vueless 1.0.2-beta.21 → 1.0.2-beta.23

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.
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M445.93-114.02V-398.2l-200.6 200.37-47.74-47.74L397.72-445.7h-283.7v-68.37H399.2L197.83-715.43l47.5-47.98 200.6 200.37v-283.18h68.14v283.7L715.2-763.41l47.97 47.98L561.8-514.07h284.42v68.37H563.28l199.89 200.13-47.74 47.74-201.36-201.13v284.94h-68.14Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M227.15-74.02q-47.14 0-80.13-33.03-33-33.03-33-80.22v-142.77h120.24v-556.18h611.96v699.07q0 47.14-33 80.13-33 33-80.13 33H227.15ZM733-142.15q19.09 0 32.09-12.94 13-12.94 13-32.06v-630.7H302.63v487.81h385.46v142.89q0 19.12 12.91 32.06 12.91 12.94 32 12.94ZM362.63-640.48v-64.54h355.46v64.54H362.63Zm0 124.78v-64.78h355.46v64.78H362.63ZM226.15-142.15h393.57v-119.76H182.15v74.64q0 19.17 13 32.15 13 12.97 31 12.97Zm0 0h-44 437.57-393.57Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M154.02-194.02v-68.13h77.85v-298.02q0-86.08 50.34-154.77 50.33-68.69 133.72-86.41v-20.56q0-26.8 18.69-45.55 18.69-18.76 45.38-18.76t45.38 18.76q18.69 18.75 18.69 45.55v20.56q83.39 17.48 133.84 86.25 50.46 68.77 50.46 154.93v298.02h77.85v68.13h-652.2ZM480-501.04Zm.12 429.17q-33.83 0-57.93-24.13t-24.1-58.02h164.06q0 33.95-24.15 58.05-24.15 24.1-57.88 24.1ZM300-262.15h360v-298.02q0-74.76-52.5-127.38Q555-740.17 480-740.17t-127.5 52.62Q300-634.93 300-560.17v298.02Z"/></svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "1.0.2-beta.21",
3
+ "version": "1.0.2-beta.23",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -138,7 +138,7 @@ export const Slots: StoryFn<UButtonArgs> = (args) => ({
138
138
  <URow>
139
139
  <UButton v-bind="args" label="Profile">
140
140
  <template #left>
141
- <UAvatar src="https://avatar.iran.liara.run/public" size="2xs" rounded="full" />
141
+ <UAvatar src="https://i.pravatar.cc/300" size="2xs" rounded="full" />
142
142
  </template>
143
143
  </UButton>
144
144
 
@@ -186,7 +186,7 @@ DefaultSlot.args = {
186
186
  slotTemplate: `
187
187
  <template #default>
188
188
  <URow align="center" gap="xs">
189
- <UAvatar size="3xs" src="https://avatar.iran.liara.run/public/boy" />
189
+ <UAvatar size="3xs" src="https://i.pravatar.cc/300" />
190
190
  <span class="text-small font-semibold">John Doe</span>
191
191
  </URow>
192
192
  </template>
@@ -197,10 +197,17 @@ DefaultSlot.args = {
197
197
  ],
198
198
  slotTemplate: `
199
199
  <template #default>
200
- <UAvatar size="sm" rounded="full" src="https://avatar.iran.liara.run/public" />
200
+ <UAvatar size="sm" rounded="full" src="https://i.pravatar.cc/300" />
201
201
  </template>
202
202
  `,
203
203
  };
204
+ DefaultSlot.parameters = {
205
+ docs: {
206
+ story: {
207
+ height: "250px",
208
+ },
209
+ },
210
+ };
204
211
 
205
212
  export const LeftSlot = DefaultTemplate.bind({});
206
213
  LeftSlot.args = {
@@ -165,12 +165,19 @@ DefaultSlot.args = {
165
165
  <template #default="{ opened }">
166
166
  <UAvatar
167
167
  rounded="full"
168
- src="https://avatar.iran.liara.run/public"
168
+ src="https://i.pravatar.cc/300"
169
169
  :class="{ 'outline-medium outline-primary': opened }"
170
170
  />
171
171
  </template>
172
172
  `,
173
173
  };
174
+ DefaultSlot.parameters = {
175
+ docs: {
176
+ story: {
177
+ height: "220px",
178
+ },
179
+ },
180
+ };
174
181
 
175
182
  export const LeftSlot = DefaultTemplate.bind({});
176
183
  LeftSlot.args = {
@@ -186,7 +193,7 @@ ToggleSlot.args = {
186
193
  slotTemplate: `
187
194
  <template #toggle="{ opened, toggle }">
188
195
  <UAvatar
189
- src="https://avatar.iran.liara.run/public"
196
+ src="https://i.pravatar.cc/300"
190
197
  size="3xs"
191
198
  rounded="full"
192
199
  :class="{ 'outline-medium outline-primary': opened }"
@@ -168,6 +168,8 @@ function getDayState(day: Date) {
168
168
  hoveredDay.value &&
169
169
  !props.selectedDateTo &&
170
170
  !dateIsOutOfRange(day, props.selectedDate, hoveredDay.value, props.locale, props.dateFormat);
171
+ const isLastRangePreview =
172
+ hoveredDay.value && isInRangePreview && isSameDay(day, hoveredDay.value);
171
173
 
172
174
  const isInRangePreviewAnotherMonth = isInRangePreview && isAnotherMonthDay;
173
175
 
@@ -185,6 +187,7 @@ function getDayState(day: Date) {
185
187
  isRangeSameDay,
186
188
  isInRangePreview,
187
189
  isInRangePreviewAnotherMonth,
190
+ isLastRangePreview,
188
191
  };
189
192
  }
190
193
 
@@ -341,6 +344,21 @@ defineExpose({
341
344
  @mouseover="onMouseoverDay(day)"
342
345
  />
343
346
 
347
+ <UButton
348
+ v-else-if="getDayState(day).isLastRangePreview"
349
+ tabindex="-1"
350
+ variant="ghost"
351
+ color="primary"
352
+ size="md"
353
+ square
354
+ v-bind="lastDayInRangeAttrs"
355
+ :disabled="dateIsOutOfRange(day, minDate, maxDate, locale, dateFormat)"
356
+ :label="formatDate(day, 'j', locale)"
357
+ @mousedown.prevent.capture
358
+ @click="onClickDay(day)"
359
+ @mouseover="onMouseoverDay(day)"
360
+ />
361
+
344
362
  <UButton
345
363
  v-else-if="
346
364
  getDayState(day).isAnotherMonthDayInRange ||
@@ -10,6 +10,11 @@ import UCheckbox from "../../ui.form-checkbox/UCheckbox.vue";
10
10
  import UCheckboxGroup from "../../ui.form-checkbox-group/UCheckboxGroup.vue";
11
11
  import UBadge from "../../ui.text-badge/UBadge.vue";
12
12
  import UCol from "../../ui.container-col/UCol.vue";
13
+ import UIcon from "../../ui.image-icon/UIcon.vue";
14
+ import ULink from "../../ui.button-link/ULink.vue";
15
+ import UText from "../../ui.text-block/UText.vue";
16
+ import URow from "../../ui.container-row/URow.vue";
17
+ import UChip from "../../ui.other-chip/UChip.vue";
13
18
 
14
19
  import type { Meta, StoryFn } from "@storybook/vue3";
15
20
  import type { Props } from "../types.ts";
@@ -37,7 +42,7 @@ export default {
37
42
  } as Meta;
38
43
 
39
44
  const DefaultTemplate: StoryFn<UCheckboxArgs> = (args: UCheckboxArgs) => ({
40
- components: { UCheckbox, UBadge },
45
+ components: { UCheckbox, UBadge, UIcon, ULink, UText, URow, UChip },
41
46
  setup: () => ({ args, slots: getSlotNames(UCheckbox.__name) }),
42
47
  template: `
43
48
  <UCheckbox v-bind="args" v-model="args.modelValue">
@@ -162,7 +167,10 @@ export const LabelSlot = DefaultTemplate.bind({});
162
167
  LabelSlot.args = {
163
168
  slotTemplate: `
164
169
  <template #label>
165
- <UBadge label="This option is required" color="error" size="sm" />
170
+ <URow gap="2xs" align="center">
171
+ <UText>I agree to the <ULink label="Privacy Policy" /></UText>
172
+ <UIcon name="contract" size="xs" />
173
+ </URow>
166
174
  </template>
167
175
  `,
168
176
  };
@@ -171,7 +179,9 @@ export const BottomSlot = DefaultTemplate.bind({});
171
179
  BottomSlot.args = {
172
180
  slotTemplate: `
173
181
  <template #bottom>
174
- <UBadge label="Subscription is optional" color="success" size="sm" />
182
+ <UChip icon="arrow_outward" size="3xs" class="mt-2">
183
+ <ULink label="Learn more" size="sm" class="mr-1.5" />
184
+ </UChip>
175
185
  </template>
176
186
  `,
177
187
  };
@@ -110,7 +110,7 @@ const { getDataTest, groupLabelAttrs, groupCheckboxAttrs, listAttrs } =
110
110
  :description="option.description"
111
111
  :disabled="disabled"
112
112
  v-bind="groupCheckboxAttrs"
113
- :data-test="getDataTest('item-${index}')"
113
+ :data-test="getDataTest(`item-${index}`)"
114
114
  />
115
115
  </slot>
116
116
  </div>
@@ -12,6 +12,9 @@ import UAlert from "../../ui.text-alert/UAlert.vue";
12
12
  import UCol from "../../ui.container-col/UCol.vue";
13
13
  import URow from "../../ui.container-row/URow.vue";
14
14
  import UBadge from "../../ui.text-badge/UBadge.vue";
15
+ import UText from "../../ui.text-block/UText.vue";
16
+ import ULink from "../../ui.button-link/ULink.vue";
17
+ import UIcon from "../../ui.image-icon/UIcon.vue";
15
18
 
16
19
  import type { Meta, StoryFn } from "@storybook/vue3";
17
20
  import type { Props } from "../types.ts";
@@ -47,7 +50,7 @@ export default {
47
50
  } as Meta;
48
51
 
49
52
  const DefaultTemplate: StoryFn<UCheckboxGroupArgs> = (args: UCheckboxGroupArgs) => ({
50
- components: { UCheckboxGroup, UCheckbox, UAlert, URow, UCol, UBadge },
53
+ components: { UCheckboxGroup, UCheckbox, UAlert, URow, UCol, UBadge, UText, ULink, UIcon },
51
54
  setup: () => ({ args, slots: getSlotNames(UCheckboxGroup.__name) }),
52
55
  template: `
53
56
  <UCol>
@@ -124,7 +127,10 @@ export const LabelSlot = DefaultTemplate.bind({});
124
127
  LabelSlot.args = {
125
128
  slotTemplate: `
126
129
  <template #label>
127
- <UBadge label="At least one option is required" color="success" />
130
+ <URow gap="2xs" align="center">
131
+ <UText>Select your <ULink label="notification preferences" /></UText>
132
+ <UIcon name="notifications" size="xs" />
133
+ </URow>
128
134
  </template>
129
135
  `,
130
136
  };
@@ -251,9 +251,7 @@ export const IconProps: StoryFn<DefaultUDatePickerArgs> = (args) => ({
251
251
 
252
252
  export const Slots: StoryFn<DefaultUDatePickerArgs> = (args) => ({
253
253
  components: { UDatePicker, URow, UButton },
254
- setup() {
255
- return { args };
256
- },
254
+ setup: () => ({ args }),
257
255
  template: `
258
256
  <URow align="stretch">
259
257
  <UDatePicker
@@ -263,9 +261,16 @@ export const Slots: StoryFn<DefaultUDatePickerArgs> = (args) => ({
263
261
  :config="{ datepickerInput: { leftSlot: 'pl-0' } }"
264
262
  >
265
263
  <template #left>
266
- <UButton label="Export" size="xs" class="h-full rounded-r-none" />
264
+ <UButton
265
+ label="Today"
266
+ size="sm"
267
+ variant="ghost"
268
+ class="h-full rounded-r-none"
269
+ @click="args.modelValue = new Date()"
270
+ />
267
271
  </template>
268
272
  </UDatePicker>
273
+
269
274
  <UDatePicker
270
275
  v-bind="args"
271
276
  v-model="args.modelValue"
@@ -273,7 +278,13 @@ export const Slots: StoryFn<DefaultUDatePickerArgs> = (args) => ({
273
278
  :config="{ datepickerInput: { rightSlot: 'pr-0' } }"
274
279
  >
275
280
  <template #right>
276
- <UButton label="Schedule" size="xs" class="h-full rounded-l-none" />
281
+ <UButton
282
+ label="Clear"
283
+ size="sm"
284
+ variant="ghost"
285
+ class="h-full rounded-l-none"
286
+ @click="args.modelValue = null"
287
+ />
277
288
  </template>
278
289
  </UDatePicker>
279
290
  </URow>
@@ -305,7 +305,7 @@ function activate() {
305
305
  adjustPositionY();
306
306
  adjustPositionX();
307
307
 
308
- menuRef.value?.focus();
308
+ menuRef.value?.focus({ preventScroll: true });
309
309
  });
310
310
  }
311
311
 
@@ -1,5 +1,14 @@
1
1
  export default /*tw*/ {
2
- inputLabel: "{ULabel}",
2
+ inputLabel: {
3
+ base: "{ULabel}",
4
+ content: "w-full",
5
+ variants: {
6
+ labelAlign: {
7
+ right: "w-full",
8
+ left: "w-full",
9
+ },
10
+ },
11
+ },
3
12
  wrapper: {
4
13
  base: `
5
14
  flex w-full relative bg-default transition
@@ -20,6 +20,7 @@ import { ref } from "vue";
20
20
  interface UInputArgs extends Props {
21
21
  slotTemplate?: string;
22
22
  enum: "labelAlign" | "size" | "validationRule";
23
+ gap?: string;
23
24
  }
24
25
 
25
26
  export default {
@@ -58,7 +59,7 @@ const EnumTemplate: StoryFn<UInputArgs> = (args: UInputArgs, { argTypes }) => ({
58
59
  components: { UInput, UCol },
59
60
  setup: () => ({ args, argTypes, getArgs }),
60
61
  template: `
61
- <UCol>
62
+ <UCol :gap="args.gap">
62
63
  <UInput
63
64
  v-for="option in argTypes?.[args.enum]?.options"
64
65
  v-bind="getArgs(args, option)"
@@ -98,8 +99,10 @@ export const LabelAlign = EnumTemplate.bind({});
98
99
  LabelAlign.args = {
99
100
  enum: "labelAlign",
100
101
  label: "Full Name",
102
+ description: "Provide additional details if necessary.",
101
103
  modelValue: "",
102
104
  placeholder: "{enumValue}",
105
+ gap: "2xl",
103
106
  };
104
107
 
105
108
  export const Sizes = EnumTemplate.bind({});
@@ -40,7 +40,7 @@ export default /*tw*/ {
40
40
  right: "font-normal",
41
41
  },
42
42
  error: {
43
- true: "text-error group-focus-within:text-error",
43
+ true: "text-error group-focus-within:!text-error",
44
44
  },
45
45
  disabled: {
46
46
  true: "text-lifted cursor-not-allowed",
@@ -11,6 +11,9 @@ import UCol from "../../ui.container-col/UCol.vue";
11
11
  import UText from "../../ui.text-block/UText.vue";
12
12
  import UIcon from "../../ui.image-icon/UIcon.vue";
13
13
  import UBadge from "../../ui.text-badge/UBadge.vue";
14
+ import URow from "../../ui.container-row/URow.vue";
15
+ import ULink from "../../ui.button-link/ULink.vue";
16
+ import UChip from "../../ui.other-chip/UChip.vue";
14
17
 
15
18
  import type { Meta, StoryFn } from "@storybook/vue3";
16
19
  import type { Props } from "../types.ts";
@@ -49,7 +52,7 @@ export default {
49
52
  const defaultTemplate = "johndoe@example.com";
50
53
 
51
54
  const DefaultTemplate: StoryFn<ULabelArgs> = (args: ULabelArgs) => ({
52
- components: { ULabel, UText, UIcon, UBadge },
55
+ components: { ULabel, UText, UIcon, UBadge, URow, ULink, UChip },
53
56
  setup: () => ({ args, slots: getSlotNames(ULabel.__name) }),
54
57
  template: `
55
58
  <ULabel v-bind="args">
@@ -111,7 +114,12 @@ LabelSlot.args = {
111
114
  label: "Email Address",
112
115
  slotTemplate: `
113
116
  <template #label="{ label }">
114
- <UBadge :label="label" color="success" />
117
+ <URow align="center" gap="xs">
118
+ <UIcon name="mail" size="sm" class="text-primary" />
119
+ <UChip icon="asterisk" color="error" size="2xs">
120
+ <UText :label="label" class="mr-2" />
121
+ </UChip>
122
+ </URow>
115
123
  </template>
116
124
  `,
117
125
  };
@@ -120,7 +128,10 @@ export const BottomSlot = DefaultTemplate.bind({});
120
128
  BottomSlot.args = {
121
129
  slotTemplate: `
122
130
  <template #bottom>
123
- <UBadge label="Your opinion is important for us!" color="success" class="max-w-fit" />
131
+ <URow align="center" gap="2xs" class="mt-1">
132
+ <UIcon name="error" size="xs" />
133
+ <UText>Invalid email address. <ULink label="Need help?" /></UText>
134
+ </URow>
124
135
  </template>
125
136
  `,
126
137
  };
@@ -48,19 +48,12 @@ export default {
48
48
 
49
49
  const DefaultTemplate: StoryFn<DefaultUListboxArgs> = (args: DefaultUListboxArgs) => ({
50
50
  components: { UListbox },
51
- setup() {
52
- const slots = getSlotNames(UListbox.__name);
53
-
54
- const showAlert = (message: string) => alert(message);
55
-
56
- return { args, slots, showAlert };
57
- },
51
+ setup: () => ({ args, slots: getSlotNames(UListbox.__name) }),
58
52
  template: `
59
53
  <UListbox
60
54
  v-bind="args"
61
55
  v-model="args.modelValue"
62
56
  class="mx-4 w-[24rem]"
63
- @add="showAlert('You triggered the add action!')"
64
57
  >
65
58
  ${args.slotTemplate || getSlotsFragment("")}
66
59
  </UListbox>
@@ -92,7 +85,22 @@ Searchable.args = { searchable: true };
92
85
  export const Multiple = DefaultTemplate.bind({});
93
86
  Multiple.args = { multiple: true, modelValue: [] };
94
87
 
95
- export const AddOption = DefaultTemplate.bind({});
88
+ export const AddOption: StoryFn<DefaultUListboxArgs> = (args: DefaultUListboxArgs) => ({
89
+ components: { UListbox },
90
+ setup() {
91
+ const showAlert = (message: string) => alert(message);
92
+
93
+ return { args, showAlert };
94
+ },
95
+ template: `
96
+ <UListbox
97
+ v-bind="args"
98
+ v-model="args.modelValue"
99
+ class="mx-4 w-[24rem]"
100
+ @add="showAlert('You triggered the add action!')"
101
+ />
102
+ `,
103
+ });
96
104
  AddOption.args = { addOption: true };
97
105
  AddOption.parameters = {
98
106
  docs: {
@@ -9,6 +9,8 @@ import {
9
9
  import URadio from "../../ui.form-radio/URadio.vue";
10
10
  import UBadge from "../../ui.text-badge/UBadge.vue";
11
11
  import URow from "../../ui.container-row/URow.vue";
12
+ import UText from "../../ui.text-block/UText.vue";
13
+ import ULink from "../../ui.button-link/ULink.vue";
12
14
 
13
15
  import type { Meta, StoryFn } from "@storybook/vue3";
14
16
  import type { Props } from "../types.ts";
@@ -39,7 +41,7 @@ export default {
39
41
  } as Meta;
40
42
 
41
43
  const DefaultTemplate: StoryFn<URadioArgs> = (args: URadioArgs) => ({
42
- components: { URadio, UBadge },
44
+ components: { URadio, UBadge, UText, ULink, URow },
43
45
  setup: () => ({ args, slots: getSlotNames(URadio.__name) }),
44
46
  template: `
45
47
  <URadio v-bind="args">
@@ -95,20 +97,29 @@ Colors.args = { enum: "color", label: "{enumValue}" };
95
97
 
96
98
  export const LabelSlot = DefaultTemplate.bind({});
97
99
  LabelSlot.args = {
100
+ name: "delivery-method",
101
+ label: "Courier Delivery",
102
+ value: "courier",
103
+ color: "primary",
98
104
  slotTemplate: `
99
105
  <template #label="{ label }">
100
- <UBadge :label="label" color="success" />
106
+ <URow gap="xs" align="center">
107
+ <UText :label="label" />
108
+ <UBadge label="Recommended" color="success" size="sm" variant="soft" />
109
+ </URow>
101
110
  </template>
102
111
  `,
103
112
  };
104
113
 
105
114
  export const BottomSlot = DefaultTemplate.bind({});
106
115
  BottomSlot.args = {
107
- name: "radio5",
108
- value: "radio",
116
+ name: "terms",
117
+ label: "I agree to the Terms and Conditions",
118
+ value: "terms",
119
+ color: "primary",
109
120
  slotTemplate: `
110
121
  <template #bottom>
111
- <UBadge label="Add to favorite" color="success" size="sm" />
122
+ <UBadge label="Required to proceed" color="warning" variant="outlined" size="sm" class="mt-2" />
112
123
  </template>
113
124
  `,
114
125
  };
@@ -11,6 +11,8 @@ import URadio from "../../ui.form-radio/URadio.vue";
11
11
  import UAlert from "../../ui.text-alert/UAlert.vue";
12
12
  import UCol from "../../ui.container-col/UCol.vue";
13
13
  import UBadge from "../../ui.text-badge/UBadge.vue";
14
+ import UText from "../../ui.text-block/UText.vue";
15
+ import URow from "../../ui.container-row/URow.vue";
14
16
 
15
17
  import type { Meta, StoryFn } from "@storybook/vue3";
16
18
  import type { Props } from "../types.ts";
@@ -43,18 +45,12 @@ export default {
43
45
  } as Meta;
44
46
 
45
47
  const DefaultTemplate: StoryFn<URadioGroupArgs> = (args: URadioGroupArgs) => ({
46
- components: { URadioGroup, URadio, UAlert, UCol, UBadge },
48
+ components: { URadioGroup, URadio, UAlert, UCol, UBadge, UText, URow },
47
49
  setup: () => ({ args, slots: getSlotNames(URadioGroup.__name) }),
48
50
  template: `
49
51
  <UCol gap="2xl">
50
52
  <URadioGroup v-bind="args" v-model="args.modelValue">
51
- <URadio
52
- v-for="(radio, index) in args.options"
53
- :key="index"
54
- v-bind="radio"
55
- >
56
- ${args.slotTemplate || getSlotsFragment("")}
57
- </URadio>
53
+ ${args.slotTemplate || getSlotsFragment("")}
58
54
  </URadioGroup>
59
55
 
60
56
  <UAlert size="sm" variant="ghost" color="success" bordered>
@@ -126,7 +122,10 @@ LabelSlot.args = {
126
122
  name: "LabelSlot",
127
123
  slotTemplate: `
128
124
  <template #label="{ label }">
129
- <UBadge :label="label" color="success" variant="soft" />
125
+ <URow gap="xs" align="center">
126
+ <UBadge label="Cannot be changed" color="warning" size="sm" variant="outlined" />
127
+ <UText :label="label" />
128
+ </URow>
130
129
  </template>
131
130
  `,
132
131
  };
@@ -1,5 +1,14 @@
1
1
  export default /*tw*/ {
2
- selectLabel: "{ULabel}",
2
+ selectLabel: {
3
+ base: "{ULabel}",
4
+ content: "w-full",
5
+ variants: {
6
+ labelAlign: {
7
+ right: "w-full",
8
+ left: "w-full",
9
+ },
10
+ },
11
+ },
3
12
  wrapper: {
4
13
  base: `
5
14
  flex flex-row-reverse justify-between w-full min-h-full box-border relative
@@ -27,6 +27,7 @@ import type { Props } from "../types.ts";
27
27
  interface USelectArgs extends Props {
28
28
  slotTemplate?: string;
29
29
  enum: "size" | "openDirection" | "labelAlign";
30
+ gap?: string;
30
31
  }
31
32
 
32
33
  interface SelectOption {
@@ -91,7 +92,7 @@ const EnumTemplate: StoryFn<USelectArgs> = (args: USelectArgs, { argTypes }) =>
91
92
  components: { USelect, UCol },
92
93
  setup: () => ({ args, argTypes, getArgs }),
93
94
  template: `
94
- <UCol>
95
+ <UCol :gap="args.gap">
95
96
  <USelect
96
97
  v-for="option in argTypes?.[args.enum]?.options"
97
98
  v-bind="getArgs(args, option)"
@@ -152,7 +153,12 @@ export const Disabled = DefaultTemplate.bind({});
152
153
  Disabled.args = { disabled: true };
153
154
 
154
155
  export const LabelAlign = EnumTemplate.bind({});
155
- LabelAlign.args = { enum: "labelAlign", label: "{enumValue}" };
156
+ LabelAlign.args = {
157
+ enum: "labelAlign",
158
+ label: "{enumValue}",
159
+ description: "Select a city from the list.",
160
+ gap: "2xl",
161
+ };
156
162
 
157
163
  export const Sizes = EnumTemplate.bind({});
158
164
  Sizes.args = { enum: "size", multiple: true, modelValue: [], label: "{enumValue}" };
@@ -9,7 +9,8 @@ import {
9
9
  import USwitch from "../../ui.form-switch/USwitch.vue";
10
10
  import UIcon from "../../ui.image-icon/UIcon.vue";
11
11
  import URow from "../../ui.container-row/URow.vue";
12
- import UBadge from "../../ui.text-badge/UBadge.vue";
12
+ import UText from "../../ui.text-block/UText.vue";
13
+ import ULink from "../../ui.button-link/ULink.vue";
13
14
 
14
15
  import type { Meta, StoryFn } from "@storybook/vue3";
15
16
  import type { Props } from "../types.ts";
@@ -37,7 +38,7 @@ export default {
37
38
  } as Meta;
38
39
 
39
40
  const DefaultTemplate: StoryFn<USwitchArgs> = (args: USwitchArgs) => ({
40
- components: { USwitch, UIcon, UBadge },
41
+ components: { USwitch, UIcon, UText, ULink, URow },
41
42
  setup: () => ({ args, slots: getSlotNames(USwitch.__name) }),
42
43
  template: `
43
44
  <USwitch v-bind="args" v-model="args.modelValue">
@@ -96,7 +97,10 @@ LabelSlot.args = {
96
97
  label: "Enable Notifications",
97
98
  slotTemplate: `
98
99
  <template #label="{ label }">
99
- <UBadge :label="label" color="success" />
100
+ <URow gap="2xs" align="center">
101
+ <UText>I agree to the <ULink label="Privacy Policy" /></UText>
102
+ <UIcon name="contract" size="xs" />
103
+ </URow>
100
104
  </template>
101
105
  `,
102
106
  };
@@ -1,5 +1,14 @@
1
1
  export default /*tw*/ {
2
- textareaLabel: "{ULabel}",
2
+ textareaLabel: {
3
+ base: "{ULabel}",
4
+ content: "w-full",
5
+ variants: {
6
+ labelAlign: {
7
+ right: "w-full",
8
+ left: "w-full",
9
+ },
10
+ },
11
+ },
3
12
  slot: "flex items-center justify-center whitespace-nowrap gap-1 rounded-medium",
4
13
  leftSlot: "{>slot} pl-2.5 rounded-r-none",
5
14
  rightSlot: "{>slot} pr-2.5 rounded-l-none",
@@ -19,6 +19,7 @@ import type { Props } from "../types.ts";
19
19
  interface UTextareaArgs extends Props {
20
20
  slotTemplate?: string;
21
21
  enum: "size" | "labelAlign";
22
+ gap?: string;
22
23
  }
23
24
 
24
25
  export default {
@@ -58,7 +59,7 @@ const EnumTemplate: StoryFn<UTextareaArgs> = (args: UTextareaArgs, { argTypes })
58
59
  components: { UTextarea, UCol },
59
60
  setup: () => ({ args, argTypes, getArgs }),
60
61
  template: `
61
- <UCol>
62
+ <UCol :gap="args.gap">
62
63
  <UTextarea
63
64
  v-for="option in argTypes?.[args.enum]?.options"
64
65
  v-bind="getArgs(args, option)"
@@ -86,7 +87,11 @@ export const Disabled = DefaultTemplate.bind({});
86
87
  Disabled.args = { disabled: true };
87
88
 
88
89
  export const LabelAlign = EnumTemplate.bind({});
89
- LabelAlign.args = { enum: "labelAlign", description: "{enumValue}" };
90
+ LabelAlign.args = {
91
+ enum: "labelAlign",
92
+ description: "{enumValue}",
93
+ gap: "2xl",
94
+ };
90
95
 
91
96
  export const Sizes = EnumTemplate.bind({});
92
97
  Sizes.args = { enum: "size", description: "{enumValue}" };
@@ -96,7 +96,7 @@ Text.args = {
96
96
  export const Inset = DefaultTemplate.bind({});
97
97
  Inset.args = {
98
98
  inset: true,
99
- slotTemplate: `<UAvatar src="https://avatar.iran.liara.run/public/11" rounded="full" />`,
99
+ slotTemplate: `<UAvatar src="https://i.pravatar.cc/300" rounded="full" />`,
100
100
  };
101
101
 
102
102
  export const Size = EnumTemplate.bind({});