@kalink-ui/seedly 0.5.0 → 0.7.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 +12 -0
- package/package.json +25 -14
- package/src/components/box/box.css.ts +34 -13
- package/src/components/box/box.tsx +1 -2
- package/src/components/button/button.tsx +4 -8
- package/src/components/center/center.css.ts +26 -9
- package/src/components/center/center.tsx +1 -2
- package/src/components/cluster/cluster.css.ts +69 -16
- package/src/components/cluster/cluster.tsx +1 -2
- package/src/components/cover/cover.css.ts +42 -13
- package/src/components/cover/cover.tsx +1 -2
- package/src/components/frame/frame.css.ts +54 -20
- package/src/components/frame/frame.tsx +1 -2
- package/src/components/grid/grid.css.ts +14 -5
- package/src/components/grid/grid.tsx +1 -2
- package/src/components/sidebar/sidebar.css.ts +43 -14
- package/src/components/sidebar/sidebar.tsx +1 -2
- package/src/components/stack/stack.css.ts +19 -6
- package/src/components/stack/stack.tsx +1 -2
- package/src/components/switcher/switcher.css.ts +45 -12
- package/src/components/switcher/switcher.tsx +1 -2
- package/src/components/text/index.ts +1 -0
- package/src/components/text/text.css.ts +15 -0
- package/src/components/text/text.tsx +43 -0
- package/src/styles/layers.css.ts +6 -0
- package/src/styles/reset.css.ts +116 -0
- package/src/styles/seed/seed.tsx +3 -3
- package/src/styles/system-contract.css.ts +2 -2
- package/src/styles/typography.css.ts +23 -0
- package/src/utils/extract-sprinkles-props.ts +1 -0
- package/src/utils/index.ts +0 -1
- package/src/types/index.ts +0 -5
- package/src/types/utils.types.ts +0 -15
- package/src/utils/is-object.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @kalink-ui/seedly
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0c7e758: Change eslint config export strategy
|
|
8
|
+
|
|
9
|
+
## 0.6.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 87e2ae2: Create new Dibbly package to centralize utils and common types
|
|
14
|
+
|
|
3
15
|
## 0.5.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kalink-ui/seedly",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "A set of components for building UIs with React and TypeScript",
|
|
4
5
|
"sideEffects": false,
|
|
5
6
|
"license": "MIT",
|
|
7
|
+
"author": "Louis Gollut",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/Kalink/kalink-ui.git"
|
|
11
|
+
},
|
|
6
12
|
"exports": {
|
|
7
13
|
"./box": "./src/components/box/index.ts",
|
|
8
14
|
"./button": "./src/components/button/index.ts",
|
|
@@ -15,7 +21,10 @@
|
|
|
15
21
|
"./stack": "./src/components/stack/index.ts",
|
|
16
22
|
"./switcher": "./src/components/switcher/index.ts",
|
|
17
23
|
"./styles": "./src/styles/index.ts",
|
|
24
|
+
"./styles/reset": "./src/styles/reset.css.ts",
|
|
25
|
+
"./styles/layers": "./src/styles/layers.css.ts",
|
|
18
26
|
"./types": "./src/types/index.ts",
|
|
27
|
+
"./text": "./src/components/text/index.ts",
|
|
19
28
|
"./utils": "./src/utils/index.ts"
|
|
20
29
|
},
|
|
21
30
|
"devDependencies": {
|
|
@@ -39,37 +48,39 @@
|
|
|
39
48
|
"@vanilla-extract/sprinkles": "^1.6.3",
|
|
40
49
|
"@vanilla-extract/vite-plugin": "^5.0.1",
|
|
41
50
|
"@vitejs/plugin-react": "^4.3.4",
|
|
51
|
+
"eslint": "^9.21.0",
|
|
42
52
|
"react": "^19.0.0",
|
|
43
53
|
"react-dom": "^19.0.0",
|
|
44
54
|
"storybook": "^8.6.4",
|
|
45
|
-
"tsup": "^8.4.0",
|
|
46
55
|
"type-fest": "^4.37.0",
|
|
47
56
|
"typescript": "5.8.2",
|
|
48
57
|
"vite": "^6.2.1",
|
|
49
58
|
"vite-tsconfig-paths": "^5.1.4",
|
|
50
59
|
"vitest": "^3.0.8",
|
|
51
|
-
"@kalink-ui/
|
|
52
|
-
"@kalink-ui/
|
|
60
|
+
"@kalink-ui/dibbly": "0.2.0",
|
|
61
|
+
"@kalink-ui/eslint-config": "0.5.0",
|
|
62
|
+
"@kalink-ui/typescript-config": "0.4.0"
|
|
53
63
|
},
|
|
54
64
|
"peerDependencies": {
|
|
55
|
-
"@vanilla-extract/css": "^1",
|
|
56
|
-
"@vanilla-extract/css-utils": "^0.1",
|
|
57
|
-
"@vanilla-extract/dynamic": "^2",
|
|
58
|
-
"@vanilla-extract/recipes": "^0.5",
|
|
59
|
-
"@vanilla-extract/sprinkles": "^1",
|
|
60
|
-
"react": "^19",
|
|
61
|
-
"react-dom": "^19"
|
|
62
|
-
},
|
|
63
|
-
"publishConfig": {
|
|
64
|
-
"access": "public"
|
|
65
|
+
"@vanilla-extract/css": "^1.17.1",
|
|
66
|
+
"@vanilla-extract/css-utils": "^0.1.4",
|
|
67
|
+
"@vanilla-extract/dynamic": "^2.1.2",
|
|
68
|
+
"@vanilla-extract/recipes": "^0.5.5",
|
|
69
|
+
"@vanilla-extract/sprinkles": "^1.6.3",
|
|
70
|
+
"react": "^19.0.0",
|
|
71
|
+
"react-dom": "^19.0.0"
|
|
65
72
|
},
|
|
66
73
|
"dependencies": {
|
|
67
74
|
"clsx": "^2.1.1"
|
|
68
75
|
},
|
|
76
|
+
"publishConfig": {
|
|
77
|
+
"access": "public"
|
|
78
|
+
},
|
|
69
79
|
"scripts": {
|
|
70
80
|
"lint": "eslint . --max-warnings 0",
|
|
71
81
|
"build-storybook": "storybook build",
|
|
72
82
|
"dev": "storybook dev -p 6006 --no-open",
|
|
83
|
+
"test": "vitest",
|
|
73
84
|
"tsc": "tsc --noEmit"
|
|
74
85
|
}
|
|
75
86
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createVar } from '@vanilla-extract/css';
|
|
2
2
|
import { recipe, type RecipeVariants } from '@vanilla-extract/recipes';
|
|
3
3
|
|
|
4
|
+
import { components } from '../../styles/layers.css';
|
|
4
5
|
import { sys } from '../../styles/system-contract.css';
|
|
5
6
|
import { mapContractVars } from '../../utils/map-contract-vars';
|
|
6
7
|
|
|
@@ -11,35 +12,55 @@ export const boxRecipe = recipe({
|
|
|
11
12
|
variants: {
|
|
12
13
|
variant: {
|
|
13
14
|
solid: {
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
'@layer': {
|
|
16
|
+
[components]: {
|
|
17
|
+
color: colorForeground,
|
|
18
|
+
backgroundColor: colorBackground,
|
|
19
|
+
},
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
vars: {
|
|
22
|
+
[colorForeground]: sys.color.foreground,
|
|
23
|
+
[colorBackground]: sys.color.background,
|
|
24
|
+
},
|
|
20
25
|
},
|
|
21
26
|
},
|
|
22
27
|
|
|
23
28
|
outline: {
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
'@layer': {
|
|
30
|
+
[components]: {
|
|
31
|
+
color: colorBackground,
|
|
32
|
+
backgroundColor: 'transparent',
|
|
26
33
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
borderColor: colorBackground,
|
|
35
|
+
borderStyle: 'solid',
|
|
36
|
+
borderWidth: '1px',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
30
39
|
},
|
|
31
40
|
},
|
|
32
41
|
|
|
33
42
|
spacing: mapContractVars(sys.spacing, (key) => ({
|
|
34
|
-
|
|
43
|
+
'@layer': {
|
|
44
|
+
[components]: {
|
|
45
|
+
padding: sys.spacing[key],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
35
48
|
})),
|
|
36
49
|
|
|
37
50
|
elevation: mapContractVars(sys.elevation, (key) => ({
|
|
38
|
-
|
|
51
|
+
'@layer': {
|
|
52
|
+
[components]: {
|
|
53
|
+
boxShadow: sys.elevation[key],
|
|
54
|
+
},
|
|
55
|
+
},
|
|
39
56
|
})),
|
|
40
57
|
|
|
41
58
|
radius: mapContractVars(sys.shape.corner, (key) => ({
|
|
42
|
-
|
|
59
|
+
'@layer': {
|
|
60
|
+
[components]: {
|
|
61
|
+
borderRadius: sys.shape.corner[key],
|
|
62
|
+
},
|
|
63
|
+
},
|
|
43
64
|
})),
|
|
44
65
|
},
|
|
45
66
|
});
|
|
@@ -2,8 +2,7 @@ import { clsx } from 'clsx';
|
|
|
2
2
|
|
|
3
3
|
import { boxRecipe, type BoxVariants } from './box.css';
|
|
4
4
|
|
|
5
|
-
import type { PolymorphicComponentProps } from '
|
|
6
|
-
|
|
5
|
+
import type { PolymorphicComponentProps } from '@kalink-ui/dibbly/types';
|
|
7
6
|
|
|
8
7
|
type BoxProps<TUse extends React.ElementType> =
|
|
9
8
|
PolymorphicComponentProps<TUse> & {
|
|
@@ -4,8 +4,7 @@ import { Box } from '../box';
|
|
|
4
4
|
|
|
5
5
|
import { buttonRecipe, type ButtonVariants } from './button.css';
|
|
6
6
|
|
|
7
|
-
import type { PolymorphicComponentProps } from '
|
|
8
|
-
|
|
7
|
+
import type { PolymorphicComponentProps } from '@kalink-ui/dibbly/types';
|
|
9
8
|
|
|
10
9
|
type ButtonProps<TUse extends React.ElementType> =
|
|
11
10
|
PolymorphicComponentProps<TUse> & {
|
|
@@ -16,7 +15,6 @@ type ButtonProps<TUse extends React.ElementType> =
|
|
|
16
15
|
};
|
|
17
16
|
|
|
18
17
|
export const Button = <TUse extends React.ElementType = 'button'>({
|
|
19
|
-
children,
|
|
20
18
|
className,
|
|
21
19
|
variant,
|
|
22
20
|
...props
|
|
@@ -24,12 +22,10 @@ export const Button = <TUse extends React.ElementType = 'button'>({
|
|
|
24
22
|
const { use: Comp = 'button', ...rest } = props;
|
|
25
23
|
|
|
26
24
|
return (
|
|
27
|
-
<
|
|
28
|
-
use={
|
|
25
|
+
<Box
|
|
26
|
+
use={Comp}
|
|
29
27
|
className={clsx(buttonRecipe({ variant }), className)}
|
|
30
28
|
{...rest}
|
|
31
|
-
|
|
32
|
-
{children}
|
|
33
|
-
</Comp>
|
|
29
|
+
/>
|
|
34
30
|
);
|
|
35
31
|
};
|
|
@@ -1,33 +1,50 @@
|
|
|
1
1
|
import { recipe, type RecipeVariants } from '@vanilla-extract/recipes';
|
|
2
2
|
|
|
3
|
+
import { components } from '../../styles/layers.css';
|
|
3
4
|
import { sys } from '../../styles/system-contract.css';
|
|
4
5
|
import { mapContractVars } from '../../utils/map-contract-vars';
|
|
5
6
|
|
|
6
7
|
export const centerRecipe = recipe({
|
|
7
8
|
base: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
'@layer': {
|
|
10
|
+
[components]: {
|
|
11
|
+
display: 'block',
|
|
12
|
+
boxSizing: 'content-box',
|
|
13
|
+
marginInline: 'auto',
|
|
14
|
+
maxInlineSize: sys.layout.measure,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
12
17
|
},
|
|
13
18
|
|
|
14
19
|
variants: {
|
|
15
20
|
andText: {
|
|
16
21
|
true: {
|
|
17
|
-
|
|
22
|
+
'@layer': {
|
|
23
|
+
[components]: {
|
|
24
|
+
textAlign: 'center',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
18
27
|
},
|
|
19
28
|
},
|
|
20
29
|
|
|
21
30
|
intrinsic: {
|
|
22
31
|
true: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
'@layer': {
|
|
33
|
+
[components]: {
|
|
34
|
+
display: 'flex',
|
|
35
|
+
flexDirection: 'column',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
26
39
|
},
|
|
27
40
|
},
|
|
28
41
|
|
|
29
42
|
gutters: mapContractVars(sys.spacing, (key) => ({
|
|
30
|
-
|
|
43
|
+
'@layer': {
|
|
44
|
+
[components]: {
|
|
45
|
+
paddingInline: sys.spacing[key],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
31
48
|
})),
|
|
32
49
|
},
|
|
33
50
|
});
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { PolymorphicComponentProps } from '@kalink-ui/dibbly/types';
|
|
1
2
|
import { clsx } from 'clsx';
|
|
2
3
|
import { ElementType } from 'react';
|
|
3
4
|
|
|
4
|
-
import { PolymorphicComponentProps } from '../../types/utils.types';
|
|
5
|
-
|
|
6
5
|
import { centerRecipe, CenterVariants } from './center.css';
|
|
7
6
|
|
|
8
7
|
type CenterProps<TUse extends ElementType> = PolymorphicComponentProps<TUse> & {
|
|
@@ -1,57 +1,110 @@
|
|
|
1
1
|
import { recipe, type RecipeVariants } from '@vanilla-extract/recipes';
|
|
2
2
|
|
|
3
|
+
import { components } from '../../styles/layers.css';
|
|
3
4
|
import { sys } from '../../styles/system-contract.css';
|
|
4
5
|
import { mapContractVars } from '../../utils/map-contract-vars';
|
|
5
6
|
|
|
6
7
|
export const clusterRecipe = recipe({
|
|
7
8
|
base: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
'@layer': {
|
|
10
|
+
[components]: {
|
|
11
|
+
display: 'flex',
|
|
12
|
+
flexWrap: 'wrap',
|
|
13
|
+
justifyContent: 'flex-start',
|
|
14
|
+
alignItems: 'flex-start',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
12
17
|
},
|
|
13
18
|
|
|
14
19
|
variants: {
|
|
15
20
|
spacing: mapContractVars(sys.spacing, (key) => ({
|
|
16
|
-
|
|
21
|
+
'@layer': {
|
|
22
|
+
[components]: {
|
|
23
|
+
gap: sys.spacing[key],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
17
26
|
})),
|
|
18
27
|
|
|
19
28
|
justify: {
|
|
20
29
|
start: {
|
|
21
|
-
|
|
30
|
+
'@layer': {
|
|
31
|
+
[components]: {
|
|
32
|
+
justifyContent: 'flex-start',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
22
35
|
},
|
|
23
36
|
end: {
|
|
24
|
-
|
|
37
|
+
'@layer': {
|
|
38
|
+
[components]: {
|
|
39
|
+
justifyContent: 'flex-end',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
25
42
|
},
|
|
26
43
|
center: {
|
|
27
|
-
|
|
44
|
+
'@layer': {
|
|
45
|
+
[components]: {
|
|
46
|
+
justifyContent: 'center',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
28
49
|
},
|
|
29
50
|
spaceBetween: {
|
|
30
|
-
|
|
51
|
+
'@layer': {
|
|
52
|
+
[components]: {
|
|
53
|
+
justifyContent: 'space-between',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
31
56
|
},
|
|
32
57
|
spaceAround: {
|
|
33
|
-
|
|
58
|
+
'@layer': {
|
|
59
|
+
[components]: {
|
|
60
|
+
justifyContent: 'space-around',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
34
63
|
},
|
|
35
64
|
spaceEvenly: {
|
|
36
|
-
|
|
65
|
+
'@layer': {
|
|
66
|
+
[components]: {
|
|
67
|
+
justifyContent: 'space-evenly',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
37
70
|
},
|
|
38
71
|
},
|
|
39
72
|
|
|
40
73
|
align: {
|
|
41
74
|
start: {
|
|
42
|
-
|
|
75
|
+
'@layer': {
|
|
76
|
+
[components]: {
|
|
77
|
+
alignItems: 'flex-start',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
43
80
|
},
|
|
44
81
|
end: {
|
|
45
|
-
|
|
82
|
+
'@layer': {
|
|
83
|
+
[components]: {
|
|
84
|
+
alignItems: 'flex-end',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
46
87
|
},
|
|
47
88
|
center: {
|
|
48
|
-
|
|
89
|
+
'@layer': {
|
|
90
|
+
[components]: {
|
|
91
|
+
alignItems: 'center',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
49
94
|
},
|
|
50
95
|
stretch: {
|
|
51
|
-
|
|
96
|
+
'@layer': {
|
|
97
|
+
[components]: {
|
|
98
|
+
alignItems: 'stretch',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
52
101
|
},
|
|
53
102
|
baseline: {
|
|
54
|
-
|
|
103
|
+
'@layer': {
|
|
104
|
+
[components]: {
|
|
105
|
+
alignItems: 'baseline',
|
|
106
|
+
},
|
|
107
|
+
},
|
|
55
108
|
},
|
|
56
109
|
},
|
|
57
110
|
},
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { PolymorphicComponentProps } from '@kalink-ui/dibbly/types';
|
|
1
2
|
import { clsx } from 'clsx';
|
|
2
3
|
import { ElementType } from 'react';
|
|
3
4
|
|
|
4
|
-
import { PolymorphicComponentProps } from '../../types/utils.types';
|
|
5
|
-
|
|
6
5
|
import { clusterRecipe, ClusterVariants } from './cluster.css';
|
|
7
6
|
|
|
8
7
|
type ClusterProps<TUse extends ElementType> =
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createVar, globalStyle } from '@vanilla-extract/css';
|
|
2
2
|
import { recipe, type RecipeVariants } from '@vanilla-extract/recipes';
|
|
3
3
|
|
|
4
|
+
import { components } from '../../styles/layers.css';
|
|
4
5
|
import { sys } from '../../styles/system-contract.css';
|
|
5
6
|
import { mapContractVars } from '../../utils/map-contract-vars';
|
|
6
7
|
|
|
@@ -9,52 +10,80 @@ export const minSizeVar = createVar();
|
|
|
9
10
|
|
|
10
11
|
export const coverRecipe = recipe({
|
|
11
12
|
base: {
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
'@layer': {
|
|
14
|
+
[components]: {
|
|
15
|
+
display: 'flex',
|
|
16
|
+
flexDirection: 'column',
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
minBlockSize: minSizeVar,
|
|
19
|
+
padding: spaceVar,
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
vars: {
|
|
22
|
+
[minSizeVar]: '100vh',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
20
25
|
},
|
|
21
26
|
},
|
|
22
27
|
|
|
23
28
|
variants: {
|
|
24
29
|
spacing: mapContractVars(sys.spacing, (key) => ({
|
|
25
|
-
|
|
26
|
-
[
|
|
30
|
+
'@layer': {
|
|
31
|
+
[components]: {
|
|
32
|
+
vars: {
|
|
33
|
+
[spaceVar]: sys.spacing[key],
|
|
34
|
+
},
|
|
35
|
+
},
|
|
27
36
|
},
|
|
28
37
|
})),
|
|
29
38
|
|
|
30
39
|
noPad: {
|
|
31
40
|
true: {
|
|
32
|
-
|
|
41
|
+
'@layer': {
|
|
42
|
+
[components]: {
|
|
43
|
+
padding: 0,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
33
46
|
},
|
|
34
47
|
},
|
|
35
48
|
},
|
|
36
49
|
});
|
|
37
50
|
|
|
38
51
|
globalStyle(`${coverRecipe.classNames.base} > *`, {
|
|
39
|
-
|
|
52
|
+
'@layer': {
|
|
53
|
+
[components]: {
|
|
54
|
+
marginBlock: spaceVar,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
40
57
|
});
|
|
41
58
|
|
|
42
59
|
globalStyle(
|
|
43
60
|
`${coverRecipe.classNames.base} > :first-child:not([data-cover-center])`,
|
|
44
61
|
{
|
|
45
|
-
|
|
62
|
+
'@layer': {
|
|
63
|
+
[components]: {
|
|
64
|
+
marginBlockStart: 0,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
46
67
|
},
|
|
47
68
|
);
|
|
48
69
|
|
|
49
70
|
globalStyle(
|
|
50
71
|
`${coverRecipe.classNames.base} > :last-child:not([data-cover-center])`,
|
|
51
72
|
{
|
|
52
|
-
|
|
73
|
+
'@layer': {
|
|
74
|
+
[components]: {
|
|
75
|
+
marginBlockEnd: 0,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
53
78
|
},
|
|
54
79
|
);
|
|
55
80
|
|
|
56
81
|
globalStyle(`${coverRecipe.classNames.base} > [data-cover-center]`, {
|
|
57
|
-
|
|
82
|
+
'@layer': {
|
|
83
|
+
[components]: {
|
|
84
|
+
marginBlock: 'auto',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
58
87
|
});
|
|
59
88
|
|
|
60
89
|
export type CoverVariants = NonNullable<RecipeVariants<typeof coverRecipe>>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { PolymorphicComponentProps } from '@kalink-ui/dibbly/types';
|
|
3
4
|
import { assignInlineVars } from '@vanilla-extract/dynamic';
|
|
4
5
|
import { clsx } from 'clsx';
|
|
5
6
|
import { ElementType } from 'react';
|
|
6
7
|
|
|
7
|
-
import { PolymorphicComponentProps } from '../../types/utils.types';
|
|
8
|
-
|
|
9
8
|
import { coverRecipe, CoverVariants, minSizeVar } from './cover.css';
|
|
10
9
|
|
|
11
10
|
type CoverProps<TUse extends ElementType> = PolymorphicComponentProps<TUse> & {
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import { createVar, globalStyle, style } from '@vanilla-extract/css';
|
|
2
2
|
import { recipe, type RecipeVariants } from '@vanilla-extract/recipes';
|
|
3
3
|
|
|
4
|
+
import { components } from '../../styles/layers.css';
|
|
5
|
+
|
|
4
6
|
const ratioVar = createVar();
|
|
5
7
|
|
|
6
8
|
const baseFrame = style({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
'@layer': {
|
|
10
|
+
[components]: {
|
|
11
|
+
display: 'flex',
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
alignItems: 'center',
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
overflow: 'hidden',
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
aspectRatio: ratioVar,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
14
20
|
});
|
|
15
21
|
|
|
16
22
|
export const frameRecipe = recipe({
|
|
@@ -19,33 +25,57 @@ export const frameRecipe = recipe({
|
|
|
19
25
|
variants: {
|
|
20
26
|
ratio: {
|
|
21
27
|
'1:1': {
|
|
22
|
-
|
|
23
|
-
[
|
|
28
|
+
'@layer': {
|
|
29
|
+
[components]: {
|
|
30
|
+
vars: {
|
|
31
|
+
[ratioVar]: '1 / 1',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
24
34
|
},
|
|
25
35
|
},
|
|
26
36
|
'3:2': {
|
|
27
|
-
|
|
28
|
-
[
|
|
37
|
+
'@layer': {
|
|
38
|
+
[components]: {
|
|
39
|
+
vars: {
|
|
40
|
+
[ratioVar]: '3 / 2',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
29
43
|
},
|
|
30
44
|
},
|
|
31
45
|
'2:3': {
|
|
32
|
-
|
|
33
|
-
[
|
|
46
|
+
'@layer': {
|
|
47
|
+
[components]: {
|
|
48
|
+
vars: {
|
|
49
|
+
[ratioVar]: '2 / 3',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
34
52
|
},
|
|
35
53
|
},
|
|
36
54
|
'4:3': {
|
|
37
|
-
|
|
38
|
-
[
|
|
55
|
+
'@layer': {
|
|
56
|
+
[components]: {
|
|
57
|
+
vars: {
|
|
58
|
+
[ratioVar]: '4 / 3',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
39
61
|
},
|
|
40
62
|
},
|
|
41
63
|
'16:9': {
|
|
42
|
-
|
|
43
|
-
[
|
|
64
|
+
'@layer': {
|
|
65
|
+
[components]: {
|
|
66
|
+
vars: {
|
|
67
|
+
[ratioVar]: '16 / 9',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
44
70
|
},
|
|
45
71
|
},
|
|
46
72
|
'9:16': {
|
|
47
|
-
|
|
48
|
-
[
|
|
73
|
+
'@layer': {
|
|
74
|
+
[components]: {
|
|
75
|
+
vars: {
|
|
76
|
+
[ratioVar]: '9 / 16',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
49
79
|
},
|
|
50
80
|
},
|
|
51
81
|
},
|
|
@@ -53,9 +83,13 @@ export const frameRecipe = recipe({
|
|
|
53
83
|
});
|
|
54
84
|
|
|
55
85
|
globalStyle(`${baseFrame} > img, ${baseFrame} > video`, {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
86
|
+
'@layer': {
|
|
87
|
+
[components]: {
|
|
88
|
+
inlineSize: '100%',
|
|
89
|
+
blockSize: '100%',
|
|
90
|
+
objectFit: 'cover',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
59
93
|
});
|
|
60
94
|
|
|
61
95
|
export type FrameVariants = NonNullable<RecipeVariants<typeof frameRecipe>>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { PolymorphicComponentProps } from '@kalink-ui/dibbly/types';
|
|
1
2
|
import { clsx } from 'clsx';
|
|
2
3
|
import { ElementType } from 'react';
|
|
3
4
|
|
|
4
|
-
import { PolymorphicComponentProps } from '../../types/utils.types';
|
|
5
|
-
|
|
6
5
|
import { frameRecipe, FrameVariants } from './frame.css';
|
|
7
6
|
|
|
8
7
|
type FrameProps<TUse extends ElementType> = PolymorphicComponentProps<TUse> & {
|