@privyid/persona 0.13.1 → 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.
- package/dist/components/breadcrumbs/BreadcrumbItem.vue +1 -1
- package/dist/components/breadcrumbs/BreadcrumbItemDropdown.vue +8 -4
- package/dist/components/button/Button.vue.d.ts +1 -1
- package/dist/components/collapse/Collapse.vue +0 -10
- package/dist/components/cropper/Cropper.vue +1 -2
- package/dist/components/dropdown/Dropdown.vue +30 -2
- package/dist/components/dropdown/Dropdown.vue.d.ts +12 -1
- package/dist/components/dropdown/index.d.ts +1 -0
- package/dist/components/modal/Modal.vue.d.ts +1 -1
- package/dist/components/nav/NavItemDropdown.vue +14 -1
- package/dist/components/nav/NavItemDropdown.vue.d.ts +11 -1
- package/dist/components/navbar/Navbar.vue +112 -0
- package/dist/components/navbar/Navbar.vue.d.ts +9 -0
- package/dist/components/pdf-text/PdfText.vue.d.ts +1 -1
- package/dist/components/sidebar/Sidebar.vue +57 -10
- package/dist/components/sidebar/Sidebar.vue.d.ts +13 -1
- package/dist/components/sidebar/SidebarBrand.vue +12 -2
- package/dist/components/sidebar/SidebarNav.vue +0 -4
- package/dist/components/sidebar-menu/SidebarMenu.vue +8 -1
- package/dist/components/sidebar-menu/SidebarMenu.vue.d.ts +9 -0
- package/dist/components/signature-text/SignatureText.vue.d.ts +1 -1
- package/dist/components/signature-text/utils/formatter.d.ts +2 -2
- package/dist/components/signature-text/utils/formatter.mjs +2 -2
- package/dist/components/toast/Toast.vue +0 -2
- package/dist/components/toast/ToastContainer.vue +1 -0
- package/dist/components/tour/TourDialog.vue.d.ts +1 -1
- package/dist/module.json +1 -1
- package/package.json +6 -6
- package/dist/components/cropper/assets/ps-neutral.png +0 -0
|
@@ -48,15 +48,19 @@ export default defineComponent({
|
|
|
48
48
|
.breadcrumbs__item {
|
|
49
49
|
&&--dropdown {
|
|
50
50
|
.dropdown__activator {
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
&.btn.btn--default.btn--variant-solid {
|
|
52
|
+
@apply px-0 text-subtle bg-transparent border-transparent hover:shadow-none hover:border-transparent hover:bg-transparent focus:shadow-none focus:border-transparent focus:bg-transparent;
|
|
53
|
+
@apply dark:text-dark-subtle dark:bg-transparent dark:border-transparent hover:dark:border-transparent hover:dark:bg-transparent focus:dark:border-transparent focus:dark:bg-transparent;
|
|
54
|
+
}
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
&&--active {
|
|
57
59
|
.dropdown__activator {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
&.btn.btn--default.btn--variant-solid {
|
|
61
|
+
@apply text-default;
|
|
62
|
+
@apply dark:text-dark-default;
|
|
63
|
+
}
|
|
60
64
|
|
|
61
65
|
& > .dropdown__caret {
|
|
62
66
|
@apply text-subtle;
|
|
@@ -366,8 +366,7 @@ export default defineComponent({
|
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
&__preview {
|
|
369
|
-
|
|
370
|
-
|
|
369
|
+
@apply bg-[url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAGklEQVR4AWNYJYoK92ihwpGiAF0AXcMIUQAAbIfSgRmCFqkAAAAASUVORK5CYII=)];
|
|
371
370
|
@apply flex w-full overflow-hidden h-auto relative aspect-compat-square select-none;
|
|
372
371
|
}
|
|
373
372
|
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
ref="menu"
|
|
37
37
|
data-testid="dropdown-menu"
|
|
38
38
|
class="dropdown__menu"
|
|
39
|
-
:class="menuClass">
|
|
39
|
+
:class="[menuClass, containerSize]">
|
|
40
40
|
<DropdownGroup
|
|
41
41
|
ref="wizard"
|
|
42
42
|
class="dropdown__menu__container">
|
|
@@ -132,6 +132,10 @@ export default defineComponent({
|
|
|
132
132
|
Object
|
|
133
133
|
],
|
|
134
134
|
default: void 0
|
|
135
|
+
},
|
|
136
|
+
menuSize: {
|
|
137
|
+
type: String,
|
|
138
|
+
default: "sm"
|
|
135
139
|
}
|
|
136
140
|
},
|
|
137
141
|
models: {
|
|
@@ -156,6 +160,12 @@ export default defineComponent({
|
|
|
156
160
|
result.push("dropdown--divider");
|
|
157
161
|
return result;
|
|
158
162
|
});
|
|
163
|
+
const containerSize = computed(() => {
|
|
164
|
+
const result = [""];
|
|
165
|
+
if (props.menuSize)
|
|
166
|
+
result.push(`dropdown__menu--${props.menuSize}`);
|
|
167
|
+
return result;
|
|
168
|
+
});
|
|
159
169
|
function toggle() {
|
|
160
170
|
if (!props.disabled) {
|
|
161
171
|
if (isOpen.value)
|
|
@@ -247,6 +257,7 @@ export default defineComponent({
|
|
|
247
257
|
return {
|
|
248
258
|
isOpen,
|
|
249
259
|
classNames,
|
|
260
|
+
containerSize,
|
|
250
261
|
toggle,
|
|
251
262
|
open,
|
|
252
263
|
close
|
|
@@ -257,10 +268,15 @@ export default defineComponent({
|
|
|
257
268
|
|
|
258
269
|
<style lang="postcss">
|
|
259
270
|
.dropdown {
|
|
271
|
+
--p-dropdown-z-index: theme(zIndex.dropdown);
|
|
272
|
+
--p-dropdown-size-lg: 30rem; /* 480px */
|
|
273
|
+
--p-dropdown-size-md: 20rem; /* 320px */
|
|
274
|
+
--p-dropdown-size-sm: 15rem; /* 240px */
|
|
275
|
+
|
|
260
276
|
@apply relative inline-flex;
|
|
261
277
|
|
|
262
278
|
&__menu {
|
|
263
|
-
@apply max-h-64 border rounded
|
|
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;
|
|
264
280
|
@apply dark:bg-dark-default dark:border-dark-default;
|
|
265
281
|
|
|
266
282
|
&__container {
|
|
@@ -276,6 +292,18 @@ export default defineComponent({
|
|
|
276
292
|
}
|
|
277
293
|
}
|
|
278
294
|
}
|
|
295
|
+
|
|
296
|
+
&--lg {
|
|
297
|
+
@apply w-[var(--p-dropdown-size-lg)];
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
&--md {
|
|
301
|
+
@apply w-[var(--p-dropdown-size-md)];
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
&--sm {
|
|
305
|
+
@apply w-[var(--p-dropdown-size-sm)];
|
|
306
|
+
}
|
|
279
307
|
}
|
|
280
308
|
|
|
281
309
|
&__activator > &__caret {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
2
|
import { Placement } from '@floating-ui/dom';
|
|
3
3
|
import type { StyleVariant, ColorVariant, SizeVariant } from '../button';
|
|
4
|
+
import type { MenuSizeVariant } from '.';
|
|
4
5
|
declare const _default: import("vue-demi").DefineComponent<{
|
|
5
6
|
modelValue: {
|
|
6
7
|
type: BooleanConstructor;
|
|
@@ -50,9 +51,14 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
50
51
|
type: (StringConstructor | ArrayConstructor | ObjectConstructor)[];
|
|
51
52
|
default: undefined;
|
|
52
53
|
};
|
|
54
|
+
menuSize: {
|
|
55
|
+
type: PropType<MenuSizeVariant>;
|
|
56
|
+
default: string;
|
|
57
|
+
};
|
|
53
58
|
}, {
|
|
54
59
|
isOpen: import("vue-demi").Ref<boolean>;
|
|
55
60
|
classNames: import("vue-demi").ComputedRef<string[]>;
|
|
61
|
+
containerSize: import("vue-demi").ComputedRef<string[]>;
|
|
56
62
|
toggle: () => void;
|
|
57
63
|
open: () => void;
|
|
58
64
|
close: () => void;
|
|
@@ -105,6 +111,10 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
105
111
|
type: (StringConstructor | ArrayConstructor | ObjectConstructor)[];
|
|
106
112
|
default: undefined;
|
|
107
113
|
};
|
|
114
|
+
menuSize: {
|
|
115
|
+
type: PropType<MenuSizeVariant>;
|
|
116
|
+
default: string;
|
|
117
|
+
};
|
|
108
118
|
}>> & {
|
|
109
119
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
110
120
|
onShow?: ((...args: any[]) => any) | undefined;
|
|
@@ -112,9 +122,9 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
112
122
|
}, {
|
|
113
123
|
variant: StyleVariant;
|
|
114
124
|
size: SizeVariant;
|
|
125
|
+
text: string;
|
|
115
126
|
color: ColorVariant;
|
|
116
127
|
icon: boolean;
|
|
117
|
-
text: string;
|
|
118
128
|
pill: boolean;
|
|
119
129
|
modelValue: boolean;
|
|
120
130
|
disabled: boolean;
|
|
@@ -122,5 +132,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
122
132
|
noCaret: boolean;
|
|
123
133
|
divider: boolean;
|
|
124
134
|
menuClass: string | Record<string, any> | unknown[];
|
|
135
|
+
menuSize: MenuSizeVariant;
|
|
125
136
|
}, {}>;
|
|
126
137
|
export default _default;
|
|
@@ -92,9 +92,9 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
92
92
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
93
93
|
}, {
|
|
94
94
|
size: SizeVariant;
|
|
95
|
+
text: string;
|
|
95
96
|
dismissable: boolean;
|
|
96
97
|
banner: boolean;
|
|
97
|
-
text: string;
|
|
98
98
|
modelValue: boolean;
|
|
99
99
|
title: string;
|
|
100
100
|
centered: 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: {
|
|
@@ -82,6 +87,14 @@ export default defineComponent({
|
|
|
82
87
|
&__item {
|
|
83
88
|
&--dropdown {
|
|
84
89
|
@apply ml-auto;
|
|
90
|
+
|
|
91
|
+
.dropdown {
|
|
92
|
+
&__menu {
|
|
93
|
+
.dropdown__item {
|
|
94
|
+
@apply px-3;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
85
98
|
}
|
|
86
99
|
}
|
|
87
100
|
|
|
@@ -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,16 +74,21 @@ 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
|
}, {
|
|
75
84
|
variant: StyleVariant;
|
|
76
85
|
size: SizeVariant;
|
|
77
|
-
icon: boolean;
|
|
78
86
|
text: string;
|
|
87
|
+
icon: boolean;
|
|
79
88
|
modelValue: boolean;
|
|
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,8 @@ 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);
|
|
92
|
+
--p-navbar-collapse-max-height: 20rem; /** 320px */
|
|
85
93
|
|
|
86
94
|
@apply bg-default relative p-3 flex items-center flex-wrap transition-shadow duration-150 ease-in-out;
|
|
87
95
|
@apply dark:bg-dark-default;
|
|
@@ -90,6 +98,10 @@ export default defineComponent({
|
|
|
90
98
|
@apply fixed left-0 top-0 w-full z-[var(--p-navbar-z-index)];
|
|
91
99
|
}
|
|
92
100
|
|
|
101
|
+
&&--sticky {
|
|
102
|
+
@apply sticky top-[var(--p-navbar-sticky-top)] z-sticky;
|
|
103
|
+
}
|
|
104
|
+
|
|
93
105
|
&&--shadow {
|
|
94
106
|
@apply shadow-lg transition-shadow duration-150 ease-in-out;
|
|
95
107
|
}
|
|
@@ -151,5 +163,105 @@ export default defineComponent({
|
|
|
151
163
|
}
|
|
152
164
|
}
|
|
153
165
|
}
|
|
166
|
+
|
|
167
|
+
&--collapse {
|
|
168
|
+
@apply basis-full flex-grow items-center max-h-[var(--p-navbar-collapse-max-height)] overflow-y-auto;
|
|
169
|
+
|
|
170
|
+
&.collapse--show {
|
|
171
|
+
@apply mt-3;
|
|
172
|
+
|
|
173
|
+
.nav__item--dropdown {
|
|
174
|
+
@apply ml-0;
|
|
175
|
+
|
|
176
|
+
.dropdown,
|
|
177
|
+
.btn {
|
|
178
|
+
@apply flex w-full;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.dropdown {
|
|
182
|
+
@apply flex-col;
|
|
183
|
+
|
|
184
|
+
&__menu {
|
|
185
|
+
@apply static shadow-none border-0 bg-base rounded-t-none;
|
|
186
|
+
@apply dark:bg-dark-base;
|
|
187
|
+
|
|
188
|
+
&:where(.dropdown__menu--sm, .dropdown__menu--md, .dropdown__menu--lg) {
|
|
189
|
+
@apply w-full;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&__container {
|
|
193
|
+
.dropdown__item {
|
|
194
|
+
@apply first:rounded-t-none;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
&.dropdown--open {
|
|
200
|
+
.dropdown__activator.btn.btn--md {
|
|
201
|
+
@apply rounded-b-none bg-base;
|
|
202
|
+
@apply dark:bg-dark-base;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
&-icon {
|
|
208
|
+
.dropdown__menu__container {
|
|
209
|
+
.dropdown__item {
|
|
210
|
+
@apply px-11;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.btn {
|
|
216
|
+
@apply justify-start;
|
|
217
|
+
|
|
218
|
+
.dropdown__caret {
|
|
219
|
+
@apply ml-auto;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
:where(.nav__item, .nav__text, .nav__form) {
|
|
225
|
+
@apply w-full;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
&&--lines {
|
|
231
|
+
.navbar--collapse {
|
|
232
|
+
|
|
233
|
+
&.collapse--show {
|
|
234
|
+
|
|
235
|
+
.nav__item--dropdown {
|
|
236
|
+
|
|
237
|
+
.dropdown {
|
|
238
|
+
&__menu {
|
|
239
|
+
@apply rounded mt-2;
|
|
240
|
+
|
|
241
|
+
&__container {
|
|
242
|
+
.dropdown__item {
|
|
243
|
+
@apply first:rounded-t;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
&.dropdown--open {
|
|
249
|
+
.dropdown__activator.btn.btn--md {
|
|
250
|
+
@apply rounded-b-none bg-transparent;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
&-icon {
|
|
256
|
+
.dropdown__menu__container {
|
|
257
|
+
.dropdown__item {
|
|
258
|
+
@apply px-3;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
154
266
|
}
|
|
155
267
|
</style>
|
|
@@ -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;
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<aside
|
|
3
|
+
ref="sidebar"
|
|
3
4
|
data-testid="sidebar"
|
|
4
5
|
class="sidebar"
|
|
5
6
|
:class="classNames">
|
|
6
|
-
<slot
|
|
7
|
+
<slot
|
|
8
|
+
v-if="$slots.brand"
|
|
9
|
+
name="brand" />
|
|
7
10
|
<div
|
|
8
11
|
ref="sidebarMenus"
|
|
9
12
|
data-testid="sidebar-menus"
|
|
13
|
+
:data-sidebar-menu="brandHeight"
|
|
14
|
+
:data-bottom-menu="isBottomMenu"
|
|
10
15
|
class="sidebar__menus"
|
|
11
|
-
:style="
|
|
16
|
+
:style="{ 'padding-bottom': bottomHeight }">
|
|
12
17
|
<slot />
|
|
13
18
|
|
|
14
19
|
<div
|
|
15
20
|
v-if="$slots.bottom"
|
|
21
|
+
data-testid="sidebar-bottom"
|
|
16
22
|
class="sidebar__bottom">
|
|
17
23
|
<slot name="bottom" />
|
|
18
24
|
</div>
|
|
@@ -25,7 +31,9 @@ import { templateRef, useElementSize } from "@vueuse/core";
|
|
|
25
31
|
import {
|
|
26
32
|
defineComponent,
|
|
27
33
|
computed,
|
|
28
|
-
|
|
34
|
+
ref,
|
|
35
|
+
provide,
|
|
36
|
+
onMounted
|
|
29
37
|
} from "vue-demi";
|
|
30
38
|
import { SIDEBAR_SETTINGS } from ".";
|
|
31
39
|
import { useSelector } from "../pdf-object/utils/use-selector";
|
|
@@ -48,6 +56,10 @@ export default defineComponent({
|
|
|
48
56
|
type: Boolean,
|
|
49
57
|
default: false
|
|
50
58
|
},
|
|
59
|
+
sticky: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false
|
|
62
|
+
},
|
|
51
63
|
toggleable: {
|
|
52
64
|
type: String,
|
|
53
65
|
default: void 0
|
|
@@ -62,17 +74,24 @@ export default defineComponent({
|
|
|
62
74
|
event: "update:modelValue"
|
|
63
75
|
},
|
|
64
76
|
emits: ["update:modelValue"],
|
|
65
|
-
setup(props) {
|
|
77
|
+
setup(props, { slots }) {
|
|
66
78
|
provide(SIDEBAR_SETTINGS, {
|
|
67
79
|
variant: props.variant,
|
|
68
80
|
align: props.align,
|
|
69
81
|
type: props.type
|
|
70
82
|
});
|
|
83
|
+
const sidebar = templateRef("sidebar");
|
|
84
|
+
const sidebarBrand = useSelector(".sidebar__brand", sidebar);
|
|
85
|
+
const brand = useElementSize(sidebarBrand);
|
|
71
86
|
const sidebarMenus = templateRef("sidebarMenus");
|
|
72
87
|
const sidebarBottom = useSelector(".sidebar__bottom", sidebarMenus);
|
|
73
|
-
const {
|
|
74
|
-
|
|
75
|
-
|
|
88
|
+
const { height } = useElementSize(sidebarBottom);
|
|
89
|
+
const brandHeight = computed(() => {
|
|
90
|
+
return slots.brand ? `${brand.height.value + titleHeight.value + 16}px` : 0;
|
|
91
|
+
});
|
|
92
|
+
const bottomHeight = computed(() => {
|
|
93
|
+
return isBottomMenu.value && !isDefault.value || !isBottomMenu.value && isDefault.value ? 0 : `${height.value + 16}px`;
|
|
94
|
+
});
|
|
76
95
|
const model = useVModel(props);
|
|
77
96
|
const classNames = computed(() => {
|
|
78
97
|
const result = [""];
|
|
@@ -84,13 +103,29 @@ export default defineComponent({
|
|
|
84
103
|
result.push(`sidebar--${props.variant}`);
|
|
85
104
|
if (props.fixed)
|
|
86
105
|
result.push("sidebar--fixed");
|
|
106
|
+
if (props.sticky)
|
|
107
|
+
result.push("sidebar--sticky");
|
|
87
108
|
if (props.toggleable)
|
|
88
109
|
result.push(`sidebar--toggleable sidebar--toggleable-${props.toggleable}`);
|
|
89
110
|
if (props.toggleable && props.fixed && model.value)
|
|
90
111
|
result.push("sidebar--show");
|
|
91
112
|
return result;
|
|
92
113
|
});
|
|
93
|
-
|
|
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
|
+
});
|
|
122
|
+
return {
|
|
123
|
+
classNames,
|
|
124
|
+
bottomHeight,
|
|
125
|
+
brandHeight,
|
|
126
|
+
isBottomMenu,
|
|
127
|
+
isDefault
|
|
128
|
+
};
|
|
94
129
|
}
|
|
95
130
|
});
|
|
96
131
|
</script>
|
|
@@ -102,6 +137,7 @@ export default defineComponent({
|
|
|
102
137
|
--p-sidebar-bg: theme(backgroundColor.DEFAULT);
|
|
103
138
|
--p-sidebar-bg-dark: theme(backgroundColor.dark.DEFAULT);
|
|
104
139
|
--p-sidebar-z-index: theme(zIndex.fixed);
|
|
140
|
+
--p-sidebar-sticky-top: theme(spacing.0);
|
|
105
141
|
|
|
106
142
|
@apply bg-[color:var(--p-sidebar-bg)] px-2 py-4;
|
|
107
143
|
@apply dark:bg-[color:var(--p-sidebar-bg-dark)];
|
|
@@ -130,7 +166,7 @@ export default defineComponent({
|
|
|
130
166
|
@apply fixed z-[var(--p-sidebar-z-index)] top-0 h-full shadow-lg overflow-y-auto;
|
|
131
167
|
|
|
132
168
|
.sidebar__menus {
|
|
133
|
-
@apply relative min-h-
|
|
169
|
+
@apply relative min-h-[calc(100%-v-bind(brandHeight))];
|
|
134
170
|
}
|
|
135
171
|
|
|
136
172
|
&:not(.sidebar--right) {
|
|
@@ -138,8 +174,12 @@ export default defineComponent({
|
|
|
138
174
|
}
|
|
139
175
|
|
|
140
176
|
.sidebar__bottom {
|
|
141
|
-
@apply absolute -bottom-
|
|
177
|
+
@apply absolute -bottom-2 w-[calc(100%+1rem)] -left-2 bg-[color:var(--p-sidebar-bg)];
|
|
142
178
|
@apply dark:bg-[color:var(--p-sidebar-bg-dark)];
|
|
179
|
+
|
|
180
|
+
.sidebar__nav {
|
|
181
|
+
@apply px-2;
|
|
182
|
+
}
|
|
143
183
|
}
|
|
144
184
|
|
|
145
185
|
/**
|
|
@@ -177,6 +217,13 @@ export default defineComponent({
|
|
|
177
217
|
}
|
|
178
218
|
}
|
|
179
219
|
|
|
220
|
+
/**
|
|
221
|
+
* Sticky sidebar
|
|
222
|
+
*/
|
|
223
|
+
&&--sticky {
|
|
224
|
+
@apply sticky top-[var(--p-sidebar-sticky-top)] z-sticky;
|
|
225
|
+
}
|
|
226
|
+
|
|
180
227
|
/**
|
|
181
228
|
* Narrow sidebar
|
|
182
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;
|
|
@@ -29,7 +33,10 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
29
33
|
};
|
|
30
34
|
}, {
|
|
31
35
|
classNames: import("vue-demi").ComputedRef<string[]>;
|
|
32
|
-
|
|
36
|
+
bottomHeight: import("vue-demi").ComputedRef<string | 0>;
|
|
37
|
+
brandHeight: import("vue-demi").ComputedRef<string | 0>;
|
|
38
|
+
isBottomMenu: import("vue-demi").Ref<boolean>;
|
|
39
|
+
isDefault: import("vue-demi").Ref<boolean>;
|
|
33
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<{
|
|
34
41
|
variant: {
|
|
35
42
|
type: PropType<StyleVariant>;
|
|
@@ -47,6 +54,10 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
47
54
|
type: BooleanConstructor;
|
|
48
55
|
default: boolean;
|
|
49
56
|
};
|
|
57
|
+
sticky: {
|
|
58
|
+
type: BooleanConstructor;
|
|
59
|
+
default: boolean;
|
|
60
|
+
};
|
|
50
61
|
toggleable: {
|
|
51
62
|
type: PropType<ToggleableVariant>;
|
|
52
63
|
default: undefined;
|
|
@@ -64,5 +75,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
64
75
|
modelValue: boolean;
|
|
65
76
|
align: AlignVariant;
|
|
66
77
|
toggleable: ToggleableVariant;
|
|
78
|
+
sticky: boolean;
|
|
67
79
|
}, {}>;
|
|
68
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>
|
|
@@ -59,7 +60,9 @@
|
|
|
59
60
|
</NavItem>
|
|
60
61
|
</template>
|
|
61
62
|
</SidebarNav>
|
|
62
|
-
<template
|
|
63
|
+
<template
|
|
64
|
+
v-if="$slots.bottom"
|
|
65
|
+
#bottom>
|
|
63
66
|
<slot name="bottom" />
|
|
64
67
|
</template>
|
|
65
68
|
</Sidebar>
|
|
@@ -87,6 +90,10 @@ export default defineComponent({
|
|
|
87
90
|
type: Boolean,
|
|
88
91
|
default: false
|
|
89
92
|
},
|
|
93
|
+
sticky: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: false
|
|
96
|
+
},
|
|
90
97
|
type: {
|
|
91
98
|
type: String,
|
|
92
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;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function capitalize(text: string):
|
|
2
|
-
export declare function formatName(text: string):
|
|
1
|
+
export declare function capitalize(text: string): any;
|
|
2
|
+
export declare function formatName(text: string): any;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export function capitalize(text) {
|
|
2
|
-
return String(text).toLowerCase().
|
|
2
|
+
return String(text).toLowerCase().replaceAll(/^\w|([\s,.])(\w)/gm, (i) => i.toUpperCase());
|
|
3
3
|
}
|
|
4
4
|
export function formatName(text) {
|
|
5
5
|
if (!text)
|
|
6
6
|
return "";
|
|
7
|
-
return capitalize(String(text).trim().
|
|
7
|
+
return capitalize(String(text).trim().replaceAll(/[^\s,.A-Za-z]+/g, ""));
|
|
8
8
|
}
|
|
@@ -94,8 +94,8 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
94
94
|
onPrev?: ((...args: any[]) => any) | undefined;
|
|
95
95
|
}, {
|
|
96
96
|
image: string;
|
|
97
|
-
dismissable: boolean;
|
|
98
97
|
text: string;
|
|
98
|
+
dismissable: boolean;
|
|
99
99
|
title: string;
|
|
100
100
|
step: number;
|
|
101
101
|
highlight: boolean;
|
package/dist/module.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@privyid/persona",
|
|
3
3
|
"description": "Persona core package",
|
|
4
|
-
"version": "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.
|
|
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.
|
|
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.
|
|
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.
|
|
103
|
-
"@privyid/tailwind-preset": "^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",
|
|
Binary file
|