@kalink-ui/seedly 0.16.0 → 0.17.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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # @kalink-ui/seedly
2
2
 
3
+ ## 0.17.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 6d46df7: Fix styling issues after Stack component update
8
+ - 141fc36: [Skeleton] Add new Skeleton component
9
+
3
10
  ## 0.16.0
4
11
 
5
12
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kalink-ui/seedly",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "A set of components for building UIs with React and TypeScript",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -16,37 +16,33 @@
16
16
  "./styles/layers": "./src/styles/layers.css.ts"
17
17
  },
18
18
  "devDependencies": {
19
- "@chromatic-com/storybook": "^3.2.5",
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
- "@turbo/gen": "^2.4.4",
29
- "@types/node": "^22.13.9",
30
- "@types/react": "19.0.10",
31
- "@types/react-dom": "19.0.4",
32
- "@vanilla-extract/css": "^1.17.1",
33
- "@vanilla-extract/css-utils": "^0.1.4",
34
- "@vanilla-extract/dynamic": "^2.1.2",
35
- "@vanilla-extract/recipes": "^0.5.5",
36
- "@vanilla-extract/sprinkles": "^1.6.3",
37
- "@vanilla-extract/vite-plugin": "^5.0.1",
38
- "@vitejs/plugin-react": "^4.3.4",
39
- "eslint": "^9.21.0",
40
- "lucide-react": "^0.511.0",
41
- "react": "^19.0.0",
42
- "react-docgen-typescript": "^2.2.2",
43
- "react-dom": "^19.0.0",
44
- "storybook": "^8.6.9",
45
- "type-fest": "^4.37.0",
46
- "typescript": "^5.8.2",
47
- "vite": "^6.2.1",
19
+ "@chromatic-com/storybook": "^4.0.0",
20
+ "@storybook/addon-docs": "^9.0.8",
21
+ "@storybook/addon-onboarding": "^9.0.8",
22
+ "@storybook/react-vite": "^9.0.8",
23
+ "@turbo/gen": "^2.5.4",
24
+ "@types/node": "^24.0.0",
25
+ "@types/react": "19.1.7",
26
+ "@types/react-dom": "19.1.6",
27
+ "@vanilla-extract/css": "^1.17.3",
28
+ "@vanilla-extract/css-utils": "^0.1.5",
29
+ "@vanilla-extract/dynamic": "^2.1.4",
30
+ "@vanilla-extract/recipes": "^0.5.6",
31
+ "@vanilla-extract/sprinkles": "^1.6.4",
32
+ "@vanilla-extract/vite-plugin": "^5.0.5",
33
+ "@vitejs/plugin-react": "^4.5.2",
34
+ "eslint": "^9.28.0",
35
+ "eslint-plugin-storybook": "9.0.8",
36
+ "lucide-react": "^0.514.0",
37
+ "react": "^19.1.0",
38
+ "react-docgen-typescript": "^2.4.0",
39
+ "react-dom": "^19.1.0",
40
+ "storybook": "^9.0.8",
41
+ "type-fest": "^4.41.0",
42
+ "typescript": "^5.8.3",
43
+ "vite": "^6.3.5",
48
44
  "vite-tsconfig-paths": "^5.1.4",
49
- "vitest": "^3.0.8",
45
+ "vitest": "^3.2.3",
50
46
  "@kalink-ui/dibbly": "0.5.0",
51
47
  "@kalink-ui/eslint-config": "0.9.0",
52
48
  "@kalink-ui/typescript-config": "0.4.0"
@@ -62,11 +58,11 @@
62
58
  "typescript": "^5.8.2"
63
59
  },
64
60
  "dependencies": {
65
- "@radix-ui/react-dialog": "^1.1.11",
66
- "@radix-ui/react-popover": "^1.1.13",
67
- "@radix-ui/react-scroll-area": "^1.2.6",
68
- "@radix-ui/react-select": "^2.2.4",
69
- "@radix-ui/react-slot": "^1.2.0",
61
+ "@radix-ui/react-dialog": "^1.1.14",
62
+ "@radix-ui/react-popover": "^1.1.14",
63
+ "@radix-ui/react-scroll-area": "^1.2.9",
64
+ "@radix-ui/react-select": "^2.2.5",
65
+ "@radix-ui/react-slot": "^1.2.3",
70
66
  "clsx": "^2.1.1",
71
67
  "cmdk": "^1.1.1"
72
68
  },
@@ -38,7 +38,9 @@ export function Card<TUse extends CardRootElement = 'article'>(
38
38
  className={clsx(card, className)}
39
39
  {...rest}
40
40
  >
41
- <Stack spacing={verticalSpacing ?? spacing}>{children}</Stack>
41
+ <Stack align="stretch" spacing={verticalSpacing ?? spacing}>
42
+ {children}
43
+ </Stack>
42
44
  </Box>
43
45
  );
44
46
  }
@@ -8,6 +8,10 @@ export const commandGroup = style([
8
8
  {
9
9
  '@layer': {
10
10
  [components]: {
11
+ display: 'flex',
12
+ flexDirection: 'column',
13
+ gap: sys.spacing[2],
14
+
11
15
  selectors: {
12
16
  '&[hidden]': {
13
17
  display: 'none',
@@ -1,31 +1,36 @@
1
1
  import { createVar, style } from '@vanilla-extract/css';
2
2
 
3
3
  import { sys, transition } from '../../styles';
4
+ import { components } from '../../styles/layers.css';
4
5
 
5
6
  const outlineColor = createVar();
6
7
 
7
8
  export const commandInputWrapper = style({
8
- padding: sys.spacing[2],
9
-
10
- borderBottomWidth: 1,
11
- borderBottomStyle: 'solid',
12
- borderBottomColor: outlineColor,
13
-
14
- transition: transition(['border-color', 'box-shadow'], {
15
- duration: 'short.2',
16
- }),
17
-
18
- selectors: {
19
- '&:focus, &:focus-within, &:focus-visible': {
20
- boxShadow: 'unset',
9
+ '@layer': {
10
+ [components]: {
11
+ padding: sys.spacing[2],
12
+
13
+ borderBottomWidth: 1,
14
+ borderBottomStyle: 'solid',
15
+ borderBottomColor: outlineColor,
16
+
17
+ transition: transition(['border-color', 'box-shadow'], {
18
+ duration: 'short.2',
19
+ }),
20
+
21
+ selectors: {
22
+ '&:focus, &:focus-within, &:focus-visible': {
23
+ boxShadow: 'unset',
24
+
25
+ vars: {
26
+ [outlineColor]: sys.color.foreground,
27
+ },
28
+ },
29
+ },
21
30
 
22
31
  vars: {
23
32
  [outlineColor]: sys.color.foreground,
24
33
  },
25
34
  },
26
35
  },
27
-
28
- vars: {
29
- [outlineColor]: sys.color.foreground,
30
- },
31
36
  });
@@ -1,22 +1,27 @@
1
1
  import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
2
2
 
3
3
  import { sys } from '../../styles';
4
+ import { components } from '../../styles/layers.css';
4
5
 
5
6
  export const commandItem = recipe({
6
7
  base: {
7
- cursor: 'pointer',
8
+ '@layer': {
9
+ [components]: {
10
+ cursor: 'pointer',
8
11
 
9
- color: sys.color.foreground,
12
+ color: sys.color.foreground,
10
13
 
11
- selectors: {
12
- '&[data-selected=true]': {
13
- backgroundColor: `color-mix(in srgb, ${sys.color.foreground} calc(${sys.state.muted.dark} * 100%), transparent)`,
14
- outline: 'none',
15
- },
14
+ selectors: {
15
+ '&[data-selected=true]': {
16
+ backgroundColor: `color-mix(in srgb, ${sys.color.foreground} calc(${sys.state.muted.dark} * 100%), transparent)`,
17
+ outline: 'none',
18
+ },
16
19
 
17
- '&:active': {
18
- backgroundColor: `color-mix(in srgb, ${sys.color.foreground} calc(${sys.state.focused} * 100%), transparent)`,
19
- outline: 'none',
20
+ '&:active': {
21
+ backgroundColor: `color-mix(in srgb, ${sys.color.foreground} calc(${sys.state.focused} * 100%), transparent)`,
22
+ outline: 'none',
23
+ },
24
+ },
20
25
  },
21
26
  },
22
27
  },
@@ -1,14 +1,50 @@
1
- import { style } from '@vanilla-extract/css';
1
+ import { createVar, globalStyle } from '@vanilla-extract/css';
2
+ import { recipe } from '@vanilla-extract/recipes';
2
3
 
3
- import { sys, transition } from '../../styles';
4
+ import { mapContractVars, sys, transition } from '../../styles';
5
+ import { components } from '../../styles/layers.css';
4
6
 
5
- export const commandList = style({
6
- width: '100%',
7
- maxHeight: 350,
8
- overflow: 'auto',
9
- paddingInline: sys.spacing[2],
10
- paddingBlockEnd: sys.spacing[2],
7
+ const spacingVar = createVar();
11
8
 
12
- overscrollBehavior: 'contain',
13
- transition: transition(['height']),
9
+ export const commandList = recipe({
10
+ base: {
11
+ '@layer': {
12
+ [components]: {
13
+ display: 'flex',
14
+ flexDirection: 'column',
15
+ gap: spacingVar,
16
+
17
+ width: '100%',
18
+ maxHeight: 350,
19
+ overflow: 'auto',
20
+ paddingInline: sys.spacing[2],
21
+ paddingBlockEnd: sys.spacing[2],
22
+
23
+ overscrollBehavior: 'contain',
24
+ transition: transition(['height']),
25
+ },
26
+ },
27
+ },
28
+
29
+ variants: {
30
+ spacing: mapContractVars(sys.spacing, (key) => ({
31
+ '@layer': {
32
+ [components]: {
33
+ vars: {
34
+ [spacingVar]: sys.spacing[key],
35
+ },
36
+ },
37
+ },
38
+ })),
39
+ },
40
+ });
41
+
42
+ globalStyle(`${commandList.classNames.base} [cmdk-list-sizer]`, {
43
+ '@layer': {
44
+ [components]: {
45
+ display: 'flex',
46
+ flexDirection: 'column',
47
+ gap: spacingVar,
48
+ },
49
+ },
14
50
  });
@@ -4,15 +4,23 @@ import { clsx } from 'clsx';
4
4
  import { Command as CommandPrimitive } from 'cmdk';
5
5
  import { ComponentPropsWithRef } from 'react';
6
6
 
7
+ import { StackProps } from '../stack';
8
+
7
9
  import { commandList } from './command-list.css';
8
10
 
11
+ type CommandListProps = ComponentPropsWithRef<typeof CommandPrimitive.List> & {
12
+ spacing?: StackProps<'div'>['spacing'];
13
+ };
14
+
9
15
  export function CommandList({
10
16
  className,
17
+ spacing = 4,
11
18
  ...props
12
- }: ComponentPropsWithRef<typeof CommandPrimitive.List>) {
19
+ }: CommandListProps) {
13
20
  return (
14
21
  <CommandPrimitive.List
15
- className={clsx(commandList, className)}
22
+ className={clsx(commandList({ spacing }), className)}
23
+ asChild
16
24
  {...props}
17
25
  />
18
26
  );
@@ -12,17 +12,16 @@ import {
12
12
  export type CommandSeparatorProps = ComponentPropsWithRef<
13
13
  typeof CommandPrimitive.Separator
14
14
  > &
15
- MenuSeparatorVariants;
15
+ Omit<MenuSeparatorVariants, 'spacing'>;
16
16
 
17
17
  export function CommandSeparator({
18
18
  className,
19
- spacing = 4,
20
19
  offset = true,
21
20
  ...props
22
21
  }: CommandSeparatorProps) {
23
22
  return (
24
23
  <CommandPrimitive.Separator
25
- className={clsx(menuSeparator({ offset, spacing }), className)}
24
+ className={clsx(menuSeparator({ offset }), className)}
26
25
  {...props}
27
26
  />
28
27
  );
@@ -18,7 +18,9 @@ export function Command({
18
18
  }: CommandProps) {
19
19
  return (
20
20
  <CommandPrimitive className={clsx(className)} {...props}>
21
- <Stack spacing={spacing}>{children}</Stack>
21
+ <Stack spacing={spacing} align="stretch">
22
+ {children}
23
+ </Stack>
22
24
  </CommandPrimitive>
23
25
  );
24
26
  }
@@ -16,7 +16,7 @@ export const loaderOverlay = recipe({
16
16
 
17
17
  zIndex: 1000,
18
18
 
19
- backgroundColor: `color-mix(in srgb, ${sys.color.foreground} 10%, transparent)`,
19
+ backgroundColor: `color-mix(in srgb, ${sys.color.foreground} 5%, transparent)`,
20
20
  },
21
21
  },
22
22
  },
@@ -1,5 +1,6 @@
1
1
  import { clsx } from 'clsx';
2
2
 
3
+ import { Box } from '../box';
3
4
  import { Center } from '../center';
4
5
  import { MoonLoader } from '../loader';
5
6
  import { Stack, StackProps } from '../stack';
@@ -20,11 +21,14 @@ export function LoaderOverlay({
20
21
  spacing = 2,
21
22
  }: LoaderOverlayProps) {
22
23
  return (
23
- <div className={clsx(loaderOverlay({ position }), className)}>
24
+ <Box
25
+ spacing={spacing}
26
+ className={clsx(loaderOverlay({ position }), className)}
27
+ >
24
28
  <Stack use={Center} align="center" spacing={spacing} intrinsic andText>
25
29
  <MoonLoader active forceMount />
26
30
  {text && <Text>{text}</Text>}
27
31
  </Stack>
28
- </div>
32
+ </Box>
29
33
  );
30
34
  }
@@ -33,6 +33,7 @@ export const menuSeparator = recipe({
33
33
  offset: {
34
34
  true: {
35
35
  marginInline: calc.negate(sys.spacing[2]),
36
+ marginBlock: calc.negate(sys.spacing[2]),
36
37
  },
37
38
  },
38
39
 
@@ -0,0 +1 @@
1
+ export { Skeleton } from './skeleton';
@@ -0,0 +1,127 @@
1
+ import { globalStyle, keyframes } from '@vanilla-extract/css';
2
+ import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
3
+
4
+ import { sys, typography } from '../../styles';
5
+ import { components } from '../../styles/layers.css';
6
+
7
+ const pulseKeyframe = keyframes({
8
+ '0%': {
9
+ opacity: 1,
10
+ },
11
+
12
+ '50%': {
13
+ opacity: 0.4,
14
+ },
15
+
16
+ '100%': {
17
+ opacity: 1,
18
+ },
19
+ });
20
+
21
+ export const skeleton = recipe({
22
+ base: {
23
+ '@layer': {
24
+ [components]: {
25
+ display: 'block',
26
+
27
+ backgroundColor: `color-mix(in srgb, ${sys.color.foreground} 10%, transparent)`,
28
+
29
+ animationName: pulseKeyframe,
30
+ animationDuration: '1500ms',
31
+ animationIterationCount: 'infinite',
32
+ animationTimingFunction: sys.motion.easing.standard,
33
+ animationDelay: '500ms',
34
+ },
35
+ },
36
+ },
37
+
38
+ variants: {
39
+ type: {
40
+ text: [
41
+ typography.body.medium,
42
+ {
43
+ '@layer': {
44
+ [components]: {
45
+ selectors: {
46
+ '&:empty::before': {
47
+ content: '"\\00a0"',
48
+ },
49
+ },
50
+ },
51
+ },
52
+ },
53
+ ],
54
+
55
+ field: {
56
+ '@layer': {
57
+ [components]: {
58
+ display: 'block',
59
+ width: '100%',
60
+ height: sys.spacing[6],
61
+ },
62
+ },
63
+ },
64
+
65
+ paragraph: {
66
+ '@layer': {
67
+ [components]: {
68
+ display: 'block',
69
+ width: '100%',
70
+ height: sys.spacing[16],
71
+ },
72
+ },
73
+ },
74
+
75
+ block: {
76
+ '@layer': {
77
+ [components]: {
78
+ aspectRatio: '1',
79
+ },
80
+ },
81
+ },
82
+ },
83
+
84
+ withChildren: {
85
+ true: {
86
+ '@layer': {
87
+ [components]: {
88
+ maxWidth: 'fit-content',
89
+ height: 'auto',
90
+ },
91
+ },
92
+ },
93
+ },
94
+
95
+ corner: {
96
+ square: {
97
+ '@layer': {
98
+ [components]: {
99
+ borderRadius: sys.shape.corner.none,
100
+ },
101
+ },
102
+ },
103
+
104
+ rounded: {
105
+ '@layer': {
106
+ [components]: {
107
+ borderRadius: sys.shape.corner.small,
108
+ },
109
+ },
110
+ },
111
+
112
+ circle: {
113
+ '@layer': {
114
+ [components]: {
115
+ borderRadius: sys.shape.corner.circle,
116
+ },
117
+ },
118
+ },
119
+ },
120
+ },
121
+ });
122
+
123
+ globalStyle(`${skeleton.classNames.variants.withChildren.true} *`, {
124
+ visibility: 'hidden',
125
+ });
126
+
127
+ export type SkeletonVariants = NonNullable<RecipeVariants<typeof skeleton>>;
@@ -0,0 +1,32 @@
1
+ import { clsx } from 'clsx';
2
+ import { Children, ElementType } from 'react';
3
+
4
+ import { Box, BoxProps } from '../box';
5
+
6
+ import { skeleton, SkeletonVariants } from './skeleton.css';
7
+
8
+ export type SkeletonProps<TUse extends ElementType> = Omit<
9
+ SkeletonVariants,
10
+ 'withChildren'
11
+ > &
12
+ BoxProps<TUse>;
13
+
14
+ export const Skeleton = <TUse extends ElementType>({
15
+ children,
16
+ className,
17
+ type = 'text',
18
+ radius = 'small',
19
+ ...props
20
+ }: SkeletonProps<TUse>) => {
21
+ const withChildren = Children.count(children) > 0;
22
+
23
+ return (
24
+ <Box
25
+ className={clsx(skeleton({ withChildren, type }), className)}
26
+ radius={radius}
27
+ {...props}
28
+ >
29
+ {children}
30
+ </Box>
31
+ );
32
+ };