@privyid/persona 0.19.0 → 0.21.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/accordion/Accordion.vue +118 -0
- package/dist/components/accordion/AccordionItem.vue +184 -0
- package/dist/components/accordion/index.d.ts +14 -0
- package/dist/components/accordion/index.mjs +10 -0
- package/dist/components/avatar/Avatar.vue.d.ts +2 -2
- package/dist/components/badge/Badge.vue.d.ts +1 -1
- package/dist/components/breadcrumbs/BreadcrumbItem.vue +3 -2
- package/dist/components/button/Button.vue +102 -65
- package/dist/components/calendar/Calendar.vue.d.ts +2 -2
- package/dist/components/calendar/adapter/adapter.mjs +1 -1
- package/dist/components/camera/Camera.vue.d.ts +4 -4
- package/dist/components/caption/Caption.vue +30 -2
- package/dist/components/card/Card.vue +9 -1
- package/dist/components/card/Card.vue.d.ts +1 -1
- package/dist/components/card/CardSection.vue.d.ts +1 -1
- package/dist/components/checkbox/Checkbox.vue.d.ts +6 -6
- package/dist/components/contextual-bar/ContextualBar.vue.d.ts +1 -1
- package/dist/components/cropper/Cropper.vue.d.ts +2 -2
- package/dist/components/datepicker/Datepicker.vue.d.ts +2 -2
- package/dist/components/dialog/index.d.ts +1 -1
- package/dist/components/dot/Dot.vue.d.ts +1 -1
- package/dist/components/dropdown/Dropdown.vue +5 -0
- package/dist/components/dropdown/Dropdown.vue.d.ts +6 -6
- package/dist/components/dropdown/DropdownItem.vue +1 -1
- package/dist/components/dropdown/index.d.ts +1 -1
- package/dist/components/dropdown-subitem/DropdownSubitem.vue.d.ts +1 -1
- package/dist/components/dropzone/Dropzone.vue.d.ts +2 -2
- package/dist/components/filterbar/pinned/PinnedDate.vue.d.ts +2 -2
- package/dist/components/filterbar/pinned/PinnedSelect.vue.d.ts +2 -2
- package/dist/components/filterbar/pinned/PinnedToggle.vue.d.ts +6 -6
- package/dist/components/form-group/FormGroup.vue +92 -65
- package/dist/components/global/store.d.ts +27 -0
- package/dist/components/global/store.mjs +31 -0
- package/dist/components/global/utils/queue.mjs +2 -0
- package/dist/components/heading/Heading.vue +26 -2
- package/dist/components/heading/index.d.ts +1 -1
- package/dist/components/input/Input.vue.d.ts +2 -2
- package/dist/components/input/utils/accept.d.ts +19 -19
- package/dist/components/input-file/InputFile.vue.d.ts +2 -2
- package/dist/components/input-password/InputPassword.vue.d.ts +1 -3
- package/dist/components/input-pin/InputPin.vue.d.ts +1 -1
- package/dist/components/input-range/InputRange.vue.d.ts +1 -1
- package/dist/components/label/Label.vue.d.ts +1 -1
- package/dist/components/list-group/ListGroupItem.vue +1 -1
- package/dist/components/main/Main.vue +47 -44
- package/dist/components/modal/Modal.vue +1 -1
- package/dist/components/modal/Modal.vue.d.ts +2 -2
- package/dist/components/modal/index.d.ts +1 -0
- package/dist/components/modal/index.mjs +0 -0
- package/dist/components/nav/Nav.vue +6 -4
- package/dist/components/nav/NavItem.vue +1 -1
- package/dist/components/nav/NavItem.vue.d.ts +2 -2
- package/dist/components/nav/NavItemDropdown.vue.d.ts +2 -2
- package/dist/components/navbar/NavbarBrand.vue +1 -1
- package/dist/components/navbar-menu/NavbarNavMenu.vue +1 -1
- package/dist/components/navbar-menu/NavbarNavMenu.vue.d.ts +3 -3
- package/dist/components/pagination/index.mjs +3 -1
- package/dist/components/pdf-object/PdfObject.vue +1 -1
- package/dist/components/pdf-text/PdfText.vue +6 -2
- package/dist/components/pdf-text/PdfText.vue.d.ts +3 -2
- package/dist/components/pdf-text/utils/text-to-image.d.ts +1 -1
- package/dist/components/pdf-text/utils/text-to-image.mjs +19 -17
- package/dist/components/pdf-viewer/PdfError.vue +12 -7
- package/dist/components/pdf-viewer/PdfError.vue.d.ts +3 -11
- package/dist/components/pdf-viewer/PdfNavigation.vue +5 -13
- package/dist/components/pdf-viewer/PdfNavigation.vue.d.ts +4 -4
- package/dist/components/pdf-viewer/PdfViewer.vue +42 -5
- package/dist/components/pdf-viewer/PdfViewer.vue.d.ts +4 -1
- package/dist/components/pdf-viewer/index.d.ts +8 -0
- package/dist/components/pdf-viewer/index.mjs +6 -1
- package/dist/components/pdf-viewer/utils/pdfjs.d.ts +8 -0
- package/dist/components/pdf-viewer/utils/pdfjs.mjs +40 -0
- package/dist/components/pdf-viewer/utils/use-sticky.mjs +7 -3
- package/dist/components/pdf-viewer/utils/use-viewer.d.ts +0 -2
- package/dist/components/pdf-viewer/utils/use-viewer.mjs +12 -18
- package/dist/components/progressbar/Progressbar.vue +110 -0
- package/dist/components/progressbar/Progressbar.vue.d.ts +63 -0
- package/dist/components/progressbar/index.d.ts +7 -0
- package/dist/components/progressbar/index.mjs +11 -0
- package/dist/components/radio/Radio.vue.d.ts +4 -4
- package/dist/components/ringbar/Ringbar.vue +148 -0
- package/dist/components/ringbar/Ringbar.vue.d.ts +66 -0
- package/dist/components/select/Select.vue.d.ts +3 -3
- package/dist/components/sheet/Sheet.vue +231 -0
- package/dist/components/sidebar/SidebarBrand.vue +1 -1
- package/dist/components/sidebar/SidebarNav.vue +6 -4
- package/dist/components/signature-draw/SignatureDrawMobile.vue +6 -1
- package/dist/components/signature-draw/utils/canvas.d.ts +1 -1
- package/dist/components/signature-draw/utils/canvas.mjs +5 -3
- package/dist/components/signature-draw/utils/smooth-line.d.ts +1 -1
- package/dist/components/signature-draw/utils/smooth-line.mjs +6 -1
- package/dist/components/signature-draw/utils/straight-line.mjs +2 -0
- package/dist/components/signature-text/SignatureText.vue +10 -7
- package/dist/components/signature-text/SignatureText.vue.d.ts +1 -0
- package/dist/components/signature-text/utils/generate-text.d.ts +1 -1
- package/dist/components/signature-text/utils/generate-text.mjs +3 -8
- package/dist/components/spread/Spread.vue +1 -1
- package/dist/components/spread/Spread.vue.d.ts +2 -2
- package/dist/components/steps/utils/hook.mjs +1 -0
- package/dist/components/subheading/Subheading.vue +36 -2
- package/dist/components/table/Table.vue +53 -9
- package/dist/components/table/Table.vue.d.ts +21 -3
- package/dist/components/table/index.d.ts +23 -6
- package/dist/components/table/index.mjs +18 -1
- package/dist/components/table-flex/TableFlex.vue +334 -0
- package/dist/components/table-static/TableStatic.vue +333 -0
- package/dist/components/tabs/Tab.vue.d.ts +1 -1
- package/dist/components/text/Text.vue +46 -13
- package/dist/components/text/Text.vue.d.ts +2 -2
- package/dist/components/toggle/Toggle.vue.d.ts +7 -7
- package/dist/components/tour/Tour.vue.d.ts +2 -4
- package/dist/components/tour/core/base.mjs +11 -0
- package/dist/components/tour/core/step/conditional.mjs +1 -0
- package/dist/components/tour/core/step/visit.mjs +1 -4
- package/dist/components/tour/core/step.mjs +1 -4
- package/dist/components/tour/core/tour.mjs +4 -0
- package/dist/components/utils/base64.mjs +3 -3
- package/dist/core/index.d.ts +5 -1
- package/dist/core/index.mjs +20 -3
- package/dist/module.d.mts +17 -0
- package/dist/module.d.ts +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +0 -1
- package/dist/runtime/plugin.mjs +10 -3
- package/dist/types.d.mts +15 -0
- package/package.json +21 -21
- package/dist/components/button/Button.vue.d.ts +0 -74
- package/dist/components/form-group/FormGroup.vue.d.ts +0 -61
- package/dist/components/global/context.d.ts +0 -24
- package/dist/components/global/context.mjs +0 -18
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="classNames"
|
|
4
|
+
data-testid="accordion">
|
|
5
|
+
<slot>
|
|
6
|
+
<Item
|
|
7
|
+
v-for="(item, i) in items"
|
|
8
|
+
:key="i"
|
|
9
|
+
:title="item.title"
|
|
10
|
+
:disabled="item.disabled">
|
|
11
|
+
<div class="p-4">
|
|
12
|
+
{{ item.content }}
|
|
13
|
+
</div>
|
|
14
|
+
</Item>
|
|
15
|
+
</slot>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script lang="ts" setup>
|
|
20
|
+
import { useVModel } from '@vueuse/core'
|
|
21
|
+
import { type AccordionItem, ACCORDION_CONTEXT } from '.'
|
|
22
|
+
import {
|
|
23
|
+
PropType, computed, provide, readonly,
|
|
24
|
+
} from 'vue-demi'
|
|
25
|
+
import Item from './AccordionItem.vue'
|
|
26
|
+
|
|
27
|
+
defineOptions({ name: 'Accordion' })
|
|
28
|
+
|
|
29
|
+
const props = defineProps({
|
|
30
|
+
multiple: {
|
|
31
|
+
type : Boolean,
|
|
32
|
+
default: false,
|
|
33
|
+
},
|
|
34
|
+
flush: {
|
|
35
|
+
type : Boolean,
|
|
36
|
+
default: false,
|
|
37
|
+
},
|
|
38
|
+
pill: {
|
|
39
|
+
type : Boolean,
|
|
40
|
+
default: false,
|
|
41
|
+
},
|
|
42
|
+
modelValue: {
|
|
43
|
+
type : String,
|
|
44
|
+
default: undefined,
|
|
45
|
+
},
|
|
46
|
+
noCaret: {
|
|
47
|
+
type : Boolean,
|
|
48
|
+
default: false,
|
|
49
|
+
},
|
|
50
|
+
items: {
|
|
51
|
+
type : Array as PropType<AccordionItem[]>,
|
|
52
|
+
default: () => ([] as AccordionItem[]),
|
|
53
|
+
},
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
const emit = defineEmits<{
|
|
57
|
+
'update:modelValue': [value: string],
|
|
58
|
+
}>()
|
|
59
|
+
|
|
60
|
+
const modelValue = useVModel(props, 'modelValue', emit, { passive: true })
|
|
61
|
+
|
|
62
|
+
const classNames = computed(() => {
|
|
63
|
+
const result: string[] = ['accordion']
|
|
64
|
+
|
|
65
|
+
if (props.flush)
|
|
66
|
+
result.push('accordion--flush')
|
|
67
|
+
|
|
68
|
+
if (props.pill)
|
|
69
|
+
result.push('accordion--pills')
|
|
70
|
+
|
|
71
|
+
return result
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
function setOpenItem (id: string): void {
|
|
75
|
+
modelValue.value = id
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
provide(ACCORDION_CONTEXT, {
|
|
79
|
+
openItem: readonly(modelValue),
|
|
80
|
+
multiple: props.multiple,
|
|
81
|
+
noCaret : props.noCaret,
|
|
82
|
+
setOpenItem,
|
|
83
|
+
})
|
|
84
|
+
</script>
|
|
85
|
+
|
|
86
|
+
<style lang="postcss">
|
|
87
|
+
.accordion {
|
|
88
|
+
@apply flex flex-col w-full;
|
|
89
|
+
@apply border border-default rounded;
|
|
90
|
+
@apply dark:border-dark-default;
|
|
91
|
+
|
|
92
|
+
& > &__item {
|
|
93
|
+
@apply first:rounded-t last:rounded-b;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&--pills {
|
|
97
|
+
@apply gap-2 border-0 rounded-none;
|
|
98
|
+
|
|
99
|
+
> .accordion__item {
|
|
100
|
+
@apply border rounded border-default;
|
|
101
|
+
@apply dark:border-dark-default;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&:not(&--pills) {
|
|
106
|
+
@apply divide-y divide-default;
|
|
107
|
+
@apply dark:divide-dark-default;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&--flush {
|
|
111
|
+
@apply border-0 rounded-none;
|
|
112
|
+
|
|
113
|
+
> .accordion__item {
|
|
114
|
+
@apply first:rounded-none last:rounded-none;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
</style>
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="classNames"
|
|
4
|
+
data-testid="accordion-item"
|
|
5
|
+
:disabled="disabled"
|
|
6
|
+
:data-accordion-item-id="uid">
|
|
7
|
+
<slot
|
|
8
|
+
name="activator"
|
|
9
|
+
:toggle="toggle"
|
|
10
|
+
:expanded="model">
|
|
11
|
+
<div
|
|
12
|
+
class="accordion__item__activator"
|
|
13
|
+
data-testid="accordion-item-activator"
|
|
14
|
+
@click="toggle">
|
|
15
|
+
<Subheading>
|
|
16
|
+
{{ title }}
|
|
17
|
+
</Subheading>
|
|
18
|
+
<slot
|
|
19
|
+
v-if="!hideCaret"
|
|
20
|
+
name="caret"
|
|
21
|
+
:expanded="model">
|
|
22
|
+
<ChevronUp
|
|
23
|
+
v-if="model"
|
|
24
|
+
class="accordion__item__caret"
|
|
25
|
+
data-testid="accordion-item-caret" />
|
|
26
|
+
<ChevronDown
|
|
27
|
+
v-else
|
|
28
|
+
class="accordion__item__caret"
|
|
29
|
+
data-testid="accordion-item-caret" />
|
|
30
|
+
</slot>
|
|
31
|
+
</div>
|
|
32
|
+
</slot>
|
|
33
|
+
|
|
34
|
+
<Collapse
|
|
35
|
+
:when="model"
|
|
36
|
+
class="accordion__item__content"
|
|
37
|
+
data-testid="accordion-item-content">
|
|
38
|
+
<slot :expanded="model" />
|
|
39
|
+
</Collapse>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script lang="ts" setup>
|
|
44
|
+
import { useVModel } from '@vueuse/core'
|
|
45
|
+
import { ACCORDION_CONTEXT, generateId } from '.'
|
|
46
|
+
import {
|
|
47
|
+
computed, inject, watch,
|
|
48
|
+
} from 'vue-demi'
|
|
49
|
+
|
|
50
|
+
import Subheading from '../subheading/Subheading.vue'
|
|
51
|
+
import { Collapse } from 'vue-collapsed'
|
|
52
|
+
import ChevronUp from '@privyid/persona-icon/vue/chevron-up/16.vue'
|
|
53
|
+
import ChevronDown from '@privyid/persona-icon/vue/chevron-down/16.vue'
|
|
54
|
+
|
|
55
|
+
const uid = generateId(undefined, 'accordion-item')
|
|
56
|
+
|
|
57
|
+
const parentData = inject(ACCORDION_CONTEXT)
|
|
58
|
+
|
|
59
|
+
const props = defineProps({
|
|
60
|
+
modelValue: {
|
|
61
|
+
type : Boolean,
|
|
62
|
+
default: false,
|
|
63
|
+
},
|
|
64
|
+
title: {
|
|
65
|
+
type : String,
|
|
66
|
+
default: '',
|
|
67
|
+
},
|
|
68
|
+
disabled: {
|
|
69
|
+
type : Boolean,
|
|
70
|
+
default: false,
|
|
71
|
+
},
|
|
72
|
+
noCaret: {
|
|
73
|
+
type : Boolean,
|
|
74
|
+
default: false,
|
|
75
|
+
},
|
|
76
|
+
})
|
|
77
|
+
const emit = defineEmits([
|
|
78
|
+
'update:modelValue',
|
|
79
|
+
'expand',
|
|
80
|
+
'collapse',
|
|
81
|
+
])
|
|
82
|
+
|
|
83
|
+
const model = useVModel(props, 'modelValue', emit, { passive: true })
|
|
84
|
+
|
|
85
|
+
const hideCaret = computed(() => {
|
|
86
|
+
return props.noCaret || (parentData?.noCaret)
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
const classNames = computed(() => {
|
|
90
|
+
const result: string[] = ['accordion__item']
|
|
91
|
+
|
|
92
|
+
if (props.disabled)
|
|
93
|
+
result.push('accordion__item--disabled')
|
|
94
|
+
|
|
95
|
+
if (model.value)
|
|
96
|
+
result.push('expanded')
|
|
97
|
+
else
|
|
98
|
+
result.push('collapsed')
|
|
99
|
+
|
|
100
|
+
return result
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
function toggle () {
|
|
104
|
+
if (props.disabled)
|
|
105
|
+
return
|
|
106
|
+
|
|
107
|
+
model.value = !model.value
|
|
108
|
+
|
|
109
|
+
if (!model.value && !parentData?.multiple)
|
|
110
|
+
parentData?.setOpenItem('')
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
watch(
|
|
114
|
+
() => parentData?.openItem.value,
|
|
115
|
+
() => {
|
|
116
|
+
model.value = parentData?.openItem.value === uid.value && !parentData?.multiple
|
|
117
|
+
},
|
|
118
|
+
)
|
|
119
|
+
watch(
|
|
120
|
+
() => model.value,
|
|
121
|
+
(value) => {
|
|
122
|
+
if (value && !parentData?.multiple) parentData?.setOpenItem(uid.value)
|
|
123
|
+
|
|
124
|
+
if (value)
|
|
125
|
+
emit('expand')
|
|
126
|
+
else
|
|
127
|
+
emit('collapse')
|
|
128
|
+
},
|
|
129
|
+
)
|
|
130
|
+
</script>
|
|
131
|
+
|
|
132
|
+
<style lang="postcss">
|
|
133
|
+
.accordion__item {
|
|
134
|
+
--p-accordion-bg: theme(backgroundColor.default.DEFAULT);
|
|
135
|
+
--p-accordion-bg-dark: theme(backgroundColor.dark.default.DEFAULT);
|
|
136
|
+
--p-accordion-collapsed-border: theme(borderColor.default.DEFAULT);
|
|
137
|
+
--p-accordion-collapsed-border-dark: theme(borderColor.dark.default.DEFAULT);
|
|
138
|
+
--p-accordion-expanded-border: theme(borderColor.default.DEFAULT);
|
|
139
|
+
--p-accordion-expanded-border-dark: theme(borderColor.dark.default.DEFAULT);
|
|
140
|
+
|
|
141
|
+
@apply w-full bg-[color:var(--p-accordion-bg)];
|
|
142
|
+
@apply dark:bg-[color:var(--p-accordion-bg-dark)];
|
|
143
|
+
|
|
144
|
+
&:not(.accordion &) {
|
|
145
|
+
@apply rounded border;
|
|
146
|
+
|
|
147
|
+
&.collapsed {
|
|
148
|
+
@apply border-[color:var(--p-accordion-collapsed-border)];
|
|
149
|
+
@apply dark:border-[color:var(--p-accordion-collapsed-border-dark)];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&.expanded {
|
|
153
|
+
@apply border-[color:var(--p-accordion-expanded-border)];
|
|
154
|
+
@apply dark:border-[color:var(--p-accordion-expanded-border-dark)];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.accordion__item__activator {
|
|
158
|
+
@apply bg-default-alpha;
|
|
159
|
+
@apply dark:bg-dark-default-alpha;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&__activator {
|
|
164
|
+
@apply flex justify-between items-center p-4 cursor-pointer;
|
|
165
|
+
|
|
166
|
+
.expanded & {
|
|
167
|
+
@apply bg-default-alpha;
|
|
168
|
+
@apply dark:bg-dark-default-alpha;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
&:is(&--disabled) {
|
|
173
|
+
@apply pointer-events-none;
|
|
174
|
+
|
|
175
|
+
> .accordion__item__activator {
|
|
176
|
+
@apply opacity-50;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&__content {
|
|
181
|
+
@apply transition-[height] duration-300 ease-out;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ComputedRef, type MaybeRefOrGetter, type InjectionKey, type Ref } from 'vue';
|
|
2
|
+
export interface AccordionItem {
|
|
3
|
+
title: string;
|
|
4
|
+
content: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const ACCORDION_CONTEXT: InjectionKey<{
|
|
8
|
+
openItem: Readonly<Ref<string | undefined>>;
|
|
9
|
+
multiple: boolean;
|
|
10
|
+
noCaret: boolean;
|
|
11
|
+
setOpenItem: (id: string) => void;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function defineAccordion(items: AccordionItem[]): AccordionItem[];
|
|
14
|
+
export declare const generateId: (id?: MaybeRefOrGetter<string | undefined>, suffix?: string) => ComputedRef<string>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
toValue
|
|
4
|
+
} from "vue";
|
|
5
|
+
export const ACCORDION_CONTEXT = Symbol("accordion");
|
|
6
|
+
export function defineAccordion(items) {
|
|
7
|
+
return items;
|
|
8
|
+
}
|
|
9
|
+
const getId = (suffix = "") => `${suffix}__${Math.random().toString().slice(2, 8)}`;
|
|
10
|
+
export const generateId = (id, suffix) => computed(() => toValue(id) ?? getId(suffix));
|
|
@@ -22,7 +22,7 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
22
22
|
default: string;
|
|
23
23
|
};
|
|
24
24
|
imgClass: {
|
|
25
|
-
type: (StringConstructor |
|
|
25
|
+
type: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
|
|
26
26
|
default: undefined;
|
|
27
27
|
};
|
|
28
28
|
}, {
|
|
@@ -51,7 +51,7 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
51
51
|
default: string;
|
|
52
52
|
};
|
|
53
53
|
imgClass: {
|
|
54
|
-
type: (StringConstructor |
|
|
54
|
+
type: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
|
|
55
55
|
default: undefined;
|
|
56
56
|
};
|
|
57
57
|
}>> & {
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
:class="classNames">
|
|
6
6
|
<component
|
|
7
7
|
:is="tagName"
|
|
8
|
-
:href="permalink"
|
|
8
|
+
:href="permalink"
|
|
9
|
+
:class="{ 'breadcrumbs__item__link' : permalink }">
|
|
9
10
|
<slot />
|
|
10
11
|
</component>
|
|
11
12
|
<div
|
|
@@ -82,7 +83,7 @@ export default defineComponent({
|
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
|
|
85
|
-
& >
|
|
86
|
+
& > .breadcrumbs__item__link {
|
|
86
87
|
@apply text-subtle cursor-pointer underline decoration-solid hover:no-underline;
|
|
87
88
|
@apply dark:text-dark-subtle;
|
|
88
89
|
}
|
|
@@ -4,77 +4,108 @@
|
|
|
4
4
|
:href="href"
|
|
5
5
|
:type="type"
|
|
6
6
|
data-testid="btn"
|
|
7
|
-
:class="classNames"
|
|
8
|
-
|
|
7
|
+
:class="classNames"
|
|
8
|
+
:disabled="loading || disabled">
|
|
9
|
+
<spinner v-if="loading" />
|
|
10
|
+
<slot v-else />
|
|
9
11
|
</component>
|
|
10
12
|
</template>
|
|
11
13
|
|
|
12
|
-
<script>
|
|
14
|
+
<script lang="ts" setup>
|
|
13
15
|
import {
|
|
14
16
|
computed,
|
|
15
|
-
|
|
16
|
-
inject
|
|
17
|
-
} from
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
icon: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: false
|
|
37
|
-
},
|
|
38
|
-
pill: {
|
|
39
|
-
type: Boolean,
|
|
40
|
-
default: false
|
|
41
|
-
},
|
|
42
|
-
href: {
|
|
43
|
-
type: [String, Object],
|
|
44
|
-
default: void 0
|
|
45
|
-
},
|
|
46
|
-
type: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: "button"
|
|
49
|
-
}
|
|
17
|
+
PropType,
|
|
18
|
+
inject,
|
|
19
|
+
} from 'vue-demi'
|
|
20
|
+
import type { RouteLocationRaw } from 'vue-router'
|
|
21
|
+
import {
|
|
22
|
+
ColorVariant,
|
|
23
|
+
SizeVariant,
|
|
24
|
+
StyleVariant,
|
|
25
|
+
TypeVariant,
|
|
26
|
+
} from '.'
|
|
27
|
+
import { BUTTONGROUP_SETTING } from '../button-group'
|
|
28
|
+
import { INPUTGROUP_SETTING } from '../input-group'
|
|
29
|
+
import Spinner from '../spinner/SpinnerRinggo.vue'
|
|
30
|
+
|
|
31
|
+
const props = defineProps({
|
|
32
|
+
variant: {
|
|
33
|
+
type : String as PropType<StyleVariant>,
|
|
34
|
+
default: 'solid',
|
|
50
35
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
36
|
+
color: {
|
|
37
|
+
type : String as PropType<ColorVariant>,
|
|
38
|
+
default: 'default',
|
|
39
|
+
},
|
|
40
|
+
size: {
|
|
41
|
+
type : String as PropType<SizeVariant>,
|
|
42
|
+
default: 'md',
|
|
43
|
+
},
|
|
44
|
+
icon: {
|
|
45
|
+
type : Boolean,
|
|
46
|
+
default: false,
|
|
47
|
+
},
|
|
48
|
+
pill: {
|
|
49
|
+
type : Boolean,
|
|
50
|
+
default: false,
|
|
51
|
+
},
|
|
52
|
+
href: {
|
|
53
|
+
type : [String, Object] as PropType<string | RouteLocationRaw>,
|
|
54
|
+
default: undefined,
|
|
55
|
+
},
|
|
56
|
+
type: {
|
|
57
|
+
type : String as PropType<TypeVariant>,
|
|
58
|
+
default: 'button',
|
|
59
|
+
},
|
|
60
|
+
disabled: {
|
|
61
|
+
type : Boolean,
|
|
62
|
+
default: false,
|
|
63
|
+
},
|
|
64
|
+
loading: {
|
|
65
|
+
type : Boolean,
|
|
66
|
+
default: false,
|
|
67
|
+
},
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
const inputSetting = inject(INPUTGROUP_SETTING, undefined, false)
|
|
71
|
+
const buttonSetting = inject(BUTTONGROUP_SETTING, undefined, false)
|
|
72
|
+
|
|
73
|
+
const classNames = computed(() => {
|
|
74
|
+
const result: string[] = ['btn']
|
|
75
|
+
|
|
76
|
+
if (props.color)
|
|
77
|
+
result.push(`btn--${props.color}`)
|
|
78
|
+
|
|
79
|
+
if (props.variant)
|
|
80
|
+
result.push(`btn--variant-${props.variant}`)
|
|
81
|
+
|
|
82
|
+
if (props.loading)
|
|
83
|
+
result.push('btn--loading')
|
|
84
|
+
|
|
85
|
+
// eslint-disable-next-line unicorn/explicit-length-check
|
|
86
|
+
if (inputSetting?.size.value)
|
|
87
|
+
result.push(`btn--${inputSetting?.size.value}`)
|
|
88
|
+
// eslint-disable-next-line unicorn/explicit-length-check
|
|
89
|
+
else if (buttonSetting?.size.value)
|
|
90
|
+
result.push(`btn--${buttonSetting?.size.value}`)
|
|
91
|
+
// eslint-disable-next-line unicorn/explicit-length-check
|
|
92
|
+
else if (props.size)
|
|
93
|
+
result.push(`btn--${props.size}`)
|
|
94
|
+
|
|
95
|
+
if (props.icon)
|
|
96
|
+
result.push('btn--icon')
|
|
97
|
+
|
|
98
|
+
if (props.pill)
|
|
99
|
+
result.push('btn--pill')
|
|
100
|
+
|
|
101
|
+
return result
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
const tagName = computed(() => {
|
|
105
|
+
return props.href
|
|
106
|
+
? 'nuxt-link'
|
|
107
|
+
: 'button'
|
|
108
|
+
})
|
|
78
109
|
</script>
|
|
79
110
|
|
|
80
111
|
<style lang="postcss">
|
|
@@ -320,5 +351,11 @@ export default defineComponent({
|
|
|
320
351
|
&&--pill {
|
|
321
352
|
@apply rounded-full;
|
|
322
353
|
}
|
|
354
|
+
|
|
355
|
+
&--loading {
|
|
356
|
+
.spinner {
|
|
357
|
+
@apply h-6;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
323
360
|
}
|
|
324
361
|
</style>
|
|
@@ -179,14 +179,14 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
179
179
|
"onUpdate:start"?: ((...args: any[]) => any) | undefined;
|
|
180
180
|
"onUpdate:end"?: ((...args: any[]) => any) | undefined;
|
|
181
181
|
}, {
|
|
182
|
+
modelValue: Date | [Date, Date];
|
|
182
183
|
start: Date;
|
|
184
|
+
mode: "date" | "month" | "year";
|
|
183
185
|
end: Date;
|
|
184
186
|
min: Date;
|
|
185
187
|
max: Date;
|
|
186
|
-
modelValue: Date | [Date, Date];
|
|
187
188
|
disabled: boolean;
|
|
188
189
|
readonly: boolean;
|
|
189
|
-
mode: "date" | "month" | "year";
|
|
190
190
|
range: boolean;
|
|
191
191
|
minRange: string;
|
|
192
192
|
maxRange: string;
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "date-fns";
|
|
4
4
|
import id from "date-fns/locale/id/index";
|
|
5
5
|
import en from "date-fns/locale/en-US/index";
|
|
6
|
-
import { getLang } from "../../global/
|
|
6
|
+
import { getLang } from "../../global/store.mjs";
|
|
7
7
|
import { chunk } from "lodash-es";
|
|
8
8
|
const localePacks = { en, id };
|
|
9
9
|
export const CalendarFormat = [
|
|
@@ -49,7 +49,7 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
49
49
|
toast: (text: string) => void;
|
|
50
50
|
deviceId: ComputedRef<string | undefined>;
|
|
51
51
|
constraints: ComputedRef<MediaStreamConstraints>;
|
|
52
|
-
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, ("change" | "
|
|
52
|
+
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, ("change" | "update:modelValue" | "result" | "start")[], "change" | "update:modelValue" | "result" | "start", import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
53
53
|
modelValue: {
|
|
54
54
|
type: PropType<string | string[] | File | File[]>;
|
|
55
55
|
default: string;
|
|
@@ -81,13 +81,13 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
81
81
|
}>> & {
|
|
82
82
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
83
83
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
84
|
-
onStart?: ((...args: any[]) => any) | undefined;
|
|
85
84
|
onResult?: ((...args: any[]) => any) | undefined;
|
|
85
|
+
onStart?: ((...args: any[]) => any) | undefined;
|
|
86
86
|
}, {
|
|
87
|
-
|
|
87
|
+
facingMode: ConstrainDOMString;
|
|
88
88
|
mask: MaskVariant;
|
|
89
89
|
mirror: boolean | "preview" | "all";
|
|
90
|
-
|
|
90
|
+
modelValue: string | string[] | File | File[];
|
|
91
91
|
modelModifiers: ModelModifier;
|
|
92
92
|
adapter: Adapter;
|
|
93
93
|
silent: boolean;
|
|
@@ -44,8 +44,12 @@ export default defineComponent({
|
|
|
44
44
|
|
|
45
45
|
<style lang="postcss">
|
|
46
46
|
.caption {
|
|
47
|
-
@apply block text-
|
|
48
|
-
|
|
47
|
+
@apply block text-xs tracking-wide;
|
|
48
|
+
|
|
49
|
+
&:not([class^='text-'], [class*='text-']) {
|
|
50
|
+
@apply text-muted;
|
|
51
|
+
@apply dark:text-dark-muted;
|
|
52
|
+
}
|
|
49
53
|
|
|
50
54
|
/**
|
|
51
55
|
* Caption in tiny size
|
|
@@ -57,10 +61,26 @@ export default defineComponent({
|
|
|
57
61
|
/**
|
|
58
62
|
* Weight of caption
|
|
59
63
|
*/
|
|
64
|
+
&--thin {
|
|
65
|
+
@apply font-thin;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&--extralight {
|
|
69
|
+
@apply font-extralight;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&--light {
|
|
73
|
+
@apply font-light;
|
|
74
|
+
}
|
|
75
|
+
|
|
60
76
|
&--normal {
|
|
61
77
|
@apply font-normal;
|
|
62
78
|
}
|
|
63
79
|
|
|
80
|
+
&--semibold {
|
|
81
|
+
@apply font-semibold;
|
|
82
|
+
}
|
|
83
|
+
|
|
64
84
|
&--medium {
|
|
65
85
|
@apply font-medium;
|
|
66
86
|
}
|
|
@@ -69,6 +89,14 @@ export default defineComponent({
|
|
|
69
89
|
@apply font-bold;
|
|
70
90
|
}
|
|
71
91
|
|
|
92
|
+
&--extrabold {
|
|
93
|
+
@apply font-extrabold;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&--black {
|
|
97
|
+
@apply font-black;
|
|
98
|
+
}
|
|
99
|
+
|
|
72
100
|
/**
|
|
73
101
|
* Text transform
|
|
74
102
|
* of caption
|
|
@@ -139,9 +139,17 @@ export default defineComponent({
|
|
|
139
139
|
--p-card-color: theme(textColor.default);
|
|
140
140
|
--p-card-color-dark: theme(textColor.dark.default);
|
|
141
141
|
|
|
142
|
-
@apply border bg-[color:var(--p-card-bg)] border-[color:var(--p-card-border)] text-[color:var(--p-card-color)] rounded;
|
|
142
|
+
@apply border bg-[color:var(--p-card-bg)] border-[color:var(--p-card-border)] text-[color:var(--p-card-color)] rounded-md;
|
|
143
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)];
|
|
144
144
|
|
|
145
|
+
/**
|
|
146
|
+
* Card inside card
|
|
147
|
+
* has 8px rounded
|
|
148
|
+
*/
|
|
149
|
+
.card {
|
|
150
|
+
@apply rounded;
|
|
151
|
+
}
|
|
152
|
+
|
|
145
153
|
/*
|
|
146
154
|
* Card Body & Card Header
|
|
147
155
|
* by default have 24px (1.5rem) padding
|