@privyid/persona 0.14.0 → 0.15.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.
@@ -56,8 +56,8 @@ declare const _default: import("vue-demi").DefineComponent<{
56
56
  }>>, {
57
57
  variant: StyleVariant;
58
58
  size: SizeVariant;
59
- color: ColorVariant;
60
59
  href: string;
60
+ color: ColorVariant;
61
61
  icon: boolean;
62
62
  pill: boolean;
63
63
  }, {}>;
@@ -268,6 +268,7 @@ export default defineComponent({
268
268
 
269
269
  <style lang="postcss">
270
270
  .dropdown {
271
+ --p-dropdown-z-index: theme(zIndex.dropdown);
271
272
  --p-dropdown-size-lg: 30rem; /* 480px */
272
273
  --p-dropdown-size-md: 20rem; /* 320px */
273
274
  --p-dropdown-size-sm: 15rem; /* 240px */
@@ -275,7 +276,7 @@ export default defineComponent({
275
276
  @apply relative inline-flex;
276
277
 
277
278
  &__menu {
278
- @apply max-h-64 border rounded bg-default z-10 border-default shadow-xl overflow-x-hidden overflow-y-auto absolute;
279
+ @apply max-h-64 border rounded bg-default z-[var(--p-dropdown-z-index)] border-default shadow-xl overflow-x-hidden overflow-y-auto absolute;
279
280
  @apply dark:bg-dark-default dark:border-dark-default;
280
281
 
281
282
  &__container {
@@ -122,8 +122,8 @@ declare const _default: import("vue-demi").DefineComponent<{
122
122
  }, {
123
123
  variant: StyleVariant;
124
124
  size: SizeVariant;
125
- color: ColorVariant;
126
125
  text: string;
126
+ color: ColorVariant;
127
127
  icon: boolean;
128
128
  pill: boolean;
129
129
  modelValue: boolean;
@@ -10,7 +10,8 @@
10
10
  :size="size"
11
11
  :placement="placement"
12
12
  :no-caret="noCaret"
13
- :menu-class="menuClass">
13
+ :menu-class="menuClass"
14
+ :menu-size="menuSize">
14
15
  <template #button-content>
15
16
  <slot name="button-content">
16
17
  {{ text }}
@@ -63,6 +64,10 @@ export default defineComponent({
63
64
  Object
64
65
  ],
65
66
  default: void 0
67
+ },
68
+ menuSize: {
69
+ type: String,
70
+ default: "sm"
66
71
  }
67
72
  },
68
73
  models: {
@@ -1,6 +1,7 @@
1
1
  import { PropType } from 'vue-demi';
2
2
  import { Placement } from '@floating-ui/core';
3
3
  import type { SizeVariant, StyleVariant } from '../button';
4
+ import { MenuSizeVariant } from '../dropdown';
4
5
  declare const _default: import("vue-demi").DefineComponent<{
5
6
  modelValue: {
6
7
  type: BooleanConstructor;
@@ -34,6 +35,10 @@ declare const _default: import("vue-demi").DefineComponent<{
34
35
  type: (StringConstructor | ArrayConstructor | ObjectConstructor)[];
35
36
  default: undefined;
36
37
  };
38
+ menuSize: {
39
+ type: PropType<MenuSizeVariant>;
40
+ default: string;
41
+ };
37
42
  }, {
38
43
  model: import("vue-demi").Ref<boolean>;
39
44
  }, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
@@ -69,6 +74,10 @@ declare const _default: import("vue-demi").DefineComponent<{
69
74
  type: (StringConstructor | ArrayConstructor | ObjectConstructor)[];
70
75
  default: undefined;
71
76
  };
77
+ menuSize: {
78
+ type: PropType<MenuSizeVariant>;
79
+ default: string;
80
+ };
72
81
  }>> & {
73
82
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
74
83
  }, {
@@ -80,5 +89,6 @@ declare const _default: import("vue-demi").DefineComponent<{
80
89
  placement: Placement;
81
90
  noCaret: boolean;
82
91
  menuClass: string | Record<string, any> | unknown[];
92
+ menuSize: MenuSizeVariant;
83
93
  }, {}>;
84
94
  export default _default;
@@ -38,6 +38,10 @@ export default defineComponent({
38
38
  type: Boolean,
39
39
  default: false
40
40
  },
41
+ sticky: {
42
+ type: Boolean,
43
+ default: false
44
+ },
41
45
  condensed: {
42
46
  type: Boolean,
43
47
  default: false
@@ -56,6 +60,8 @@ export default defineComponent({
56
60
  const result = [""];
57
61
  if (props.fixed)
58
62
  result.push("navbar--fixed");
63
+ if (props.sticky)
64
+ result.push("navbar--sticky");
59
65
  if (props.variant)
60
66
  result.push(`navbar--${props.variant}`);
61
67
  if (props.toggleable)
@@ -82,6 +88,7 @@ export default defineComponent({
82
88
  <style lang="postcss">
83
89
  .navbar {
84
90
  --p-navbar-z-index: theme(zIndex.fixed);
91
+ --p-navbar-sticky-top: theme(spacing.0);
85
92
  --p-navbar-collapse-max-height: 20rem; /** 320px */
86
93
 
87
94
  @apply bg-default relative p-3 flex items-center flex-wrap transition-shadow duration-150 ease-in-out;
@@ -91,6 +98,10 @@ export default defineComponent({
91
98
  @apply fixed left-0 top-0 w-full z-[var(--p-navbar-z-index)];
92
99
  }
93
100
 
101
+ &&--sticky {
102
+ @apply sticky top-[var(--p-navbar-sticky-top)] z-sticky;
103
+ }
104
+
94
105
  &&--shadow {
95
106
  @apply shadow-lg transition-shadow duration-150 ease-in-out;
96
107
  }
@@ -174,6 +185,10 @@ export default defineComponent({
174
185
  @apply static shadow-none border-0 bg-base rounded-t-none;
175
186
  @apply dark:bg-dark-base;
176
187
 
188
+ &:where(.dropdown__menu--sm, .dropdown__menu--md, .dropdown__menu--lg) {
189
+ @apply w-full;
190
+ }
191
+
177
192
  &__container {
178
193
  .dropdown__item {
179
194
  @apply first:rounded-t-none;
@@ -206,9 +221,7 @@ export default defineComponent({
206
221
  }
207
222
  }
208
223
 
209
- .nav__item,
210
- .nav__text,
211
- .nav__form {
224
+ :where(.nav__item, .nav__text, .nav__form) {
212
225
  @apply w-full;
213
226
  }
214
227
  }
@@ -14,6 +14,10 @@ declare const _default: import("vue-demi").DefineComponent<{
14
14
  type: BooleanConstructor;
15
15
  default: boolean;
16
16
  };
17
+ sticky: {
18
+ type: BooleanConstructor;
19
+ default: boolean;
20
+ };
17
21
  condensed: {
18
22
  type: BooleanConstructor;
19
23
  default: boolean;
@@ -35,6 +39,10 @@ declare const _default: import("vue-demi").DefineComponent<{
35
39
  type: BooleanConstructor;
36
40
  default: boolean;
37
41
  };
42
+ sticky: {
43
+ type: BooleanConstructor;
44
+ default: boolean;
45
+ };
38
46
  condensed: {
39
47
  type: BooleanConstructor;
40
48
  default: boolean;
@@ -44,5 +52,6 @@ declare const _default: import("vue-demi").DefineComponent<{
44
52
  variant: StyleVariant;
45
53
  toggleable: ToggleableVariant | undefined;
46
54
  condensed: boolean;
55
+ sticky: boolean;
47
56
  }, {}>;
48
57
  export default _default;
@@ -148,8 +148,8 @@ declare const _default: import("vue-demi").DefineComponent<{
148
148
  };
149
149
  }>>, {
150
150
  size: number;
151
- color: string;
152
151
  text: string;
152
+ color: string;
153
153
  modelValue: string | File;
154
154
  label: string;
155
155
  modelModifiers: ModelModifier;
@@ -11,6 +11,7 @@
11
11
  ref="sidebarMenus"
12
12
  data-testid="sidebar-menus"
13
13
  :data-sidebar-menu="brandHeight"
14
+ :data-bottom-menu="isBottomMenu"
14
15
  class="sidebar__menus"
15
16
  :style="{ 'padding-bottom': bottomHeight }">
16
17
  <slot />
@@ -30,7 +31,9 @@ import { templateRef, useElementSize } from "@vueuse/core";
30
31
  import {
31
32
  defineComponent,
32
33
  computed,
33
- provide
34
+ ref,
35
+ provide,
36
+ onMounted
34
37
  } from "vue-demi";
35
38
  import { SIDEBAR_SETTINGS } from ".";
36
39
  import { useSelector } from "../pdf-object/utils/use-selector";
@@ -53,6 +56,10 @@ export default defineComponent({
53
56
  type: Boolean,
54
57
  default: false
55
58
  },
59
+ sticky: {
60
+ type: Boolean,
61
+ default: false
62
+ },
56
63
  toggleable: {
57
64
  type: String,
58
65
  default: void 0
@@ -75,15 +82,15 @@ export default defineComponent({
75
82
  });
76
83
  const sidebar = templateRef("sidebar");
77
84
  const sidebarBrand = useSelector(".sidebar__brand", sidebar);
85
+ const brand = useElementSize(sidebarBrand);
78
86
  const sidebarMenus = templateRef("sidebarMenus");
79
87
  const sidebarBottom = useSelector(".sidebar__bottom", sidebarMenus);
80
88
  const { height } = useElementSize(sidebarBottom);
81
- const brand = useElementSize(sidebarBrand);
82
89
  const brandHeight = computed(() => {
83
- return slots.brand ? `${brand.height.value + 16}px` : 0;
90
+ return slots.brand ? `${brand.height.value + titleHeight.value + 16}px` : 0;
84
91
  });
85
92
  const bottomHeight = computed(() => {
86
- return slots.bottom && !slots.default ? 0 : `${height.value + 24}px`;
93
+ return isBottomMenu.value && !isDefault.value || !isBottomMenu.value && isDefault.value ? 0 : `${height.value + 16}px`;
87
94
  });
88
95
  const model = useVModel(props);
89
96
  const classNames = computed(() => {
@@ -96,16 +103,28 @@ export default defineComponent({
96
103
  result.push(`sidebar--${props.variant}`);
97
104
  if (props.fixed)
98
105
  result.push("sidebar--fixed");
106
+ if (props.sticky)
107
+ result.push("sidebar--sticky");
99
108
  if (props.toggleable)
100
109
  result.push(`sidebar--toggleable sidebar--toggleable-${props.toggleable}`);
101
110
  if (props.toggleable && props.fixed && model.value)
102
111
  result.push("sidebar--show");
103
112
  return result;
104
113
  });
114
+ const titleHeight = ref(0);
115
+ const isBottomMenu = ref(false);
116
+ const isDefault = ref(false);
117
+ onMounted(() => {
118
+ titleHeight.value = document.querySelectorAll(".sidebar .nav--has-title").length * 0.25 * 20;
119
+ isBottomMenu.value = document.querySelectorAll(".sidebar .sidebar__nav--bottom").length > 0;
120
+ isDefault.value = document.querySelectorAll(".sidebar .sidebar__nav:not(.sidebar__nav--bottom)").length > 0;
121
+ });
105
122
  return {
106
123
  classNames,
107
124
  bottomHeight,
108
- brandHeight
125
+ brandHeight,
126
+ isBottomMenu,
127
+ isDefault
109
128
  };
110
129
  }
111
130
  });
@@ -118,6 +137,7 @@ export default defineComponent({
118
137
  --p-sidebar-bg: theme(backgroundColor.DEFAULT);
119
138
  --p-sidebar-bg-dark: theme(backgroundColor.dark.DEFAULT);
120
139
  --p-sidebar-z-index: theme(zIndex.fixed);
140
+ --p-sidebar-sticky-top: theme(spacing.0);
121
141
 
122
142
  @apply bg-[color:var(--p-sidebar-bg)] px-2 py-4;
123
143
  @apply dark:bg-[color:var(--p-sidebar-bg-dark)];
@@ -154,8 +174,12 @@ export default defineComponent({
154
174
  }
155
175
 
156
176
  .sidebar__bottom {
157
- @apply absolute -bottom-4 w-[calc(100%+1rem)] -left-2 bg-[color:var(--p-sidebar-bg)];
177
+ @apply absolute -bottom-2 w-[calc(100%+1rem)] -left-2 bg-[color:var(--p-sidebar-bg)];
158
178
  @apply dark:bg-[color:var(--p-sidebar-bg-dark)];
179
+
180
+ .sidebar__nav {
181
+ @apply px-2;
182
+ }
159
183
  }
160
184
 
161
185
  /**
@@ -193,6 +217,13 @@ export default defineComponent({
193
217
  }
194
218
  }
195
219
 
220
+ /**
221
+ * Sticky sidebar
222
+ */
223
+ &&--sticky {
224
+ @apply sticky top-[var(--p-sidebar-sticky-top)] z-sticky;
225
+ }
226
+
196
227
  /**
197
228
  * Narrow sidebar
198
229
  * is 60px width
@@ -19,6 +19,10 @@ declare const _default: import("vue-demi").DefineComponent<{
19
19
  type: BooleanConstructor;
20
20
  default: boolean;
21
21
  };
22
+ sticky: {
23
+ type: BooleanConstructor;
24
+ default: boolean;
25
+ };
22
26
  toggleable: {
23
27
  type: PropType<ToggleableVariant>;
24
28
  default: undefined;
@@ -31,6 +35,8 @@ declare const _default: import("vue-demi").DefineComponent<{
31
35
  classNames: import("vue-demi").ComputedRef<string[]>;
32
36
  bottomHeight: import("vue-demi").ComputedRef<string | 0>;
33
37
  brandHeight: import("vue-demi").ComputedRef<string | 0>;
38
+ isBottomMenu: import("vue-demi").Ref<boolean>;
39
+ isDefault: import("vue-demi").Ref<boolean>;
34
40
  }, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
35
41
  variant: {
36
42
  type: PropType<StyleVariant>;
@@ -48,6 +54,10 @@ declare const _default: import("vue-demi").DefineComponent<{
48
54
  type: BooleanConstructor;
49
55
  default: boolean;
50
56
  };
57
+ sticky: {
58
+ type: BooleanConstructor;
59
+ default: boolean;
60
+ };
51
61
  toggleable: {
52
62
  type: PropType<ToggleableVariant>;
53
63
  default: undefined;
@@ -65,5 +75,6 @@ declare const _default: import("vue-demi").DefineComponent<{
65
75
  modelValue: boolean;
66
76
  align: AlignVariant;
67
77
  toggleable: ToggleableVariant;
78
+ sticky: boolean;
68
79
  }, {}>;
69
80
  export default _default;
@@ -57,9 +57,19 @@ export default defineComponent({
57
57
 
58
58
  a {
59
59
  @apply no-underline;
60
+
61
+ & > img {
62
+ @apply max-w-full h-auto;
63
+ }
64
+
65
+ .sidebar--wide & {
66
+ & > img {
67
+ @apply h-7 w-auto;
68
+ }
69
+ }
60
70
  }
61
71
 
62
- img {
72
+ & > img {
63
73
  @apply max-w-full h-auto;
64
74
  }
65
75
 
@@ -78,7 +88,7 @@ export default defineComponent({
78
88
  .sidebar--wide & {
79
89
  @apply px-3;
80
90
 
81
- img {
91
+ & > img {
82
92
  @apply h-7 w-auto;
83
93
  }
84
94
  }
@@ -3,6 +3,7 @@
3
3
  data-testid="sidebar-menu"
4
4
  :type="type"
5
5
  :fixed="fixed"
6
+ :sticky="sticky"
6
7
  :toggleable="toggleable"
7
8
  :align="align">
8
9
  <template #brand>
@@ -89,6 +90,10 @@ export default defineComponent({
89
90
  type: Boolean,
90
91
  default: false
91
92
  },
93
+ sticky: {
94
+ type: Boolean,
95
+ default: false
96
+ },
92
97
  type: {
93
98
  type: String,
94
99
  default: "wide"
@@ -12,6 +12,10 @@ declare const _default: import("vue-demi").DefineComponent<{
12
12
  type: BooleanConstructor;
13
13
  default: boolean;
14
14
  };
15
+ sticky: {
16
+ type: BooleanConstructor;
17
+ default: boolean;
18
+ };
15
19
  type: {
16
20
  type: PropType<TypeVariant>;
17
21
  default: string;
@@ -33,6 +37,10 @@ declare const _default: import("vue-demi").DefineComponent<{
33
37
  type: BooleanConstructor;
34
38
  default: boolean;
35
39
  };
40
+ sticky: {
41
+ type: BooleanConstructor;
42
+ default: boolean;
43
+ };
36
44
  type: {
37
45
  type: PropType<TypeVariant>;
38
46
  default: string;
@@ -50,6 +58,7 @@ declare const _default: import("vue-demi").DefineComponent<{
50
58
  type: TypeVariant;
51
59
  align: AlignVariant;
52
60
  toggleable: ToggleableVariant;
61
+ sticky: boolean;
53
62
  menus: Menu[];
54
63
  }, {}>;
55
64
  export default _default;
@@ -84,8 +84,8 @@ declare const _default: import("vue-demi").DefineComponent<{
84
84
  default: string;
85
85
  };
86
86
  }>>, {
87
- color: string;
88
87
  text: string;
88
+ color: string;
89
89
  modelValue: string | File;
90
90
  modelModifiers: ModelModifier;
91
91
  font: string;
@@ -110,8 +110,6 @@ export default defineComponent({
110
110
  * global style
111
111
  * of toast
112
112
  */
113
- --p-toast-z-index: theme(zIndex.toast);
114
-
115
113
  @apply flex shadow-xl rounded w-72 md:w-96 overflow-hidden;
116
114
 
117
115
  .toast__icon,
@@ -44,6 +44,7 @@ export default defineComponent({
44
44
 
45
45
  <style lang="postcss">
46
46
  .toast-container {
47
+ --p-toast-z-index: theme(zIndex.toast);
47
48
  @apply z-[var(--p-toast-z-index)] fixed top-0 right-0 flex flex-col space-y-2 max-h-screen overflow-visible;
48
49
  }
49
50
 
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.0.0"
6
6
  },
7
- "version": "0.14.0"
7
+ "version": "0.15.0"
8
8
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@privyid/persona",
3
3
  "description": "Persona core package",
4
- "version": "0.14.0",
4
+ "version": "0.15.0",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "url": "https://github.com/privy-open-source/design-system.git",
@@ -67,7 +67,7 @@
67
67
  "@zxing/library": "0.20.0",
68
68
  "chart.js": "4.3.0",
69
69
  "core-js": "3",
70
- "date-fns": "2.29.3",
70
+ "date-fns": "2.30.0",
71
71
  "defu": "6.1.2",
72
72
  "fast-equals": "^4.0.3",
73
73
  "fuse.js": "6.6.2",
@@ -88,7 +88,7 @@
88
88
  "extends @privyid/browserslist-config"
89
89
  ],
90
90
  "peerDependencies": {
91
- "@privyid/tailwind-preset": "^0.14.0",
91
+ "@privyid/tailwind-preset": "^0.15.0",
92
92
  "postcss-custom-properties": "^12.1.11",
93
93
  "postcss-hexrgba": "^2.1.0",
94
94
  "postcss-lighten-darken": "^0.9.0",
@@ -96,11 +96,11 @@
96
96
  "vue-router": ">=4.0.0"
97
97
  },
98
98
  "devDependencies": {
99
- "@nuxt/module-builder": "^0.3.0",
99
+ "@nuxt/module-builder": "^0.4.0",
100
100
  "@nuxt/schema": "3.3.3",
101
101
  "@nuxtjs/tailwindcss": "^6.2.0",
102
- "@privyid/browserslist-config": "^0.14.0",
103
- "@privyid/tailwind-preset": "^0.14.0",
102
+ "@privyid/browserslist-config": "^0.15.0",
103
+ "@privyid/tailwind-preset": "^0.15.0",
104
104
  "@types/sanitize-html": "^2",
105
105
  "browserslist-to-esbuild": "^1.2.0",
106
106
  "nuxt": "3.3.3",