@weni/unnnic-system 2.0.9 → 2.0.11
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/style.css +1 -1
- package/dist/unnnic.mjs +7543 -7193
- package/dist/unnnic.umd.js +21 -21
- package/package.json +1 -1
- package/src/assets/scss/colors.scss +6 -6
- package/src/components/Alert/AlertBanner.vue +180 -0
- package/src/components/AudioRecorder/AudioRecorder.vue +5 -3
- package/src/components/Card/CardCompany.vue +132 -255
- package/src/components/Checkbox/Checkbox.vue +3 -6
- package/src/components/Disclaimer/Disclaimer.vue +64 -0
- package/src/components/Drawer/Drawer.vue +234 -0
- package/src/components/Radio/Radio.vue +1 -1
- package/src/components/Slider/Slider.vue +137 -57
- package/src/components/Tab/Tab.vue +64 -5
- package/src/components/TextArea/TextArea.vue +1 -4
- package/src/components/ToolTip/ToolTip.vue +24 -20
- package/src/components/index.js +6 -0
- package/src/locales/en.json +3 -0
- package/src/locales/es.json +3 -0
- package/src/locales/pt_br.json +3 -0
- package/src/mixins/i18n.js +14 -1
- package/src/stories/Alert.stories.js +46 -20
- package/src/stories/AudioRecorder.stories.js +25 -29
- package/src/stories/Disclaimer.stories.js +37 -0
- package/src/stories/Drawer.stories.js +136 -0
- package/src/stories/Introduction.mdx +196 -196
- package/src/stories/Slider.stories.js +14 -18
- package/src/stories/Tab.stories.js +38 -31
- package/src/stories/ToolTip.stories.js +11 -0
- package/.vscode/extensions.json +0 -3
|
@@ -13,6 +13,19 @@
|
|
|
13
13
|
@click="change(tab)"
|
|
14
14
|
>
|
|
15
15
|
<slot :name="tabHeadSlotName(tab)">{{ tab }} </slot>
|
|
16
|
+
<UnnnicToolTip
|
|
17
|
+
v-if="getHeadTooltip(tab)"
|
|
18
|
+
enabled
|
|
19
|
+
:text="getHeadTooltip(tab)"
|
|
20
|
+
side="bottom"
|
|
21
|
+
>
|
|
22
|
+
<UnnnicIcon
|
|
23
|
+
icon="info"
|
|
24
|
+
:size="size === 'sm' ? 'xs' : 'sm'"
|
|
25
|
+
filled
|
|
26
|
+
scheme="neutral-cleanest"
|
|
27
|
+
/>
|
|
28
|
+
</UnnnicToolTip>
|
|
16
29
|
</li>
|
|
17
30
|
</ul>
|
|
18
31
|
</header>
|
|
@@ -23,11 +36,18 @@
|
|
|
23
36
|
</template>
|
|
24
37
|
|
|
25
38
|
<script>
|
|
39
|
+
import UnnnicIcon from '../Icon.vue';
|
|
40
|
+
import UnnnicToolTip from '../ToolTip/ToolTip.vue';
|
|
41
|
+
|
|
26
42
|
export default {
|
|
27
43
|
model: {
|
|
28
44
|
prop: 'activeTab',
|
|
29
45
|
event: 'change',
|
|
30
46
|
},
|
|
47
|
+
components: {
|
|
48
|
+
UnnnicIcon,
|
|
49
|
+
UnnnicToolTip,
|
|
50
|
+
},
|
|
31
51
|
props: {
|
|
32
52
|
size: {
|
|
33
53
|
type: String,
|
|
@@ -71,6 +91,17 @@ export default {
|
|
|
71
91
|
tabHeadSlotName(tabName) {
|
|
72
92
|
return `tab-head-${tabName}`;
|
|
73
93
|
},
|
|
94
|
+
tabHeadTooltipSlotName(tabName) {
|
|
95
|
+
return tabName ? `tab-head-${tabName}-tooltip` : '';
|
|
96
|
+
},
|
|
97
|
+
getHeadTooltip(tabName) {
|
|
98
|
+
const tooltipSlot = this.$slots[this.tabHeadTooltipSlotName(tabName)];
|
|
99
|
+
|
|
100
|
+
if (tooltipSlot) {
|
|
101
|
+
return tooltipSlot()?.[0]?.children;
|
|
102
|
+
}
|
|
103
|
+
return '';
|
|
104
|
+
},
|
|
74
105
|
change(value) {
|
|
75
106
|
this.localValue = value;
|
|
76
107
|
this.$emit('change', this.localValue);
|
|
@@ -86,40 +117,68 @@ export default {
|
|
|
86
117
|
display: flex;
|
|
87
118
|
align-items: flex-start;
|
|
88
119
|
justify-content: space-between;
|
|
89
|
-
color: $unnnic-color-neutral-
|
|
120
|
+
color: $unnnic-color-neutral-cloudy;
|
|
90
121
|
font-family: $unnnic-font-family-secondary;
|
|
91
122
|
font-weight: $unnnic-font-weight-bold;
|
|
92
123
|
font-size: $unnnic-font-size-body-lg;
|
|
93
124
|
line-height: ($unnnic-font-size-body-lg + $unnnic-line-height-medium);
|
|
94
|
-
padding-bottom: $unnnic-inset-sm;
|
|
95
125
|
margin-bottom: $unnnic-inset-sm;
|
|
96
126
|
border-bottom: $unnnic-border-width-thinner solid $unnnic-color-neutral-soft;
|
|
97
127
|
}
|
|
98
128
|
|
|
99
129
|
.tab-content {
|
|
100
130
|
display: flex;
|
|
131
|
+
gap: $unnnic-spacing-sm;
|
|
132
|
+
|
|
101
133
|
margin: 0;
|
|
102
134
|
padding: 0;
|
|
103
135
|
list-style: none;
|
|
104
136
|
}
|
|
105
137
|
|
|
106
138
|
.tab-head {
|
|
139
|
+
display: flex;
|
|
140
|
+
gap: $unnnic-spacing-xs;
|
|
141
|
+
align-items: center;
|
|
142
|
+
|
|
107
143
|
cursor: pointer;
|
|
108
|
-
margin
|
|
144
|
+
margin: $unnnic-spacing-xs $unnnic-spacing-sm;
|
|
145
|
+
|
|
146
|
+
.unnnic-tooltip {
|
|
147
|
+
display: flex;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&:hover {
|
|
151
|
+
color: $unnnic-color-neutral-black;
|
|
152
|
+
}
|
|
109
153
|
}
|
|
110
154
|
|
|
111
155
|
.tab-head--active {
|
|
112
156
|
font-family: $unnnic-font-family-secondary;
|
|
113
157
|
font-weight: $unnnic-font-weight-bold;
|
|
114
|
-
color: $unnnic-color-neutral-
|
|
158
|
+
color: $unnnic-color-neutral-black;
|
|
115
159
|
font-size: $unnnic-font-size-body-lg;
|
|
116
160
|
line-height: ($unnnic-font-size-body-lg + $unnnic-line-height-medium);
|
|
117
161
|
transition: 0.4s;
|
|
162
|
+
|
|
163
|
+
position: relative;
|
|
164
|
+
|
|
165
|
+
&::after {
|
|
166
|
+
content: '';
|
|
167
|
+
|
|
168
|
+
position: absolute;
|
|
169
|
+
bottom: -$unnnic-spacing-xs;
|
|
170
|
+
left: -$unnnic-spacing-sm;
|
|
171
|
+
|
|
172
|
+
display: block;
|
|
173
|
+
|
|
174
|
+
width: calc(100% + (#{$unnnic-spacing-sm} * 2));
|
|
175
|
+
|
|
176
|
+
border-bottom: $unnnic-border-width-thin solid $unnnic-color-weni-600;
|
|
177
|
+
}
|
|
118
178
|
}
|
|
119
179
|
|
|
120
180
|
.tab.size-sm {
|
|
121
181
|
.tab-header {
|
|
122
|
-
padding-bottom: $unnnic-spacing-stack-xs;
|
|
123
182
|
margin-bottom: $unnnic-spacing-stack-xs;
|
|
124
183
|
|
|
125
184
|
.tab-head,
|
|
@@ -147,7 +147,7 @@ export default {
|
|
|
147
147
|
font-weight: $unnnic-font-weight-regular;
|
|
148
148
|
|
|
149
149
|
&::placeholder {
|
|
150
|
-
color: $unnnic-color-neutral-
|
|
150
|
+
color: $unnnic-color-neutral-cleanest;
|
|
151
151
|
font-family: $unnnic-font-family-secondary;
|
|
152
152
|
font-size: $unnnic-font-size-body-gt;
|
|
153
153
|
line-height: $unnnic-font-size-body-gt + $unnnic-line-height-md;
|
|
@@ -156,9 +156,6 @@ export default {
|
|
|
156
156
|
|
|
157
157
|
&:focus {
|
|
158
158
|
border-color: $unnnic-color-neutral-clean;
|
|
159
|
-
&::placeholder {
|
|
160
|
-
color: $unnnic-color-neutral-cleanest;
|
|
161
|
-
}
|
|
162
159
|
}
|
|
163
160
|
}
|
|
164
161
|
|
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
{{ line }}
|
|
22
22
|
<br />
|
|
23
23
|
</template>
|
|
24
|
+
|
|
25
|
+
<template v-if="shortcutText">
|
|
26
|
+
<span class="unnnic-tooltip-label-shortcut">
|
|
27
|
+
{{ shortcutText }}
|
|
28
|
+
</span>
|
|
29
|
+
</template>
|
|
24
30
|
</span>
|
|
25
31
|
</div>
|
|
26
32
|
</template>
|
|
@@ -72,6 +78,10 @@ export default {
|
|
|
72
78
|
maxWidth: {
|
|
73
79
|
type: String,
|
|
74
80
|
},
|
|
81
|
+
shortcutText: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: null,
|
|
84
|
+
},
|
|
75
85
|
},
|
|
76
86
|
methods: {
|
|
77
87
|
handleResize() {
|
|
@@ -83,31 +93,15 @@ export default {
|
|
|
83
93
|
if (element && this.$refs.label) {
|
|
84
94
|
if (this.side === 'right') {
|
|
85
95
|
this.leftPos = `${elementPos.x + elementPos.width + 8}px`;
|
|
86
|
-
this.topPos = `${
|
|
87
|
-
elementPos.y +
|
|
88
|
-
elementPos.height / 2 -
|
|
89
|
-
this.$refs.label.offsetHeight / 2
|
|
90
|
-
}px`;
|
|
96
|
+
this.topPos = `${elementPos.y + elementPos.height / 2 - this.$refs.label.offsetHeight / 2}px`;
|
|
91
97
|
} else if (this.side === 'left') {
|
|
92
98
|
this.leftPos = `${elementPos.x - this.$refs.label.offsetWidth - 8}px`;
|
|
93
|
-
this.topPos = `${
|
|
94
|
-
elementPos.y +
|
|
95
|
-
elementPos.height / 2 -
|
|
96
|
-
this.$refs.label.offsetHeight / 2
|
|
97
|
-
}px`;
|
|
99
|
+
this.topPos = `${elementPos.y + elementPos.height / 2 - this.$refs.label.offsetHeight / 2}px`;
|
|
98
100
|
} else if (this.side === 'top') {
|
|
99
|
-
this.leftPos = `${
|
|
100
|
-
elementPos.x +
|
|
101
|
-
elementPos.width / 2 -
|
|
102
|
-
this.$refs.label.clientWidth / 2
|
|
103
|
-
}px`;
|
|
101
|
+
this.leftPos = `${elementPos.x + elementPos.width / 2 - this.$refs.label.clientWidth / 2}px`;
|
|
104
102
|
this.topPos = `${elementPos.y - this.$refs.label.offsetHeight - 8}px`;
|
|
105
103
|
} else if (this.side === 'bottom') {
|
|
106
|
-
this.leftPos = `${
|
|
107
|
-
elementPos.x +
|
|
108
|
-
elementPos.width / 2 -
|
|
109
|
-
this.$refs.label.clientWidth / 2
|
|
110
|
-
}px`;
|
|
104
|
+
this.leftPos = `${elementPos.x + elementPos.width / 2 - this.$refs.label.clientWidth / 2}px`;
|
|
111
105
|
this.topPos = `${elementPos.y + elementPos.height + 8}px`;
|
|
112
106
|
}
|
|
113
107
|
}
|
|
@@ -134,6 +128,10 @@ export default {
|
|
|
134
128
|
min-width: 2 * $unnnic-font-size;
|
|
135
129
|
box-sizing: border-box;
|
|
136
130
|
width: auto;
|
|
131
|
+
display: flex;
|
|
132
|
+
justify-content: center;
|
|
133
|
+
gap: $unnnic-spacing-xs;
|
|
134
|
+
align-items: center;
|
|
137
135
|
|
|
138
136
|
background-color: $unnnic-color-neutral-black;
|
|
139
137
|
color: $unnnic-color-neutral-snow;
|
|
@@ -193,6 +191,12 @@ export default {
|
|
|
193
191
|
$unnnic-color-neutral-black;
|
|
194
192
|
}
|
|
195
193
|
}
|
|
194
|
+
|
|
195
|
+
&-shortcut {
|
|
196
|
+
background-color: $unnnic-color-neutral-darkest;
|
|
197
|
+
border-radius: $unnnic-border-radius-sm;
|
|
198
|
+
padding: calc($unnnic-inset-nano / 2) $unnnic-inset-nano;
|
|
199
|
+
}
|
|
196
200
|
}
|
|
197
201
|
|
|
198
202
|
.unnnic-tooltip.force-open {
|
package/src/components/index.js
CHANGED
|
@@ -77,6 +77,8 @@ import ChatsUserAvatar from './ChatsUserAvatar/ChatsUserAvatar.vue';
|
|
|
77
77
|
import ChartMultiLine from './ChartMultiLine/ChartMultiLine.vue';
|
|
78
78
|
import EmojiPicker from './EmojiPicker/EmojiPicker.vue';
|
|
79
79
|
import ChartFunnel from './ChartFunnel/ChartFunnel.vue';
|
|
80
|
+
import Disclaimer from './Disclaimer/Disclaimer.vue';
|
|
81
|
+
import Drawer from './Drawer/Drawer.vue';
|
|
80
82
|
|
|
81
83
|
export const components = {
|
|
82
84
|
unnnicFormElement: formElement,
|
|
@@ -159,6 +161,8 @@ export const components = {
|
|
|
159
161
|
unnnicChartMultiLine: ChartMultiLine,
|
|
160
162
|
unnnicEmojiPicker: EmojiPicker,
|
|
161
163
|
unnnicChartFunnel: ChartFunnel,
|
|
164
|
+
unnnicDisclaimer: Disclaimer,
|
|
165
|
+
unnnicDrawer: Drawer,
|
|
162
166
|
};
|
|
163
167
|
|
|
164
168
|
export const unnnicFontSize = fontSize;
|
|
@@ -242,3 +246,5 @@ export const unnnicChatsUserAvatar = ChatsUserAvatar;
|
|
|
242
246
|
export const unnnicChartMultiLine = ChartMultiLine;
|
|
243
247
|
export const unnnicEmojiPicker = EmojiPicker;
|
|
244
248
|
export const unnnicChartFunnel = ChartFunnel;
|
|
249
|
+
export const unnnicDisclaimer = Disclaimer;
|
|
250
|
+
export const unnnicDrawer = Drawer;
|
package/src/locales/en.json
CHANGED
package/src/locales/es.json
CHANGED
package/src/locales/pt_br.json
CHANGED
package/src/mixins/i18n.js
CHANGED
|
@@ -14,7 +14,20 @@ export default {
|
|
|
14
14
|
i18n(...args) {
|
|
15
15
|
const [key, defaults] = args;
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
const validLocaleValues = Object.keys(this.$i18n.messages);
|
|
18
|
+
|
|
19
|
+
let { locale } = this;
|
|
20
|
+
|
|
21
|
+
const treatedSelectedLocale =
|
|
22
|
+
get(this, '$i18n.locale') === 'en-us'
|
|
23
|
+
? 'en'
|
|
24
|
+
: get(this, '$i18n.locale');
|
|
25
|
+
|
|
26
|
+
locale = validLocaleValues.includes(locale)
|
|
27
|
+
? locale
|
|
28
|
+
: treatedSelectedLocale;
|
|
29
|
+
|
|
30
|
+
locale = locale.toLowerCase();
|
|
18
31
|
|
|
19
32
|
let text = get(
|
|
20
33
|
this.translations,
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import alertCaller from '../components/Alert/AlertCaller.vue';
|
|
2
|
+
import alert from '../utils/call';
|
|
1
3
|
import unnnicAlert from '../components/Alert/Alert.vue';
|
|
2
|
-
import
|
|
4
|
+
import alertBanner from '../components/Alert/AlertBanner.vue';
|
|
3
5
|
|
|
4
6
|
export default {
|
|
5
7
|
title: 'example/Alert',
|
|
6
8
|
component: unnnicAlert,
|
|
7
9
|
argTypes: {
|
|
8
|
-
type: { control: { type: 'text' } },
|
|
9
10
|
text: { control: { type: 'text' } },
|
|
11
|
+
showCloseButton: { control: { type: 'boolean' } },
|
|
12
|
+
title: { control: { type: 'text' } },
|
|
10
13
|
closeText: { control: { type: 'text' } },
|
|
11
14
|
scheme: {
|
|
12
15
|
control: {
|
|
@@ -55,7 +58,7 @@ export default {
|
|
|
55
58
|
|
|
56
59
|
const Template = (args, { argTypes }) => ({
|
|
57
60
|
props: Object.keys(argTypes),
|
|
58
|
-
components: {
|
|
61
|
+
components: { alertCaller, unnnicAlert },
|
|
59
62
|
template: `
|
|
60
63
|
<div>
|
|
61
64
|
<button @click="unnnicCallAlert">Click for alert</button>
|
|
@@ -84,21 +87,14 @@ Recommended use:
|
|
|
84
87
|
</div>`,
|
|
85
88
|
methods: {
|
|
86
89
|
unnnicCallAlert() {
|
|
87
|
-
|
|
88
|
-
props: {
|
|
89
|
-
type: 'success',
|
|
90
|
-
text: 'Alert'
|
|
91
|
-
},
|
|
92
|
-
containerRef: this.$refs.divContainer,
|
|
93
|
-
})
|
|
90
|
+
alert.callAlert({ props: this.$props, seconds: this.$props.seconds });
|
|
94
91
|
},
|
|
95
|
-
|
|
96
92
|
},
|
|
97
93
|
});
|
|
98
94
|
|
|
99
95
|
const TemplateWithContainerRef = (args, { argTypes }) => ({
|
|
100
96
|
props: Object.keys(argTypes),
|
|
101
|
-
components: {
|
|
97
|
+
components: { alertCaller, unnnicAlert },
|
|
102
98
|
template: `
|
|
103
99
|
<div ref="divContainer" style="height: 200px; position: relative; border: 1px solid black">
|
|
104
100
|
<button @click="unnnicCallAlert">Click for alert</button>
|
|
@@ -114,25 +110,55 @@ const TemplateWithContainerRef = (args, { argTypes }) => ({
|
|
|
114
110
|
</div>`,
|
|
115
111
|
methods: {
|
|
116
112
|
unnnicCallAlert() {
|
|
117
|
-
|
|
118
|
-
props:
|
|
119
|
-
type: 'success',
|
|
120
|
-
text: 'Alert'
|
|
121
|
-
},
|
|
113
|
+
alert.callAlert({
|
|
114
|
+
props: this.$props,
|
|
122
115
|
containerRef: this.$refs.divContainer,
|
|
123
|
-
})
|
|
116
|
+
});
|
|
124
117
|
},
|
|
125
118
|
},
|
|
126
119
|
});
|
|
127
120
|
|
|
121
|
+
const TemplateBanner = (args, { argTypes }) => ({
|
|
122
|
+
props: Object.keys(argTypes),
|
|
123
|
+
components: { alertBanner },
|
|
124
|
+
template: `
|
|
125
|
+
<div>
|
|
126
|
+
<alert-banner v-bind="$props" />
|
|
127
|
+
|
|
128
|
+
<pre>
|
|
129
|
+
Recommended use:
|
|
130
|
+
|
|
131
|
+
<unnnic-alert-banner
|
|
132
|
+
type String default 'info' ('info', 'warning', 'danger')
|
|
133
|
+
text String required
|
|
134
|
+
showCloseButton Boolean default false
|
|
135
|
+
@close Event
|
|
136
|
+
link-href String
|
|
137
|
+
┠ link-text String default 'Learn more'
|
|
138
|
+
┖ link-target String default '_blank'
|
|
139
|
+
/>
|
|
140
|
+
</pre>
|
|
141
|
+
</div>`,
|
|
142
|
+
});
|
|
143
|
+
|
|
128
144
|
export const Normal = Template.bind({});
|
|
129
145
|
Normal.args = {
|
|
130
|
-
|
|
146
|
+
title: 'Title',
|
|
131
147
|
text: 'Text',
|
|
148
|
+
icon: 'check-circle-1-1',
|
|
149
|
+
scheme: 'feedback-green',
|
|
132
150
|
};
|
|
133
151
|
|
|
134
152
|
export const WithContainerRef = TemplateWithContainerRef.bind({});
|
|
135
153
|
WithContainerRef.args = {
|
|
136
|
-
|
|
154
|
+
title: 'Title',
|
|
155
|
+
text: 'Text',
|
|
156
|
+
icon: 'check-circle-1-1',
|
|
157
|
+
scheme: 'feedback-green',
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export const Banner = TemplateBanner.bind({});
|
|
161
|
+
Banner.args = {
|
|
137
162
|
text: 'Text',
|
|
163
|
+
showCloseButton: false,
|
|
138
164
|
};
|
|
@@ -5,44 +5,40 @@ export default {
|
|
|
5
5
|
title: 'Form/AudioRecorder',
|
|
6
6
|
component: unnnicAudioRecorder,
|
|
7
7
|
argTypes: {},
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
template: `
|
|
8
|
+
render: (args) => ({
|
|
9
|
+
components: {
|
|
10
|
+
unnnicAudioRecorder,
|
|
11
|
+
},
|
|
12
|
+
setup() {
|
|
13
|
+
return { args };
|
|
14
|
+
},
|
|
15
|
+
data() {
|
|
16
|
+
return {
|
|
17
|
+
audio: null,
|
|
18
|
+
status: '',
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
template: `
|
|
25
22
|
<div>
|
|
26
23
|
<button @click="$refs['audio-recorder'].record()">Gravar</button>
|
|
27
24
|
|
|
28
25
|
<pre>v-model: {{ audio }}</pre>
|
|
29
26
|
<pre>status: {{ status }}</pre>
|
|
30
27
|
|
|
31
|
-
<unnnic-audio-recorder v-bind="
|
|
28
|
+
<unnnic-audio-recorder v-bind="args" ref="audio-recorder" v-model="audio" @status="(value) => this.status = value" />
|
|
32
29
|
</div>
|
|
33
30
|
`,
|
|
34
|
-
|
|
35
|
-
methods: {},
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
export const Default = Template.bind({});
|
|
39
|
-
|
|
40
|
-
Default.args = {
|
|
41
|
-
canDiscard: true,
|
|
31
|
+
}),
|
|
42
32
|
};
|
|
43
33
|
|
|
44
|
-
export const
|
|
34
|
+
export const Default = {
|
|
35
|
+
args: {
|
|
36
|
+
canDiscard: true,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
45
39
|
|
|
46
|
-
Player
|
|
47
|
-
|
|
40
|
+
export const Player = {
|
|
41
|
+
args: {
|
|
42
|
+
src: AudioSample,
|
|
43
|
+
},
|
|
48
44
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import unnnicDisclaimer from '../components/Disclaimer/Disclaimer.vue';
|
|
2
|
+
import icons from '../utils/iconList';
|
|
3
|
+
import colors from '../utils/colorsList';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Example/Disclaimer',
|
|
7
|
+
component: unnnicDisclaimer,
|
|
8
|
+
args: {},
|
|
9
|
+
argTypes: {
|
|
10
|
+
text: { control: { type: 'text' } },
|
|
11
|
+
icon: { options: icons, control: { type: 'select', } },
|
|
12
|
+
iconColor: { options: colors, control: { type: 'select', } },
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const Template = (args) => ({
|
|
17
|
+
components: {
|
|
18
|
+
unnnicDisclaimer,
|
|
19
|
+
},
|
|
20
|
+
setup() {
|
|
21
|
+
return { args };
|
|
22
|
+
},
|
|
23
|
+
props: Object.keys(args),
|
|
24
|
+
template: `
|
|
25
|
+
<div>
|
|
26
|
+
<unnnic-disclaimer v-bind="args" />
|
|
27
|
+
</div>
|
|
28
|
+
`,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const Default = Template.bind({});
|
|
32
|
+
|
|
33
|
+
Default.args = {
|
|
34
|
+
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
|
|
35
|
+
icon: 'alert-circle-1-1',
|
|
36
|
+
iconColor: 'feedback-yellow',
|
|
37
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import unnnicDrawer from '../components/Drawer/Drawer.vue';
|
|
2
|
+
import unnnicButton from '../components/Button/Button.vue';
|
|
3
|
+
|
|
4
|
+
const primaryButtonTypeOptions = ['primary', 'secondary', 'tertiary', 'alternative', 'warning', 'attention']
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Example/Drawer',
|
|
8
|
+
component: unnnicDrawer,
|
|
9
|
+
argTypes: {
|
|
10
|
+
title: { control: { type: 'text' } },
|
|
11
|
+
description: { control: { type: 'text' } },
|
|
12
|
+
primaryButtonType: { options: primaryButtonTypeOptions, control: { type: 'select' } },
|
|
13
|
+
primaryButtonText: { control: { type: 'text' } },
|
|
14
|
+
secondaryButtonText: { control: { type: 'text' } },
|
|
15
|
+
modelValue: { control: { type: 'boolean' } },
|
|
16
|
+
wide: { control: { type: 'boolean' } },
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const Template = (args) => ({
|
|
21
|
+
props: Object.keys(args),
|
|
22
|
+
setup() {
|
|
23
|
+
return { args }
|
|
24
|
+
},
|
|
25
|
+
components: { unnnicDrawer, unnnicButton },
|
|
26
|
+
data() {
|
|
27
|
+
return {
|
|
28
|
+
opened: false,
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
primaryClick() {
|
|
33
|
+
console.log('primaryClick')
|
|
34
|
+
},
|
|
35
|
+
secondaryClick() {
|
|
36
|
+
console.log('secondaryClick')
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
template: `
|
|
40
|
+
<div>
|
|
41
|
+
<pre>v-model: {{ opened }}</pre>
|
|
42
|
+
<button @click="opened = !opened">Change</button>
|
|
43
|
+
<unnnic-drawer v-bind="args" v-model="opened" @close="opened = false" @primaryButtonClick="primaryClick" @secondaryButtonClick="secondaryClick">
|
|
44
|
+
<template #content>
|
|
45
|
+
<p>Conteúdo</p>
|
|
46
|
+
</template>
|
|
47
|
+
</unnnic-drawer>
|
|
48
|
+
</div>
|
|
49
|
+
`,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export const Default = Template.bind({});
|
|
53
|
+
Default.args = {
|
|
54
|
+
title: 'Title',
|
|
55
|
+
description: 'Description',
|
|
56
|
+
primaryButtonText: 'Confirmar',
|
|
57
|
+
secondaryButtonText: 'Cancelar',
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const Wide = Template.bind({});
|
|
61
|
+
Wide.args = {
|
|
62
|
+
title: 'Title',
|
|
63
|
+
description: 'Description',
|
|
64
|
+
primaryButtonText: 'Confirmar',
|
|
65
|
+
secondaryButtonText: 'Cancelar',
|
|
66
|
+
wide: true,
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const TemplateOveflowed = (args) => ({
|
|
70
|
+
props: Object.keys(args),
|
|
71
|
+
components: { unnnicDrawer, unnnicButton },
|
|
72
|
+
setup() {
|
|
73
|
+
return { args }
|
|
74
|
+
},
|
|
75
|
+
data() {
|
|
76
|
+
return {
|
|
77
|
+
opened: false,
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
template: `
|
|
81
|
+
<div>
|
|
82
|
+
<pre>v-model: {{ opened }}</pre>
|
|
83
|
+
<button @click="opened = !opened">Change</button>
|
|
84
|
+
<unnnic-drawer v-bind="args" v-model="opened" @close="opened = false">
|
|
85
|
+
<template #content>
|
|
86
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed interdum dolor viverra, aliquam metus dictum, vehicula felis. Nulla sapien nisi, laoreet sit amet nisi sed, consectetur ornare odio. Nullam facilisis a ligula quis accumsan. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus et sodales ex. Donec mauris dui, tempor eget lorem vel, blandit consequat tellus. Maecenas ut justo vitae orci commodo consectetur eget id nisl. Donec auctor sollicitudin ex at lacinia. Integer lobortis, eros nec congue facilisis, augue nisl elementum nibh, pharetra euismod odio turpis eu lorem. Vivamus a tristique tellus.</p>
|
|
87
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed interdum dolor viverra, aliquam metus dictum, vehicula felis. Nulla sapien nisi, laoreet sit amet nisi sed, consectetur ornare odio. Nullam facilisis a ligula quis accumsan. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus et sodales ex. Donec mauris dui, tempor eget lorem vel, blandit consequat tellus. Maecenas ut justo vitae orci commodo consectetur eget id nisl. Donec auctor sollicitudin ex at lacinia. Integer lobortis, eros nec congue facilisis, augue nisl elementum nibh, pharetra euismod odio turpis eu lorem. Vivamus a tristique tellus.</p>
|
|
88
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed interdum dolor viverra, aliquam metus dictum, vehicula felis. Nulla sapien nisi, laoreet sit amet nisi sed, consectetur ornare odio. Nullam facilisis a ligula quis accumsan. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus et sodales ex. Donec mauris dui, tempor eget lorem vel, blandit consequat tellus. Maecenas ut justo vitae orci commodo consectetur eget id nisl. Donec auctor sollicitudin ex at lacinia. Integer lobortis, eros nec congue facilisis, augue nisl elementum nibh, pharetra euismod odio turpis eu lorem. Vivamus a tristique tellus.</p>
|
|
89
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed interdum dolor viverra, aliquam metus dictum, vehicula felis. Nulla sapien nisi, laoreet sit amet nisi sed, consectetur ornare odio. Nullam facilisis a ligula quis accumsan. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus et sodales ex. Donec mauris dui, tempor eget lorem vel, blandit consequat tellus. Maecenas ut justo vitae orci commodo consectetur eget id nisl. Donec auctor sollicitudin ex at lacinia. Integer lobortis, eros nec congue facilisis, augue nisl elementum nibh, pharetra euismod odio turpis eu lorem. Vivamus a tristique tellus.</p>
|
|
90
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed interdum dolor viverra, aliquam metus dictum, vehicula felis. Nulla sapien nisi, laoreet sit amet nisi sed, consectetur ornare odio. Nullam facilisis a ligula quis accumsan. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus et sodales ex. Donec mauris dui, tempor eget lorem vel, blandit consequat tellus. Maecenas ut justo vitae orci commodo consectetur eget id nisl. Donec auctor sollicitudin ex at lacinia. Integer lobortis, eros nec congue facilisis, augue nisl elementum nibh, pharetra euismod odio turpis eu lorem. Vivamus a tristique tellus.</p>
|
|
91
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed interdum dolor viverra, aliquam metus dictum, vehicula felis. Nulla sapien nisi, laoreet sit amet nisi sed, consectetur ornare odio. Nullam facilisis a ligula quis accumsan. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus et sodales ex. Donec mauris dui, tempor eget lorem vel, blandit consequat tellus. Maecenas ut justo vitae orci commodo consectetur eget id nisl. Donec auctor sollicitudin ex at lacinia. Integer lobortis, eros nec congue facilisis, augue nisl elementum nibh, pharetra euismod odio turpis eu lorem. Vivamus a tristique tellus.</p>
|
|
92
|
+
</template>
|
|
93
|
+
</unnnic-drawer>
|
|
94
|
+
</div>
|
|
95
|
+
`,
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
export const ContentOverflowed = TemplateOveflowed.bind({});
|
|
99
|
+
ContentOverflowed.args = {
|
|
100
|
+
title: 'Title',
|
|
101
|
+
description: 'Description',
|
|
102
|
+
primaryButtonText: 'Confirmar',
|
|
103
|
+
secondaryButtonText: 'Cancelar',
|
|
104
|
+
wide: true,
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const TemplateVideo = (args) => ({
|
|
108
|
+
props: Object.keys(args),
|
|
109
|
+
components: { unnnicDrawer, unnnicButton },
|
|
110
|
+
setup() {
|
|
111
|
+
return { args }
|
|
112
|
+
},
|
|
113
|
+
data() {
|
|
114
|
+
return {
|
|
115
|
+
opened: false,
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
template: `
|
|
119
|
+
<div>
|
|
120
|
+
<pre>v-model: {{ opened }}</pre>
|
|
121
|
+
<button @click="opened = !opened">Change</button>
|
|
122
|
+
<unnnic-drawer v-bind="args" v-model="opened" @close="opened = false">
|
|
123
|
+
<template #content>
|
|
124
|
+
<iframe width="100%" height="315" src="https://www.youtube.com/embed/dD8ENnN-2CI?si=68dJEsG5FdiNaYvY" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
|
|
125
|
+
</template>
|
|
126
|
+
</unnnic-drawer>
|
|
127
|
+
</div>
|
|
128
|
+
`,
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
export const ContentVideo = TemplateVideo.bind({});
|
|
132
|
+
ContentVideo.args = {
|
|
133
|
+
title: 'Title',
|
|
134
|
+
description: 'Description',
|
|
135
|
+
wide: true,
|
|
136
|
+
};
|