@kalink-ui/seedly 0.10.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
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
+
3
12
  ## 0.10.0
4
13
 
5
14
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kalink-ui/seedly",
3
- "version": "0.10.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,6 +37,7 @@
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",
@@ -46,9 +47,9 @@
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.4.0",
50
50
  "@kalink-ui/eslint-config": "0.9.0",
51
- "@kalink-ui/typescript-config": "0.4.0"
51
+ "@kalink-ui/typescript-config": "0.4.0",
52
+ "@kalink-ui/dibbly": "0.4.0"
52
53
  },
53
54
  "peerDependencies": {
54
55
  "@vanilla-extract/css": "^1.17.1",
@@ -66,7 +67,8 @@
66
67
  "@radix-ui/react-scroll-area": "^1.2.6",
67
68
  "@radix-ui/react-select": "^2.2.4",
68
69
  "@radix-ui/react-slot": "^1.2.0",
69
- "clsx": "^2.1.1"
70
+ "clsx": "^2.1.1",
71
+ "cmdk": "^1.1.1"
70
72
  },
71
73
  "publishConfig": {
72
74
  "access": "public"
@@ -357,7 +357,12 @@ export const buttonLabel = recipe({
357
357
  },
358
358
  });
359
359
 
360
- export const buttonStartSlot = style({});
361
- 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]);
362
367
 
363
368
  export type ButtonVariants = NonNullable<RecipeVariants<typeof buttonRecipe>>;
@@ -3,10 +3,10 @@ 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
 
@@ -39,11 +39,11 @@ export function Button<TUse extends ButtonTypes>(props: ButtonProps<TUse>) {
39
39
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
40
40
  {...(rest as any)}
41
41
  >
42
- {startSlot && <span className={clsx(buttonStartSlot)}>{startSlot}</span>}
42
+ {startSlot && <span className={clsx(buttonSlotStart)}>{startSlot}</span>}
43
43
  {children && (
44
44
  <span className={clsx(buttonLabel({ size }))}>{children}</span>
45
45
  )}
46
- {endSlot && <span className={clsx(buttonEndSlot)}>{endSlot}</span>}
46
+ {endSlot && <span className={clsx(buttonSlotEnd)}>{endSlot}</span>}
47
47
  </Comp>
48
48
  );
49
49
  }
@@ -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
+ }
@@ -0,0 +1,31 @@
1
+ import { createVar, style } from '@vanilla-extract/css';
2
+
3
+ import { sys, transition } from '../../styles';
4
+
5
+ const outlineColor = createVar();
6
+
7
+ 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',
21
+
22
+ vars: {
23
+ [outlineColor]: sys.color.foreground,
24
+ },
25
+ },
26
+ },
27
+
28
+ vars: {
29
+ [outlineColor]: sys.color.foreground,
30
+ },
31
+ });
@@ -0,0 +1,44 @@
1
+ 'use client';
2
+
3
+ import { mergeRefs } from '@kalink-ui/dibbly';
4
+ import { clsx } from 'clsx';
5
+ import { Command as CommandPrimitive } from 'cmdk';
6
+ import { ComponentPropsWithRef, ReactNode, useRef } from 'react';
7
+
8
+ import { InputWrapper } from '../input/input-wrapper';
9
+ import { input } from '../input/input.css';
10
+
11
+ import { commandInputWrapper } from './command-input.css';
12
+
13
+ export type CommandInputProps = ComponentPropsWithRef<
14
+ typeof CommandPrimitive.Input
15
+ > & {
16
+ icon?: ReactNode;
17
+ };
18
+
19
+ export function CommandInput({
20
+ className,
21
+ disabled,
22
+ ref,
23
+ icon,
24
+ ...props
25
+ }: CommandInputProps) {
26
+ const innerRef = useRef<HTMLInputElement>(null);
27
+
28
+ return (
29
+ <InputWrapper
30
+ inputRef={innerRef}
31
+ disabled={disabled}
32
+ variant="bare"
33
+ className={commandInputWrapper}
34
+ >
35
+ {icon}
36
+ <CommandPrimitive.Input
37
+ ref={mergeRefs([ref, innerRef])}
38
+ className={clsx(input, className)}
39
+ disabled={disabled}
40
+ {...props}
41
+ />
42
+ </InputWrapper>
43
+ );
44
+ }
@@ -0,0 +1,27 @@
1
+ import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
2
+
3
+ import { sys } from '../../styles';
4
+
5
+ export const commandItem = recipe({
6
+ base: {
7
+ cursor: 'pointer',
8
+
9
+ color: sys.color.foreground,
10
+
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
+ },
16
+
17
+ '&:active': {
18
+ backgroundColor: `color-mix(in srgb, ${sys.color.foreground} calc(${sys.state.focused} * 100%), transparent)`,
19
+ outline: 'none',
20
+ },
21
+ },
22
+ },
23
+ });
24
+
25
+ export type CommandItemVariants = NonNullable<
26
+ RecipeVariants<typeof commandItem>
27
+ >;
@@ -0,0 +1,35 @@
1
+ 'use client';
2
+
3
+ import { clsx } from 'clsx';
4
+ import { Command as CommandPrimitive } from 'cmdk';
5
+ import { ComponentPropsWithRef, ComponentType } from 'react';
6
+
7
+ import { Cluster } from '../cluster';
8
+ import { menuItem, menuItemIcon } from '../menu/menu-item.css';
9
+
10
+ export type CommandItemProps = ComponentPropsWithRef<
11
+ typeof CommandPrimitive.Item
12
+ > & {
13
+ inset?: boolean;
14
+ icon?: ComponentType<{ className?: string }>;
15
+ };
16
+
17
+ export function CommandItem({
18
+ className,
19
+ inset,
20
+ icon: IconComp,
21
+ children,
22
+ ...props
23
+ }: CommandItemProps) {
24
+ return (
25
+ <CommandPrimitive.Item
26
+ className={clsx(menuItem({ inset }), className)}
27
+ {...props}
28
+ >
29
+ <Cluster spacing={2} align="center">
30
+ {IconComp && <IconComp className={menuItemIcon} />}
31
+ {children}
32
+ </Cluster>
33
+ </CommandPrimitive.Item>
34
+ );
35
+ }
@@ -0,0 +1,14 @@
1
+ import { style } from '@vanilla-extract/css';
2
+
3
+ import { sys, transition } from '../../styles';
4
+
5
+ export const commandList = style({
6
+ width: '100%',
7
+ maxHeight: 350,
8
+ overflow: 'auto',
9
+ paddingInline: sys.spacing[2],
10
+ paddingBlockEnd: sys.spacing[2],
11
+
12
+ overscrollBehavior: 'contain',
13
+ transition: transition(['height']),
14
+ });
@@ -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 { commandList } from './command-list.css';
8
+
9
+ export function CommandList({
10
+ className,
11
+ ...props
12
+ }: ComponentPropsWithRef<typeof CommandPrimitive.List>) {
13
+ return (
14
+ <CommandPrimitive.List
15
+ className={clsx(commandList, className)}
16
+ {...props}
17
+ />
18
+ );
19
+ }
@@ -0,0 +1,29 @@
1
+ 'use client';
2
+
3
+ import { clsx } from 'clsx';
4
+ import { Command as CommandPrimitive } from 'cmdk';
5
+ import { ComponentPropsWithRef } from 'react';
6
+
7
+ import {
8
+ MenuSeparatorVariants,
9
+ menuSeparator,
10
+ } from '../menu/menu-separator.css';
11
+
12
+ export type CommandSeparatorProps = ComponentPropsWithRef<
13
+ typeof CommandPrimitive.Separator
14
+ > &
15
+ MenuSeparatorVariants;
16
+
17
+ export function CommandSeparator({
18
+ className,
19
+ spacing = 4,
20
+ offset = true,
21
+ ...props
22
+ }: CommandSeparatorProps) {
23
+ return (
24
+ <CommandPrimitive.Separator
25
+ className={clsx(menuSeparator({ offset, spacing }), className)}
26
+ {...props}
27
+ />
28
+ );
29
+ }
@@ -0,0 +1,24 @@
1
+ 'use client';
2
+
3
+ import { clsx } from 'clsx';
4
+ import { Command as CommandPrimitive } from 'cmdk';
5
+ import { ComponentPropsWithRef } from 'react';
6
+
7
+ import { Stack, StackVariants } from '../stack';
8
+
9
+ export type CommandProps = ComponentPropsWithRef<typeof CommandPrimitive> & {
10
+ spacing?: StackVariants['spacing'];
11
+ };
12
+
13
+ export function Command({
14
+ className,
15
+ children,
16
+ spacing = 2,
17
+ ...props
18
+ }: CommandProps) {
19
+ return (
20
+ <CommandPrimitive className={clsx(className)} {...props}>
21
+ <Stack spacing={spacing}>{children}</Stack>
22
+ </CommandPrimitive>
23
+ );
24
+ }
@@ -0,0 +1,7 @@
1
+ export { Command } from './command';
2
+ export { CommandInput } from './command-input';
3
+ export { CommandList } from './command-list';
4
+ export { CommandEmpty } from './command-empty';
5
+ export { CommandGroup } from './command-group';
6
+ export { CommandItem } from './command-item';
7
+ export { CommandSeparator } from './command-separator';
@@ -1,2 +1,2 @@
1
1
  export { Cover } from './cover';
2
- export { coverRecipe, type CoverVariants } from './cover.css';
2
+ export { coverRecipe, minSizeVar, type CoverVariants } from './cover.css';
@@ -4,6 +4,7 @@ export * from './button-icon';
4
4
  export * from './card';
5
5
  export * from './center';
6
6
  export * from './cluster';
7
+ export * from './command';
7
8
  export * from './conditional-wrapper';
8
9
  export * from './cover';
9
10
  export * from './divider';
@@ -15,6 +16,7 @@ export * from './input';
15
16
  export * from './label';
16
17
  export * from './loader';
17
18
  export * from './loader-overlay';
19
+ export * from './popover';
18
20
  export * from './scroll-area';
19
21
  export * from './seed';
20
22
  export * from './select';
@@ -2,7 +2,7 @@ import { createVar, keyframes } from '@vanilla-extract/css';
2
2
  import { calc } from '@vanilla-extract/css-utils';
3
3
  import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
4
4
 
5
- import { sys } from '../../styles';
5
+ import { mapContractVars, sys } from '../../styles';
6
6
 
7
7
  const translateX = createVar();
8
8
  const offsetX = createVar();
@@ -28,10 +28,6 @@ const leave = keyframes({
28
28
 
29
29
  export const popoverContent = recipe({
30
30
  base: {
31
- padding: sys.spacing[1],
32
-
33
- boxShadow: sys.elevation.high,
34
-
35
31
  animationDuration: sys.motion.duration.short[2],
36
32
  animationTimingFunction: sys.motion.easing.standard,
37
33
  animationFillMode: 'forwards',
@@ -99,6 +95,10 @@ export const popoverContent = recipe({
99
95
  overflow: 'hidden',
100
96
  },
101
97
  },
98
+
99
+ elevation: mapContractVars(sys.elevation, (key) => ({
100
+ boxShadow: sys.elevation[key],
101
+ })),
102
102
  },
103
103
  });
104
104
 
@@ -51,12 +51,16 @@ export function PopoverContent({
51
51
  portaled = true,
52
52
  scrollable = true,
53
53
  maxHeight = 'var(--radix-popover-content-available-height)',
54
+ elevation,
54
55
  ...props
55
56
  }: PopoverContentProps) {
56
57
  const content = (
57
58
  <Content
58
59
  align={align}
59
- className={clsx(popoverContent({ width, scrollable }), className)}
60
+ className={clsx(
61
+ popoverContent({ width, scrollable, elevation }),
62
+ className,
63
+ )}
60
64
  sideOffset={0}
61
65
  asChild
62
66
  collisionPadding={16}
@@ -4,7 +4,11 @@ import { recipe, type RecipeVariants } from '@vanilla-extract/recipes';
4
4
  import { sys, mapContractVars } from '../../styles';
5
5
  import { components } from '../../styles/layers.css';
6
6
 
7
- const spacing = createVar();
7
+ const spacing = createVar({
8
+ syntax: '<length>',
9
+ initialValue: sys.spacing['0'],
10
+ inherits: false,
11
+ });
8
12
 
9
13
  export const stackRecipe = recipe({
10
14
  base: {