bonkers-ui 1.0.4 → 1.0.7

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/package.json +1 -1
  3. package/src/{_colors.json → _styles/classTypes/_colors.json} +2 -2
  4. package/src/{_font-sizes.json → _styles/classTypes/_font-sizes.json} +1 -1
  5. package/src/{_shadow.json → _styles/classTypes/_shadow.json} +1 -1
  6. package/src/{_spacing.json → _styles/classTypes/_spacing.json} +1 -0
  7. package/src/_styles/{colors.css → variables/colors.css} +0 -0
  8. package/src/_styles/{font-sizes.css → variables/font-sizes.css} +1 -1
  9. package/src/_styles/variables/shadow.css +8 -0
  10. package/src/_styles/{spacing.css → variables/spacing.css} +1 -0
  11. package/src/components/ui-badge/_typings.ts +11 -0
  12. package/src/components/ui-badge/index.ts +2 -0
  13. package/src/components/ui-badge/ui-badge.stories.ts +41 -0
  14. package/src/components/ui-badge/ui-badge.vue +57 -0
  15. package/src/components/ui-ber-rank/index.ts +1 -0
  16. package/src/components/ui-ber-rank/ui-ber-rank.stories.ts +30 -0
  17. package/src/components/ui-ber-rank/ui-ber-rank.vue +142 -0
  18. package/src/components/ui-button/ui-button.stories.ts +27 -13
  19. package/src/components/ui-button/ui-button.test.ts +5 -3
  20. package/src/components/ui-button/ui-button.vue +34 -8
  21. package/src/components/ui-card-cta/ui-card-cta.stories.ts +3 -13
  22. package/src/components/ui-card-cta/ui-card-cta.vue +3 -10
  23. package/src/components/ui-card-result/index.ts +1 -0
  24. package/src/components/ui-card-result/ui-card-result.stories.ts +103 -0
  25. package/src/components/ui-card-result/ui-card-result.vue +70 -0
  26. package/src/components/ui-card-simple/ui-card-simple.stories.ts +2 -8
  27. package/src/components/ui-card-simple/ui-card-simple.vue +1 -6
  28. package/src/components/ui-checkbox/ui-checkbox.stories.ts +1 -5
  29. package/src/components/ui-checkbox/ui-checkbox.vue +0 -2
  30. package/src/components/ui-icon/_typings.ts +9 -2
  31. package/src/components/ui-icon/ui-icon.stories.ts +2 -6
  32. package/src/components/ui-icon/ui-icon.vue +0 -2
  33. package/src/components/ui-input/_typings.ts +0 -2
  34. package/src/components/ui-input/ui-input.stories.ts +9 -7
  35. package/src/components/ui-input/ui-input.vue +48 -21
  36. package/src/components/ui-input-range/index.ts +1 -0
  37. package/src/components/ui-input-range/ui-input-range.stories.ts +44 -0
  38. package/src/components/ui-input-range/ui-input-range.vue +60 -0
  39. package/src/components/ui-list-item/index.ts +1 -0
  40. package/src/components/ui-list-item/ui-list-item.stories.ts +35 -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 -7
  43. package/src/components/ui-radio/ui-radio.vue +35 -4
  44. package/src/components/ui-radio-list-fancy/ui-radio-item/ui-radio-item.vue +3 -4
  45. package/src/components/ui-radio-list-fancy/ui-radio-list-fancy.stories.ts +2 -8
  46. package/src/components/ui-radio-list-fancy/ui-radio-list-fancy.vue +5 -6
  47. package/src/components/ui-ripple/ui-ripple.stories.ts +3 -8
  48. package/src/components/ui-ripple/ui-ripple.vue +0 -5
  49. package/src/components/ui-select/index.ts +1 -0
  50. package/src/components/ui-select/ui-select.stories.ts +41 -0
  51. package/src/components/ui-select/ui-select.vue +68 -0
  52. package/src/components/ui-tabs/index.ts +1 -0
  53. package/src/components/ui-tabs/ui-tabs.stories.ts +27 -0
  54. package/src/components/ui-tabs/ui-tabs.vue +58 -0
  55. package/src/components/ui-toggle/index.ts +1 -0
  56. package/src/components/ui-toggle/ui-toggle.stories.ts +39 -0
  57. package/src/components/ui-toggle/ui-toggle.vue +127 -0
  58. package/src/components/ui-typography/_typings.ts +5 -31
  59. package/src/components/ui-typography/index.ts +1 -1
  60. package/src/components/ui-typography/ui-typography.stories.ts +7 -6
  61. package/src/components/ui-typography/ui-typography.vue +4 -6
  62. package/src/components/ui-verification-input/ui-verification-input.stories.ts +1 -6
  63. package/src/components/ui-verification-input/ui-verification-input.vue +0 -2
  64. package/src/main.css +6 -5
  65. package/src/stories/colors/ui-colors.vue +1 -1
  66. package/src/stories/font-sizes/font-sizes.stories.ts +13 -0
  67. package/src/stories/font-sizes/ui-font-sizes.vue +28 -0
  68. package/src/stories/spacings/ui-spacings.vue +1 -1
  69. package/tailwind.config.js +4 -4
  70. package/vite.config.ts +5 -3
  71. package/src/_styles/shadow.css +0 -7
@@ -6,11 +6,10 @@ import { library } from '@fortawesome/fontawesome-svg-core';
6
6
  import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
7
7
 
8
8
  /* import specific icons */
9
- import { faUserSecret } from '@fortawesome/free-solid-svg-icons';
10
9
  import { faFaceSmile } from '@fortawesome/free-regular-svg-icons';
11
10
 
12
11
  /* add icons to the library */
13
- library.add(faUserSecret, faFaceSmile);
12
+ library.add(faFaceSmile);
14
13
 
15
14
  import '../src/main.css';
16
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bonkers-ui",
3
- "version": "1.0.4",
3
+ "version": "1.0.7",
4
4
  "scripts": {
5
5
  "storybook": "start-storybook -p 6006",
6
6
  "build-storybook": "build-storybook",
@@ -56,8 +56,8 @@
56
56
  "700": "var(--color-accent-700)"
57
57
  },
58
58
  "accent-alt": {
59
- "DEFAULT": "var(--color-accent)",
60
- "500": "var(--color-accent-500)"
59
+ "DEFAULT": "var(--color-accent-alt)",
60
+ "500": "var(--color-accent-alt-500)"
61
61
  },
62
62
  "secondary-alt": {
63
63
  "DEFAULT": "var(--color-secondary-alt)",
@@ -2,7 +2,7 @@
2
2
  "xxs": "var(--font-size-xxs)",
3
3
  "xs": "var(--font-size-xs)",
4
4
  "sm": "var(--font-size-sm)",
5
- "m": "var(--font-size-m)",
5
+ "md": "var(--font-size-md)",
6
6
  "lg": "var(--font-size-lg)",
7
7
  "xl": "var(--font-size-xl)",
8
8
  "2xl": "var(--font-size-2xl)",
@@ -1,4 +1,4 @@
1
1
  {
2
- "m": "var(--shadow-size-m)",
2
+ "md": "var(--shadow-size-md)",
3
3
  "border-primary": "var(--shadow-border-primary)"
4
4
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "0": "var(--zero)",
2
3
  "xxs": "var(--xxs)",
3
4
  "xs": "var(--xs)",
4
5
  "sm": "var(--sm)",
File without changes
@@ -4,7 +4,7 @@
4
4
  --font-size-xxs: 10px;
5
5
  --font-size-xs: 12px;
6
6
  --font-size-sm: 14px;
7
- --font-size-m: 16px;
7
+ --font-size-md: 16px;
8
8
  --font-size-lg: 18px;
9
9
  --font-size-xl: 20px;
10
10
  --font-size-2xl: 24px;
@@ -0,0 +1,8 @@
1
+ @layer base {
2
+ :root {
3
+ /* shadow sizes */
4
+ --shadow-size-md: 0 2px 4px 0 rgb(180 184 205 / 50%);
5
+ --shadow-border-primary: 0 0 0 4px rgb(69 158 74 / 50%);
6
+ --shadow-border-secondary: 0 0 0 4px rgb(223 225 233 / 50%);
7
+ }
8
+ }
@@ -1,6 +1,7 @@
1
1
  @layer base {
2
2
  :root {
3
3
  /* spacing */
4
+ --zero: 0;
4
5
  --xxs: 4px;
5
6
  --xs: 8px;
6
7
  --sm: 16px;
@@ -0,0 +1,11 @@
1
+ export enum EBadgeSize {
2
+ SMALL = "small",
3
+ MEDIUM = "medium",
4
+ LARGE = "large",
5
+ }
6
+
7
+ export enum EBadgeKind {
8
+ PRIMARY = "primary",
9
+ ERROR = "error",
10
+ ACCENT = "accent",
11
+ }
@@ -0,0 +1,2 @@
1
+ export { default } from "./ui-badge.vue";
2
+ export { EBadgeKind, EBadgeSize } from "./_typings";
@@ -0,0 +1,41 @@
1
+ import UiBadge from "./ui-badge.vue";
2
+ import type { Story } from "@storybook/vue3";
3
+ import { EBadgeKind, EBadgeSize } from "./_typings";
4
+
5
+ export default {
6
+ title: "Components/ui-badge",
7
+ component: UiBadge,
8
+ argTypes: {
9
+ kind: {
10
+ control: { type: "select" },
11
+ options: Object.values(EBadgeKind),
12
+ description: "The Element kinds",
13
+ },
14
+ size: {
15
+ control: { type: "select" },
16
+ options: Object.values(EBadgeSize),
17
+ description: "The Element size",
18
+ }
19
+ },
20
+ args: {
21
+ slot: "default text",
22
+ kind: EBadgeKind.PRIMARY,
23
+ size: EBadgeSize.SMALL,
24
+ },
25
+ };
26
+
27
+ type TComponentProps = InstanceType<typeof UiBadge>["$props"];
28
+
29
+ const Template: Story<TComponentProps> = (args) => ({
30
+ components: { UiBadge },
31
+ setup() {
32
+ return { args };
33
+ },
34
+ template: `
35
+ <ui-badge :icon="['far', 'face-smile']" v-bind="args">
36
+ {{ args.slot }}
37
+ </ui-badge>
38
+ `,
39
+ });
40
+
41
+ export const Default = Template.bind({});
@@ -0,0 +1,57 @@
1
+ <template>
2
+ <span
3
+ class="ui-badge rounded-full inline-flex items-center"
4
+ :class="[
5
+ (!size || size === EBadgeSize.SMALL) && 'px-xs py-xxs',
6
+ (!kind || kind === EBadgeKind.PRIMARY) && 'bg-primary-alt-300 text-primary-alt-700',
7
+
8
+ kind === EBadgeKind.ERROR && 'bg-error-300 text-error-700',
9
+ kind === EBadgeKind.ACCENT && 'bg-accent-300 text-accent-700',
10
+
11
+ size === EBadgeSize.MEDIUM && 'px-xs py-xs',
12
+ size === EBadgeSize.LARGE && 'px-sm py-xs',
13
+ ]"
14
+ >
15
+ <ui-icon
16
+ v-if="icon"
17
+ class="mr-xxs"
18
+ :size="ESize.SM"
19
+ :icon-name="icon"
20
+ />
21
+
22
+ <ui-typography
23
+ is="span"
24
+ :size="getBadgeSize"
25
+ :weight="ETextWeight.SEMI_BOLD"
26
+ class="whitespace-nowrap"
27
+ >
28
+ <slot />
29
+ </ui-typography>
30
+ </span>
31
+ </template>
32
+
33
+ <script lang="ts" setup>
34
+ import { computed } from "vue";
35
+ import { EBadgeKind, EBadgeSize } from "./_typings";
36
+ import UiIcon, { type TIconName } from "../ui-icon";
37
+ import { ESize } from "../../_types/sizing";
38
+ import UiTypography, { ETypographySizes, ETextWeight } from "../ui-typography";
39
+
40
+ const props = defineProps<{
41
+ size?: EBadgeSize;
42
+ kind?: EBadgeKind;
43
+ icon?: TIconName;
44
+ }>();
45
+
46
+ const getBadgeSize = computed(()=>{
47
+ switch (props.size) {
48
+ case EBadgeSize.MEDIUM:
49
+ return ETypographySizes.XS;
50
+ case EBadgeSize.LARGE:
51
+ return ETypographySizes.SM;
52
+ case EBadgeSize.SMALL:
53
+ default:
54
+ return ETypographySizes.XXS;
55
+ }
56
+ });
57
+ </script>
@@ -0,0 +1 @@
1
+ export { default } from "./ui-ber-rank.vue";
@@ -0,0 +1,30 @@
1
+ import UiBerRank from "./ui-ber-rank.vue";
2
+ import type { Story } from "@storybook/vue3";
3
+
4
+ export default {
5
+ title: "Components/ui-ber-rank",
6
+ component: UiBerRank,
7
+ argTypes: {
8
+ rank:{
9
+ control: { type: "number" },
10
+ description: "The Element rank from 0 to 15",
11
+ }
12
+ },
13
+ args: {
14
+ rank: 0,
15
+ },
16
+ };
17
+
18
+ type TComponentProps = InstanceType<typeof UiBerRank>["$props"];
19
+
20
+ const Template: Story<TComponentProps> = (args) => ({
21
+ components: { UiBerRank },
22
+ setup() {
23
+ return { args };
24
+ },
25
+ template: `
26
+ <ui-ber-rank v-bind="args" />
27
+ `,
28
+ });
29
+
30
+ export const Default = Template.bind({});
@@ -0,0 +1,142 @@
1
+ <template>
2
+ <div class="ui-ber-rank flex">
3
+ <div class="ui-ber-rank__icon-wrapper relative">
4
+ <svg
5
+ class="ui-ber-rank__icon text-secondary"
6
+ viewBox="0 0 160 60"
7
+ fill="none"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ >
10
+ <path
11
+ fill-rule="evenodd"
12
+ d="M0.279251 15.36C0.279251 9.9835 0.279251 7.29524 1.32559 5.24169C2.24597 3.43534 3.71459 1.96672 5.52094 1.04634C7.5745 0 10.2627 0 15.6393 0H139.208C143.189 0 145.18 0 146.874 0.666121C148.369 1.25435 149.693 2.20864 150.724 3.44151C151.892 4.83764 152.521 6.72601 153.78 10.5027L158.93 25.9523C159.431 27.4541 159.681 28.205 159.78 28.9732C159.869 29.6549 159.869 30.3451 159.78 31.0268C159.681 31.795 159.431 32.5459 158.93 34.0477L153.78 49.4973C152.521 53.274 151.892 55.1624 150.724 56.5585C149.693 57.7914 148.369 58.7457 146.874 59.3339C145.18 60 143.189 60 139.208 60H15.6393C10.2627 60 7.5745 60 5.52094 58.9537C3.71459 58.0333 2.24597 56.5647 1.32559 54.7583C0.279251 52.7048 0.279251 50.0165 0.279251 44.64V15.36Z"
13
+ fill="currentColor"
14
+ />
15
+ </svg>
16
+ <ui-typography
17
+ :kind="EColors.WHITE"
18
+ :weight="ETextWeight.BOLD"
19
+ :size="ETypographySizes.XXXL"
20
+ :text-transform="ETextTransform.UPPERCASE"
21
+ class="absolute top-0 left-0 w-full h-full flex justify-center items-center"
22
+ >
23
+ ber
24
+ </ui-typography>
25
+ </div>
26
+
27
+ <div class="ui-ber-rank__icon-wrapper relative">
28
+ <ui-typography :kind="berRankDictionary[+rank]?.color || berRankDictionary[0].color">
29
+ <svg
30
+ class="ui-ber-rank__icon"
31
+ viewBox="0 0 106 60"
32
+ fill="none"
33
+ xmlns="http://www.w3.org/2000/svg"
34
+ >
35
+ <path
36
+ fill-rule="evenodd"
37
+ d="M3.01833 20.2172C0.74308 13.3915 -0.394547 9.9786 0.287586 7.26202C0.884697 4.88404 2.36903 2.82464 4.43616 1.50619C6.79762 0 10.3951 0 17.5901 0H90.3607C95.7373 0 98.4255 0 100.479 1.04634C102.285 1.96672 103.754 3.43534 104.674 5.24169C105.721 7.29524 105.721 9.9835 105.721 15.36V44.64C105.721 50.0165 105.721 52.7048 104.674 54.7583C103.754 56.5647 102.285 58.0333 100.479 58.9537C98.4255 60 95.7373 60 90.3607 60H17.5901C10.3951 60 6.79762 60 4.43616 58.4938C2.36903 57.1754 0.884697 55.116 0.287586 52.738C-0.394547 50.0214 0.743081 46.6085 3.01834 39.7827L4.93001 34.0477C5.43062 32.5459 5.68093 31.795 5.78035 31.0268C5.86857 30.3451 5.86857 29.6549 5.78035 28.9732C5.68093 28.205 5.43062 27.4541 4.93001 25.9523L3.01833 20.2172Z"
38
+ fill="currentColor"
39
+ />
40
+ </svg>
41
+ </ui-typography>
42
+
43
+ <ui-typography
44
+ :kind="EColors.WHITE"
45
+ :weight="ETextWeight.BOLD"
46
+ :size="ETypographySizes.XXXL"
47
+ :text-transform="ETextTransform.UPPERCASE"
48
+ class="absolute top-0 left-0 w-full h-full flex justify-center items-center"
49
+ >
50
+ {{ berRankDictionary[+rank]?.text || berRankDictionary[0].text }}
51
+ </ui-typography>
52
+ </div>
53
+ </div>
54
+ </template>
55
+
56
+ <script lang="ts" setup>
57
+ import UiTypography, { ETextWeight, ETypographySizes, ETextTransform } from "../ui-typography";
58
+ import { EColors } from "../../_types/colors";
59
+
60
+ type Ran<T extends number> = number extends T ? number :_Range<T, []>;
61
+ type _Range<T extends number, R extends unknown[]> = R["length"] extends T ? R[number] : _Range<T, [R["length"], ...R]>;
62
+
63
+ type TPropNumber = Ran<typeof berRankDictionary.length>
64
+ type TPropString = `${TPropNumber}`;
65
+
66
+ defineProps<{
67
+ rank: TPropNumber | TPropString; // from 0 to 15
68
+ }>();
69
+
70
+ const berRankDictionary = [
71
+ {
72
+ text: "N/A",
73
+ color: EColors.SECONDARY_ALT,
74
+ },
75
+ {
76
+ text: "G",
77
+ color: EColors.ERROR,
78
+ },
79
+ {
80
+ text: "F",
81
+ color: EColors.WARNING,
82
+ },
83
+ {
84
+ text: "E2",
85
+ color: EColors.WARNING_600,
86
+ },
87
+ {
88
+ text: "E1",
89
+ color: EColors.WARNING_600,
90
+ },
91
+ {
92
+ text: "D2",
93
+ color: EColors.WARNING_400,
94
+ },
95
+ {
96
+ text: "D1",
97
+ color: EColors.WARNING_400,
98
+ },
99
+ {
100
+ text: "C3",
101
+ color: EColors.PRIMARY_ALT,
102
+ },
103
+ {
104
+ text: "C2",
105
+ color: EColors.PRIMARY_ALT,
106
+ },
107
+ {
108
+ text: "C1",
109
+ color: EColors.PRIMARY_ALT,
110
+ },
111
+ {
112
+ text: "B3",
113
+ color: EColors.PRIMARY_ALT_600,
114
+ },
115
+ {
116
+ text: "B2",
117
+ color: EColors.PRIMARY_ALT_600,
118
+ },
119
+ {
120
+ text: "B1",
121
+ color: EColors.PRIMARY_ALT_600,
122
+ },
123
+ {
124
+ text: "A3",
125
+ color: EColors.PRIMARY_ALT_700,
126
+ },
127
+ {
128
+ text: "A2",
129
+ color: EColors.PRIMARY_ALT_700,
130
+ },
131
+ {
132
+ text: "A1",
133
+ color: EColors.PRIMARY_ALT_700,
134
+ },
135
+ ] as const;
136
+ </script>
137
+
138
+ <style>
139
+ .ui-ber-rank__icon {
140
+ height: 60px;
141
+ }
142
+ </style>
@@ -1,17 +1,13 @@
1
1
  import UiButton from "../ui-button";
2
+ import UiIcon from "../ui-icon";
3
+ import { ESize } from "../../_types/sizing";
2
4
  import { EButtonSizes, EButtonTypes } from "./_typings";
3
- import { Story } from "@storybook/vue3";
4
-
5
+ import type { Story } from "@storybook/vue3";
5
6
  export default {
6
7
  title: "Components/ui-button",
7
8
  component: UiButton,
8
9
  // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
9
10
  argTypes: {
10
- className: {
11
- control: { type: "select" },
12
- options: ["small", "medium", "large"],
13
- description: "The button size",
14
- },
15
11
  kind: {
16
12
  control: { type: "select" },
17
13
  options: Object.values(EButtonTypes),
@@ -33,10 +29,18 @@ export default {
33
29
  slot: {
34
30
  control: { type: "text" },
35
31
  description: "The slot text or component",
32
+ },
33
+ hasPrefix:{
34
+ control: { type: "boolean" },
35
+ },
36
+ hasPostfix:{
37
+ control: { type: "boolean" },
36
38
  }
37
39
  },
38
40
  args: {
39
41
  slot: "default text",
42
+ hasPrefix: false,
43
+ hasPostfix: false,
40
44
  },
41
45
  };
42
46
 
@@ -44,20 +48,31 @@ type TComponentProps = InstanceType<typeof UiButton>["$props"];
44
48
 
45
49
  const Template: Story<TComponentProps> = (args) => ({
46
50
  // Components used in your story `template` are defined in the `components` object
47
- components: { UiButton },
51
+ components: { UiButton, UiIcon },
48
52
  // The story's `args` need to be mapped into the template through the `setup()` method
49
53
  setup() {
50
- return { args };
54
+ return { args, ESize };
51
55
  },
52
56
  // And then the `args` are bound to your component with `v-bind="args"`
53
57
  template: `
54
- <ui-button :className="args.className"
55
- :kind="args.kind"
58
+ <ui-button :kind="args.kind"
56
59
  :size="args.size"
57
60
  :fullWidth="args.fullWidth"
58
61
  :disabled="args.disabled"
59
62
  >
60
- ${args.slot}
63
+ <template #prefix v-if="args.hasPrefix">
64
+ <ui-icon
65
+ :icon-name="['far', 'face-smile']"
66
+ :size="ESize.SM"
67
+ />
68
+ </template>
69
+ ${args.slot}
70
+ <template #postfix v-if="args.hasPostfix">
71
+ <ui-icon
72
+ :icon-name="['far', 'face-smile']"
73
+ :size="ESize.SM"
74
+ />
75
+ </template>
61
76
  </ui-button>`,
62
77
  });
63
78
  const TemplateAll: Story<TComponentProps> = () => ({
@@ -94,7 +109,6 @@ export const Primary = Template.bind({});
94
109
 
95
110
  Primary.args = {
96
111
  ...Primary,
97
- className: "medium",
98
112
  kind: EButtonTypes.PRIMARY,
99
113
  size: EButtonSizes.MEDIUM,
100
114
  fullWidth: false,
@@ -5,9 +5,11 @@ describe("VButton.test.ts", () => {
5
5
  it("renders props.msg when passed", () => {
6
6
  const className = "message";
7
7
  const wrapper = mount(UiButton, {
8
- props: { className },
8
+ propsData: {
9
+ class: className
10
+ }
9
11
  });
10
12
 
11
13
  expect(wrapper.classes()).toContain(className);
12
- },);
13
- },);
14
+ });
15
+ });
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <button
3
- class="text-base text-white rounded-md whitespace-nowrap font-bold leading-none"
3
+ class="ui-button justify-center grid text-base rounded-lg whitespace-nowrap font-bold leading-none touch-manipulation"
4
4
  :disabled="disabled"
5
5
  :class="[
6
6
  (!kind || kind === EButtonTypes.PRIMARY) && [primaryColor, primaryColorHover, primaryColorActive].join(' '),
7
- kind === EButtonTypes.SECONDARY && 'bg-secondary hover:bg-secondary-600 active:bg-secondary-700 disabled:bg-secondary-300',
8
- kind === EButtonTypes.WARNING && 'bg-warning hover:bg-warning-600 active:bg-warning-700 disabled:bg-warning-300',
9
- kind === EButtonTypes.ERROR && 'bg-error hover:bg-error-600 active:bg-error-700 disabled:bg-error-300',
7
+ kind === EButtonTypes.SECONDARY && 'text-white bg-secondary hover:bg-secondary-600 active:bg-secondary-700 disabled:bg-secondary-300',
8
+ kind === EButtonTypes.WARNING && 'text-white bg-warning hover:bg-warning-600 active:bg-warning-700 disabled:bg-warning-300',
9
+ kind === EButtonTypes.ERROR && 'text-white bg-error hover:bg-error-600 active:bg-error-700 disabled:bg-error-300',
10
10
  kind === EButtonTypes.PRIMARY_OVERLAY
11
11
  && 'text-primary border border-primary hover:bg-primary-600 hover:border-transparent hover:text-white active:bg-primary-700 active:border-transparent active:text-white disabled:text-primary-300 disabled:border-primary-300',
12
12
  kind === EButtonTypes.SECONDARY_OVERLAY
@@ -21,25 +21,51 @@
21
21
  size === EButtonSizes.LARGE && 'py-md px-md',
22
22
  fullWidth && 'w-full',
23
23
  disabled && 'pointer-events-none',
24
- className
25
24
  ]"
26
25
  >
27
- <slot />
26
+ <span
27
+ v-if="slots.prefix"
28
+ class="ui-button__prefix"
29
+ :class="(slots.default || slots.postfix) && 'mr-sm'"
30
+ >
31
+ <slot name="prefix" />
32
+ </span>
33
+
34
+ <span>
35
+ <slot />
36
+ </span>
37
+
38
+ <span
39
+ v-if="slots.postfix"
40
+ class="ui-button__postfix"
41
+ :class="(slots.default || slots.prefix) && 'ml-sm'"
42
+ >
43
+ <slot name="postfix" />
44
+ </span>
28
45
  </button>
29
46
  </template>
30
47
 
31
48
  <script lang="ts" setup>
32
49
  import { EButtonSizes, EButtonTypes } from "./_typings";
50
+ import { useSlots } from "vue";
33
51
  type TProps = {
34
- className?: string;
35
52
  kind?: EButtonTypes;
36
53
  size?: EButtonSizes;
37
54
  fullWidth?: boolean;
38
55
  disabled?: boolean;
39
56
  }
40
57
 
41
- const primaryColor = "bg-primary disabled:bg-primary-300";
58
+ const slots = useSlots();
59
+
60
+ const primaryColor = "text-white bg-primary disabled:bg-primary-300";
42
61
  const primaryColorHover = "hover:bg-primary-600 ";
43
62
  const primaryColorActive = "active:bg-primary-700 ";
63
+
44
64
  defineProps<TProps>();
45
65
  </script>
66
+
67
+ <style>
68
+ .ui-button {
69
+ grid-template-columns: auto auto auto;
70
+ }
71
+ </style>
@@ -1,27 +1,18 @@
1
- import UiCardCta from "./ui-card-cta.vue";
1
+ import UiCardCta from "../ui-card-cta";
2
2
  import UiIcon from "../ui-icon";
3
3
  import { ESize } from "../../_types/sizing";
4
4
  import UiTypography from "../ui-typography";
5
- import { Story } from "@storybook/vue3";
5
+ import type { Story } from "@storybook/vue3";
6
6
 
7
7
  export default {
8
8
  title: "Components/ui-card-cta",
9
9
  component: UiCardCta,
10
10
  // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
11
11
  argTypes: {
12
- className: {
13
- control: { type: "text" },
14
- description: "The Element classes",
15
- },
16
-
17
12
  invertOrder: {
18
13
  control: { type: "boolean" },
19
14
  description: "The Element order",
20
15
  },
21
- fullWidth: {
22
- control: { type: "boolean" },
23
- description: "The full width size",
24
- },
25
16
  disabled: {
26
17
  control: { type: "boolean" },
27
18
  description: "The full width size",
@@ -30,7 +21,6 @@ export default {
30
21
  args: {
31
22
  slot: "Description",
32
23
  invertOrder: false,
33
- fullWidth: false,
34
24
  disabled: false
35
25
  },
36
26
  };
@@ -45,7 +35,7 @@ const Template: Story<TComponentProps> = (args) => ({
45
35
  template: `
46
36
  <ui-card-cta v-bind="args">
47
37
  <template v-slot:icon>
48
- <ui-icon :size="ESize.MD" has-wrapper class-name="text-white" :icon-name="['fas', 'fa-user-secret']" />
38
+ <ui-icon :size="ESize.MD" has-wrapper class="text-white" :icon-name="['far', 'fa-face-smile']" />
49
39
  </template>
50
40
 
51
41
  <template v-slot:title>
@@ -1,8 +1,7 @@
1
1
  <template>
2
2
  <button
3
- class="ui-card-cta outline-0 border border-secondary-alt-500 rounded-2xl p-sm shadow-m hover:border-secondary-700 focus:shadow-border-primary active:bg-secondary-alt-200 disabled:bg-secondary-alt-200"
3
+ class="ui-card-cta outline-0 border border-secondary-alt-500 rounded-2xl p-sm shadow-md hover:border-secondary-700 focus:shadow-border-primary active:bg-secondary-alt-200 disabled:bg-secondary-alt-200"
4
4
  :disabled="disabled"
5
- :class="[!fullWidth && 'ui-card-cta_cropped', className]"
6
5
  >
7
6
  <span
8
7
  class="ui-card-cta__wrapper grid gap-sm items-center"
@@ -19,7 +18,7 @@
19
18
  <ui-typography
20
19
  :kind="EColors.SECONDARY"
21
20
  :weight="ETextWeight.SEMI_BOLD"
22
- class-name="mb-xxs"
21
+ class="mb-xxs"
23
22
  >
24
23
  <slot name="title" />
25
24
  </ui-typography>
@@ -38,15 +37,13 @@
38
37
  <script lang="ts" setup>
39
38
  import { useSlots } from "vue";
40
39
  import UiTypography from "../ui-typography";
41
- import { ETypographyColors, ETypographySizes, ETextWeight } from "../ui-typography/_typings";
40
+ import { ETypographySizes, ETextWeight } from "../ui-typography";
42
41
  import { EColors } from "../../_types/colors";
43
42
 
44
43
  const slots = useSlots();
45
44
 
46
45
  defineProps<{
47
- className?: string;
48
46
  invertOrder?: boolean;
49
- fullWidth?: boolean;
50
47
  disabled?: boolean;
51
48
  }>();
52
49
 
@@ -75,10 +72,6 @@
75
72
  width: 100%;
76
73
  }
77
74
 
78
- .ui-card-cta_cropped {
79
- max-width: 382px;
80
- }
81
-
82
75
  .ui-card-cta_inverted {
83
76
  grid-template-columns: 1fr auto;
84
77
  }
@@ -0,0 +1 @@
1
+ export { default } from "./ui-card-result.vue";