vueless 0.0.176 → 0.0.178

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.176",
3
+ "version": "0.0.178",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -37,7 +37,7 @@
37
37
  "@release-it/bumper": "^6.0.1",
38
38
  "@vitejs/plugin-vue": "^5.0.5",
39
39
  "@vue/eslint-config-prettier": "^9.0.0",
40
- "@vueless/plugin-vite": "^0.0.32",
40
+ "@vueless/plugin-vite": "^0.0.34",
41
41
  "@vueless/storybook": "^0.0.32",
42
42
  "@vueless/web-types": "^0.0.12",
43
43
  "autoprefixer": "^10.4.19",
@@ -21,7 +21,7 @@ export default {
21
21
  };
22
22
 
23
23
  const DefaultTemplate = (args) => ({
24
- components: { UButton },
24
+ components: { UButton, UIcon },
25
25
  setup() {
26
26
  const slots = getSlotNames(UButton.name);
27
27
 
@@ -43,7 +43,7 @@ const SlotTemplate = (args) => ({
43
43
  },
44
44
  template: `
45
45
  <UButton v-bind="args">
46
- ${args.slotTemplate}
46
+ ${args.slotTemplate || ""}
47
47
  </UButton>
48
48
  `,
49
49
  });
@@ -133,6 +133,16 @@ disabled.args = { disabled: true };
133
133
  export const colors = ColorTemplate.bind({});
134
134
  colors.args = {};
135
135
 
136
+ export const iconLeft = DefaultTemplate.bind({});
137
+ iconLeft.args = {
138
+ iconLeft: "star",
139
+ };
140
+
141
+ export const iconRight = DefaultTemplate.bind({});
142
+ iconRight.args = {
143
+ iconRight: "star",
144
+ };
145
+
136
146
  export const slotDefault = SlotTemplate.bind({});
137
147
  slotDefault.args = {
138
148
  slotTemplate: `
@@ -142,26 +152,26 @@ slotDefault.args = {
142
152
  `,
143
153
  };
144
154
 
145
- export const slotLeft = SlotTemplate.bind({});
146
- slotLeft.args = {
155
+ export const iconLeftSlot = SlotTemplate.bind({});
156
+ iconLeftSlot.args = {
147
157
  slotTemplate: `
148
158
  <template #left>
149
159
  <UIcon
150
160
  name="star"
151
- color="gray"
152
- />
161
+ color="green"
162
+ />
153
163
  </template>
154
164
  `,
155
165
  };
156
166
 
157
- export const slotRight = SlotTemplate.bind({});
158
- slotRight.args = {
167
+ export const iconRightSlot = SlotTemplate.bind({});
168
+ iconRightSlot.args = {
159
169
  slotTemplate: `
160
170
  <template #right>
161
171
  <UIcon
162
172
  name="star"
163
- color="gray"
164
- />
173
+ color="green"
174
+ />
165
175
  </template>
166
176
  `,
167
177
  };
@@ -11,19 +11,23 @@
11
11
  <template v-if="loading">
12
12
  <!-- Label is needed to prevent changing button height -->
13
13
  <div v-bind="textAttrs" tabindex="-1" class="invisible w-0" v-text="label" />
14
- <ULoader :size="loaderSize" :color="loaderColor" v-bind="loaderAttrs" />
14
+ <ULoader :size="loaderSize" :color="componentColor" v-bind="loaderAttrs" />
15
15
  </template>
16
16
 
17
17
  <template v-else>
18
- <!-- @slot Use it to add something before text. -->
19
- <slot name="left" />
18
+ <!-- @slot Use it to add icon before text. -->
19
+ <slot name="left">
20
+ <UIcon v-if="iconLeft" :name="iconLeft" :color="componentColor" />
21
+ </slot>
20
22
 
21
23
  <!-- @slot Use it to add something instead of text. -->
22
24
  <slot />
23
25
  <div v-if="label" v-bind="textAttrs" tabindex="-1" v-text="label" />
24
26
 
25
- <!-- @slot Use it to add something after text. -->
26
- <slot name="right" />
27
+ <!-- @slot Use it to add icon after text. -->
28
+ <slot name="right">
29
+ <UIcon v-if="iconRight" :name="iconRight" :color="componentColor" />
30
+ </slot>
27
31
  </template>
28
32
  </component>
29
33
  </template>
@@ -33,6 +37,7 @@ import { computed, ref } from "vue";
33
37
 
34
38
  import UIService, { getRandomId } from "../service.ui";
35
39
  import ULoader from "../ui.loader";
40
+ import UIcon from "../ui.image-icon";
36
41
 
37
42
  import defaultConfig from "./configs/default.config";
38
43
  import { useAttrs } from "./composables/attrs.composable";
@@ -157,6 +162,22 @@ const props = defineProps({
157
162
  type: String,
158
163
  default: "",
159
164
  },
165
+
166
+ /**
167
+ * Left side icon name.
168
+ */
169
+ iconLeft: {
170
+ type: String,
171
+ default: "",
172
+ },
173
+
174
+ /**
175
+ * Right side icon name.
176
+ */
177
+ iconRight: {
178
+ type: String,
179
+ default: "",
180
+ },
160
181
  });
161
182
 
162
183
  const emit = defineEmits(["click"]);
@@ -180,7 +201,7 @@ const loaderSize = computed(() => {
180
201
  return sizes[props.size];
181
202
  });
182
203
 
183
- const loaderColor = computed(() => {
204
+ const componentColor = computed(() => {
184
205
  return props.variant === "primary" ? "white" : props.color;
185
206
  });
186
207
 
@@ -67,7 +67,7 @@
67
67
 
68
68
  <ULoaderTop
69
69
  v-if="resource && isHeaderSticky"
70
- :resource-names="resource"
70
+ :resources="resource"
71
71
  v-bind="stickyHeaderLoaderAttrs"
72
72
  />
73
73
  </div>
@@ -126,7 +126,7 @@
126
126
  </th>
127
127
  </tr>
128
128
 
129
- <ULoaderTop v-if="resource" :resource-names="resource" v-bind="headerLoaderAttrs" />
129
+ <ULoaderTop v-if="resource" :resources="resource" v-bind="headerLoaderAttrs" />
130
130
  </thead>
131
131
 
132
132
  <tbody v-if="tableRows.length" v-bind="bodyAttrs">
@@ -10,7 +10,7 @@ export default /*tw*/ {
10
10
  hover:transition hover:duration-100 hover:ease-in-out bg-white opacity-1
11
11
  `,
12
12
  subGroupLabel: {
13
- base: "pointer-events-none bg-transparent !font-medium leading-none !uppercase !text-gray-500/[85] pt-1",
13
+ base: "pointer-events-none bg-transparent !font-medium !leading-none !uppercase !text-gray-500/[85] pt-1",
14
14
  variants: {
15
15
  size: {
16
16
  sm: "text-2xs",
@@ -20,7 +20,7 @@ export default /*tw*/ {
20
20
  },
21
21
  },
22
22
  groupLabel: {
23
- base: "pointer-events-none bg-transparent !font-medium leading-none !uppercase !text-gray-500/[85] pt-6 group-first/item:pt-2",
23
+ base: "pointer-events-none bg-transparent !font-medium !leading-none !uppercase !text-gray-500/[85] pt-6 group-first/item:pt-2",
24
24
  variants: {
25
25
  size: {
26
26
  sm: "text-2xs pb-1 mt-4",
@@ -20,6 +20,7 @@ export default /*tw*/ {
20
20
  icon: "",
21
21
  checkbox: {
22
22
  base: `
23
+ transition duration-100 ease-in-out
23
24
  border border-solid rounded
24
25
  border-gray-300 bg-white
25
26
  hover:border-gray-400
@@ -34,11 +35,11 @@ export default /*tw*/ {
34
35
  sm: "size-5 text-sm",
35
36
  md: "size-6",
36
37
  lg: "size-7 text-lg",
37
- xl: "size-6 text-xl",
38
+ xl: "size-8 text-xl",
38
39
  },
39
40
  color: {
40
41
  grayscale: `
41
- focus:border-gray-500 focus:ring-gray-200
42
+ focus:border-gray-500 focus:ring-gray-500
42
43
  checked:border-gray-900 checked:bg-gray-900 checked:text-gray-900
43
44
  active:border-gray-900 active:bg-gray-900
44
45
  `,
@@ -135,7 +135,7 @@ const props = defineProps({
135
135
 
136
136
  /**
137
137
  * Checkbox size.
138
- * @values sm, md, lg
138
+ * @values xs, sm, md, lg, xl
139
139
  */
140
140
  size: {
141
141
  type: String,
@@ -192,9 +192,11 @@ const { config, checkboxAttrs, iconWrapperCellAttrs, labelAttrs, iconAttrs } = u
192
192
 
193
193
  const iconSize = computed(() => {
194
194
  const sizes = {
195
+ xs: "2xs",
195
196
  sm: "xs",
196
197
  md: "sm",
197
198
  lg: "md",
199
+ xl: "lg",
198
200
  };
199
201
 
200
202
  return sizes[props.size];
@@ -49,9 +49,9 @@ export default /*tw*/ {
49
49
  `,
50
50
  },
51
51
  compoundVariants: [
52
- { labelAlign: "topInside", label: true, size: "sm", class: "pt-6 pb-2" },
53
- { labelAlign: "topInside", label: true, size: "md", class: "pt-7 pb-2.5" },
54
- { labelAlign: "topInside", label: true, size: "lg", class: "pt-8 pb-3" },
52
+ { labelAlign: "topInside", label: true, size: "sm", class: "pt-5 pb-1.5" },
53
+ { labelAlign: "topInside", label: true, size: "md", class: "pt-6 pb-1.5" },
54
+ { labelAlign: "topInside", label: true, size: "lg", class: "pt-7 pb-2" },
55
55
  ],
56
56
  },
57
57
  defaultVariants: {
@@ -3,38 +3,38 @@ export default /*tw*/ {
3
3
  base: "flex",
4
4
  variants: {
5
5
  size: {
6
+ xs: "gap-2",
6
7
  sm: "gap-2",
7
8
  md: "gap-2.5",
8
9
  lg: "gap-3",
10
+ xl: "gap-3.5",
9
11
  },
10
12
  align: {
11
13
  top: "flex-col",
12
- topInside: "flex-col",
14
+ topInside: "flex-col gap-0",
13
15
  topWithDesc: "flex-col-reverse w-fit",
14
16
  left: "flex-row w-fit",
15
17
  right: "flex-row-reverse w-fit",
16
18
  bottom: "flex-col-reverse w-fit",
17
19
  },
18
20
  },
19
- compoundVariants: [
20
- { align: "topInside", size: "sm", class: "gap-0" },
21
- { align: "topInside", size: "md", class: "gap-0" },
22
- { align: "topInside", size: "lg", class: "gap-0" },
23
- ],
24
21
  },
25
22
  labelWrapper: "",
26
23
  label: {
27
24
  base: "text-gray-500 z-10 font-normal block !leading-none",
28
25
  variants: {
29
26
  size: {
27
+ xs: "text-2xs",
30
28
  sm: "text-xs",
31
29
  md: "text-sm",
32
30
  lg: "text-base",
31
+ xl: "text-lg",
33
32
  },
34
33
  align: {
35
34
  topInside: "absolute left-4",
36
- left: "text-gray-900",
37
- right: "text-gray-900",
35
+ topWithDesc: "pt-1 pb-1.5",
36
+ left: "pt-1 pb-1 text-gray-900",
37
+ right: "pt-1 pb-1 text-gray-900",
38
38
  },
39
39
  error: {
40
40
  true: "text-red-500",
@@ -44,49 +44,55 @@ export default /*tw*/ {
44
44
  },
45
45
  },
46
46
  compoundVariants: [
47
+ { align: "topInside", size: "xs", class: "top-1.5" },
47
48
  { align: "topInside", size: "sm", class: "top-2" },
48
49
  { align: "topInside", size: "md", class: "top-2.5" },
49
50
  { align: "topInside", size: "lg", class: "top-3" },
50
- { align: "topWithDesc", size: "sm", class: "pt-1 pb-1.5" },
51
- { align: "topWithDesc", size: "md", class: "pt-1 pb-1.5 mt-px" },
52
- { align: "topWithDesc", size: "lg", class: "pt-1 pb-1.5 mt-0.5" },
53
- { align: "left", size: "sm", class: "pt-1 pb-1.5 text-sm" },
54
- { align: "left", size: "md", class: "pt-1 pb-1.5 mt-px text-base" },
55
- { align: "left", size: "lg", class: "pt-1 pb-1.5 mt-0.5 text-lg" },
56
- { align: "right", size: "sm", class: "pt-1 pb-1.5 text-sm" },
57
- { align: "right", size: "md", class: "pt-1 pb-1.5 mt-px text-base" },
58
- { align: "right", size: "lg", class: "pt-1 pb-1.5 mt-0.5 text-lg" },
51
+ { align: "topInside", size: "xl", class: "top-3.5" },
52
+ { align: "topWithDesc", size: "xs", class: "-mt-px" },
53
+ { align: "topWithDesc", size: "sm", class: "" },
54
+ { align: "topWithDesc", size: "md", class: "mt-px" },
55
+ { align: "topWithDesc", size: "lg", class: "mt-0.5" },
56
+ { align: "topWithDesc", size: "xl", class: "mt-1" },
57
+ { align: "left", size: "xs", class: "-mt-0.5 text-sm" },
58
+ { align: "left", size: "sm", class: "text-sm" },
59
+ { align: "left", size: "md", class: "mt-px text-base" },
60
+ { align: "left", size: "lg", class: "mt-0.5 text-lg" },
61
+ { align: "left", size: "xl", class: "mt-1 text-xl" },
62
+ { align: "right", size: "sm", class: "-mt-0.5 text-xs" },
63
+ { align: "right", size: "sm", class: "text-sm" },
64
+ { align: "right", size: "md", class: "mt-px text-base" },
65
+ { align: "right", size: "lg", class: "mt-0.5 text-lg" },
66
+ { align: "right", size: "xl", class: "mt-1 text-xl" },
59
67
  ],
60
68
  },
61
69
  description: {
62
70
  base: "font-normal text-gray-500/[85] !leading-none",
63
71
  variants: {
64
72
  size: {
73
+ xs: "text-2xs",
65
74
  sm: "text-2xs",
66
75
  md: "text-xs",
67
76
  lg: "text-sm",
77
+ xl: "text-base",
68
78
  },
69
79
  align: {
70
80
  topInside: "pl-4",
71
- top: "pl-0",
81
+ top: "pl-0 -mt-0.5",
72
82
  left: "pl-0",
73
83
  right: "pl-0",
74
- bottom: "-order-1",
84
+ bottom: "-order-1 -mt-2",
75
85
  },
76
86
  error: {
77
87
  true: "text-red-500",
78
88
  },
79
89
  },
80
90
  compoundVariants: [
81
- { align: "bottom", size: "sm", class: "-mt-2" },
82
- { align: "bottom", size: "md", class: "-mt-2" },
83
- { align: "bottom", size: "lg", class: "-mt-2" },
84
- { align: "top", size: "sm", class: "-mt-0.5" },
85
- { align: "top", size: "md", class: "-mt-0.5" },
86
- { align: "top", size: "lg", class: "-mt-0.5" },
91
+ { align: "topInside", size: "xs", class: "mt-1" },
87
92
  { align: "topInside", size: "sm", class: "mt-1.5" },
88
93
  { align: "topInside", size: "md", class: "mt-2" },
89
94
  { align: "topInside", size: "lg", class: "mt-2.5" },
95
+ { align: "topInside", size: "xl", class: "mt-3" },
90
96
  ],
91
97
  },
92
98
  defaultVariants: {
@@ -16,12 +16,7 @@
16
16
  v-text="label"
17
17
  />
18
18
 
19
- <div
20
- v-if="error"
21
- :data-cy="`${dataCy}-error-message`"
22
- v-bind="descriptionAttrs"
23
- v-text="error"
24
- />
19
+ <div v-if="error" :data-cy="`${dataCy}-error`" v-bind="descriptionAttrs" v-text="error" />
25
20
 
26
21
  <div
27
22
  v-if="description && !error"
@@ -46,12 +41,7 @@
46
41
 
47
42
  <slot />
48
43
 
49
- <div
50
- v-if="error"
51
- :data-cy="`${dataCy}-error-message`"
52
- v-bind="descriptionAttrs"
53
- v-text="error"
54
- />
44
+ <div v-if="error" :data-cy="`${dataCy}-error`" v-bind="descriptionAttrs" v-text="error" />
55
45
 
56
46
  <div
57
47
  v-if="description && !error"
@@ -89,7 +79,7 @@ const props = defineProps({
89
79
 
90
80
  /**
91
81
  * Set label size.
92
- * @values sm, md, lg
82
+ * @values xs, sm, md, lg, xl
93
83
  */
94
84
  size: {
95
85
  type: String,
@@ -2,6 +2,7 @@ export default /*tw*/ {
2
2
  label: "inline-flex",
3
3
  radio: {
4
4
  base: `
5
+ transition duration-100 ease-in-out
5
6
  border border-solid border-{color}-300 text-{color}-500
6
7
  hover:border-{color}-400
7
8
  active:border-{color}-500
@@ -10,9 +11,11 @@ export default /*tw*/ {
10
11
  `,
11
12
  variants: {
12
13
  size: {
14
+ xs: "size-4",
13
15
  sm: "size-5",
14
16
  md: "size-6",
15
17
  lg: "size-7",
18
+ xl: "size-8",
16
19
  },
17
20
  },
18
21
  compoundVariants: [
@@ -77,7 +77,7 @@ const props = defineProps({
77
77
 
78
78
  /**
79
79
  * Radio size.
80
- * @values sm, md, lg
80
+ * @values xs, sm, md, lg, xl
81
81
  */
82
82
  size: {
83
83
  type: String,
@@ -9,9 +9,9 @@ export default /*tw*/ {
9
9
  `,
10
10
  variants: {
11
11
  size: {
12
- sm: "pt-2 pb-2",
13
- md: "pt-2.5 pb-2.5",
14
- lg: "pt-3 pb-3",
12
+ sm: "pt-2 pb-1.5",
13
+ md: "pt-2.5 pb-1.5",
14
+ lg: "pt-3 pb-2",
15
15
  },
16
16
  error: {
17
17
  true: `
@@ -27,9 +27,9 @@ export default /*tw*/ {
27
27
  },
28
28
  },
29
29
  compoundVariants: [
30
- { labelAlign: "topInside", label: true, size: "sm", class: "pt-6" },
31
- { labelAlign: "topInside", label: true, size: "md", class: "pt-7" },
32
- { labelAlign: "topInside", label: true, size: "lg", class: "pt-8" },
30
+ { labelAlign: "topInside", label: true, size: "sm", class: "pt-5" },
31
+ { labelAlign: "topInside", label: true, size: "md", class: "pt-6" },
32
+ { labelAlign: "topInside", label: true, size: "lg", class: "pt-7" },
33
33
  ],
34
34
  },
35
35
  innerWrapper: {
@@ -48,8 +48,8 @@ export default /*tw*/ {
48
48
  base: "flex items-center mt-0",
49
49
  compoundVariants: [
50
50
  { labelAlign: "topInside", size: "sm", label: true, class: "-mt-3" },
51
- { labelAlign: "topInside", size: "md", label: true, class: "-mt-4" },
52
- { labelAlign: "topInside", size: "lg", label: true, class: "-mt-5" },
51
+ { labelAlign: "topInside", size: "md", label: true, class: "-mt-3" },
52
+ { labelAlign: "topInside", size: "lg", label: true, class: "-mt-4" },
53
53
  ],
54
54
  },
55
55
  beforeCaretSlot: "",
@@ -41,7 +41,7 @@
41
41
  internal
42
42
  interactive
43
43
  color="gray"
44
- :size="size"
44
+ :size="iconSize"
45
45
  :name="config.toggleIconName"
46
46
  v-bind="toggleIconAttrs"
47
47
  />
@@ -60,7 +60,7 @@
60
60
  internal
61
61
  interactive
62
62
  color="gray"
63
- :size="size"
63
+ :size="iconSize"
64
64
  :name="config.clearIconName"
65
65
  v-bind="clearIconAttrs"
66
66
  @mousedown="removeElement"
@@ -93,7 +93,7 @@
93
93
  internal
94
94
  interactive
95
95
  color="gray"
96
- :size="size"
96
+ :size="iconSize"
97
97
  :name="config.removeItemIconName"
98
98
  v-bind="removeItemIconAttrs"
99
99
  @mousedown="removeElement(item)"
@@ -503,6 +503,16 @@ const {
503
503
  const i18nGlobal = tm(USelect);
504
504
  const currentLocale = computed(() => merge(defaultConfig.i18n, i18nGlobal, props.config.i18n));
505
505
 
506
+ const iconSize = computed(() => {
507
+ const sizes = {
508
+ sm: "sm",
509
+ md: "md",
510
+ lg: "md",
511
+ };
512
+
513
+ return sizes[props.size];
514
+ });
515
+
506
516
  const inputPlaceholder = computed(() => {
507
517
  const message = currentLocale.value.addMore;
508
518
 
@@ -4,10 +4,10 @@ export default /*tw*/ {
4
4
  rightSlot: "flex items-center justify-center h-full w-11 absolute right-0",
5
5
  textareaWrapper: {
6
6
  base: `
7
- transition duration-100 ease-in-out focus-within:outline-none rounded-lg border
8
- border-solid border-gray-300 focus-within:border-gray-500 focus-within:ring-4
9
- focus-within:ring-gray-600/[.15] ring-0 hover:border-gray-400 pl-4 hover:focus-within:border-gray-500
10
- cursor-text bg-white
7
+ transition duration-100 ease-in-out focus-within:outline-none
8
+ rounded-lg border border-solid border-gray-300 ring-0 cursor-text bg-white pr-4
9
+ hover:border-gray-400 pl-4 hover:focus-within:border-gray-500
10
+ focus-within:border-gray-500 focus-within:ring-4 focus-within:ring-gray-600/[.15]
11
11
  `,
12
12
  variants: {
13
13
  error: {
@@ -24,18 +24,15 @@ export default /*tw*/ {
24
24
  true: "ring-0 border-gray-300 focus-within:ring-0 focus-within:border-brand-300",
25
25
  },
26
26
  size: {
27
- sm: "pb-2 pr-4 pt-6",
28
- md: "pb-2.5 pr-4 pt-7",
29
- lg: "pb-3 pr-4 pt-8",
27
+ sm: "pt-2 pb-2",
28
+ md: "pt-2.5 pb-2.5",
29
+ lg: "pt-3 pb-3",
30
30
  },
31
31
  },
32
32
  compoundVariants: [
33
- { labelAlign: "top", size: "sm", class: "pt-2" },
34
- { labelAlign: "top", size: "md", class: "pt-2.5" },
35
- { labelAlign: "top", size: "lg", class: "pt-3" },
36
- { labelAlign: "topInside", label: false, class: "pt-2" },
37
- { labelAlign: "topInside", label: false, class: "pt-2.5" },
38
- { labelAlign: "topInside", label: false, class: "pt-3" },
33
+ { labelAlign: "topInside", label: true, class: "pt-5 pb-1.5" },
34
+ { labelAlign: "topInside", label: true, class: "pt-6 pb-1.5" },
35
+ { labelAlign: "topInside", label: true, class: "pt-7 pb-2" },
39
36
  ],
40
37
  },
41
38
  textarea: {
@@ -1,7 +1,8 @@
1
- import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source, Markdown } from "@storybook/blocks";
1
+ import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
2
2
  import { getSource } from "../service.storybook";
3
3
 
4
4
  import * as stories from "./index.stories";
5
+ import defaultConfig from "./configs/default.config?raw"
5
6
 
6
7
  <Meta of={stories} />
7
8
  <Title of={stories} />
@@ -1,5 +1,6 @@
1
1
  import ULoaderRendering from "../ui.loader-rendering";
2
2
  import UButton from "../ui.button";
3
+ import UGroup from "../ui.container-group";
3
4
 
4
5
  import { useLoaderRendering } from "./composables/useLoaderRendering";
5
6
 
@@ -10,11 +11,18 @@ import { getArgTypes } from "../service.storybook";
10
11
  */
11
12
  export default {
12
13
  id: "9030",
13
- title: "Loaders and Skeletons / Loader rendering",
14
+ title: "Loaders and Skeletons / Loader Rendering",
14
15
  component: ULoaderRendering,
15
16
  argTypes: {
16
17
  ...getArgTypes(ULoaderRendering.name),
17
18
  },
19
+ parameters: {
20
+ docs: {
21
+ story: {
22
+ height: "420px",
23
+ },
24
+ },
25
+ },
18
26
  };
19
27
 
20
28
  const DefaultTemplate = (args) => ({
@@ -23,32 +31,29 @@ const DefaultTemplate = (args) => ({
23
31
  return { args };
24
32
  },
25
33
  template: `
26
- <div>
27
- <ULoaderRendering v-bind="args" class="!static !w-full" />
28
- </div>
34
+ <ULoaderRendering v-bind="args" class="w-full h-full" />
29
35
  `,
30
36
  });
31
37
 
32
38
  const LoadingTemplate = (args) => ({
33
- components: { ULoaderRendering, UButton },
39
+ components: { ULoaderRendering, UButton, UGroup },
34
40
  setup() {
35
- const { setRenderingFinished, isRenderingPage, setRenderingStarted } = useLoaderRendering();
41
+ const { loaderRenderingOn, loaderRenderingOff, isLoading } = useLoaderRendering();
36
42
 
37
- return { args, setRenderingFinished, setRenderingStarted, isRenderingPage };
43
+ return { args, loaderRenderingOn, loaderRenderingOff, isLoading };
38
44
  },
39
45
  methods: {
40
46
  toggleLoading() {
41
- this.isRenderingPage ? this.setRenderingFinished() : this.setRenderingStarted();
47
+ this.isLoading ? this.loaderRenderingOff() : this.loaderRenderingOn();
42
48
  },
43
49
  },
44
50
  template: `
45
- <div class="flex justify-center items-center pb-4">
46
- <UButton label="Toggle loading" @click="toggleLoading"/>
47
- </div>
48
- <div>
49
- <ULoaderRendering v-bind="args" class="!static !w-full" />
50
- </div>
51
- `,
51
+ <UGroup align="center" class="pb-4">
52
+ <UButton label="Toggle loading" size="sm" @click="toggleLoading"/>
53
+ </UGroup>
54
+
55
+ <ULoaderRendering v-bind="args" class="!static w-full h-96" />
56
+ `,
52
57
  });
53
58
 
54
59
  export const Default = DefaultTemplate.bind({});