@kalink-ui/seedly 0.10.0 → 0.12.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 +15 -0
- package/package.json +6 -4
- package/src/components/button/button.css.ts +54 -2
- package/src/components/button/button.tsx +4 -4
- package/src/components/button-icon/button-icon.css.ts +37 -62
- package/src/components/command/command-empty.tsx +14 -0
- package/src/components/command/command-group.css.ts +34 -0
- package/src/components/command/command-group.tsx +19 -0
- package/src/components/command/command-input.css.ts +31 -0
- package/src/components/command/command-input.tsx +44 -0
- package/src/components/command/command-item.css.ts +27 -0
- package/src/components/command/command-item.tsx +35 -0
- package/src/components/command/command-list.css.ts +14 -0
- package/src/components/command/command-list.tsx +19 -0
- package/src/components/command/command-separator.tsx +29 -0
- package/src/components/command/command.tsx +24 -0
- package/src/components/command/index.ts +7 -0
- package/src/components/cover/index.ts +1 -1
- package/src/components/index.ts +2 -0
- package/src/components/input/input.css.ts +1 -0
- package/src/components/loader-overlay/loader-overlay.css.ts +24 -11
- package/src/components/popover/popover-content.css.ts +5 -5
- package/src/components/popover/popover-content.tsx +5 -1
- package/src/components/stack/stack.css.ts +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @kalink-ui/seedly
|
|
2
2
|
|
|
3
|
+
## 0.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0f1ff4b: [loader] Correctly use layers to define component styles
|
|
8
|
+
|
|
9
|
+
## 0.11.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 4a6ec83: Create command component
|
|
14
|
+
- ad0b4d1: [Stack] Fix inheritance of the spacing property
|
|
15
|
+
- 2371dd4: [Button] Fix how slot behave in the flex context
|
|
16
|
+
- 4e6b205: [Cover] Reexport `minSizeVar` custom property
|
|
17
|
+
|
|
3
18
|
## 0.10.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kalink-ui/seedly",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.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",
|
|
@@ -47,8 +48,8 @@
|
|
|
47
48
|
"vite-tsconfig-paths": "^5.1.4",
|
|
48
49
|
"vitest": "^3.0.8",
|
|
49
50
|
"@kalink-ui/dibbly": "0.4.0",
|
|
50
|
-
"@kalink-ui/
|
|
51
|
-
"@kalink-ui/
|
|
51
|
+
"@kalink-ui/typescript-config": "0.4.0",
|
|
52
|
+
"@kalink-ui/eslint-config": "0.9.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"
|
|
@@ -2,8 +2,10 @@ import {
|
|
|
2
2
|
assignVars,
|
|
3
3
|
createThemeContract,
|
|
4
4
|
fallbackVar,
|
|
5
|
+
globalStyle,
|
|
5
6
|
style,
|
|
6
7
|
} from '@vanilla-extract/css';
|
|
8
|
+
import { calc } from '@vanilla-extract/css-utils';
|
|
7
9
|
import { recipe, type RecipeVariants } from '@vanilla-extract/recipes';
|
|
8
10
|
|
|
9
11
|
import { sys, typography } from '../../styles';
|
|
@@ -357,7 +359,57 @@ export const buttonLabel = recipe({
|
|
|
357
359
|
},
|
|
358
360
|
});
|
|
359
361
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
+
const buttonSlot = style({
|
|
363
|
+
flexShrink: 0,
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
export const buttonSlotStart = style([buttonSlot]);
|
|
367
|
+
|
|
368
|
+
export const buttonSlotEnd = style([buttonSlot]);
|
|
369
|
+
|
|
370
|
+
globalStyle(`${buttonRecipe.classNames.variants.size.sm} svg`, {
|
|
371
|
+
'@layer': {
|
|
372
|
+
[components]: {
|
|
373
|
+
width: calc.multiply(
|
|
374
|
+
sys.typography.label.small.lineHeight,
|
|
375
|
+
sys.typography.label.small.size,
|
|
376
|
+
),
|
|
377
|
+
height: calc.multiply(
|
|
378
|
+
sys.typography.label.small.lineHeight,
|
|
379
|
+
sys.typography.label.small.size,
|
|
380
|
+
),
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
globalStyle(`${buttonRecipe.classNames.variants.size.md} svg`, {
|
|
386
|
+
'@layer': {
|
|
387
|
+
[components]: {
|
|
388
|
+
width: calc.multiply(
|
|
389
|
+
sys.typography.label.medium.lineHeight,
|
|
390
|
+
sys.typography.label.medium.size,
|
|
391
|
+
),
|
|
392
|
+
height: calc.multiply(
|
|
393
|
+
sys.typography.label.medium.lineHeight,
|
|
394
|
+
sys.typography.label.medium.size,
|
|
395
|
+
),
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
globalStyle(`${buttonRecipe.classNames.variants.size.lg} svg`, {
|
|
401
|
+
'@layer': {
|
|
402
|
+
[components]: {
|
|
403
|
+
width: calc.multiply(
|
|
404
|
+
sys.typography.label.large.lineHeight,
|
|
405
|
+
sys.typography.label.large.size,
|
|
406
|
+
),
|
|
407
|
+
height: calc.multiply(
|
|
408
|
+
sys.typography.label.large.lineHeight,
|
|
409
|
+
sys.typography.label.large.size,
|
|
410
|
+
),
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
});
|
|
362
414
|
|
|
363
415
|
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
|
-
|
|
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(
|
|
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(
|
|
46
|
+
{endSlot && <span className={clsx(buttonSlotEnd)}>{endSlot}</span>}
|
|
47
47
|
</Comp>
|
|
48
48
|
);
|
|
49
49
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { assignVars
|
|
2
|
-
import { calc } from '@vanilla-extract/css-utils';
|
|
1
|
+
import { assignVars } from '@vanilla-extract/css';
|
|
3
2
|
import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
|
|
4
3
|
|
|
5
4
|
import { sys } from '../../styles';
|
|
@@ -12,39 +11,48 @@ export const buttonIcon = recipe({
|
|
|
12
11
|
variants: {
|
|
13
12
|
variant: buttonRecipe.classNames.variants.variant,
|
|
14
13
|
size: {
|
|
15
|
-
sm:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
sm: [
|
|
15
|
+
buttonRecipe.classNames.variants.size.sm,
|
|
16
|
+
{
|
|
17
|
+
'@layer': {
|
|
18
|
+
[components]: {
|
|
19
|
+
vars: assignVars(buttonVars.spacing, {
|
|
20
|
+
block: sys.spacing[2],
|
|
21
|
+
inline: sys.spacing[2],
|
|
22
|
+
inner: sys.spacing[2],
|
|
23
|
+
}),
|
|
24
|
+
},
|
|
23
25
|
},
|
|
24
26
|
},
|
|
25
|
-
|
|
26
|
-
md:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
],
|
|
28
|
+
md: [
|
|
29
|
+
buttonRecipe.classNames.variants.size.md,
|
|
30
|
+
{
|
|
31
|
+
'@layer': {
|
|
32
|
+
[components]: {
|
|
33
|
+
vars: assignVars(buttonVars.spacing, {
|
|
34
|
+
block: sys.spacing[2],
|
|
35
|
+
inline: sys.spacing[2],
|
|
36
|
+
inner: sys.spacing[2],
|
|
37
|
+
}),
|
|
38
|
+
},
|
|
34
39
|
},
|
|
35
40
|
},
|
|
36
|
-
|
|
37
|
-
lg:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
],
|
|
42
|
+
lg: [
|
|
43
|
+
buttonRecipe.classNames.variants.size.lg,
|
|
44
|
+
{
|
|
45
|
+
'@layer': {
|
|
46
|
+
[components]: {
|
|
47
|
+
vars: assignVars(buttonVars.spacing, {
|
|
48
|
+
block: sys.spacing[3],
|
|
49
|
+
inline: sys.spacing[3],
|
|
50
|
+
inner: sys.spacing[3],
|
|
51
|
+
}),
|
|
52
|
+
},
|
|
45
53
|
},
|
|
46
54
|
},
|
|
47
|
-
|
|
55
|
+
],
|
|
48
56
|
},
|
|
49
57
|
},
|
|
50
58
|
|
|
@@ -54,37 +62,4 @@ export const buttonIcon = recipe({
|
|
|
54
62
|
},
|
|
55
63
|
});
|
|
56
64
|
|
|
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
65
|
export type ButtonIconVariants = NonNullable<RecipeVariants<typeof buttonIcon>>;
|
|
@@ -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';
|
package/src/components/index.ts
CHANGED
|
@@ -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';
|
|
@@ -1,30 +1,43 @@
|
|
|
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 loaderOverlay = recipe({
|
|
6
7
|
base: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
'@layer': {
|
|
9
|
+
[components]: {
|
|
10
|
+
display: 'flex',
|
|
11
|
+
justifyContent: 'center',
|
|
12
|
+
alignItems: 'center',
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
height: '100%',
|
|
15
|
+
width: '100%',
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
zIndex: 1000,
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
backgroundColor: `color-mix(in srgb, ${sys.color.foreground} 10%, transparent)`,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
17
22
|
},
|
|
18
23
|
|
|
19
24
|
variants: {
|
|
20
25
|
position: {
|
|
21
26
|
absolute: {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
'@layer': {
|
|
28
|
+
[components]: {
|
|
29
|
+
position: 'absolute',
|
|
30
|
+
top: 0,
|
|
31
|
+
left: 0,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
25
34
|
},
|
|
26
35
|
relative: {
|
|
27
|
-
|
|
36
|
+
'@layer': {
|
|
37
|
+
[components]: {
|
|
38
|
+
position: 'relative',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
28
41
|
},
|
|
29
42
|
},
|
|
30
43
|
},
|
|
@@ -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(
|
|
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: {
|