@kalink-ui/seedly 0.8.1 → 0.10.0
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/CHANGELOG.md +20 -0
- package/package.json +26 -18
- package/src/components/box/box.css.ts +6 -15
- package/src/components/box/box.tsx +2 -2
- package/src/components/box/index.ts +1 -1
- package/src/components/button/button.css.ts +45 -48
- package/src/components/button/button.tsx +11 -8
- package/src/components/button/index.ts +1 -1
- package/src/components/button-icon/button-icon.css.ts +90 -0
- package/src/components/button-icon/button-icon.tsx +23 -0
- package/src/components/button-icon/index.ts +1 -0
- package/src/components/card/card.css.ts +42 -0
- package/src/components/card/card.tsx +76 -0
- package/src/components/card/index.ts +1 -0
- package/src/components/center/center.css.ts +1 -1
- package/src/components/center/center.tsx +2 -2
- package/src/components/center/index.ts +1 -1
- package/src/components/cluster/cluster.css.ts +18 -1
- package/src/components/cluster/cluster.tsx +2 -2
- package/src/components/cluster/index.ts +1 -1
- package/src/components/cover/cover.css.ts +1 -1
- package/src/components/divider/divider.css.ts +11 -0
- package/src/components/divider/divider.tsx +11 -0
- package/src/components/divider/index.ts +1 -0
- package/src/components/form-field/form-field-context.ts +18 -0
- package/src/components/form-field/form-field-control.tsx +34 -0
- package/src/components/form-field/form-field-description.tsx +16 -0
- package/src/components/form-field/form-field-error.tsx +22 -0
- package/src/components/form-field/form-field-item-context.ts +6 -0
- package/src/components/form-field/form-field-item.tsx +28 -0
- package/src/components/form-field/form-field-label.tsx +27 -0
- package/src/components/form-field/form-field-message.tsx +33 -0
- package/src/components/form-field/form-field.css.ts +97 -0
- package/src/components/form-field/form-field.tsx +56 -0
- package/src/components/form-field/index.ts +9 -0
- package/src/components/frame/frame.css.ts +8 -8
- package/src/components/frame/frame.tsx +2 -6
- package/src/components/frame/index.ts +1 -1
- package/src/components/grid/grid.css.ts +1 -1
- package/src/components/heading/heading.css.ts +49 -2
- package/src/components/heading/heading.tsx +123 -69
- package/src/components/heading/index.ts +2 -1
- package/src/components/index.ts +27 -14
- package/src/components/input/index.ts +2 -0
- package/src/components/input/input-wrapper.tsx +58 -0
- package/src/components/input/input.css.ts +250 -0
- package/src/components/input/input.tsx +56 -0
- package/src/components/label/index.ts +1 -0
- package/src/components/label/label.css.ts +37 -0
- package/src/components/label/label.tsx +23 -0
- package/src/components/loader/index.ts +1 -0
- package/src/components/loader/loader.css.ts +109 -0
- package/src/components/loader/moon-loader.tsx +43 -0
- package/src/components/loader-overlay/index.ts +1 -0
- package/src/components/loader-overlay/loader-overlay.css.ts +35 -0
- package/src/components/loader-overlay/loader-overlay.tsx +28 -0
- package/src/components/menu/index.ts +2 -0
- package/src/components/menu/menu-item.css.ts +79 -0
- package/src/components/menu/menu-separator.css.ts +53 -0
- package/src/components/popover/index.ts +3 -0
- package/src/components/popover/popover-content.css.ts +107 -0
- package/src/components/popover/popover-content.tsx +78 -0
- package/src/components/popover/popover.tsx +6 -0
- package/src/components/scroll-area/index.ts +1 -0
- package/src/components/scroll-area/scroll-area.css.ts +72 -0
- package/src/components/scroll-area/scroll-area.tsx +39 -0
- package/src/components/scroll-area/scroll-bar.tsx +37 -0
- package/src/components/seed/index.ts +1 -1
- package/src/components/seed/seed.tsx +39 -2
- package/src/components/select/index.ts +5 -0
- package/src/components/select/select-content.css.ts +22 -0
- package/src/components/select/select-content.tsx +51 -0
- package/src/components/select/select-item.css.ts +24 -0
- package/src/components/select/select-item.tsx +24 -0
- package/src/components/select/select-root.tsx +14 -0
- package/src/components/select/select-trigger.css.ts +75 -0
- package/src/components/select/select-trigger.tsx +47 -0
- package/src/components/select/select.tsx +85 -0
- package/src/components/sheet/index.ts +5 -0
- package/src/components/sheet/sheet-content.css.ts +143 -0
- package/src/components/sheet/sheet-content.tsx +43 -0
- package/src/components/sheet/sheet-description.tsx +21 -0
- package/src/components/sheet/sheet-footer.tsx +15 -0
- package/src/components/sheet/sheet-header.css.ts +35 -0
- package/src/components/sheet/sheet-header.tsx +32 -0
- package/src/components/sheet/sheet-overlay.css.ts +43 -0
- package/src/components/sheet/sheet-overlay.tsx +14 -0
- package/src/components/sheet/sheet-title.tsx +31 -0
- package/src/components/sheet/sheet.tsx +8 -0
- package/src/components/stack/index.ts +1 -1
- package/src/components/stack/stack.tsx +2 -2
- package/src/components/text/index.ts +6 -0
- package/src/components/text/text.css.ts +173 -7
- package/src/components/text/text.tsx +19 -27
- package/src/components/text-field/index.ts +1 -0
- package/src/components/text-field/text-field.css.ts +3 -0
- package/src/components/text-field/text-field.tsx +64 -0
- package/src/components/textarea/index.ts +1 -0
- package/src/components/textarea/textarea-input.tsx +20 -0
- package/src/components/textarea/textarea.css.ts +10 -0
- package/src/components/textarea/textarea.tsx +69 -0
- package/src/styles/define-responsive-properties.ts +242 -0
- package/src/styles/extract-sprinkles-props.ts +29 -35
- package/src/styles/index.ts +9 -0
- package/src/styles/reset.css.ts +1 -0
- package/src/styles/system-contract.css.ts +0 -2
- package/src/styles/typography.css.ts +10 -5
- package/src/styles/visually-hidden.css.ts +21 -0
- package/build-storybook.log +0 -67
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @kalink-ui/seedly
|
|
2
2
|
|
|
3
|
+
## 0.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 84903c1: Add multiple components
|
|
8
|
+
|
|
9
|
+
- ButtonIcon
|
|
10
|
+
- TextField
|
|
11
|
+
- Select
|
|
12
|
+
- Textarea
|
|
13
|
+
- Label
|
|
14
|
+
- Loader
|
|
15
|
+
- LoaderOverly
|
|
16
|
+
|
|
17
|
+
## 0.9.0
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- 7fe5a15: Fix issues with TypeScript config and setup Github Actions
|
|
22
|
+
|
|
3
23
|
## 0.8.1
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kalink-ui/seedly",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "A set of components for building UIs with React and TypeScript",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@chromatic-com/storybook": "^3.2.5",
|
|
20
|
-
"@storybook/addon-docs": "^8.6.
|
|
21
|
-
"@storybook/addon-essentials": "^8.6.
|
|
22
|
-
"@storybook/addon-interactions": "^8.6.
|
|
23
|
-
"@storybook/addon-onboarding": "^8.6.
|
|
24
|
-
"@storybook/blocks": "^8.6.
|
|
25
|
-
"@storybook/react": "^8.6.
|
|
26
|
-
"@storybook/react-vite": "^8.6.
|
|
27
|
-
"@storybook/test": "^8.6.
|
|
20
|
+
"@storybook/addon-docs": "^8.6.9",
|
|
21
|
+
"@storybook/addon-essentials": "^8.6.9",
|
|
22
|
+
"@storybook/addon-interactions": "^8.6.9",
|
|
23
|
+
"@storybook/addon-onboarding": "^8.6.9",
|
|
24
|
+
"@storybook/blocks": "^8.6.9",
|
|
25
|
+
"@storybook/react": "^8.6.9",
|
|
26
|
+
"@storybook/react-vite": "^8.6.9",
|
|
27
|
+
"@storybook/test": "^8.6.9",
|
|
28
28
|
"@turbo/gen": "^2.4.4",
|
|
29
29
|
"@types/node": "^22.13.9",
|
|
30
30
|
"@types/react": "19.0.10",
|
|
@@ -40,15 +40,15 @@
|
|
|
40
40
|
"react": "^19.0.0",
|
|
41
41
|
"react-docgen-typescript": "^2.2.2",
|
|
42
42
|
"react-dom": "^19.0.0",
|
|
43
|
-
"storybook": "^8.6.
|
|
43
|
+
"storybook": "^8.6.9",
|
|
44
44
|
"type-fest": "^4.37.0",
|
|
45
|
-
"typescript": "5.8.2",
|
|
45
|
+
"typescript": "^5.8.2",
|
|
46
46
|
"vite": "^6.2.1",
|
|
47
47
|
"vite-tsconfig-paths": "^5.1.4",
|
|
48
48
|
"vitest": "^3.0.8",
|
|
49
|
-
"@kalink-ui/
|
|
50
|
-
"@kalink-ui/eslint-config": "0.
|
|
51
|
-
"@kalink-ui/
|
|
49
|
+
"@kalink-ui/dibbly": "0.4.0",
|
|
50
|
+
"@kalink-ui/eslint-config": "0.9.0",
|
|
51
|
+
"@kalink-ui/typescript-config": "0.4.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@vanilla-extract/css": "^1.17.1",
|
|
@@ -57,19 +57,27 @@
|
|
|
57
57
|
"@vanilla-extract/recipes": "^0.5.5",
|
|
58
58
|
"@vanilla-extract/sprinkles": "^1.6.3",
|
|
59
59
|
"react": "^19.0.0",
|
|
60
|
-
"react-dom": "^19.0.0"
|
|
60
|
+
"react-dom": "^19.0.0",
|
|
61
|
+
"typescript": "^5.8.2"
|
|
61
62
|
},
|
|
62
63
|
"dependencies": {
|
|
64
|
+
"@radix-ui/react-dialog": "^1.1.11",
|
|
65
|
+
"@radix-ui/react-popover": "^1.1.13",
|
|
66
|
+
"@radix-ui/react-scroll-area": "^1.2.6",
|
|
67
|
+
"@radix-ui/react-select": "^2.2.4",
|
|
68
|
+
"@radix-ui/react-slot": "^1.2.0",
|
|
63
69
|
"clsx": "^2.1.1"
|
|
64
70
|
},
|
|
65
71
|
"publishConfig": {
|
|
66
72
|
"access": "public"
|
|
67
73
|
},
|
|
68
74
|
"scripts": {
|
|
69
|
-
"lint": "eslint
|
|
75
|
+
"lint": "eslint --max-warnings 0",
|
|
76
|
+
"lint:fix": "pnpm lint --fix",
|
|
70
77
|
"build-storybook": "storybook build",
|
|
71
78
|
"dev": "storybook dev -p 6006 --no-open",
|
|
72
|
-
"test": "vitest",
|
|
73
|
-
"
|
|
79
|
+
"test": "vitest run",
|
|
80
|
+
"test:watch": "vitest",
|
|
81
|
+
"tsc": "tsc -b"
|
|
74
82
|
}
|
|
75
83
|
}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import { createVar } from '@vanilla-extract/css';
|
|
2
1
|
import { recipe, type RecipeVariants } from '@vanilla-extract/recipes';
|
|
3
2
|
|
|
4
|
-
import { mapContractVars, sys } from '
|
|
5
|
-
import { components } from '
|
|
6
|
-
|
|
7
|
-
export const colorForeground = createVar();
|
|
8
|
-
export const colorBackground = createVar();
|
|
3
|
+
import { mapContractVars, sys } from '@kalink-ui/seedly/styles';
|
|
4
|
+
import { components } from '@kalink-ui/seedly/styles/layers';
|
|
9
5
|
|
|
10
6
|
export const boxRecipe = recipe({
|
|
11
7
|
variants: {
|
|
@@ -16,13 +12,8 @@ export const boxRecipe = recipe({
|
|
|
16
12
|
solid: {
|
|
17
13
|
'@layer': {
|
|
18
14
|
[components]: {
|
|
19
|
-
color:
|
|
20
|
-
backgroundColor:
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
vars: {
|
|
24
|
-
[colorForeground]: sys.color.foreground,
|
|
25
|
-
[colorBackground]: sys.color.background,
|
|
15
|
+
color: sys.color.foreground,
|
|
16
|
+
backgroundColor: sys.color.background,
|
|
26
17
|
},
|
|
27
18
|
},
|
|
28
19
|
},
|
|
@@ -30,10 +21,10 @@ export const boxRecipe = recipe({
|
|
|
30
21
|
outline: {
|
|
31
22
|
'@layer': {
|
|
32
23
|
[components]: {
|
|
33
|
-
color:
|
|
24
|
+
color: sys.color.foreground,
|
|
34
25
|
backgroundColor: 'transparent',
|
|
35
26
|
|
|
36
|
-
borderColor:
|
|
27
|
+
borderColor: sys.color.foreground,
|
|
37
28
|
borderStyle: 'solid',
|
|
38
29
|
borderWidth: '1px',
|
|
39
30
|
},
|
|
@@ -4,8 +4,8 @@ import { ElementType } from 'react';
|
|
|
4
4
|
|
|
5
5
|
import { BoxVariants, boxRecipe } from './box.css';
|
|
6
6
|
|
|
7
|
-
type BoxProps<TUse extends ElementType> =
|
|
8
|
-
BoxVariants;
|
|
7
|
+
export type BoxProps<TUse extends ElementType> =
|
|
8
|
+
PolymorphicComponentProps<TUse> & BoxVariants;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* A evenly spaced container for grouping related elements. Can
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Box } from './box';
|
|
1
|
+
export { Box, type BoxProps } from './box';
|
|
2
2
|
export { boxRecipe, type BoxVariants } from './box.css';
|
|
@@ -13,9 +13,6 @@ import { transition } from '../../styles/transition';
|
|
|
13
13
|
export const buttonVars = createThemeContract({
|
|
14
14
|
borderRadius: null,
|
|
15
15
|
textTransform: null,
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const vars = createThemeContract({
|
|
19
16
|
color: {
|
|
20
17
|
text: null,
|
|
21
18
|
background: null,
|
|
@@ -42,22 +39,22 @@ export const buttonRecipe = recipe({
|
|
|
42
39
|
display: 'flex',
|
|
43
40
|
alignItems: 'center',
|
|
44
41
|
justifyContent: 'center',
|
|
45
|
-
gap:
|
|
42
|
+
gap: buttonVars.spacing.inner,
|
|
46
43
|
|
|
47
|
-
paddingBlock:
|
|
48
|
-
paddingInline:
|
|
44
|
+
paddingBlock: buttonVars.spacing.block,
|
|
45
|
+
paddingInline: buttonVars.spacing.inline,
|
|
49
46
|
|
|
50
|
-
color:
|
|
47
|
+
color: buttonVars.color.text,
|
|
51
48
|
textTransform: fallbackVar(buttonVars.textTransform, 'unset'),
|
|
52
|
-
backgroundColor:
|
|
49
|
+
backgroundColor: buttonVars.color.background,
|
|
53
50
|
borderRadius: fallbackVar(
|
|
54
51
|
buttonVars.borderRadius,
|
|
55
52
|
sys.shape.corner.none,
|
|
56
53
|
),
|
|
57
|
-
borderWidth:
|
|
58
|
-
borderStyle:
|
|
59
|
-
borderColor:
|
|
60
|
-
boxShadow:
|
|
54
|
+
borderWidth: buttonVars.border.width,
|
|
55
|
+
borderStyle: buttonVars.border.style,
|
|
56
|
+
borderColor: buttonVars.border.color,
|
|
57
|
+
boxShadow: buttonVars.shadow.level,
|
|
61
58
|
|
|
62
59
|
transition: transition(
|
|
63
60
|
['background-color', 'box-shadow', 'border-color', 'color'],
|
|
@@ -81,11 +78,11 @@ export const buttonRecipe = recipe({
|
|
|
81
78
|
'@layer': {
|
|
82
79
|
[components]: {
|
|
83
80
|
vars: {
|
|
84
|
-
...assignVars(
|
|
81
|
+
...assignVars(buttonVars.color, {
|
|
85
82
|
text: sys.color.background,
|
|
86
83
|
background: sys.color.foreground,
|
|
87
84
|
}),
|
|
88
|
-
...assignVars(
|
|
85
|
+
...assignVars(buttonVars.border, {
|
|
89
86
|
width: '1px',
|
|
90
87
|
style: 'solid',
|
|
91
88
|
color: 'transparent',
|
|
@@ -93,19 +90,19 @@ export const buttonRecipe = recipe({
|
|
|
93
90
|
},
|
|
94
91
|
':hover': {
|
|
95
92
|
vars: {
|
|
96
|
-
[
|
|
93
|
+
[buttonVars.color.background]:
|
|
97
94
|
`color-mix(in srgb, ${sys.color.foreground}, ${sys.color.background} calc(100% * ${sys.state.hovered.opacity}))`,
|
|
98
|
-
[
|
|
95
|
+
[buttonVars.shadow.level]: sys.elevation.minimal,
|
|
99
96
|
},
|
|
100
97
|
},
|
|
101
98
|
':disabled': {
|
|
102
99
|
vars: {
|
|
103
|
-
...assignVars(
|
|
100
|
+
...assignVars(buttonVars.color, {
|
|
104
101
|
text: `color-mix(in srgb, ${sys.color.background} calc(100% * ${sys.state.muted.light}), transparent)`,
|
|
105
102
|
background: `color-mix(in srgb, ${sys.color.foreground} calc(100% * ${sys.state.muted.dark}), transparent)`,
|
|
106
103
|
}),
|
|
107
|
-
[
|
|
108
|
-
[
|
|
104
|
+
[buttonVars.shadow.level]: sys.elevation.none,
|
|
105
|
+
[buttonVars.border.color]: `transparent`,
|
|
109
106
|
},
|
|
110
107
|
},
|
|
111
108
|
},
|
|
@@ -115,11 +112,11 @@ export const buttonRecipe = recipe({
|
|
|
115
112
|
'@layer': {
|
|
116
113
|
[components]: {
|
|
117
114
|
vars: {
|
|
118
|
-
...assignVars(
|
|
115
|
+
...assignVars(buttonVars.color, {
|
|
119
116
|
text: sys.color.foreground,
|
|
120
117
|
background: 'unset',
|
|
121
118
|
}),
|
|
122
|
-
...assignVars(
|
|
119
|
+
...assignVars(buttonVars.border, {
|
|
123
120
|
width: '1px',
|
|
124
121
|
style: 'solid',
|
|
125
122
|
color: sys.color.foreground,
|
|
@@ -128,16 +125,16 @@ export const buttonRecipe = recipe({
|
|
|
128
125
|
selectors: {
|
|
129
126
|
'&:hover': {
|
|
130
127
|
vars: {
|
|
131
|
-
[
|
|
128
|
+
[buttonVars.color.background]:
|
|
132
129
|
`color-mix(in srgb, ${sys.color.foreground} calc(100% * ${sys.state.hovered.opacity}), transparent)`,
|
|
133
130
|
},
|
|
134
131
|
},
|
|
135
132
|
'&:disabled': {
|
|
136
133
|
vars: {
|
|
137
|
-
[
|
|
138
|
-
[
|
|
134
|
+
[buttonVars.color.background]: 'unset',
|
|
135
|
+
[buttonVars.color.text]:
|
|
139
136
|
`color-mix(in srgb, ${sys.color.foreground} calc(100% * ${sys.state.muted.dark}), transparent)`,
|
|
140
|
-
[
|
|
137
|
+
[buttonVars.border.color]:
|
|
141
138
|
`color-mix(in srgb, ${sys.color.foreground} calc(100% * ${sys.state.muted.dark}), transparent)`,
|
|
142
139
|
},
|
|
143
140
|
},
|
|
@@ -149,11 +146,11 @@ export const buttonRecipe = recipe({
|
|
|
149
146
|
'@layer': {
|
|
150
147
|
[components]: {
|
|
151
148
|
vars: {
|
|
152
|
-
...assignVars(
|
|
149
|
+
...assignVars(buttonVars.color, {
|
|
153
150
|
text: sys.color.foreground,
|
|
154
151
|
background: 'unset',
|
|
155
152
|
}),
|
|
156
|
-
...assignVars(
|
|
153
|
+
...assignVars(buttonVars.border, {
|
|
157
154
|
width: '1px',
|
|
158
155
|
style: 'solid',
|
|
159
156
|
color: 'transparent',
|
|
@@ -162,14 +159,14 @@ export const buttonRecipe = recipe({
|
|
|
162
159
|
selectors: {
|
|
163
160
|
'&:hover': {
|
|
164
161
|
vars: {
|
|
165
|
-
[
|
|
162
|
+
[buttonVars.color.background]:
|
|
166
163
|
`color-mix(in srgb, ${sys.color.foreground} calc(100% * ${sys.state.hovered.opacity}), transparent)`,
|
|
167
164
|
},
|
|
168
165
|
},
|
|
169
166
|
'&:disabled': {
|
|
170
167
|
vars: {
|
|
171
|
-
[
|
|
172
|
-
[
|
|
168
|
+
[buttonVars.color.background]: 'unset',
|
|
169
|
+
[buttonVars.color.text]:
|
|
173
170
|
`color-mix(in srgb, ${sys.color.foreground} calc(100% * ${sys.state.muted.dark}), transparent)`,
|
|
174
171
|
},
|
|
175
172
|
},
|
|
@@ -185,11 +182,11 @@ export const buttonRecipe = recipe({
|
|
|
185
182
|
textDecoration: 'none',
|
|
186
183
|
|
|
187
184
|
vars: {
|
|
188
|
-
...assignVars(
|
|
185
|
+
...assignVars(buttonVars.color, {
|
|
189
186
|
text: sys.color.foreground,
|
|
190
187
|
background: 'unset',
|
|
191
188
|
}),
|
|
192
|
-
...assignVars(
|
|
189
|
+
...assignVars(buttonVars.spacing, {
|
|
193
190
|
block: '0',
|
|
194
191
|
inline: '0',
|
|
195
192
|
inner: '0',
|
|
@@ -203,7 +200,7 @@ export const buttonRecipe = recipe({
|
|
|
203
200
|
'&:disabled': {
|
|
204
201
|
textDecoration: 'none',
|
|
205
202
|
vars: {
|
|
206
|
-
[
|
|
203
|
+
[buttonVars.color.text]:
|
|
207
204
|
`color-mix(in srgb, ${sys.color.foreground} calc(100% * ${sys.state.muted.dark}), transparent)`,
|
|
208
205
|
},
|
|
209
206
|
},
|
|
@@ -217,7 +214,7 @@ export const buttonRecipe = recipe({
|
|
|
217
214
|
sm: {
|
|
218
215
|
'@layer': {
|
|
219
216
|
[components]: {
|
|
220
|
-
vars: assignVars(
|
|
217
|
+
vars: assignVars(buttonVars.spacing, {
|
|
221
218
|
block: sys.spacing[2],
|
|
222
219
|
inline: sys.spacing[3],
|
|
223
220
|
inner: sys.spacing[3],
|
|
@@ -228,7 +225,7 @@ export const buttonRecipe = recipe({
|
|
|
228
225
|
md: {
|
|
229
226
|
'@layer': {
|
|
230
227
|
[components]: {
|
|
231
|
-
vars: assignVars(
|
|
228
|
+
vars: assignVars(buttonVars.spacing, {
|
|
232
229
|
block: sys.spacing[2],
|
|
233
230
|
inline: sys.spacing[4],
|
|
234
231
|
inner: sys.spacing[4],
|
|
@@ -239,7 +236,7 @@ export const buttonRecipe = recipe({
|
|
|
239
236
|
lg: {
|
|
240
237
|
'@layer': {
|
|
241
238
|
[components]: {
|
|
242
|
-
vars: assignVars(
|
|
239
|
+
vars: assignVars(buttonVars.spacing, {
|
|
243
240
|
block: sys.spacing[3],
|
|
244
241
|
inline: sys.spacing[6],
|
|
245
242
|
inner: sys.spacing[6],
|
|
@@ -260,8 +257,8 @@ export const buttonRecipe = recipe({
|
|
|
260
257
|
'@layer': {
|
|
261
258
|
[components]: {
|
|
262
259
|
vars: {
|
|
263
|
-
[
|
|
264
|
-
[
|
|
260
|
+
[buttonVars.spacing.block]: '0',
|
|
261
|
+
[buttonVars.spacing.inline]: '0',
|
|
265
262
|
},
|
|
266
263
|
},
|
|
267
264
|
},
|
|
@@ -276,8 +273,8 @@ export const buttonRecipe = recipe({
|
|
|
276
273
|
'@layer': {
|
|
277
274
|
[components]: {
|
|
278
275
|
vars: {
|
|
279
|
-
[
|
|
280
|
-
[
|
|
276
|
+
[buttonVars.spacing.block]: '0',
|
|
277
|
+
[buttonVars.spacing.inline]: '0',
|
|
281
278
|
},
|
|
282
279
|
},
|
|
283
280
|
},
|
|
@@ -292,8 +289,8 @@ export const buttonRecipe = recipe({
|
|
|
292
289
|
'@layer': {
|
|
293
290
|
[components]: {
|
|
294
291
|
vars: {
|
|
295
|
-
[
|
|
296
|
-
[
|
|
292
|
+
[buttonVars.spacing.block]: '0',
|
|
293
|
+
[buttonVars.spacing.inline]: '0',
|
|
297
294
|
},
|
|
298
295
|
},
|
|
299
296
|
},
|
|
@@ -308,8 +305,8 @@ export const buttonRecipe = recipe({
|
|
|
308
305
|
'@layer': {
|
|
309
306
|
[components]: {
|
|
310
307
|
vars: {
|
|
311
|
-
[
|
|
312
|
-
[
|
|
308
|
+
[buttonVars.spacing.block]: '0',
|
|
309
|
+
[buttonVars.spacing.inline]: '0',
|
|
313
310
|
},
|
|
314
311
|
},
|
|
315
312
|
},
|
|
@@ -324,8 +321,8 @@ export const buttonRecipe = recipe({
|
|
|
324
321
|
'@layer': {
|
|
325
322
|
[components]: {
|
|
326
323
|
vars: {
|
|
327
|
-
[
|
|
328
|
-
[
|
|
324
|
+
[buttonVars.spacing.block]: '0',
|
|
325
|
+
[buttonVars.spacing.inline]: '0',
|
|
329
326
|
},
|
|
330
327
|
},
|
|
331
328
|
},
|
|
@@ -340,8 +337,8 @@ export const buttonRecipe = recipe({
|
|
|
340
337
|
'@layer': {
|
|
341
338
|
[components]: {
|
|
342
339
|
vars: {
|
|
343
|
-
[
|
|
344
|
-
[
|
|
340
|
+
[buttonVars.spacing.block]: '0',
|
|
341
|
+
[buttonVars.spacing.inline]: '0',
|
|
345
342
|
},
|
|
346
343
|
},
|
|
347
344
|
},
|
|
@@ -11,14 +11,15 @@ import {
|
|
|
11
11
|
} from './button.css';
|
|
12
12
|
|
|
13
13
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
14
|
-
type ButtonTypes = 'button' | 'a' | ComponentType<any>;
|
|
14
|
+
export type ButtonTypes = 'button' | 'a' | ComponentType<any>;
|
|
15
15
|
|
|
16
|
-
type ButtonProps<TUse extends ButtonTypes> =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
export type ButtonProps<TUse extends ButtonTypes> =
|
|
17
|
+
PolymorphicComponentProps<TUse> &
|
|
18
|
+
ButtonVariants & {
|
|
19
|
+
startSlot?: ReactNode;
|
|
20
|
+
endSlot?: ReactNode;
|
|
21
|
+
children?: string;
|
|
22
|
+
};
|
|
22
23
|
|
|
23
24
|
export function Button<TUse extends ButtonTypes>(props: ButtonProps<TUse>) {
|
|
24
25
|
const {
|
|
@@ -39,7 +40,9 @@ export function Button<TUse extends ButtonTypes>(props: ButtonProps<TUse>) {
|
|
|
39
40
|
{...(rest as any)}
|
|
40
41
|
>
|
|
41
42
|
{startSlot && <span className={clsx(buttonStartSlot)}>{startSlot}</span>}
|
|
42
|
-
|
|
43
|
+
{children && (
|
|
44
|
+
<span className={clsx(buttonLabel({ size }))}>{children}</span>
|
|
45
|
+
)}
|
|
43
46
|
{endSlot && <span className={clsx(buttonEndSlot)}>{endSlot}</span>}
|
|
44
47
|
</Comp>
|
|
45
48
|
);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Button } from './button';
|
|
1
|
+
export { Button, type ButtonProps, type ButtonTypes } from './button';
|
|
2
2
|
export { buttonRecipe, type ButtonVariants } from './button.css';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { assignVars, globalStyle } from '@vanilla-extract/css';
|
|
2
|
+
import { calc } from '@vanilla-extract/css-utils';
|
|
3
|
+
import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
|
|
4
|
+
|
|
5
|
+
import { sys } from '../../styles';
|
|
6
|
+
import { components } from '../../styles/layers.css';
|
|
7
|
+
import { buttonRecipe, buttonVars } from '../button/button.css';
|
|
8
|
+
|
|
9
|
+
export const buttonIcon = recipe({
|
|
10
|
+
base: [buttonRecipe.classNames.base],
|
|
11
|
+
|
|
12
|
+
variants: {
|
|
13
|
+
variant: buttonRecipe.classNames.variants.variant,
|
|
14
|
+
size: {
|
|
15
|
+
sm: {
|
|
16
|
+
'@layer': {
|
|
17
|
+
[components]: {
|
|
18
|
+
vars: assignVars(buttonVars.spacing, {
|
|
19
|
+
block: sys.spacing[2],
|
|
20
|
+
inline: sys.spacing[2],
|
|
21
|
+
inner: sys.spacing[2],
|
|
22
|
+
}),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
md: {
|
|
27
|
+
'@layer': {
|
|
28
|
+
[components]: {
|
|
29
|
+
vars: assignVars(buttonVars.spacing, {
|
|
30
|
+
block: sys.spacing[2],
|
|
31
|
+
inline: sys.spacing[2],
|
|
32
|
+
inner: sys.spacing[2],
|
|
33
|
+
}),
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
lg: {
|
|
38
|
+
'@layer': {
|
|
39
|
+
[components]: {
|
|
40
|
+
vars: assignVars(buttonVars.spacing, {
|
|
41
|
+
block: sys.spacing[3],
|
|
42
|
+
inline: sys.spacing[3],
|
|
43
|
+
inner: sys.spacing[3],
|
|
44
|
+
}),
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
defaultVariants: {
|
|
52
|
+
variant: 'ghost',
|
|
53
|
+
size: 'md',
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
globalStyle(`${buttonIcon.classNames.variants.size.sm} > svg`, {
|
|
58
|
+
width: calc.multiply(
|
|
59
|
+
sys.typography.label.small.lineHeight,
|
|
60
|
+
sys.typography.label.small.size,
|
|
61
|
+
),
|
|
62
|
+
height: calc.multiply(
|
|
63
|
+
sys.typography.label.small.lineHeight,
|
|
64
|
+
sys.typography.label.small.size,
|
|
65
|
+
),
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
globalStyle(`${buttonIcon.classNames.variants.size.md} > svg`, {
|
|
69
|
+
width: calc.multiply(
|
|
70
|
+
sys.typography.label.medium.lineHeight,
|
|
71
|
+
sys.typography.label.medium.size,
|
|
72
|
+
),
|
|
73
|
+
height: calc.multiply(
|
|
74
|
+
sys.typography.label.medium.lineHeight,
|
|
75
|
+
sys.typography.label.medium.size,
|
|
76
|
+
),
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
globalStyle(`${buttonIcon.classNames.variants.size.lg} > svg`, {
|
|
80
|
+
width: calc.multiply(
|
|
81
|
+
sys.typography.label.large.lineHeight,
|
|
82
|
+
sys.typography.label.large.size,
|
|
83
|
+
),
|
|
84
|
+
height: calc.multiply(
|
|
85
|
+
sys.typography.label.large.lineHeight,
|
|
86
|
+
sys.typography.label.large.size,
|
|
87
|
+
),
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
export type ButtonIconVariants = NonNullable<RecipeVariants<typeof buttonIcon>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PolymorphicComponentProps } from '@kalink-ui/dibbly';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
|
|
4
|
+
import { ButtonTypes } from '../button/button';
|
|
5
|
+
|
|
6
|
+
import { buttonIcon, ButtonIconVariants } from './button-icon.css';
|
|
7
|
+
|
|
8
|
+
export type ButtonIconProps<TUse extends ButtonTypes> =
|
|
9
|
+
PolymorphicComponentProps<TUse> & ButtonIconVariants;
|
|
10
|
+
|
|
11
|
+
export function ButtonIcon<TUse extends ButtonTypes>(
|
|
12
|
+
props: ButtonIconProps<TUse>,
|
|
13
|
+
) {
|
|
14
|
+
const { use: Comp = 'button', className, variant, size, ...rest } = props;
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<Comp
|
|
18
|
+
className={clsx(buttonIcon({ variant, size }), buttonIcon, className)}
|
|
19
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
20
|
+
{...(rest as any)}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ButtonIcon, type ButtonIconProps } from './button-icon';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { style } from '@vanilla-extract/css';
|
|
2
|
+
import { recipe } from '@vanilla-extract/recipes';
|
|
3
|
+
|
|
4
|
+
import { components } from '../../styles/layers.css';
|
|
5
|
+
|
|
6
|
+
export const card = style({});
|
|
7
|
+
export const cardHeader = style({});
|
|
8
|
+
export const cardBody = style({});
|
|
9
|
+
export const cardFooter = recipe({
|
|
10
|
+
base: {
|
|
11
|
+
'@layer': {
|
|
12
|
+
[components]: {
|
|
13
|
+
display: 'flex',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
variants: {
|
|
18
|
+
align: {
|
|
19
|
+
start: {
|
|
20
|
+
'@layer': {
|
|
21
|
+
[components]: {
|
|
22
|
+
justifyContent: 'flex-start',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
center: {
|
|
27
|
+
'@layer': {
|
|
28
|
+
[components]: {
|
|
29
|
+
justifyContent: 'center',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
end: {
|
|
34
|
+
'@layer': {
|
|
35
|
+
[components]: {
|
|
36
|
+
justifyContent: 'flex-end',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
});
|