Skip to content

Commit

Permalink
fix(types): include json files in declaration + rename color type (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
bnjm authored Aug 17, 2023
1 parent ddd1f42 commit 6877d81
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/colors/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import colorMap from './colorMap.json'

export type Colors = keyof typeof colorMap
export type Color = keyof typeof colorMap

export { colorMap }
6 changes: 3 additions & 3 deletions src/components/ColorCircle.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { computed, defineComponent, PropType } from 'vue'
import { type Colors, colorMap } from '../colors'
import { type Color, colorMap } from '../colors'
export default defineComponent({
name: 'AColorCircle',
Expand All @@ -9,11 +9,11 @@ export default defineComponent({
* fill color of the circle
*/
color: {
type: String as PropType<Colors>,
type: String as PropType<Color>,
default: ''
},
borderColor: {
type: String as PropType<Colors>,
type: String as PropType<Color>,
default: ''
},
/**
Expand Down
4 changes: 2 additions & 2 deletions src/components/Option.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { computed, defineComponent, PropType } from 'vue'
import { ListboxOption, ComboboxOption } from '@headlessui/vue'
import ACheckbox from './Checkbox.vue'
import AColorCircle from './ColorCircle.vue'
import { type Colors } from '../colors'
import { type Color } from '../colors'
export type Option = {
value: string
label: string
disabled?: boolean
color?: Colors
color?: Color
}
export default defineComponent({
Expand Down
4 changes: 2 additions & 2 deletions src/components/Tag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { defineComponent, computed, PropType } from 'vue'
import AIcon from './Icon.vue'
import AColorCircle from './ColorCircle.vue'
import type { Colors } from '../colors'
import type { Color } from '../colors'
export default defineComponent({
name: 'ATag',
Expand All @@ -27,7 +27,7 @@ export default defineComponent({
* produces an optional color circle
*/
color: {
type: String as PropType<Colors>,
type: String as PropType<Color>,
default: ''
},
/**
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.json",
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "dist", "src/**/*.stories.ts", "src/**/*.test.ts"],
"include": ["src/**/*"],
"exclude": ["src/**/*.stories.ts", "src/**/*.test.ts"],
"compilerOptions": {
"rootDir": "src"
}
Expand Down

0 comments on commit 6877d81

Please sign in to comment.