@kalink-ui/seedly 0.9.0 → 0.11.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 (108) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/package.json +14 -6
  3. package/src/components/box/box.css.ts +2 -2
  4. package/src/components/button/button.css.ts +52 -50
  5. package/src/components/button/button.tsx +15 -12
  6. package/src/components/button/index.ts +1 -1
  7. package/src/components/button-icon/button-icon.css.ts +90 -0
  8. package/src/components/button-icon/button-icon.tsx +23 -0
  9. package/src/components/button-icon/index.ts +1 -0
  10. package/src/components/card/card.tsx +7 -4
  11. package/src/components/card/index.ts +1 -1
  12. package/src/components/center/center.tsx +2 -2
  13. package/src/components/center/index.ts +1 -1
  14. package/src/components/cluster/cluster.css.ts +17 -0
  15. package/src/components/command/command-empty.tsx +14 -0
  16. package/src/components/command/command-group.css.ts +34 -0
  17. package/src/components/command/command-group.tsx +19 -0
  18. package/src/components/command/command-input.css.ts +31 -0
  19. package/src/components/command/command-input.tsx +44 -0
  20. package/src/components/command/command-item.css.ts +27 -0
  21. package/src/components/command/command-item.tsx +35 -0
  22. package/src/components/command/command-list.css.ts +14 -0
  23. package/src/components/command/command-list.tsx +19 -0
  24. package/src/components/command/command-separator.tsx +29 -0
  25. package/src/components/command/command.tsx +24 -0
  26. package/src/components/command/index.ts +7 -0
  27. package/src/components/cover/index.ts +1 -1
  28. package/src/components/divider/divider.css.ts +11 -0
  29. package/src/components/divider/divider.tsx +11 -0
  30. package/src/components/divider/index.ts +1 -0
  31. package/src/components/form-field/form-field-context.ts +18 -0
  32. package/src/components/form-field/form-field-control.tsx +34 -0
  33. package/src/components/form-field/form-field-description.tsx +16 -0
  34. package/src/components/form-field/form-field-error.tsx +22 -0
  35. package/src/components/form-field/form-field-item-context.ts +6 -0
  36. package/src/components/form-field/form-field-item.tsx +28 -0
  37. package/src/components/form-field/form-field-label.tsx +27 -0
  38. package/src/components/form-field/form-field-message.tsx +33 -0
  39. package/src/components/form-field/form-field.css.ts +97 -0
  40. package/src/components/form-field/form-field.tsx +56 -0
  41. package/src/components/form-field/index.ts +9 -0
  42. package/src/components/frame/frame.css.ts +8 -8
  43. package/src/components/frame/frame.tsx +2 -6
  44. package/src/components/frame/index.ts +1 -1
  45. package/src/components/heading/heading.tsx +43 -8
  46. package/src/components/index.ts +29 -15
  47. package/src/components/input/index.ts +2 -0
  48. package/src/components/input/input-wrapper.tsx +58 -0
  49. package/src/components/input/input.css.ts +250 -0
  50. package/src/components/input/input.tsx +56 -0
  51. package/src/components/label/index.ts +1 -0
  52. package/src/components/label/label.css.ts +37 -0
  53. package/src/components/label/label.tsx +23 -0
  54. package/src/components/loader/index.ts +1 -0
  55. package/src/components/loader/loader.css.ts +109 -0
  56. package/src/components/loader/moon-loader.tsx +43 -0
  57. package/src/components/loader-overlay/index.ts +1 -0
  58. package/src/components/loader-overlay/loader-overlay.css.ts +35 -0
  59. package/src/components/loader-overlay/loader-overlay.tsx +28 -0
  60. package/src/components/menu/index.ts +2 -0
  61. package/src/components/menu/menu-item.css.ts +79 -0
  62. package/src/components/menu/menu-separator.css.ts +53 -0
  63. package/src/components/popover/index.ts +3 -0
  64. package/src/components/popover/popover-content.css.ts +107 -0
  65. package/src/components/popover/popover-content.tsx +82 -0
  66. package/src/components/popover/popover.tsx +6 -0
  67. package/src/components/scroll-area/index.ts +1 -0
  68. package/src/components/scroll-area/scroll-area.css.ts +72 -0
  69. package/src/components/scroll-area/scroll-area.tsx +39 -0
  70. package/src/components/scroll-area/scroll-bar.tsx +37 -0
  71. package/src/components/seed/seed.tsx +4 -4
  72. package/src/components/select/index.ts +5 -0
  73. package/src/components/select/select-content.css.ts +22 -0
  74. package/src/components/select/select-content.tsx +51 -0
  75. package/src/components/select/select-item.css.ts +24 -0
  76. package/src/components/select/select-item.tsx +24 -0
  77. package/src/components/select/select-root.tsx +14 -0
  78. package/src/components/select/select-trigger.css.ts +75 -0
  79. package/src/components/select/select-trigger.tsx +47 -0
  80. package/src/components/select/select.tsx +85 -0
  81. package/src/components/sheet/index.ts +5 -0
  82. package/src/components/sheet/sheet-content.css.ts +143 -0
  83. package/src/components/sheet/sheet-content.tsx +43 -0
  84. package/src/components/sheet/sheet-description.tsx +21 -0
  85. package/src/components/sheet/sheet-footer.tsx +15 -0
  86. package/src/components/sheet/sheet-header.css.ts +35 -0
  87. package/src/components/sheet/sheet-header.tsx +32 -0
  88. package/src/components/sheet/sheet-overlay.css.ts +43 -0
  89. package/src/components/sheet/sheet-overlay.tsx +14 -0
  90. package/src/components/sheet/sheet-title.tsx +31 -0
  91. package/src/components/sheet/sheet.tsx +8 -0
  92. package/src/components/stack/index.ts +1 -1
  93. package/src/components/stack/stack.css.ts +5 -1
  94. package/src/components/stack/stack.tsx +2 -2
  95. package/src/components/text/index.ts +6 -0
  96. package/src/components/text/text.css.ts +31 -4
  97. package/src/components/text-field/index.ts +1 -0
  98. package/src/components/text-field/text-field.css.ts +3 -0
  99. package/src/components/text-field/text-field.tsx +64 -0
  100. package/src/components/textarea/index.ts +1 -0
  101. package/src/components/textarea/textarea-input.tsx +20 -0
  102. package/src/components/textarea/textarea.css.ts +10 -0
  103. package/src/components/textarea/textarea.tsx +69 -0
  104. package/src/styles/define-responsive-properties.ts +242 -0
  105. package/src/styles/extract-sprinkles-props.ts +29 -35
  106. package/src/styles/index.ts +9 -0
  107. package/src/styles/reset.css.ts +1 -0
  108. package/src/styles/visually-hidden.css.ts +21 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @kalink-ui/seedly
2
2
 
3
+ ## 0.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 4a6ec83: Create command component
8
+ - ad0b4d1: [Stack] Fix inheritance of the spacing property
9
+ - 2371dd4: [Button] Fix how slot behave in the flex context
10
+ - 4e6b205: [Cover] Reexport `minSizeVar` custom property
11
+
12
+ ## 0.10.0
13
+
14
+ ### Minor Changes
15
+
16
+ - 84903c1: Add multiple components
17
+
18
+ - ButtonIcon
19
+ - TextField
20
+ - Select
21
+ - Textarea
22
+ - Label
23
+ - Loader
24
+ - LoaderOverly
25
+
3
26
  ## 0.9.0
4
27
 
5
28
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kalink-ui/seedly",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "A set of components for building UIs with React and TypeScript",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -37,18 +37,19 @@
37
37
  "@vanilla-extract/vite-plugin": "^5.0.1",
38
38
  "@vitejs/plugin-react": "^4.3.4",
39
39
  "eslint": "^9.21.0",
40
+ "lucide-react": "^0.511.0",
40
41
  "react": "^19.0.0",
41
42
  "react-docgen-typescript": "^2.2.2",
42
43
  "react-dom": "^19.0.0",
43
44
  "storybook": "^8.6.9",
44
45
  "type-fest": "^4.37.0",
45
- "typescript": "5.8.2",
46
+ "typescript": "^5.8.2",
46
47
  "vite": "^6.2.1",
47
48
  "vite-tsconfig-paths": "^5.1.4",
48
49
  "vitest": "^3.0.8",
49
- "@kalink-ui/dibbly": "0.3.0",
50
+ "@kalink-ui/eslint-config": "0.9.0",
50
51
  "@kalink-ui/typescript-config": "0.4.0",
51
- "@kalink-ui/eslint-config": "0.8.0"
52
+ "@kalink-ui/dibbly": "0.4.0"
52
53
  },
53
54
  "peerDependencies": {
54
55
  "@vanilla-extract/css": "^1.17.1",
@@ -57,10 +58,17 @@
57
58
  "@vanilla-extract/recipes": "^0.5.5",
58
59
  "@vanilla-extract/sprinkles": "^1.6.3",
59
60
  "react": "^19.0.0",
60
- "react-dom": "^19.0.0"
61
+ "react-dom": "^19.0.0",
62
+ "typescript": "^5.8.2"
61
63
  },
62
64
  "dependencies": {
63
- "clsx": "^2.1.1"
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",
70
+ "clsx": "^2.1.1",
71
+ "cmdk": "^1.1.1"
64
72
  },
65
73
  "publishConfig": {
66
74
  "access": "public"
@@ -1,7 +1,7 @@
1
1
  import { recipe, type RecipeVariants } from '@vanilla-extract/recipes';
2
2
 
3
- import { mapContractVars, sys } from '../../styles';
4
- import { components } from '../../styles/layers.css';
3
+ import { mapContractVars, sys } from '@kalink-ui/seedly/styles';
4
+ import { components } from '@kalink-ui/seedly/styles/layers';
5
5
 
6
6
  export const boxRecipe = recipe({
7
7
  variants: {
@@ -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: vars.spacing.inner,
42
+ gap: buttonVars.spacing.inner,
46
43
 
47
- paddingBlock: vars.spacing.block,
48
- paddingInline: vars.spacing.inline,
44
+ paddingBlock: buttonVars.spacing.block,
45
+ paddingInline: buttonVars.spacing.inline,
49
46
 
50
- color: vars.color.text,
47
+ color: buttonVars.color.text,
51
48
  textTransform: fallbackVar(buttonVars.textTransform, 'unset'),
52
- backgroundColor: vars.color.background,
49
+ backgroundColor: buttonVars.color.background,
53
50
  borderRadius: fallbackVar(
54
51
  buttonVars.borderRadius,
55
52
  sys.shape.corner.none,
56
53
  ),
57
- borderWidth: vars.border.width,
58
- borderStyle: vars.border.style,
59
- borderColor: vars.border.color,
60
- boxShadow: vars.shadow.level,
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(vars.color, {
81
+ ...assignVars(buttonVars.color, {
85
82
  text: sys.color.background,
86
83
  background: sys.color.foreground,
87
84
  }),
88
- ...assignVars(vars.border, {
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
- [vars.color.background]:
93
+ [buttonVars.color.background]:
97
94
  `color-mix(in srgb, ${sys.color.foreground}, ${sys.color.background} calc(100% * ${sys.state.hovered.opacity}))`,
98
- [vars.shadow.level]: sys.elevation.minimal,
95
+ [buttonVars.shadow.level]: sys.elevation.minimal,
99
96
  },
100
97
  },
101
98
  ':disabled': {
102
99
  vars: {
103
- ...assignVars(vars.color, {
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
- [vars.shadow.level]: sys.elevation.none,
108
- [vars.border.color]: `transparent`,
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(vars.color, {
115
+ ...assignVars(buttonVars.color, {
119
116
  text: sys.color.foreground,
120
117
  background: 'unset',
121
118
  }),
122
- ...assignVars(vars.border, {
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
- [vars.color.background]:
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
- [vars.color.background]: 'unset',
138
- [vars.color.text]:
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
- [vars.border.color]:
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(vars.color, {
149
+ ...assignVars(buttonVars.color, {
153
150
  text: sys.color.foreground,
154
151
  background: 'unset',
155
152
  }),
156
- ...assignVars(vars.border, {
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
- [vars.color.background]:
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
- [vars.color.background]: 'unset',
172
- [vars.color.text]:
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(vars.color, {
185
+ ...assignVars(buttonVars.color, {
189
186
  text: sys.color.foreground,
190
187
  background: 'unset',
191
188
  }),
192
- ...assignVars(vars.spacing, {
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
- [vars.color.text]:
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(vars.spacing, {
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(vars.spacing, {
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(vars.spacing, {
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
- [vars.spacing.block]: '0',
264
- [vars.spacing.inline]: '0',
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
- [vars.spacing.block]: '0',
280
- [vars.spacing.inline]: '0',
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
- [vars.spacing.block]: '0',
296
- [vars.spacing.inline]: '0',
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
- [vars.spacing.block]: '0',
312
- [vars.spacing.inline]: '0',
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
- [vars.spacing.block]: '0',
328
- [vars.spacing.inline]: '0',
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
- [vars.spacing.block]: '0',
344
- [vars.spacing.inline]: '0',
340
+ [buttonVars.spacing.block]: '0',
341
+ [buttonVars.spacing.inline]: '0',
345
342
  },
346
343
  },
347
344
  },
@@ -360,7 +357,12 @@ export const buttonLabel = recipe({
360
357
  },
361
358
  });
362
359
 
363
- export const buttonStartSlot = style({});
364
- export const buttonEndSlot = style({});
360
+ const buttonSlot = style({
361
+ flexShrink: 0,
362
+ });
363
+
364
+ export const buttonSlotStart = style([buttonSlot]);
365
+
366
+ export const buttonSlotEnd = style([buttonSlot]);
365
367
 
366
368
  export type ButtonVariants = NonNullable<RecipeVariants<typeof buttonRecipe>>;
@@ -3,22 +3,23 @@ import { clsx } from 'clsx';
3
3
  import { ComponentType, ReactNode } from 'react';
4
4
 
5
5
  import {
6
- buttonEndSlot,
7
6
  buttonLabel,
8
7
  buttonRecipe,
9
- buttonStartSlot,
8
+ buttonSlotEnd,
9
+ buttonSlotStart,
10
10
  ButtonVariants,
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> = PolymorphicComponentProps<TUse> &
17
- ButtonVariants & {
18
- startSlot?: ReactNode;
19
- endSlot?: ReactNode;
20
- children?: string;
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 {
@@ -38,9 +39,11 @@ export function Button<TUse extends ButtonTypes>(props: ButtonProps<TUse>) {
38
39
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
39
40
  {...(rest as any)}
40
41
  >
41
- {startSlot && <span className={clsx(buttonStartSlot)}>{startSlot}</span>}
42
- <span className={clsx(buttonLabel({ size }))}>{children}</span>
43
- {endSlot && <span className={clsx(buttonEndSlot)}>{endSlot}</span>}
42
+ {startSlot && <span className={clsx(buttonSlotStart)}>{startSlot}</span>}
43
+ {children && (
44
+ <span className={clsx(buttonLabel({ size }))}>{children}</span>
45
+ )}
46
+ {endSlot && <span className={clsx(buttonSlotEnd)}>{endSlot}</span>}
44
47
  </Comp>
45
48
  );
46
49
  }
@@ -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';
@@ -10,11 +10,14 @@ import { ClusterProps } from '../cluster';
10
10
 
11
11
  import { card, cardBody, cardFooter, cardHeader } from './card.css';
12
12
 
13
- export type CardProps<TUse extends ElementType = 'article'> = BoxProps<TUse> & {
14
- verticalSpacing?: Spacing;
15
- };
13
+ export type CardRootElement = 'article' | 'div';
14
+
15
+ export type CardProps<TUse extends CardRootElement = 'article'> =
16
+ BoxProps<TUse> & {
17
+ verticalSpacing?: Spacing;
18
+ };
16
19
 
17
- export function Card<TUse extends ElementType = 'article'>(
20
+ export function Card<TUse extends CardRootElement = 'article'>(
18
21
  props: CardProps<TUse>,
19
22
  ) {
20
23
  const {
@@ -1 +1 @@
1
- export { Card } from './card';
1
+ export { Card, type CardProps, type CardRootElement } from './card';
@@ -4,8 +4,8 @@ import { ElementType } from 'react';
4
4
 
5
5
  import { centerRecipe, CenterVariants } from './center.css';
6
6
 
7
- type CenterProps<TUse extends ElementType> = PolymorphicComponentProps<TUse> &
8
- CenterVariants;
7
+ export type CenterProps<TUse extends ElementType> =
8
+ PolymorphicComponentProps<TUse> & CenterVariants;
9
9
 
10
10
  /**
11
11
  * A custom element for centering a block-level element horizontally,
@@ -1,2 +1,2 @@
1
- export { Center } from './center';
1
+ export { Center, type CenterProps } from './center';
2
2
  export { centerRecipe, type CenterVariants } from './center.css';
@@ -115,6 +115,23 @@ export const clusterRecipe = recipe({
115
115
  },
116
116
  },
117
117
  },
118
+
119
+ direction: {
120
+ row: {
121
+ '@layer': {
122
+ [components]: {
123
+ flexDirection: 'row',
124
+ },
125
+ },
126
+ },
127
+ rowReverse: {
128
+ '@layer': {
129
+ [components]: {
130
+ flexDirection: 'row-reverse',
131
+ },
132
+ },
133
+ },
134
+ },
118
135
  },
119
136
  });
120
137
 
@@ -0,0 +1,14 @@
1
+ 'use client';
2
+
3
+ import { Command as CommandPrimitive } from 'cmdk';
4
+ import { ComponentPropsWithoutRef } from 'react';
5
+
6
+ import { menuItem } from '../menu/menu-item.css';
7
+
8
+ export type CommandEmptyProps = ComponentPropsWithoutRef<
9
+ typeof CommandPrimitive.Empty
10
+ >;
11
+
12
+ export function CommandEmpty(props: CommandEmptyProps) {
13
+ return <CommandPrimitive.Empty className={menuItem()} {...props} />;
14
+ }
@@ -0,0 +1,34 @@
1
+ import { globalStyle, style } from '@vanilla-extract/css';
2
+
3
+ import { sys, typography } from '../../styles';
4
+ import { components } from '../../styles/layers.css';
5
+
6
+ export const commandGroup = style([
7
+ typography.label.small,
8
+ {
9
+ '@layer': {
10
+ [components]: {
11
+ selectors: {
12
+ '&[hidden]': {
13
+ display: 'none',
14
+
15
+ position: 'absolute',
16
+ },
17
+ },
18
+ },
19
+ },
20
+ },
21
+ ]);
22
+
23
+ globalStyle(`${commandGroup} [cmdk-group-heading]`, {
24
+ '@layer': {
25
+ [components]: {
26
+ position: 'relative',
27
+
28
+ color: `color-mix(in srgb, ${sys.color.foreground} calc(${sys.state.muted.light} * 100%), transparent)`,
29
+
30
+ cursor: 'default',
31
+ userSelect: 'none',
32
+ },
33
+ },
34
+ });
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+
3
+ import { clsx } from 'clsx';
4
+ import { Command as CommandPrimitive } from 'cmdk';
5
+ import { ComponentPropsWithRef } from 'react';
6
+
7
+ import { commandGroup } from './command-group.css';
8
+
9
+ export function CommandGroup({
10
+ className,
11
+ ...props
12
+ }: ComponentPropsWithRef<typeof CommandPrimitive.Group>) {
13
+ return (
14
+ <CommandPrimitive.Group
15
+ className={clsx(commandGroup, className)}
16
+ {...props}
17
+ />
18
+ );
19
+ }