@privyid/persona 0.21.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/components/accordion/Accordion.vue +1 -1
  2. package/dist/components/accordion/AccordionItem.vue +6 -6
  3. package/dist/components/badge/Badge.vue +21 -3
  4. package/dist/components/banner/Banner.vue +5 -0
  5. package/dist/components/banner/Banner.vue.d.ts +9 -0
  6. package/dist/components/button/Button.vue +18 -18
  7. package/dist/components/calendar/adapter/adapter.d.ts +1 -8
  8. package/dist/components/calendar/adapter/adapter.mjs +0 -10
  9. package/dist/components/calendar/adapter/date.mjs +2 -2
  10. package/dist/components/calendar/adapter/month.mjs +2 -2
  11. package/dist/components/card/CardSection.vue +1 -0
  12. package/dist/components/carousel/Carousel.vue.d.ts +6 -6
  13. package/dist/components/chart/ChartSet.vue.d.ts +2 -2
  14. package/dist/components/chart/ChartVal.vue.d.ts +4 -4
  15. package/dist/components/checkbox/Checkbox.vue +98 -112
  16. package/dist/components/checkbox/icon/IconCheckbox.vue +13 -0
  17. package/dist/components/checkbox/icon/IconInderteminate.vue +12 -0
  18. package/dist/components/contextual-bar/ContextualBar.vue +67 -19
  19. package/dist/components/contextual-bar/ContextualBar.vue.d.ts +3 -3
  20. package/dist/components/contextual-bar/index.d.ts +1 -1
  21. package/dist/components/cropper/Cropper.vue.d.ts +8 -8
  22. package/dist/components/datepicker/Datepicker.vue +2 -0
  23. package/dist/components/datepicker/Datepicker.vue.d.ts +1 -1
  24. package/dist/components/dialog/Dialog.vue +2 -0
  25. package/dist/components/dialog/index.d.ts +2 -0
  26. package/dist/components/divider/Divider.vue +1 -1
  27. package/dist/components/dropdown/Dropdown.vue +303 -222
  28. package/dist/components/dropzone/Dropzone.vue.d.ts +3 -3
  29. package/dist/components/filterbar/pinned/PinnedDate.vue +2 -0
  30. package/dist/components/filterbar/pinned/PinnedDate.vue.d.ts +1 -1
  31. package/dist/components/filterbar/pinned/PinnedMultiselect.vue +10 -6
  32. package/dist/components/filterbar/pinned/PinnedSelect.vue +11 -7
  33. package/dist/components/filterbar/pinned/PinnedSelect.vue.d.ts +3 -3
  34. package/dist/components/filterbar/pinned/PinnedToggle.vue.d.ts +7 -7
  35. package/dist/components/global/store.d.ts +2 -1
  36. package/dist/components/heading/Heading.vue.d.ts +1 -1
  37. package/dist/components/input/Input.vue +16 -5
  38. package/dist/components/input/Input.vue.d.ts +4 -3
  39. package/dist/components/input/index.d.ts +1 -1
  40. package/dist/components/input-file/InputFile.vue.d.ts +3 -3
  41. package/dist/components/input-pin/InputPin.vue.d.ts +2 -2
  42. package/dist/components/input-range/InputRange.vue.d.ts +6 -6
  43. package/dist/components/label/Label.vue +9 -8
  44. package/dist/components/label/Label.vue.d.ts +1 -1
  45. package/dist/components/main/Main.vue +4 -2
  46. package/dist/components/markdown/index.d.ts +6 -1
  47. package/dist/components/markdown/index.mjs +8 -2
  48. package/dist/components/meta.json +135 -0
  49. package/dist/components/modal/Modal.vue +215 -12
  50. package/dist/components/modal/Modal.vue.d.ts +55 -1
  51. package/dist/components/modal/index.d.ts +1 -1
  52. package/dist/components/nav/Nav.vue +5 -1
  53. package/dist/components/nav/NavItemDropdown.vue.d.ts +1 -1
  54. package/dist/components/nav/NavSubItem.vue +6 -6
  55. package/dist/components/navbar/Navbar.vue.d.ts +1 -1
  56. package/dist/components/navbar/NavbarBrand.vue +1 -1
  57. package/dist/components/pdf-helipad/PdfHelipad.vue +101 -85
  58. package/dist/components/pdf-helipad/utils/use-drag.d.ts +2 -7
  59. package/dist/components/pdf-helipad/utils/use-drag.mjs +1 -1
  60. package/dist/components/pdf-object/utils/use-drag.d.ts +1 -0
  61. package/dist/components/pdf-object/utils/use-drag.mjs +1 -1
  62. package/dist/components/pdf-viewer/PdfViewer.vue.d.ts +4 -4
  63. package/dist/components/progress-indicator/ProgressIndicator.vue.d.ts +2 -2
  64. package/dist/components/progressbar/Progressbar.vue.d.ts +7 -7
  65. package/dist/components/radio/Radio.vue.d.ts +4 -4
  66. package/dist/components/ringbar/Ringbar.vue.d.ts +6 -6
  67. package/dist/components/select/Select.vue +396 -214
  68. package/dist/components/select/SelectInput.vue +102 -0
  69. package/dist/components/select/SelectTags.vue +57 -0
  70. package/dist/components/select/adapter/adapter.d.ts +1 -0
  71. package/dist/components/select/adapter/async-adapter.d.ts +13 -1
  72. package/dist/components/select/adapter/async-adapter.mjs +8 -15
  73. package/dist/components/select/index.d.ts +2 -0
  74. package/dist/components/select/index.mjs +4 -1
  75. package/dist/components/sheet/Sheet.vue +2 -3
  76. package/dist/components/sidebar/Sidebar.vue +101 -116
  77. package/dist/components/sidebar/SidebarBrand.vue +1 -1
  78. package/dist/components/sidebar/SidebarContent.vue +27 -0
  79. package/dist/components/sidebar/SidebarNav.vue +60 -84
  80. package/dist/components/sidebar-menu/SidebarMenu.vue +57 -204
  81. package/dist/components/sidebar-menu/SidebarMenuItem.vue +70 -0
  82. package/dist/components/signature-text/SignatureText.vue.d.ts +4 -4
  83. package/dist/components/steps/StepSlider.vue +2 -2
  84. package/dist/components/strengthbar/Strengthbar.vue.d.ts +8 -8
  85. package/dist/components/table-flex/TableFlex.vue +3 -5
  86. package/dist/components/table-static/TableStatic.vue +118 -111
  87. package/dist/components/table-static/TableStaticRoot.vue +42 -0
  88. package/dist/components/tabs/Tab.vue +13 -15
  89. package/dist/components/tabs/TabContent.vue +64 -23
  90. package/dist/components/tabs/Tabs.vue +93 -75
  91. package/dist/components/text/Text.vue +15 -7
  92. package/dist/components/text/Text.vue.d.ts +11 -2
  93. package/dist/components/text/index.d.ts +1 -0
  94. package/dist/components/textarea/Textarea.vue.d.ts +5 -5
  95. package/dist/components/toggle/Toggle.vue +12 -1
  96. package/dist/components/toggle/Toggle.vue.d.ts +16 -7
  97. package/dist/components/tooltip/index.mjs +1 -1
  98. package/dist/components/tooltip/utils/create-handler.mjs +1 -1
  99. package/dist/components/tour/TourDialog.vue +6 -0
  100. package/dist/components/truncate/Truncate.vue +1 -1
  101. package/dist/components/truncate/Truncate.vue.d.ts +2 -2
  102. package/dist/components/utils/date.d.ts +21 -0
  103. package/dist/components/utils/date.mjs +15 -0
  104. package/dist/components/utils/vnode.mjs +1 -1
  105. package/dist/core/index.d.ts +1 -0
  106. package/dist/core/index.mjs +4 -0
  107. package/dist/module.json +1 -1
  108. package/package.json +17 -17
  109. package/dist/components/checkbox/Checkbox.vue.d.ts +0 -84
  110. package/dist/components/dropdown/Dropdown.vue.d.ts +0 -147
  111. package/dist/components/pdf-helipad/PdfHelipad.vue.d.ts +0 -45
  112. package/dist/components/select/Select.vue.d.ts +0 -157
  113. package/dist/components/sidebar/Sidebar.vue.d.ts +0 -80
  114. package/dist/components/sidebar/SidebarNav.vue.d.ts +0 -66
  115. package/dist/components/sidebar-menu/SidebarMenu.vue.d.ts +0 -91
  116. package/dist/components/tabs/Tab.vue.d.ts +0 -23
  117. package/dist/components/tabs/TabContent.vue.d.ts +0 -14
  118. package/dist/components/tabs/Tabs.vue.d.ts +0 -80
@@ -54,7 +54,7 @@ const props = defineProps({
54
54
  })
55
55
 
56
56
  const emit = defineEmits<{
57
- 'update:modelValue': [value: string],
57
+ 'update:modelValue': [string],
58
58
  }>()
59
59
 
60
60
  const modelValue = useVModel(props, 'modelValue', emit, { passive: true })
@@ -12,7 +12,7 @@
12
12
  class="accordion__item__activator"
13
13
  data-testid="accordion-item-activator"
14
14
  @click="toggle">
15
- <Subheading>
15
+ <Subheading class="accordion__item__title">
16
16
  {{ title }}
17
17
  </Subheading>
18
18
  <slot
@@ -74,11 +74,11 @@ const props = defineProps({
74
74
  default: false,
75
75
  },
76
76
  })
77
- const emit = defineEmits([
78
- 'update:modelValue',
79
- 'expand',
80
- 'collapse',
81
- ])
77
+ const emit = defineEmits<{
78
+ 'update:modelValue': [boolean],
79
+ 'expand': [],
80
+ 'collapse': [],
81
+ }>()
82
82
 
83
83
  const model = useVModel(props, 'modelValue', emit, { passive: true })
84
84
 
@@ -51,7 +51,17 @@ export default defineComponent({
51
51
  --p-color-primary-light: lighten(theme(colors.brand.accent), 40%);
52
52
  --p-color-dark-primary-light: darken(theme(colors.dark.brand.accent), 40%);
53
53
 
54
- @apply inline-block font-bold text-xs px-2 py-0.5 text-state-emphasis dark:text-dark-state-emphasis rounded-full;
54
+ @apply inline-block font-bold text-xs px-2 py-0.5 rounded-full space-x-1 align-middle;
55
+
56
+ > .persona-icon,
57
+ > svg {
58
+ @apply inline-block;
59
+ }
60
+
61
+ &:not(&--variant-default&--default) {
62
+ @apply text-state-emphasis;
63
+ @apply dark:text-dark-state-emphasis
64
+ }
55
65
 
56
66
  /**
57
67
  * Provide colors variant
@@ -64,8 +74,16 @@ export default defineComponent({
64
74
  &--default {
65
75
  --p-bg-variant-default: theme(backgroundColor.inverse);
66
76
  --p-bg-dark-variant-default: theme(backgroundColor.dark.inverse);
67
- @apply bg-[color:var(--p-bg-variant-default)];
68
- @apply dark:bg-[color:var(--p-bg-dark-variant-default)] dark:text-dark-on-emphasis;
77
+
78
+ &:not([class^='bg-'], [class*='bg-']) {
79
+ @apply bg-[color:var(--p-bg-variant-default)];
80
+ @apply dark:bg-[color:var(--p-bg-dark-variant-default)];
81
+ }
82
+
83
+ &:not([class^='text-'], [class*='text-']) {
84
+ @apply text-state-emphasis;
85
+ @apply dark:text-dark-state-emphasis dark:text-dark-on-emphasis;
86
+ }
69
87
  }
70
88
 
71
89
  &--primary {
@@ -4,6 +4,7 @@
4
4
  data-testid="banner"
5
5
  :class="classNames">
6
6
  <div
7
+ v-if="!noIcon"
7
8
  class="banner__icon"
8
9
  data-testid="banner-icon"
9
10
  :class="{ 'banner__icon--custom' : $slots.icon }">
@@ -53,6 +54,10 @@ export default defineComponent({
53
54
  dismissable: {
54
55
  type: Boolean,
55
56
  default: true
57
+ },
58
+ noIcon: {
59
+ type: Boolean,
60
+ default: false
56
61
  }
57
62
  },
58
63
  emits: ["dismissed"],
@@ -9,6 +9,10 @@ declare const _default: import("vue-demi").DefineComponent<{
9
9
  type: BooleanConstructor;
10
10
  default: boolean;
11
11
  };
12
+ noIcon: {
13
+ type: BooleanConstructor;
14
+ default: boolean;
15
+ };
12
16
  }, {
13
17
  classNames: import("vue-demi").ComputedRef<string[]>;
14
18
  show: import("vue-demi").Ref<boolean>;
@@ -23,10 +27,15 @@ declare const _default: import("vue-demi").DefineComponent<{
23
27
  type: BooleanConstructor;
24
28
  default: boolean;
25
29
  };
30
+ noIcon: {
31
+ type: BooleanConstructor;
32
+ default: boolean;
33
+ };
26
34
  }>> & {
27
35
  onDismissed?: ((...args: any[]) => any) | undefined;
28
36
  }, {
29
37
  variant: StyleVariant;
30
38
  dismissable: boolean;
39
+ noIcon: boolean;
31
40
  }, {}>;
32
41
  export default _default;
@@ -116,10 +116,10 @@ const tagName = computed(() => {
116
116
  * Last Update : Nov 21, 2022
117
117
  */
118
118
  .btn {
119
- --p-color-primary-hover: darken(theme(colors.brand.accent), 5%);
120
- --p-color-dark-primary-hover: darken(theme(colors.dark.brand.accent), 5%);
121
- --p-color-primary-focus: darken(theme(colors.brand.accent), 10%);
122
- --p-color-dark-primary-focus: darken(theme(colors.dark.brand.accent), 10%);
119
+ --p-color-primary-hover: darken(theme(colors.brand.action), 5%);
120
+ --p-color-dark-primary-hover: darken(theme(colors.dark.brand.action), 5%);
121
+ --p-color-primary-focus: darken(theme(colors.brand.action), 10%);
122
+ --p-color-dark-primary-focus: darken(theme(colors.dark.brand.action), 10%);
123
123
  --p-color-info-hover: darken(theme(backgroundColor.info.emphasis), 5%);
124
124
  --p-color-dark-info-hover: darken(theme(backgroundColor.dark.info.emphasis), 5%);
125
125
  --p-color-info-focus: darken(theme(backgroundColor.info.emphasis), 10%);
@@ -181,13 +181,13 @@ const tagName = computed(() => {
181
181
 
182
182
  &.btn {
183
183
  &--default {
184
- @apply bg-default-alpha focus:bg-subtle-alpha active:bg-subtle-alpha text-subtle hover:text-default focus:text-default;
185
- @apply dark:bg-dark-default-alpha focus:dark:bg-dark-subtle-alpha active:dark:bg-dark-subtle-alpha dark:text-dark-subtle hover:dark:text-dark-default focus:dark:text-dark-default;
184
+ @apply bg-default-alpha focus:bg-subtle-alpha active:bg-subtle-alpha hover:text-default focus:text-default;
185
+ @apply dark:bg-dark-default-alpha focus:dark:bg-dark-subtle-alpha active:dark:bg-dark-subtle-alpha hover:dark:text-dark-default focus:dark:text-dark-default;
186
186
  }
187
187
 
188
188
  &--primary {
189
- @apply bg-brand-accent hover:bg-[color:var(--p-color-primary-hover)] focus:bg-[color:var(--p-color-primary-focus)] active:bg-[color:var(--p-color-primary-focus)];
190
- @apply dark:bg-dark-brand-accent hover:dark:bg-[color:var(--p-color-dark-primary-hover)] focus:dark:bg-[color:var(--p-color-dark-primary-focus)] active:dark:bg-[color:var(--p-color-dark-primary-focus)];
189
+ @apply bg-brand-action hover:bg-[color:var(--p-color-primary-hover)] focus:bg-[color:var(--p-color-primary-focus)] active:bg-[color:var(--p-color-primary-focus)];
190
+ @apply dark:bg-dark-brand-action hover:dark:bg-[color:var(--p-color-dark-primary-hover)] focus:dark:bg-[color:var(--p-color-dark-primary-focus)] active:dark:bg-[color:var(--p-color-dark-primary-focus)];
191
191
  }
192
192
 
193
193
  &--info {
@@ -214,8 +214,8 @@ const tagName = computed(() => {
214
214
 
215
215
  &&--variant-outline,
216
216
  &&--variant-ghost {
217
- @apply border border-solid text-subtle hover:text-default hover:shadow-lg focus:shadow-none active:shadow-none focus:text-default active:text-default;
218
- @apply dark:text-dark-subtle hover:dark:text-dark-default focus:dark:text-dark-default active:dark:text-dark-default;
217
+ @apply border border-solid text-default hover:text-default hover:shadow-lg focus:shadow-none active:shadow-none focus:text-default active:text-default;
218
+ @apply dark:text-dark-default hover:dark:text-dark-default focus:dark:text-dark-default active:dark:text-dark-default;
219
219
  }
220
220
 
221
221
  /**
@@ -228,13 +228,13 @@ const tagName = computed(() => {
228
228
  &&--variant-outline {
229
229
  &.btn {
230
230
  &--default {
231
- @apply border-default-alpha hover:border-subtle-alpha active:border-subtle-alpha focus:border-subtle-alpha;
232
- @apply dark:border-dark-default-alpha hover:dark:border-dark-subtle-alpha active:dark:border-dark-subtle-alpha focus:dark:border-dark-subtle-alpha;
231
+ @apply text-default border-default-alpha hover:border-subtle-alpha active:border-subtle-alpha focus:border-subtle-alpha;
232
+ @apply dark:text-dark-default dark:border-dark-default-alpha hover:dark:border-dark-subtle-alpha active:dark:border-dark-subtle-alpha focus:dark:border-dark-subtle-alpha;
233
233
  }
234
234
 
235
235
  &--primary {
236
- @apply border-brand-accent hover:border-[color:var(--p-color-primary-hover)] focus:border-[color:var(--p-color-primary-focus)] active:border-[color:var(--p-color-primary-focus)];
237
- @apply dark:border-dark-brand-accent hover:dark:border-[color:var(--p-color-dark-primary-hover)] focus:dark:border-[color:var(--p-color-dark-primary-focus)] active:dark:border-[color:var(--p-color-dark-primary-focus)];
236
+ @apply border-brand-action hover:border-[color:var(--p-color-primary-hover)] focus:border-[color:var(--p-color-primary-focus)] active:border-[color:var(--p-color-primary-focus)];
237
+ @apply dark:border-dark-brand-action border-brand-action hover:dark:border-[color:var(--p-color-dark-primary-hover)] focus:dark:border-[color:var(--p-color-dark-primary-focus)] active:dark:border-[color:var(--p-color-dark-primary-focus)];
238
238
  }
239
239
 
240
240
  &--info {
@@ -276,13 +276,13 @@ const tagName = computed(() => {
276
276
 
277
277
  &.btn {
278
278
  &--default {
279
- @apply text-subtle hover:text-default focus:text-default active:text-default ;
280
- @apply dark:text-dark-subtle hover:dark:text-dark-default focus:dark:text-dark-default active:dark:text-dark-default;
279
+ @apply text-default hover:text-default focus:text-default active:text-default ;
280
+ @apply dark:text-dark-default hover:dark:text-dark-default focus:dark:text-dark-default active:dark:text-dark-default;
281
281
  }
282
282
 
283
283
  &--primary {
284
- @apply text-brand-accent hover:text-[color:var(--p-color-primary-hover)] focus:text-[color:var(--p-color-primary-focus)] active:text-[color:var(--p-color-primary-focus)];
285
- @apply dark:text-dark-brand-accent hover:dark:text-[color:var(--p-color-dark-primary-hover)] focus:dark:text-[color:var(--p-color-dark-primary-focus)] active:dark:text-[color:var(--p-color-dark-primary-focus)];
284
+ @apply text-brand-action hover:text-[color:var(--p-color-primary-hover)] focus:text-[color:var(--p-color-primary-focus)] active:text-[color:var(--p-color-primary-focus)];
285
+ @apply dark:text-dark-brand-action hover:dark:text-[color:var(--p-color-dark-primary-hover)] focus:dark:text-[color:var(--p-color-dark-primary-focus)] active:dark:text-[color:var(--p-color-dark-primary-focus)];
286
286
  }
287
287
 
288
288
  &--info {
@@ -1,5 +1,5 @@
1
1
  import { Ref } from 'vue-demi';
2
- import { Duration } from 'date-fns';
2
+ import { type Duration } from 'date-fns';
3
3
  export interface CalendarItem {
4
4
  value: Date;
5
5
  text: string;
@@ -27,12 +27,5 @@ export interface CalendarAdapter {
27
27
  export declare const CalendarFormat: readonly ["date", "month", "year"];
28
28
  export type CalendarMode = typeof CalendarFormat[number];
29
29
  export declare function defineAdapter(adapter: CalendarAdapter): CalendarAdapter;
30
- /**
31
- * Format date using date-fns/format,
32
- * Automatically switch local following global lang setting.
33
- * @param date Date
34
- * @param formatStr date format
35
- */
36
- export declare function formatDate(date: Date, formatStr: string): string;
37
30
  export declare function validateDuration(duration?: string): boolean;
38
31
  export declare function parseDuration(duration?: string): Duration | undefined;
@@ -1,11 +1,4 @@
1
- import {
2
- format
3
- } from "date-fns";
4
- import id from "date-fns/locale/id/index";
5
- import en from "date-fns/locale/en-US/index";
6
- import { getLang } from "../../global/store.mjs";
7
1
  import { chunk } from "lodash-es";
8
- const localePacks = { en, id };
9
2
  export const CalendarFormat = [
10
3
  "date",
11
4
  "month",
@@ -14,9 +7,6 @@ export const CalendarFormat = [
14
7
  export function defineAdapter(adapter) {
15
8
  return adapter;
16
9
  }
17
- export function formatDate(date, formatStr) {
18
- return format(date, formatStr, { locale: localePacks[getLang()] });
19
- }
20
10
  const DURATION_SUFFIX = {
21
11
  Y: "years",
22
12
  y: "years",
@@ -13,9 +13,9 @@ import {
13
13
  isWithinInterval
14
14
  } from "date-fns";
15
15
  import {
16
- defineAdapter,
17
- formatDate
16
+ defineAdapter
18
17
  } from "./adapter.mjs";
18
+ import { formatDate } from "../../utils/date.mjs";
19
19
  function getInterval(date) {
20
20
  const start = startOfWeek(startOfMonth(date), { weekStartsOn: 1 });
21
21
  const end = endOfWeek(endOfMonth(date), { weekStartsOn: 1 });
@@ -10,9 +10,9 @@ import {
10
10
  subYears
11
11
  } from "date-fns";
12
12
  import {
13
- defineAdapter,
14
- formatDate
13
+ defineAdapter
15
14
  } from "./adapter.mjs";
15
+ import { formatDate } from "../../utils/date.mjs";
16
16
  function getInterval(date) {
17
17
  const start = startOfYear(date);
18
18
  const end = endOfYear(date);
@@ -13,6 +13,7 @@
13
13
  v-else-if="title"
14
14
  class="card__header card__header--default">
15
15
  <Subheading
16
+ class="card__header__title"
16
17
  weight="medium"
17
18
  overline>
18
19
  {{ title }}
@@ -17,11 +17,11 @@ declare const _default: import("vue-demi").DefineComponent<{
17
17
  default: string;
18
18
  };
19
19
  width: {
20
- type: (NumberConstructor | StringConstructor)[];
20
+ type: (StringConstructor | NumberConstructor)[];
21
21
  default: string;
22
22
  };
23
23
  height: {
24
- type: (NumberConstructor | StringConstructor)[];
24
+ type: (StringConstructor | NumberConstructor)[];
25
25
  default: string;
26
26
  };
27
27
  loop: {
@@ -33,7 +33,7 @@ declare const _default: import("vue-demi").DefineComponent<{
33
33
  default: boolean;
34
34
  };
35
35
  autoplayInterval: {
36
- type: (NumberConstructor | StringConstructor)[];
36
+ type: (StringConstructor | NumberConstructor)[];
37
37
  default: number;
38
38
  };
39
39
  splideOptions: {
@@ -66,11 +66,11 @@ declare const _default: import("vue-demi").DefineComponent<{
66
66
  default: string;
67
67
  };
68
68
  width: {
69
- type: (NumberConstructor | StringConstructor)[];
69
+ type: (StringConstructor | NumberConstructor)[];
70
70
  default: string;
71
71
  };
72
72
  height: {
73
- type: (NumberConstructor | StringConstructor)[];
73
+ type: (StringConstructor | NumberConstructor)[];
74
74
  default: string;
75
75
  };
76
76
  loop: {
@@ -82,7 +82,7 @@ declare const _default: import("vue-demi").DefineComponent<{
82
82
  default: boolean;
83
83
  };
84
84
  autoplayInterval: {
85
- type: (NumberConstructor | StringConstructor)[];
85
+ type: (StringConstructor | NumberConstructor)[];
86
86
  default: number;
87
87
  };
88
88
  splideOptions: {
@@ -1,11 +1,11 @@
1
1
  declare const _default: import("vue-demi").DefineComponent<{
2
2
  name: {
3
- type: (NumberConstructor | StringConstructor)[];
3
+ type: (StringConstructor | NumberConstructor)[];
4
4
  required: true;
5
5
  };
6
6
  }, unknown, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {}, string, import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
7
7
  name: {
8
- type: (NumberConstructor | StringConstructor)[];
8
+ type: (StringConstructor | NumberConstructor)[];
9
9
  required: true;
10
10
  };
11
11
  }>>, {}, {}>;
@@ -1,10 +1,10 @@
1
1
  declare const _default: import("vue-demi").DefineComponent<{
2
2
  name: {
3
- type: (NumberConstructor | StringConstructor)[];
3
+ type: (StringConstructor | NumberConstructor)[];
4
4
  required: true;
5
5
  };
6
6
  value: {
7
- type: (NumberConstructor | StringConstructor)[];
7
+ type: (StringConstructor | NumberConstructor)[];
8
8
  required: true;
9
9
  };
10
10
  color: {
@@ -13,11 +13,11 @@ declare const _default: import("vue-demi").DefineComponent<{
13
13
  };
14
14
  }, unknown, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {}, string, import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
15
15
  name: {
16
- type: (NumberConstructor | StringConstructor)[];
16
+ type: (StringConstructor | NumberConstructor)[];
17
17
  required: true;
18
18
  };
19
19
  value: {
20
- type: (NumberConstructor | StringConstructor)[];
20
+ type: (StringConstructor | NumberConstructor)[];
21
21
  required: true;
22
22
  };
23
23
  color: {
@@ -6,31 +6,8 @@
6
6
  @click.prevent="toggle">
7
7
  <span class="checkbox__icon">
8
8
  <!-- checked icon -->
9
- <template v-if="indeterminate">
10
- <svg
11
- width="10"
12
- height="10"
13
- viewBox="0 0 14 2"
14
- fill="none"
15
- xmlns="http://www.w3.org/2000/svg">
16
- <rect
17
- width="14"
18
- height="2" />
19
- </svg>
20
- </template>
21
- <template v-else>
22
- <svg
23
- width="10"
24
- height="10"
25
- viewBox="0 0 14 10"
26
- fill="none"
27
- xmlns="http://www.w3.org/2000/svg">
28
- <path
29
- fill-rule="evenodd"
30
- clip-rule="evenodd"
31
- d="M3.81581 8.48528L5.23002 9.8995L6.64423 8.48528L13.7153 1.41421L12.3011 0L5.23002 7.07107L1.69449 3.53553L0.280273 4.94975L3.81581 8.48528Z" />
32
- </svg>
33
- </template>
9
+ <icon-inderteminate v-if="indeterminate" />
10
+ <icon-checkbox v-else />
34
11
  </span>
35
12
  <span class="checkbox__label">
36
13
  <slot />
@@ -44,95 +21,104 @@
44
21
  </label>
45
22
  </template>
46
23
 
47
- <script>
48
- import { useVModel } from ".";
49
- import { computed, defineComponent } from "vue-demi";
50
- export default defineComponent({
51
- props: {
52
- name: {
53
- type: String,
54
- default: void 0
55
- },
56
- modelValue: {
57
- type: [
58
- String,
59
- Number,
60
- Boolean,
61
- Array,
62
- Object,
63
- Date
64
- ],
65
- default: false
66
- },
67
- value: {
68
- type: [
69
- String,
70
- Number,
71
- Boolean,
72
- Array,
73
- Object,
74
- Date
75
- ],
76
- default: true
77
- },
78
- uncheckedValue: {
79
- type: [
80
- String,
81
- Number,
82
- Boolean,
83
- Array,
84
- Object,
85
- Date
86
- ],
87
- default: false
88
- },
89
- checked: {
90
- type: Boolean,
91
- default: false
92
- },
93
- readonly: {
94
- type: Boolean,
95
- default: false
96
- },
97
- disabled: {
98
- type: Boolean,
99
- default: false
100
- },
101
- indeterminate: {
102
- type: Boolean,
103
- default: false
104
- }
105
- },
24
+ <script lang="ts" setup>
25
+ import { useVModel } from '.'
26
+ import { computed } from 'vue-demi'
27
+ import IconCheckbox from './icon/IconCheckbox.vue'
28
+ import IconInderteminate from './icon/IconInderteminate.vue'
29
+
30
+ defineOptions({
106
31
  models: {
107
- prop: "modelValue",
108
- event: "update:modelValue"
32
+ prop : 'modelValue',
33
+ event: 'update:modelValue',
109
34
  },
110
- emits: ["change", "update:modelValue"],
111
- setup(props) {
112
- const model = useVModel(props);
113
- const classNames = computed(() => {
114
- const result = [];
115
- if (model.value)
116
- result.push("checkbox--checked");
117
- if (props.indeterminate)
118
- result.push("checkbox--indeterminate");
119
- if (props.disabled)
120
- result.push("checkbox--disabled");
121
- if (props.readonly)
122
- result.push("checkbox--readonly");
123
- return result;
124
- });
125
- function toggle() {
126
- if (!props.readonly && !props.disabled)
127
- model.value = !model.value;
128
- }
129
- return {
130
- model,
131
- classNames,
132
- toggle
133
- };
134
- }
135
- });
35
+ })
36
+
37
+ const props = defineProps({
38
+ name: {
39
+ type : String,
40
+ default: undefined,
41
+ },
42
+ modelValue: {
43
+ type: [
44
+ String,
45
+ Number,
46
+ Boolean,
47
+ Array,
48
+ Object,
49
+ Date,
50
+ ],
51
+ default: false,
52
+ },
53
+ value: {
54
+ type: [
55
+ String,
56
+ Number,
57
+ Boolean,
58
+ Array,
59
+ Object,
60
+ Date,
61
+ ],
62
+ default: true,
63
+ },
64
+ uncheckedValue: {
65
+ type: [
66
+ String,
67
+ Number,
68
+ Boolean,
69
+ Array,
70
+ Object,
71
+ Date,
72
+ ],
73
+ default: false,
74
+ },
75
+ checked: {
76
+ type : Boolean,
77
+ default: false,
78
+ },
79
+ readonly: {
80
+ type : Boolean,
81
+ default: false,
82
+ },
83
+ disabled: {
84
+ type : Boolean,
85
+ default: false,
86
+ },
87
+ indeterminate: {
88
+ type : Boolean,
89
+ default: false,
90
+ },
91
+ })
92
+
93
+ defineEmits<{
94
+ 'change': [boolean],
95
+ 'update:modelValue': [unknown],
96
+ }>()
97
+
98
+ const model = useVModel(props)
99
+
100
+ const classNames = computed(() => {
101
+ const result: string[] = []
102
+
103
+ if (model.value)
104
+ result.push('checkbox--checked')
105
+
106
+ if (props.indeterminate)
107
+ result.push('checkbox--indeterminate')
108
+
109
+ if (props.disabled)
110
+ result.push('checkbox--disabled')
111
+
112
+ if (props.readonly)
113
+ result.push('checkbox--readonly')
114
+
115
+ return result
116
+ })
117
+
118
+ function toggle () {
119
+ if (!props.readonly && !props.disabled)
120
+ model.value = !model.value
121
+ }
136
122
  </script>
137
123
 
138
124
  <style lang="postcss">
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <svg
3
+ width="10"
4
+ height="10"
5
+ viewBox="0 0 14 10"
6
+ fill="none"
7
+ xmlns="http://www.w3.org/2000/svg">
8
+ <path
9
+ fill-rule="evenodd"
10
+ clip-rule="evenodd"
11
+ d="M3.81581 8.48528L5.23002 9.8995L6.64423 8.48528L13.7153 1.41421L12.3011 0L5.23002 7.07107L1.69449 3.53553L0.280273 4.94975L3.81581 8.48528Z" />
12
+ </svg>
13
+ </template>
@@ -0,0 +1,12 @@
1
+ <template>
2
+ <svg
3
+ width="10"
4
+ height="10"
5
+ viewBox="0 0 14 2"
6
+ fill="none"
7
+ xmlns="http://www.w3.org/2000/svg">
8
+ <rect
9
+ width="14"
10
+ height="2" />
11
+ </svg>
12
+ </template>