vueless 0.0.201 → 0.0.202

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.
Files changed (60) hide show
  1. package/composable.ui/index.js +3 -2
  2. package/package.json +2 -2
  3. package/ui.button-link/composables/attrs.composable.js +64 -130
  4. package/ui.button-link/index.stories.js +2 -4
  5. package/ui.button-link/index.vue +29 -4
  6. package/ui.button-toggle/composables/attrs.composable.js +21 -33
  7. package/ui.button-toggle/configs/default.config.js +2 -2
  8. package/ui.button-toggle/index.vue +8 -2
  9. package/ui.button-toggle-item/composables/attrs.composable.js +50 -40
  10. package/ui.button-toggle-item/configs/default.config.js +1 -1
  11. package/ui.button-toggle-item/index.stories.js +2 -4
  12. package/ui.button-toggle-item/index.vue +11 -3
  13. package/ui.dropdown-badge/composables/attrs.composable.js +45 -45
  14. package/ui.dropdown-badge/configs/default.config.js +3 -3
  15. package/ui.dropdown-badge/index.stories.js +2 -4
  16. package/ui.dropdown-badge/index.vue +8 -2
  17. package/ui.dropdown-button/composables/attrs.composable.js +45 -45
  18. package/ui.dropdown-button/configs/default.config.js +3 -3
  19. package/ui.dropdown-button/index.stories.js +2 -4
  20. package/ui.dropdown-button/index.vue +8 -2
  21. package/ui.dropdown-item/index.vue +7 -1
  22. package/ui.dropdown-link/composables/attrs.composable.js +43 -45
  23. package/ui.dropdown-link/configs/default.config.js +3 -3
  24. package/ui.dropdown-link/index.stories.js +2 -4
  25. package/ui.dropdown-link/index.vue +8 -2
  26. package/ui.dropdown-list/composables/attrs.composable.js +43 -67
  27. package/ui.dropdown-list/configs/default.config.js +2 -2
  28. package/ui.dropdown-list/index.vue +19 -3
  29. package/ui.form-calendar/components/DayView.vue +4 -4
  30. package/ui.form-calendar/composables/attrs.composable.js +5 -4
  31. package/ui.navigation-progress/components/StepperProgress.vue +87 -0
  32. package/ui.navigation-progress/composables/attrs.composable.js +33 -56
  33. package/ui.navigation-progress/configs/default.config.js +34 -1
  34. package/ui.navigation-progress/constants/index.js +5 -0
  35. package/ui.navigation-progress/index.stories.js +3 -0
  36. package/ui.navigation-progress/index.vue +55 -9
  37. package/ui.text-alert/composables/attrs.composable.js +23 -39
  38. package/ui.text-alert/configs/default.config.js +3 -3
  39. package/ui.text-alert/index.vue +19 -8
  40. package/ui.text-badge/composables/attrs.composable.js +25 -36
  41. package/ui.text-badge/index.stories.js +2 -4
  42. package/ui.text-badge/index.vue +22 -2
  43. package/ui.text-block/composables/attrs.composable.js +24 -20
  44. package/ui.text-block/index.vue +1 -1
  45. package/ui.text-empty/composables/attrs.composable.js +17 -27
  46. package/ui.text-empty/configs/default.config.js +1 -1
  47. package/ui.text-empty/index.stories.js +2 -4
  48. package/ui.text-empty/index.vue +1 -1
  49. package/ui.text-header/composables/attrs.composable.js +28 -22
  50. package/ui.text-header/index.stories.js +1 -1
  51. package/ui.text-header/index.vue +1 -1
  52. package/ui.text-money/composables/attrs.composable.js +21 -48
  53. package/ui.text-money/index.stories.js +2 -4
  54. package/web-types.json +181 -97
  55. package/ui.navigation-stepper/Docs.mdx +0 -16
  56. package/ui.navigation-stepper/composables/attrs.composable.js +0 -25
  57. package/ui.navigation-stepper/configs/default.config.js +0 -13
  58. package/ui.navigation-stepper/constants/index.js +0 -5
  59. package/ui.navigation-stepper/index.stories.js +0 -33
  60. package/ui.navigation-stepper/index.vue +0 -126
@@ -25,9 +25,17 @@
25
25
  @click.stop="select(option)"
26
26
  @mouseenter.self="pointerSet(index)"
27
27
  >
28
- <!-- @slot Use it to add something before option. -->
28
+ <!--
29
+ @slot Use it to add something before the option.
30
+ @binding {other} option
31
+ -->
29
32
  <slot :option="option" name="before-option" />
30
33
 
34
+ <!--
35
+ @slot Use it to add something instead of the option.
36
+ @binding {other} option
37
+ @binding {number} index
38
+ -->
31
39
  <slot name="option" :option="option" :index="index">
32
40
  <span
33
41
  :style="getMarginForSubCategory(option.level)"
@@ -36,7 +44,10 @@
36
44
  />
37
45
  </slot>
38
46
 
39
- <!-- @slot Use it to add something after option. -->
47
+ <!--
48
+ @slot Use it to add something after the option.
49
+ @binding {other} option
50
+ -->
40
51
  <slot :option="option" name="after-option" />
41
52
  </span>
42
53
 
@@ -198,7 +209,12 @@ const props = defineProps({
198
209
  },
199
210
  });
200
211
 
201
- const emit = defineEmits(["update:modelValue", "addOption"]);
212
+ const emit = defineEmits([
213
+ /**
214
+ * Triggers when option is added.
215
+ */
216
+ "addOption",
217
+ ]);
202
218
 
203
219
  const wrapperRef = ref(null);
204
220
  const optionsRef = ref([]);
@@ -245,19 +245,19 @@ function getDayClasses(day) {
245
245
  }
246
246
 
247
247
  if (isDayInRange) {
248
- return [inRangeDayAttrs.value.class];
248
+ return inRangeDayAttrs.value.class;
249
249
  }
250
250
 
251
251
  if (isSelectedDay(day)) {
252
- return [selectedDayAttrs.value.class];
252
+ return selectedDayAttrs.value.class;
253
253
  }
254
254
 
255
255
  if (isSameDay(props.activeDate, day)) {
256
- return [activeDayAttrs.value.class];
256
+ return activeDayAttrs.value.class;
257
257
  }
258
258
 
259
259
  if (isAnotherMothDay(day, activeMonthDate.value)) {
260
- return [anotherMonthDayAttrs.value.class];
260
+ return anotherMonthDayAttrs.value.class;
261
261
  }
262
262
  }
263
263
 
@@ -55,17 +55,18 @@ export default function useAttrs(props) {
55
55
  });
56
56
  const timepickerSubmitButtonAttrs = getAttrs("timepickerSubmitButton");
57
57
 
58
- const nextPrevWrapperAttrs = getAttrs("nextPrevWrapper", { classes: optionClasses.value });
58
+ const nextPrevWrapperAttrs = getAttrs("nextPrevWrapper", { classes: optionClasses });
59
59
 
60
- const dayAttrs = (classes = []) => {
60
+ // TODO: Need to find other solution
61
+ const dayAttrs = (classes) => {
61
62
  return getAttrs("day", { classes }).value;
62
63
  };
63
64
 
64
- const monthAttrs = (classes = []) => {
65
+ const monthAttrs = (classes) => {
65
66
  return getAttrs("month", { classes, isComponent: true }).value;
66
67
  };
67
68
 
68
- const yearAttrs = (classes = []) => {
69
+ const yearAttrs = (classes) => {
69
70
  return getAttrs("year", { classes, isComponent: true }).value;
70
71
  };
71
72
 
@@ -0,0 +1,87 @@
1
+ <template>
2
+ <svg width="100%" height="100%" viewBox="0 0 40 40" v-bind="stepperSvgAttrs">
3
+ <defs>
4
+ <linearGradient id="gradient" x1="0%" y1="0%" x2="100%" y2="0%" v-bind="stepperGradientAttrs">
5
+ <stop offset="0%" :stop-color="stepperColor" />
6
+ <stop offset="100%" :stop-color="stepperColor" />
7
+ </linearGradient>
8
+ </defs>
9
+
10
+ <circle
11
+ cx="20"
12
+ cy="20"
13
+ r="15.91549430918954"
14
+ fill="transparent"
15
+ stroke-width="4"
16
+ v-bind="stepperCircleAttrs"
17
+ />
18
+
19
+ <circle
20
+ cx="20"
21
+ cy="20"
22
+ r="15.91549430918954"
23
+ fill="transparent"
24
+ stroke="url(#gradient)"
25
+ stroke-width="4"
26
+ :stroke-dasharray="progressPercent"
27
+ stroke-dashoffset="0"
28
+ />
29
+ <g v-bind="stepperCountAttrs">
30
+ <text y="45%" transform="translate(0, 2)">
31
+ <tspan x="50%" text-anchor="middle">{{ value }}</tspan>
32
+ </text>
33
+ </g>
34
+ </svg>
35
+ </template>
36
+
37
+ <script setup>
38
+ import colors from "tailwindcss/colors";
39
+ import { computed } from "vue";
40
+
41
+ import { GRAY_COLORS } from "../../preset.tailwind/constants";
42
+
43
+ import { useAttrs } from "../composables/attrs.composable";
44
+
45
+ const props = defineProps({
46
+ progressPercent: {
47
+ type: String,
48
+ required: true,
49
+ },
50
+
51
+ value: {
52
+ type: Number,
53
+ required: true,
54
+ },
55
+
56
+ color: {
57
+ type: String,
58
+ required: true,
59
+ },
60
+
61
+ max: {
62
+ type: Number,
63
+ default: null,
64
+ },
65
+
66
+ config: {
67
+ type: Object,
68
+ default: () => ({}),
69
+ },
70
+
71
+ dataCy: {
72
+ type: String,
73
+ default: "",
74
+ },
75
+ });
76
+
77
+ const { stepperCircleAttrs, stepperCountAttrs, stepperGradientAttrs, stepperSvgAttrs } =
78
+ useAttrs(props);
79
+
80
+ const stepperColor = computed(() => {
81
+ return colors[props.color]
82
+ ? colors[props.color][500]
83
+ : GRAY_COLORS.includes(props.color)
84
+ ? colors[props.color][900]
85
+ : colors.zinc[900];
86
+ });
87
+ </script>
@@ -5,72 +5,49 @@ import defaultConfig from "../configs/default.config";
5
5
  import { computed } from "vue";
6
6
 
7
7
  export function useAttrs(props) {
8
- const { config, getAttrs, getColor, setColor } = useUI(defaultConfig, () => props.config);
9
- const { progress, indicator, step } = config.value;
8
+ const { config, getAttrs, getColor, setColor, isSystemKey } = useUI(
9
+ defaultConfig,
10
+ () => props.config,
11
+ );
12
+ const attrs = {};
10
13
 
11
- const cvaProgress = cva({
12
- base: progress.base,
13
- variants: progress.variants,
14
- compoundVariants: progress.compoundVariants,
15
- });
14
+ for (const key in defaultConfig) {
15
+ if (isSystemKey(key)) continue;
16
16
 
17
- const cvaIndicator = cva({
18
- base: indicator.base,
19
- variants: indicator.variants,
20
- compoundVariants: indicator.compoundVariants,
21
- });
17
+ let classes = "";
18
+ let value = config.value[key];
22
19
 
23
- const cvaStep = cva({
24
- base: step.base,
25
- variants: step.variants,
26
- compoundVariants: step.compoundVariants,
27
- });
20
+ const isVariants = value.variants || value.compoundVariants;
21
+ const excludeKeys = ["progress", "indicator", "step"];
28
22
 
29
- const progressClasses = computed(() =>
30
- setColor(
31
- cvaProgress({
32
- size: props.size,
33
- color: getColor(props.color),
34
- }),
35
- props.color,
36
- ),
37
- );
23
+ if (isVariants && !excludeKeys.includes(key)) {
24
+ const getCVA = cva(value);
38
25
 
39
- const indicatorClasses = computed(() =>
40
- setColor(
41
- cvaIndicator({
42
- size: props.size,
43
- color: getColor(props.color),
44
- }),
45
- props.color,
46
- ),
47
- );
26
+ classes = computed(() => getCVA({ ...props }));
27
+ }
48
28
 
49
- const stepClasses = computed(() =>
50
- setColor(
51
- cvaStep({
52
- size: props.size,
53
- color: getColor(props.color),
54
- }),
55
- props.color,
56
- ),
57
- );
29
+ if (isVariants && excludeKeys.includes(key)) {
30
+ const getCVA = cva(value);
31
+
32
+ classes = computed(() =>
33
+ setColor(getCVA({ ...props, color: getColor(props.color) }), props.color),
34
+ );
35
+ }
58
36
 
59
- const wrapperAttrs = getAttrs("wrapper");
60
- const indicatorAttrs = getAttrs("indicator", { classes: indicatorClasses });
61
- const progressAttrs = getAttrs("progress", { classes: progressClasses });
62
- const stepAttrsRaw = getAttrs("step", { classes: stepClasses });
37
+ if (key === "step") {
38
+ const stepAttrsRaw = getAttrs("step", { classes });
63
39
 
64
- const stepAttrs = computed(() => (classes) => ({
65
- ...stepAttrsRaw.value,
66
- class: cx([stepAttrsRaw.value.class, classes]),
67
- }));
40
+ attrs[`${key}Attrs`] = computed(() => (classes) => ({
41
+ ...stepAttrsRaw.value,
42
+ class: cx([stepAttrsRaw.value.class, classes]),
43
+ }));
44
+ } else {
45
+ attrs[`${key}Attrs`] = getAttrs(key, { classes });
46
+ }
47
+ }
68
48
 
69
49
  return {
70
- progressAttrs,
71
- wrapperAttrs,
72
- indicatorAttrs,
73
- stepAttrs,
50
+ ...attrs,
74
51
  config,
75
52
  };
76
53
  }
@@ -1,5 +1,31 @@
1
1
  export default /*tw*/ {
2
- wrapper: "w-full h-auto flex flex-col gap-1.5",
2
+ wrapper: {
3
+ base: "",
4
+ variants: {
5
+ variant: {
6
+ progress: "w-full h-auto flex flex-col gap-1.5",
7
+ stepper: "flex items-center justify-between",
8
+ },
9
+ },
10
+ },
11
+ stepper: {
12
+ base: "",
13
+ variants: {
14
+ size: {
15
+ "2xs": "h-8 w-8",
16
+ xs: "h-8 w-8",
17
+ sm: "h-10 w-10",
18
+ md: "h-12 w-12",
19
+ lg: "h-14 w-14",
20
+ xl: "h-16 w-16",
21
+ "2xl": "h-20 w-20",
22
+ },
23
+ },
24
+ },
25
+ stepperCircle: "stroke-current text-gray-100",
26
+ stepperCount: "text-xl font-bold text-gray-900 translate-y-2 transform",
27
+ stepperGradient: "",
28
+ stepperSvg: "",
3
29
  progress: {
4
30
  base: `
5
31
  text-{color}-500 w-full block appearance-none border-none overflow-hidden
@@ -35,6 +61,7 @@ export default /*tw*/ {
35
61
  grayscale: "text-gray-900",
36
62
  },
37
63
  size: {
64
+ "2xs": "text-xs",
38
65
  xs: "text-xs",
39
66
  sm: "text-sm",
40
67
  md: "text-md",
@@ -48,11 +75,16 @@ export default /*tw*/ {
48
75
  step: {
49
76
  base: "text-{color}-500 flex justify-end w-full transition",
50
77
  variants: {
78
+ variant: {
79
+ progress: "justify-end",
80
+ stepper: "justify-start",
81
+ },
51
82
  color: {
52
83
  white: "text-gray-200",
53
84
  grayscale: "text-gray-900",
54
85
  },
55
86
  size: {
87
+ "2xs": "text-xs",
56
88
  xs: "text-xs",
57
89
  sm: "text-sm",
58
90
  md: "text-md",
@@ -65,6 +97,7 @@ export default /*tw*/ {
65
97
  defaultVariants: {
66
98
  color: "brand",
67
99
  size: "md",
100
+ variant: "progress",
68
101
  indicator: false,
69
102
  },
70
103
  safelist: (colors) => [{ pattern: `text-(${colors})-500` }],
@@ -3,3 +3,8 @@
3
3
  `defineProps` is referencing locally declared variables. (vue/valid-define-props)
4
4
  */
5
5
  export const UProgress = "UProgress";
6
+
7
+ export const VARIANT = {
8
+ stepper: "stepper",
9
+ progress: "progress",
10
+ };
@@ -129,6 +129,9 @@ const SizesTemplate = (args, { argTypes } = {}) => ({
129
129
  export const Default = DefaultTemplate.bind({});
130
130
  Default.args = {};
131
131
 
132
+ export const Variant = StepsTemplate.bind({});
133
+ Variant.args = { variant: "stepper" };
134
+
132
135
  export const Indicator = DefaultTemplate.bind({});
133
136
  Indicator.args = { indicator: true };
134
137
 
@@ -1,12 +1,14 @@
1
1
  <template>
2
2
  <div v-bind="wrapperAttrs">
3
- <div v-if="indicator" v-bind="indicatorAttrs" :style="{ width: progressPercent }">
4
- <slot name="indicator" :percent="progressPercent" :value="value" :max="realMax">
5
- {{ progressPercent }}
6
- </slot>
7
- </div>
3
+ <template v-if="isVariant.progress">
4
+ <div v-if="indicator" v-bind="indicatorAttrs" :style="{ width: progressPercent }">
5
+ <slot name="indicator" :percent="progressPercent" :value="value" :max="realMax">
6
+ {{ progressPercent }}
7
+ </slot>
8
+ </div>
8
9
 
9
- <progress v-bind="progressAttrs" :max="realMax" :value="value" />
10
+ <progress v-bind="progressAttrs" :max="realMax" :value="value" />
11
+ </template>
10
12
 
11
13
  <div v-if="isSteps" v-bind="stepAttrs(!value && config.firstStep)">
12
14
  <template v-for="(step, index) in max" :key="index">
@@ -21,6 +23,16 @@
21
23
  </slot>
22
24
  </template>
23
25
  </div>
26
+
27
+ <StepperProgress
28
+ v-if="isVariant.stepper"
29
+ v-bind="stepperAttrs"
30
+ :color="color"
31
+ :max="realMax"
32
+ :value="value"
33
+ :data-cy="dataCy"
34
+ :progress-percent="progressPercent"
35
+ />
24
36
  </div>
25
37
  </template>
26
38
 
@@ -31,7 +43,9 @@ import UIService from "../service.ui";
31
43
  import { useAttrs } from "./composables/attrs.composable";
32
44
 
33
45
  import defaultConfig from "./configs/default.config";
34
- import { UProgress } from "./constants";
46
+ import { UProgress, VARIANT } from "./constants";
47
+
48
+ import StepperProgress from "./components/StepperProgress.vue";
35
49
 
36
50
  /* Should be a string for correct web-types gen */
37
51
  defineOptions({ name: "UProgress", inheritAttrs: false });
@@ -72,6 +86,15 @@ const props = defineProps({
72
86
  default: UIService.get(defaultConfig, UProgress).default.color,
73
87
  },
74
88
 
89
+ /**
90
+ * Progress variant.
91
+ * @values stepper, progress
92
+ */
93
+ variant: {
94
+ type: String,
95
+ default: UIService.get(defaultConfig, UProgress).default.variant,
96
+ },
97
+
75
98
  /**
76
99
  * Progress indicator visibility.
77
100
  */
@@ -79,9 +102,18 @@ const props = defineProps({
79
102
  type: Boolean,
80
103
  default: UIService.get(defaultConfig, UProgress).default.indicator,
81
104
  },
105
+
106
+ /**
107
+ * Sets data-cy attribute for automated testing.
108
+ */
109
+ dataCy: {
110
+ type: String,
111
+ default: "",
112
+ },
82
113
  });
83
114
 
84
- const { progressAttrs, wrapperAttrs, indicatorAttrs, stepAttrs, config } = useAttrs(props);
115
+ const { progressAttrs, wrapperAttrs, indicatorAttrs, stepAttrs, stepperAttrs, config } =
116
+ useAttrs(props);
85
117
 
86
118
  const isSteps = computed(() => Array.isArray(props.max));
87
119
 
@@ -93,7 +125,21 @@ const realMax = computed(() => {
93
125
  return Number(props.max);
94
126
  });
95
127
 
96
- const progressPercent = computed(() => `${(props.value / realMax.value) * 100}%`);
128
+ const isVariant = computed(() => ({
129
+ stepper: props.variant === VARIANT.stepper,
130
+ progress: props.variant === VARIANT.progress,
131
+ }));
132
+
133
+ const progressPercent = computed(() => {
134
+ const maxPercent = 100;
135
+ const currentPercent = (props.value / realMax.value) * maxPercent;
136
+
137
+ if (isVariant.value.progress) {
138
+ return `${currentPercent}%`;
139
+ }
140
+
141
+ return `${currentPercent} ${maxPercent}`;
142
+ });
97
143
 
98
144
  function isActiveStep(index) {
99
145
  return index + 1 == props.value;
@@ -4,54 +4,38 @@ import { cva } from "../../service.ui";
4
4
  import defaultConfig from "../configs/default.config";
5
5
  import { computed } from "vue";
6
6
 
7
- export function useAttrs(props) {
8
- const { config, getAttrs, hasSlotContent, getColor, setColor } = useUI(
7
+ export default function useAttrs(props) {
8
+ const { config, getAttrs, hasSlotContent, getColor, setColor, isSystemKey } = useUI(
9
9
  defaultConfig,
10
10
  () => props.config,
11
11
  );
12
- const { wrapper, body } = config.value;
13
-
14
- const cvaWrapper = cva({
15
- base: wrapper.base,
16
- variants: wrapper.variants,
17
- compoundVariants: wrapper.compoundVariants,
18
- });
19
-
20
- const cvaBody = cva({
21
- base: body.base,
22
- variants: body.variants,
23
- compoundVariants: body.compoundVariants,
24
- });
25
-
26
- const wrapperClasses = computed(() =>
27
- setColor(
28
- cvaWrapper({
29
- color: getColor(props.color),
30
- bordered: props.bordered,
31
- variant: props.variant,
32
- }),
33
- props.color,
34
- ),
35
- );
12
+ const attrs = {};
13
+
14
+ for (const key in defaultConfig) {
15
+ if (isSystemKey(key)) continue;
16
+
17
+ const classes = computed(() => {
18
+ const value = config.value[key];
36
19
 
37
- const bodyClasses = computed(() => setColor(cvaBody({ size: props.size }), props.color));
20
+ if (value.variants || value.compoundVariants) {
21
+ return setColor(
22
+ cva(value)({
23
+ ...props,
24
+ color: getColor(props.color),
25
+ }),
26
+ props.color,
27
+ );
28
+ }
38
29
 
39
- const wrapperAttrs = getAttrs("wrapper", { classes: wrapperClasses });
40
- const bodyAttrs = getAttrs("body", { classes: bodyClasses });
41
- const titleAttrs = getAttrs("title");
42
- const descriptionAttrs = getAttrs("description");
30
+ return "";
31
+ });
43
32
 
44
- const buttonAttrs = getAttrs("button", { isComponent: true });
45
- const iconAttrs = getAttrs("icon", { isComponent: true });
33
+ attrs[`${key}Attrs`] = getAttrs(key, { classes });
34
+ }
46
35
 
47
36
  return {
37
+ ...attrs,
48
38
  config,
49
- wrapperAttrs,
50
- bodyAttrs,
51
- buttonAttrs,
52
- iconAttrs,
53
39
  hasSlotContent,
54
- titleAttrs,
55
- descriptionAttrs,
56
40
  };
57
41
  }
@@ -17,7 +17,7 @@ export default /*tw*/ {
17
17
  base: `
18
18
  flex gap-2 items-baseline
19
19
  font-normal leading-normal
20
- [&_b]:font-bold [&_b]:font-bold [&_i]:italic [&_em]:italic [&_p]:font-normal
20
+ [&_b]:font-bold [&_i]:italic [&_em]:italic [&_p]:font-normal
21
21
  [&_a:not([class])]:underline [&_a:not([class])]:underline-offset-4
22
22
  [&_a:not([class]):hover]:no-underline [&_a:not([class])]:font-bold
23
23
  [&_ul]:font-normal [&_ol]:font-normal
@@ -36,8 +36,8 @@ export default /*tw*/ {
36
36
  },
37
37
  title: "font-bold text-lg leading-tight",
38
38
  description: "text-sm",
39
- button: "",
40
- icon: "",
39
+ button: "{UButton}",
40
+ icon: "{UIcon}",
41
41
  iconName: "close",
42
42
  defaultVariants: {
43
43
  variant: "thirdary",
@@ -1,20 +1,26 @@
1
1
  <template>
2
2
  <div v-if="isShownAlert" :data-cy="dataCy" v-bind="wrapperAttrs">
3
- <!-- @slot Use it to add something above text. -->
3
+ <!-- @slot Use it to add something above the text. -->
4
4
  <slot name="top" />
5
5
 
6
- <!-- Use it to add something instead of the title. -->
6
+ <!--
7
+ @slot Use it to add something instead of the title.
8
+ @binding {string} title
9
+ -->
7
10
  <slot name="title" :title="title">
8
11
  <div v-bind="titleAttrs" v-text="title" />
9
12
  </slot>
10
13
 
11
- <!-- @slot Use it to add something instead of the description. -->
14
+ <!--
15
+ @slot Use it to add something instead of the description.
16
+ @binding {string} description
17
+ -->
12
18
  <slot name="description" :description="description">
13
19
  <div v-bind="descriptionAttrs" v-text="description" />
14
20
  </slot>
15
21
 
16
22
  <div v-bind="bodyAttrs">
17
- <!-- @slot Use it to add something before text. -->
23
+ <!-- @slot Use it to add something before the text. -->
18
24
  <slot name="left" />
19
25
 
20
26
  <!-- @slot Default slot. -->
@@ -40,11 +46,11 @@
40
46
  />
41
47
  </UButton>
42
48
 
43
- <!-- @slot Use it to add something after text. -->
49
+ <!-- @slot Use it to add something after the text. -->
44
50
  <slot name="right" />
45
51
  </div>
46
52
 
47
- <!-- @slot Use it to add something under text. -->
53
+ <!-- @slot Use it to add something under the text. -->
48
54
  <slot name="bottom" />
49
55
  </div>
50
56
  </template>
@@ -58,7 +64,7 @@ import UIService from "../service.ui";
58
64
 
59
65
  import { UAlert } from "./constatns";
60
66
  import defaultConfig from "./configs/default.config";
61
- import { useAttrs } from "./composables/attrs.composable";
67
+ import useAttrs from "./composables/attrs.composable";
62
68
 
63
69
  /* Should be a string for correct web-types gen */
64
70
  defineOptions({ name: "UAlert" });
@@ -155,7 +161,12 @@ const props = defineProps({
155
161
  },
156
162
  });
157
163
 
158
- const emit = defineEmits(["hidden"]);
164
+ const emit = defineEmits([
165
+ /**
166
+ * Triggers when the alert is hidden.
167
+ */
168
+ "hidden",
169
+ ]);
159
170
 
160
171
  const isShownAlert = ref(true);
161
172