vueless 1.0.2-beta.14 → 1.0.2-beta.16

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="M294.24-230.52 64.5-460.26 113-509l181 181 48.74 48.74-48.5 48.74ZM464-236.26 234.02-466.48l48.98-48.5 181 181L847.76-717.5l48.98 48.5L464-236.26Zm0-175.98-48.5-48.74 257-257 48.5 48.74-257 257Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M771.65-67.33q-6.72 0-12.55-2.35-5.84-2.36-11.32-7.84L502.2-323.11q-5.48-5.48-7.84-11.31-2.36-5.84-2.36-12.56 0-6.72 2.36-12.67 2.36-5.96 7.84-11.44l85.47-85.48q5.48-5.47 11.32-7.95 5.84-2.48 12.79-2.48 6.72 0 12.56 2.48 5.83 2.48 11.31 7.95l245.59 245.83q5.48 5.48 7.96 11.2 2.47 5.71 2.47 12.67 0 6.72-2.59 12.67-2.6 5.96-7.84 11.2l-85.48 85.48q-5.48 5.48-11.31 7.84-5.84 2.35-12.8 2.35Zm.24-77.97 41.57-41.57-201.92-202.15-41.56 41.56L771.89-145.3Zm-584.3 77.74q-6.72 0-13.06-2.24-6.33-2.24-11.81-7.72L78.24-162q-5.48-5.24-7.72-11.46-2.24-6.21-2.24-13.17 0-6.72 2.24-12.67 2.24-5.96 7.72-11.44L308.74-441h87.15l37.28-37.28L255.3-656.15h-58.43L66.85-786.17l104.5-104.5 130.02 130.02v58.43l177.87 177.87 130.72-130.72-68.2-68.19 56-55.76h-113l-20.15-20.39 134.22-134.46 20.39 20.63v112.76l56-56 174.02 174.26q15.48 15.72 24.46 35.94 8.97 20.21 8.97 42.93 0 21.44-7.45 41.25-7.46 19.82-20.42 35.77l-87.15-87.15-57.43 57.44-53.2-53.2-215.06 215.07v86.39L211.46-77.52q-5.48 5.48-11.2 7.72-5.72 2.24-12.67 2.24Zm0-77.74 202.39-202.16v-41.56h-41.57L146.02-186.87l41.57 41.57Zm0 0-41.57-41.57 21.28 20.28 20.29 21.29Zm584.3 0 41.57-41.57-41.57 41.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="M428.13-330.96q1-75.58 17.46-110.74 16.45-35.15 60.17-72.95 41.28-36.33 62.83-68.26 21.54-31.92 21.54-68.63 0-43.57-28.92-72.49-28.93-28.93-80.54-28.93-50.56 0-78.8 28.67-28.24 28.66-41.48 62.81l-92.61-40.59q23.2-62.58 77.49-105.28 54.3-42.69 135.35-42.69 102.2 0 157.4 57.09t55.2 137.65q0 50.87-20.62 91.42-20.62 40.55-65.86 82.84-48.28 45.32-58.52 70.44-10.24 25.12-11 79.64H428.13ZM480.62-73.3q-31.34 0-53.39-22.06-22.06-22.05-22.06-53.32t22.04-53.33q22.03-22.06 53.44-22.06 31.42 0 53.47 22.06 22.05 22.06 22.05 53.33t-22.1 53.32Q511.96-73.3 480.62-73.3Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="m122.76-234.74-48.74-48.74 298.94-297.69 167 167 231.91-232.4H647.02v-68.36h239.2v239.19h-67.37v-121.09L538.96-316.7l-167-167-249.2 248.96Z"/></svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "1.0.2-beta.14",
3
+ "version": "1.0.2-beta.16",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -33,12 +33,6 @@ const props = withDefaults(defineProps<Props>(), {
33
33
  });
34
34
 
35
35
  const emit = defineEmits([
36
- /**
37
- * Triggers when the select component is clicked.
38
- * @property {boolean} value
39
- */
40
- "click",
41
-
42
36
  /**
43
37
  * Triggers when a dropdown list is opened.
44
38
  * @property {string} elementId
@@ -255,8 +249,6 @@ function deactivate() {
255
249
  }
256
250
 
257
251
  function activate() {
258
- emit("click", isOpen.value);
259
-
260
252
  if (isOpen.value || props.disabled || props.readonly) {
261
253
  return;
262
254
  }
@@ -12,6 +12,8 @@ import UCol from "../../ui.container-col/UCol.vue";
12
12
  import UIcon from "../../ui.image-icon/UIcon.vue";
13
13
  import UButton from "../../ui.button/UButton.vue";
14
14
  import UBadge from "../../ui.text-badge/UBadge.vue";
15
+ import ULink from "../../ui.button-link/ULink.vue";
16
+ import UText from "../../ui.text-block/UText.vue";
15
17
 
16
18
  import type { Meta, StoryFn } from "@storybook/vue3";
17
19
  import type { Props } from "../types.ts";
@@ -26,7 +28,7 @@ export default {
26
28
  title: "Text & Content / Alert",
27
29
  component: UAlert,
28
30
  args: {
29
- title: "Network Error",
31
+ title: "Scheduled Maintenance Notice",
30
32
  },
31
33
  argTypes: {
32
34
  ...getArgTypes(UAlert.__name),
@@ -67,18 +69,23 @@ Default.args = {};
67
69
 
68
70
  export const Description = DefaultTemplate.bind({});
69
71
  Description.args = {
70
- description:
71
- "Unable to connect to the server. Please check your internet connection and try again.",
72
+ description: `
73
+ Our website will be undergoing scheduled maintenance on March 15th from 2:00 AM to 4:00 AM UTC.
74
+ Some features may be temporarily unavailable during this time. We appreciate your patience!
75
+ `,
72
76
  };
73
77
 
74
78
  export const Variants = EnumTemplate.bind({});
75
- Variants.args = { enum: "variant", title: "{enumValue}" };
79
+ Variants.args = { enum: "variant" };
76
80
 
77
81
  export const Sizes = EnumTemplate.bind({});
78
- Sizes.args = { enum: "size", title: "{enumValue}" };
82
+ Sizes.args = { enum: "size" };
79
83
 
80
84
  export const Colors = EnumTemplate.bind({});
81
- Colors.args = { enum: "color", title: "{enumValue}" };
85
+ Colors.args = { enum: "color" };
86
+
87
+ export const Icon = DefaultTemplate.bind({});
88
+ Icon.args = { icon: "handyman" };
82
89
 
83
90
  export const Closable = DefaultTemplate.bind({});
84
91
  Closable.args = { closable: true };
@@ -90,8 +97,7 @@ CloseSlot.args = {
90
97
  <template #close="{ close }">
91
98
  <UButton
92
99
  label="Close"
93
- variant="solid"
94
- color="neutral"
100
+ variant="ghost"
95
101
  size="sm"
96
102
  @click="close"
97
103
  />
@@ -100,38 +106,74 @@ CloseSlot.args = {
100
106
  };
101
107
 
102
108
  export const Slots: StoryFn<UAlertArgs> = (args) => ({
103
- components: { UAlert, UIcon, URow, UBadge },
109
+ components: { UAlert, UIcon, URow, UCol, UButton, UBadge, ULink, UText },
104
110
  setup() {
105
111
  return { args };
106
112
  },
107
113
  template: `
108
- <URow>
109
- <UAlert v-bind="args">
110
- <template #title>
111
- <UBadge
112
- label="Connection lost"
113
- size="lg"
114
- color="error"
115
- variant="outlined"
116
- />
114
+ <UCol>
115
+ <UAlert
116
+ title="New Feature Available"
117
+ description="We've just released our new AI-powered analytics dashboard.
118
+ Try it out and let us know what you think!"
119
+ color="success"
120
+ icon="question_mark"
121
+ >
122
+ <template #left="{ iconName }">
123
+ <URow align="center" gap="none">
124
+ <ULink label="What's New" color="success" />
125
+ <UIcon :name="iconName" color="success" size="2xs" class="mb-1" />
126
+ </URow>
117
127
  </template>
118
128
  </UAlert>
119
129
 
120
- <UAlert v-bind="args">
121
- <template #description>
122
- <UBadge
123
- label="We are trying to reconnect. Please wait a moment or check your network settings."
124
- color="error"
125
- variant="soft"
126
- />
130
+ <UAlert
131
+ title="System Maintenance"
132
+ description="Scheduled maintenance will begin in 30 minutes. Estimated downtime: 2 hours."
133
+ color="warning"
134
+ >
135
+ <template #title>
136
+ <URow align="center" gap="sm">
137
+ <UBadge
138
+ label="MAINTENANCE"
139
+ size="sm"
140
+ color="warning"
141
+ variant="outlined"
142
+ />
143
+ <UText label="System Maintenance" size="sm" />
144
+ </URow>
127
145
  </template>
128
146
  </UAlert>
129
147
 
130
- <UAlert v-bind="args">
131
- <template #left>
132
- <UIcon name="warning" color="warning" />
148
+ <UAlert
149
+ title="Welcome to Vueless!"
150
+ description="You've successfully joined our community.
151
+ Check out our documentation to get started with building beautiful interfaces."
152
+ color="info"
153
+ >
154
+ <template #description>
155
+ <UCol>
156
+ <p>
157
+ You've successfully joined our community. Check out our documentation
158
+ to get started with building beautiful interfaces.
159
+ </p>
160
+ <URow gap="sm">
161
+ <UButton
162
+ label="View Docs"
163
+ variant="ghost"
164
+ size="sm"
165
+ color="info"
166
+ />
167
+ <UButton
168
+ label="Join Discord"
169
+ variant="ghost"
170
+ size="sm"
171
+ color="info"
172
+ />
173
+ </URow>
174
+ </UCol>
133
175
  </template>
134
176
  </UAlert>
135
- </URow>
177
+ </UCol>
136
178
  `,
137
179
  });
@@ -11,6 +11,8 @@ import UIcon from "../../ui.image-icon/UIcon.vue";
11
11
  import URow from "../../ui.container-row/URow.vue";
12
12
  import UCol from "../../ui.container-col/UCol.vue";
13
13
  import UNumber from "../../ui.text-number/UNumber.vue";
14
+ import UText from "../../ui.text-block/UText.vue";
15
+ import UDot from "../../ui.other-dot/UDot.vue";
14
16
 
15
17
  import type { Meta, StoryFn } from "@storybook/vue3";
16
18
  import type { Props } from "../types.ts";
@@ -26,7 +28,7 @@ export default {
26
28
  title: "Text & Content / Badge",
27
29
  component: UBadge,
28
30
  args: {
29
- label: "Badge",
31
+ label: "3 New Messages",
30
32
  },
31
33
  argTypes: {
32
34
  ...getArgTypes(UBadge.__name),
@@ -85,10 +87,10 @@ export const Round = DefaultTemplate.bind({});
85
87
  Round.args = { round: true };
86
88
 
87
89
  export const Variants = EnumTemplate.bind({});
88
- Variants.args = { enum: "variant", label: "{enumValue}" };
90
+ Variants.args = { enum: "variant" };
89
91
 
90
92
  export const Sizes = EnumTemplate.bind({});
91
- Sizes.args = { enum: "size", label: "{enumValue}" };
93
+ Sizes.args = { enum: "size" };
92
94
 
93
95
  export const Colors = MultiEnumTemplate.bind({});
94
96
  Colors.args = { outerEnum: "variant", enum: "color", label: "{enumValue}" };
@@ -120,45 +122,32 @@ export const IconProps: StoryFn<UBadgeArgs> = (args) => ({
120
122
  });
121
123
 
122
124
  export const Slots: StoryFn<UBadgeArgs> = (args) => ({
123
- components: { UBadge, UIcon, URow, UNumber },
125
+ components: { UBadge, UIcon, URow, UNumber, UText, UDot },
124
126
  setup() {
125
127
  return { args };
126
128
  },
127
129
  template: `
128
130
  <URow>
129
- <UBadge label="Add to favorite">
131
+ <UBadge label="Live" variant="outlined">
130
132
  <template #left>
131
- <UIcon
132
- name="heart_plus"
133
- size="2xs"
134
- color="inherit"
135
- />
133
+ <UDot color="error" size="sm" />
136
134
  </template>
137
135
  </UBadge>
138
136
 
139
- <UBadge label="shopping_cart">
140
- <template #default="{ label }">
137
+ <UBadge variant="outlined">
138
+ <template #default>
141
139
  <UNumber
142
140
  value="20.25"
143
141
  size="sm"
144
142
  currency="$"
145
- color="inherit"
146
- />
147
- <UIcon
148
- :name="label"
149
- size="2xs"
150
- color="inherit"
143
+ currency-space
151
144
  />
152
145
  </template>
153
146
  </UBadge>
154
147
 
155
- <UBadge label="Delete">
148
+ <UBadge label="Status:" variant="outlined">
156
149
  <template #right>
157
- <UIcon
158
- name="delete"
159
- size="2xs"
160
- color="inherit"
161
- />
150
+ <UText label="Active" size="sm" />
162
151
  </template>
163
152
  </UBadge>
164
153
  </URow>
@@ -176,11 +176,13 @@ FormattedText.args = {
176
176
  `,
177
177
  };
178
178
 
179
- export const NestedComponent = DefaultTemplate.bind({});
180
- NestedComponent.args = {
179
+ export const DefaultSlot = DefaultTemplate.bind({});
180
+ DefaultSlot.args = {
181
181
  slotTemplate: `
182
- <p>To proceed with your registration, please enter your
183
- <UBadge label="email address" color="success" variant="subtle" /> in the field below.
184
- A verification link will be sent to your inbox shortly.</p>
182
+ <template #default>
183
+ <p>To proceed with your registration, please enter your
184
+ <UBadge label="email address" color="success" variant="subtle" /> in the field below.
185
+ A verification link will be sent to your inbox shortly.</p>
186
+ </template>
185
187
  `,
186
188
  };
@@ -4,7 +4,6 @@ import {
4
4
  getSlotNames,
5
5
  getSlotsFragment,
6
6
  getDocsDescription,
7
- getEnumVariantDescription,
8
7
  } from "../../utils/storybook.ts";
9
8
 
10
9
  import UFile from "../../ui.text-file/UFile.vue";
@@ -78,14 +77,15 @@ export const Default = DefaultTemplate.bind({});
78
77
  Default.args = {};
79
78
 
80
79
  export const ImageURL = DefaultTemplate.bind({});
81
- ImageURL.args = { imageUrl: "https://picsum.photos/100" };
80
+ ImageURL.args = {
81
+ imageUrl: "https://cdn-icons-png.flaticon.com/256/11039/11039912.png",
82
+ };
82
83
 
83
84
  export const Removable = DefaultTemplate.bind({});
84
85
  Removable.args = { removable: true };
85
86
 
86
87
  export const Sizes = EnumTemplate.bind({});
87
88
  Sizes.args = { enum: "size" };
88
- Sizes.parameters = getEnumVariantDescription();
89
89
 
90
90
  export const Slots: StoryFn<UFileArgs> = (args) => ({
91
91
  components: { UFile, URow, UBadge, UIcon },
@@ -102,7 +102,7 @@ export const Slots: StoryFn<UFileArgs> = (args) => ({
102
102
 
103
103
  <UFile v-bind="args">
104
104
  <template #right>
105
- <UBadge label="File uploaded" color="success" />
105
+ <UBadge label="File uploaded" color="success" size="sm" variant="subtle" right-icon="done_all" />
106
106
  </template>
107
107
  </UFile>
108
108
  </URow>
@@ -4,15 +4,12 @@ import {
4
4
  getSlotNames,
5
5
  getSlotsFragment,
6
6
  getDocsDescription,
7
- getEnumVariantDescription,
8
7
  } from "../../utils/storybook.ts";
9
8
 
10
9
  import UHeader from "../../ui.text-header/UHeader.vue";
11
10
  import UCol from "../../ui.container-col/UCol.vue";
12
11
  import UBadge from "../../ui.text-badge/UBadge.vue";
13
12
 
14
- import tooltip from "../../directives/tooltip/vTooltip.ts";
15
-
16
13
  import type { Meta, StoryFn } from "@storybook/vue3";
17
14
  import type { Props } from "../types.ts";
18
15
 
@@ -50,7 +47,6 @@ const DefaultTemplate: StoryFn<UHeaderArgs> = (args: UHeaderArgs) => ({
50
47
 
51
48
  const EnumTemplate: StoryFn<UHeaderArgs> = (args: UHeaderArgs, { argTypes }) => ({
52
49
  components: { UHeader, UCol },
53
- directives: { tooltip },
54
50
  setup: () => ({ args, argTypes, getArgs }),
55
51
  template: `
56
52
  <UCol>
@@ -58,7 +54,6 @@ const EnumTemplate: StoryFn<UHeaderArgs> = (args: UHeaderArgs, { argTypes }) =>
58
54
  v-for="option in argTypes?.[args.enum]?.options"
59
55
  v-bind="getArgs(args, option)"
60
56
  :key="option"
61
- v-tooltip="option"
62
57
  />
63
58
  </UCol>
64
59
  `,
@@ -69,15 +64,12 @@ Default.args = {};
69
64
 
70
65
  export const Sizes = EnumTemplate.bind({});
71
66
  Sizes.args = { enum: "size" };
72
- Sizes.parameters = getEnumVariantDescription();
73
67
 
74
68
  export const Variants = EnumTemplate.bind({});
75
69
  Variants.args = { enum: "variant" };
76
- Variants.parameters = getEnumVariantDescription();
77
70
 
78
71
  export const Colors = EnumTemplate.bind({});
79
72
  Colors.args = { enum: "color" };
80
- Colors.parameters = getEnumVariantDescription();
81
73
 
82
74
  export const DefaultSlot = DefaultTemplate.bind({});
83
75
  DefaultSlot.args = {
@@ -36,7 +36,7 @@ notify({
36
36
  });
37
37
 
38
38
  notifySuccess({ description: "The file successfully downloaded." });
39
- notifyWarning({ description: "The file have been downloaded, but some data is missing." });
39
+ notifyWarning({ description: "The file has been downloaded, but some data is missing." });
40
40
  notifyError({ description: "The file can't be downloaded, please check the fields and try again." });
41
41
  `} language="jsx" dark />
42
42
 
@@ -6,7 +6,6 @@ import {
6
6
  } from "../../utils/storybook.ts";
7
7
 
8
8
  import { notify } from "../utilNotify.js";
9
- import { NotificationType } from "../constants.ts";
10
9
 
11
10
  import UNotify from "../../ui.text-notify/UNotify.vue";
12
11
  import UButton from "../../ui.button/UButton.vue";
@@ -38,65 +37,56 @@ export default {
38
37
 
39
38
  const DefaultTemplate: StoryFn<UNotifyArgs> = (args: UNotifyArgs) => ({
40
39
  components: { UNotify, UButton },
41
- setup() {
42
- function onClick() {
43
- notify({
44
- type: NotificationType.Success,
45
- label: "Hurray!",
46
- description: "The file successfully downloaded.",
47
- });
48
- }
49
-
50
- const slots = getSlotNames(UNotify.__name);
51
-
52
- return { args, slots, onClick };
53
- },
40
+ setup: () => ({ args, slots: getSlotNames(UNotify.__name), notify }),
54
41
  template: `
55
42
  <UNotify class="m-4" v-bind="args">
56
43
  ${args.slotTemplate || getSlotsFragment("")}
57
44
  </UNotify>
58
- <UButton label="Show notify" @click="onClick"/>
45
+ <UButton
46
+ label="Show notify"
47
+ @click="notify({
48
+ type: 'success',
49
+ label: 'Hurray!',
50
+ description: 'The file has been downloaded successfully.',
51
+ })"
52
+ />
59
53
  `,
60
54
  });
61
55
 
62
56
  const TypesTemplate: StoryFn<UNotifyArgs> = (args: UNotifyArgs) => ({
63
57
  components: { UNotify, UButton, UCol },
64
- setup() {
65
- function onClick(type: string) {
66
- if (type === NotificationType.Success) {
67
- notify({
68
- type,
69
- label: "Hurray!",
70
- description: "The file successfully downloaded.",
71
- });
72
- }
73
-
74
- if (type === NotificationType.Warning) {
75
- notify({
76
- type,
77
- label: "Be aware!",
78
- description: "The file have been downloaded, but some data is missing.",
79
- });
80
- }
81
-
82
- if (type === NotificationType.Error) {
83
- notify({
84
- type,
85
- label: "Ooops!",
86
- description: "The file can't be downloaded, please check the fields and try again.",
87
- });
88
- }
89
- }
90
-
91
- return { args, onClick };
92
- },
58
+ setup: () => ({ args, notify }),
93
59
  template: `
94
60
  <UNotify class="m-4" />
95
61
 
96
62
  <UCol>
97
- <UButton label="Success" color="success" @click="onClick('success')"/>
98
- <UButton label="Warning" color="warning" @click="onClick('warning')"/>
99
- <UButton label="Error" color="error" @click="onClick('error')"/>
63
+ <UButton
64
+ label="Success"
65
+ color="success"
66
+ @click="notify({
67
+ type: 'success',
68
+ label: 'Hurray!',
69
+ description: 'The file has been downloaded successfully.',
70
+ })"
71
+ />
72
+ <UButton
73
+ label="Warning"
74
+ color="warning"
75
+ @click="notify({
76
+ type: 'warning',
77
+ label: 'Be aware!',
78
+ description: 'The file has been downloaded, but some data is missing. Please check the file and try again.',
79
+ })"
80
+ />
81
+ <UButton
82
+ label="Error"
83
+ color="error"
84
+ @click="notify({
85
+ type: 'error',
86
+ label: 'Ooops!',
87
+ description: 'The file cant be downloaded, please check the file and try again.',
88
+ })"
89
+ />
100
90
  </UCol>
101
91
  `,
102
92
  });
@@ -1,18 +1,9 @@
1
- import {
2
- getArgs,
3
- getArgTypes,
4
- getSlotNames,
5
- getSlotsFragment,
6
- getEnumVariantDescription,
7
- } from "../../utils/storybook.ts";
1
+ import { getArgs, getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/storybook.ts";
8
2
 
9
3
  import UNumber from "../../ui.text-number/UNumber.vue";
10
4
  import UIcon from "../../ui.image-icon/UIcon.vue";
11
5
  import URow from "../../ui.container-row/URow.vue";
12
6
  import UCol from "../../ui.container-col/UCol.vue";
13
- import UBadge from "../../ui.text-badge/UBadge.vue";
14
-
15
- import tooltip from "../../directives/tooltip/vTooltip.ts";
16
7
 
17
8
  import type { Meta, StoryFn } from "@storybook/vue3";
18
9
  import type { Props } from "../types.ts";
@@ -28,7 +19,6 @@ export default {
28
19
  component: UNumber,
29
20
  args: {
30
21
  value: -14.24,
31
- sign: "auto",
32
22
  },
33
23
  argTypes: {
34
24
  ...getArgTypes(UNumber.__name),
@@ -36,7 +26,7 @@ export default {
36
26
  } as Meta;
37
27
 
38
28
  const DefaultTemplate: StoryFn<UNumberArgs> = (args: UNumberArgs) => ({
39
- components: { UNumber, UIcon, UBadge },
29
+ components: { UNumber, UIcon },
40
30
  setup: () => ({ args, slots: getSlotNames(UNumber.__name) }),
41
31
  template: `
42
32
  <UNumber v-bind="args">
@@ -47,7 +37,6 @@ const DefaultTemplate: StoryFn<UNumberArgs> = (args: UNumberArgs) => ({
47
37
 
48
38
  const EnumTemplate: StoryFn<UNumberArgs> = (args: UNumberArgs, { argTypes }) => ({
49
39
  components: { UNumber, URow },
50
- directives: { tooltip },
51
40
  setup: () => ({ args, argTypes, getArgs }),
52
41
  template: `
53
42
  <URow>
@@ -55,7 +44,6 @@ const EnumTemplate: StoryFn<UNumberArgs> = (args: UNumberArgs, { argTypes }) =>
55
44
  v-for="option in argTypes?.[args.enum]?.options"
56
45
  v-bind="getArgs(args, option)"
57
46
  :key="option"
58
- v-tooltip="option"
59
47
  />
60
48
  </URow>
61
49
  `,
@@ -64,48 +52,34 @@ const EnumTemplate: StoryFn<UNumberArgs> = (args: UNumberArgs, { argTypes }) =>
64
52
  export const Default = DefaultTemplate.bind({});
65
53
  Default.args = {};
66
54
 
55
+ export const Currency = DefaultTemplate.bind({});
56
+ Currency.args = { currency: "$" };
57
+
58
+ export const CurrencySpace = DefaultTemplate.bind({});
59
+ CurrencySpace.args = { currency: "EUR", currencySpace: true };
60
+
67
61
  export const Sign = EnumTemplate.bind({});
68
62
  Sign.args = { enum: "sign" };
69
- Sign.parameters = getEnumVariantDescription();
70
63
 
71
64
  export const Align: StoryFn<UNumberArgs> = (args: UNumberArgs) => ({
72
65
  components: { UNumber, URow, UCol },
73
- directives: { tooltip },
74
- setup() {
75
- const options = ["left", "right"];
76
-
77
- return { args, options };
78
- },
66
+ setup: () => ({ args }),
79
67
  template: `
80
- <UCol>
81
- <URow
82
- :justify="option === 'right' ? 'end' : 'start'"
83
- block
84
- v-for="(option, index) in options"
85
- :key="index"
86
- >
87
- <UNumber
88
- v-bind="args"
89
- :align="option"
90
- v-tooltip="option"
91
- />
92
- </URow>
68
+ <UCol block align="stretch">
69
+ <UNumber v-bind="args" align="left" />
70
+ <UNumber v-bind="args" align="right" />
93
71
  </UCol>
94
72
  `,
95
73
  });
96
- Align.parameters = getEnumVariantDescription();
97
74
 
98
75
  export const Colors = EnumTemplate.bind({});
99
- Colors.args = { enum: "color", sign: "auto" };
100
- Colors.parameters = getEnumVariantDescription();
76
+ Colors.args = { enum: "color" };
101
77
 
102
78
  export const Sizes = EnumTemplate.bind({});
103
79
  Sizes.args = { enum: "size" };
104
- Sizes.parameters = getEnumVariantDescription();
105
80
 
106
81
  export const CurrencyAlign = EnumTemplate.bind({});
107
82
  CurrencyAlign.args = { enum: "currencyAlign", currency: "USD", currencySpace: true };
108
- CurrencyAlign.parameters = getEnumVariantDescription();
109
83
 
110
84
  export const LimitFractionDigits = DefaultTemplate.bind({});
111
85
  LimitFractionDigits.args = {
@@ -143,21 +117,21 @@ ThousandsSeparator.parameters = {
143
117
  };
144
118
 
145
119
  export const Slots: StoryFn<UNumberArgs> = (args) => ({
146
- components: { UNumber, UIcon, URow, UBadge },
120
+ components: { UNumber, UIcon, URow },
147
121
  setup() {
148
122
  return { args };
149
123
  },
150
124
  template: `
151
- <URow>
152
- <UNumber v-bind="args">
125
+ <URow align="center">
126
+ <UNumber v-bind="args" value="29.99" currency="$">
153
127
  <template #left>
154
- <UIcon name="payments" color="success" class="mr-1" />
128
+ <UIcon name="payments" color="success" size="sm" class="mr-1" />
155
129
  </template>
156
130
  </UNumber>
157
131
 
158
- <UNumber v-bind="args">
132
+ <UNumber v-bind="args" value="156.78" currency="$">
159
133
  <template #right>
160
- <UBadge label="Quantity" color="success" class="ml-1" />
134
+ <UIcon name="trending_up" color="success" size="sm" class="ml-1" />
161
135
  </template>
162
136
  </UNumber>
163
137
  </URow>
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M439.76-497.48Zm0 384.61-90.63-83.59q-92.98-85.02-153.47-145.25-60.49-60.22-96.68-108.14-36.2-47.91-50.7-89.33t-14.5-88.23q0-92.77 62.21-157.1 62.22-64.34 153.77-64.34 56.83 0 105.18 25.78 48.34 25.79 84.82 75.83 42.48-52.8 89.25-77.21 46.77-24.4 100.75-24.4 82.25 0 139.12 56.2 56.86 56.19 69.34 136.58h-68.09q-8.76-52.84-45.3-88.63-36.55-35.78-95.07-35.78-49.56 0-93.68 30.76-44.12 30.76-68.01 87.05h-57.14q-23.36-55.29-67.18-86.55-43.81-31.26-93.91-31.26-65.36 0-106.52 43.93-41.17 43.93-41.17 109.07 0 39.33 15.4 76.3t53.52 84q38.13 47.03 103.78 109.76 65.65 62.73 164.91 154.79 30.57-28.04 55.96-50.41 25.39-22.37 52.43-45.42l7.51 7.39 16.27 16.01q8.76 8.62 16.36 15.98l7.6 7.36q-26.28 23.52-52.51 46.22-26.22 22.7-58.31 52.04l-45.31 40.59Zm279-163.06v-130h-130v-68.14h130v-130h68.13v130h130v68.14h-130v130h-68.13Z"/></svg>
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M142.15-154.02q-28.35 0-48.24-19.89t-19.89-48.24v-515.7q0-28.45 19.89-48.41 19.89-19.96 48.24-19.96h466.7q16.47 0 30.91 7.35 14.45 7.34 24.02 20.24L887.22-480 664.78-181.37q-9.57 12.9-24.02 20.13-14.44 7.22-30.91 7.22h-467.7Zm-.24-67.89h467.42L802.17-480 609.42-738.09H141.91v516.18ZM376.24-480Z"/></svg>
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M34.74-116.89 480-886.22l445.26 769.33H34.74Zm113.8-65.74h662.92L480-754.98 148.54-182.63Zm335.64-54.85q12.96 0 21.87-9.08 8.91-9.09 8.91-22.05t-9.09-21.75q-9.08-8.79-22.05-8.79-12.96 0-21.87 8.96-8.91 8.97-8.91 21.93 0 12.96 9.09 21.87 9.08 8.91 22.05 8.91ZM454-348h60v-222.09h-60V-348Zm26-120.8Z"/></svg>