vueless 0.0.779 → 0.0.781

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.779",
3
+ "version": "0.0.781",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -132,8 +132,7 @@ Options.parameters = {
132
132
  docs: {
133
133
  description: {
134
134
  story:
135
- // eslint-disable-next-line vue/max-len
136
- "Every option you pass via the `options` prop can be of different type (`Boolean` | `String` | `Number` | `Array` | `Object`).",
135
+ "Every option you pass via the `options` prop can be of different type (see object meta keys table below).",
137
136
  },
138
137
  },
139
138
  };
@@ -33,7 +33,7 @@ export default /*tw*/ {
33
33
  },
34
34
  align: {
35
35
  top: "font-medium",
36
- topInside: "font-normal absolute left-3 text-gray-500 group-focus-within:text-brand-600",
36
+ topInside: "font-normal absolute text-gray-500 group-focus-within:text-brand-600",
37
37
  topWithDesc: "font-medium",
38
38
  left: "font-normal",
39
39
  right: "font-normal",
@@ -47,9 +47,9 @@ export default /*tw*/ {
47
47
  },
48
48
  compoundVariants: [
49
49
  { interactive: true, disabled: false, class: "hover:cursor-pointer" },
50
- { align: "topInside", size: "sm", class: "top-2 text-2xs" },
51
- { align: "topInside", size: "md", class: "top-2.5 text-xs" },
52
- { align: "topInside", size: "lg", class: "top-2.5 text-sm" },
50
+ { align: "topInside", size: "sm", class: "-top-3 text-2xs" },
51
+ { align: "topInside", size: "md", class: "-top-4 text-xs" },
52
+ { align: "topInside", size: "lg", class: "-top-5 text-sm" },
53
53
  { align: "topWithDesc", size: "sm", class: "-mt-px" },
54
54
  { align: "topWithDesc", size: "md", class: "" },
55
55
  { align: "topWithDesc", size: "lg", class: "mt-px" },
@@ -69,7 +69,7 @@ export default /*tw*/ {
69
69
  },
70
70
  align: {
71
71
  top: "",
72
- topInside: "pl-3 mt-1.5",
72
+ topInside: "mt-1.5",
73
73
  topWithDesc: "pt-0.5",
74
74
  left: "pt-0.5",
75
75
  right: "pt-0.5",
@@ -24,8 +24,8 @@ export default {
24
24
  title: "Form Inputs & Controls / Label",
25
25
  component: ULabel,
26
26
  args: {
27
- label: "Label",
28
- description: "Description",
27
+ label: "Email Address",
28
+ description: "We'll never share your email with anyone else.",
29
29
  },
30
30
  argTypes: {
31
31
  ...getArgTypes(ULabel.__name),
@@ -37,7 +37,7 @@ export default {
37
37
  },
38
38
  } as Meta;
39
39
 
40
- const defaultTemplate = "This is plain text";
40
+ const defaultTemplate = "johndoe@example.com";
41
41
 
42
42
  const DefaultTemplate: StoryFn<ULabelArgs> = (args: ULabelArgs) => ({
43
43
  components: { ULabel, UText, UIcon, UBadge },
@@ -78,13 +78,12 @@ const EnumVariantTemplate: StoryFn<ULabelArgs> = (args: ULabelArgs, { argTypes }
78
78
  };
79
79
  },
80
80
  template: `
81
- <UCol>
81
+ <UCol class="gap-10">
82
82
  <ULabel
83
83
  v-for="(option, index) in options"
84
84
  :key="index"
85
85
  v-bind="args"
86
86
  :[args.enum]="option"
87
- class="border border-gray-200 rounded-dynamic-sm p-4"
88
87
  >
89
88
  <UText :[args.enum]="option">
90
89
  {{ prefixedOptions[index] }}
@@ -95,23 +94,39 @@ const EnumVariantTemplate: StoryFn<ULabelArgs> = (args: ULabelArgs, { argTypes }
95
94
  });
96
95
 
97
96
  export const Default = DefaultTemplate.bind({});
98
- Default.args = {};
97
+ Default.args = { description: "" };
99
98
 
100
- export const Sizes = EnumVariantTemplate.bind({});
101
- Sizes.args = { enum: "size" };
102
-
103
- export const LabelPlacement = EnumVariantTemplate.bind({});
104
- LabelPlacement.args = { enum: "align" };
99
+ export const Description = DefaultTemplate.bind({});
100
+ Description.args = {};
105
101
 
106
102
  export const Error = DefaultTemplate.bind({});
107
- Error.args = { error: "Error description" };
103
+ Error.args = { error: "Please enter a valid email address." };
108
104
 
109
105
  export const Disabled = DefaultTemplate.bind({});
110
106
  Disabled.args = { disabled: true };
111
107
 
108
+ export const Interactive = DefaultTemplate.bind({});
109
+ Interactive.args = { interactive: true };
110
+ Interactive.parameters = {
111
+ docs: {
112
+ description: {
113
+ story: "Make the label interactive (cursor pointer on hover).",
114
+ },
115
+ },
116
+ };
117
+
118
+ export const Centred = DefaultTemplate.bind({});
119
+ Centred.args = { centred: true };
120
+
121
+ export const Sizes = EnumVariantTemplate.bind({});
122
+ Sizes.args = { enum: "size" };
123
+
124
+ export const LabelPlacement = EnumVariantTemplate.bind({});
125
+ LabelPlacement.args = { enum: "align" };
126
+
112
127
  export const SlotLabel = DefaultTemplate.bind({});
113
128
  SlotLabel.args = {
114
- label: "Custom badge label",
129
+ label: "Email Address",
115
130
  slotTemplate: `
116
131
  <template #label="{ label }">
117
132
  <UBadge :label="label" color="green" />
@@ -119,11 +134,11 @@ SlotLabel.args = {
119
134
  `,
120
135
  };
121
136
 
122
- export const SlotFooter = DefaultTemplate.bind({});
123
- SlotFooter.args = {
137
+ export const SlotBottom = DefaultTemplate.bind({});
138
+ SlotBottom.args = {
124
139
  slotTemplate: `
125
140
  <template #bottom>
126
- <UIcon name="star" color="green" />
141
+ <UBadge label="Your opinion is important for us!" color="green" class="max-w-fit" />
127
142
  </template>
128
143
  `,
129
144
  };
@@ -7,13 +7,14 @@ import {
7
7
 
8
8
  import URadio from "../../ui.form-radio/URadio.vue";
9
9
  import UBadge from "../../ui.text-badge/UBadge.vue";
10
+ import URow from "../../ui.container-row/URow.vue";
10
11
 
11
12
  import type { Meta, StoryFn } from "@storybook/vue3";
12
13
  import type { Props } from "../types.ts";
13
14
 
14
15
  interface URadioArgs extends Props {
15
16
  slotTemplate?: string;
16
- enum: "variant" | "size";
17
+ enum: "size" | "labelAlign" | "color";
17
18
  }
18
19
 
19
20
  export default {
@@ -22,7 +23,7 @@ export default {
22
23
  component: URadio,
23
24
  args: {
24
25
  name: "radio1",
25
- label: "Radio",
26
+ label: "Payment Method",
26
27
  value: "1",
27
28
  color: "brand",
28
29
  },
@@ -50,26 +51,75 @@ const DefaultTemplate: StoryFn<URadioArgs> = (args: URadioArgs) => ({
50
51
  `,
51
52
  });
52
53
 
54
+ const EnumVariantTemplate: StoryFn<URadioArgs> = (args: URadioArgs, { argTypes }) => ({
55
+ components: { URadio, URow },
56
+ setup() {
57
+ return {
58
+ args,
59
+ options: argTypes?.[args.enum]?.options,
60
+ };
61
+ },
62
+ template: `
63
+ <URow :class="{ '!flex-col': args.enum === 'labelAlign' }">
64
+ <URadio
65
+ v-for="(option, index) in options"
66
+ :key="index"
67
+ v-bind="args"
68
+ v-model="args.modelValue"
69
+ :[args.enum]="option"
70
+ :label="option"
71
+ />
72
+ </URow>
73
+ `,
74
+ });
75
+
53
76
  export const Default = DefaultTemplate.bind({});
54
77
  Default.args = {};
55
78
 
79
+ export const Description = DefaultTemplate.bind({});
80
+ Description.args = {
81
+ name: "radio3",
82
+ label: "Subscription Plan",
83
+ description: "Choose your preferred plan. You can change it anytime.",
84
+ };
85
+
86
+ export const Error = DefaultTemplate.bind({});
87
+ Error.args = {
88
+ description: "Please select a payment method.",
89
+ error: "This field is required. Please make a selection.",
90
+ };
91
+
56
92
  export const Disabled = DefaultTemplate.bind({});
57
93
  Disabled.args = { disabled: true, name: "radio2" };
58
94
 
59
- export const Description = DefaultTemplate.bind({});
60
- Description.args = { name: "radio3", description: "description" };
61
-
62
95
  export const Checked = DefaultTemplate.bind({});
63
96
  Checked.args = { checked: true, name: "radio4" };
64
97
 
65
- export const SlotFooter = DefaultTemplate.bind({});
66
- SlotFooter.args = {
98
+ export const LabelPlacement = EnumVariantTemplate.bind({});
99
+ LabelPlacement.args = { enum: "labelAlign" };
100
+
101
+ export const Sizes = EnumVariantTemplate.bind({});
102
+ Sizes.args = { enum: "size" };
103
+
104
+ export const Color = EnumVariantTemplate.bind({});
105
+ Color.args = { enum: "color" };
106
+
107
+ export const SlotLabel = DefaultTemplate.bind({});
108
+ SlotLabel.args = {
109
+ slotTemplate: `
110
+ <template #label="{ label }">
111
+ <UBadge :label="label" color="green" />
112
+ </template>
113
+ `,
114
+ };
115
+
116
+ export const SlotBottom = DefaultTemplate.bind({});
117
+ SlotBottom.args = {
67
118
  name: "radio5",
68
- label: "radio",
69
119
  value: "radio",
70
120
  slotTemplate: `
71
- <template #footer>
72
- <UBadge label="favourite" color="green" size="sm" />
121
+ <template #bottom>
122
+ <UBadge label="Add to favorite" color="green" size="sm" />
73
123
  </template>
74
124
  `,
75
125
  };
@@ -9,6 +9,7 @@ import URadioGroup from "../../ui.form-radio-group/URadioGroup.vue";
9
9
  import URadio from "../../ui.form-radio/URadio.vue";
10
10
  import UAlert from "../../ui.text-alert/UAlert.vue";
11
11
  import UCol from "../../ui.container-col/UCol.vue";
12
+ import UBadge from "../../ui.text-badge/UBadge.vue";
12
13
 
13
14
  import type { Meta, StoryFn } from "@storybook/vue3";
14
15
  import type { Props } from "../types.ts";
@@ -23,14 +24,11 @@ export default {
23
24
  title: "Form Inputs & Controls / Radio Group",
24
25
  component: URadioGroup,
25
26
  args: {
26
- label: "Radio Group",
27
- modelValue: "One",
27
+ label: "Select your preferred delivery option:",
28
28
  options: [
29
- { label: "Boolean", value: false },
30
- { label: "String", value: "One" },
31
- { label: "Number", value: 3 },
32
- { label: "Object", value: { key: "value" } },
33
- { label: "Array", value: ["Array", 1] },
29
+ { value: "standard", label: "Standard Shipping (3-5 business days)" },
30
+ { value: "express", label: "Express Shipping (1-2 business days)" },
31
+ { value: "pickup", label: "In-Store Pickup (Available same day)" },
34
32
  ],
35
33
  },
36
34
  argTypes: {
@@ -44,7 +42,7 @@ export default {
44
42
  } as Meta;
45
43
 
46
44
  const DefaultTemplate: StoryFn<URadioGroupArgs> = (args: URadioGroupArgs) => ({
47
- components: { URadioGroup, URadio, UAlert, UCol },
45
+ components: { URadioGroup, URadio, UAlert, UCol, UBadge },
48
46
  setup() {
49
47
  const slots = getSlotNames(URadioGroup.__name);
50
48
 
@@ -62,8 +60,8 @@ const DefaultTemplate: StoryFn<URadioGroupArgs> = (args: URadioGroupArgs) => ({
62
60
  </URadio>
63
61
  </URadioGroup>
64
62
 
65
- <UAlert color="gray" size="xs">
66
- <code>Selected value: <b>{{ args.modelValue }}</b></code>
63
+ <UAlert size="sm" variant="thirdary" color="green" bordered>
64
+ <p>Selected value: {{ args.modelValue }}</p>
67
65
  </UAlert>
68
66
  </UCol>
69
67
  `,
@@ -98,21 +96,58 @@ Default.args = {
98
96
  name: "Default",
99
97
  };
100
98
 
99
+ export const Description = DefaultTemplate.bind({});
100
+ Description.args = {
101
+ name: "Description",
102
+ label: "Delivery Options",
103
+ description:
104
+ "Select your preferred delivery method. Additional charges may apply for expedited shipping.",
105
+ };
106
+
107
+ export const Error = DefaultTemplate.bind({});
108
+ Error.args = {
109
+ name: "Error",
110
+ error: "Please, select at least one option to proceed.",
111
+ };
112
+
113
+ export const Disabled = DefaultTemplate.bind({});
114
+ Disabled.args = {
115
+ name: "Disabled",
116
+ disabled: true,
117
+ };
118
+
101
119
  export const Options = DefaultTemplate.bind({});
102
120
  Options.args = {
103
121
  name: "Options",
104
- modelValue: "Custom string value",
105
122
  options: [
106
- { label: "Boolean", value: false },
107
- { label: "String", value: "Custom string value" },
108
- { label: "Number", value: 4 },
109
- { label: "Object", value: { key: "Custom object value" } },
110
- { label: "Array", value: ["Custom array value", 2] },
123
+ { label: "String", value: "Subscribed" },
124
+ { label: "Number", value: 42 },
125
+ { label: "Boolean", value: true },
126
+ { label: "Object", value: { id: 101, status: "active" } },
127
+ { label: "Array", value: ["Admin", "Editor"] },
111
128
  ],
112
129
  };
130
+ Options.parameters = {
131
+ docs: {
132
+ description: {
133
+ story:
134
+ "Every option you pass via the `options` prop can be of different type (see object meta keys table below).",
135
+ },
136
+ },
137
+ };
138
+
139
+ export const Sizes = EnumVariantTemplate.bind({});
140
+ Sizes.args = { enum: "size", name: "Sizes" };
113
141
 
114
142
  export const Colors = EnumVariantTemplate.bind({});
115
143
  Colors.args = { enum: "color", name: "Colors" };
116
144
 
117
- export const Sizes = EnumVariantTemplate.bind({});
118
- Sizes.args = { enum: "size", name: "Sizes" };
145
+ export const SlotLabel = DefaultTemplate.bind({});
146
+ SlotLabel.args = {
147
+ name: "SlotLabel",
148
+ slotTemplate: `
149
+ <template #label="{ label }">
150
+ <UBadge :label="label" color="green" variant="thirdary" />
151
+ </template>
152
+ `,
153
+ };
@@ -84,7 +84,21 @@ export default /*tw*/ {
84
84
  leftSlot: "{>toggle} pl-2.5",
85
85
  rightSlot: "{>toggle} pr-2.5",
86
86
  beforeToggle: "{>toggle} cursor-auto",
87
- afterToggle: "{>toggle} mr-2.5 items-start pt-3 cursor-auto",
87
+ afterToggle: {
88
+ base: "{>toggle} mr-2.5 items-start cursor-auto",
89
+ variants: {
90
+ size: {
91
+ sm: "pt-0.5",
92
+ md: "pt-1",
93
+ lg: "pt-1.5",
94
+ },
95
+ },
96
+ compoundVariants: [
97
+ { labelAlign: "topInside", size: "sm", class: "pt-2" },
98
+ { labelAlign: "topInside", size: "md", class: "pt-3" },
99
+ { labelAlign: "topInside", size: "lg", class: "pt-4" },
100
+ ],
101
+ },
88
102
  toggle: {
89
103
  base: "flex items-center",
90
104
  compoundVariants: [
@@ -1,5 +1,9 @@
1
1
  export default /*tw*/ {
2
- switchLabel: "{ULabel}",
2
+ switchLabel: {
3
+ base: "{ULabel}",
4
+ wrapper: "items-center",
5
+ content: "h-fit",
6
+ },
3
7
  wrapper: {
4
8
  base: `
5
9
  flex items-center p-0.5 relative rounded-full cursor-pointer transition
@@ -8,13 +8,14 @@ import {
8
8
  import USwitch from "../../ui.form-switch/USwitch.vue";
9
9
  import UIcon from "../../ui.image-icon/UIcon.vue";
10
10
  import URow from "../../ui.container-row/URow.vue";
11
+ import UBadge from "../../ui.text-badge/UBadge.vue";
11
12
 
12
13
  import type { Meta, StoryFn } from "@storybook/vue3";
13
14
  import type { Props } from "../types.ts";
14
15
 
15
16
  interface USwitchArgs extends Props {
16
17
  slotTemplate?: string;
17
- enum: "size" | "color";
18
+ enum: "size" | "color" | "labelAlign";
18
19
  }
19
20
 
20
21
  export default {
@@ -35,7 +36,7 @@ export default {
35
36
  } as Meta;
36
37
 
37
38
  const DefaultTemplate: StoryFn<USwitchArgs> = (args: USwitchArgs) => ({
38
- components: { USwitch, UIcon },
39
+ components: { USwitch, UIcon, UBadge },
39
40
  setup() {
40
41
  const slots = getSlotNames(USwitch.__name);
41
42
 
@@ -57,7 +58,7 @@ const EnumVariantTemplate: StoryFn<USwitchArgs> = (args: USwitchArgs, { argTypes
57
58
  };
58
59
  },
59
60
  template: `
60
- <URow>
61
+ <URow :class="{ '!flex-col max-w-fit': args.enum === 'labelAlign' }">
61
62
  <USwitch
62
63
  v-for="(option, index) in options"
63
64
  :key="index"
@@ -74,10 +75,19 @@ export const Default = DefaultTemplate.bind({});
74
75
  Default.args = {};
75
76
 
76
77
  export const Label = DefaultTemplate.bind({});
77
- Label.args = { label: "Some label" };
78
+ Label.args = { label: "Enable Notifications" };
78
79
 
79
80
  export const Description = DefaultTemplate.bind({});
80
- Description.args = { label: "Label", description: "Some description" };
81
+ Description.args = {
82
+ label: "Enable Dark Mode",
83
+ description: "Switch to a darker color scheme to reduce eye strain.",
84
+ };
85
+
86
+ export const LabelPlacement = EnumVariantTemplate.bind({});
87
+ LabelPlacement.args = { enum: "labelAlign" };
88
+
89
+ export const Sizes = EnumVariantTemplate.bind({});
90
+ Sizes.args = { enum: "size", color: "yellow" };
81
91
 
82
92
  export const Colors = EnumVariantTemplate.bind({});
83
93
  Colors.args = { enum: "color", modelValue: true };
@@ -85,11 +95,18 @@ Colors.args = { enum: "color", modelValue: true };
85
95
  export const ToggleLabel = DefaultTemplate.bind({});
86
96
  ToggleLabel.args = { toggleLabel: true };
87
97
 
88
- export const Sizes = EnumVariantTemplate.bind({});
89
- Sizes.args = { enum: "size", color: "yellow" };
90
-
91
- export const Icon = DefaultTemplate.bind({});
92
- Icon.args = { toggleIcon: true, color: "yellow" };
98
+ export const ToggleIcon = DefaultTemplate.bind({});
99
+ ToggleIcon.args = { toggleIcon: true, color: "yellow" };
93
100
 
94
101
  export const Disabled = DefaultTemplate.bind({});
95
102
  Disabled.args = { disabled: true };
103
+
104
+ export const SlotLabel = DefaultTemplate.bind({});
105
+ SlotLabel.args = {
106
+ label: "Enable Notifications",
107
+ slotTemplate: `
108
+ <template #label="{ label }">
109
+ <UBadge :label="label" color="green" />
110
+ </template>
111
+ `,
112
+ };