vueless 1.4.7-beta.0 → 1.4.7-beta.2

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 (38) hide show
  1. package/icons/storybook/cloud_sync.svg +1 -0
  2. package/icons/storybook/date_range.svg +1 -0
  3. package/icons/storybook/event.svg +1 -0
  4. package/icons/storybook/folder.svg +1 -0
  5. package/icons/storybook/format_quote.svg +1 -0
  6. package/icons/storybook/local_shipping.svg +1 -0
  7. package/icons/storybook/location_city.svg +1 -0
  8. package/icons/storybook/mark_email_unread.svg +1 -0
  9. package/icons/storybook/notifications.svg +1 -0
  10. package/icons/storybook/shield.svg +1 -0
  11. package/icons/storybook/workspace_premium.svg +1 -0
  12. package/package.json +1 -1
  13. package/ui.container-col/config.ts +4 -2
  14. package/ui.container-col/tests/UCol.test.ts +24 -16
  15. package/ui.container-row/config.ts +4 -2
  16. package/ui.container-row/tests/URow.test.ts +24 -16
  17. package/ui.form-checkbox/UCheckbox.vue +0 -5
  18. package/ui.form-checkbox/storybook/stories.ts +56 -18
  19. package/ui.form-checkbox/tests/UCheckbox.test.ts +0 -17
  20. package/ui.form-checkbox-group/storybook/stories.ts +61 -0
  21. package/ui.form-date-picker/storybook/stories.ts +85 -37
  22. package/ui.form-date-picker-range/storybook/stories.ts +97 -38
  23. package/ui.form-input/storybook/stories.ts +75 -37
  24. package/ui.form-input-file/storybook/stories.ts +44 -5
  25. package/ui.form-input-number/storybook/stories.ts +66 -28
  26. package/ui.form-input-password/storybook/stories.ts +94 -50
  27. package/ui.form-input-search/storybook/stories.ts +40 -4
  28. package/ui.form-label/ULabel.vue +0 -6
  29. package/ui.form-label/storybook/stories.ts +46 -24
  30. package/ui.form-label/tests/ULabel.test.ts +0 -12
  31. package/ui.form-radio/URadio.vue +0 -5
  32. package/ui.form-radio/storybook/stories.ts +65 -25
  33. package/ui.form-radio/tests/URadio.test.ts +0 -17
  34. package/ui.form-radio-group/storybook/stories.ts +67 -0
  35. package/ui.form-select/storybook/stories.ts +99 -44
  36. package/ui.form-switch/storybook/stories.ts +35 -11
  37. package/ui.form-textarea/storybook/stories.ts +61 -20
  38. package/ui.text-files/storybook/stories.ts +30 -13
@@ -15,6 +15,7 @@ import UCol from "../../ui.container-col/UCol.vue";
15
15
  import UIcon from "../../ui.image-icon/UIcon.vue";
16
16
  import UButton from "../../ui.button/UButton.vue";
17
17
  import UText from "../../ui.text-block/UText.vue";
18
+ import ULink from "../../ui.button-link/ULink.vue";
18
19
 
19
20
  import { addDays } from "../../ui.form-calendar/utilDate";
20
21
 
@@ -296,44 +297,102 @@ export const IconProps: StoryFn<DefaultUDatePickerRangeArgs> = (args) => ({
296
297
  });
297
298
 
298
299
  export const Slots: StoryFn<DefaultUDatePickerRangeArgs> = (args) => ({
299
- components: { UDatePickerRange, URow, UButton },
300
- setup: () => ({ args, fromDate, toDate, leftModel: ref({ from: null, to: null }) }),
300
+ components: { UDatePickerRange, URow, UCol, UButton, UText, ULink, UIcon },
301
+ setup: () => ({
302
+ args,
303
+ fromDate,
304
+ toDate,
305
+ leftModel: ref({ from: null, to: null }),
306
+ descriptionSlotValue: ref({ from: fromDate, to: toDate }),
307
+ errorSlotValue: ref({ from: null, to: null }),
308
+ }),
301
309
  template: `
302
- <URow align="stretch">
303
- <UDatePickerRange
304
- label="Select date range"
305
- v-model="leftModel"
306
- variant="input"
307
- class="w-full"
308
- :config="{ datepickerInput: { wrapper: 'pl-0' } }"
309
- >
310
- <template #left>
311
- <UButton
312
- label="2 weeks"
313
- size="sm"
314
- variant="soft"
315
- class="h-full rounded-r-none"
316
- @click="leftModel = { from: fromDate, to: toDate }"
317
- />
318
- </template>
319
- </UDatePickerRange>
320
- <UDatePickerRange
321
- label="Select date range"
322
- v-model="args.modelValue"
323
- variant="input"
324
- class="w-full"
325
- :config="{ datepickerInput: { wrapper: 'pr-0' } }"
326
- >
327
- <template #right>
328
- <UButton
329
- label="Clear"
330
- size="sm"
331
- variant="ghost"
332
- class="h-full rounded-l-none"
333
- @click="args.modelValue = { from: null, to: null }"
334
- />
335
- </template>
336
- </UDatePickerRange>
337
- </URow>
310
+ <UCol gap="3xl">
311
+ <URow block>
312
+ <UDatePickerRange
313
+ label="Select date range"
314
+ v-model="leftModel"
315
+ variant="input"
316
+ class="w-full"
317
+ :config="{ datepickerInput: { wrapper: 'pl-0' } }"
318
+ >
319
+ <template #left>
320
+ <UButton
321
+ label="2 weeks"
322
+ size="sm"
323
+ variant="soft"
324
+ class="h-full rounded-r-none"
325
+ @click="leftModel = { from: fromDate, to: toDate }"
326
+ />
327
+ </template>
328
+ </UDatePickerRange>
329
+ <UDatePickerRange
330
+ label="Select date range"
331
+ v-model="args.modelValue"
332
+ variant="input"
333
+ class="w-full"
334
+ :config="{ datepickerInput: { wrapper: 'pr-0' } }"
335
+ >
336
+ <template #right>
337
+ <UButton
338
+ label="Clear"
339
+ size="sm"
340
+ variant="ghost"
341
+ class="h-full rounded-l-none"
342
+ @click="args.modelValue = { from: null, to: null }"
343
+ />
344
+ </template>
345
+ </UDatePickerRange>
346
+ </URow>
347
+
348
+ <URow block>
349
+ <UDatePickerRange
350
+ v-bind="args"
351
+ v-model="descriptionSlotValue"
352
+ variant="input"
353
+ label="Report period"
354
+ class="w-full"
355
+ >
356
+ <template #description>
357
+ <URow align="center" gap="2xs" class="text-neutral">
358
+ <UIcon name="date_range" size="xs" color="primary" />
359
+ <UText size="sm">
360
+ Inclusive of start and end.
361
+ <ULink label="Fiscal calendar" underlined size="sm" />.
362
+ </UText>
363
+ </URow>
364
+ </template>
365
+ </UDatePickerRange>
366
+
367
+ <UDatePickerRange
368
+ v-bind="args"
369
+ v-model="errorSlotValue"
370
+ variant="input"
371
+ label="Stay dates"
372
+ :error="true"
373
+ class="w-full"
374
+ >
375
+ <template #error>
376
+ <URow align="center" gap="2xs">
377
+ <UIcon name="error" size="xs" color="error" />
378
+ <UText size="sm" color="error">
379
+ <ul>
380
+ <li>End date must be after the start date</li>
381
+ <li>Range cannot span more than 30 days</li>
382
+ <li>Select both dates from the calendar</li>
383
+ </ul>
384
+ </UText>
385
+ </URow>
386
+ </template>
387
+ </UDatePickerRange>
388
+ </URow>
389
+ </UCol>
338
390
  `,
339
391
  });
392
+ Slots.parameters = {
393
+ docs: {
394
+ story: {
395
+ height: "700px",
396
+ },
397
+ },
398
+ };
@@ -13,6 +13,7 @@ import URow from "../../ui.container-row/URow.vue";
13
13
  import UDropdownButton from "../../ui.dropdown-button/UDropdownButton.vue";
14
14
  import UText from "../../ui.text-block/UText.vue";
15
15
  import UChip from "../../ui.other-chip/UChip.vue";
16
+ import ULink from "../../ui.button-link/ULink.vue";
16
17
 
17
18
  import type { Meta, StoryFn } from "@storybook/vue3-vite";
18
19
  import type { Props } from "../types";
@@ -190,7 +191,7 @@ export const IconProps: StoryFn<UInputArgs> = (args) => ({
190
191
  });
191
192
 
192
193
  export const Slots: StoryFn<UInputArgs> = (args) => ({
193
- components: { UInput, URow, UDropdownButton, UText, UChip },
194
+ components: { UInput, URow, UCol, UDropdownButton, UText, UChip, ULink, UIcon },
194
195
  setup() {
195
196
  const countryCodes = [
196
197
  { label: "+33", value: "+33" },
@@ -199,50 +200,87 @@ export const Slots: StoryFn<UInputArgs> = (args) => ({
199
200
  ];
200
201
 
201
202
  const countryCode = ref("+33");
203
+ const descriptionSlotValue = ref("");
204
+ const errorSlotValue = ref("");
202
205
 
203
- return { args, countryCode, countryCodes };
206
+ return { args, countryCode, countryCodes, descriptionSlotValue, errorSlotValue };
204
207
  },
205
208
  template: `
206
- <URow>
207
- <UInput
208
- label="Phone Number"
209
- placeholder="Enter your phone number"
210
- :config="{ wrapper: 'pl-0' }"
211
- >
212
- <template #label="{ label }">
213
- {{ label }}
214
- <span class="text-red-500">*</span>
215
- </template>
216
-
217
- <template #left>
218
- <UDropdownButton
219
- v-model="countryCode"
220
- :options="countryCodes"
221
- square
222
- size="sm"
223
- variant="soft"
224
- class="rounded-r-none h-[49px]"
225
- />
226
- </template>
227
- </UInput>
228
-
229
- <UInput label="Website" placeholder="Enter your website">
230
- <template #label="{ label }">
231
- {{ label }}
232
- <span class="text-red-500">*</span>
233
- </template>
234
-
235
- <template #right>
236
- <UText label=".com" variant="lifted" />
237
- </template>
238
- </UInput>
239
- </URow>
209
+ <UCol gap="3xl">
210
+ <URow block>
211
+ <UInput
212
+ label="Phone Number"
213
+ placeholder="Enter your phone number"
214
+ :config="{ wrapper: 'pl-0' }"
215
+ >
216
+ <template #label="{ label }">
217
+ {{ label }}
218
+ <span class="text-red-500">*</span>
219
+ </template>
220
+
221
+ <template #left>
222
+ <UDropdownButton
223
+ v-model="countryCode"
224
+ :options="countryCodes"
225
+ square
226
+ size="sm"
227
+ variant="soft"
228
+ class="rounded-r-none h-[49px]"
229
+ />
230
+ </template>
231
+ </UInput>
232
+
233
+ <UInput label="Website" placeholder="Enter your website">
234
+ <template #label="{ label }">
235
+ {{ label }}
236
+ <span class="text-red-500">*</span>
237
+ </template>
238
+
239
+ <template #right>
240
+ <UText label=".com" variant="lifted" :wrap="false" />
241
+ </template>
242
+ </UInput>
243
+ </URow>
244
+
245
+ <URow block>
246
+ <UInput v-model="descriptionSlotValue" label="Display name">
247
+ <template #description>
248
+ <URow align="center" gap="2xs" class="text-neutral">
249
+ <UIcon name="info" size="xs" color="primary" />
250
+ <UText size="sm">
251
+ Shown on your public profile. Read the
252
+ <ULink label="naming policy" underlined size="sm" />.
253
+ </UText>
254
+ </URow>
255
+ </template>
256
+ </UInput>
257
+
258
+ <UInput
259
+ v-model="errorSlotValue"
260
+ label="Name"
261
+ :error="true"
262
+ >
263
+ <template #error>
264
+ <URow align="center" gap="2xs">
265
+ <UIcon name="error" size="xs" color="error" />
266
+ <UText size="sm" color="error">
267
+ <ul>
268
+ <li>This field failed validation</li>
269
+ <li>Check minimum and maximum length rules</li>
270
+ <li>Only allowed characters may be used</li>
271
+ </ul>
272
+ </UText>
273
+ </URow>
274
+ </template>
275
+ </UInput>
276
+ </URow>
277
+ </UCol>
240
278
  `,
241
279
  });
242
280
  Slots.parameters = {
243
281
  docs: {
244
282
  story: {
245
- height: "250px",
283
+ height: "300px",
246
284
  },
247
285
  },
248
286
  };
@@ -14,6 +14,7 @@ import UBadge from "../../ui.text-badge/UBadge.vue";
14
14
  import UIcon from "../../ui.image-icon/UIcon.vue";
15
15
  import URow from "../../ui.container-row/URow.vue";
16
16
  import UText from "../../ui.text-block/UText.vue";
17
+ import ULink from "../../ui.button-link/ULink.vue";
17
18
 
18
19
  import type { Meta, StoryFn } from "@storybook/vue3-vite";
19
20
  import type { Props } from "../types";
@@ -109,15 +110,17 @@ LabelSlot.args = {
109
110
  };
110
111
 
111
112
  export const Slots: StoryFn<UInputFileArgs> = (args) => ({
112
- components: { UInputFile, UCol, UBadge, UIcon, URow, UText },
113
+ components: { UInputFile, UCol, UBadge, UIcon, URow, UText, ULink },
113
114
  setup() {
114
- return { args };
115
+ const files = ref<File[]>([]);
116
+
117
+ return { args, files };
115
118
  },
116
119
  template: `
117
120
  <UCol gap="xl">
118
121
  <UInputFile
119
122
  v-bind="args"
120
- v-model="args.files"
123
+ v-model="files"
121
124
  label="Top Slot"
122
125
  :allowedFileTypes="['.jpeg', '.png']"
123
126
  :maxFileSize="2"
@@ -132,7 +135,7 @@ export const Slots: StoryFn<UInputFileArgs> = (args) => ({
132
135
 
133
136
  <UInputFile
134
137
  v-bind="args"
135
- v-model="args.files"
138
+ v-model="files"
136
139
  label="Left Slot"
137
140
  :allowedFileTypes="['.pdf', '.doc', '.docx']"
138
141
  >
@@ -146,7 +149,7 @@ export const Slots: StoryFn<UInputFileArgs> = (args) => ({
146
149
 
147
150
  <UInputFile
148
151
  v-bind="args"
149
- v-model="args.files"
152
+ v-model="files"
150
153
  label="Bottom Slot"
151
154
  multiple
152
155
  :allowedFileTypes="['.png', '.jpeg']"
@@ -158,6 +161,42 @@ export const Slots: StoryFn<UInputFileArgs> = (args) => ({
158
161
  </URow>
159
162
  </template>
160
163
  </UInputFile>
164
+
165
+ <UInputFile
166
+ v-bind="args"
167
+ v-model="files"
168
+ label="Upload document"
169
+ >
170
+ <template #description>
171
+ <URow align="center" gap="2xs">
172
+ <UIcon name="description" size="xs" color="primary" />
173
+ <UText size="sm">
174
+ PDF or image, max 5MB.
175
+ <ULink label="See requirements" underlined size="sm" />.
176
+ </UText>
177
+ </URow>
178
+ </template>
179
+ </UInputFile>
180
+
181
+ <UInputFile
182
+ v-bind="args"
183
+ v-model="files"
184
+ label="Upload document"
185
+ :error="true"
186
+ >
187
+ <template #error>
188
+ <URow align="center" gap="2xs">
189
+ <UIcon name="error" size="xs" color="error" />
190
+ <UText size="sm" color="error">
191
+ <ul>
192
+ <li>File type is not accepted for this field</li>
193
+ <li>Maximum file size has been exceeded</li>
194
+ <li>Choose another file and upload again</li>
195
+ </ul>
196
+ </UText>
197
+ </URow>
198
+ </template>
199
+ </UInputFile>
161
200
  </UCol>
162
201
  `,
163
202
  });
@@ -14,6 +14,7 @@ import UButton from "../../ui.button/UButton.vue";
14
14
  import URow from "../../ui.container-row/URow.vue";
15
15
  import UDropdownButton from "../../ui.dropdown-button/UDropdownButton.vue";
16
16
  import UText from "../../ui.text-block/UText.vue";
17
+ import ULink from "../../ui.button-link/ULink.vue";
17
18
 
18
19
  import type { Meta, StoryFn } from "@storybook/vue3-vite";
19
20
  import type { Props } from "../types";
@@ -200,7 +201,7 @@ export const IconProps: StoryFn<UInputNumberArgs> = (args) => ({
200
201
  });
201
202
 
202
203
  export const Slots: StoryFn<UInputNumberArgs> = (args) => ({
203
- components: { UInputNumber, URow, UButton, UDropdownButton, UText },
204
+ components: { UInputNumber, URow, UCol, UButton, UDropdownButton, UText, ULink, UIcon },
204
205
  setup() {
205
206
  const currencies = [
206
207
  { label: "USD", value: "usd" },
@@ -209,42 +210,79 @@ export const Slots: StoryFn<UInputNumberArgs> = (args) => ({
209
210
  ];
210
211
 
211
212
  const currency = ref("usd");
213
+ const descriptionSlotValue = ref(0);
214
+ const errorSlotValue = ref(null);
212
215
 
213
- return { args, currency, currencies };
216
+ return { args, currency, currencies, descriptionSlotValue, errorSlotValue };
214
217
  },
215
218
  template: `
216
- <URow class="gap-4">
217
- <UInputNumber
218
- label="Left slot"
219
- placeholder="Enter discount amount"
220
- :config="{ numberInput: { wrapper: 'pl-0' } }"
221
- >
222
- <template #left>
223
- <UDropdownButton
224
- v-model="currency"
225
- :options="currencies"
226
- size="sm"
227
- variant="soft"
228
- class="rounded-r-none h-[49px]"
229
- />
230
- </template>
231
- </UInputNumber>
219
+ <UCol gap="3xl">
220
+ <URow block>
221
+ <UInputNumber
222
+ label="Left slot"
223
+ placeholder="Enter discount amount"
224
+ :config="{ numberInput: { wrapper: 'pl-0' } }"
225
+ >
226
+ <template #left>
227
+ <UDropdownButton
228
+ v-model="currency"
229
+ :options="currencies"
230
+ size="sm"
231
+ variant="soft"
232
+ class="rounded-r-none h-[49px]"
233
+ />
234
+ </template>
235
+ </UInputNumber>
232
236
 
233
- <UInputNumber
234
- label="Right slot"
235
- placeholder="Enter your annual payment"
236
- >
237
- <template #right>
238
- <UText label="%, per year" variant="lifted" size="sm" :wrap="false" />
239
- </template>
240
- </UInputNumber>
241
- </URow>
237
+ <UInputNumber
238
+ label="Right slot"
239
+ placeholder="Enter your annual payment"
240
+ >
241
+ <template #right>
242
+ <UText label="%, per year" variant="lifted" size="sm" :wrap="false" />
243
+ </template>
244
+ </UInputNumber>
245
+ </URow>
246
+
247
+ <URow block>
248
+ <UInputNumber v-model="descriptionSlotValue" label="Amount">
249
+ <template #description>
250
+ <URow align="center" gap="2xs" class="text-neutral">
251
+ <UIcon name="payments" size="xs" color="primary" />
252
+ <UText size="sm">
253
+ Net amount in
254
+ <ULink label="account currency" underlined size="sm" />.
255
+ </UText>
256
+ </URow>
257
+ </template>
258
+ </UInputNumber>
259
+
260
+ <UInputNumber
261
+ v-model="errorSlotValue"
262
+ label="Amount"
263
+ :error="true"
264
+ >
265
+ <template #error>
266
+ <URow align="center" gap="2xs">
267
+ <UIcon name="error" size="xs" color="error" />
268
+ <UText size="sm" color="error">
269
+ <ul>
270
+ <li>Value is outside the allowed range</li>
271
+ <li>Use up to two decimal places for this currency</li>
272
+ <li>Enter a number greater than zero</li>
273
+ </ul>
274
+ </UText>
275
+ </URow>
276
+ </template>
277
+ </UInputNumber>
278
+ </URow>
279
+ </UCol>
242
280
  `,
243
281
  });
244
282
  Slots.parameters = {
245
283
  docs: {
246
284
  story: {
247
- height: "250px",
285
+ height: "300px",
248
286
  },
249
287
  },
250
288
  };