vueless 0.0.702 → 0.0.704
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/bin/constants.js +2 -2
- package/constants.js +2 -2
- package/package.json +1 -1
- package/ui.button/config.ts +8 -26
- package/ui.button/storybook/stories.ts +0 -3
- package/ui.button/types.ts +0 -5
- package/ui.button-link/config.ts +3 -9
- package/ui.button-link/storybook/stories.ts +0 -3
- package/ui.button-link/types.ts +0 -5
- package/ui.button-toggle/UToggle.vue +0 -1
- package/ui.button-toggle/config.ts +1 -6
- package/ui.button-toggle/types.ts +0 -5
- package/ui.button-toggle-item/UToggleItem.vue +0 -2
- package/ui.button-toggle-item/config.ts +1 -1
- package/ui.container-modal/UModal.vue +0 -1
- package/ui.container-page/UPage.vue +0 -1
- package/ui.dropdown-badge/config.ts +4 -5
- package/ui.dropdown-badge/storybook/stories.ts +0 -1
- package/ui.dropdown-button/config.ts +4 -5
- package/ui.dropdown-button/storybook/stories.ts +0 -1
- package/ui.dropdown-link/UDropdownLink.vue +0 -1
- package/ui.dropdown-link/config.ts +3 -7
- package/ui.dropdown-link/storybook/stories.ts +0 -3
- package/ui.dropdown-link/types.ts +0 -5
- package/ui.dropdown-list/config.ts +7 -3
- package/ui.dropdown-list/storybook/stories.ts +1 -0
- package/ui.form-calendar/UCalendar.vue +0 -4
- package/ui.form-calendar/UCalendarDayView.vue +0 -13
- package/ui.form-calendar/UCalendarMonthView.vue +0 -12
- package/ui.form-calendar/UCalendarYearView.vue +0 -12
- package/ui.form-checkbox/config.ts +9 -6
- package/ui.form-color-picker/UColorPicker.vue +0 -1
- package/ui.form-date-picker-range/UDatePickerRange.vue +0 -3
- package/ui.form-date-picker-range/UDatePickerRangePeriodMenu.vue +0 -12
- package/ui.form-date-picker-range/config.ts +7 -20
- package/ui.form-input/UInput.vue +2 -8
- package/ui.form-input/config.ts +6 -16
- package/ui.form-input/storybook/stories.ts +36 -22
- package/ui.form-input/types.ts +1 -1
- package/ui.form-input-file/UInputFile.vue +1 -2
- package/ui.form-input-file/config.ts +4 -7
- package/ui.form-input-money/UInputMoney.vue +5 -4
- package/ui.form-input-money/storybook/stories.ts +126 -49
- package/ui.form-input-number/storybook/stories.ts +43 -21
- package/ui.form-input-rating/UInputRating.vue +1 -0
- package/ui.form-input-rating/config.ts +5 -0
- package/ui.form-input-rating/storybook/stories.ts +62 -19
- package/ui.form-input-rating/types.ts +12 -7
- package/ui.form-input-search/UInputSearch.vue +1 -1
- package/ui.form-input-search/config.ts +8 -11
- package/ui.form-input-search/storybook/stories.ts +110 -31
- package/ui.form-input-search/types.ts +6 -6
- package/ui.form-label/config.ts +3 -3
- package/ui.form-radio/URadio.vue +5 -2
- package/ui.form-radio/config.ts +12 -6
- package/ui.form-radio-group/URadioGroup.vue +1 -0
- package/ui.form-select/config.ts +4 -7
- package/ui.form-switch/USwitch.vue +8 -2
- package/ui.form-switch/config.ts +11 -8
- package/ui.form-switch/types.ts +0 -1
- package/ui.form-textarea/config.ts +8 -14
- package/ui.navigation-breadcrumbs/UBreadcrumbs.vue +0 -1
- package/ui.navigation-breadcrumbs/types.ts +1 -1
- package/ui.navigation-pagination/UPagination.vue +22 -10
- package/ui.navigation-pagination/config.ts +15 -17
- package/ui.navigation-tab/UTab.vue +58 -20
- package/ui.navigation-tab/config.ts +14 -14
- package/ui.navigation-tab/storybook/stories.ts +1 -1
- package/ui.navigation-tab/types.ts +15 -4
- package/ui.navigation-tabs/UTabs.vue +6 -4
- package/ui.navigation-tabs/config.ts +4 -15
- package/ui.navigation-tabs/storybook/stories.ts +0 -3
- package/ui.navigation-tabs/types.ts +8 -3
- package/ui.text-alert/UAlert.vue +0 -1
- package/ui.text-badge/config.ts +3 -6
- package/ui.text-file/UFile.vue +2 -9
|
@@ -134,7 +134,6 @@ const {
|
|
|
134
134
|
variant="primary"
|
|
135
135
|
color="brand"
|
|
136
136
|
size="md"
|
|
137
|
-
:ring="false"
|
|
138
137
|
v-bind="selectedMonthAttrs"
|
|
139
138
|
:disabled="dateIsOutOfRange(month, minDate, maxDate, locale, dateFormat)"
|
|
140
139
|
:label="formatDate(month, 'M', props.locale)"
|
|
@@ -148,7 +147,6 @@ const {
|
|
|
148
147
|
"
|
|
149
148
|
variant="thirdary"
|
|
150
149
|
color="brand"
|
|
151
|
-
:ring="false"
|
|
152
150
|
v-bind="currentMonthAttrs"
|
|
153
151
|
:disabled="dateIsOutOfRange(month, minDate, maxDate, locale, dateFormat)"
|
|
154
152
|
:label="formatDate(month, 'M', props.locale)"
|
|
@@ -161,7 +159,6 @@ const {
|
|
|
161
159
|
variant="thirdary"
|
|
162
160
|
color="brand"
|
|
163
161
|
size="md"
|
|
164
|
-
:ring="false"
|
|
165
162
|
filled
|
|
166
163
|
v-bind="currentFirstMonthInRangeAttrs"
|
|
167
164
|
:disabled="dateIsOutOfRange(month, minDate, maxDate, locale, dateFormat)"
|
|
@@ -175,7 +172,6 @@ const {
|
|
|
175
172
|
variant="thirdary"
|
|
176
173
|
color="brand"
|
|
177
174
|
size="md"
|
|
178
|
-
:ring="false"
|
|
179
175
|
filled
|
|
180
176
|
v-bind="currentLastMonthInRangeAttrs"
|
|
181
177
|
:disabled="dateIsOutOfRange(month, minDate, maxDate, locale, dateFormat)"
|
|
@@ -189,7 +185,6 @@ const {
|
|
|
189
185
|
variant="thirdary"
|
|
190
186
|
color="brand"
|
|
191
187
|
size="md"
|
|
192
|
-
:ring="false"
|
|
193
188
|
filled
|
|
194
189
|
v-bind="firstMonthInRangeAttrs"
|
|
195
190
|
:disabled="dateIsOutOfRange(month, minDate, maxDate, locale, dateFormat)"
|
|
@@ -203,7 +198,6 @@ const {
|
|
|
203
198
|
variant="thirdary"
|
|
204
199
|
color="brand"
|
|
205
200
|
size="md"
|
|
206
|
-
:ring="false"
|
|
207
201
|
filled
|
|
208
202
|
v-bind="lastMonthInRangeAttrs"
|
|
209
203
|
:disabled="dateIsOutOfRange(month, minDate, maxDate, locale, dateFormat)"
|
|
@@ -220,7 +214,6 @@ const {
|
|
|
220
214
|
variant="primary"
|
|
221
215
|
color="brand"
|
|
222
216
|
size="md"
|
|
223
|
-
:ring="false"
|
|
224
217
|
v-bind="singleCurrentMonthInRangeAttrs"
|
|
225
218
|
:disabled="dateIsOutOfRange(month, minDate, maxDate, locale, dateFormat)"
|
|
226
219
|
:label="formatDate(month, 'M', props.locale)"
|
|
@@ -233,7 +226,6 @@ const {
|
|
|
233
226
|
variant="primary"
|
|
234
227
|
color="brand"
|
|
235
228
|
size="md"
|
|
236
|
-
:ring="false"
|
|
237
229
|
v-bind="currentMonthInRangeAttrs"
|
|
238
230
|
:disabled="dateIsOutOfRange(month, minDate, maxDate, locale, dateFormat)"
|
|
239
231
|
:label="formatDate(month, 'M', props.locale)"
|
|
@@ -249,7 +241,6 @@ const {
|
|
|
249
241
|
variant="thirdary"
|
|
250
242
|
color="brand"
|
|
251
243
|
size="md"
|
|
252
|
-
:ring="false"
|
|
253
244
|
v-bind="singleMonthInRangeAttrs"
|
|
254
245
|
:disabled="dateIsOutOfRange(month, minDate, maxDate, locale, dateFormat)"
|
|
255
246
|
:label="formatDate(month, 'M', props.locale)"
|
|
@@ -265,7 +256,6 @@ const {
|
|
|
265
256
|
variant="thirdary"
|
|
266
257
|
color="brand"
|
|
267
258
|
size="md"
|
|
268
|
-
:ring="false"
|
|
269
259
|
v-bind="monthInRangeAttrs"
|
|
270
260
|
:disabled="dateIsOutOfRange(month, minDate, maxDate, locale, dateFormat)"
|
|
271
261
|
:label="formatDate(month, 'M', props.locale)"
|
|
@@ -278,7 +268,6 @@ const {
|
|
|
278
268
|
variant="thirdary"
|
|
279
269
|
color="brand"
|
|
280
270
|
size="md"
|
|
281
|
-
:ring="false"
|
|
282
271
|
v-bind="activeMonthAttrs"
|
|
283
272
|
:disabled="dateIsOutOfRange(month, minDate, maxDate, locale, dateFormat)"
|
|
284
273
|
:label="formatDate(month, 'M', props.locale)"
|
|
@@ -291,7 +280,6 @@ const {
|
|
|
291
280
|
variant="thirdary"
|
|
292
281
|
color="grayscale"
|
|
293
282
|
size="md"
|
|
294
|
-
:ring="false"
|
|
295
283
|
v-bind="monthAttrs"
|
|
296
284
|
:disabled="dateIsOutOfRange(month, minDate, maxDate, locale, dateFormat)"
|
|
297
285
|
:label="formatDate(month, 'M', props.locale)"
|
|
@@ -132,7 +132,6 @@ const {
|
|
|
132
132
|
variant="primary"
|
|
133
133
|
color="brand"
|
|
134
134
|
size="md"
|
|
135
|
-
:ring="false"
|
|
136
135
|
v-bind="selectedYearAttrs"
|
|
137
136
|
:disabled="dateIsOutOfRange(year, minDate, maxDate, locale, dateFormat)"
|
|
138
137
|
:label="formatDate(year, 'Y', props.locale)"
|
|
@@ -145,7 +144,6 @@ const {
|
|
|
145
144
|
variant="thirdary"
|
|
146
145
|
color="brand"
|
|
147
146
|
size="md"
|
|
148
|
-
:ring="false"
|
|
149
147
|
v-bind="currentYearAttrs"
|
|
150
148
|
:disabled="dateIsOutOfRange(year, minDate, maxDate, locale, dateFormat)"
|
|
151
149
|
:label="formatDate(year, 'Y', props.locale)"
|
|
@@ -158,7 +156,6 @@ const {
|
|
|
158
156
|
variant="thirdary"
|
|
159
157
|
color="brand"
|
|
160
158
|
size="md"
|
|
161
|
-
:ring="false"
|
|
162
159
|
filled
|
|
163
160
|
v-bind="currentFirstYearInRangeAttrs"
|
|
164
161
|
:disabled="dateIsOutOfRange(year, minDate, maxDate, locale, dateFormat)"
|
|
@@ -172,7 +169,6 @@ const {
|
|
|
172
169
|
variant="thirdary"
|
|
173
170
|
color="brand"
|
|
174
171
|
size="md"
|
|
175
|
-
:ring="false"
|
|
176
172
|
filled
|
|
177
173
|
v-bind="currentLastYearInRangeAttrs"
|
|
178
174
|
:disabled="dateIsOutOfRange(year, minDate, maxDate, locale, dateFormat)"
|
|
@@ -186,7 +182,6 @@ const {
|
|
|
186
182
|
variant="thirdary"
|
|
187
183
|
color="brand"
|
|
188
184
|
size="md"
|
|
189
|
-
:ring="false"
|
|
190
185
|
filled
|
|
191
186
|
v-bind="firstYearInRangeAttrs"
|
|
192
187
|
:disabled="dateIsOutOfRange(year, minDate, maxDate, locale, dateFormat)"
|
|
@@ -200,7 +195,6 @@ const {
|
|
|
200
195
|
variant="thirdary"
|
|
201
196
|
color="brand"
|
|
202
197
|
size="md"
|
|
203
|
-
:ring="false"
|
|
204
198
|
filled
|
|
205
199
|
v-bind="lastYearInRangeAttrs"
|
|
206
200
|
:disabled="dateIsOutOfRange(year, minDate, maxDate, locale, dateFormat)"
|
|
@@ -217,7 +211,6 @@ const {
|
|
|
217
211
|
variant="thirdary"
|
|
218
212
|
color="brand"
|
|
219
213
|
size="md"
|
|
220
|
-
:ring="false"
|
|
221
214
|
v-bind="singleCurrentYearInRangeAttrs"
|
|
222
215
|
:disabled="dateIsOutOfRange(year, minDate, maxDate, locale, dateFormat)"
|
|
223
216
|
:label="formatDate(year, 'Y', props.locale)"
|
|
@@ -230,7 +223,6 @@ const {
|
|
|
230
223
|
variant="thirdary"
|
|
231
224
|
color="brand"
|
|
232
225
|
size="md"
|
|
233
|
-
:ring="false"
|
|
234
226
|
v-bind="currentYearInRangeAttrs"
|
|
235
227
|
:disabled="dateIsOutOfRange(year, minDate, maxDate, locale, dateFormat)"
|
|
236
228
|
:label="formatDate(year, 'Y', props.locale) + 'sd'"
|
|
@@ -245,7 +237,6 @@ const {
|
|
|
245
237
|
variant="thirdary"
|
|
246
238
|
color="brand"
|
|
247
239
|
size="md"
|
|
248
|
-
:ring="false"
|
|
249
240
|
v-bind="singleYearInRangeAttrs"
|
|
250
241
|
:disabled="dateIsOutOfRange(year, minDate, maxDate, locale, dateFormat)"
|
|
251
242
|
:label="formatDate(year, 'Y', props.locale)"
|
|
@@ -260,7 +251,6 @@ const {
|
|
|
260
251
|
variant="thirdary"
|
|
261
252
|
color="brand"
|
|
262
253
|
size="md"
|
|
263
|
-
:ring="false"
|
|
264
254
|
v-bind="yearInRangeAttrs"
|
|
265
255
|
:disabled="dateIsOutOfRange(year, minDate, maxDate, locale, dateFormat)"
|
|
266
256
|
:label="formatDate(year, 'Y', props.locale)"
|
|
@@ -273,7 +263,6 @@ const {
|
|
|
273
263
|
variant="thirdary"
|
|
274
264
|
color="brand"
|
|
275
265
|
size="md"
|
|
276
|
-
:ring="false"
|
|
277
266
|
v-bind="activeYearAttrs"
|
|
278
267
|
:disabled="dateIsOutOfRange(year, minDate, maxDate, locale, dateFormat)"
|
|
279
268
|
:label="formatDate(year, 'Y', props.locale)"
|
|
@@ -286,7 +275,6 @@ const {
|
|
|
286
275
|
variant="thirdary"
|
|
287
276
|
color="grayscale"
|
|
288
277
|
size="md"
|
|
289
|
-
:ring="false"
|
|
290
278
|
v-bind="yearAttrs"
|
|
291
279
|
:disabled="dateIsOutOfRange(year, minDate, maxDate, locale, dateFormat)"
|
|
292
280
|
:label="formatDate(year, 'Y', props.locale)"
|
|
@@ -2,9 +2,12 @@ export default /*tw*/ {
|
|
|
2
2
|
checkboxLabel: "{ULabel}",
|
|
3
3
|
checkbox: {
|
|
4
4
|
base: `
|
|
5
|
-
border rounded-dynamic-sm bg-white cursor-pointer transition
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
border border-gray-300 rounded-dynamic-sm bg-white cursor-pointer transition
|
|
6
|
+
hover:border-gray-400
|
|
7
|
+
active:border-{color}-600 active:bg-{color}-200
|
|
8
|
+
focus:ring-0 focus:ring-offset-0
|
|
9
|
+
checked:text-{color}-600
|
|
10
|
+
focus-visible:ring-{color}-600 focus-visible:ring-dynamic focus-visible:ring-offset-dynamic
|
|
8
11
|
disabled:border-gray-300 disabled:bg-gray-100 disabled:cursor-not-allowed
|
|
9
12
|
`,
|
|
10
13
|
variants: {
|
|
@@ -14,10 +17,10 @@ export default /*tw*/ {
|
|
|
14
17
|
lg: "size-6",
|
|
15
18
|
},
|
|
16
19
|
color: {
|
|
17
|
-
grayscale: "focus:ring-gray-
|
|
20
|
+
grayscale: "focus-visible:ring-gray-900 active:bg-gray-200 checked:text-gray-900",
|
|
18
21
|
},
|
|
19
22
|
error: {
|
|
20
|
-
true: "
|
|
23
|
+
true: "!border-red-600 focus:ring-red-600",
|
|
21
24
|
},
|
|
22
25
|
},
|
|
23
26
|
},
|
|
@@ -33,7 +36,7 @@ export default /*tw*/ {
|
|
|
33
36
|
lg: "size-6",
|
|
34
37
|
},
|
|
35
38
|
color: {
|
|
36
|
-
grayscale: "
|
|
39
|
+
grayscale: "bg-gray-900 hover:bg-gray-800 active:bg-gray-700",
|
|
37
40
|
},
|
|
38
41
|
disabled: {
|
|
39
42
|
true: "border-gray-400 bg-gray-400",
|
|
@@ -630,7 +630,6 @@ watchEffect(() => {
|
|
|
630
630
|
square
|
|
631
631
|
filled
|
|
632
632
|
:size="size"
|
|
633
|
-
:ring="false"
|
|
634
633
|
:disabled="disabled"
|
|
635
634
|
variant="thirdary"
|
|
636
635
|
:left-icon="config.defaults.prevIcon"
|
|
@@ -644,7 +643,6 @@ watchEffect(() => {
|
|
|
644
643
|
square
|
|
645
644
|
filled
|
|
646
645
|
:size="size"
|
|
647
|
-
:ring="false"
|
|
648
646
|
:disabled="disabled"
|
|
649
647
|
:label="userFormatDate"
|
|
650
648
|
variant="thirdary"
|
|
@@ -657,7 +655,6 @@ watchEffect(() => {
|
|
|
657
655
|
square
|
|
658
656
|
filled
|
|
659
657
|
:size="size"
|
|
660
|
-
:ring="false"
|
|
661
658
|
:disabled="disabled"
|
|
662
659
|
variant="thirdary"
|
|
663
660
|
:left-icon="config.defaults.nextIcon"
|
|
@@ -140,7 +140,6 @@ function getDatePeriodState(date: DatePeriodRange) {
|
|
|
140
140
|
square
|
|
141
141
|
filled
|
|
142
142
|
size="xs"
|
|
143
|
-
:ring="false"
|
|
144
143
|
color="grayscale"
|
|
145
144
|
variant="thirdary"
|
|
146
145
|
:label="periodButton.title"
|
|
@@ -153,7 +152,6 @@ function getDatePeriodState(date: DatePeriodRange) {
|
|
|
153
152
|
square
|
|
154
153
|
filled
|
|
155
154
|
size="xs"
|
|
156
|
-
:ring="false"
|
|
157
155
|
color="grayscale"
|
|
158
156
|
variant="thirdary"
|
|
159
157
|
:label="periodButton.title"
|
|
@@ -169,7 +167,6 @@ function getDatePeriodState(date: DatePeriodRange) {
|
|
|
169
167
|
square
|
|
170
168
|
filled
|
|
171
169
|
size="xs"
|
|
172
|
-
:ring="false"
|
|
173
170
|
color="grayscale"
|
|
174
171
|
variant="thirdary"
|
|
175
172
|
v-bind="attrs.periodButtonAttrs.value"
|
|
@@ -188,7 +185,6 @@ function getDatePeriodState(date: DatePeriodRange) {
|
|
|
188
185
|
square
|
|
189
186
|
filled
|
|
190
187
|
size="xs"
|
|
191
|
-
:ring="false"
|
|
192
188
|
color="grayscale"
|
|
193
189
|
variant="thirdary"
|
|
194
190
|
v-bind="attrs.periodButtonActiveAttrs.value"
|
|
@@ -207,7 +203,6 @@ function getDatePeriodState(date: DatePeriodRange) {
|
|
|
207
203
|
square
|
|
208
204
|
filled
|
|
209
205
|
size="xs"
|
|
210
|
-
:ring="false"
|
|
211
206
|
color="grayscale"
|
|
212
207
|
variant="thirdary"
|
|
213
208
|
:label="locale.ownRange"
|
|
@@ -221,7 +216,6 @@ function getDatePeriodState(date: DatePeriodRange) {
|
|
|
221
216
|
square
|
|
222
217
|
filled
|
|
223
218
|
size="xs"
|
|
224
|
-
:ring="false"
|
|
225
219
|
color="grayscale"
|
|
226
220
|
variant="thirdary"
|
|
227
221
|
:label="locale.ownRange"
|
|
@@ -236,7 +230,6 @@ function getDatePeriodState(date: DatePeriodRange) {
|
|
|
236
230
|
<UButton
|
|
237
231
|
square
|
|
238
232
|
size="sm"
|
|
239
|
-
:ring="false"
|
|
240
233
|
color="grayscale"
|
|
241
234
|
variant="thirdary"
|
|
242
235
|
:left-icon="config.defaults?.prevIcon"
|
|
@@ -251,7 +244,6 @@ function getDatePeriodState(date: DatePeriodRange) {
|
|
|
251
244
|
<UButton
|
|
252
245
|
square
|
|
253
246
|
size="sm"
|
|
254
|
-
:ring="false"
|
|
255
247
|
color="grayscale"
|
|
256
248
|
variant="thirdary"
|
|
257
249
|
:left-icon="config.defaults?.nextIcon"
|
|
@@ -269,7 +261,6 @@ function getDatePeriodState(date: DatePeriodRange) {
|
|
|
269
261
|
v-if="getDatePeriodState(date).isSelected && getDatePeriodState(date).isCurrentDate"
|
|
270
262
|
filled
|
|
271
263
|
size="sm"
|
|
272
|
-
:ring="false"
|
|
273
264
|
color="brand"
|
|
274
265
|
variant="thirdary"
|
|
275
266
|
:disabled="isDatePeriodOutOfRange(date)"
|
|
@@ -282,7 +273,6 @@ function getDatePeriodState(date: DatePeriodRange) {
|
|
|
282
273
|
v-else-if="getDatePeriodState(date).isSelected"
|
|
283
274
|
filled
|
|
284
275
|
size="sm"
|
|
285
|
-
:ring="false"
|
|
286
276
|
color="brand"
|
|
287
277
|
variant="thirdary"
|
|
288
278
|
:disabled="isDatePeriodOutOfRange(date)"
|
|
@@ -296,7 +286,6 @@ function getDatePeriodState(date: DatePeriodRange) {
|
|
|
296
286
|
filled
|
|
297
287
|
size="sm"
|
|
298
288
|
color="brand"
|
|
299
|
-
:ring="false"
|
|
300
289
|
variant="secondary"
|
|
301
290
|
:disabled="isDatePeriodOutOfRange(date)"
|
|
302
291
|
v-bind="attrs.periodDateCurrentAttrs.value"
|
|
@@ -307,7 +296,6 @@ function getDatePeriodState(date: DatePeriodRange) {
|
|
|
307
296
|
<UButton
|
|
308
297
|
v-else
|
|
309
298
|
size="sm"
|
|
310
|
-
:ring="false"
|
|
311
299
|
color="grayscale"
|
|
312
300
|
variant="thirdary"
|
|
313
301
|
:disabled="isDatePeriodOutOfRange(date)"
|
|
@@ -2,12 +2,12 @@ export default /*tw*/ {
|
|
|
2
2
|
wrapper: "relative",
|
|
3
3
|
datepickerInput: "{UInput}",
|
|
4
4
|
datepickerInputActive: {
|
|
5
|
-
base: "{
|
|
5
|
+
base: "{>datepickerInput}",
|
|
6
6
|
wrapper: {
|
|
7
|
-
base: "ring-dynamic ring-offset-
|
|
7
|
+
base: "ring-dynamic ring-offset-0 ring-brand-600 border-brand-600 hover:border-brand-600",
|
|
8
8
|
variants: {
|
|
9
9
|
error: {
|
|
10
|
-
true: "
|
|
10
|
+
true: "!border-red-600 ring-red-600",
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
13
|
},
|
|
@@ -22,17 +22,7 @@ export default /*tw*/ {
|
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
24
|
},
|
|
25
|
-
buttonWrapper:
|
|
26
|
-
base: `
|
|
27
|
-
flex rounded-dynamic max-md:justify-between
|
|
28
|
-
focus-within:ring-dynamic focus-within:ring-offset-dynamic focus-within:ring-brand-700/15
|
|
29
|
-
`,
|
|
30
|
-
variants: {
|
|
31
|
-
opened: {
|
|
32
|
-
true: "ring-dynamic ring-offset-dynamic ring-brand-700/15",
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
25
|
+
buttonWrapper: "flex rounded-dynamic max-md:justify-between",
|
|
36
26
|
button: "{UButton} shrink-0 grow rounded-none",
|
|
37
27
|
shiftRangeButton: `
|
|
38
28
|
first:rounded-dynamic first:rounded-r-none
|
|
@@ -54,12 +44,9 @@ export default /*tw*/ {
|
|
|
54
44
|
},
|
|
55
45
|
},
|
|
56
46
|
compoundVariants: [
|
|
57
|
-
{ error: true, variant: "input", class: "-mt-
|
|
58
|
-
{ description: true, variant: "input", class: "-mt-
|
|
59
|
-
{ description: false, error: false, variant: "input", class: "mt-2" },
|
|
60
|
-
{ error: true, variant: "button", class: "-mt-2" },
|
|
61
|
-
{ description: true, variant: "button", class: "-mt-2" },
|
|
62
|
-
{ description: false, error: false, variant: "button", class: "mt-3" },
|
|
47
|
+
{ error: true, variant: ["button", "input"], class: "-mt-2" },
|
|
48
|
+
{ description: true, variant: ["button", "input"], class: "-mt-2" },
|
|
49
|
+
{ description: false, error: false, variant: ["button", "input"], class: "mt-2" },
|
|
63
50
|
],
|
|
64
51
|
},
|
|
65
52
|
menuTransition: {
|
package/ui.form-input/UInput.vue
CHANGED
|
@@ -287,7 +287,7 @@ const {
|
|
|
287
287
|
@binding {string} icon-name
|
|
288
288
|
-->
|
|
289
289
|
<slot name="left" :icon-name="leftIcon">
|
|
290
|
-
<UIcon v-if="leftIcon" internal color="
|
|
290
|
+
<UIcon v-if="leftIcon" internal color="gray" :name="leftIcon" v-bind="leftIconAttrs" />
|
|
291
291
|
</slot>
|
|
292
292
|
</span>
|
|
293
293
|
|
|
@@ -332,13 +332,7 @@ const {
|
|
|
332
332
|
@binding {string} icon-name
|
|
333
333
|
-->
|
|
334
334
|
<slot name="right" :icon-name="rightIcon">
|
|
335
|
-
<UIcon
|
|
336
|
-
v-if="rightIcon"
|
|
337
|
-
internal
|
|
338
|
-
color="inherit"
|
|
339
|
-
:name="rightIcon"
|
|
340
|
-
v-bind="rightIconAttrs"
|
|
341
|
-
/>
|
|
335
|
+
<UIcon v-if="rightIcon" internal color="gray" :name="rightIcon" v-bind="rightIconAttrs" />
|
|
342
336
|
</slot>
|
|
343
337
|
</div>
|
|
344
338
|
</label>
|
package/ui.form-input/config.ts
CHANGED
|
@@ -2,23 +2,16 @@ export default /*tw*/ {
|
|
|
2
2
|
inputLabel: "{ULabel}",
|
|
3
3
|
wrapper: {
|
|
4
4
|
base: `
|
|
5
|
-
|
|
6
|
-
hover:border-gray-400 hover:focus-within:border-brand-
|
|
7
|
-
focus-within:ring-dynamic focus-within:ring-offset-
|
|
5
|
+
border rounded-dynamic border-gray-300 relative flex w-full bg-white transition
|
|
6
|
+
hover:border-gray-400 hover:focus-within:border-brand-600 focus-within:border-brand-600
|
|
7
|
+
focus-within:ring-dynamic focus-within:ring-offset-0 focus-within:ring-brand-600
|
|
8
8
|
`,
|
|
9
9
|
variants: {
|
|
10
10
|
error: {
|
|
11
|
-
true:
|
|
12
|
-
border-red-300 bg-red-50
|
|
13
|
-
hover:border-red-400 hover:focus-within:border-red-500
|
|
14
|
-
focus-within:border-red-500 focus-within:ring-red-700/15
|
|
15
|
-
`,
|
|
11
|
+
true: "!border-red-600 focus-within:ring-red-600",
|
|
16
12
|
},
|
|
17
13
|
disabled: {
|
|
18
|
-
true:
|
|
19
|
-
focus-within:ring-0 focus-within:ring-offset-0 bg-gray-100
|
|
20
|
-
hover:border-gray-300 focus-within:border-gray-300 hover:focus-within:border-gray-300
|
|
21
|
-
`,
|
|
14
|
+
true: "!border-gray-300 focus-within:ring-0 bg-gray-100",
|
|
22
15
|
},
|
|
23
16
|
},
|
|
24
17
|
},
|
|
@@ -52,10 +45,7 @@ export default /*tw*/ {
|
|
|
52
45
|
lg: "text-base placeholder:text-base placeholder:font-normal",
|
|
53
46
|
},
|
|
54
47
|
error: {
|
|
55
|
-
true:
|
|
56
|
-
bg-red-50 placeholder:text-red-300 hover:border-red-400 focus:border-red-500 focus:ring-red-700/15
|
|
57
|
-
focus-within:border-red-500 focus-within:ring-red-700/15
|
|
58
|
-
`,
|
|
48
|
+
true: "placeholder:text-red-300",
|
|
59
49
|
},
|
|
60
50
|
typePassword: {
|
|
61
51
|
true: "tracking-widest !leading-[1.18] [font-family:text-security-disc,serif] [-webkit-text-security:disc]",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
1
2
|
import {
|
|
2
3
|
getArgTypes,
|
|
3
4
|
getSlotNames,
|
|
@@ -25,7 +26,8 @@ export default {
|
|
|
25
26
|
title: "Form Inputs & Controls / Input",
|
|
26
27
|
component: UInput,
|
|
27
28
|
args: {
|
|
28
|
-
label: "
|
|
29
|
+
label: "Full Name",
|
|
30
|
+
modelValue: "Satoshi Nakamoto",
|
|
29
31
|
},
|
|
30
32
|
argTypes: {
|
|
31
33
|
...getArgTypes(UInput.__name),
|
|
@@ -41,13 +43,19 @@ const DefaultTemplate: StoryFn<UInputArgs> = (args: UInputArgs) => ({
|
|
|
41
43
|
components: { UInput, UIcon },
|
|
42
44
|
setup() {
|
|
43
45
|
const slots = getSlotNames(UInput.__name);
|
|
46
|
+
const errorMessage = computed(() =>
|
|
47
|
+
args.modelValue === "" && args.error !== ""
|
|
48
|
+
? "This field is required. Please enter a value."
|
|
49
|
+
: "",
|
|
50
|
+
);
|
|
44
51
|
|
|
45
|
-
return { args, slots };
|
|
52
|
+
return { args, slots, errorMessage };
|
|
46
53
|
},
|
|
47
54
|
template: `
|
|
48
55
|
<UInput
|
|
49
56
|
v-bind="args"
|
|
50
57
|
v-model="args.modelValue"
|
|
58
|
+
:error="errorMessage"
|
|
51
59
|
class="max-w-96"
|
|
52
60
|
>
|
|
53
61
|
${args.slotTemplate || getSlotsFragment("")}
|
|
@@ -61,15 +69,15 @@ const EnumVariantTemplate: StoryFn<UInputArgs> = (args: UInputArgs, { argTypes }
|
|
|
61
69
|
function getDescription(option: string) {
|
|
62
70
|
switch (option) {
|
|
63
71
|
case "string":
|
|
64
|
-
return "Only letters are allowed";
|
|
72
|
+
return "Only letters are allowed.";
|
|
65
73
|
case "number":
|
|
66
|
-
return "Numbers are allowed (including decimals)";
|
|
74
|
+
return "Numbers are allowed (including decimals).";
|
|
67
75
|
case "integer":
|
|
68
|
-
return "Only integers are allowed";
|
|
76
|
+
return "Only integers are allowed.";
|
|
69
77
|
case "stringAndNumber":
|
|
70
|
-
return "Letters and numbers are allowed";
|
|
78
|
+
return "Letters and numbers are allowed.";
|
|
71
79
|
case "symbol":
|
|
72
|
-
return "Special characters are allowed";
|
|
80
|
+
return "Special characters are allowed.";
|
|
73
81
|
default:
|
|
74
82
|
return "";
|
|
75
83
|
}
|
|
@@ -96,18 +104,18 @@ const EnumVariantTemplate: StoryFn<UInputArgs> = (args: UInputArgs, { argTypes }
|
|
|
96
104
|
:key="index"
|
|
97
105
|
v-bind="args"
|
|
98
106
|
:[args.enum]="option"
|
|
99
|
-
:
|
|
100
|
-
:
|
|
107
|
+
:placeholder="args.enum === 'validationRule' ? '' : option"
|
|
108
|
+
:label="args.enum === 'validationRule' ? option : 'Full Name'"
|
|
109
|
+
:description="args.enum === 'validationRule' ? getDescription(option) : ''"
|
|
101
110
|
class="max-w-96"
|
|
102
111
|
/>
|
|
103
112
|
|
|
104
113
|
<UInput
|
|
105
114
|
v-if="args.enum === 'validationRule'"
|
|
106
|
-
|
|
107
|
-
validation-rule="^#([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"
|
|
115
|
+
validation-rule="^#([a-fA-F0-9]{0,6}|[a-fA-F0-9]{0,8})$"
|
|
108
116
|
label="Custom RegExp"
|
|
109
|
-
description="Enter a valid hex color code (e.g., #FF5733)"
|
|
110
|
-
|
|
117
|
+
description="Enter a valid hex color code (e.g., #FF5733)."
|
|
118
|
+
label-align="topWithDesc"
|
|
111
119
|
placeholder="#FF5733"
|
|
112
120
|
class="max-w-96"
|
|
113
121
|
/>
|
|
@@ -119,31 +127,39 @@ export const Default = DefaultTemplate.bind({});
|
|
|
119
127
|
Default.args = {};
|
|
120
128
|
|
|
121
129
|
export const Placeholder = DefaultTemplate.bind({});
|
|
122
|
-
Placeholder.args = { placeholder: "Type something here..." };
|
|
130
|
+
Placeholder.args = { modelValue: "", placeholder: "Type something here...", error: "" };
|
|
123
131
|
|
|
124
132
|
export const Description = DefaultTemplate.bind({});
|
|
125
133
|
Description.args = { description: "Provide additional details if necessary." };
|
|
126
134
|
|
|
127
135
|
export const Error = DefaultTemplate.bind({});
|
|
128
|
-
Error.args = {
|
|
136
|
+
Error.args = { modelValue: "" };
|
|
129
137
|
|
|
130
138
|
export const Readonly = DefaultTemplate.bind({});
|
|
131
|
-
Readonly.args = {
|
|
139
|
+
Readonly.args = {
|
|
140
|
+
readonly: true,
|
|
141
|
+
label: "Readonly data",
|
|
142
|
+
modelValue: "Pre-filled content that cannot be changed",
|
|
143
|
+
};
|
|
132
144
|
|
|
133
145
|
export const Disabled = DefaultTemplate.bind({});
|
|
134
146
|
Disabled.args = { disabled: true };
|
|
135
147
|
|
|
136
148
|
export const TypePassword = DefaultTemplate.bind({});
|
|
137
|
-
TypePassword.args = { type: "password" };
|
|
149
|
+
TypePassword.args = { label: "Password", modelValue: "donotforgetyourpassword", type: "password" };
|
|
138
150
|
|
|
139
151
|
export const LabelPlacement = EnumVariantTemplate.bind({});
|
|
140
|
-
LabelPlacement.args = { enum: "labelAlign" };
|
|
152
|
+
LabelPlacement.args = { enum: "labelAlign", label: "Full Name", modelValue: "" };
|
|
141
153
|
|
|
142
154
|
export const Sizes = EnumVariantTemplate.bind({});
|
|
143
|
-
Sizes.args = { enum: "size" };
|
|
155
|
+
Sizes.args = { enum: "size", modelValue: "" };
|
|
144
156
|
|
|
145
157
|
export const ValidationRules = EnumVariantTemplate.bind({});
|
|
146
|
-
ValidationRules.args = {
|
|
158
|
+
ValidationRules.args = {
|
|
159
|
+
enum: "validationRule",
|
|
160
|
+
labelAlign: "topWithDesc",
|
|
161
|
+
modelValue: "",
|
|
162
|
+
};
|
|
147
163
|
ValidationRules.parameters = {
|
|
148
164
|
docs: {
|
|
149
165
|
description: {
|
|
@@ -161,13 +177,11 @@ export const IconProps: StoryFn<UInputArgs> = (args) => ({
|
|
|
161
177
|
template: `
|
|
162
178
|
<URow>
|
|
163
179
|
<UInput
|
|
164
|
-
v-bind="args"
|
|
165
180
|
left-icon="feedback"
|
|
166
181
|
label="Your opinion"
|
|
167
182
|
placeholder="Share your feedback with us"
|
|
168
183
|
/>
|
|
169
184
|
<UInput
|
|
170
|
-
v-bind="args"
|
|
171
185
|
right-icon="person"
|
|
172
186
|
label="Username"
|
|
173
187
|
placeholder="Enter your username"
|
package/ui.form-input/types.ts
CHANGED
|
@@ -310,7 +310,7 @@ const {
|
|
|
310
310
|
<template v-if="Array.isArray(currentFiles) || !currentFiles">
|
|
311
311
|
<UButton
|
|
312
312
|
filled
|
|
313
|
-
|
|
313
|
+
tabindex="-1"
|
|
314
314
|
:for="elementId"
|
|
315
315
|
tag="label"
|
|
316
316
|
variant="thirdary"
|
|
@@ -338,7 +338,6 @@ const {
|
|
|
338
338
|
round
|
|
339
339
|
square
|
|
340
340
|
filled
|
|
341
|
-
:ring="false"
|
|
342
341
|
variant="thirdary"
|
|
343
342
|
:disabled="disabled"
|
|
344
343
|
:left-icon="config.defaults.clearIcon"
|
|
@@ -4,12 +4,12 @@ export default /*tw*/ {
|
|
|
4
4
|
base: `
|
|
5
5
|
p-3 size-auto w-full bg-white transition
|
|
6
6
|
rounded-dynamic border border-solid border-gray-300
|
|
7
|
-
hover:border-gray-400 hover:focus-within:border-brand-
|
|
8
|
-
focus-within:ring-brand-
|
|
7
|
+
hover:border-gray-400 hover:focus-within:border-brand-600 focus-within:border-brand-600
|
|
8
|
+
focus-within:ring-brand-600 focus-within:ring-dynamic focus-within:ring-offset-0
|
|
9
9
|
`,
|
|
10
10
|
variants: {
|
|
11
11
|
error: {
|
|
12
|
-
true: "border-red-
|
|
12
|
+
true: "!border-red-600",
|
|
13
13
|
},
|
|
14
14
|
disabled: {
|
|
15
15
|
true: "pointer-events-none bg-gray-100",
|
|
@@ -22,7 +22,7 @@ export default /*tw*/ {
|
|
|
22
22
|
],
|
|
23
23
|
},
|
|
24
24
|
dropzoneHover: "border-gray-400 border-dashed",
|
|
25
|
-
dropzoneError: "
|
|
25
|
+
dropzoneError: "!border-red-600 border-dashed",
|
|
26
26
|
descriptionTop: "{UText} text-gray-700 mb-2",
|
|
27
27
|
descriptionBottom: "{UText} text-gray-700 mt-2",
|
|
28
28
|
content: {
|
|
@@ -31,9 +31,6 @@ export default /*tw*/ {
|
|
|
31
31
|
multiple: {
|
|
32
32
|
false: "items-center",
|
|
33
33
|
},
|
|
34
|
-
error: {
|
|
35
|
-
true: "bg-red-50",
|
|
36
|
-
},
|
|
37
34
|
disabled: {
|
|
38
35
|
true: "bg-gray-200",
|
|
39
36
|
},
|