@vc-shell/framework 1.1.0-alpha.3 → 1.1.0-alpha.4
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/core/composables/index.ts +18 -17
- package/core/composables/useDashboard/index.ts +19 -0
- package/core/composables/{useGlobalSearch.ts → useGlobalSearch/index.ts} +3 -5
- package/core/composables/useWidgets/index.ts +19 -18
- package/core/plugins/modularity/loader.ts +2 -1
- package/core/services/dashboard-service.ts +121 -0
- package/core/services/widget-service.ts +1 -4
- package/dist/core/composables/index.d.ts +1 -0
- package/dist/core/composables/index.d.ts.map +1 -1
- package/dist/core/composables/useDashboard/index.d.ts +5 -0
- package/dist/core/composables/useDashboard/index.d.ts.map +1 -0
- package/dist/core/composables/{useGlobalSearch.d.ts → useGlobalSearch/index.d.ts} +1 -1
- package/dist/core/composables/useGlobalSearch/index.d.ts.map +1 -0
- package/dist/core/plugins/modularity/loader.d.ts.map +1 -1
- package/dist/core/services/dashboard-service.d.ts +33 -0
- package/dist/core/services/dashboard-service.d.ts.map +1 -0
- package/dist/core/services/widget-service.d.ts.map +1 -1
- package/dist/framework.js +235 -225
- package/dist/{index-Bu12RZTu.js → index-8LELHzw9.js} +1 -1
- package/dist/{index-Bwl2ND2Q.js → index-9lJxZE5w.js} +1 -1
- package/dist/{index-CJi-BbTb.js → index-B1YR_MYV.js} +1 -1
- package/dist/{index-BhdwVgUw.js → index-BA98L1jI.js} +1 -1
- package/dist/{index-NdrUF1u3.js → index-BAeTsi-X.js} +1 -1
- package/dist/{index-CbRqPQTw.js → index-BBYyHeYA.js} +1 -1
- package/dist/{index-CsaYfhir.js → index-BrUitdDo.js} +1 -1
- package/dist/{index-CZ_pj3nW.js → index-BuO5ByG9.js} +1 -1
- package/dist/{index-DFPb-jDP.js → index-CJ5I7vTn.js} +1 -1
- package/dist/{index-BdoAu2fz.js → index-CWKrD2Cd.js} +1 -1
- package/dist/{index-DVaMW7gL.js → index-Cf9Tz1ql.js} +1 -1
- package/dist/{index-B89uIUkS.js → index-CrxFDC2b.js} +1 -1
- package/dist/{index-BcQiBkO6.js → index-D1JchciU.js} +1 -1
- package/dist/{index-CEvuTGIu.js → index-DLtsQ_PJ.js} +31254 -31134
- package/dist/{index-COjjAS6v.js → index-DVljTjbf.js} +1 -1
- package/dist/{index-DjQ6Ffv8.js → index-RwX3kiZh.js} +28 -28
- package/dist/{index-S9Ht7s3i.js → index-xLYzNPa7.js} +1 -1
- package/dist/index.css +1 -1
- package/dist/injection-keys.d.ts +28 -0
- package/dist/injection-keys.d.ts.map +1 -1
- package/dist/shared/components/dashboard-widget-card/dashboard-widget-card.vue.d.ts +25 -0
- package/dist/shared/components/dashboard-widget-card/dashboard-widget-card.vue.d.ts.map +1 -0
- package/dist/shared/components/dashboard-widget-card/index.d.ts +2 -0
- package/dist/shared/components/dashboard-widget-card/index.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/DraggableDashboard.vue.d.ts +6 -0
- package/dist/shared/components/draggable-dashboard/DraggableDashboard.vue.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/_internal/DashboardWidget.vue.d.ts +20 -0
- package/dist/shared/components/draggable-dashboard/_internal/DashboardWidget.vue.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.d.ts +354 -0
- package/dist/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/composables/useDashboardGrid.d.ts +12 -0
- package/dist/shared/components/draggable-dashboard/composables/useDashboardGrid.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/index.d.ts +2 -0
- package/dist/shared/components/draggable-dashboard/index.d.ts.map +1 -0
- package/dist/shared/components/draggable-dashboard/types.d.ts +80 -0
- package/dist/shared/components/draggable-dashboard/types.d.ts.map +1 -0
- package/dist/shared/components/index.d.ts +2 -0
- package/dist/shared/components/index.d.ts.map +1 -1
- package/dist/shared/components/user-dropdown-button/_internal/user-info.vue.d.ts.map +1 -1
- package/dist/shared/components/user-dropdown-button/user-dropdown-button.vue.d.ts.map +1 -1
- package/dist/shared/composables/useMenuExpanded.d.ts +2 -0
- package/dist/shared/composables/useMenuExpanded.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/Button.stories.d.ts +0 -41
- package/dist/shared/modules/dynamic/components/fields/storybook/Button.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/Card.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +2 -25
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -1
- package/dist/tailwind.config.d.ts +1 -81
- package/dist/tailwind.config.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/atoms/vc-button/vc-button.stories.d.ts +169 -734
- package/dist/ui/components/atoms/vc-button/vc-button.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-button/vc-button.vue.d.ts +18 -2
- package/dist/ui/components/atoms/vc-button/vc-button.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-card/index.d.ts +2 -0
- package/dist/ui/components/atoms/vc-card/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-card/vc-card.stories.d.ts +12 -0
- package/dist/ui/components/atoms/vc-card/vc-card.stories.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-card/vc-card.vue.d.ts +2 -0
- package/dist/ui/components/atoms/vc-card/vc-card.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue.d.ts +18 -0
- package/dist/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue.d.ts +18 -0
- package/dist/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-icon/icons/index.d.ts +2 -0
- package/dist/ui/components/atoms/vc-icon/icons/index.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/composables/useAppMenuState.d.ts +2 -0
- package/dist/ui/components/organisms/vc-app/_internal/composables/useAppMenuState.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts +0 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue.d.ts +2 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.stories.d.ts +13 -67
- package/dist/ui/components/organisms/vc-app/vc-app.stories.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts +5 -65
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-base-header/vc-table-base-header.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/{vc-table-header/vc-table-header.vue.d.ts → vc-table-columns-header/vc-table-columns-header.vue.d.ts} +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-columns-header/vc-table-columns-header.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue.d.ts +33 -3
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/composables/useTableRowReorder.d.ts.map +1 -1
- package/package.json +10 -5
- package/shared/components/dashboard-widget-card/dashboard-widget-card.vue +67 -0
- package/shared/components/dashboard-widget-card/index.ts +1 -0
- package/shared/components/draggable-dashboard/DraggableDashboard.vue +369 -0
- package/shared/components/draggable-dashboard/_internal/DashboardWidget.vue +133 -0
- package/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.ts +547 -0
- package/shared/components/draggable-dashboard/composables/useDashboardGrid.ts +250 -0
- package/shared/components/draggable-dashboard/index.ts +1 -0
- package/shared/components/draggable-dashboard/types.ts +91 -0
- package/shared/components/index.ts +2 -0
- package/shared/components/user-dropdown-button/_internal/user-info.vue +25 -12
- package/shared/components/user-dropdown-button/user-dropdown-button.vue +3 -3
- package/shared/composables/useMenuExpanded.ts +24 -0
- package/shared/modules/assets/components/assets-details/assets-details.vue +1 -1
- package/shared/modules/dynamic/components/fields/storybook/Button.stories.ts +186 -247
- package/shared/modules/dynamic/components/fields/storybook/Card.stories.ts +175 -176
- package/shared/modules/dynamic/components/fields/storybook/common/templates.ts +8 -8
- package/shared/modules/dynamic/pages/dynamic-blade-list.vue +153 -187
- package/tailwind.config.ts +127 -126
- package/ui/components/atoms/vc-button/vc-button.stories.ts +1 -16
- package/ui/components/atoms/vc-button/vc-button.vue +74 -63
- package/ui/components/atoms/vc-card/vc-card.stories.ts +102 -102
- package/ui/components/atoms/vc-card/vc-card.vue +164 -159
- package/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue +22 -0
- package/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue +16 -0
- package/ui/components/atoms/vc-icon/icons/index.ts +2 -0
- package/ui/components/molecules/vc-field/vc-field.vue +1 -1
- package/ui/components/organisms/vc-app/_internal/composables/useAppMenuState.ts +12 -1
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarContent.vue +1 -2
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarHeader.vue +1 -1
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarOverlay.vue +0 -1
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +274 -112
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +81 -37
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue +7 -5
- package/ui/components/organisms/vc-app/vc-app.vue +26 -15
- package/ui/components/organisms/vc-table/_internal/vc-table-base-header/vc-table-base-header.vue +5 -7
- package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/{vc-table-header/vc-table-header.vue → vc-table-columns-header/vc-table-columns-header.vue} +23 -21
- package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-row/vc-table-row.vue +1 -0
- package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/vc-table-desktop-view.vue +1 -1
- package/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue +12 -1
- package/ui/components/organisms/vc-table/_internal/vc-table-mobile-view/vc-table-mobile-view.vue +45 -2
- package/ui/components/organisms/vc-table/composables/useTableColumnReorder.ts +5 -5
- package/ui/components/organisms/vc-table/composables/useTableColumnResize.ts +1 -1
- package/ui/components/organisms/vc-table/composables/useTableRowReorder.ts +1 -0
- package/core/services/toolbarbus-service.ts +0 -34
- package/dist/core/composables/useGlobalSearch.d.ts.map +0 -1
- package/dist/core/services/toolbarbus-service.d.ts +0 -10
- package/dist/core/services/toolbarbus-service.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-app/composables/useToolbarSlots.d.ts +0 -5
- package/dist/ui/components/organisms/vc-app/composables/useToolbarSlots.d.ts.map +0 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-header/vc-table-header.vue.d.ts.map +0 -1
- package/ui/components/organisms/vc-app/composables/useToolbarSlots.ts +0 -37
package/tailwind.config.ts
CHANGED
|
@@ -1,126 +1,127 @@
|
|
|
1
|
-
/** @type { import('tailwindcss').Config } */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"
|
|
6
|
-
"./
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
1
|
+
/** @type { import('tailwindcss').Config } */
|
|
2
|
+
import type { Config } from "tailwindcss";
|
|
3
|
+
|
|
4
|
+
export const content = [
|
|
5
|
+
"../../node_modules/@vc-shell/**/*.{vue,js,ts,jsx,tsx}",
|
|
6
|
+
"./ui/components/**/*.{vue,js,ts,jsx,tsx}",
|
|
7
|
+
"./shared/**/*.{vue,js,ts,jsx,tsx}",
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
prefix: "tw-",
|
|
12
|
+
theme: {
|
|
13
|
+
fontFamily: {
|
|
14
|
+
jakarta: ["Plus Jakarta Sans", "sans-serif"],
|
|
15
|
+
},
|
|
16
|
+
fontSize: {
|
|
17
|
+
xxs: [
|
|
18
|
+
"0.625rem", //10px
|
|
19
|
+
{
|
|
20
|
+
lineHeight: "0.75rem", //12px
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
xs: [
|
|
24
|
+
"0.75rem", //12px
|
|
25
|
+
{
|
|
26
|
+
lineHeight: "0.875rem", //14px
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
sm: [
|
|
30
|
+
"0.875rem", //14px
|
|
31
|
+
{
|
|
32
|
+
lineHeight: "1.125rem", //18px
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
s: [
|
|
36
|
+
"0.875rem", //14px
|
|
37
|
+
{
|
|
38
|
+
lineHeight: "1.125rem", //18px
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
base: [
|
|
42
|
+
"1rem", //16px
|
|
43
|
+
{
|
|
44
|
+
lineHeight: "1.25rem", //20px
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
lg: [
|
|
48
|
+
"1.125rem", //18px
|
|
49
|
+
{
|
|
50
|
+
lineHeight: "1.375rem", //22px
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
xl: [
|
|
54
|
+
"1.25rem", //20px
|
|
55
|
+
{
|
|
56
|
+
lineHeight: "1.75rem", //28px
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
"2xl": [
|
|
60
|
+
"1.5rem", //24px
|
|
61
|
+
{
|
|
62
|
+
lineHeight: "2rem", //32px
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
"3xl": [
|
|
66
|
+
"1.875rem", //30px
|
|
67
|
+
{
|
|
68
|
+
lineHeight: "2.25rem", //36px
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
"4xl": [
|
|
72
|
+
"2.25rem", //36px
|
|
73
|
+
{
|
|
74
|
+
lineHeight: "2.5rem", //40px
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
"5xl": [
|
|
78
|
+
"3rem", //48px
|
|
79
|
+
{
|
|
80
|
+
lineHeight: "3rem", //48px
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
"6xl": [
|
|
84
|
+
"3.75rem", //60px
|
|
85
|
+
{
|
|
86
|
+
lineHeight: "3.75rem", //60px
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
"7xl": [
|
|
90
|
+
"4.5rem", //72px
|
|
91
|
+
{
|
|
92
|
+
lineHeight: "4.5rem", //72px
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
"8xl": [
|
|
96
|
+
"6rem", //96px
|
|
97
|
+
{
|
|
98
|
+
lineHeight: "6rem", //96px
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
extend: {
|
|
103
|
+
keyframes: {
|
|
104
|
+
loadingMarker: {
|
|
105
|
+
"50%": { transform: "translateX(96px)" },
|
|
106
|
+
},
|
|
107
|
+
loadingMarkers: {
|
|
108
|
+
"50%": { transform: "translateX(-31px)" },
|
|
109
|
+
},
|
|
110
|
+
loadingProgress: {
|
|
111
|
+
from: {
|
|
112
|
+
"background-position": "0 0, left",
|
|
113
|
+
},
|
|
114
|
+
to: {
|
|
115
|
+
"background-position": "30px 0, left",
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
animation: {
|
|
120
|
+
loadingMarker: "loadingMarker 3s infinite",
|
|
121
|
+
loadingMarkers: "loadingMarkers 3s infinite",
|
|
122
|
+
loadingProgress: "loadingProgress 1s linear infinite",
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
content,
|
|
127
|
+
} as Config;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
2
2
|
import { VcButton } from "./";
|
|
3
3
|
|
|
4
|
-
const COLORS = ["primary", "
|
|
4
|
+
const COLORS = ["primary", "secondary"];
|
|
5
5
|
|
|
6
6
|
const PROPERTY = ["disabled", "small", "outline", "selected", "text", "raised"];
|
|
7
7
|
|
|
@@ -61,21 +61,12 @@ export const Basic = Template.bind({});
|
|
|
61
61
|
export const Disabled = Template.bind({});
|
|
62
62
|
Disabled.args = { disabled: true };
|
|
63
63
|
|
|
64
|
-
export const Small = Template.bind({});
|
|
65
|
-
Small.args = { small: true };
|
|
66
|
-
|
|
67
|
-
export const Outline = Template.bind({});
|
|
68
|
-
Outline.args = { outline: true };
|
|
69
|
-
|
|
70
64
|
export const Selected = Template.bind({});
|
|
71
65
|
Selected.args = { selected: true };
|
|
72
66
|
|
|
73
67
|
export const Text = Template.bind({});
|
|
74
68
|
Text.args = { text: true };
|
|
75
69
|
|
|
76
|
-
export const Raised = Template.bind({});
|
|
77
|
-
Raised.args = { raised: true };
|
|
78
|
-
|
|
79
70
|
export const Icon = Template.bind({});
|
|
80
71
|
Icon.args = { icon: "fas fa-plus" };
|
|
81
72
|
|
|
@@ -85,12 +76,6 @@ IconClass.args = { icon: "fas fa-plus", iconClass: "tw-text-red" };
|
|
|
85
76
|
export const IconSize = Template.bind({});
|
|
86
77
|
IconSize.args = { icon: "fas fa-plus", iconSize: "l" };
|
|
87
78
|
|
|
88
|
-
export const Warning = Template.bind({});
|
|
89
|
-
Warning.args = { variant: "warning" };
|
|
90
|
-
|
|
91
|
-
export const Danger = Template.bind({});
|
|
92
|
-
Danger.args = { variant: "danger" };
|
|
93
|
-
|
|
94
79
|
export const AllStates: StoryFn<typeof VcButton> = () => ({
|
|
95
80
|
components: { VcButton },
|
|
96
81
|
setup: () => ({ colors: COLORS, properties: PROPERTY }),
|
|
@@ -26,12 +26,25 @@ export interface Props {
|
|
|
26
26
|
icon?: string | Component;
|
|
27
27
|
iconClass?: string;
|
|
28
28
|
iconSize?: InstanceType<typeof VcIcon>["$props"]["size"];
|
|
29
|
-
variant?: "primary" | "
|
|
29
|
+
variant?: "primary" | "secondary";
|
|
30
30
|
disabled?: boolean;
|
|
31
|
+
size?: "xs" | "sm" | "base";
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated Use `size` instead
|
|
34
|
+
* Whether the button is small
|
|
35
|
+
* */
|
|
31
36
|
small?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated Use `variant` instead
|
|
39
|
+
* Whether the button is outlined
|
|
40
|
+
* */
|
|
32
41
|
outline?: boolean;
|
|
33
42
|
selected?: boolean;
|
|
34
43
|
text?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated Use `variant` instead
|
|
46
|
+
* Whether the button is raised
|
|
47
|
+
* */
|
|
35
48
|
raised?: boolean;
|
|
36
49
|
}
|
|
37
50
|
|
|
@@ -45,6 +58,7 @@ export interface Emits {
|
|
|
45
58
|
const props = withDefaults(defineProps<Props>(), {
|
|
46
59
|
variant: "primary",
|
|
47
60
|
iconSize: "s",
|
|
61
|
+
size: "base",
|
|
48
62
|
});
|
|
49
63
|
|
|
50
64
|
const emit = defineEmits<Emits>();
|
|
@@ -58,11 +72,12 @@ const buttonClass = computed(() => {
|
|
|
58
72
|
"vc-button",
|
|
59
73
|
{
|
|
60
74
|
[`vc-button-${props.variant}`]: props.variant,
|
|
75
|
+
[`vc-button_${props.size}`]: props.size,
|
|
61
76
|
"vc-button_small": props.small,
|
|
62
|
-
"vc-button_outline": props.outline,
|
|
77
|
+
// "vc-button_outline": props.outline,
|
|
63
78
|
"vc-button_selected": props.selected,
|
|
64
79
|
"vc-button_text": props.text,
|
|
65
|
-
"vc-button_raised": props.raised,
|
|
80
|
+
// "vc-button_raised": props.raised,
|
|
66
81
|
},
|
|
67
82
|
];
|
|
68
83
|
});
|
|
@@ -80,38 +95,38 @@ function onClick(e: Event): void {
|
|
|
80
95
|
--button-primary-background-color: var(--primary-500);
|
|
81
96
|
--button-primary-background-color-hover: var(--primary-600);
|
|
82
97
|
--button-primary-background-color-disabled: var(--primary-300);
|
|
83
|
-
--button-primary-text-color: var(--
|
|
84
|
-
--button-primary-text-color-
|
|
85
|
-
--button-primary-
|
|
86
|
-
|
|
87
|
-
--button-
|
|
88
|
-
|
|
89
|
-
--button-
|
|
90
|
-
--button-
|
|
91
|
-
--button-
|
|
92
|
-
--button-
|
|
93
|
-
|
|
94
|
-
--button-
|
|
95
|
-
--button-
|
|
96
|
-
--button-
|
|
97
|
-
|
|
98
|
-
--button-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
--button-border-radius: 3px;
|
|
98
|
+
--button-primary-text-color: var(--additional-50);
|
|
99
|
+
--button-primary-text-color-disabled: var(--additional-50);
|
|
100
|
+
--button-primary-border-color: var(--primary-500);
|
|
101
|
+
--button-primary-border-color-hover: var(--primary-600);
|
|
102
|
+
--button-primary-border-color-disabled: var(--primary-300);
|
|
103
|
+
|
|
104
|
+
--button-secondary-background-color: var(--additional-50);
|
|
105
|
+
--button-secondary-background-color-hover: var(--primary-100);
|
|
106
|
+
--button-secondary-background-color-disabled: var(--additional-50);
|
|
107
|
+
--button-secondary-text-color: var(--neutrals-700);
|
|
108
|
+
--button-secondary-text-color-disabled: var(--neutrals-400);
|
|
109
|
+
--button-secondary-border-color: var(--secondary-300);
|
|
110
|
+
--button-secondary-border-color-hover: var(--secondary-400);
|
|
111
|
+
--button-secondary-border-color-disabled: var(--secondary-300);
|
|
112
|
+
|
|
113
|
+
--button-border-radius: 4px;
|
|
114
|
+
|
|
102
115
|
--button-padding-hor: 14px;
|
|
103
|
-
--button-padding-hor-small: 14px;
|
|
104
116
|
--button-padding-vert: 10px;
|
|
105
|
-
|
|
117
|
+
|
|
118
|
+
--button-padding-hor-small: 12px;
|
|
119
|
+
--button-padding-vert-small: 8px;
|
|
120
|
+
|
|
121
|
+
--button-padding-vert-extra-small: 5px;
|
|
122
|
+
--button-padding-hor-extra-small: 12px;
|
|
106
123
|
|
|
107
124
|
--button-height: 36px;
|
|
108
125
|
--button-height-small: 28px;
|
|
109
|
-
|
|
110
|
-
--button-raised-shadow-color: var(--secondary-200);
|
|
111
|
-
--button-raised-shadow: 1px 4px 10px rgb(from var(--button-raised-shadow-color) r g b / 100%);
|
|
126
|
+
--button-height-extra-small: 22px;
|
|
112
127
|
}
|
|
113
128
|
|
|
114
|
-
$variants: primary,
|
|
129
|
+
$variants: primary, secondary;
|
|
115
130
|
|
|
116
131
|
.vc-button {
|
|
117
132
|
&__icon + &__title {
|
|
@@ -120,34 +135,29 @@ $variants: primary, warning, danger;
|
|
|
120
135
|
|
|
121
136
|
@each $variant in $variants {
|
|
122
137
|
&.vc-button-#{$variant} {
|
|
123
|
-
@apply tw-inline-flex tw-items-center tw-font-
|
|
124
|
-
tw-rounded-[var(--button-border-radius)]
|
|
138
|
+
@apply tw-inline-flex tw-items-center tw-font-semibold tw-cursor-pointer tw-box-border tw-transition tw-duration-200
|
|
139
|
+
tw-rounded-[var(--button-border-radius)]
|
|
125
140
|
tw-min-h-[var(--button-height)]
|
|
126
141
|
tw-bg-[color:var(--button-#{$variant}-background-color)]
|
|
142
|
+
tw-border tw-border-[color:var(--button-#{$variant}-border-color)] tw-border-solid
|
|
127
143
|
tw-flex tw-justify-center
|
|
128
|
-
tw-text-[color:var(--button-#{$variant}-text-color)]
|
|
129
|
-
hover:tw-bg-[color:var(--button-#{$variant}-background-color-hover)]
|
|
130
|
-
focus:tw-bg-[color:var(--button-#{$variant}-background-color-hover)]
|
|
131
|
-
disabled:tw-cursor-not-allowed
|
|
132
|
-
disabled:tw-bg-[color:var(--button-#{$variant}-background-color-disabled)];
|
|
144
|
+
tw-text-[color:var(--button-#{$variant}-text-color)];
|
|
133
145
|
|
|
134
|
-
|
|
135
|
-
@apply tw-
|
|
146
|
+
&:hover {
|
|
147
|
+
@apply tw-bg-[color:var(--button-#{$variant}-background-color-hover)] tw-border-[color:var(--button-#{$variant}-border-color-hover)];
|
|
148
|
+
}
|
|
136
149
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
150
|
+
&:focus {
|
|
151
|
+
@apply tw-bg-[color:var(--button-#{$variant}-background-color-hover)] tw-border-[color:var(--button-#{$variant}-border-color-hover)];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&:disabled {
|
|
155
|
+
@apply tw-bg-[color:var(--button-#{$variant}-background-color-disabled)] tw-border-[color:var(--button-#{$variant}-border-color-disabled)] tw-cursor-not-allowed;
|
|
140
156
|
}
|
|
141
157
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
tw-
|
|
145
|
-
hover:tw-text-[color:var(--button-#{$variant}-text-color-hover)]
|
|
146
|
-
hover:tw-bg-transparent
|
|
147
|
-
hover:tw-border-[color:var(--button-#{$variant}-background-color-hover)]
|
|
148
|
-
disabled:tw-text-[color:rgb(from_var(--button-#{$variant}-text-color-hover)_r_g_b/50%)]
|
|
149
|
-
disabled:tw-border-[color:rgb(from_var(--button-#{$variant}-background-color)_r_g_b/50%)]
|
|
150
|
-
disabled:tw-bg-transparent;
|
|
158
|
+
// TODO: remove this after the migration
|
|
159
|
+
&.vc-button_small {
|
|
160
|
+
@apply tw-py-[var(--button-padding-vert-extra-small)] tw-min-h-[var(--button-height-extra-small)] tw-px-[var(--button-padding-hor-extra-small)] tw-text-xxs;
|
|
151
161
|
}
|
|
152
162
|
|
|
153
163
|
&.vc-button_text {
|
|
@@ -158,27 +168,28 @@ $variants: primary, warning, danger;
|
|
|
158
168
|
disabled:tw-text-[color:rgb(from_var(--button-#{$variant}-background-color)_r_g_b/50%)];
|
|
159
169
|
}
|
|
160
170
|
|
|
161
|
-
&.vc-button_raised {
|
|
162
|
-
@apply [box-shadow:var(--button-raised-shadow)] tw-px-[var(--button-padding-hor)] tw-py-[var(--button-padding-vert)];
|
|
163
|
-
|
|
164
|
-
&.vc-button_text:not(:disabled) {
|
|
165
|
-
&:hover,
|
|
166
|
-
&:focus {
|
|
167
|
-
@apply tw-bg-[color:rgb(from_var(--button-#{$variant}-background-color-hover)_r_g_b/7%)];
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
171
|
&.vc-button_selected {
|
|
173
172
|
@apply tw-bg-[color:var(--button-#{$variant}-background-color-hover)];
|
|
174
173
|
|
|
175
174
|
&.vc-button_text {
|
|
176
175
|
@apply tw-bg-[color:rgb(from_var(--button-#{$variant}-background-color-hover)_r_g_b/7%)] tw-p-1;
|
|
177
176
|
}
|
|
177
|
+
}
|
|
178
178
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
&.vc-button_xs {
|
|
180
|
+
@apply tw-py-[var(--button-padding-vert-extra-small)] tw-min-h-[var(--button-height-extra-small)] tw-px-[var(--button-padding-hor-extra-small)] tw-text-xxs;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
&.vc-button_sm {
|
|
184
|
+
@apply tw-py-[var(--button-padding-vert-small)] tw-min-h-[var(--button-height-small)] tw-px-[var(--button-padding-hor-small)] tw-text-xs;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
&.vc-button_base {
|
|
188
|
+
@apply tw-py-[var(--button-padding-vert)] tw-min-h-[var(--button-height)] tw-px-[var(--button-padding-hor)] tw-text-sm tw-leading-4;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.vc-button__icon + .vc-button__title {
|
|
192
|
+
@apply tw-ml-2;
|
|
182
193
|
}
|
|
183
194
|
}
|
|
184
195
|
}
|