@kalink-ui/seedly 0.4.0 → 0.6.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +25 -14
  3. package/src/components/box/box.css.ts +36 -15
  4. package/src/components/box/box.tsx +2 -2
  5. package/src/components/button/button.css.ts +1 -1
  6. package/src/components/button/button.tsx +6 -8
  7. package/src/components/center/center.css.ts +28 -11
  8. package/src/components/center/center.tsx +1 -2
  9. package/src/components/cluster/cluster.css.ts +71 -18
  10. package/src/components/cluster/cluster.tsx +1 -2
  11. package/src/components/cover/cover.css.ts +44 -15
  12. package/src/components/cover/cover.tsx +1 -2
  13. package/src/components/frame/frame.css.ts +54 -20
  14. package/src/components/frame/frame.tsx +1 -2
  15. package/src/components/grid/grid.css.ts +16 -7
  16. package/src/components/grid/grid.tsx +1 -2
  17. package/src/components/sidebar/sidebar.css.ts +45 -16
  18. package/src/components/sidebar/sidebar.tsx +1 -2
  19. package/src/components/stack/stack.css.ts +21 -8
  20. package/src/components/stack/stack.tsx +1 -2
  21. package/src/components/switcher/switcher.css.ts +47 -14
  22. package/src/components/switcher/switcher.tsx +1 -2
  23. package/src/components/text/index.ts +1 -0
  24. package/src/components/text/text.css.ts +15 -0
  25. package/src/components/text/text.tsx +43 -0
  26. package/src/styles/layers.css.ts +6 -0
  27. package/src/styles/reset.css.ts +116 -0
  28. package/src/styles/seed/seed.tsx +4 -4
  29. package/src/styles/system-contract.css.ts +2 -2
  30. package/src/styles/typography.css.ts +23 -0
  31. package/src/utils/extract-sprinkles-props.ts +1 -0
  32. package/src/utils/index.ts +0 -1
  33. package/src/types/index.ts +0 -5
  34. package/src/types/utils.types.ts +0 -15
  35. 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.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 87e2ae2: Create new Dibbly package to centralize utils and common types
8
+
9
+ ## 0.5.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 73cbf48: Remove alias usage in source files
14
+
3
15
  ## 0.4.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.4.0",
3
+ "version": "0.6.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/eslint-config": "0.3.0",
52
- "@kalink-ui/typescript-config": "0.2.0"
60
+ "@kalink-ui/typescript-config": "0.3.0",
61
+ "@kalink-ui/eslint-config": "0.4.0",
62
+ "@kalink-ui/dibbly": "0.1.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,8 +1,9 @@
1
1
  import { createVar } from '@vanilla-extract/css';
2
2
  import { recipe, type RecipeVariants } from '@vanilla-extract/recipes';
3
3
 
4
- import { sys } from '@/styles/system-contract.css';
5
- import { mapContractVars } from '@/utils/map-contract-vars';
4
+ import { components } from '../../styles/layers.css';
5
+ import { sys } from '../../styles/system-contract.css';
6
+ import { mapContractVars } from '../../utils/map-contract-vars';
6
7
 
7
8
  export const colorForeground = createVar();
8
9
  export const colorBackground = createVar();
@@ -11,35 +12,55 @@ export const boxRecipe = recipe({
11
12
  variants: {
12
13
  variant: {
13
14
  solid: {
14
- color: colorForeground,
15
- backgroundColor: colorBackground,
15
+ '@layer': {
16
+ [components]: {
17
+ color: colorForeground,
18
+ backgroundColor: colorBackground,
19
+ },
16
20
 
17
- vars: {
18
- [colorForeground]: sys.color.foreground,
19
- [colorBackground]: sys.color.background,
21
+ vars: {
22
+ [colorForeground]: sys.color.foreground,
23
+ [colorBackground]: sys.color.background,
24
+ },
20
25
  },
21
26
  },
22
27
 
23
28
  outline: {
24
- color: colorBackground,
25
- backgroundColor: 'transparent',
29
+ '@layer': {
30
+ [components]: {
31
+ color: colorBackground,
32
+ backgroundColor: 'transparent',
26
33
 
27
- borderColor: colorBackground,
28
- borderStyle: 'solid',
29
- borderWidth: '1px',
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
- padding: sys.spacing[key],
43
+ '@layer': {
44
+ [components]: {
45
+ padding: sys.spacing[key],
46
+ },
47
+ },
35
48
  })),
36
49
 
37
50
  elevation: mapContractVars(sys.elevation, (key) => ({
38
- boxShadow: sys.elevation[key],
51
+ '@layer': {
52
+ [components]: {
53
+ boxShadow: sys.elevation[key],
54
+ },
55
+ },
39
56
  })),
40
57
 
41
58
  radius: mapContractVars(sys.shape.corner, (key) => ({
42
- borderRadius: sys.shape.corner[key],
59
+ '@layer': {
60
+ [components]: {
61
+ borderRadius: sys.shape.corner[key],
62
+ },
63
+ },
43
64
  })),
44
65
  },
45
66
  });
@@ -1,9 +1,9 @@
1
1
  import { clsx } from 'clsx';
2
2
 
3
- import type { PolymorphicComponentProps } from '@/types/utils.types.js';
4
-
5
3
  import { boxRecipe, type BoxVariants } from './box.css';
6
4
 
5
+ import type { PolymorphicComponentProps } from '@kalink-ui/dibbly/types';
6
+
7
7
  type BoxProps<TUse extends React.ElementType> =
8
8
  PolymorphicComponentProps<TUse> & {
9
9
  /**
@@ -1,7 +1,7 @@
1
1
  import { createTheme } from '@vanilla-extract/css';
2
2
  import { recipe, type RecipeVariants } from '@vanilla-extract/recipes';
3
3
 
4
- import { sys } from '@/styles/system-contract.css';
4
+ import { sys } from '../../styles/system-contract.css';
5
5
 
6
6
  export const [buttonTheme, buttonsys] = createTheme({
7
7
  color: {
@@ -1,10 +1,11 @@
1
1
  import { clsx } from 'clsx';
2
2
 
3
- import { Box } from '@/components/box';
4
- import type { PolymorphicComponentProps } from '@/types/utils.types';
3
+ import { Box } from '../box';
5
4
 
6
5
  import { buttonRecipe, type ButtonVariants } from './button.css';
7
6
 
7
+ import type { PolymorphicComponentProps } from '@kalink-ui/dibbly/types';
8
+
8
9
  type ButtonProps<TUse extends React.ElementType> =
9
10
  PolymorphicComponentProps<TUse> & {
10
11
  /**
@@ -14,7 +15,6 @@ type ButtonProps<TUse extends React.ElementType> =
14
15
  };
15
16
 
16
17
  export const Button = <TUse extends React.ElementType = 'button'>({
17
- children,
18
18
  className,
19
19
  variant,
20
20
  ...props
@@ -22,12 +22,10 @@ export const Button = <TUse extends React.ElementType = 'button'>({
22
22
  const { use: Comp = 'button', ...rest } = props;
23
23
 
24
24
  return (
25
- <Comp
26
- use={Box}
25
+ <Box
26
+ use={Comp}
27
27
  className={clsx(buttonRecipe({ variant }), className)}
28
28
  {...rest}
29
- >
30
- {children}
31
- </Comp>
29
+ />
32
30
  );
33
31
  };
@@ -1,33 +1,50 @@
1
1
  import { recipe, type RecipeVariants } from '@vanilla-extract/recipes';
2
2
 
3
- import { sys } from '@/styles/system-contract.css';
4
- import { mapContractVars } from '@/utils/map-contract-vars';
3
+ import { components } from '../../styles/layers.css';
4
+ import { sys } from '../../styles/system-contract.css';
5
+ import { mapContractVars } from '../../utils/map-contract-vars';
5
6
 
6
7
  export const centerRecipe = recipe({
7
8
  base: {
8
- display: 'block',
9
- boxSizing: 'content-box',
10
- marginInline: 'auto',
11
- maxInlineSize: sys.layout.measure,
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
- textAlign: 'center',
22
+ '@layer': {
23
+ [components]: {
24
+ textAlign: 'center',
25
+ },
26
+ },
18
27
  },
19
28
  },
20
29
 
21
30
  intrinsic: {
22
31
  true: {
23
- display: 'flex',
24
- flexDirection: 'column',
25
- alignItems: 'center',
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
- paddingInline: sys.spacing[key],
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 { sys } from '@/styles/system-contract.css';
4
- import { mapContractVars } from '@/utils/map-contract-vars';
3
+ import { components } from '../../styles/layers.css';
4
+ import { sys } from '../../styles/system-contract.css';
5
+ import { mapContractVars } from '../../utils/map-contract-vars';
5
6
 
6
7
  export const clusterRecipe = recipe({
7
8
  base: {
8
- display: 'flex',
9
- flexWrap: 'wrap',
10
- justifyContent: 'flex-start',
11
- alignItems: 'flex-start',
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
- gap: sys.spacing[key],
21
+ '@layer': {
22
+ [components]: {
23
+ gap: sys.spacing[key],
24
+ },
25
+ },
17
26
  })),
18
27
 
19
28
  justify: {
20
29
  start: {
21
- justifyContent: 'flex-start',
30
+ '@layer': {
31
+ [components]: {
32
+ justifyContent: 'flex-start',
33
+ },
34
+ },
22
35
  },
23
36
  end: {
24
- justifyContent: 'flex-end',
37
+ '@layer': {
38
+ [components]: {
39
+ justifyContent: 'flex-end',
40
+ },
41
+ },
25
42
  },
26
43
  center: {
27
- justifyContent: 'center',
44
+ '@layer': {
45
+ [components]: {
46
+ justifyContent: 'center',
47
+ },
48
+ },
28
49
  },
29
50
  spaceBetween: {
30
- justifyContent: 'space-between',
51
+ '@layer': {
52
+ [components]: {
53
+ justifyContent: 'space-between',
54
+ },
55
+ },
31
56
  },
32
57
  spaceAround: {
33
- justifyContent: 'space-around',
58
+ '@layer': {
59
+ [components]: {
60
+ justifyContent: 'space-around',
61
+ },
62
+ },
34
63
  },
35
64
  spaceEvenly: {
36
- justifyContent: 'space-evenly',
65
+ '@layer': {
66
+ [components]: {
67
+ justifyContent: 'space-evenly',
68
+ },
69
+ },
37
70
  },
38
71
  },
39
72
 
40
73
  align: {
41
74
  start: {
42
- alignItems: 'flex-start',
75
+ '@layer': {
76
+ [components]: {
77
+ alignItems: 'flex-start',
78
+ },
79
+ },
43
80
  },
44
81
  end: {
45
- alignItems: 'flex-end',
82
+ '@layer': {
83
+ [components]: {
84
+ alignItems: 'flex-end',
85
+ },
86
+ },
46
87
  },
47
88
  center: {
48
- alignItems: 'center',
89
+ '@layer': {
90
+ [components]: {
91
+ alignItems: 'center',
92
+ },
93
+ },
49
94
  },
50
95
  stretch: {
51
- alignItems: 'stretch',
96
+ '@layer': {
97
+ [components]: {
98
+ alignItems: 'stretch',
99
+ },
100
+ },
52
101
  },
53
102
  baseline: {
54
- alignItems: 'baseline',
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,60 +1,89 @@
1
1
  import { createVar, globalStyle } from '@vanilla-extract/css';
2
2
  import { recipe, type RecipeVariants } from '@vanilla-extract/recipes';
3
3
 
4
- import { sys } from '@/styles/system-contract.css';
5
- import { mapContractVars } from '@/utils/map-contract-vars';
4
+ import { components } from '../../styles/layers.css';
5
+ import { sys } from '../../styles/system-contract.css';
6
+ import { mapContractVars } from '../../utils/map-contract-vars';
6
7
 
7
8
  const spaceVar = createVar();
8
9
  export const minSizeVar = createVar();
9
10
 
10
11
  export const coverRecipe = recipe({
11
12
  base: {
12
- display: 'flex',
13
- flexDirection: 'column',
13
+ '@layer': {
14
+ [components]: {
15
+ display: 'flex',
16
+ flexDirection: 'column',
14
17
 
15
- minBlockSize: minSizeVar,
16
- padding: spaceVar,
18
+ minBlockSize: minSizeVar,
19
+ padding: spaceVar,
17
20
 
18
- vars: {
19
- [minSizeVar]: '100vh',
21
+ vars: {
22
+ [minSizeVar]: '100vh',
23
+ },
24
+ },
20
25
  },
21
26
  },
22
27
 
23
28
  variants: {
24
29
  spacing: mapContractVars(sys.spacing, (key) => ({
25
- sys: {
26
- [spaceVar]: sys.spacing[key],
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
- padding: 0,
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
- marginBlock: spaceVar,
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
- marginBlockStart: 0,
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
- marginBlockEnd: 0,
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
- marginBlock: 'auto',
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> & {