@privyid/persona 0.17.0 → 0.18.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 (95) hide show
  1. package/dist/components/avatar/utils/create-image.mjs +1 -1
  2. package/dist/components/banner/Banner.vue +3 -3
  3. package/dist/components/breadcrumbs/BreadcrumbItem.vue +1 -1
  4. package/dist/components/breadcrumbs/BreadcrumbItemDropdown.vue +1 -1
  5. package/dist/components/button/Button.vue +24 -11
  6. package/dist/components/button/Button.vue.d.ts +17 -7
  7. package/dist/components/button/index.d.ts +1 -0
  8. package/dist/components/calendar/Calendar.vue +8 -4
  9. package/dist/components/camera/Camera.vue +3 -3
  10. package/dist/components/card/Card.vue +9 -3
  11. package/dist/components/checkbox/index.mjs +1 -1
  12. package/dist/components/collapse/Collapse.vue +12 -1
  13. package/dist/components/contextual-bar/ContextualBar.vue +1 -1
  14. package/dist/components/cropper/Cropper.vue +4 -4
  15. package/dist/components/datepicker/Datepicker.vue +19 -4
  16. package/dist/components/datepicker/Datepicker.vue.d.ts +10 -0
  17. package/dist/components/dropdown/Dropdown.vue +13 -7
  18. package/dist/components/dropdown/Dropdown.vue.d.ts +1 -0
  19. package/dist/components/dropdown/DropdownItem.vue +10 -0
  20. package/dist/components/dropdown/DropdownItem.vue.d.ts +9 -0
  21. package/dist/components/dropdown/utils/use-focus.d.ts +1 -1
  22. package/dist/components/dropdown/utils/use-focus.mjs +2 -2
  23. package/dist/components/dropdown-subitem/DropdownSubitem.vue +2 -2
  24. package/dist/components/filterbar/pinned/PinnedDate.vue +4 -7
  25. package/dist/components/filterbar/pinned/PinnedMultiselect.vue +4 -7
  26. package/dist/components/filterbar/pinned/PinnedSelect.vue +5 -7
  27. package/dist/components/form-group/FormGroup.vue +1 -1
  28. package/dist/components/global/router.d.ts +2 -1
  29. package/dist/components/input/Input.vue +22 -4
  30. package/dist/components/input/Input.vue.d.ts +20 -0
  31. package/dist/components/input/index.d.ts +1 -0
  32. package/dist/components/input/index.mjs +5 -0
  33. package/dist/components/input/utils/accept.d.ts +26 -0
  34. package/dist/components/input/utils/accept.mjs +81 -0
  35. package/dist/components/input-file/InputFile.vue.d.ts +1 -1
  36. package/dist/components/input-password/InputPassword.vue +4 -1
  37. package/dist/components/input-password/InputPassword.vue.d.ts +7 -3
  38. package/dist/components/input-pin/InputPin.vue +45 -30
  39. package/dist/components/input-pin/InputPin.vue.d.ts +24 -5
  40. package/dist/components/input-pin/index.d.ts +6 -0
  41. package/dist/components/input-pin/index.mjs +3 -0
  42. package/dist/components/input-range/InputRange.vue +5 -5
  43. package/dist/components/label/Label.vue +1 -1
  44. package/dist/components/list-group/ListGroup.vue +25 -0
  45. package/dist/components/list-group/ListGroup.vue.d.ts +18 -0
  46. package/dist/components/main/Main.vue +44 -44
  47. package/dist/components/modal/Modal.vue +5 -2
  48. package/dist/components/nav/NavItem.vue +19 -6
  49. package/dist/components/nav/NavItem.vue.d.ts +6 -3
  50. package/dist/components/navbar/NavbarToggle.vue +2 -2
  51. package/dist/components/pagination/Pagination.vue +2 -2
  52. package/dist/components/pagination/Pagination.vue.d.ts +1 -1
  53. package/dist/components/pdf-object/PdfObject.vue.d.ts +2 -2
  54. package/dist/components/pdf-viewer/PdfNavigation.vue +4 -4
  55. package/dist/components/pdf-viewer/PdfViewer.vue +1 -2
  56. package/dist/components/pdf-viewer/PdfViewer.vue.d.ts +2 -2
  57. package/dist/components/radio/Radio.vue +1 -1
  58. package/dist/components/select/Select.vue +60 -30
  59. package/dist/components/select/Select.vue.d.ts +21 -3
  60. package/dist/components/select/index.d.ts +2 -0
  61. package/dist/components/select/index.mjs +4 -0
  62. package/dist/components/sidebar/SidebarNav.vue +2 -0
  63. package/dist/components/sidebar-menu/SidebarMenu.vue +68 -48
  64. package/dist/components/sidebar-menu/index.d.ts +95 -2
  65. package/dist/components/sidebar-menu/index.mjs +41 -0
  66. package/dist/components/signature-draw/SignatureDrawMobile.vue +3 -7
  67. package/dist/components/spinner/Spinner.vue +28 -12
  68. package/dist/components/spinner/SpinnerRing.vue +14 -7
  69. package/dist/components/spinner/SpinnerRinggo.vue +62 -0
  70. package/dist/components/spinner/SpinnerRinggo.vue.d.ts +6 -0
  71. package/dist/components/steps/Step.vue +3 -0
  72. package/dist/components/steps/Step.vue.d.ts +1 -0
  73. package/dist/components/steps/Steps.vue +1 -0
  74. package/dist/components/steps/index.d.ts +2 -0
  75. package/dist/components/steps/index.mjs +1 -0
  76. package/dist/components/table/Table.vue +2 -2
  77. package/dist/components/tabs/Tabs.vue +4 -2
  78. package/dist/components/textarea/Textarea.vue +10 -1
  79. package/dist/components/textarea/Textarea.vue.d.ts +12 -0
  80. package/dist/components/toast/Toast.vue +5 -5
  81. package/dist/components/toast/ToastContainer.vue +6 -6
  82. package/dist/components/toggle/Toggle.vue +1 -1
  83. package/dist/components/tooltip/TooltipContainer.vue +18 -3
  84. package/dist/components/tooltip/index.d.ts +3 -0
  85. package/dist/components/tooltip/index.mjs +29 -4
  86. package/dist/components/tooltip/utils/parse-bindings.d.ts +2 -1
  87. package/dist/components/tooltip/utils/parse-bindings.mjs +2 -0
  88. package/dist/components/tour/TourDialog.vue +1 -1
  89. package/dist/components/truncate/Truncate.vue +9 -1
  90. package/dist/components/truncate/Truncate.vue.d.ts +9 -0
  91. package/dist/core/index.d.ts +2 -1
  92. package/dist/core/index.mjs +7 -1
  93. package/dist/module.json +1 -1
  94. package/dist/module.mjs +1 -1
  95. package/package.json +14 -14
@@ -4,7 +4,7 @@ export function createText(text, size, bgColor, textColor) {
4
4
  return `data:image/svg+xml,<svg height="${size}" width="${size}" xmlns="http://www.w3.org/2000/svg"><rect fill="${encodeURIComponent(bgColor)}" x="0" y="0" height="${size}" width="${size}"></rect><text fill="${encodeURIComponent(textColor)}" dominant-baseline="central" text-anchor="middle" x="50%" y="50%" font-family="sans-serif" font-weight="600">${encodeURIComponent(text)}</text></svg>`;
5
5
  }
6
6
  export function createSpinner(width = 50, height = width) {
7
- return `data:image/svg+xml,<svg class="lds-spinner" width="${width}" height="${height}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" style="background:0 0"><rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="%23ebecf0"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.9166666666666666s" repeatCount="indefinite"/></rect><rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="%23ebecf0" transform="rotate(30 50 50)"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.8333333333333334s" repeatCount="indefinite"/></rect><rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="%23ebecf0" transform="rotate(60 50 50)"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.75s" repeatCount="indefinite"/></rect><rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="%23ebecf0" transform="rotate(90 50 50)"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.6666666666666666s" repeatCount="indefinite"/></rect><rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="%23ebecf0" transform="rotate(120 50 50)"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.5833333333333334s" repeatCount="indefinite"/></rect><rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="%23ebecf0" transform="rotate(150 50 50)"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.5s" repeatCount="indefinite"/></rect><rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="%23ebecf0" transform="rotate(180 50 50)"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.4166666666666667s" repeatCount="indefinite"/></rect><rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="%23ebecf0" transform="rotate(210 50 50)"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.3333333333333333s" repeatCount="indefinite"/></rect><rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="%23ebecf0" transform="rotate(240 50 50)"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.25s" repeatCount="indefinite"/></rect><rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="%23ebecf0" transform="rotate(270 50 50)"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.16666666666666666s" repeatCount="indefinite"/></rect><rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="%23ebecf0" transform="rotate(300 50 50)"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.08333333333333333s" repeatCount="indefinite"/></rect><rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="%23ebecf0" transform="rotate(330 50 50)"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="0s" repeatCount="indefinite"/></rect></svg>`;
7
+ return `data:image/svg+xml,<svg v-once data-testid="spinner" class="spinner spinner-basic" width="${width}" height="${height}" viewBox="0 0 19 19" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><rect class="spinner-basic__bar" x="8.125" width="2.5" height="6.25" rx="1.25" fill="currentColor" fill-opacity="60%"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="0" repeatCount="indefinite" /></rect><rect class="spinner-basic__bar" x="15.1202" y="1.86199" width="2.5" height="6.25" rx="1.25" transform="rotate(45 15.1202 1.86199)" fill="currentColor" fill-opacity="60%"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="0.125s" repeatCount="indefinite" /></rect><rect class="spinner-basic__bar" x="18.75" y="8.125" width="2.5" height="6.25" rx="1.25" transform="rotate(90 18.75 8.125)" fill="currentColor" fill-opacity="60%"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="0.250s" repeatCount="indefinite" /></rect><rect class="spinner-basic__bar" x="16.888" y="15.1202" width="2.5" height="6.25" rx="1.25" transform="rotate(135 16.888 15.1202)" fill="currentColor" fill-opacity="60%"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="0.375s" repeatCount="indefinite" /></rect><rect class="spinner-basic__bar" x="8.125" y="12.5" width="2.5" height="6.25" rx="1.25" fill="currentColor" fill-opacity="60%"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="0.500s" repeatCount="indefinite" /></rect><rect class="spinner-basic__bar" x="6.2814" y="10.7008" width="2.5" height="6.25" rx="1.25" transform="rotate(45 6.2814 10.7008)" fill="currentColor" fill-opacity="60%"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="0.625s" repeatCount="indefinite" /></rect><rect class="spinner-basic__bar" x="6.25" y="8.125" width="2.5" height="6.25" rx="1.25" transform="rotate(90 6.25 8.125)" fill="currentColor" fill-opacity="60%"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="0.750s" repeatCount="indefinite" /></rect><rect class="spinner-basic__bar" x="8.04917" y="6.2814" width="2.5" height="6.25" rx="1.25" transform="rotate(135 8.04917 6.2814)" fill="currentColor" fill-opacity="60%"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="0.875s" repeatCount="indefinite" /></rect></svg>`;
8
8
  }
9
9
  export function getAlias(name) {
10
10
  return name.split(" ").slice(0, 2).map((c) => c.at(0)).join("").toUpperCase();
@@ -27,9 +27,9 @@
27
27
  </template>
28
28
 
29
29
  <script>
30
- import IconInfo from "@carbon/icons-vue/lib/information--filled/20";
31
- import IconDanger from "@carbon/icons-vue/lib/warning--filled/20";
32
- import IconClose from "@carbon/icons-vue/lib/close/16";
30
+ import IconInfo from "@privyid/persona-icon/vue/information-circle-solid/20.vue";
31
+ import IconDanger from "@privyid/persona-icon/vue/exclamation-circle-solid/20.vue";
32
+ import IconClose from "@privyid/persona-icon/vue/close/16.vue";
33
33
  import {
34
34
  defineComponent,
35
35
  ref,
@@ -17,7 +17,7 @@
17
17
 
18
18
  <script>
19
19
  import { defineComponent, computed } from "vue-demi";
20
- import IconChevron from "@carbon/icons-vue/lib/chevron--right/16";
20
+ import IconChevron from "@privyid/persona-icon/vue/chevron-right/20.vue";
21
21
  export default defineComponent({
22
22
  components: { IconChevron },
23
23
  props: {
@@ -19,7 +19,7 @@
19
19
  <script>
20
20
  import { defineComponent, computed } from "vue-demi";
21
21
  import Dropdown from "../dropdown/Dropdown.vue";
22
- import IconChevron from "@carbon/icons-vue/lib/chevron--right/16";
22
+ import IconChevron from "@privyid/persona-icon/vue/chevron-right/20.vue";
23
23
  export default defineComponent({
24
24
  components: { Dropdown, IconChevron },
25
25
  props: {
@@ -1,7 +1,9 @@
1
1
  <template>
2
2
  <component
3
3
  :is="tagName"
4
- :href="href"
4
+ :href="tagName === 'a' ? href : undefined"
5
+ :to="tagName === 'a' ? undefined : href"
6
+ :type="tagName === 'a' ? undefined : type"
5
7
  data-testid="btn"
6
8
  :class="classNames">
7
9
  <slot />
@@ -12,7 +14,8 @@
12
14
  import {
13
15
  computed,
14
16
  defineComponent,
15
- inject
17
+ inject,
18
+ resolveComponent
16
19
  } from "vue-demi";
17
20
  import { BUTTONGROUP_SETTING } from "../button-group";
18
21
  import { INPUTGROUP_SETTING } from "../input-group";
@@ -39,8 +42,12 @@ export default defineComponent({
39
42
  default: false
40
43
  },
41
44
  href: {
42
- type: String,
45
+ type: [String, Object],
43
46
  default: void 0
47
+ },
48
+ type: {
49
+ type: String,
50
+ default: "button"
44
51
  }
45
52
  },
46
53
  setup(props) {
@@ -65,10 +72,12 @@ export default defineComponent({
65
72
  return result;
66
73
  });
67
74
  const tagName = computed(() => {
68
- let tag = "button";
69
- if (props.href)
70
- tag = "a";
71
- return tag;
75
+ if (props.href) {
76
+ if (typeof props.href === "string" && (props.href.startsWith("http") || props.href.startsWith("#")))
77
+ return "a";
78
+ return resolveComponent("router-link");
79
+ }
80
+ return "button";
72
81
  });
73
82
  return { classNames, tagName };
74
83
  }
@@ -103,6 +112,10 @@ export default defineComponent({
103
112
  --p-color-dark-danger-hover: darken(theme(backgroundColor.dark.danger.emphasis), 5%);
104
113
  --p-color-danger-focus: darken(theme(backgroundColor.danger.emphasis), 10%);
105
114
  --p-color-dark-danger-focus: darken(theme(backgroundColor.dark.danger.emphasis), 10%);
115
+ --p-button-xs-padding-x: theme(spacing.2);
116
+ --p-button-sm-padding-x: theme(spacing.4);
117
+ --p-button-md-padding-x: theme(spacing.5);
118
+ --p-button-lg-padding-x: theme(spacing.8);
106
119
 
107
120
  @apply inline-flex align-middle justify-center font-medium no-underline hover:no-underline disabled:opacity-50 disabled:pointer-events-none transition-all ease-in-out duration-200;
108
121
 
@@ -119,19 +132,19 @@ export default defineComponent({
119
132
  * eg: xs, sm, md, and lg
120
133
  */
121
134
  &&--xs {
122
- @apply px-2 py-[2px] gap-1 text-sm rounded-xs;
135
+ @apply px-[var(--p-button-xs-padding-x)] py-[2px] gap-1 text-sm rounded-xs;
123
136
  }
124
137
 
125
138
  &&--sm {
126
- @apply px-4 py-1 gap-2 text-base tracking-wider rounded-sm;
139
+ @apply px-[var(--p-button-sm-padding-x)] py-1 gap-2 text-base tracking-wider rounded-sm;
127
140
  }
128
141
 
129
142
  &&--md {
130
- @apply px-5 py-[10px] gap-3 text-base tracking-wider rounded;
143
+ @apply px-[var(--p-button-md-padding-x)] py-[10px] gap-3 text-base tracking-wider rounded;
131
144
  }
132
145
 
133
146
  &&--lg {
134
- @apply px-8 py-4 gap-4 text-base tracking-wider rounded;
147
+ @apply px-[var(--p-button-lg-padding-x)] py-4 gap-4 text-base tracking-wider rounded;
135
148
  }
136
149
 
137
150
  /*
@@ -1,6 +1,7 @@
1
- import { PropType } from 'vue-demi';
2
- import { ColorVariant, SizeVariant, StyleVariant, TagVariant } from '.';
3
- declare const _default: import("vue-demi").DefineComponent<{
1
+ import { PropType, type DefineComponent } from 'vue-demi';
2
+ import type { RouteLocationRaw } from 'vue-router';
3
+ import { ColorVariant, SizeVariant, StyleVariant, TagVariant, TypeVariant } from '.';
4
+ declare const _default: DefineComponent<{
4
5
  variant: {
5
6
  type: PropType<StyleVariant>;
6
7
  default: string;
@@ -22,12 +23,16 @@ declare const _default: import("vue-demi").DefineComponent<{
22
23
  default: boolean;
23
24
  };
24
25
  href: {
25
- type: StringConstructor;
26
+ type: PropType<RouteLocationRaw>;
26
27
  default: undefined;
27
28
  };
29
+ type: {
30
+ type: PropType<TypeVariant>;
31
+ default: string;
32
+ };
28
33
  }, {
29
34
  classNames: import("vue-demi").ComputedRef<string[]>;
30
- tagName: import("vue-demi").ComputedRef<TagVariant>;
35
+ tagName: import("vue-demi").ComputedRef<TagVariant | DefineComponent>;
31
36
  }, 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<{
32
37
  variant: {
33
38
  type: PropType<StyleVariant>;
@@ -50,15 +55,20 @@ declare const _default: import("vue-demi").DefineComponent<{
50
55
  default: boolean;
51
56
  };
52
57
  href: {
53
- type: StringConstructor;
58
+ type: PropType<RouteLocationRaw>;
54
59
  default: undefined;
55
60
  };
61
+ type: {
62
+ type: PropType<TypeVariant>;
63
+ default: string;
64
+ };
56
65
  }>>, {
57
66
  variant: StyleVariant;
58
67
  size: SizeVariant;
68
+ type: TypeVariant;
59
69
  icon: boolean;
60
70
  color: ColorVariant;
61
71
  pill: boolean;
62
- href: string;
72
+ href: RouteLocationRaw;
63
73
  }, {}>;
64
74
  export default _default;
@@ -2,3 +2,4 @@ export type StyleVariant = 'solid' | 'outline' | 'ghost' | 'link' | 'input';
2
2
  export type ColorVariant = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
3
3
  export type SizeVariant = 'xs' | 'sm' | 'md' | 'lg';
4
4
  export type TagVariant = 'a' | 'button';
5
+ export type TypeVariant = 'button' | 'menu' | 'reset' | 'submit';
@@ -10,6 +10,7 @@
10
10
  data-testid="calendar-prev"
11
11
  variant="solid"
12
12
  icon
13
+ type="button"
13
14
  :disabled="!canPrev"
14
15
  :readonly="disabled || readonly"
15
16
  @click="prev">
@@ -20,6 +21,7 @@
20
21
  data-testid="calendar-title"
21
22
  class="calendar__nav-title"
22
23
  variant="solid"
24
+ type="button"
23
25
  :readonly="disabled || readonly"
24
26
  @click="changeMode(1)">
25
27
  {{ title }}
@@ -29,6 +31,7 @@
29
31
  data-testid="calendar-next"
30
32
  variant="solid"
31
33
  icon
34
+ type="button"
32
35
  :readonly="disabled || readonly"
33
36
  :disabled="!canNext"
34
37
  @click="next">
@@ -49,6 +52,7 @@
49
52
  :key="i">
50
53
  <p-button
51
54
  variant="solid"
55
+ type="button"
52
56
  data-testid="calendar-item"
53
57
  :readonly="item.readonly || disabled || readonly"
54
58
  :active="item.active"
@@ -175,7 +179,7 @@ export default defineComponent({
175
179
  const localEnd = ref(Array.isArray(props.modelValue) ? props.modelValue[1] : props.end ?? props.modelValue);
176
180
  const vStart = computed({
177
181
  get() {
178
- return Array.isArray(props.modelValue) ? props.modelValue[0] : props.start ?? props.modelValue;
182
+ return Array.isArray(props.modelValue) ? props.modelValue?.[0] : props.start ?? props.modelValue;
179
183
  },
180
184
  set(value) {
181
185
  emit("update:start", value);
@@ -183,7 +187,7 @@ export default defineComponent({
183
187
  });
184
188
  const vEnd = computed({
185
189
  get() {
186
- return Array.isArray(props.modelValue) ? props.modelValue[1] : props.end ?? props.modelValue;
190
+ return Array.isArray(props.modelValue) ? props.modelValue?.[1] : props.end ?? props.modelValue;
187
191
  },
188
192
  set(value) {
189
193
  emit("update:end", value);
@@ -275,8 +279,8 @@ export default defineComponent({
275
279
  }
276
280
  return false;
277
281
  }
278
- syncRef(localStart, vStart);
279
- syncRef(localEnd, vEnd);
282
+ syncRef(localStart, vStart, { immediate: false });
283
+ syncRef(localEnd, vEnd, { immediate: false });
280
284
  watch([localStart, localEnd], ([startVal, endVal]) => {
281
285
  if (props.range) {
282
286
  if (startVal && endVal) {
@@ -126,9 +126,9 @@ import {
126
126
  toRef
127
127
  } from "vue-demi";
128
128
  import pButton from "../button/Button.vue";
129
- import IconRotate from "@carbon/icons-vue/lib/renew/16";
130
- import IconCamera from "@carbon/icons-vue/lib/camera/24";
131
- import IconRetake from "@carbon/icons-vue/lib/reset/24";
129
+ import IconRotate from "@privyid/persona-icon/vue/refresh/16.vue";
130
+ import IconCamera from "@privyid/persona-icon/vue/camera/24.vue";
131
+ import IconRetake from "@privyid/persona-icon/vue/reset/24.vue";
132
132
  import ShutterWav from "./assets/shutter.wav";
133
133
  import { useVModel } from "../input";
134
134
  import CaptureAdapter from "./adapter/capture";
@@ -58,7 +58,7 @@ import {
58
58
  defineComponent,
59
59
  ref
60
60
  } from "vue-demi";
61
- import IconClose from "@carbon/icons-vue/lib/close/16";
61
+ import IconClose from "@privyid/persona-icon/vue/close/16.vue";
62
62
  import Heading from "../heading/Heading.vue";
63
63
  export default defineComponent({
64
64
  components: { Heading, IconClose },
@@ -132,9 +132,15 @@ export default defineComponent({
132
132
  .card {
133
133
  --p-card-padding-x: theme(spacing.6);
134
134
  --p-card-padding-y: theme(spacing.6);
135
+ --p-card-bg: theme(backgroundColor.default.DEFAULT);
136
+ --p-card-bg-dark: theme(backgroundColor.dark.default.DEFAULT);
137
+ --p-card-border: theme(borderColor.default.DEFAULT);
138
+ --p-card-border-dark: theme(borderColor.dark.default.DEFAULT);
139
+ --p-card-color: theme(textColor.default);
140
+ --p-card-color-dark: theme(textColor.dark.default);
135
141
 
136
- @apply border bg-default border-default text-default rounded;
137
- @apply dark:bg-dark-default dark:border-dark-default dark:text-dark-default;
142
+ @apply border bg-[color:var(--p-card-bg)] border-[color:var(--p-card-border)] text-[color:var(--p-card-color)] rounded;
143
+ @apply dark:bg-[color:var(--p-card-bg-dark)] dark:border-[color:var(--p-card-border-dark)] dark:text-[color:var(--p-card-color-dark)];
138
144
 
139
145
  /*
140
146
  * Card Body & Card Header
@@ -32,6 +32,6 @@ export function useVModel(props) {
32
32
  emit("change", value);
33
33
  }
34
34
  });
35
- syncRef(localValue, model);
35
+ syncRef(localValue, model, { immediate: false });
36
36
  return localValue;
37
37
  }
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <transition
3
- name="fade"
3
+ name="collapse"
4
4
  mode="out-in">
5
5
  <div
6
6
  v-show="model || isToggleable"
@@ -79,5 +79,16 @@ export default defineComponent({
79
79
  &:not(&--show) {
80
80
  @apply hidden;
81
81
  }
82
+
83
+ &-enter-active,
84
+ &-leave-active {
85
+ @apply transition-[transform,opacity] origin-top duration-150 ease-in-out;
86
+ }
87
+
88
+ &-enter,
89
+ &-enter-from,
90
+ &-leave-to {
91
+ @apply scale-y-0 opacity-0;
92
+ }
82
93
  }
83
94
  </style>
@@ -74,7 +74,7 @@ import {
74
74
  import { useVModel } from "../input";
75
75
  import pCaption from "../caption/Caption.vue";
76
76
  import pSubheading from "../subheading/Subheading.vue";
77
- import IconClose from "@carbon/icons-vue/lib/close/20";
77
+ import IconClose from "@privyid/persona-icon/vue/close/16.vue";
78
78
  export default defineComponent({
79
79
  components: {
80
80
  IconClose,
@@ -122,10 +122,10 @@ import {
122
122
  import { usePinch } from "./utils/use-pinch";
123
123
  import pButton from "../button/Button.vue";
124
124
  import pInputRange from "../input-range/InputRange.vue";
125
- import IconRotateLeft from "@carbon/icons-vue/lib/rotate--counterclockwise/16";
126
- import IconRotateRight from "@carbon/icons-vue/lib/rotate--clockwise/16";
127
- import IconZoomIn from "@carbon/icons-vue/lib/zoom--in/16";
128
- import IconZoomOut from "@carbon/icons-vue/lib/zoom--out/16";
125
+ import IconRotateLeft from "@privyid/persona-icon/vue/rotate-left/20.vue";
126
+ import IconRotateRight from "@privyid/persona-icon/vue/rotate-right/20.vue";
127
+ import IconZoomIn from "@privyid/persona-icon/vue/zoom-in/20.vue";
128
+ import IconZoomOut from "@privyid/persona-icon/vue/zoom-out/20.vue";
129
129
  import { cropImage } from "./utils/crop-image";
130
130
  import { useVModel } from "../input";
131
131
  import { fromBase64 } from "../utils/base64";
@@ -15,6 +15,7 @@
15
15
  :placeholder="placeholder"
16
16
  :disabled="disabled"
17
17
  :error="error"
18
+ :size="size"
18
19
  readonly
19
20
  @focus="onFocus">
20
21
  <template #append>
@@ -51,7 +52,8 @@ import { format as formatDate, isDate } from "date-fns";
51
52
  import {
52
53
  computed,
53
54
  defineComponent,
54
- ref
55
+ ref,
56
+ watch
55
57
  } from "vue-demi";
56
58
  import { useVModel } from "../input";
57
59
  import IconCalendar from "@privyid/persona-icon/vue/calendar/16.vue";
@@ -67,6 +69,10 @@ export default defineComponent({
67
69
  type: [Date, Array],
68
70
  default: void 0
69
71
  },
72
+ size: {
73
+ type: String,
74
+ default: "md"
75
+ },
70
76
  start: {
71
77
  type: Date,
72
78
  default: void 0
@@ -134,9 +140,18 @@ export default defineComponent({
134
140
  const model = useVModel(props);
135
141
  const isOpen = ref(false);
136
142
  const value = computed(() => {
137
- if (props.range && Array.isArray(model.value))
138
- return `${formatDate(model.value[0], props.format)} - ${formatDate(model.value[1], props.format)}`;
139
- return isDate(model.value) ? formatDate(model.value, props.format) : "";
143
+ const dates = Array.isArray(model.value) ? model.value : [model.value];
144
+ return dates.map((date) => {
145
+ return isDate(date) ? formatDate(date, props.format) : "";
146
+ }).filter(Boolean).join(" - ");
147
+ });
148
+ watch(() => props.start, (start) => {
149
+ if (Array.isArray(model.value))
150
+ model.value[0] = start;
151
+ });
152
+ watch(() => props.end, (end) => {
153
+ if (Array.isArray(model.value))
154
+ model.value[1] = end;
140
155
  });
141
156
  const classNames = computed(() => {
142
157
  const result = [];
@@ -1,9 +1,14 @@
1
1
  import { PropType } from 'vue-demi';
2
+ import { SizeVariant } from '../button';
2
3
  declare const _default: import("vue-demi").DefineComponent<{
3
4
  modelValue: {
4
5
  type: PropType<Date | [Date, Date]>;
5
6
  default: undefined;
6
7
  };
8
+ size: {
9
+ type: PropType<SizeVariant>;
10
+ default: string;
11
+ };
7
12
  start: {
8
13
  type: DateConstructor;
9
14
  default: undefined;
@@ -68,6 +73,10 @@ declare const _default: import("vue-demi").DefineComponent<{
68
73
  type: PropType<Date | [Date, Date]>;
69
74
  default: undefined;
70
75
  };
76
+ size: {
77
+ type: PropType<SizeVariant>;
78
+ default: string;
79
+ };
71
80
  start: {
72
81
  type: DateConstructor;
73
82
  default: undefined;
@@ -127,6 +136,7 @@ declare const _default: import("vue-demi").DefineComponent<{
127
136
  "onUpdate:end"?: ((...args: any[]) => any) | undefined;
128
137
  }, {
129
138
  error: boolean;
139
+ size: SizeVariant;
130
140
  start: Date;
131
141
  end: Date;
132
142
  min: Date;
@@ -33,7 +33,7 @@
33
33
 
34
34
  <Transition name="fade">
35
35
  <div
36
- v-show="isOpen"
36
+ v-show="isOpen && !isHidden"
37
37
  ref="menu"
38
38
  data-testid="dropdown-menu"
39
39
  class="dropdown__menu"
@@ -55,7 +55,8 @@ import {
55
55
  watch,
56
56
  toRef,
57
57
  watchEffect,
58
- computed
58
+ computed,
59
+ ref
59
60
  } from "vue-demi";
60
61
  import {
61
62
  templateRef,
@@ -70,10 +71,11 @@ import {
70
71
  computePosition,
71
72
  offset,
72
73
  flip,
73
- shift
74
+ shift,
75
+ hide
74
76
  } from "@floating-ui/dom";
75
77
  import { useVModel } from "../input";
76
- import IconArrow from "@carbon/icons-vue/lib/chevron--down/16";
78
+ import IconArrow from "@privyid/persona-icon/vue/chevron-down/16.vue";
77
79
  import { DROPDOWN_CONTEXT } from ".";
78
80
  export default defineComponent({
79
81
  components: {
@@ -162,6 +164,7 @@ export default defineComponent({
162
164
  const wizard = templateRef("wizard");
163
165
  const placement = toRef(props, "placement");
164
166
  const isOpen = useVModel(props);
167
+ const isHidden = ref(false);
165
168
  const { next: nextFocus, prev: prevFocus } = useFocus(menu);
166
169
  const classNames = computed(() => {
167
170
  const result = [""];
@@ -240,13 +243,15 @@ export default defineComponent({
240
243
  middleware: [
241
244
  flip(),
242
245
  shift(),
243
- offset(8)
246
+ offset(8),
247
+ hide()
244
248
  ]
245
- }).then(({ x, y, placement: placement2 }) => {
249
+ }).then(({ x, y, placement: placement2, middlewareData }) => {
246
250
  if (menu.value) {
247
251
  menu.value.dataset.popperPlacement = placement2;
248
252
  menu.value.style.left = `${x || 0}px`;
249
253
  menu.value.style.top = `${y || 0}px`;
254
+ isHidden.value = middlewareData.hide.referenceHidden;
250
255
  }
251
256
  });
252
257
  });
@@ -265,6 +270,7 @@ export default defineComponent({
265
270
  });
266
271
  return {
267
272
  isOpen,
273
+ isHidden,
268
274
  classNames,
269
275
  containerSize,
270
276
  toggle,
@@ -283,7 +289,7 @@ export default defineComponent({
283
289
  --p-dropdown-size-sm: 15rem; /* 240px */
284
290
  --p-dropdown-max-height: theme(spacing.64);
285
291
 
286
- @apply relative inline-flex;
292
+ @apply inline-flex;
287
293
 
288
294
  &__menu {
289
295
  @apply max-h-[var(--p-dropdown-max-height)] border rounded bg-default z-[var(--p-dropdown-z-index)] border-default shadow-xl overflow-x-hidden overflow-y-auto absolute;
@@ -61,6 +61,7 @@ declare const _default: import("vue-demi").DefineComponent<{
61
61
  };
62
62
  }, {
63
63
  isOpen: import("vue-demi").Ref<boolean>;
64
+ isHidden: import("vue-demi").Ref<boolean>;
64
65
  classNames: import("vue-demi").ComputedRef<string[]>;
65
66
  containerSize: import("vue-demi").ComputedRef<string[]>;
66
67
  toggle: () => void;
@@ -5,6 +5,7 @@
5
5
  class="dropdown__item"
6
6
  :class="classNames"
7
7
  :href="href"
8
+ :disabled="disabled"
8
9
  @click="handleOnClick">
9
10
  <slot>
10
11
  {{ text }}
@@ -32,6 +33,10 @@ export default defineComponent({
32
33
  active: {
33
34
  type: Boolean,
34
35
  default: false
36
+ },
37
+ disabled: {
38
+ type: Boolean,
39
+ default: false
35
40
  }
36
41
  },
37
42
  emits: ["click"],
@@ -83,5 +88,10 @@ export default defineComponent({
83
88
  @apply bg-default-alpha;
84
89
  @apply dark:bg-dark-default-alpha cursor-default;
85
90
  }
91
+
92
+ &:disabled {
93
+ @apply bg-subtle border-subtle pointer-events-none text-muted;
94
+ @apply dark:bg-dark-subtle dark:border-dark-subtle dark:text-dark-muted;
95
+ }
86
96
  }
87
97
  </style>
@@ -12,6 +12,10 @@ declare const _default: import("vue-demi").DefineComponent<{
12
12
  type: BooleanConstructor;
13
13
  default: boolean;
14
14
  };
15
+ disabled: {
16
+ type: BooleanConstructor;
17
+ default: boolean;
18
+ };
15
19
  }, {
16
20
  handleOnClick: (event: Event) => void;
17
21
  classNames: import("vue-demi").ComputedRef<string[]>;
@@ -29,11 +33,16 @@ declare const _default: import("vue-demi").DefineComponent<{
29
33
  type: BooleanConstructor;
30
34
  default: boolean;
31
35
  };
36
+ disabled: {
37
+ type: BooleanConstructor;
38
+ default: boolean;
39
+ };
32
40
  }>> & {
33
41
  onClick?: ((...args: any[]) => any) | undefined;
34
42
  }, {
35
43
  href: string;
36
44
  active: boolean;
37
45
  text: string;
46
+ disabled: boolean;
38
47
  }, {}>;
39
48
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import type { Ref } from 'vue-demi';
2
- export declare function useFocus(target: Ref<HTMLElement>, repeat?: boolean): {
2
+ export declare function useFocus(target: Ref<HTMLElement>, loop?: boolean): {
3
3
  next: () => void;
4
4
  prev: () => void;
5
5
  };
@@ -1,10 +1,10 @@
1
1
  import { clamp } from "lodash-es";
2
2
  import { focusable } from "tabbable";
3
- export function useFocus(target, repeat = true) {
3
+ export function useFocus(target, loop = true) {
4
4
  function travel(step) {
5
5
  const elements = focusable(target.value);
6
6
  const index = elements.indexOf(document.activeElement);
7
- const nextIndex = repeat ? (index + step) % elements.length : clamp(index + step, 0, elements.length - 1);
7
+ const nextIndex = loop ? (index + step) % elements.length : clamp(index + step, 0, elements.length - 1);
8
8
  const targetFocus = elements.at(nextIndex);
9
9
  if (targetFocus !== void 0)
10
10
  targetFocus.focus();
@@ -50,8 +50,8 @@
50
50
 
51
51
  <script>
52
52
  import DropdownItem from "../dropdown/DropdownItem.vue";
53
- import IconNext from "@carbon/icons-vue/lib/chevron--right/16";
54
- import IconBack from "@carbon/icons-vue/lib/arrow--left/16";
53
+ import IconNext from "@privyid/persona-icon/vue/chevron-right/16.vue";
54
+ import IconBack from "@privyid/persona-icon/vue/arrow-left/16.vue";
55
55
  import {
56
56
  defineComponent,
57
57
  inject,