bonkers-ui 1.0.2 → 1.0.5

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 (71) hide show
  1. package/.storybook/preview.js +1 -2
  2. package/README.md +1 -1
  3. package/package.json +5 -5
  4. package/src/{_colors.json → _styles/classTypes/_colors.json} +2 -2
  5. package/src/{_font-sizes.json → _styles/classTypes/_font-sizes.json} +1 -1
  6. package/src/{_shadow.json → _styles/classTypes/_shadow.json} +1 -1
  7. package/src/{_spacing.json → _styles/classTypes/_spacing.json} +1 -0
  8. package/src/_styles/{colors.css → variables/colors.css} +0 -0
  9. package/src/_styles/{font-sizes.css → variables/font-sizes.css} +1 -1
  10. package/src/_styles/variables/shadow.css +8 -0
  11. package/src/_styles/{spacing.css → variables/spacing.css} +1 -0
  12. package/src/components/ui-badge/_typings.ts +11 -0
  13. package/src/components/ui-badge/index.ts +2 -0
  14. package/src/components/ui-badge/ui-badge.stories.ts +45 -0
  15. package/src/components/ui-badge/ui-badge.vue +59 -0
  16. package/src/components/ui-ber-rank/index.ts +1 -0
  17. package/src/components/ui-ber-rank/ui-ber-rank.stories.ts +34 -0
  18. package/src/components/ui-ber-rank/ui-ber-rank.vue +142 -0
  19. package/src/components/ui-button/index.ts +1 -0
  20. package/src/components/ui-button/ui-button.stories.ts +26 -5
  21. package/src/components/ui-button/ui-button.vue +34 -6
  22. package/src/components/ui-card-cta/ui-card-cta.stories.ts +3 -8
  23. package/src/components/ui-card-cta/ui-card-cta.vue +6 -11
  24. package/src/components/ui-card-result/index.ts +1 -0
  25. package/src/components/ui-card-result/ui-card-result.stories.ts +107 -0
  26. package/src/components/ui-card-result/ui-card-result.vue +70 -0
  27. package/src/components/ui-card-simple/ui-card-simple.stories.ts +1 -1
  28. package/src/components/ui-card-simple/ui-card-simple.vue +1 -1
  29. package/src/components/ui-checkbox/ui-checkbox.stories.ts +1 -1
  30. package/src/components/ui-checkbox/ui-checkbox.vue +1 -1
  31. package/src/components/ui-icon/ui-icon.stories.ts +2 -2
  32. package/src/components/ui-icon/ui-icon.vue +1 -1
  33. package/src/components/ui-input/_typings.ts +0 -2
  34. package/src/components/ui-input/ui-input.stories.ts +9 -3
  35. package/src/components/ui-input/ui-input.vue +49 -20
  36. package/src/components/ui-input-range/index.ts +1 -0
  37. package/src/components/ui-input-range/ui-input-range.stories.ts +48 -0
  38. package/src/components/ui-input-range/ui-input-range.vue +62 -0
  39. package/src/components/ui-list-item/index.ts +1 -0
  40. package/src/components/ui-list-item/ui-list-item.stories.ts +40 -0
  41. package/src/components/ui-list-item/ui-list-item.vue +29 -0
  42. package/src/components/ui-radio/ui-radio.stories.ts +8 -3
  43. package/src/components/ui-radio/ui-radio.vue +36 -3
  44. package/src/components/ui-radio-list-fancy/ui-radio-item/ui-radio-item.vue +4 -4
  45. package/src/components/ui-radio-list-fancy/ui-radio-list-fancy.stories.ts +1 -1
  46. package/src/components/ui-ripple/ui-ripple.stories.ts +1 -1
  47. package/src/components/ui-ripple/ui-ripple.vue +2 -2
  48. package/src/components/ui-select/index.ts +1 -0
  49. package/src/components/ui-select/ui-select.stories.ts +45 -0
  50. package/src/components/ui-select/ui-select.vue +68 -0
  51. package/src/components/ui-tabs/index.ts +1 -0
  52. package/src/components/ui-tabs/ui-tabs.stories.ts +32 -0
  53. package/src/components/ui-tabs/ui-tabs.vue +58 -0
  54. package/src/components/ui-toggle/index.ts +1 -0
  55. package/src/components/ui-toggle/ui-toggle.stories.ts +40 -0
  56. package/src/components/ui-toggle/ui-toggle.vue +92 -0
  57. package/src/components/ui-typography/_typings.ts +5 -31
  58. package/src/components/ui-typography/index.ts +1 -1
  59. package/src/components/ui-typography/ui-typography.stories.ts +7 -2
  60. package/src/components/ui-typography/ui-typography.vue +4 -3
  61. package/src/components/ui-verification-input/ui-verification-input.stories.ts +1 -2
  62. package/src/components/ui-verification-input/ui-verification-input.vue +2 -2
  63. package/src/main.css +6 -5
  64. package/src/stories/colors/ui-colors.vue +1 -1
  65. package/src/stories/font-sizes/font-sizes.stories.ts +13 -0
  66. package/src/stories/font-sizes/ui-font-sizes.vue +28 -0
  67. package/src/stories/spacings/ui-spacings.vue +2 -2
  68. package/tailwind.config.js +4 -4
  69. package/tsconfig.json +4 -1
  70. package/vite.config.ts +5 -3
  71. package/src/_styles/shadow.css +0 -7
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <label
3
- class="ui-radio-item block p-sm border border-secondary-alt rounded-2xl hover:border-primary hover:text-primary cursor-pointer"
3
+ class="ui-radio-item block p-sm border border-secondary-alt rounded-2xl hover:border-primary cursor-pointer"
4
4
  :class="[
5
5
  isActive && 'bg-primary text-white pointer-events-none',
6
6
  ]"
@@ -12,7 +12,7 @@
12
12
  :name="name"
13
13
  :value="value"
14
14
  class="appearance-none absolute"
15
- @input="$emit('update:modelValue', $event.target.value)"
15
+ @input="$emit('update:modelValue', ($event.target as HTMLTextAreaElement)?.value)"
16
16
  >
17
17
 
18
18
  <ui-icon
@@ -33,11 +33,11 @@
33
33
  <script lang="ts" setup>
34
34
  import { computed, ref, watch } from "vue";
35
35
  import UiTypography, { ETypographySizes, ETextWeight } from "../../ui-typography";
36
- import UiIcon, { TIconName } from "../../ui-icon";
36
+ import UiIcon, { type TIconName } from "../../ui-icon";
37
37
  import { ESize } from "../../../_types/sizing";
38
38
  import { EColors } from "../../../_types/colors";
39
39
 
40
- const props = defineProps< {
40
+ const props = defineProps<{
41
41
  className?: string;
42
42
  modelValue: string;
43
43
  name: string;
@@ -1,6 +1,6 @@
1
1
  import { ref } from "vue";
2
2
  import UiRadioFancy from "./ui-radio-list-fancy.vue";
3
- import { Story } from "@storybook/vue3";
3
+ import type { Story } from "@storybook/vue3";
4
4
 
5
5
  export default {
6
6
  title: "Components/ui-radio-list-fancy",
@@ -2,7 +2,7 @@ import UiRipple from "./ui-ripple.vue";
2
2
  import UiButton from "../ui-button";
3
3
  import UiTypography from "../ui-typography";
4
4
 
5
- import { Story } from "@storybook/vue3";
5
+ import type { Story } from "@storybook/vue3";
6
6
 
7
7
  export default {
8
8
  title: "Components/ui-ripple",
@@ -30,11 +30,11 @@
30
30
  </template>
31
31
 
32
32
  <script lang="ts" setup>
33
- import { ref } from "vue";
33
+ import { ref, type VNodeRef } from "vue";
34
34
 
35
35
  const ripples = ref<{x:number, y:number, id:string}[]>([]);
36
36
  const tiBtn = ref<HTMLDivElement>();
37
- const inputsRefs = ref<Array<HTMLSpanElement | null>>([]);
37
+ const inputsRefs = ref<VNodeRef>();
38
38
 
39
39
  defineProps<{
40
40
  className?: string;
@@ -0,0 +1 @@
1
+ export { default } from "./ui-select.vue";
@@ -0,0 +1,45 @@
1
+ import UiSelect from "./ui-select.vue";
2
+ import type { Story } from "@storybook/vue3";
3
+ import { ref } from "vue";
4
+
5
+ export default {
6
+ title: "Components/ui-select",
7
+ component: UiSelect,
8
+ argTypes: {
9
+ className: {
10
+ control: { type: "text" },
11
+ description: "The Element classes",
12
+ },
13
+ disabled: {
14
+ control: { type: "boolean" },
15
+ description: "The Element disabled state",
16
+ }
17
+ },
18
+ args: {
19
+ slot: "default text",
20
+ disabled: false,
21
+ },
22
+ };
23
+
24
+ type TComponentProps = InstanceType<typeof UiSelect>["$props"];
25
+
26
+ const Template: Story<TComponentProps> = (args) => ({
27
+ components: { UiSelect },
28
+ setup() {
29
+ const list = ["Option 1", "Option 2", "Option 3"];
30
+ const valueModel = ref(list[0]);
31
+ return { args, valueModel, list };
32
+ },
33
+ template: `
34
+ <ui-select v-bind="args" :list="list" v-model:value="valueModel" heading="heading" subLabel="subLabel">
35
+ {{ args.slot }}
36
+ <template #postfix-icon>
37
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
38
+ <path d="M13.25 6.8125L8.5 11.2812C8.34375 11.4375 8.15625 11.5 8 11.5C7.8125 11.5 7.625 11.4375 7.46875 11.3125L2.71875 6.8125C2.40625 6.53125 2.40625 6.0625 2.6875 5.75C2.96875 5.4375 3.4375 5.4375 3.75 5.71875L8 9.71875L12.2188 5.71875C12.5312 5.4375 13 5.4375 13.2812 5.75C13.5625 6.0625 13.5625 6.53125 13.25 6.8125Z" fill="currentColor"/>
39
+ </svg>
40
+ </template>
41
+ </ui-select>
42
+ `,
43
+ });
44
+
45
+ export const Default = Template.bind({});
@@ -0,0 +1,68 @@
1
+ <template>
2
+ <div class="ui-select">
3
+ <ui-typography
4
+ v-if="heading"
5
+ :weight="ETextWeight.SEMI_BOLD"
6
+ class-name="mb-sm"
7
+ >
8
+ {{ heading }}
9
+ </ui-typography>
10
+ <div
11
+ class="relative rounded-lg border bg-white border-secondary-alt-500 hover:border-secondary-alt-700"
12
+ :class="[disabled && 'pointer-events-none bg-secondary-alt-200 border-secondary-alt-300']"
13
+ >
14
+ <select
15
+ v-model="localModel"
16
+ class="appearance-none bg-transparent border-0 m-0 outline-0 w-full p-sm cursor-pointer italic text-secondary-alt"
17
+ @change=" $emit('update:value', ($event.target as HTMLTextAreaElement)?.value)"
18
+ >
19
+ <option
20
+ v-for="item in list"
21
+ :key="item"
22
+ :value="item"
23
+ >
24
+ {{ item }}
25
+ </option>
26
+ </select>
27
+
28
+ <div class="ui-select__icon-wrapper absolute right-sm">
29
+ <slot name="postfix-icon" />
30
+ </div>
31
+ </div>
32
+ <ui-typography
33
+ v-if="subLabel"
34
+ :size="ETypographySizes.SM"
35
+ class-name="mt-sm"
36
+ >
37
+ {{ subLabel }}
38
+ </ui-typography>
39
+ </div>
40
+ </template>
41
+
42
+ <script lang="ts" setup>
43
+ import { ref, watch } from "vue";
44
+ import UiTypography, { ETypographySizes, ETextWeight } from "../ui-typography";
45
+
46
+ const props = defineProps<{
47
+ list: string[];
48
+ value: string;
49
+ heading?: string;
50
+ subLabel?: string;
51
+ disabled?: boolean;
52
+ }>();
53
+
54
+ defineEmits(["update:value"]);
55
+
56
+ const localModel = ref(props.value);
57
+
58
+ watch(() => props.value, (value) => {
59
+ localModel.value = value;
60
+ });
61
+ </script>
62
+
63
+ <style scoped>
64
+ .ui-select__icon-wrapper {
65
+ top: 50%;
66
+ transform: translateY(-50%);
67
+ }
68
+ </style>
@@ -0,0 +1 @@
1
+ export { default } from "./ui-tabs.vue";
@@ -0,0 +1,32 @@
1
+ import { ref } from "vue";
2
+ import UiTabs from "./ui-tabs.vue";
3
+ import type { Story } from "@storybook/vue3";
4
+
5
+ export default {
6
+ title: "Components/ui-tabs",
7
+ component: UiTabs,
8
+ argTypes: {
9
+ className: {
10
+ control: { type: "text" },
11
+ description: "The Element classes",
12
+ },
13
+ },
14
+ };
15
+
16
+ type TComponentProps = InstanceType<typeof UiTabs>["$props"];
17
+
18
+ const Template: Story<TComponentProps> = (args) => ({
19
+ components: { UiTabs },
20
+ setup() {
21
+ const value = ref("Tab1");
22
+ const value2 = ref("Tab1");
23
+ return { args, value, value2 };
24
+ },
25
+ template: `
26
+ <ui-tabs v-bind="args" :tabs="['Tab1', 'Tab2', 'Tab3']" v-model:modelValue="value" />
27
+ <br/>
28
+ <ui-tabs v-bind="args" :tabs="['Tab1', 'Tab2']" v-model:modelValue="value2" />
29
+ `,
30
+ });
31
+
32
+ export const Default = Template.bind({});
@@ -0,0 +1,58 @@
1
+ <template>
2
+ <ul class="ui-tabs bg-secondary-alt-200 rounded-full grid grid-flow-col">
3
+ <li
4
+ v-for="tab in tabs"
5
+ :key="tab"
6
+ class="rounded-full text-center"
7
+ :class="[localValue === tab && 'bg-white']"
8
+ >
9
+ <label class="block cursor-pointer py-xs px-md">
10
+ <input
11
+ v-model="localValue"
12
+ type="radio"
13
+ class="appearance-none"
14
+ :value="tab"
15
+ :name="name || 'default'"
16
+ @input="$emit('update:modelValue', ($event.target as HTMLTextAreaElement)?.value)"
17
+ >
18
+ <ui-typography
19
+ is="span"
20
+ :size="ETypographySizes.XS"
21
+ :kind="localValue === tab?EColors.SECONDARY_500:EColors.SECONDARY_400"
22
+ :weight="ETextWeight.SEMI_BOLD"
23
+ >
24
+ {{ tab }}
25
+ </ui-typography>
26
+ </label>
27
+ </li>
28
+ </ul>
29
+ </template>
30
+
31
+ <script lang="ts" setup>
32
+ import { ref, watch } from "vue";
33
+ import UiTypography, { ETypographySizes, ETextWeight } from "../ui-typography";
34
+ import { EColors } from "../../_types/colors";
35
+
36
+ const props = defineProps<{
37
+ tabs: string[];
38
+ modelValue: string;
39
+ name: string;
40
+ }>();
41
+
42
+ defineEmits(["update:modelValue"]);
43
+
44
+ const localValue = ref(props.modelValue);
45
+
46
+ watch(() => props.modelValue, (newValue) => {
47
+ if(newValue !== localValue.value){
48
+ localValue.value = newValue;
49
+ }
50
+ });
51
+
52
+ </script>
53
+
54
+ <style scoped>
55
+ .ui-tabs {
56
+ padding: 2px;
57
+ }
58
+ </style>
@@ -0,0 +1 @@
1
+ export { default } from "./ui-toggle.vue";
@@ -0,0 +1,40 @@
1
+ import UiToggle from "./ui-toggle.vue";
2
+ import type { Story } from "@storybook/vue3";
3
+ import { ref } from "vue";
4
+
5
+ export default {
6
+ title: "Components/ui-toggle",
7
+ component: UiToggle,
8
+ argTypes: {
9
+ className: {
10
+ control: { type: "text" },
11
+ description: "The Element classes",
12
+ },
13
+ disabled: {
14
+ control: { type: "boolean" },
15
+ description: "The Element disabled state",
16
+ }
17
+ },
18
+ args: {
19
+ slot: "default text",
20
+ disabled: false,
21
+ },
22
+ };
23
+
24
+ type TComponentProps = InstanceType<typeof UiToggle>["$props"];
25
+
26
+ const Template: Story<TComponentProps> = (args) => ({
27
+ components: { UiToggle },
28
+ setup() {
29
+ const modelValue = ref(false);
30
+
31
+ return { args, modelValue };
32
+ },
33
+ template: `
34
+ <ui-toggle v-bind="args" v-model:model-value="modelValue">
35
+ {{ args.slot }}
36
+ </ui-toggle>
37
+ `,
38
+ });
39
+
40
+ export const Default = Template.bind({});
@@ -0,0 +1,92 @@
1
+ <template>
2
+ <label
3
+ class="ui-toggle rounded-full cursor-pointer"
4
+ :class="className"
5
+ >
6
+ <span class="ui-input__input-wrapper block w-lg h-md relative">
7
+ <input
8
+ type="checkbox"
9
+ class="appearance-none absolute w-0 h-0 border-0"
10
+ :checked="modelValue"
11
+ @input="$emit('update:modelValue', !!($event.target as HTMLInputElement)?.value)"
12
+ >
13
+
14
+ <span class="ui-toggle__bg-block bg-secondary-alt block w-full h-full rounded-full" />
15
+ <span class="ui-toggle__dot block bg-white absolute top-0 rounded-full">
16
+ <svg
17
+ class="ui-toggle__check-icon text-primary absolute"
18
+ width="16"
19
+ height="12"
20
+ viewBox="0 0 16 12"
21
+ fill="none"
22
+ xmlns="http://www.w3.org/2000/svg"
23
+ >
24
+ <path
25
+ d="M1 4.40106L6.60071 10.1135L15.1694 1.71245"
26
+ stroke="currentColor"
27
+ stroke-width="1.6"
28
+ stroke-linecap="round"
29
+ />
30
+ </svg>
31
+ </span>
32
+ </span>
33
+ </label>
34
+ </template>
35
+
36
+ <script lang="ts" setup>
37
+ defineProps<{
38
+ className?: string;
39
+ modelValue: boolean;
40
+ }>();
41
+
42
+ defineEmits<{
43
+ (e: "update:modelValue", state: boolean): void
44
+ }>();
45
+ </script>
46
+
47
+ <style scoped>
48
+ .ui-toggle__dot {
49
+ top: 50%;
50
+ width: 22px;
51
+ height: 22px;
52
+ transform: translate3d(1px, -50%, 0);
53
+ transition: transform 0.2s ease-in-out;
54
+ }
55
+
56
+ .ui-toggle__check-icon {
57
+ top: 50%;
58
+ left: 50%;
59
+ transform: translate3d(-50%, -50%, 0);
60
+ stroke-dasharray: 70;
61
+ stroke-dashoffset: 70;
62
+ transition: stroke-dashoffset 0.2s ease-in-out;
63
+ }
64
+
65
+ .ui-toggle:hover .ui-toggle__dot,
66
+ .ui-toggle:active .ui-toggle__dot,
67
+ .ui-toggle:focus .ui-toggle__dot {
68
+ box-shadow: var(--shadow-border-secondary);
69
+ }
70
+
71
+ .ui-toggle input:checked ~ .ui-toggle__dot {
72
+ transform: translate3d(calc(var(--lg) - 100% - 1px), -50%, 0);
73
+ }
74
+
75
+ .ui-toggle:hover input:checked ~ .ui-toggle__dot,
76
+ .ui-toggle:active input:checked ~ .ui-toggle__dot,
77
+ .ui-toggle:focus input:checked ~ .ui-toggle__dot {
78
+ box-shadow: var(--shadow-border-primary);
79
+ }
80
+
81
+ .ui-toggle__bg-block {
82
+ transition: background-color 0.2s ease-in-out;
83
+ }
84
+
85
+ .ui-toggle input:checked ~ .ui-toggle__bg-block {
86
+ background-color: var(--color-primary);
87
+ }
88
+
89
+ .ui-toggle input:checked ~ .ui-toggle__dot .ui-toggle__check-icon {
90
+ stroke-dashoffset: 0;
91
+ }
92
+ </style>
@@ -2,7 +2,7 @@ export enum ETypographySizes {
2
2
  XXS = "xxs",
3
3
  XS = "xs",
4
4
  SM = "sm",
5
- M = "m",
5
+ MD = "m",
6
6
  LG = "lg",
7
7
  XL = "xl",
8
8
  XXL = "2xl",
@@ -11,37 +11,11 @@ export enum ETypographySizes {
11
11
  XXXXXL = "5xl",
12
12
  }
13
13
 
14
- export enum ETypographyColors {
15
- PRIMARY = "primary",
16
- PRIMARY_300 = "primary-300",
17
- PRIMARY_400 = "primary-400",
18
- PRIMARY_600 = "primary-600",
19
- PRIMARY_700 = "primary-700",
20
-
21
- SECONDARY = "secondary",
22
- SECONDARY_300 = "secondary-300",
23
- SECONDARY_400 = "secondary-400",
24
- SECONDARY_600 = "secondary-600",
25
- SECONDARY_700 = "secondary-700",
26
-
27
- ERROR = "error",
28
- ERROR_300 = "error-300",
29
- ERROR_400 = "error-400",
30
- ERROR_600 = "error-600",
31
- ERROR_700 = "error-700",
32
-
33
- WARNING = "warning",
34
- WARNING_300 = "warning-300",
35
- WARNING_400 = "warning-400",
36
- WARNING_600 = "warning-600",
37
- WARNING_700 = "warning-700",
38
- }
39
-
40
14
  export enum ETextWeight {
41
- LIGHT = "light",
42
- REGULAR = "regular",
43
- SEMI_BOLD = "semi_bold",
44
- BOLD = "bold",
15
+ LIGHT = "light", // 300
16
+ REGULAR = "regular", // 400
17
+ SEMI_BOLD = "semi_bold", // 600
18
+ BOLD = "bold", // 900
45
19
  }
46
20
 
47
21
  export enum ETextAlign {
@@ -1,2 +1,2 @@
1
1
  export { default } from "./ui-typography.vue";
2
- export { ETypographySizes, ETextWeight, ETextAlign } from "./_typings";
2
+ export { ETypographySizes, ETextWeight, ETextAlign, ETextTransform } from "./_typings";
@@ -1,6 +1,6 @@
1
1
  import { ETypographySizes, ETextWeight, ETextAlign, ETextTransform } from "./_typings";
2
2
  import UiTypography from "./ui-typography.vue";
3
- import { Story } from "@storybook/vue3";
3
+ import type { Story } from "@storybook/vue3";
4
4
  import { EColors } from "../../_types/colors";
5
5
 
6
6
  export default {
@@ -40,6 +40,10 @@ export default {
40
40
  control: { type: "boolean" },
41
41
  description: "The Element line height 1.6",
42
42
  },
43
+ underline: {
44
+ control: { type: "boolean" },
45
+ description: "The Element underline",
46
+ },
43
47
  size: {
44
48
  control: { type: "select" },
45
49
  options: Object.values(ETypographySizes),
@@ -48,6 +52,7 @@ export default {
48
52
  },
49
53
  args: {
50
54
  slot: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
55
+ underline: false
51
56
  },
52
57
  };
53
58
 
@@ -71,7 +76,7 @@ const Template: Story<TComponentProps> = (args) => ({
71
76
  export const Default = Template.bind({});
72
77
 
73
78
  Default.args = {
74
- size: ETypographySizes.M,
79
+ size: ETypographySizes.MD,
75
80
  weight: ETextWeight.REGULAR,
76
81
  align: ETextAlign.LEFT,
77
82
  lineHeight: true,
@@ -4,7 +4,7 @@
4
4
  class="ui-typography"
5
5
  :class="[
6
6
  'leading-none',
7
- (!size || size === ETypographySizes.M) && 'text-m',
7
+ (!size || size === ETypographySizes.MD) && 'text-md',
8
8
  size === ETypographySizes.XXS && 'text-xxs',
9
9
  size === ETypographySizes.XS && 'text-xs',
10
10
  size === ETypographySizes.SM && 'text-sm',
@@ -85,6 +85,7 @@
85
85
  textTransform === ETextTransform.UPPERCASE && 'uppercase',
86
86
 
87
87
  lineHeight && 'ui-typography_line-height',
88
+ underline && 'underline',
88
89
 
89
90
  className
90
91
  ]"
@@ -94,7 +95,6 @@
94
95
  </template>
95
96
 
96
97
  <script lang="ts" setup>
97
- import type { Component } from "vue";
98
98
  import { ETextAlign, ETextTransform, ETextWeight, ETypographySizes } from "./_typings";
99
99
  import { EColors } from "../../_types/colors";
100
100
 
@@ -106,7 +106,8 @@
106
106
  weight?: ETextWeight;
107
107
  lineHeight?: boolean;
108
108
  textTransform?: ETextTransform;
109
- is?: string | Component;
109
+ underline?: boolean;
110
+ is?: string;
110
111
  }>();
111
112
  </script>
112
113
 
@@ -1,5 +1,4 @@
1
1
  import UiVerificationInput from "./ui-verification-input.vue";
2
- import { Story } from "@storybook/vue3";
3
2
 
4
3
  export default {
5
4
  title: "Components/ui-verification-input",
@@ -28,7 +27,7 @@ export default {
28
27
 
29
28
  type MyComponentProps = InstanceType<typeof UiVerificationInput>["$props"];
30
29
 
31
- const Template: Story<MyComponentProps> = (args: MyComponentProps) => ({
30
+ const Template = (args: MyComponentProps) => ({
32
31
  components:{
33
32
  UiVerificationInput
34
33
  },
@@ -42,7 +42,7 @@
42
42
  emit("onFiled", generateString);
43
43
  };
44
44
 
45
- const inputHandler = (event:InputEvent, index:number)=>{
45
+ const inputHandler = (event:Event, index:number)=>{
46
46
  if(index < props.inputsCount){
47
47
  inputsRefs.value[index + 1]?.focus();
48
48
  }
@@ -52,7 +52,7 @@
52
52
  }
53
53
  };
54
54
 
55
- const focusHandler = (e:InputEvent) => {
55
+ const focusHandler = (e:FocusEvent) => {
56
56
  if(e.target){
57
57
  (e.target as HTMLInputElement).select();
58
58
  }
package/src/main.css CHANGED
@@ -1,7 +1,7 @@
1
- @import "./_styles/colors.css";
2
- @import "./_styles/spacing.css";
3
- @import "./_styles/font-sizes.css";
4
- @import "./_styles/shadow.css";
1
+ @import "_styles/variables/colors.css";
2
+ @import "_styles/variables/spacing.css";
3
+ @import "_styles/variables/font-sizes.css";
4
+ @import "_styles/variables/shadow.css";
5
5
 
6
6
  @tailwind base;
7
7
  @tailwind components;
@@ -11,9 +11,10 @@
11
11
  :root {
12
12
  /* text */
13
13
  --base-line-height: 1.6;
14
+ --base-font: museo-sans, sans-serif;
14
15
  }
15
16
  }
16
17
 
17
18
  body {
18
- font-family: museo-sans, sans-serif;
19
+ font-family: var(--base-font);
19
20
  }
@@ -62,7 +62,7 @@
62
62
  </template>
63
63
 
64
64
  <script lang="ts" setup>
65
- import colors from "../../_colors.json";
65
+ import colors from "../../_styles/classTypes/_colors.json";
66
66
  import { getCssVariableValue } from "../helper";
67
67
  </script>
68
68
 
@@ -0,0 +1,13 @@
1
+ import UiFontSizes from "./ui-font-sizes.vue";
2
+
3
+ export default {
4
+ title: "Example/FontSizes",
5
+ component: UiFontSizes,
6
+ };
7
+
8
+ const Template = () => ({
9
+ components: { UiFontSizes },
10
+ template: `<ui-font-sizes/>`,
11
+ });
12
+
13
+ export const FontSizes = Template();
@@ -0,0 +1,28 @@
1
+ <template>
2
+ <div class="ui-font-sizes flex flex-row flex-wrap gap-md">
3
+ <p
4
+ v-for="(value, key) in fontSizes"
5
+ :key="key"
6
+ class="p-md"
7
+ :style="{fontSize: value}"
8
+ >
9
+ {{ getCssVariableValue(value) }}
10
+ <br>
11
+ <br>
12
+ {{ key }}
13
+ <br>
14
+ {{ value }}
15
+ </p>
16
+ </div>
17
+ </template>
18
+
19
+ <script lang="ts" setup>
20
+ import fontSizes from "../../_styles/classTypes/_font-sizes.json";
21
+ import { getCssVariableValue } from "../helper";
22
+ </script>
23
+
24
+ <style>
25
+ .ui-font-sizes p {
26
+ border: 1px solid #ccc;
27
+ }
28
+ </style>
@@ -35,10 +35,10 @@
35
35
  </template>
36
36
 
37
37
  <script lang="ts" setup>
38
- import spacings from "../../_spacing.json";
38
+ import spacings from "../../_styles/classTypes/_spacing.json";
39
39
  import { getCssVariableValue } from "../helper";
40
40
 
41
- const spacingKeys = Object.keys(spacings);
41
+ const spacingKeys = Object.keys(spacings) as Array<keyof typeof spacings>;
42
42
 
43
43
  </script>
44
44
 
@@ -1,7 +1,7 @@
1
- const colors = require("./src/_colors.json");
2
- const fontSize = require("./src/_font-sizes.json");
3
- const spacing = require("./src/_spacing.json");
4
- const boxShadow = require("./src/_shadow.json");
1
+ const colors = require("./src/_styles/classTypes/_colors.json");
2
+ const fontSize = require("./src/_styles/classTypes/_font-sizes.json");
3
+ const spacing = require("./src/_styles/classTypes/_spacing.json");
4
+ const boxShadow = require("./src/_styles/classTypes/_shadow.json");
5
5
 
6
6
  module.exports = {
7
7
  darkMode: "class",