@weni/unnnic-system 3.31.1 → 3.32.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.
Files changed (34) hide show
  1. package/dist/index.d.ts +1518 -4106
  2. package/dist/style.css +1 -1
  3. package/dist/unnnic.mjs +12879 -13865
  4. package/dist/unnnic.umd.js +36 -36
  5. package/package.json +1 -1
  6. package/src/components/index.ts +1 -41
  7. package/src/stories/PageHeader.stories.js +11 -5
  8. package/src/types/index.d.ts +0 -1
  9. package/src/components/Button/ButtonIcon.vue +0 -106
  10. package/src/components/Button/__tests__/ButtonIcon.spec.js +0 -56
  11. package/src/components/Carousel/Carousel.vue +0 -59
  12. package/src/components/Carousel/TagCarousel.vue +0 -209
  13. package/src/components/Carousel/__tests__/TagCarousel.spec.js +0 -258
  14. package/src/components/ChatText/ChatText.vue +0 -179
  15. package/src/components/CircleProgressBar/CircleProgressBar.vue +0 -150
  16. package/src/components/Indicator/Indicator.vue +0 -110
  17. package/src/components/InputNext/InputNext.vue +0 -282
  18. package/src/components/ModalUpload/ModalUpload.vue +0 -181
  19. package/src/components/MoodRating/MoodRating.vue +0 -130
  20. package/src/components/Slider/Slider.vue +0 -438
  21. package/src/components/Slider/__tests__/Slider.spec.js +0 -321
  22. package/src/components/StarRating/StarRating.vue +0 -76
  23. package/src/components/TransitionRipple/TransitionRipple.vue +0 -126
  24. package/src/stories/ButtonIcon.stories.js +0 -31
  25. package/src/stories/Carousel.stories.js +0 -45
  26. package/src/stories/ChatText.stories.js +0 -57
  27. package/src/stories/CircleProgressBar.stories.js +0 -15
  28. package/src/stories/Indicator.stories.js +0 -18
  29. package/src/stories/InputNext.stories.js +0 -92
  30. package/src/stories/ModalUpload.stories.js +0 -25
  31. package/src/stories/MoodRating.stories.js +0 -33
  32. package/src/stories/Slider.stories.js +0 -23
  33. package/src/stories/StarRating.stories.js +0 -38
  34. package/src/stories/TransitionRipple.stories.js +0 -35
@@ -1,282 +0,0 @@
1
- <template>
2
- <div :class="['unnnic-input', `size-${size}`, { 'type-error': hasError }]">
3
- <span
4
- v-if="!!$slots.label || label"
5
- :class="[
6
- 'label unnnic-font secondary color-fg-base',
7
- { 'body-md': size === 'sm', 'body-gt': size == 'md' },
8
- ]"
9
- @click="$refs.input.focus()"
10
- >
11
- <template v-if="!!$slots.label">
12
- <slot name="label" />
13
- </template>
14
-
15
- <template v-else-if="label">
16
- {{ label }}
17
- </template>
18
- </span>
19
-
20
- <div
21
- class="input-container"
22
- @click="$refs.input.focus()"
23
- >
24
- <UnnnicIcon
25
- v-if="iconLeft"
26
- :icon="iconLeft"
27
- size="sm"
28
- :scheme="iconScheme"
29
- :clickable="!!$attrs['icon-left-click']"
30
- @click="
31
- $attrs['icon-left-click']
32
- ? $emit('icon-left-click')
33
- : $refs.input.focus()
34
- "
35
- />
36
-
37
- <input
38
- ref="input"
39
- class="unnnic-font secondary"
40
- :type="
41
- allowTogglePassword
42
- ? showPassword
43
- ? 'text'
44
- : 'password'
45
- : nativeType
46
- "
47
- :placeholder="placeholder"
48
- :disabled="disabled"
49
- :value="modelValue"
50
- :maxlength="maxlength"
51
- :readonly="readonly"
52
- @focus="focus"
53
- @blur="blur"
54
- @input="$emit('update:model-value', $event.srcElement.value)"
55
- />
56
-
57
- <UnnnicIcon
58
- v-if="iconRight"
59
- :icon="iconRight"
60
- size="sm"
61
- :scheme="iconScheme"
62
- :clickable="!!$attrs['icon-right-click']"
63
- @click="
64
- $attrs['icon-right-click']
65
- ? $emit('icon-right-click')
66
- : $refs.input.focus()
67
- "
68
- />
69
-
70
- <UnnnicIcon
71
- v-if="allowTogglePassword"
72
- :icon="showPassword ? 'view-off-1' : 'view-1-1'"
73
- size="sm"
74
- :scheme="iconScheme"
75
- clickable
76
- @click="showPassword = !showPassword"
77
- />
78
- </div>
79
-
80
- <div
81
- v-if="error && error !== true"
82
- class="message unnnic-font secondary body-md color-feedback-red"
83
- >
84
- {{ error }}
85
- </div>
86
-
87
- <div
88
- v-else-if="message"
89
- class="message unnnic-font secondary body-md color-fg-base"
90
- >
91
- {{ message }}
92
- </div>
93
- </div>
94
- </template>
95
-
96
- <script>
97
- import UnnnicIcon from '../Icon.vue';
98
-
99
- export default {
100
- components: {
101
- UnnnicIcon,
102
- },
103
-
104
- props: {
105
- modelValue: String,
106
- label: String,
107
- iconLeft: String,
108
- iconRight: String,
109
-
110
- allowTogglePassword: Boolean,
111
- disabled: Boolean,
112
-
113
- maxlength: {
114
- type: [String, Number],
115
- },
116
-
117
- size: {
118
- type: String,
119
- default: 'md',
120
- validator: (size) => ['md', 'sm'].includes(size),
121
- },
122
-
123
- type: {
124
- type: String,
125
- default: 'normal',
126
- validator: (type) => ['normal', 'error'].includes(type),
127
- },
128
-
129
- nativeType: {
130
- type: String,
131
- default: 'text',
132
- validator: (type) => ['text', 'password'].includes(type),
133
- },
134
-
135
- placeholder: String,
136
-
137
- message: String,
138
-
139
- error: {
140
- type: [Boolean, String],
141
- },
142
-
143
- readonly: {
144
- type: Boolean,
145
- default: false,
146
- },
147
- },
148
-
149
- data() {
150
- return {
151
- isFocused: false,
152
- showPassword: false,
153
- };
154
- },
155
-
156
- computed: {
157
- hasError() {
158
- return this.error === true || this.error || this.type === 'error';
159
- },
160
-
161
- iconScheme() {
162
- if (this.hasError) {
163
- return 'feedback-red';
164
- }
165
-
166
- return 'fg-base';
167
- },
168
- },
169
-
170
- methods: {
171
- focus() {
172
- this.isFocused = true;
173
- },
174
-
175
- blur() {
176
- this.isFocused = false;
177
- },
178
- },
179
- };
180
- </script>
181
-
182
- <style lang="scss" scoped>
183
- @use '@/assets/scss/unnnic' as *;
184
-
185
- .unnnic-input {
186
- .label {
187
- display: inline-block;
188
- }
189
-
190
- .input-container {
191
- background-color: $unnnic-color-bg-base;
192
- border-radius: $unnnic-border-radius-sm;
193
- outline-style: solid;
194
- outline-color: $unnnic-color-bg-muted;
195
- outline-width: 1px;
196
- outline-offset: -1px;
197
- cursor: text;
198
- display: flex;
199
- align-items: center;
200
- column-gap: $unnnic-spacing-inline-xs;
201
-
202
- &:focus-within {
203
- outline-color: $unnnic-color-fg-base;
204
- }
205
-
206
- &:has(input:disabled) {
207
- outline-style: dashed;
208
- outline-color: $unnnic-color-fg-muted;
209
- background-color: $unnnic-color-bg-base-soft;
210
- cursor: default;
211
- }
212
-
213
- input {
214
- all: unset;
215
-
216
- flex: 1;
217
-
218
- font-family: $unnnic-font-family-secondary;
219
- font-weight: $unnnic-font-weight-regular;
220
- color: $unnnic-color-fg-base;
221
-
222
- &:focus::placeholder {
223
- color: $unnnic-color-fg-muted;
224
- }
225
-
226
- &::placeholder {
227
- color: $unnnic-color-fg-base;
228
- opacity: 1; /* Firefox */
229
- user-select: none;
230
- }
231
- }
232
- }
233
-
234
- .message {
235
- margin-top: $unnnic-spacing-stack-nano;
236
- }
237
-
238
- &.size-md {
239
- .label {
240
- margin-bottom: $unnnic-spacing-stack-xs;
241
- }
242
-
243
- .input-container {
244
- padding: $unnnic-squish-xs;
245
-
246
- input {
247
- font-size: $unnnic-font-size-body-gt;
248
- line-height: $unnnic-font-size-body-gt + $unnnic-line-height-md;
249
- }
250
- }
251
- }
252
-
253
- &.size-sm {
254
- .label {
255
- margin-bottom: $unnnic-spacing-stack-nano;
256
- }
257
-
258
- .input-container {
259
- padding: $unnnic-squish-nano;
260
-
261
- input {
262
- font-size: $unnnic-font-size-body-md;
263
- line-height: $unnnic-font-size-body-md + $unnnic-line-height-md;
264
- }
265
- }
266
- }
267
-
268
- &.type-error {
269
- .input-container {
270
- outline-color: $unnnic-color-fg-critical;
271
-
272
- input {
273
- color: $unnnic-color-fg-critical;
274
-
275
- &::placeholder {
276
- color: $unnnic-color-fg-critical;
277
- }
278
- }
279
- }
280
- }
281
- }
282
- </style>
@@ -1,181 +0,0 @@
1
- <template>
2
- <div class="modal-upload">
3
- <div class="close-button-container">
4
- <UnnnicIcon
5
- class="close-button"
6
- icon="close-1"
7
- scheme="fg-base"
8
- size="sm"
9
- clickable
10
- @click="$emit('close')"
11
- />
12
- </div>
13
-
14
- <div class="title">
15
- {{ textTitle }}
16
- </div>
17
-
18
- <UnnnicUploadArea
19
- :acceptMultiple="acceptMultiple"
20
- :supportedFormats="supportedFormats"
21
- :maximumUploads="maximumUploads"
22
- :filesProgress="filesProgress"
23
- :isUploading="isUploading"
24
- :canImport="canImport"
25
- :canDelete="canDelete"
26
- :maxFileSize="maxFileSize"
27
- :files="files"
28
- :subtitle="subtitle"
29
- @file-change="$emit('file-change', $event)"
30
- />
31
-
32
- <div class="footer">
33
- <UnnnicButton
34
- size="large"
35
- type="tertiary"
36
- :text="textCancel"
37
- @click="$emit('cancel')"
38
- />
39
-
40
- <UnnnicButton
41
- size="large"
42
- type="primary"
43
- :text="textAction"
44
- @click="$emit('action')"
45
- />
46
- </div>
47
- </div>
48
- </template>
49
-
50
- <script>
51
- import UnnnicUploadArea from '../UploadArea/UploadArea.vue';
52
- import UnnnicIcon from '../Icon.vue';
53
- import UnnnicButton from '../Button/Button.vue';
54
-
55
- export default {
56
- components: {
57
- UnnnicUploadArea,
58
- UnnnicIcon,
59
- UnnnicButton,
60
- },
61
- model: {
62
- prop: 'files',
63
- event: 'file-change',
64
- },
65
-
66
- props: {
67
- textCancel: {
68
- type: String,
69
- default: 'Cancelar',
70
- },
71
-
72
- textAction: {
73
- type: String,
74
- default: 'Importar tudo',
75
- },
76
-
77
- textTitle: {
78
- type: String,
79
- default: 'Importar sentenças',
80
- },
81
-
82
- acceptMultiple: {
83
- type: Boolean,
84
- default: true,
85
- },
86
-
87
- supportedFormats: {
88
- type: String,
89
- default: '.png',
90
- },
91
-
92
- maximumUploads: {
93
- type: Number,
94
- default: 1,
95
- },
96
-
97
- filesProgress: {
98
- type: Array,
99
- default: () => [],
100
- },
101
-
102
- isUploading: {
103
- type: Boolean,
104
- default: false,
105
- },
106
-
107
- canImport: {
108
- type: Boolean,
109
- default: false,
110
- },
111
-
112
- canDelete: {
113
- type: Boolean,
114
- default: true,
115
- },
116
-
117
- maxFileSize: {
118
- type: Number,
119
- default: undefined,
120
- },
121
-
122
- files: {
123
- type: Array,
124
- default: () => [],
125
- },
126
- subtitle: {
127
- required: false,
128
- type: String,
129
- default: '',
130
- },
131
- },
132
- emits: ['close', 'file-change', 'cancel', 'action'],
133
-
134
- data() {
135
- return {};
136
- },
137
- };
138
- </script>
139
-
140
- <style lang="scss" scoped>
141
- @use '@/assets/scss/unnnic' as *;
142
-
143
- .modal-upload {
144
- background-color: $unnnic-color-bg-base-soft;
145
- border-radius: $unnnic-border-radius-sm;
146
- padding: 0 $unnnic-spacing-inline-md;
147
- padding-top: $unnnic-spacing-stack-sm;
148
- padding-bottom: $unnnic-spacing-stack-giant;
149
- box-shadow: $unnnic-shadow-1;
150
-
151
- .close-button-container {
152
- text-align: right;
153
- margin-bottom: $unnnic-spacing-stack-xs;
154
-
155
- .close-button {
156
- cursor: pointer;
157
- }
158
- }
159
-
160
- .title {
161
- text-align: center;
162
- font-family: $unnnic-font-family-secondary;
163
- font-weight: $unnnic-font-weight-black;
164
- font-size: $unnnic-font-size-title-sm;
165
- line-height: $unnnic-font-size-title-sm + $unnnic-line-height-md;
166
- color: $unnnic-color-fg-emphasized;
167
- margin-bottom: $unnnic-spacing-stack-md;
168
- }
169
-
170
- .footer {
171
- margin-top: $unnnic-spacing-stack-md;
172
- margin-bottom: -$unnnic-spacing-stack-sm;
173
- display: grid;
174
- grid-gap: $unnnic-spacing-inline-lg;
175
- grid-template-columns: repeat(
176
- auto-fit,
177
- minmax(10 * $unnnic-font-size, 1fr)
178
- );
179
- }
180
- }
181
- </style>
@@ -1,130 +0,0 @@
1
- <template>
2
- <div class="unnnic-mood-rating">
3
- <div class="title">{{ title }}</div>
4
-
5
- <div :class="['moods', { selected: modelValue !== null }]">
6
- <div
7
- v-for="(mood, index) in moods"
8
- :key="index"
9
- class="mood"
10
- >
11
- <UnnnicToolTip
12
- side="bottom"
13
- :text="titlesMoods[index]"
14
- enabled
15
- >
16
- <img
17
- :src="mood.image"
18
- :class="{
19
- active: modelValue && index === modelValue - 1,
20
- }"
21
- @click="
22
- modelValue && index === modelValue - 1
23
- ? $emit('update:model-value', null)
24
- : $emit('update:model-value', index + 1)
25
- "
26
- />
27
- </UnnnicToolTip>
28
- </div>
29
- </div>
30
- </div>
31
- </template>
32
-
33
- <script>
34
- import UnnnicToolTip from '../ToolTip/ToolTip.vue';
35
-
36
- import mood1 from '../../assets/emoji/u1F625.png';
37
- import mood2 from '../../assets/emoji/u1F641.png';
38
- import mood3 from '../../assets/emoji/u1F610.png';
39
- import mood4 from '../../assets/emoji/u1F645.png';
40
- import mood5 from '../../assets/emoji/u1F601.png';
41
-
42
- export default {
43
- components: {
44
- UnnnicToolTip,
45
- },
46
-
47
- props: {
48
- modelValue: {
49
- type: Number,
50
- },
51
-
52
- title: {
53
- type: String,
54
- },
55
-
56
- titlesMoods: {
57
- type: Array,
58
- default() {
59
- return ['Decepcionado', 'Insatisfeito', 'Neutro', 'Feliz', 'Produtivo'];
60
- },
61
- },
62
- },
63
-
64
- data() {
65
- return {
66
- moods: [
67
- {
68
- image: mood1,
69
- },
70
- {
71
- image: mood2,
72
- },
73
- {
74
- image: mood3,
75
- },
76
- {
77
- image: mood4,
78
- },
79
- {
80
- image: mood5,
81
- },
82
- ],
83
- };
84
- },
85
- };
86
- </script>
87
-
88
- <style lang="scss" scoped>
89
- @use '@/assets/scss/unnnic' as *;
90
-
91
- .unnnic-mood-rating {
92
- text-align: center;
93
-
94
- .title {
95
- margin-bottom: $unnnic-spacing-stack-xs;
96
- font-family: $unnnic-font-family-secondary;
97
- font-weight: $unnnic-font-weight-bold;
98
- font-size: $unnnic-font-size-body-lg;
99
- line-height: $unnnic-font-size-body-lg + $unnnic-line-height-md;
100
- color: $unnnic-color-fg-base;
101
- }
102
-
103
- .moods {
104
- display: flex;
105
- justify-content: center;
106
- column-gap: $unnnic-spacing-inline-sm;
107
- height: 2.5 * $unnnic-font-size;
108
-
109
- &.selected .mood img {
110
- opacity: $unnnic-opacity-level-overlay;
111
- }
112
-
113
- .mood {
114
- padding-top: $unnnic-spacing-stack-nano;
115
-
116
- img {
117
- cursor: pointer;
118
- width: $unnnic-icon-size-lg;
119
- transition: all 300ms;
120
-
121
- &:hover,
122
- &.active {
123
- opacity: 1;
124
- width: $unnnic-icon-size-xl;
125
- }
126
- }
127
- }
128
- }
129
- }
130
- </style>