vueless 0.0.321 → 0.0.322

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.321",
3
+ "version": "0.0.322",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -1,2 +1,2 @@
1
1
  /* Hide `/index.js` from import in Tailwind config. */
2
- export { vuelessPreset } from "./preset.tailwind/index.js";
2
+ export { vuelessPreset, vuelessContent } from "./preset.tailwind/index.js";
@@ -7,11 +7,11 @@ export default /*tw*/ {
7
7
  component: "{UDropdownList}",
8
8
  base: "w-fit",
9
9
  variants: {
10
- listYPosition: {
10
+ yPosition: {
11
11
  top: "bottom-6 mb-6",
12
12
  bottom: "top-3 mt-6",
13
13
  },
14
- listXPosition: {
14
+ xPosition: {
15
15
  left: "left-0",
16
16
  right: "right-0",
17
17
  },
@@ -23,8 +23,8 @@ export default /*tw*/ {
23
23
  variant: "primary",
24
24
  labelKey: "label",
25
25
  valueKey: "id",
26
- listYPosition: "bottom",
27
- listXPosition: "left",
26
+ yPosition: "bottom",
27
+ xPosition: "left",
28
28
  round: false,
29
29
  noIcon: false,
30
30
  /* icons */
@@ -161,18 +161,18 @@ const props = defineProps({
161
161
  * The position of dropdown list on the y-axis.
162
162
  * @values top, bottom
163
163
  */
164
- listYPosition: {
164
+ yPosition: {
165
165
  type: String,
166
- default: getDefault(defaultConfig, UDropdownBadge).listYPosition,
166
+ default: getDefault(defaultConfig, UDropdownBadge).yPosition,
167
167
  },
168
168
 
169
169
  /**
170
170
  * The position of dropdown list on the x-axis.
171
171
  * @values left, right
172
172
  */
173
- listXPosition: {
173
+ xPosition: {
174
174
  type: String,
175
- default: getDefault(defaultConfig, UDropdownBadge).listXPosition,
175
+ default: getDefault(defaultConfig, UDropdownBadge).xPosition,
176
176
  },
177
177
 
178
178
  /**
@@ -6,11 +6,11 @@ export default /*tw*/ {
6
6
  dropdownList: {
7
7
  base: "{UDropdownList} w-fit",
8
8
  variants: {
9
- listYPosition: {
9
+ yPosition: {
10
10
  top: "bottom-full mb-2",
11
11
  bottom: "top-full mt-2",
12
12
  },
13
- listXPosition: {
13
+ xPosition: {
14
14
  left: "left-0",
15
15
  right: "right-0",
16
16
  },
@@ -22,8 +22,8 @@ export default /*tw*/ {
22
22
  variant: "primary",
23
23
  labelKey: "label",
24
24
  valueKey: "id",
25
- listYPosition: "bottom",
26
- listXPosition: "left",
25
+ yPosition: "bottom",
26
+ xPosition: "left",
27
27
  filled: false,
28
28
  round: false,
29
29
  square: false,
@@ -187,18 +187,18 @@ const props = defineProps({
187
187
  * The position of dropdown list on the y-axis.
188
188
  * @values top, bottom
189
189
  */
190
- listYPosition: {
190
+ yPosition: {
191
191
  type: String,
192
- default: getDefault(defaultConfig, UDropdownButton).listYPosition,
192
+ default: getDefault(defaultConfig, UDropdownButton).yPosition,
193
193
  },
194
194
 
195
195
  /**
196
196
  * The position of dropdown list on the x-axis.
197
197
  * @values left, right
198
198
  */
199
- listXPosition: {
199
+ xPosition: {
200
200
  type: String,
201
- default: getDefault(defaultConfig, UDropdownButton).listXPosition,
201
+ default: getDefault(defaultConfig, UDropdownButton).xPosition,
202
202
  },
203
203
 
204
204
  /**
@@ -6,11 +6,11 @@ export default /*tw*/ {
6
6
  dropdownList: {
7
7
  base: "{UDropdownList} w-fit",
8
8
  variants: {
9
- listYPosition: {
9
+ yPosition: {
10
10
  top: "bottom-6 mb-4",
11
11
  bottom: "top-3 mt-4",
12
12
  },
13
- listXPosition: {
13
+ xPosition: {
14
14
  left: "left-0",
15
15
  right: "right-0",
16
16
  },
@@ -21,8 +21,8 @@ export default /*tw*/ {
21
21
  size: "md",
22
22
  labelKey: "label",
23
23
  valueKey: "id",
24
- listYPosition: "bottom",
25
- listXPosition: "left",
24
+ yPosition: "bottom",
25
+ xPosition: "left",
26
26
  underlined: undefined,
27
27
  dashed: true,
28
28
  noRing: true,
@@ -180,18 +180,18 @@ const props = defineProps({
180
180
  * The position of dropdown list on the y-axis.
181
181
  * @values top, bottom
182
182
  */
183
- listYPosition: {
183
+ yPosition: {
184
184
  type: String,
185
- default: getDefault(defaultConfig, UDropdownLink).listYPosition,
185
+ default: getDefault(defaultConfig, UDropdownLink).yPosition,
186
186
  },
187
187
 
188
188
  /**
189
189
  * The position of dropdown list on the x-axis.
190
190
  * @values left, right
191
191
  */
192
- listXPosition: {
192
+ xPosition: {
193
193
  type: String,
194
- default: getDefault(defaultConfig, UDropdownLink).listXPosition,
194
+ default: getDefault(defaultConfig, UDropdownLink).xPosition,
195
195
  },
196
196
 
197
197
  /**
@@ -47,7 +47,6 @@ export default /*tw*/ {
47
47
  },
48
48
  },
49
49
  },
50
-
51
50
  defaults: {
52
51
  color: "brand",
53
52
  size: "md",
@@ -26,10 +26,9 @@ export default /*tw*/ {
26
26
  { color: "grayscale", variant: "thirdary", bordered: true, class: "border-gray-200" },
27
27
  ],
28
28
  },
29
- text: "{UText}",
30
29
  body: "flex items-start justify-between",
30
+ contentWrapper: "flex gap-2",
31
31
  content: "",
32
- innerWrapper: "flex gap-2",
33
32
  title: {
34
33
  base: "font-bold leading-tight",
35
34
  variants: {
@@ -42,6 +41,7 @@ export default /*tw*/ {
42
41
  },
43
42
  },
44
43
  description: "",
44
+ text: "{UText}",
45
45
  closeButton: "{UButton}",
46
46
  closeIcon: "{UIcon}",
47
47
  defaults: {
@@ -4,7 +4,7 @@
4
4
  <slot name="top" />
5
5
 
6
6
  <div v-bind="bodyAttrs">
7
- <div v-bind="innerWrapperAttrs">
7
+ <div v-bind="contentWrapperAttrs">
8
8
  <!-- @slot Use it to add something before the text. -->
9
9
  <slot name="left" />
10
10
 
@@ -29,8 +29,8 @@
29
29
  <div v-if="description" v-bind="descriptionAttrs" v-text="description" />
30
30
  </slot>
31
31
 
32
- <!-- @slot Use it to add something inside. -->
33
32
  <UText v-bind="textAttrs" :size="size">
33
+ <!-- @slot Use it to add something inside. -->
34
34
  <slot />
35
35
  </UText>
36
36
  </div>
@@ -119,7 +119,15 @@ const props = defineProps({
119
119
  },
120
120
 
121
121
  /**
122
- * Hint size.
122
+ * Add border to the `thirdary` variant.
123
+ */
124
+ bordered: {
125
+ type: Boolean,
126
+ default: getDefault(defaultConfig, UAlert).bordered,
127
+ },
128
+
129
+ /**
130
+ * Alert size.
123
131
  * @values xs, sm, md, lg
124
132
  */
125
133
  size: {
@@ -128,7 +136,7 @@ const props = defineProps({
128
136
  },
129
137
 
130
138
  /**
131
- * Hint color.
139
+ * Alert color.
132
140
  * @values brand, grayscale, gray, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose, white */
133
141
  color: {
134
142
  type: String,
@@ -136,15 +144,7 @@ const props = defineProps({
136
144
  },
137
145
 
138
146
  /**
139
- * Add border to the `thirdary` variant.
140
- */
141
- bordered: {
142
- type: Boolean,
143
- default: getDefault(defaultConfig, UAlert).bordered,
144
- },
145
-
146
- /**
147
- * Hint timeout.
147
+ * Alert timeout.
148
148
  */
149
149
  timeout: {
150
150
  type: Number,
@@ -195,7 +195,7 @@ const {
195
195
  descriptionAttrs,
196
196
  closeButtonAttrs,
197
197
  closeIconAttrs,
198
- innerWrapperAttrs,
198
+ contentWrapperAttrs,
199
199
  hasSlotContent,
200
200
  } = useAttrs(props);
201
201
 
@@ -54,9 +54,9 @@ export default /*tw*/ {
54
54
  rightIcon: "{UIcon}",
55
55
  defaults: {
56
56
  color: "brand",
57
- size: "md",
58
57
  variant: "primary",
59
58
  tabindex: "-1",
59
+ size: "md",
60
60
  round: false,
61
61
  bordered: false,
62
62
  },
@@ -155,14 +155,6 @@ const props = defineProps({
155
155
  default: "",
156
156
  },
157
157
 
158
- /**
159
- * Controls the keyboard “Tab” focus order of elements.
160
- */
161
- tabindex: {
162
- type: [String, Number],
163
- default: getDefault(defaultConfig, UBadge).tabindex,
164
- },
165
-
166
158
  /**
167
159
  * Set badge corners rounded.
168
160
  */
@@ -171,6 +163,14 @@ const props = defineProps({
171
163
  default: getDefault(defaultConfig, UBadge).round,
172
164
  },
173
165
 
166
+ /**
167
+ * Controls the keyboard “Tab” focus order of elements.
168
+ */
169
+ tabindex: {
170
+ type: [String, Number],
171
+ default: getDefault(defaultConfig, UBadge).tabindex,
172
+ },
173
+
174
174
  /**
175
175
  * Component ui config object.
176
176
  */
@@ -22,7 +22,6 @@ export default /*tw*/ {
22
22
  },
23
23
  emptyIcon: "{UIcon}",
24
24
  title: "{UHeader}",
25
- footer: "mt-4 flex justify-center",
26
25
  description: {
27
26
  base: "text-center",
28
27
  variants: {
@@ -33,6 +32,7 @@ export default /*tw*/ {
33
32
  },
34
33
  },
35
34
  },
35
+ footer: "mt-4 flex justify-center",
36
36
  defaults: {
37
37
  size: "md",
38
38
  /* icons */
@@ -44,7 +44,7 @@ defineOptions({ name: "UEmpty", inheritAttrs: false });
44
44
 
45
45
  const props = defineProps({
46
46
  /**
47
- * Sets title.
47
+ * Empty state title.
48
48
  */
49
49
  title: {
50
50
  type: String,
@@ -52,7 +52,7 @@ const props = defineProps({
52
52
  },
53
53
 
54
54
  /**
55
- * Sets description.
55
+ * Empty state description.
56
56
  */
57
57
  description: {
58
58
  type: String,
@@ -60,7 +60,7 @@ const props = defineProps({
60
60
  },
61
61
 
62
62
  /**
63
- * Sets component size.
63
+ * Empty state size.
64
64
  * @values sm, md, lg
65
65
  */
66
66
  size: {
@@ -69,7 +69,7 @@ const props = defineProps({
69
69
  },
70
70
 
71
71
  /**
72
- * Sets component ui config object.
72
+ * Component ui config object.
73
73
  */
74
74
  config: {
75
75
  type: Object,
@@ -1,6 +1,6 @@
1
1
  export default /*tw*/ {
2
2
  file: "{ULink}",
3
- info: {
3
+ body: {
4
4
  base: "flex items-center",
5
5
  variants: {
6
6
  size: {
@@ -10,21 +10,9 @@ export default /*tw*/ {
10
10
  },
11
11
  },
12
12
  },
13
+ fileImage: "rounded-sm max-w-7",
13
14
  fileIcon: "{UIcon}",
14
- image: "rounded-sm max-w-7",
15
- label: {
16
- base: "text-gray-700 whitespace-normal hover:underline hover:decoration-dashed hover:underline-offset-4",
17
- variants: {
18
- focus: {
19
- true: "underline decoration-dashed underline-offset-4",
20
- },
21
- size: {
22
- sm: "text-xs",
23
- md: "text-sm",
24
- lg: "text-base",
25
- },
26
- },
27
- },
15
+ fileLabel: "{ULink}",
28
16
  defaults: {
29
17
  size: "md",
30
18
  /* icons */
@@ -1,10 +1,10 @@
1
1
  <template>
2
- <ULink :href="url" no-ring target-blank :data-test="dataTest" v-bind="fileAttrs">
2
+ <ULink :href="url" no-ring v-bind="fileAttrs" :data-test="dataTest">
3
3
  <slot name="left" :file="{ id, label, url, imageUrl }" />
4
4
 
5
5
  <slot :file="{ id, label, url, imageUrl }">
6
- <div v-bind="infoAttrs">
7
- <img v-if="imageUrl" :src="imageUrl" v-bind="imageAttrs" />
6
+ <div v-bind="bodyAttrs">
7
+ <img v-if="imageUrl" :alt="label" :src="imageUrl" v-bind="fileImageAttrs" />
8
8
 
9
9
  <UIcon
10
10
  v-else
@@ -18,7 +18,7 @@
18
18
  @blur="onBlur"
19
19
  />
20
20
 
21
- <span v-bind="labelAttrs" v-text="label" />
21
+ <ULink :label="label" :size="size" color="gray" dashed no-ring v-bind="fileLabelAttrs" />
22
22
  </div>
23
23
  </slot>
24
24
 
@@ -103,9 +103,12 @@ const props = defineProps({
103
103
 
104
104
  const focus = ref(false);
105
105
 
106
- const { config, fileAttrs, infoAttrs, fileIconAttrs, labelAttrs, imageAttrs } = useAttrs(props, {
107
- focus,
108
- });
106
+ const { config, fileAttrs, bodyAttrs, fileIconAttrs, fileLabelAttrs, fileImageAttrs } = useAttrs(
107
+ props,
108
+ {
109
+ focus,
110
+ },
111
+ );
109
112
 
110
113
  const iconSize = computed(() => {
111
114
  const sizes = {
@@ -1,9 +1,9 @@
1
1
  export default /*tw*/ {
2
2
  filesLabel: "{ULabel}",
3
- body: "flex flex-col gap-1",
4
- file: "{UFile} block",
3
+ items: "flex flex-col gap-1",
4
+ item: "{UFile} block",
5
5
  defaults: {
6
- placement: "top",
7
6
  size: "md",
7
+ labelAlign: "top",
8
8
  },
9
9
  };
@@ -1,6 +1,13 @@
1
1
  <template>
2
- <ULabel :label="label" :description="description" :size="size" v-bind="filesLabelAttrs">
3
- <div v-bind="bodyAttrs">
2
+ <ULabel
3
+ :label="label"
4
+ :description="description"
5
+ :size="size"
6
+ :align="labelAlign"
7
+ v-bind="filesLabelAttrs"
8
+ >
9
+ <div v-bind="itemsAttrs">
10
+ <!-- @slot Use it to add UFile. -->
4
11
  <slot>
5
12
  <UFile
6
13
  v-for="file in formattedFileList"
@@ -10,12 +17,12 @@
10
17
  :url="file.url"
11
18
  :image-url="file.imageUrl"
12
19
  :size="size"
13
- v-bind="fileAttrs"
20
+ v-bind="itemAttrs"
14
21
  :data-test="`${dataTest}-item`"
15
22
  >
16
23
  <template #left="{ file: currentFile }">
17
24
  <!-- @slot Use it to add something left.
18
- @binding {object} file
25
+ @binding {object} file
19
26
  -->
20
27
  <slot name="left" :file="currentFile" />
21
28
  </template>
@@ -47,40 +54,40 @@ defineOptions({ name: "UFiles", inheritAttrs: false });
47
54
 
48
55
  const props = defineProps({
49
56
  /**
50
- * Set files label.
57
+ * List of file objects.
51
58
  */
52
- label: {
53
- type: String,
54
- default: "",
59
+ fileList: {
60
+ type: Array,
61
+ default: () => [],
55
62
  },
56
63
 
57
64
  /**
58
- * Set description text.
65
+ * File list label.
59
66
  */
60
- description: {
67
+ label: {
61
68
  type: String,
62
69
  default: "",
63
70
  },
64
71
 
65
72
  /**
66
- * Set label placement related from the default slot.
67
- * @values topInside, top, left, right
73
+ * File list label placement.
74
+ * @values top, topWithDesc
68
75
  */
69
- placement: {
76
+ labelAlign: {
70
77
  type: String,
71
- default: getDefault(defaultConfig, UFiles).placement,
78
+ default: getDefault(defaultConfig, UFiles).labelAlign,
72
79
  },
73
80
 
74
81
  /**
75
- * List of file objects.
82
+ * File list description.
76
83
  */
77
- fileList: {
78
- type: Array,
79
- default: () => [],
84
+ description: {
85
+ type: String,
86
+ default: "",
80
87
  },
81
88
 
82
89
  /**
83
- * Set size.
90
+ * File list size.
84
91
  * @values sm, md, lg
85
92
  */
86
93
  size: {
@@ -105,7 +112,7 @@ const props = defineProps({
105
112
  },
106
113
  });
107
114
 
108
- const { filesLabelAttrs, bodyAttrs, fileAttrs } = useAttrs(props);
115
+ const { filesLabelAttrs, itemsAttrs, itemAttrs } = useAttrs(props);
109
116
 
110
117
  const formattedFileList = computed(() =>
111
118
  props.fileList.map((file) => {
@@ -1,5 +1,5 @@
1
1
  export default /*tw*/ {
2
- wrapper: {
2
+ header: {
3
3
  base: "text-{color}-600",
4
4
  variants: {
5
5
  size: {
@@ -10,17 +10,12 @@ export default /*tw*/ {
10
10
  xl: "text-4xl",
11
11
  "2xl": "text-5xl",
12
12
  },
13
- weight: {
14
- regular: "font-normal",
15
- medium: "font-medium",
16
- bold: "font-bold",
17
- },
18
13
  color: {
19
14
  brand: "text-brand",
20
15
  white: "text-white",
21
16
  grayscale: "text-gray-900",
22
17
  },
23
- multiline: {
18
+ line: {
24
19
  true: "!leading-none",
25
20
  },
26
21
  underlined: {
@@ -40,10 +35,9 @@ export default /*tw*/ {
40
35
  },
41
36
  defaults: {
42
37
  color: "grayscale",
43
- weight: "medium",
44
38
  size: "md",
45
39
  tag: "div",
46
- multiline: false,
40
+ line: true,
47
41
  underlined: false,
48
42
  },
49
43
  safelist: (colors) => [{ pattern: `text-(${colors})-600` }, { pattern: `border-(${colors})-600` }],
@@ -56,19 +56,16 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
56
56
  export const Default = DefaultTemplate.bind({});
57
57
  Default.args = {};
58
58
 
59
- export const Weights = EnumVariantTemplate.bind({});
60
- Weights.args = { enum: "weight" };
61
-
62
59
  export const Sizes = EnumVariantTemplate.bind({});
63
60
  Sizes.args = { enum: "size" };
64
61
 
65
62
  export const Underlined = EnumVariantTemplate.bind({});
66
63
  Underlined.args = { enum: "size", underlined: true };
67
64
 
68
- export const Multiline = DefaultTemplate.bind({});
69
- Multiline.args = {
65
+ export const Line = DefaultTemplate.bind({});
66
+ Line.args = {
70
67
  size: "2xl",
71
- multiline: true,
68
+ line: false,
72
69
  label: "Some very long header you ever may imagine in your whole long and beautiful life",
73
70
  };
74
71
 
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <component :is="tag" v-bind="wrapperAttrs" :data-test="dataTest">
2
+ <component :is="tag" v-bind="headerAttrs" :data-test="dataTest">
3
3
  <slot>{{ label }}</slot>
4
4
  </component>
5
5
  </template>
@@ -32,15 +32,6 @@ const props = defineProps({
32
32
  default: getDefault(defaultConfig, UHeader).size,
33
33
  },
34
34
 
35
- /**
36
- * Header weight.
37
- * @values regular, medium, bold
38
- */
39
- weight: {
40
- type: String,
41
- default: getDefault(defaultConfig, UHeader).weight,
42
- },
43
-
44
35
  /**
45
36
  * Header color.
46
37
  * @values brand, grayscale, gray, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose, white
@@ -51,7 +42,7 @@ const props = defineProps({
51
42
  },
52
43
 
53
44
  /**
54
- * Allows changing button html tag.
45
+ * Allows changing HTML tag.
55
46
  */
56
47
  tag: {
57
48
  type: String,
@@ -59,11 +50,11 @@ const props = defineProps({
59
50
  },
60
51
 
61
52
  /**
62
- * Return default line height to the component (it may be useful for multiline headers).
53
+ * Removes text line height (disable for multiline headers).
63
54
  */
64
- multiline: {
55
+ line: {
65
56
  type: Boolean,
66
- default: getDefault(defaultConfig, UHeader).multiline,
57
+ default: getDefault(defaultConfig, UHeader).line,
67
58
  },
68
59
 
69
60
  /**
@@ -91,5 +82,5 @@ const props = defineProps({
91
82
  },
92
83
  });
93
84
 
94
- const { wrapperAttrs } = useAttrs(props);
85
+ const { headerAttrs } = useAttrs(props);
95
86
  </script>