bonkers-ui 1.0.54 → 1.0.56
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/.eslintrc.js +95 -40
- package/package.json +31 -25
- package/src/components/ui-alert/ui-alert.stories.ts +6 -2
- package/src/components/ui-alert/ui-alert.vue +1 -1
- package/src/components/ui-badge/ui-badge.stories.ts +12 -4
- package/src/components/ui-badge/ui-badge.vue +5 -5
- package/src/components/ui-ber-rank/ui-ber-rank.stories.ts +7 -3
- package/src/components/ui-ber-rank/ui-ber-rank.vue +4 -4
- package/src/components/ui-button/ui-button.stories.ts +38 -13
- package/src/components/ui-button/ui-button.test.ts +1 -1
- package/src/components/ui-button/ui-button.vue +35 -13
- package/src/components/ui-card-cta/ui-card-cta.stories.ts +12 -4
- package/src/components/ui-card-cta/ui-card-cta.vue +6 -6
- package/src/components/ui-card-result/ui-card-result.stories.ts +23 -4
- package/src/components/ui-card-result/ui-card-result.vue +20 -7
- package/src/components/ui-card-simple/ui-card-simple.stories.ts +6 -2
- package/src/components/ui-card-simple/ui-card-simple.vue +1 -1
- package/src/components/ui-checkbox/ui-checkbox.stories.ts +19 -6
- package/src/components/ui-checkbox/ui-checkbox.vue +15 -3
- package/src/components/ui-icon/index.ts +1 -1
- package/src/components/ui-icon/ui-icon.stories.ts +9 -3
- package/src/components/ui-icon-wrapper/ui-icon-wrapper.stories.ts +17 -4
- package/src/components/ui-icon-wrapper/ui-icon-wrapper.vue +8 -8
- package/src/components/ui-input/ui-input.stories.ts +18 -10
- package/src/components/ui-input/ui-input.vue +4 -4
- package/src/components/ui-input-range/ui-input-range.stories.ts +19 -8
- package/src/components/ui-input-range/ui-input-range.vue +15 -15
- package/src/components/ui-list-item/ui-list-item.stories.ts +23 -8
- package/src/components/ui-list-item/ui-list-item.vue +14 -3
- package/src/components/ui-modal/ui-backdrop/ui-backdrop.vue +2 -2
- package/src/components/ui-modal/ui-modal.stories.ts +21 -6
- package/src/components/ui-modal/ui-modal.vue +12 -12
- package/src/components/ui-notification-badge/ui-notification-badge.stories.ts +9 -3
- package/src/components/ui-notification-badge/ui-notification-badge.vue +17 -3
- package/src/components/ui-order-card/ui-order-card.stories.ts +9 -3
- package/src/components/ui-order-card/ui-order-card.vue +5 -5
- package/src/components/ui-plain-radio/ui-plain-radio.stories.ts +21 -6
- package/src/components/ui-plain-radio/ui-plain-radio.vue +22 -23
- package/src/components/ui-progress/_types.ts +0 -0
- package/src/components/ui-progress/index.ts +1 -0
- package/src/components/ui-progress/ui-progress.stories.ts +40 -0
- package/src/components/ui-progress/ui-progress.vue +43 -0
- package/src/components/ui-radio/ui-radio.stories.ts +16 -5
- package/src/components/ui-radio/ui-radio.vue +14 -14
- package/src/components/ui-radio-fancy/ui-radio-fancy.stories.ts +18 -5
- package/src/components/ui-radio-fancy/ui-radio-fancy.vue +22 -20
- package/src/components/ui-result-card-range/ui-result-card-range.stories.ts +21 -11
- package/src/components/ui-result-card-range/ui-result-card-range.vue +3 -3
- package/src/components/ui-ripple/ui-ripple.stories.ts +14 -7
- package/src/components/ui-ripple/ui-ripple.vue +1 -1
- package/src/components/ui-select/ui-select.stories.ts +11 -3
- package/src/components/ui-select/ui-select.vue +14 -3
- package/src/components/ui-snackbar/index.ts +1 -1
- package/src/components/ui-snackbar/ui-snackbar.stories.ts +6 -2
- package/src/components/ui-snackbar/ui-snackbar.vue +1 -1
- package/src/components/ui-table/index.ts +2 -0
- package/src/components/ui-table/ui-table.stories.ts +6 -4
- package/src/components/ui-table/ui-table.vue +3 -5
- package/src/components/ui-tabs/ui-tabs.stories.ts +8 -2
- package/src/components/ui-tabs/ui-tabs.vue +3 -3
- package/src/components/ui-toggle/ui-toggle.stories.ts +16 -5
- package/src/components/ui-toggle/ui-toggle.vue +7 -6
- package/src/components/ui-typography/ui-typography.stories.ts +30 -10
- package/src/components/ui-verification-input/ui-verification-input.stories.ts +12 -5
- package/src/components/ui-verification-input/ui-verification-input.vue +5 -5
- package/src/stories/colors/colors.stories.ts +4 -2
- package/src/stories/colors/ui-colors.vue +2 -2
- package/src/stories/font-sizes/font-sizes.stories.ts +3 -1
- package/src/stories/spacings/spacings.stories.ts +3 -1
package/.eslintrc.js
CHANGED
|
@@ -1,51 +1,106 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
root: true,
|
|
3
|
+
env: {
|
|
4
|
+
browser: true,
|
|
5
|
+
es2021: true,
|
|
6
|
+
node: true,
|
|
7
7
|
},
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
8
|
+
extends: [
|
|
9
|
+
"plugin:vue/vue3-recommended",
|
|
10
|
+
"eslint:recommended",
|
|
11
|
+
"@vue/typescript/recommended",
|
|
12
|
+
"plugin:storybook/recommended",
|
|
13
|
+
"plugin:tailwindcss/recommended"
|
|
14
|
+
],
|
|
15
|
+
parserOptions: {
|
|
16
|
+
ecmaVersion: 2021,
|
|
11
17
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
18
|
+
parser: "vue-eslint-parser",
|
|
19
|
+
plugins: [
|
|
20
|
+
"tailwindcss",
|
|
21
|
+
],
|
|
22
|
+
overrides: [
|
|
23
|
+
{
|
|
24
|
+
files: ["*.vue"],
|
|
25
|
+
rules: {
|
|
26
|
+
indent: "off",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
rules: {
|
|
31
|
+
indent: [
|
|
32
|
+
"error",
|
|
33
|
+
"tab",
|
|
34
|
+
{
|
|
35
|
+
VariableDeclarator: "first",
|
|
36
|
+
MemberExpression: 1,
|
|
37
|
+
ObjectExpression: 1,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
"vue/html-indent": [
|
|
41
|
+
"error",
|
|
42
|
+
"tab",
|
|
43
|
+
{
|
|
44
|
+
attribute: 1,
|
|
45
|
+
baseIndent: 1,
|
|
46
|
+
closeBracket: 0,
|
|
47
|
+
alignAttributesVertically: true,
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
"vue/script-indent": [
|
|
51
|
+
"error",
|
|
52
|
+
"tab",
|
|
53
|
+
{
|
|
54
|
+
baseIndent: 1,
|
|
55
|
+
switchCase: 1,
|
|
56
|
+
},
|
|
57
|
+
],
|
|
36
58
|
"eol-last": ["error", "always"],
|
|
37
59
|
"no-console": "warn",
|
|
38
60
|
"no-debugger": "warn",
|
|
39
61
|
"vue/multi-word-component-names": 0,
|
|
40
62
|
"object-curly-spacing": ["error", "always"],
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
"
|
|
63
|
+
quotes: [
|
|
64
|
+
"error",
|
|
65
|
+
"double",
|
|
66
|
+
{
|
|
67
|
+
avoidEscape: true,
|
|
68
|
+
allowTemplateLiterals: true,
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
"no-multiple-empty-lines": [
|
|
72
|
+
"error",
|
|
73
|
+
{
|
|
74
|
+
max: 1,
|
|
75
|
+
maxEOF: 0,
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
semi: ["error", "always"],
|
|
79
|
+
"max-len": ["error", {
|
|
80
|
+
"code": 120,
|
|
81
|
+
"tabWidth": 4,
|
|
82
|
+
"ignoreStrings": true,
|
|
83
|
+
"ignoreTemplateLiterals": true,
|
|
84
|
+
"ignoreRegExpLiterals": true,
|
|
85
|
+
"ignoreUrls": true,
|
|
86
|
+
"ignoreComments": true,
|
|
87
|
+
"ignoreTrailingComments": true,
|
|
88
|
+
ignorePattern: 'd="([\\s\\S]*?)"',
|
|
44
89
|
}],
|
|
45
|
-
"no-
|
|
46
|
-
|
|
47
|
-
"
|
|
90
|
+
"tailwindcss/no-custom-classname": "off",
|
|
91
|
+
"object-curly-newline": ["error", {
|
|
92
|
+
"ObjectExpression": {
|
|
93
|
+
"multiline": true,
|
|
94
|
+
"minProperties": 1,
|
|
95
|
+
},
|
|
96
|
+
"ImportDeclaration": {
|
|
97
|
+
"multiline": true,
|
|
98
|
+
"minProperties": 5,
|
|
99
|
+
}
|
|
48
100
|
}],
|
|
49
|
-
|
|
50
|
-
|
|
101
|
+
"object-property-newline": "error",
|
|
102
|
+
"space-before-blocks": ["error", "always"],
|
|
103
|
+
"keyword-spacing": "error",
|
|
104
|
+
"key-spacing": "error"
|
|
105
|
+
},
|
|
51
106
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bonkers-ui",
|
|
3
|
-
"version": "v1.0.
|
|
3
|
+
"version": "v1.0.56",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"storybook": "storybook dev -p 6006",
|
|
@@ -19,50 +19,56 @@
|
|
|
19
19
|
"@fortawesome/free-regular-svg-icons": "^6.4.0",
|
|
20
20
|
"@fortawesome/free-solid-svg-icons": "^6.4.0",
|
|
21
21
|
"@fortawesome/vue-fontawesome": "^3.0.3",
|
|
22
|
+
"eslint-plugin-tailwindcss": "^3.13.0",
|
|
22
23
|
"storybook-addon-designs": "^6.3.1",
|
|
23
24
|
"vue": "^3.3.4",
|
|
24
|
-
"vue-router": "^4.2.
|
|
25
|
+
"vue-router": "^4.2.4"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
|
-
"@storybook/addon-essentials": "^7.0
|
|
28
|
-
"@storybook/addon-links": "^7.0
|
|
29
|
-
"@storybook/addon-mdx-gfm": "^7.0
|
|
30
|
-
"@storybook/vue3": "^7.0
|
|
31
|
-
"@storybook/vue3-vite": "^7.0
|
|
28
|
+
"@storybook/addon-essentials": "^7.2.0",
|
|
29
|
+
"@storybook/addon-links": "^7.2.0",
|
|
30
|
+
"@storybook/addon-mdx-gfm": "^7.2.0",
|
|
31
|
+
"@storybook/vue3": "^7.2.0",
|
|
32
|
+
"@storybook/vue3-vite": "^7.2.0",
|
|
32
33
|
"@typescript-eslint/eslint-plugin": "^5.59.9",
|
|
33
34
|
"@typescript-eslint/parser": "^5.59.9",
|
|
34
35
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
35
36
|
"@vue/eslint-config-typescript": "^11.0.3",
|
|
36
|
-
"@vue/test-utils": "^2.
|
|
37
|
-
"eslint": "8.
|
|
38
|
-
"eslint-plugin-storybook": "^0.6.
|
|
39
|
-
"eslint-plugin-vue": "^9.
|
|
37
|
+
"@vue/test-utils": "^2.4.1",
|
|
38
|
+
"eslint": "8.46.0",
|
|
39
|
+
"eslint-plugin-storybook": "^0.6.13",
|
|
40
|
+
"eslint-plugin-vue": "^9.16.1",
|
|
40
41
|
"gh-pages": "^5.0.0",
|
|
41
42
|
"husky": "4.3.8",
|
|
42
43
|
"jsdom": "^22.1.0",
|
|
43
|
-
"lint-staged": "^13.2.
|
|
44
|
-
"postcss": "^8.4.
|
|
44
|
+
"lint-staged": "^13.2.3",
|
|
45
|
+
"postcss": "^8.4.27",
|
|
45
46
|
"postcss-html": "^1.4.1",
|
|
46
47
|
"react": "^18.2.0",
|
|
47
48
|
"react-dom": "^18.2.0",
|
|
48
|
-
"storybook": "^7.0
|
|
49
|
+
"storybook": "^7.2.0",
|
|
49
50
|
"storybook-tailwind-dark-mode": "^1.0.22",
|
|
50
|
-
"stylelint": "^15.
|
|
51
|
-
"stylelint-config-recommended": "^
|
|
52
|
-
"stylelint-config-recommended-vue": "^1.
|
|
53
|
-
"stylelint-config-standard": "^
|
|
54
|
-
"tailwindcss": "^3.3.
|
|
51
|
+
"stylelint": "^15.10.2",
|
|
52
|
+
"stylelint-config-recommended": "^13.0.0",
|
|
53
|
+
"stylelint-config-recommended-vue": "^1.5.0",
|
|
54
|
+
"stylelint-config-standard": "^34.0.0",
|
|
55
|
+
"tailwindcss": "^3.3.3",
|
|
55
56
|
"ts-node": "^10.9.1",
|
|
56
|
-
"typescript": "^5.1.
|
|
57
|
-
"vite": "^4.
|
|
58
|
-
"vitest": "^0.
|
|
59
|
-
"vue-eslint-parser": "^9.3.
|
|
57
|
+
"typescript": "^5.1.6",
|
|
58
|
+
"vite": "^4.4.8",
|
|
59
|
+
"vitest": "^0.34.1",
|
|
60
|
+
"vue-eslint-parser": "^9.3.1",
|
|
60
61
|
"vue-loader": "^17.2.2",
|
|
61
|
-
"vue-tsc": "^1.
|
|
62
|
+
"vue-tsc": "^1.8.8"
|
|
63
|
+
},
|
|
64
|
+
"resolutions": {
|
|
65
|
+
"strip-ansi": "^6.0.1",
|
|
66
|
+
"string-width": "^4.2.2",
|
|
67
|
+
"wrap-ansi": "^7.0.0"
|
|
62
68
|
},
|
|
63
69
|
"lint-staged": {
|
|
64
70
|
"*.{ts,tsx,vue}": [
|
|
65
|
-
"eslint --fix",
|
|
71
|
+
"yarn eslint --fix",
|
|
66
72
|
"bash -c 'yarn typecheck'"
|
|
67
73
|
],
|
|
68
74
|
"*.{css,vue,tsx}": "stylelint --fix"
|
|
@@ -9,12 +9,16 @@ export default {
|
|
|
9
9
|
|
|
10
10
|
argTypes: {
|
|
11
11
|
kind: {
|
|
12
|
-
control: {
|
|
12
|
+
control: {
|
|
13
|
+
type: "select"
|
|
14
|
+
},
|
|
13
15
|
options: Object.values(EAlertTypes),
|
|
14
16
|
description: "The button kinds",
|
|
15
17
|
},
|
|
16
18
|
default: {
|
|
17
|
-
control: {
|
|
19
|
+
control: {
|
|
20
|
+
type: "text"
|
|
21
|
+
},
|
|
18
22
|
}
|
|
19
23
|
},
|
|
20
24
|
} satisfies Meta<typeof UiAlert>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="ui-alert flex gap-sm
|
|
3
|
+
class="ui-alert flex gap-sm rounded-lg border bg-white p-sm"
|
|
4
4
|
:class="[
|
|
5
5
|
(!kind || kind === EAlertTypes.PRIMARY) && 'border-primary',
|
|
6
6
|
kind === EAlertTypes.WARNING && 'border-warning',
|
|
@@ -7,12 +7,16 @@ export default {
|
|
|
7
7
|
component: UiBadge,
|
|
8
8
|
argTypes: {
|
|
9
9
|
kind: {
|
|
10
|
-
control: {
|
|
10
|
+
control: {
|
|
11
|
+
type: "select"
|
|
12
|
+
},
|
|
11
13
|
options: Object.values(EBadgeKind),
|
|
12
14
|
description: "The Element kinds",
|
|
13
15
|
},
|
|
14
16
|
size: {
|
|
15
|
-
control: {
|
|
17
|
+
control: {
|
|
18
|
+
type: "select"
|
|
19
|
+
},
|
|
16
20
|
options: Object.values(EBadgeSize),
|
|
17
21
|
description: "The Element size",
|
|
18
22
|
},
|
|
@@ -27,9 +31,13 @@ export default {
|
|
|
27
31
|
type TComponentProps = InstanceType<typeof UiBadge>["$props"];
|
|
28
32
|
|
|
29
33
|
const Template: Story<TComponentProps> = (args) => ({
|
|
30
|
-
components: {
|
|
34
|
+
components: {
|
|
35
|
+
UiBadge
|
|
36
|
+
},
|
|
31
37
|
setup() {
|
|
32
|
-
return {
|
|
38
|
+
return {
|
|
39
|
+
args
|
|
40
|
+
};
|
|
33
41
|
},
|
|
34
42
|
template: /*html*/`
|
|
35
43
|
<ui-badge :icon="['far', 'face-smile']" v-bind="args" class="inline-flex">
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="ui-badge relative text-white
|
|
3
|
+
class="ui-badge relative overflow-hidden text-white"
|
|
4
4
|
>
|
|
5
|
-
<div class="relative z-[1] flex
|
|
5
|
+
<div class="relative z-[1] flex content-center items-center gap-xxs px-xs py-xxs">
|
|
6
6
|
<ui-icon
|
|
7
7
|
v-if="icon"
|
|
8
|
-
:size="ESize.
|
|
8
|
+
:size="ESize.SM"
|
|
9
9
|
:icon-name="icon"
|
|
10
10
|
/>
|
|
11
11
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
class="whitespace-nowrap"
|
|
17
17
|
line-height
|
|
18
18
|
:class="[
|
|
19
|
-
elipsis && 'overflow-hidden
|
|
19
|
+
elipsis && 'overflow-hidden text-ellipsis',
|
|
20
20
|
]"
|
|
21
21
|
>
|
|
22
22
|
<slot />
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
</div>
|
|
25
25
|
|
|
26
26
|
<div
|
|
27
|
-
class="absolute
|
|
27
|
+
class="absolute left-0 top-0 h-full w-full rounded-full"
|
|
28
28
|
:class="[
|
|
29
29
|
(!kind || kind === EBadgeKind.PRIMARY) && 'bg-primary-600',
|
|
30
30
|
|
|
@@ -7,12 +7,16 @@ export default {
|
|
|
7
7
|
title: "Components/ui-ber-rank",
|
|
8
8
|
component: UiBerRank,
|
|
9
9
|
argTypes: {
|
|
10
|
-
rank:{
|
|
11
|
-
control: {
|
|
10
|
+
rank: {
|
|
11
|
+
control: {
|
|
12
|
+
type: "number"
|
|
13
|
+
},
|
|
12
14
|
description: "The Element rank from 0 to 15",
|
|
13
15
|
},
|
|
14
16
|
size: {
|
|
15
|
-
control: {
|
|
17
|
+
control: {
|
|
18
|
+
type: "select"
|
|
19
|
+
},
|
|
16
20
|
options: Object.values(EBerSize),
|
|
17
21
|
description: "The size of the rank",
|
|
18
22
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
:weight="ETextWeight.BOLD"
|
|
23
23
|
:size="textSize"
|
|
24
24
|
:text-transform="ETextTransform.UPPERCASE"
|
|
25
|
-
class="absolute
|
|
25
|
+
class="absolute left-0 top-0 flex h-full w-full items-center justify-center"
|
|
26
26
|
>
|
|
27
27
|
ber
|
|
28
28
|
</ui-typography>
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
:weight="ETextWeight.BOLD"
|
|
53
53
|
:size="textSize"
|
|
54
54
|
:text-transform="ETextTransform.UPPERCASE"
|
|
55
|
-
class="absolute
|
|
55
|
+
class="absolute left-0 top-0 flex h-full w-full items-center justify-center"
|
|
56
56
|
>
|
|
57
57
|
{{ berRankDictionary[+rank]?.text || berRankDictionary[0].text }}
|
|
58
58
|
</ui-typography>
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
import { computed } from "vue";
|
|
65
65
|
import UiTypography, { ETextWeight, ETypographySizes, ETextTransform } from "../ui-typography";
|
|
66
66
|
import { EColors } from "../../_types/colors";
|
|
67
|
-
import { berRankDictionary, type TBerPropNumber, type TBerPropString, EBerSize }from"./_types";
|
|
67
|
+
import { berRankDictionary, type TBerPropNumber, type TBerPropString, EBerSize } from "./_types";
|
|
68
68
|
|
|
69
69
|
const props = withDefaults(defineProps<{
|
|
70
70
|
rank: TBerPropNumber | TBerPropString | number; // from 0 to 15
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
const textSize = computed(()=>{
|
|
77
|
-
switch(props.size) {
|
|
77
|
+
switch (props.size) {
|
|
78
78
|
case EBerSize.SMALL:
|
|
79
79
|
return ETypographySizes.SM;
|
|
80
80
|
case EBerSize.MEDIUM:
|
|
@@ -9,32 +9,46 @@ export default {
|
|
|
9
9
|
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
|
10
10
|
argTypes: {
|
|
11
11
|
kind: {
|
|
12
|
-
control: {
|
|
12
|
+
control: {
|
|
13
|
+
type: "select"
|
|
14
|
+
},
|
|
13
15
|
options: Object.values(EButtonTypes),
|
|
14
16
|
description: "The button kinds",
|
|
15
17
|
},
|
|
16
18
|
size: {
|
|
17
|
-
control: {
|
|
19
|
+
control: {
|
|
20
|
+
type: "select"
|
|
21
|
+
},
|
|
18
22
|
options: Object.values(EButtonSizes),
|
|
19
23
|
description: "The button sizes",
|
|
20
24
|
},
|
|
21
25
|
fullWidth: {
|
|
22
|
-
control: {
|
|
26
|
+
control: {
|
|
27
|
+
type: "boolean"
|
|
28
|
+
},
|
|
23
29
|
description: "The full width size",
|
|
24
30
|
},
|
|
25
31
|
disabled: {
|
|
26
|
-
control: {
|
|
32
|
+
control: {
|
|
33
|
+
type: "boolean"
|
|
34
|
+
},
|
|
27
35
|
description: "Disabled state",
|
|
28
36
|
},
|
|
29
37
|
slot: {
|
|
30
|
-
control: {
|
|
38
|
+
control: {
|
|
39
|
+
type: "text"
|
|
40
|
+
},
|
|
31
41
|
description: "The slot text or component",
|
|
32
42
|
},
|
|
33
|
-
hasPrefix:{
|
|
34
|
-
control: {
|
|
43
|
+
hasPrefix: {
|
|
44
|
+
control: {
|
|
45
|
+
type: "boolean"
|
|
46
|
+
},
|
|
35
47
|
},
|
|
36
|
-
hasPostfix:{
|
|
37
|
-
control: {
|
|
48
|
+
hasPostfix: {
|
|
49
|
+
control: {
|
|
50
|
+
type: "boolean"
|
|
51
|
+
},
|
|
38
52
|
}
|
|
39
53
|
},
|
|
40
54
|
args: {
|
|
@@ -48,10 +62,16 @@ type TComponentProps = InstanceType<typeof UiButton>["$props"];
|
|
|
48
62
|
|
|
49
63
|
const Template: Story<TComponentProps> = (args) => ({
|
|
50
64
|
// Components used in your story `template` are defined in the `components` object
|
|
51
|
-
components: {
|
|
65
|
+
components: {
|
|
66
|
+
UiButton,
|
|
67
|
+
UiIcon
|
|
68
|
+
},
|
|
52
69
|
// The story's `args` need to be mapped into the template through the `setup()` method
|
|
53
70
|
setup() {
|
|
54
|
-
return {
|
|
71
|
+
return {
|
|
72
|
+
args,
|
|
73
|
+
ESize
|
|
74
|
+
};
|
|
55
75
|
},
|
|
56
76
|
// And then the `args` are bound to your component with `v-bind="args"`
|
|
57
77
|
template: /*html*/`
|
|
@@ -76,10 +96,15 @@ const Template: Story<TComponentProps> = (args) => ({
|
|
|
76
96
|
</ui-button>`,
|
|
77
97
|
});
|
|
78
98
|
const TemplateAll: Story<TComponentProps> = () => ({
|
|
79
|
-
components: {
|
|
99
|
+
components: {
|
|
100
|
+
UiButton
|
|
101
|
+
},
|
|
80
102
|
|
|
81
103
|
setup() {
|
|
82
|
-
return {
|
|
104
|
+
return {
|
|
105
|
+
EButtonSizes,
|
|
106
|
+
EButtonTypes
|
|
107
|
+
};
|
|
83
108
|
},
|
|
84
109
|
|
|
85
110
|
template: /*html*/`
|
|
@@ -1,26 +1,48 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<button
|
|
3
|
-
class="ui-button
|
|
3
|
+
class="ui-button
|
|
4
|
+
text-base
|
|
5
|
+
grid
|
|
6
|
+
touch-manipulation
|
|
7
|
+
grid-flow-col
|
|
8
|
+
items-center
|
|
9
|
+
justify-center
|
|
10
|
+
whitespace-nowrap
|
|
11
|
+
rounded-lg
|
|
12
|
+
font-bold
|
|
13
|
+
leading-none
|
|
14
|
+
"
|
|
4
15
|
:disabled="disabled"
|
|
5
16
|
:class="[
|
|
6
17
|
(!kind || kind === EButtonTypes.PRIMARY) && [primaryColor, primaryColorHover, primaryColorActive].join(' '),
|
|
7
18
|
kind === EButtonTypes.SECONDARY
|
|
8
|
-
&& 'text-white
|
|
9
|
-
kind === EButtonTypes.WARNING
|
|
10
|
-
|
|
19
|
+
&& 'bg-secondary text-white hover:bg-secondary-600 active:bg-secondary-700 disabled:bg-secondary-300',
|
|
20
|
+
kind === EButtonTypes.WARNING
|
|
21
|
+
&& 'bg-warning text-white hover:bg-warning-600 active:bg-warning-700 disabled:bg-warning-300',
|
|
22
|
+
kind === EButtonTypes.ERROR
|
|
23
|
+
&& 'bg-error text-white hover:bg-error-600 active:bg-error-700 disabled:bg-error-300',
|
|
11
24
|
kind === EButtonTypes.PRIMARY_OVERLAY
|
|
12
|
-
&&
|
|
25
|
+
&& `border border-primary text-primary hover:border-transparent hover:bg-primary-600
|
|
26
|
+
hover:text-white active:border-transparent active:bg-primary-700
|
|
27
|
+
active:text-white disabled:border-primary-300 disabled:text-primary-300`,
|
|
13
28
|
kind === EButtonTypes.SECONDARY_OVERLAY
|
|
14
|
-
&&
|
|
29
|
+
&& `border border-secondary text-secondary hover:border-transparent hover:bg-secondary-600
|
|
30
|
+
hover:text-white active:border-transparent active:bg-secondary-700
|
|
31
|
+
active:text-white disabled:border-secondary-300 disabled:text-secondary-300`,
|
|
15
32
|
kind === EButtonTypes.WARNING_OVERLAY
|
|
16
|
-
&&
|
|
33
|
+
&& `border border-warning text-warning hover:border-transparent hover:bg-warning-600
|
|
34
|
+
hover:text-white active:border-transparent active:bg-warning-700
|
|
35
|
+
active:text-white disabled:border-warning-300 disabled:text-warning-300`,
|
|
17
36
|
kind === EButtonTypes.ERROR_OVERLAY
|
|
18
|
-
&&
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
size === EButtonSizes.
|
|
37
|
+
&& `border border-error text-error hover:border-transparent hover:bg-error-600
|
|
38
|
+
hover:text-white active:border-transparent active:bg-error-700
|
|
39
|
+
active:text-white disabled:border-error-300 disabled:text-error-300`,
|
|
40
|
+
kind === EButtonTypes.LINK && `hover:text-accent-alt-600 active:text-accent-alt-700
|
|
41
|
+
disabled:text-accent-alt-300 text-accent-alt`,
|
|
42
|
+
(!size || size === EButtonSizes.DEFAULT) && 'px-md py-sm',
|
|
43
|
+
size === EButtonSizes.SMALL && 'px-md py-xs',
|
|
44
|
+
size === EButtonSizes.MEDIUM && 'p-sm',
|
|
45
|
+
size === EButtonSizes.LARGE && 'p-md',
|
|
24
46
|
($slots.default || $slots.postfix) && 'gap-sm',
|
|
25
47
|
fullWidth && 'w-full',
|
|
26
48
|
disabled && 'pointer-events-none',
|
|
@@ -7,11 +7,15 @@ export default {
|
|
|
7
7
|
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
|
8
8
|
argTypes: {
|
|
9
9
|
invertOrder: {
|
|
10
|
-
control: {
|
|
10
|
+
control: {
|
|
11
|
+
type: "boolean"
|
|
12
|
+
},
|
|
11
13
|
description: "The Element order",
|
|
12
14
|
},
|
|
13
15
|
disabled: {
|
|
14
|
-
control: {
|
|
16
|
+
control: {
|
|
17
|
+
type: "boolean"
|
|
18
|
+
},
|
|
15
19
|
description: "The full width size",
|
|
16
20
|
},
|
|
17
21
|
},
|
|
@@ -25,9 +29,13 @@ export default {
|
|
|
25
29
|
type TComponentProps = InstanceType<typeof UiCardCta>["$props"];
|
|
26
30
|
|
|
27
31
|
const Template: Story<TComponentProps> = (args) => ({
|
|
28
|
-
components: {
|
|
32
|
+
components: {
|
|
33
|
+
UiCardCta
|
|
34
|
+
},
|
|
29
35
|
setup() {
|
|
30
|
-
return {
|
|
36
|
+
return {
|
|
37
|
+
args
|
|
38
|
+
};
|
|
31
39
|
},
|
|
32
40
|
template: /*html*/ `
|
|
33
41
|
<ui-card-cta v-bind="args" :icon-name="['far', 'face-smile']">
|
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
class="
|
|
4
4
|
ui-card-cta
|
|
5
5
|
w-full
|
|
6
|
-
|
|
6
|
+
rounded-2xl
|
|
7
7
|
border
|
|
8
8
|
border-secondary-alt-500
|
|
9
|
-
|
|
9
|
+
bg-white
|
|
10
10
|
p-sm
|
|
11
11
|
shadow-md
|
|
12
|
-
|
|
12
|
+
outline-0
|
|
13
13
|
hover:border-secondary-700
|
|
14
14
|
focus:shadow-border-primary
|
|
15
15
|
active:bg-secondary-alt-200
|
|
16
|
-
disabled:
|
|
17
|
-
disabled:
|
|
16
|
+
disabled:pointer-events-none
|
|
17
|
+
disabled:bg-secondary-alt-200"
|
|
18
18
|
:disabled="disabled"
|
|
19
19
|
>
|
|
20
20
|
<span
|
|
21
|
-
class="ui-card-cta__wrapper w-full
|
|
21
|
+
class="ui-card-cta__wrapper grid w-full items-center gap-sm"
|
|
22
22
|
:class="[
|
|
23
23
|
invertOrder && 'ui-card-cta_inverted',
|
|
24
24
|
]"
|
|
@@ -13,11 +13,15 @@ export default {
|
|
|
13
13
|
component: UiCardResult,
|
|
14
14
|
argTypes: {
|
|
15
15
|
exclusiveText: {
|
|
16
|
-
control: {
|
|
16
|
+
control: {
|
|
17
|
+
type: "boolean"
|
|
18
|
+
},
|
|
17
19
|
description: "Whether to show the exclusive text",
|
|
18
20
|
},
|
|
19
21
|
exclusiveTextBottom: {
|
|
20
|
-
control: {
|
|
22
|
+
control: {
|
|
23
|
+
type: "boolean"
|
|
24
|
+
},
|
|
21
25
|
description: "Whether to show the exclusive text",
|
|
22
26
|
},
|
|
23
27
|
},
|
|
@@ -31,9 +35,24 @@ export default {
|
|
|
31
35
|
type TComponentProps = InstanceType<typeof UiCardResult>["$props"];
|
|
32
36
|
|
|
33
37
|
const Template: Story<TComponentProps> = (args) => ({
|
|
34
|
-
components: {
|
|
38
|
+
components: {
|
|
39
|
+
UiCardResult,
|
|
40
|
+
UiTypography,
|
|
41
|
+
UiBadge,
|
|
42
|
+
UiListItem,
|
|
43
|
+
UiButton,
|
|
44
|
+
UiIcon
|
|
45
|
+
},
|
|
35
46
|
setup() {
|
|
36
|
-
return {
|
|
47
|
+
return {
|
|
48
|
+
args,
|
|
49
|
+
ETypographySizes,
|
|
50
|
+
ETextWeight,
|
|
51
|
+
ETextAlign,
|
|
52
|
+
EButtonTypes,
|
|
53
|
+
ESize,
|
|
54
|
+
EColors
|
|
55
|
+
};
|
|
37
56
|
},
|
|
38
57
|
template:
|
|
39
58
|
/*html*/`
|