bonkers-ui 1.0.4 → 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.
- package/.storybook/preview.js +1 -2
- package/package.json +1 -1
- package/src/{_colors.json → _styles/classTypes/_colors.json} +2 -2
- package/src/{_font-sizes.json → _styles/classTypes/_font-sizes.json} +1 -1
- package/src/{_shadow.json → _styles/classTypes/_shadow.json} +1 -1
- package/src/{_spacing.json → _styles/classTypes/_spacing.json} +1 -0
- package/src/_styles/{colors.css → variables/colors.css} +0 -0
- package/src/_styles/{font-sizes.css → variables/font-sizes.css} +1 -1
- package/src/_styles/variables/shadow.css +8 -0
- package/src/_styles/{spacing.css → variables/spacing.css} +1 -0
- package/src/components/ui-badge/_typings.ts +11 -0
- package/src/components/ui-badge/index.ts +2 -0
- package/src/components/ui-badge/ui-badge.stories.ts +45 -0
- package/src/components/ui-badge/ui-badge.vue +59 -0
- package/src/components/ui-ber-rank/index.ts +1 -0
- package/src/components/ui-ber-rank/ui-ber-rank.stories.ts +34 -0
- package/src/components/ui-ber-rank/ui-ber-rank.vue +142 -0
- package/src/components/ui-button/ui-button.stories.ts +26 -5
- package/src/components/ui-button/ui-button.vue +34 -6
- package/src/components/ui-card-cta/ui-card-cta.stories.ts +3 -8
- package/src/components/ui-card-cta/ui-card-cta.vue +3 -8
- package/src/components/ui-card-result/index.ts +1 -0
- package/src/components/ui-card-result/ui-card-result.stories.ts +107 -0
- package/src/components/ui-card-result/ui-card-result.vue +70 -0
- package/src/components/ui-card-simple/ui-card-simple.stories.ts +1 -1
- package/src/components/ui-card-simple/ui-card-simple.vue +1 -1
- package/src/components/ui-checkbox/ui-checkbox.stories.ts +1 -1
- package/src/components/ui-icon/ui-icon.stories.ts +2 -2
- package/src/components/ui-input/_typings.ts +0 -2
- package/src/components/ui-input/ui-input.stories.ts +9 -3
- package/src/components/ui-input/ui-input.vue +49 -20
- package/src/components/ui-input-range/index.ts +1 -0
- package/src/components/ui-input-range/ui-input-range.stories.ts +48 -0
- package/src/components/ui-input-range/ui-input-range.vue +62 -0
- package/src/components/ui-list-item/index.ts +1 -0
- package/src/components/ui-list-item/ui-list-item.stories.ts +40 -0
- package/src/components/ui-list-item/ui-list-item.vue +29 -0
- package/src/components/ui-radio/ui-radio.stories.ts +8 -3
- package/src/components/ui-radio/ui-radio.vue +35 -2
- package/src/components/ui-radio-list-fancy/ui-radio-item/ui-radio-item.vue +2 -2
- package/src/components/ui-radio-list-fancy/ui-radio-list-fancy.stories.ts +1 -1
- package/src/components/ui-ripple/ui-ripple.stories.ts +1 -1
- package/src/components/ui-select/index.ts +1 -0
- package/src/components/ui-select/ui-select.stories.ts +45 -0
- package/src/components/ui-select/ui-select.vue +68 -0
- package/src/components/ui-tabs/index.ts +1 -0
- package/src/components/ui-tabs/ui-tabs.stories.ts +32 -0
- package/src/components/ui-tabs/ui-tabs.vue +58 -0
- package/src/components/ui-toggle/index.ts +1 -0
- package/src/components/ui-toggle/ui-toggle.stories.ts +40 -0
- package/src/components/ui-toggle/ui-toggle.vue +92 -0
- package/src/components/ui-typography/_typings.ts +5 -31
- package/src/components/ui-typography/index.ts +1 -1
- package/src/components/ui-typography/ui-typography.stories.ts +7 -2
- package/src/components/ui-typography/ui-typography.vue +4 -3
- package/src/components/ui-verification-input/ui-verification-input.stories.ts +1 -2
- package/src/main.css +6 -5
- package/src/stories/colors/ui-colors.vue +1 -1
- package/src/stories/font-sizes/font-sizes.stories.ts +13 -0
- package/src/stories/font-sizes/ui-font-sizes.vue +28 -0
- package/src/stories/spacings/ui-spacings.vue +1 -1
- package/tailwind.config.js +4 -4
- package/vite.config.ts +5 -3
- package/src/_styles/shadow.css +0 -7
package/.storybook/preview.js
CHANGED
|
@@ -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(
|
|
12
|
+
library.add(faFaceSmile);
|
|
14
13
|
|
|
15
14
|
import '../src/main.css';
|
|
16
15
|
|
package/package.json
CHANGED
|
@@ -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)",
|
|
File without changes
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
className: {
|
|
10
|
+
control: { type: "text" },
|
|
11
|
+
description: "The Element classes",
|
|
12
|
+
},
|
|
13
|
+
kind: {
|
|
14
|
+
control: { type: "select" },
|
|
15
|
+
options: Object.values(EBadgeKind),
|
|
16
|
+
description: "The Element kinds",
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
control: { type: "select" },
|
|
20
|
+
options: Object.values(EBadgeSize),
|
|
21
|
+
description: "The Element size",
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
args: {
|
|
25
|
+
slot: "default text",
|
|
26
|
+
kind: EBadgeKind.PRIMARY,
|
|
27
|
+
size: EBadgeSize.SMALL,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
type TComponentProps = InstanceType<typeof UiBadge>["$props"];
|
|
32
|
+
|
|
33
|
+
const Template: Story<TComponentProps> = (args) => ({
|
|
34
|
+
components: { UiBadge },
|
|
35
|
+
setup() {
|
|
36
|
+
return { args };
|
|
37
|
+
},
|
|
38
|
+
template: `
|
|
39
|
+
<ui-badge :icon="['far', 'face-smile']" v-bind="args">
|
|
40
|
+
{{ args.slot }}
|
|
41
|
+
</ui-badge>
|
|
42
|
+
`,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export const Default = Template.bind({});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span
|
|
3
|
+
class="ui-badge rounded-full inline-flex items-center"
|
|
4
|
+
:class="[
|
|
5
|
+
className,
|
|
6
|
+
(!size || size === EBadgeSize.SMALL) && 'px-xs py-xxs',
|
|
7
|
+
(!kind || kind === EBadgeKind.PRIMARY) && 'bg-primary-alt-300 text-primary-alt-700',
|
|
8
|
+
|
|
9
|
+
kind === EBadgeKind.ERROR && 'bg-error-300 text-error-700',
|
|
10
|
+
kind === EBadgeKind.ACCENT && 'bg-accent-300 text-accent-700',
|
|
11
|
+
|
|
12
|
+
size === EBadgeSize.MEDIUM && 'px-xs py-xs',
|
|
13
|
+
size === EBadgeSize.LARGE && 'px-sm py-xs',
|
|
14
|
+
]"
|
|
15
|
+
>
|
|
16
|
+
<ui-icon
|
|
17
|
+
v-if="icon"
|
|
18
|
+
class-name="mr-xxs"
|
|
19
|
+
:size="ESize.SM"
|
|
20
|
+
:icon-name="icon"
|
|
21
|
+
/>
|
|
22
|
+
|
|
23
|
+
<ui-typography
|
|
24
|
+
is="span"
|
|
25
|
+
:size="getBadgeSize"
|
|
26
|
+
:weight="ETextWeight.SEMI_BOLD"
|
|
27
|
+
class-name="whitespace-nowrap"
|
|
28
|
+
>
|
|
29
|
+
<slot />
|
|
30
|
+
</ui-typography>
|
|
31
|
+
</span>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script lang="ts" setup>
|
|
35
|
+
import { computed } from "vue";
|
|
36
|
+
import { EBadgeKind, EBadgeSize } from "./_typings";
|
|
37
|
+
import UiIcon, { type TIconName } from "../ui-icon";
|
|
38
|
+
import { ESize } from "../../_types/sizing";
|
|
39
|
+
import UiTypography, { ETypographySizes, ETextWeight } from "../ui-typography";
|
|
40
|
+
|
|
41
|
+
const props = defineProps<{
|
|
42
|
+
className?: string;
|
|
43
|
+
size?: EBadgeSize;
|
|
44
|
+
kind?: EBadgeKind;
|
|
45
|
+
icon?: TIconName;
|
|
46
|
+
}>();
|
|
47
|
+
|
|
48
|
+
const getBadgeSize = computed(()=>{
|
|
49
|
+
switch (props.size) {
|
|
50
|
+
case EBadgeSize.MEDIUM:
|
|
51
|
+
return ETypographySizes.XS;
|
|
52
|
+
case EBadgeSize.LARGE:
|
|
53
|
+
return ETypographySizes.SM;
|
|
54
|
+
case EBadgeSize.SMALL:
|
|
55
|
+
default:
|
|
56
|
+
return ETypographySizes.XXS;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
</script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./ui-ber-rank.vue";
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
className: {
|
|
9
|
+
control: { type: "text" },
|
|
10
|
+
description: "The Element classes",
|
|
11
|
+
},
|
|
12
|
+
rank:{
|
|
13
|
+
control: { type: "number" },
|
|
14
|
+
description: "The Element rank from 0 to 15",
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
args: {
|
|
18
|
+
rank: 0,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
type TComponentProps = InstanceType<typeof UiBerRank>["$props"];
|
|
23
|
+
|
|
24
|
+
const Template: Story<TComponentProps> = (args) => ({
|
|
25
|
+
components: { UiBerRank },
|
|
26
|
+
setup() {
|
|
27
|
+
return { args };
|
|
28
|
+
},
|
|
29
|
+
template: `
|
|
30
|
+
<ui-ber-rank v-bind="args" />
|
|
31
|
+
`,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
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-name="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-name="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,7 +1,8 @@
|
|
|
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,
|
|
@@ -33,10 +34,18 @@ export default {
|
|
|
33
34
|
slot: {
|
|
34
35
|
control: { type: "text" },
|
|
35
36
|
description: "The slot text or component",
|
|
37
|
+
},
|
|
38
|
+
hasPrefix:{
|
|
39
|
+
control: { type: "boolean" },
|
|
40
|
+
},
|
|
41
|
+
hasPostfix:{
|
|
42
|
+
control: { type: "boolean" },
|
|
36
43
|
}
|
|
37
44
|
},
|
|
38
45
|
args: {
|
|
39
46
|
slot: "default text",
|
|
47
|
+
hasPrefix: false,
|
|
48
|
+
hasPostfix: false,
|
|
40
49
|
},
|
|
41
50
|
};
|
|
42
51
|
|
|
@@ -44,10 +53,10 @@ type TComponentProps = InstanceType<typeof UiButton>["$props"];
|
|
|
44
53
|
|
|
45
54
|
const Template: Story<TComponentProps> = (args) => ({
|
|
46
55
|
// Components used in your story `template` are defined in the `components` object
|
|
47
|
-
components: { UiButton },
|
|
56
|
+
components: { UiButton, UiIcon },
|
|
48
57
|
// The story's `args` need to be mapped into the template through the `setup()` method
|
|
49
58
|
setup() {
|
|
50
|
-
return { args };
|
|
59
|
+
return { args, ESize };
|
|
51
60
|
},
|
|
52
61
|
// And then the `args` are bound to your component with `v-bind="args"`
|
|
53
62
|
template: `
|
|
@@ -57,7 +66,19 @@ const Template: Story<TComponentProps> = (args) => ({
|
|
|
57
66
|
:fullWidth="args.fullWidth"
|
|
58
67
|
:disabled="args.disabled"
|
|
59
68
|
>
|
|
60
|
-
|
|
69
|
+
<template #prefix v-if="args.hasPrefix">
|
|
70
|
+
<ui-icon
|
|
71
|
+
:icon-name="['far', 'face-smile']"
|
|
72
|
+
:size="ESize.SM"
|
|
73
|
+
/>
|
|
74
|
+
</template>
|
|
75
|
+
${args.slot}
|
|
76
|
+
<template #postfix v-if="args.hasPostfix">
|
|
77
|
+
<ui-icon
|
|
78
|
+
:icon-name="['far', 'face-smile']"
|
|
79
|
+
:size="ESize.SM"
|
|
80
|
+
/>
|
|
81
|
+
</template>
|
|
61
82
|
</ui-button>`,
|
|
62
83
|
});
|
|
63
84
|
const TemplateAll: Story<TComponentProps> = () => ({
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<button
|
|
3
|
-
class="
|
|
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
|
|
@@ -24,12 +24,31 @@
|
|
|
24
24
|
className
|
|
25
25
|
]"
|
|
26
26
|
>
|
|
27
|
-
<
|
|
27
|
+
<span
|
|
28
|
+
v-if="slots.prefix"
|
|
29
|
+
class="ui-button__prefix"
|
|
30
|
+
:class="(slots.default || slots.postfix) && 'mr-sm'"
|
|
31
|
+
>
|
|
32
|
+
<slot name="prefix" />
|
|
33
|
+
</span>
|
|
34
|
+
|
|
35
|
+
<span>
|
|
36
|
+
<slot />
|
|
37
|
+
</span>
|
|
38
|
+
|
|
39
|
+
<span
|
|
40
|
+
v-if="slots.postfix"
|
|
41
|
+
class="ui-button__postfix"
|
|
42
|
+
:class="(slots.default || slots.prefix) && 'ml-sm'"
|
|
43
|
+
>
|
|
44
|
+
<slot name="postfix" />
|
|
45
|
+
</span>
|
|
28
46
|
</button>
|
|
29
47
|
</template>
|
|
30
48
|
|
|
31
49
|
<script lang="ts" setup>
|
|
32
50
|
import { EButtonSizes, EButtonTypes } from "./_typings";
|
|
51
|
+
import { useSlots } from "vue";
|
|
33
52
|
type TProps = {
|
|
34
53
|
className?: string;
|
|
35
54
|
kind?: EButtonTypes;
|
|
@@ -38,8 +57,17 @@
|
|
|
38
57
|
disabled?: boolean;
|
|
39
58
|
}
|
|
40
59
|
|
|
41
|
-
const
|
|
60
|
+
const slots = useSlots();
|
|
61
|
+
|
|
62
|
+
const primaryColor = "text-white bg-primary disabled:bg-primary-300";
|
|
42
63
|
const primaryColorHover = "hover:bg-primary-600 ";
|
|
43
64
|
const primaryColorActive = "active:bg-primary-700 ";
|
|
65
|
+
|
|
44
66
|
defineProps<TProps>();
|
|
45
67
|
</script>
|
|
68
|
+
|
|
69
|
+
<style>
|
|
70
|
+
.ui-button {
|
|
71
|
+
grid-template-columns: auto auto auto;
|
|
72
|
+
}
|
|
73
|
+
</style>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import UiCardCta from "
|
|
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",
|
|
@@ -18,10 +18,6 @@ export default {
|
|
|
18
18
|
control: { type: "boolean" },
|
|
19
19
|
description: "The Element order",
|
|
20
20
|
},
|
|
21
|
-
fullWidth: {
|
|
22
|
-
control: { type: "boolean" },
|
|
23
|
-
description: "The full width size",
|
|
24
|
-
},
|
|
25
21
|
disabled: {
|
|
26
22
|
control: { type: "boolean" },
|
|
27
23
|
description: "The full width size",
|
|
@@ -30,7 +26,6 @@ export default {
|
|
|
30
26
|
args: {
|
|
31
27
|
slot: "Description",
|
|
32
28
|
invertOrder: false,
|
|
33
|
-
fullWidth: false,
|
|
34
29
|
disabled: false
|
|
35
30
|
},
|
|
36
31
|
};
|
|
@@ -45,7 +40,7 @@ const Template: Story<TComponentProps> = (args) => ({
|
|
|
45
40
|
template: `
|
|
46
41
|
<ui-card-cta v-bind="args">
|
|
47
42
|
<template v-slot:icon>
|
|
48
|
-
<ui-icon :size="ESize.MD" has-wrapper class-name="text-white" :icon-name="['
|
|
43
|
+
<ui-icon :size="ESize.MD" has-wrapper class-name="text-white" :icon-name="['far', 'fa-face-smile']" />
|
|
49
44
|
</template>
|
|
50
45
|
|
|
51
46
|
<template v-slot:title>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<button
|
|
3
|
-
class="ui-card-cta outline-0 border border-secondary-alt-500 rounded-2xl p-sm shadow-
|
|
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="[
|
|
5
|
+
:class="[className]"
|
|
6
6
|
>
|
|
7
7
|
<span
|
|
8
8
|
class="ui-card-cta__wrapper grid gap-sm items-center"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
<script lang="ts" setup>
|
|
39
39
|
import { useSlots } from "vue";
|
|
40
40
|
import UiTypography from "../ui-typography";
|
|
41
|
-
import {
|
|
41
|
+
import { ETypographySizes, ETextWeight } from "../ui-typography";
|
|
42
42
|
import { EColors } from "../../_types/colors";
|
|
43
43
|
|
|
44
44
|
const slots = useSlots();
|
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
defineProps<{
|
|
47
47
|
className?: string;
|
|
48
48
|
invertOrder?: boolean;
|
|
49
|
-
fullWidth?: boolean;
|
|
50
49
|
disabled?: boolean;
|
|
51
50
|
}>();
|
|
52
51
|
|
|
@@ -75,10 +74,6 @@
|
|
|
75
74
|
width: 100%;
|
|
76
75
|
}
|
|
77
76
|
|
|
78
|
-
.ui-card-cta_cropped {
|
|
79
|
-
max-width: 382px;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
77
|
.ui-card-cta_inverted {
|
|
83
78
|
grid-template-columns: 1fr auto;
|
|
84
79
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./ui-card-result.vue";
|