@weni/unnnic-system 3.8.2-alpha.2 → 3.9.1-alpha.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/CHANGELOG.md +8 -0
- package/dist/components/MultiSelect/MultiSelect.vue.d.ts +6 -0
- package/dist/components/PageHeader/PageHeader.vue.d.ts +28 -0
- package/dist/components/PageHeader/PageHeader.vue.d.ts.map +1 -0
- package/dist/components/PageHeader/index.d.ts +3 -0
- package/dist/components/PageHeader/index.d.ts.map +1 -0
- package/dist/components/PageHeader/types.d.ts +9 -0
- package/dist/components/PageHeader/types.d.ts.map +1 -0
- package/dist/components/Radio/Radio.vue.d.ts +2 -0
- package/dist/components/Radio/Radio.vue.d.ts.map +1 -1
- package/dist/components/Tag/DefaultTag.vue.d.ts.map +1 -1
- package/dist/components/TextArea/TextArea.vue.d.ts +9 -0
- package/dist/components/TextArea/TextArea.vue.d.ts.map +1 -1
- package/dist/components/index.d.ts +312 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/ui/dialog/DialogHeader.vue.d.ts.map +1 -1
- package/dist/components/ui/tabs/Tabs.vue.d.ts +24 -0
- package/dist/components/ui/tabs/Tabs.vue.d.ts.map +1 -0
- package/dist/components/ui/tabs/TabsContent.vue.d.ts +23 -0
- package/dist/components/ui/tabs/TabsContent.vue.d.ts.map +1 -0
- package/dist/components/ui/tabs/TabsList.vue.d.ts +23 -0
- package/dist/components/ui/tabs/TabsList.vue.d.ts.map +1 -0
- package/dist/components/ui/tabs/TabsTrigger.vue.d.ts +23 -0
- package/dist/components/ui/tabs/TabsTrigger.vue.d.ts.map +1 -0
- package/dist/components/ui/tabs/index.d.ts +5 -0
- package/dist/components/ui/tabs/index.d.ts.map +1 -0
- package/dist/{es-4f3d094b.mjs → es-ed9b7d22.mjs} +1 -1
- package/dist/{index-43281ff3.mjs → index-bbfce723.mjs} +9572 -8837
- package/dist/{pt-br-8a34ccb7.mjs → pt-br-8c45d7e7.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +165 -153
- package/dist/unnnic.umd.js +39 -36
- package/package.json +1 -1
- package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +11 -7
- package/src/components/Alert/__tests__/__snapshots__/Version1dot1.spec.js.snap +1 -1
- package/src/components/AvatarIcon/__tests__/__snapshots__/AvatarIcon.spec.js.snap +1 -1
- package/src/components/Collapse/__tests__/__snapshots__/Collapse.spec.js.snap +1 -3
- package/src/components/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +3 -3
- package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +14 -5
- package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +1 -1
- package/src/components/Label/__tests__/__snapshots__/Label.spec.js.snap +1 -1
- package/src/components/PageHeader/PageHeader.vue +154 -0
- package/src/components/PageHeader/index.ts +2 -0
- package/src/components/PageHeader/types.ts +10 -0
- package/src/components/Radio/Radio.vue +23 -2
- package/src/components/Radio/__test__/__snapshots__/Radio.spec.js.snap +3 -3
- package/src/components/Switch/__tests__/__snapshots__/Switch.spec.js.snap +5 -6
- package/src/components/Tab/__test__/__snapshots__/Tab.spec.js.snap +1 -1
- package/src/components/Tag/DefaultTag.vue +5 -0
- package/src/components/TextArea/TextArea.vue +6 -0
- package/src/components/TextArea/__test__/__snapshots__/TextArea.spec.js.snap +11 -3
- package/src/components/Toast/Toast.vue +4 -4
- package/src/components/Toast/__tests__/Toast.spec.js +9 -2
- package/src/components/index.ts +22 -0
- package/src/components/ui/dialog/DialogHeader.vue +1 -0
- package/src/components/ui/tabs/Tabs.vue +19 -0
- package/src/components/ui/tabs/TabsContent.vue +22 -0
- package/src/components/ui/tabs/TabsList.vue +34 -0
- package/src/components/ui/tabs/TabsTrigger.vue +79 -0
- package/src/components/ui/tabs/index.ts +4 -0
- package/src/stories/PageHeader.stories.js +330 -0
- package/src/stories/Radio.stories.js +28 -1
- package/src/stories/Tabs.stories.js +125 -0
- package/src/stories/TextArea.stories.js +1 -0
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`UnnnicAlert.vue > matches the snapshot 1`] = `
|
|
4
|
-
"<
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
"<transition-stub data-v-c3231c18="" name="toast-slide" appear="true" persisted="false" css="true" data-testid="toast-transition">
|
|
5
|
+
<aside data-v-c3231c18="" class="unnnic-toast unnnic-toast--success" role="status" aria-live="polite" data-testid="toast">
|
|
6
|
+
<section data-v-c3231c18="" class="unnnic-toast__content" data-testid="toast-content">
|
|
7
|
+
<header data-v-c3231c18="" class="unnnic-toast__header" data-testid="toast-header"><span data-v-26446d8e="" data-v-c3231c18="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--green-500 unnnic-icon-size--ant unnnic-icon__size--ant" data-testid="toast-type-icon" translate="no">check_circle</span>
|
|
8
|
+
<h3 data-v-c3231c18="" class="unnnic-toast__title" data-testid="toast-title">Test Alert</h3><span data-v-26446d8e="" data-v-c3231c18="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--neutral-dark unnnic-icon-size--ant unnnic-icon__size--ant unnnic--clickable unnnic-toast__close" data-testid="toast-close-icon" translate="no">close</span>
|
|
9
|
+
</header>
|
|
10
|
+
<!--v-if-->
|
|
11
|
+
</section>
|
|
12
|
+
<!--v-if-->
|
|
13
|
+
</aside>
|
|
14
|
+
</transition-stub>"
|
|
11
15
|
`;
|
|
@@ -6,7 +6,7 @@ exports[`Alert.vue > matches snapshot 1`] = `
|
|
|
6
6
|
<div data-v-fb94f284="" class="alert__progress"></div>
|
|
7
7
|
<div data-v-fb94f284="" class="alert__text">Test Alert</div>
|
|
8
8
|
<div data-v-fb94f284="" class="alert__close">
|
|
9
|
-
<unnnic-icon-stub data-v-fb94f284="" filled="false"
|
|
9
|
+
<unnnic-icon-stub data-v-fb94f284="" filled="false" icon="close-1" clickable="false" size="sm" scheme="neutral-white"></unnnic-icon-stub>
|
|
10
10
|
</div>
|
|
11
11
|
</div>
|
|
12
12
|
</div>"
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`AvatarIcon.vue > matches the snapshot 1`] = `
|
|
4
4
|
"<div data-v-5f185a90="" class="unnnic-avatar-icon aux-blue sm">
|
|
5
|
-
<unnnic-icon-stub data-v-5f185a90="" filled="false"
|
|
5
|
+
<unnnic-icon-stub data-v-5f185a90="" filled="false" icon="graph-stats-1" clickable="false" size="md" scheme="aux-blue"></unnnic-icon-stub>
|
|
6
6
|
</div>"
|
|
7
7
|
`;
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`Collapse.vue > matches the snapshot 1`] = `
|
|
4
4
|
"<div data-v-7d0d9fbd="" data-testid="collapse" class="unnnic-collapse unnnic-collapse--size-lg">
|
|
5
|
-
<div data-v-7d0d9fbd="" data-testid="collapse-header" class="unnnic-collapse__header">Test Title<
|
|
6
|
-
<path d="M5.31471 14.0096L19.0432 29.5967C19.1676 29.7264 19.3169 29.8296 19.4822 29.9001C19.6474 29.9707 19.8253 30.007 20.005 30.007C20.1847 30.007 20.3625 29.9707 20.5278 29.9001C20.6931 29.8296 20.8424 29.7264 20.9668 29.5967L34.689 14.0096C34.7987 13.886 34.8825 13.7415 34.9353 13.5849C34.9882 13.4282 35.009 13.2625 34.9965 13.0977C34.984 12.9328 34.9385 12.7721 34.8627 12.6252C34.7869 12.4783 34.6824 12.3481 34.5553 12.2423L32.243 10.2963C31.9852 10.0789 31.6522 9.97163 31.316 9.99759C30.9797 10.0235 30.6671 10.1807 30.4457 10.435L20.2406 22.25C20.2112 22.2841 20.1749 22.3114 20.134 22.3302C20.0931 22.3489 20.0487 22.3587 20.0037 22.3587C19.9588 22.3587 19.9143 22.3489 19.8734 22.3302C19.8326 22.3114 19.7962 22.2841 19.7669 22.25L9.558 10.4338C9.33639 10.1806 9.02374 10.0252 8.68809 10.0013C8.52167 9.9865 8.35397 10.0052 8.19489 10.0563C8.03582 10.1074 7.8886 10.1898 7.76195 10.2988L5.44845 12.2423C5.32061 12.3479 5.21534 12.4781 5.13889 12.6252C5.06245 12.7723 5.0164 12.9332 5.0035 13.0985C4.99099 13.2635 5.01212 13.4294 5.06562 13.586C5.11911 13.7426 5.20386 13.8868 5.31471 14.0096Z" fill="#3B414D" class="primary"></path>
|
|
7
|
-
</svg></div>
|
|
5
|
+
<div data-v-7d0d9fbd="" data-testid="collapse-header" class="unnnic-collapse__header">Test Title<span data-v-26446d8e="" data-v-7d0d9fbd="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--neutral-cloudy unnnic-icon-size--xs unnnic-icon__size--xs" data-testid="material-icon" translate="no">expand_more</span></div>
|
|
8
6
|
<div data-v-7d0d9fbd="" class="unnnic-collapse__body" style="display: none;"></div>
|
|
9
7
|
</div>"
|
|
10
8
|
`;
|
|
@@ -10,12 +10,12 @@ exports[`Drawer.vue > Component Rendering > Component Rendering > matches the sn
|
|
|
10
10
|
<h1 data-v-196de012="" class="unnnic-drawer__title" data-testid="drawer-title">Test Title</h1>
|
|
11
11
|
<p data-v-196de012="" class="unnnic-drawer__description" data-testid="drawer-description">Test Description</p>
|
|
12
12
|
</section>
|
|
13
|
-
<unnnic-icon-stub data-v-196de012="" filled="false"
|
|
13
|
+
<unnnic-icon-stub data-v-196de012="" filled="false" icon="arrow_back" clickable="true" size="avatar-nano" scheme="neutral-darkest" class="unnnic-drawer__close" data-testid="close-icon"></unnnic-icon-stub>
|
|
14
14
|
</header>
|
|
15
15
|
<section data-v-196de012="" class="unnnic-drawer__content"></section>
|
|
16
16
|
<footer data-v-196de012="" class="unnnic-drawer__footer" data-testid="footer">
|
|
17
|
-
<unnnic-button-stub data-v-196de012="" size="large" text="Secondary Action" type="tertiary" float="false" iconleft="" iconright="" iconcenter="" iconsfilled="false"
|
|
18
|
-
<unnnic-button-stub data-v-196de012="" size="large" text="Primary Action" type="primary" float="false" iconleft="" iconright="" iconcenter="" iconsfilled="false"
|
|
17
|
+
<unnnic-button-stub data-v-196de012="" size="large" text="Secondary Action" type="tertiary" float="false" iconleft="" iconright="" iconcenter="" iconsfilled="false" disabled="false" loading="false" data-testid="secondary-button"></unnnic-button-stub>
|
|
18
|
+
<unnnic-button-stub data-v-196de012="" size="large" text="Primary Action" type="primary" float="false" iconleft="" iconright="" iconcenter="" iconsfilled="false" disabled="false" loading="false" data-testid="primary-button"></unnnic-button-stub>
|
|
19
19
|
</footer>
|
|
20
20
|
</section>
|
|
21
21
|
</transition-stub>
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`Input.vue > matches the snapshot 1`] = `
|
|
4
|
-
"<
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
</
|
|
4
|
+
"<section data-v-9f8d6c86="" data-v-d890ad85="" class="unnnic-form-element unnnic-form md" data-testid="form-element">
|
|
5
|
+
<section data-v-7f222291="" data-v-9f8d6c86="" class="unnnic-label unnnic-form-element__label">
|
|
6
|
+
<p data-v-7f222291="" class="unnnic-label__label">Sample Label</p>
|
|
7
|
+
<!--v-if-->
|
|
8
|
+
</section>
|
|
9
|
+
<div data-v-a0d36167="" data-v-d890ad85="" class="text-input size--md unnnic-form-input" hascloudycolor="false" mask="####-####"><input data-v-86533b41="" data-v-a0d36167="" class="unnnic-form-input input-itself input size-md normal input--has-icon-left input--has-icon-right unnnic-form-input input-itself" hascloudycolor="false" placeholder="Enter text" iconleft="search" iconright="clear" iconleftclickable="true" iconrightclickable="true" type="text" value=""><span data-v-26446d8e="" data-v-a0d36167="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic-icon__size--ant unnnic--clickable icon-left clickable" data-testid="material-icon" translate="no">search</span><span data-v-26446d8e="" data-v-a0d36167="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic-icon__size--ant unnnic--clickable icon-right clickable" data-testid="material-icon" translate="no">clear</span></div>
|
|
10
|
+
<section data-v-9f8d6c86="" class="unnnic-form-element__hints-container">
|
|
11
|
+
<section data-v-9f8d6c86="" class="unnnic-form-element__message-container">
|
|
12
|
+
<p data-v-9f8d6c86="" class="unnnic-form-element__message">Error message</p>
|
|
13
|
+
<!--v-if-->
|
|
14
|
+
</section>
|
|
15
|
+
<!--v-if-->
|
|
16
|
+
</section>
|
|
17
|
+
</section>"
|
|
9
18
|
`;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`TextInput.vue > matches the snapshot 1`] = `"<div data-v-a0d36167="" class="text-input size--md
|
|
3
|
+
exports[`TextInput.vue > matches the snapshot 1`] = `"<div data-v-a0d36167="" class="text-input size--md"><input data-v-86533b41="" data-v-a0d36167="" placeholder="Enter text" iconleft="search" iconright="clear" iconleftclickable="true" iconrightclickable="true" allowtogglepassword="false" class="input-itself input size-md normal input--has-icon-left input--has-icon-right input-itself" type="text" value=""><span data-v-26446d8e="" data-v-a0d36167="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic-icon__size--ant unnnic--clickable icon-left clickable" data-testid="material-icon" translate="no">search</span><span data-v-26446d8e="" data-v-a0d36167="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--ant unnnic-icon__size--ant unnnic--clickable icon-right clickable" data-testid="material-icon" translate="no">clear</span></div>"`;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`Label > applies the correct classes and styles 1`] = `"<p class="unnnic-label__label">Label Test</p>"`;
|
|
3
|
+
exports[`Label > applies the correct classes and styles 1`] = `"<p data-v-7f222291="" class="unnnic-label__label">Label Test</p>"`;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<header
|
|
3
|
+
:class="`page-header
|
|
4
|
+
${hasBackButton ? 'page-header--has-back-button' : ''}
|
|
5
|
+
${hasTabsSlot ? 'page-header--has-tabs' : ''}
|
|
6
|
+
`"
|
|
7
|
+
>
|
|
8
|
+
<UnnnicButton
|
|
9
|
+
v-if="hasBackButton"
|
|
10
|
+
data-testid="back-button"
|
|
11
|
+
type="tertiary"
|
|
12
|
+
iconCenter="arrow_back_ios_new"
|
|
13
|
+
class="page-header__back-button"
|
|
14
|
+
@click="handleBackClick"
|
|
15
|
+
/>
|
|
16
|
+
|
|
17
|
+
<section class="page-header__infos">
|
|
18
|
+
<section class="page-header__main-infos">
|
|
19
|
+
<h1
|
|
20
|
+
class="page-header__title"
|
|
21
|
+
data-testid="page-title"
|
|
22
|
+
>
|
|
23
|
+
{{ title }}
|
|
24
|
+
</h1>
|
|
25
|
+
|
|
26
|
+
<slot name="tag" />
|
|
27
|
+
</section>
|
|
28
|
+
|
|
29
|
+
<p
|
|
30
|
+
v-if="description"
|
|
31
|
+
class="page-header__description"
|
|
32
|
+
data-testid="page-description"
|
|
33
|
+
>
|
|
34
|
+
{{ description }}
|
|
35
|
+
</p>
|
|
36
|
+
</section>
|
|
37
|
+
|
|
38
|
+
<section
|
|
39
|
+
v-if="hasActionsSlot"
|
|
40
|
+
class="page-header__actions"
|
|
41
|
+
data-testid="page-actions"
|
|
42
|
+
>
|
|
43
|
+
<slot name="actions" />
|
|
44
|
+
</section>
|
|
45
|
+
|
|
46
|
+
<section
|
|
47
|
+
v-if="hasTabsSlot"
|
|
48
|
+
class="page-header__tabs"
|
|
49
|
+
data-testid="page-tabs"
|
|
50
|
+
>
|
|
51
|
+
<slot name="tabs" />
|
|
52
|
+
</section>
|
|
53
|
+
</header>
|
|
54
|
+
</template>
|
|
55
|
+
|
|
56
|
+
<script setup lang="ts">
|
|
57
|
+
import { useSlots } from 'vue';
|
|
58
|
+
|
|
59
|
+
import UnnnicButton from '../Button/Button.vue';
|
|
60
|
+
|
|
61
|
+
import type { PageHeaderProps, PageHeaderEmits } from './types';
|
|
62
|
+
|
|
63
|
+
withDefaults(defineProps<PageHeaderProps>(), {
|
|
64
|
+
description: '',
|
|
65
|
+
hasBackButton: false,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const emit = defineEmits<PageHeaderEmits>();
|
|
69
|
+
|
|
70
|
+
const slots = useSlots();
|
|
71
|
+
const hasActionsSlot = !!slots.actions;
|
|
72
|
+
const hasTabsSlot = !!slots.tabs;
|
|
73
|
+
|
|
74
|
+
const handleBackClick = (): void => {
|
|
75
|
+
emit('back');
|
|
76
|
+
};
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<style lang="scss" scoped>
|
|
80
|
+
@use '@/assets/scss/unnnic' as *;
|
|
81
|
+
|
|
82
|
+
* {
|
|
83
|
+
margin: 0;
|
|
84
|
+
padding: 0;
|
|
85
|
+
box-sizing: border-box;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.page-header {
|
|
89
|
+
width: 100%;
|
|
90
|
+
|
|
91
|
+
margin-top: $unnnic-space-2;
|
|
92
|
+
padding-bottom: $unnnic-space-6;
|
|
93
|
+
|
|
94
|
+
display: grid;
|
|
95
|
+
gap: $unnnic-space-4;
|
|
96
|
+
grid-template-columns: 1fr minmax(250px, 20%); // TODO: Verify if is 250px or 20% (8fr 2fr)
|
|
97
|
+
align-items: center;
|
|
98
|
+
|
|
99
|
+
border-bottom: 1px solid $unnnic-color-border-soft;
|
|
100
|
+
|
|
101
|
+
&--has-back-button {
|
|
102
|
+
grid-template-columns: auto 1fr minmax(250px, 20%);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&--has-tabs {
|
|
106
|
+
border-bottom: none;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&__infos {
|
|
110
|
+
display: flex;
|
|
111
|
+
flex-direction: column;
|
|
112
|
+
gap: $unnnic-space-2;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&__main-infos {
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
gap: $unnnic-space-2;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&__title {
|
|
122
|
+
overflow: hidden;
|
|
123
|
+
text-overflow: ellipsis;
|
|
124
|
+
white-space: nowrap;
|
|
125
|
+
|
|
126
|
+
color: $unnnic-color-fg-emphasized;
|
|
127
|
+
text-overflow: ellipsis;
|
|
128
|
+
|
|
129
|
+
font: $unnnic-font-display-1;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&__description {
|
|
133
|
+
color: $unnnic-color-fg-base;
|
|
134
|
+
|
|
135
|
+
font: $unnnic-font-body;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&__actions {
|
|
139
|
+
display: flex;
|
|
140
|
+
gap: $unnnic-space-2;
|
|
141
|
+
align-items: center;
|
|
142
|
+
justify-content: flex-end;
|
|
143
|
+
|
|
144
|
+
> * {
|
|
145
|
+
width: 100%;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&__tabs {
|
|
150
|
+
grid-column: 1 / -1;
|
|
151
|
+
grid-row: 2 / 3;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
</style>
|
|
@@ -26,6 +26,13 @@
|
|
|
26
26
|
{{ label }}
|
|
27
27
|
<slot />
|
|
28
28
|
</p>
|
|
29
|
+
|
|
30
|
+
<footer
|
|
31
|
+
v-if="helper"
|
|
32
|
+
class="unnnic-radio__helper"
|
|
33
|
+
>
|
|
34
|
+
{{ helper }}
|
|
35
|
+
</footer>
|
|
29
36
|
</label>
|
|
30
37
|
</section>
|
|
31
38
|
</template>
|
|
@@ -55,6 +62,10 @@ const props = defineProps({
|
|
|
55
62
|
type: String,
|
|
56
63
|
default: '',
|
|
57
64
|
},
|
|
65
|
+
helper: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: '',
|
|
68
|
+
},
|
|
58
69
|
});
|
|
59
70
|
|
|
60
71
|
const emit = defineEmits(['update:modelValue']);
|
|
@@ -93,9 +104,11 @@ $radio-size: 21px;
|
|
|
93
104
|
&__input-wrapper {
|
|
94
105
|
width: fit-content;
|
|
95
106
|
|
|
96
|
-
display:
|
|
107
|
+
display: grid;
|
|
108
|
+
grid-template-columns: $radio-size auto;
|
|
109
|
+
grid-template-rows: auto auto;
|
|
97
110
|
align-items: center;
|
|
98
|
-
gap: $unnnic-space-2;
|
|
111
|
+
column-gap: $unnnic-space-2;
|
|
99
112
|
|
|
100
113
|
cursor: pointer;
|
|
101
114
|
|
|
@@ -143,5 +156,13 @@ $radio-size: 21px;
|
|
|
143
156
|
color: $unnnic-color-fg-muted;
|
|
144
157
|
}
|
|
145
158
|
}
|
|
159
|
+
|
|
160
|
+
&__helper {
|
|
161
|
+
grid-column: 2 / -1;
|
|
162
|
+
grid-row: 2;
|
|
163
|
+
|
|
164
|
+
font: $unnnic-font-caption-2;
|
|
165
|
+
color: $unnnic-color-fg-base;
|
|
166
|
+
}
|
|
146
167
|
}
|
|
147
168
|
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`Radio.vue > matches the snapshot 1`] = `
|
|
4
|
-
"<
|
|
5
|
-
<
|
|
6
|
-
</
|
|
4
|
+
"<section data-v-38c6bf5e="" class="unnnic-radio" size="md"><label data-v-38c6bf5e="" class="unnnic-radio__input-wrapper"><input data-v-38c6bf5e="" class="unnnic-radio__input" type="radio" name="">
|
|
5
|
+
<p data-v-38c6bf5e="" class="unnnic-radio__label"> Option 1</p>
|
|
6
|
+
</label></section>"
|
|
7
7
|
`;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`Switch > should match the snapshot 1`] = `
|
|
4
|
-
"<
|
|
5
|
-
<!--v-if--><
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
</svg>
|
|
4
|
+
"<section data-v-e4356c9d="" class="unnnic-switch">
|
|
5
|
+
<!--v-if--><label data-v-e4356c9d="" class="unnnic-switch__input-wrapper"><input data-v-e4356c9d="" class="unnnic-switch__input" type="checkbox">
|
|
6
|
+
<!--v-if-->
|
|
7
|
+
</label>
|
|
9
8
|
<!--v-if-->
|
|
10
|
-
</
|
|
9
|
+
</section>"
|
|
11
10
|
`;
|
|
@@ -4,7 +4,7 @@ exports[`Tab.vue > matches the snapshot 1`] = `
|
|
|
4
4
|
"<div data-v-b4e39fac="" class="tab size-md">
|
|
5
5
|
<header data-v-b4e39fac="" class="tab-header">
|
|
6
6
|
<ul data-v-b4e39fac="" class="tab-content">
|
|
7
|
-
<li data-v-b4e39fac="" class="tab-head">tab1<div data-v-bf0cf546="" data-v-b4e39fac="" class="unnnic-tooltip"><span data-v-26446d8e="" data-v-b4e39fac="" class="material-symbols-rounded unnnic-icon-scheme--
|
|
7
|
+
<li data-v-b4e39fac="" class="tab-head">tab1<div data-v-bf0cf546="" data-v-b4e39fac="" class="unnnic-tooltip"><span data-v-26446d8e="" data-v-b4e39fac="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--sm unnnic-icon__size--sm" data-testid="material-icon" translate="no">help</span><span data-v-bf0cf546="" class="unnnic-tooltip-label unnnic-tooltip-label-bottom" data-testid="tooltip-label" style="left: 0px; top: 8px;">Tooltip text <br data-v-bf0cf546=""><!--v-if--></span></div>
|
|
8
8
|
</li>
|
|
9
9
|
<li data-v-b4e39fac="" class="tab-head tab-head--active">tab2
|
|
10
10
|
<!--v-if-->
|
|
@@ -62,6 +62,7 @@ const color = computed(() => {
|
|
|
62
62
|
gap: $unnnic-space-1;
|
|
63
63
|
border-radius: $unnnic-border-radius-pill;
|
|
64
64
|
padding: calc($unnnic-space-1 * 1.5) $unnnic-space-3;
|
|
65
|
+
width: fit-content;
|
|
65
66
|
|
|
66
67
|
background-color: v-bind(color);
|
|
67
68
|
|
|
@@ -72,6 +73,10 @@ const color = computed(() => {
|
|
|
72
73
|
&__label {
|
|
73
74
|
margin: 0;
|
|
74
75
|
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
text-overflow: ellipsis;
|
|
78
|
+
white-space: nowrap;
|
|
79
|
+
|
|
75
80
|
font: $unnnic-font-caption-1;
|
|
76
81
|
color: $unnnic-color-fg-emphasized;
|
|
77
82
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
:size="size"
|
|
5
5
|
:disabled="disabled"
|
|
6
6
|
:message="message"
|
|
7
|
+
:tooltip="tooltip"
|
|
7
8
|
:error="computedError"
|
|
8
9
|
>
|
|
9
10
|
<textarea
|
|
@@ -85,6 +86,11 @@ export default {
|
|
|
85
86
|
},
|
|
86
87
|
},
|
|
87
88
|
|
|
89
|
+
tooltip: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: '',
|
|
92
|
+
},
|
|
93
|
+
|
|
88
94
|
errors: {
|
|
89
95
|
type: Array,
|
|
90
96
|
default: () => [],
|
|
@@ -2,8 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`TextArea.vue > matches the snapshot 1`] = `
|
|
4
4
|
"<section data-v-9f8d6c86="" data-v-735b3c51="" class="unnnic-form-element">
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
<section data-v-7f222291="" data-v-9f8d6c86="" class="unnnic-label unnnic-form-element__label">
|
|
6
|
+
<p data-v-7f222291="" class="unnnic-label__label">Description</p>
|
|
7
|
+
<!--v-if-->
|
|
8
|
+
</section><textarea data-v-735b3c51="" class="unnnic-text-area__textarea unnnic-text-area__textarea--size-md unnnic-text-area__textarea--type-normal" placeholder="Enter text" maxlength="200" value=""></textarea>
|
|
9
|
+
<section data-v-9f8d6c86="" class="unnnic-form-element__hints-container">
|
|
10
|
+
<section data-v-9f8d6c86="" class="unnnic-form-element__message-container">
|
|
11
|
+
<!--v-if-->
|
|
12
|
+
<!--v-if-->
|
|
13
|
+
</section>
|
|
14
|
+
<p data-v-9f8d6c86="">0/200</p>
|
|
15
|
+
</section>
|
|
8
16
|
</section>"
|
|
9
17
|
`;
|
|
@@ -128,7 +128,7 @@ const startTimeout = () => {
|
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
130
|
|
|
131
|
-
const
|
|
131
|
+
const stopTimeout = () => {
|
|
132
132
|
if (timeoutId) {
|
|
133
133
|
window.clearTimeout(timeoutId);
|
|
134
134
|
timeoutId = null;
|
|
@@ -141,7 +141,7 @@ onMounted(() => {
|
|
|
141
141
|
});
|
|
142
142
|
|
|
143
143
|
onUnmounted(() => {
|
|
144
|
-
|
|
144
|
+
stopTimeout();
|
|
145
145
|
});
|
|
146
146
|
</script>
|
|
147
147
|
|
|
@@ -192,16 +192,16 @@ onUnmounted(() => {
|
|
|
192
192
|
width: 100%;
|
|
193
193
|
|
|
194
194
|
display: flex;
|
|
195
|
-
gap: $unnnic-space-2;
|
|
196
195
|
}
|
|
197
196
|
|
|
198
197
|
&__content {
|
|
199
198
|
flex-direction: column;
|
|
200
|
-
gap: $unnnic-space-
|
|
199
|
+
gap: $unnnic-space-1;
|
|
201
200
|
}
|
|
202
201
|
|
|
203
202
|
&__header {
|
|
204
203
|
align-items: center;
|
|
204
|
+
gap: $unnnic-space-2;
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
&__title {
|
|
@@ -254,11 +254,18 @@ describe('UnnnicToast', () => {
|
|
|
254
254
|
});
|
|
255
255
|
|
|
256
256
|
test('clears timeout when component is unmounted', () => {
|
|
257
|
+
vi.useRealTimers();
|
|
257
258
|
const clearTimeoutSpy = vi.spyOn(window, 'clearTimeout');
|
|
258
|
-
wrapper = createTimeoutWrapper();
|
|
259
259
|
|
|
260
|
-
|
|
260
|
+
const localWrapper = shallowMount(Toast, {
|
|
261
|
+
props: { title: 'Test Toast', timeout: 1000 },
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
localWrapper.unmount();
|
|
261
265
|
expect(clearTimeoutSpy).toHaveBeenCalled();
|
|
266
|
+
|
|
267
|
+
clearTimeoutSpy.mockRestore();
|
|
268
|
+
vi.useFakeTimers();
|
|
262
269
|
});
|
|
263
270
|
});
|
|
264
271
|
|
package/src/components/index.ts
CHANGED
|
@@ -106,6 +106,11 @@ import DialogHeader from './ui/dialog/DialogHeader.vue';
|
|
|
106
106
|
import DialogTitle from './ui/dialog/DialogTitle.vue';
|
|
107
107
|
import DialogTrigger from './ui/dialog/DialogTrigger.vue';
|
|
108
108
|
import DialogClose from './ui/dialog/DialogClose.vue';
|
|
109
|
+
import Tabs from './ui/tabs/Tabs.vue';
|
|
110
|
+
import TabsList from './ui/tabs/TabsList.vue';
|
|
111
|
+
import TabsTrigger from './ui/tabs/TabsTrigger.vue';
|
|
112
|
+
import TabsContent from './ui/tabs/TabsContent.vue';
|
|
113
|
+
import PageHeader from './PageHeader/PageHeader.vue';
|
|
109
114
|
|
|
110
115
|
type VueComponent = Component;
|
|
111
116
|
|
|
@@ -221,6 +226,11 @@ export const components: ComponentsMap = {
|
|
|
221
226
|
unnnicDialogTitle: DialogTitle,
|
|
222
227
|
unnnicDialogTrigger: DialogTrigger,
|
|
223
228
|
unnnicDialogClose: DialogClose,
|
|
229
|
+
unnnicTabs: Tabs,
|
|
230
|
+
unnnicTabsList: TabsList,
|
|
231
|
+
unnnicTabsTrigger: TabsTrigger,
|
|
232
|
+
unnnicTabsContent: TabsContent,
|
|
233
|
+
unnnicPageHeader: PageHeader,
|
|
224
234
|
};
|
|
225
235
|
|
|
226
236
|
export const unnnicFontSize = fontSize;
|
|
@@ -319,6 +329,8 @@ export const unnnicTemplatePreview = TemplatePreview as VueComponent;
|
|
|
319
329
|
export const unnnicTemplatePreviewModal = TemplatePreviewModal as VueComponent;
|
|
320
330
|
export const unnnicDataTable = DataTable as VueComponent;
|
|
321
331
|
export const unnnicChip = Chip;
|
|
332
|
+
export const unnnicToast = Toast;
|
|
333
|
+
export const unnnicToastManager = toast;
|
|
322
334
|
export const unnnicPopover = Popover;
|
|
323
335
|
export const unnnicPopoverContent = PopoverContent;
|
|
324
336
|
export const unnnicPopoverTrigger = PopoverTrigger;
|
|
@@ -330,6 +342,11 @@ export const unnnicDialogHeader = DialogHeader;
|
|
|
330
342
|
export const unnnicDialogTitle = DialogTitle;
|
|
331
343
|
export const unnnicDialogTrigger = DialogTrigger;
|
|
332
344
|
export const unnnicDialogClose = DialogClose;
|
|
345
|
+
export const unnnicTabs = Tabs;
|
|
346
|
+
export const unnnicTabsList = TabsList;
|
|
347
|
+
export const unnnicTabsTrigger = TabsTrigger;
|
|
348
|
+
export const unnnicTabsContent = TabsContent;
|
|
349
|
+
export const unnnicPageHeader = PageHeader;
|
|
333
350
|
|
|
334
351
|
export const UnnnicFontSize = fontSize;
|
|
335
352
|
export const UnnnicInput = input;
|
|
@@ -439,3 +456,8 @@ export const UnnnicDialogHeader = DialogHeader;
|
|
|
439
456
|
export const UnnnicDialogTitle = DialogTitle;
|
|
440
457
|
export const UnnnicDialogTrigger = DialogTrigger;
|
|
441
458
|
export const UnnnicDialogClose = DialogClose;
|
|
459
|
+
export const UnnnicTabs = Tabs;
|
|
460
|
+
export const UnnnicTabsList = TabsList;
|
|
461
|
+
export const UnnnicTabsTrigger = TabsTrigger;
|
|
462
|
+
export const UnnnicTabsContent = TabsContent;
|
|
463
|
+
export const UnnnicPageHeader = PageHeader;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TabsRootEmits, TabsRootProps } from 'reka-ui';
|
|
3
|
+
import { TabsRoot, useForwardPropsEmits } from 'reka-ui';
|
|
4
|
+
|
|
5
|
+
defineOptions({
|
|
6
|
+
name: 'UnnnicTabs',
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const props = defineProps<TabsRootProps>();
|
|
10
|
+
const emits = defineEmits<TabsRootEmits>();
|
|
11
|
+
|
|
12
|
+
const forwarded = useForwardPropsEmits(props, emits);
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<TabsRoot v-bind="forwarded">
|
|
17
|
+
<slot />
|
|
18
|
+
</TabsRoot>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TabsContentProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { TabsContent } from 'reka-ui';
|
|
6
|
+
import { cn } from '@/lib/utils';
|
|
7
|
+
|
|
8
|
+
const props = defineProps<
|
|
9
|
+
TabsContentProps & { class?: HTMLAttributes['class'] }
|
|
10
|
+
>();
|
|
11
|
+
|
|
12
|
+
const delegatedProps = reactiveOmit(props, 'class');
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<TabsContent
|
|
17
|
+
:class="cn(props.class)"
|
|
18
|
+
v-bind="delegatedProps"
|
|
19
|
+
>
|
|
20
|
+
<slot />
|
|
21
|
+
</TabsContent>
|
|
22
|
+
</template>
|