@kalink-ui/seedly 0.34.4 → 0.35.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 +12 -0
- package/README.md +34 -0
- package/docs/component-theming.md +295 -0
- package/docs/theming-strategy.md +69 -0
- package/docs/tone-system.md +139 -0
- package/docs/value-and-scope.md +65 -0
- package/package.json +4 -3
- package/src/components/alert-dialog/alert-dialog-action.tsx +0 -2
- package/src/components/alert-dialog/alert-dialog-cancel.tsx +0 -1
- package/src/components/alert-dialog/alert-dialog-content.css.ts +1 -1
- package/src/components/alert-dialog/alert-dialog-content.tsx +13 -6
- package/src/components/alert-dialog/alert-dialog-footer.css.ts +3 -3
- package/src/components/alert-dialog/alert-dialog-footer.tsx +2 -2
- package/src/components/alert-dialog/alert-dialog-header.tsx +4 -4
- package/src/components/alert-dialog/index.ts +9 -0
- package/src/components/box/box.css.ts +137 -39
- package/src/components/box/box.responsive.ts +2 -2
- package/src/components/box/box.tsx +2 -3
- package/src/components/box/index.ts +1 -1
- package/src/components/button/button.css.ts +142 -149
- package/src/components/button/button.responsive.ts +2 -2
- package/src/components/button/button.tsx +44 -31
- package/src/components/button/index.ts +2 -2
- package/src/components/button-icon/button-icon.css.ts +26 -62
- package/src/components/button-icon/button-icon.responsive.ts +2 -2
- package/src/components/button-icon/button-icon.tsx +5 -7
- package/src/components/card/card.css.ts +1 -5
- package/src/components/card/card.tsx +11 -11
- package/src/components/center/center.css.ts +61 -21
- package/src/components/center/center.responsive.ts +2 -2
- package/src/components/center/center.tsx +4 -6
- package/src/components/center/index.ts +1 -1
- package/src/components/cluster/cluster.css.ts +37 -99
- package/src/components/cluster/cluster.responsive.ts +13 -2
- package/src/components/cluster/cluster.tsx +6 -5
- package/src/components/cluster/index.ts +5 -1
- package/src/components/command/command-empty.tsx +36 -4
- package/src/components/command/command-group.css.ts +23 -7
- package/src/components/command/command-group.tsx +30 -6
- package/src/components/command/command-input.css.ts +2 -2
- package/src/components/command/command-item.tsx +26 -2
- package/src/components/command/command-list.css.ts +2 -2
- package/src/components/command/command-list.responsive.ts +2 -2
- package/src/components/command/command-list.tsx +1 -2
- package/src/components/command/command-separator.tsx +7 -5
- package/src/components/cover/cover.css.ts +29 -8
- package/src/components/cover/cover.tsx +13 -13
- package/src/components/cover/index.ts +2 -2
- package/src/components/divider/divider.css.ts +9 -4
- package/src/components/form-field/form-field-context.ts +3 -0
- package/src/components/form-field/form-field-item.tsx +3 -3
- package/src/components/form-field/form-field-message.tsx +34 -3
- package/src/components/form-field/form-field.css.ts +78 -16
- package/src/components/form-field/form-field.tsx +5 -0
- package/src/components/form-field/index.ts +1 -1
- package/src/components/frame/frame.css.ts +96 -59
- package/src/components/frame/frame.responsive.ts +9 -0
- package/src/components/frame/frame.tsx +11 -5
- package/src/components/frame/index.ts +1 -1
- package/src/components/grid/grid-child.tsx +14 -10
- package/src/components/grid/grid.css.ts +56 -148
- package/src/components/grid/grid.tsx +40 -18
- package/src/components/grid/index.ts +4 -3
- package/src/components/heading/heading.css.ts +4 -4
- package/src/components/heading/heading.responsive.ts +6 -6
- package/src/components/heading/heading.tsx +3 -4
- package/src/components/heading/index.ts +1 -1
- package/src/components/input/index.ts +4 -1
- package/src/components/input/input-wrapper.tsx +20 -8
- package/src/components/input/input.css.ts +121 -93
- package/src/components/input/input.responsive.ts +9 -0
- package/src/components/input/input.tsx +7 -1
- package/src/components/label/label.css.ts +2 -2
- package/src/components/label/label.tsx +23 -3
- package/src/components/layout-maps.ts +120 -0
- package/src/components/loader/index.ts +2 -1
- package/src/components/loader/loader.css.ts +91 -54
- package/src/components/loader/moon-loader.responsive.ts +2 -2
- package/src/components/loader/moon-loader.tsx +4 -5
- package/src/components/loader-overlay/loader-overlay.css.ts +3 -3
- package/src/components/loader-overlay/loader-overlay.tsx +5 -2
- package/src/components/menu/index.ts +2 -2
- package/src/components/menu/menu-item.css.ts +102 -46
- package/src/components/menu/menu-separator.css.ts +27 -15
- package/src/components/menu/menu-separator.responsive.ts +2 -2
- package/src/components/overlay/overlay.css.ts +1 -1
- package/src/components/popover/index.ts +1 -1
- package/src/components/popover/popover-content.css.ts +69 -52
- package/src/components/popover/popover-content.tsx +22 -6
- package/src/components/scroll-area/scroll-area.css.ts +3 -3
- package/src/components/scroll-area/scroll-bar.tsx +2 -2
- package/src/components/select/index.ts +4 -5
- package/src/components/select/select-content.css.ts +1 -1
- package/src/components/select/select-content.tsx +2 -2
- package/src/components/select/select-item.tsx +11 -3
- package/src/components/select/select-trigger.css.ts +14 -18
- package/src/components/select/select-trigger.tsx +18 -8
- package/src/components/select/select.tsx +10 -6
- package/src/components/sheet/index.ts +9 -0
- package/src/components/sheet/sheet-content.css.ts +2 -2
- package/src/components/sheet/sheet-content.tsx +25 -7
- package/src/components/sheet/sheet-description.tsx +5 -7
- package/src/components/sheet/sheet-footer.tsx +3 -1
- package/src/components/sheet/sheet-header.css.ts +1 -1
- package/src/components/sheet/sheet-header.tsx +3 -3
- package/src/components/sheet/sheet-overlay.tsx +3 -4
- package/src/components/sheet/sheet-title.tsx +1 -1
- package/src/components/sidebar/index.ts +5 -1
- package/src/components/sidebar/sidebar.css.ts +35 -9
- package/src/components/sidebar/sidebar.tsx +7 -10
- package/src/components/skeleton/skeleton.css.ts +23 -14
- package/src/components/skeleton/skeleton.tsx +26 -7
- package/src/components/stack/index.ts +1 -1
- package/src/components/stack/stack.css.ts +18 -46
- package/src/components/stack/stack.tsx +1 -2
- package/src/components/switcher/index.ts +5 -1
- package/src/components/switcher/switcher.css.ts +105 -72
- package/src/components/switcher/switcher.responsive.ts +2 -2
- package/src/components/switcher/switcher.tsx +5 -5
- package/src/components/text/text.css.ts +93 -105
- package/src/components/text/text.responsive.ts +3 -63
- package/src/components/text/text.tsx +16 -28
- package/src/components/text-field/index.ts +1 -2
- package/src/components/text-field/text-field.tsx +5 -7
- package/src/components/textarea/textarea-input.tsx +30 -3
- package/src/components/textarea/textarea.css.ts +12 -7
- package/src/components/textarea/textarea.tsx +9 -3
- package/src/components/visually-hidden/visually-hidden.css.ts +16 -10
- package/src/styles/define-responsive-properties.ts +5 -1
- package/src/styles/index.ts +12 -0
- package/src/styles/responsive.ts +72 -43
- package/src/styles/system-contract.css.ts +22 -3
- package/src/styles/theme/sprout-ref.css.ts +107 -0
- package/src/styles/theme/sprout.css.ts +259 -0
- package/src/styles/tone.ts +69 -0
- package/src/styles/typography.responsive.css.ts +35 -0
- package/src/styles/typography.responsive.ts +104 -0
- package/src/utils/arg-types/index.ts +1 -0
- package/src/utils/arg-types/responsive-arg.ts +28 -0
- package/src/utils/index.ts +1 -0
- package/src/components/command/command-item.css.ts +0 -32
- package/src/components/select/select.css.ts +0 -3
- package/src/components/sheet/sheet-body.css.ts +0 -68
- package/src/components/text-field/text-field.css.ts +0 -3
|
@@ -3,6 +3,7 @@ import { calc } from '@vanilla-extract/css-utils';
|
|
|
3
3
|
import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
|
|
4
4
|
|
|
5
5
|
import { mapContractVars, sys } from '../../styles';
|
|
6
|
+
import { components } from '../../styles/layers.css';
|
|
6
7
|
|
|
7
8
|
const translateX = createVar();
|
|
8
9
|
const offsetX = createVar();
|
|
@@ -26,82 +27,98 @@ const leave = keyframes({
|
|
|
26
27
|
},
|
|
27
28
|
});
|
|
28
29
|
|
|
29
|
-
export const
|
|
30
|
+
export const popoverContentRecipe = recipe({
|
|
30
31
|
base: {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
[
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
[
|
|
57
|
-
|
|
32
|
+
'@layer': {
|
|
33
|
+
[components]: {
|
|
34
|
+
animationDuration: sys.motion.duration.short[2],
|
|
35
|
+
animationTimingFunction: sys.motion.easing.standard,
|
|
36
|
+
animationFillMode: 'forwards',
|
|
37
|
+
|
|
38
|
+
opacity: 0,
|
|
39
|
+
transform: `translate3d(${translateX}, ${translateY}, 0) scale3d(${scale}, ${scale}, ${scale})`,
|
|
40
|
+
|
|
41
|
+
selectors: {
|
|
42
|
+
'&[data-state="open"]': {
|
|
43
|
+
animationName: enter,
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
'&[data-state="closed"]': {
|
|
47
|
+
animationName: leave,
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
'&[data-side*="top"]': {
|
|
51
|
+
vars: {
|
|
52
|
+
[translateY]: sys.spacing[2],
|
|
53
|
+
[offsetY]: calc.negate(sys.spacing[1]),
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
'&[data-side*="right"]': {
|
|
58
|
+
vars: {
|
|
59
|
+
[translateX]: calc.negate(sys.spacing[1]),
|
|
60
|
+
[offsetX]: sys.spacing[2],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
'&[data-side*="bottom"]': {
|
|
65
|
+
vars: {
|
|
66
|
+
[translateY]: calc.negate(sys.spacing[1]),
|
|
67
|
+
[offsetY]: sys.spacing[2],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
'&[data-side*="left"]': {
|
|
72
|
+
vars: {
|
|
73
|
+
[translateX]: sys.spacing[3],
|
|
74
|
+
[offsetY]: calc.negate(sys.spacing[1]),
|
|
75
|
+
},
|
|
76
|
+
},
|
|
58
77
|
},
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
'&[data-side*="bottom"]': {
|
|
62
|
-
vars: {
|
|
63
|
-
[translateY]: calc.negate(sys.spacing[1]),
|
|
64
|
-
[offsetY]: sys.spacing[2],
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
78
|
|
|
68
|
-
'&[data-side*="left"]': {
|
|
69
79
|
vars: {
|
|
70
|
-
[translateX]:
|
|
71
|
-
[
|
|
80
|
+
[translateX]: '0',
|
|
81
|
+
[translateY]: '0',
|
|
82
|
+
[offsetX]: '0',
|
|
83
|
+
[offsetY]: '0',
|
|
84
|
+
[scale]: '0.98',
|
|
85
|
+
'--popover-trigger-width': 'var(--radix-popover-trigger-width)',
|
|
72
86
|
},
|
|
73
87
|
},
|
|
74
88
|
},
|
|
75
|
-
|
|
76
|
-
vars: {
|
|
77
|
-
[translateX]: '0',
|
|
78
|
-
[translateY]: '0',
|
|
79
|
-
[offsetX]: '0',
|
|
80
|
-
[offsetY]: '0',
|
|
81
|
-
[scale]: '0.98',
|
|
82
|
-
'--popover-trigger-width': 'var(--radix-popover-trigger-width)',
|
|
83
|
-
},
|
|
84
89
|
},
|
|
85
90
|
|
|
86
91
|
variants: {
|
|
87
92
|
width: {
|
|
88
93
|
trigger: {
|
|
89
|
-
|
|
94
|
+
'@layer': {
|
|
95
|
+
[components]: {
|
|
96
|
+
minWidth: 'var(--popover-trigger-width)',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
90
99
|
},
|
|
91
100
|
},
|
|
92
101
|
|
|
93
102
|
scrollable: {
|
|
94
103
|
true: {
|
|
95
|
-
|
|
104
|
+
'@layer': {
|
|
105
|
+
[components]: {
|
|
106
|
+
overflow: 'hidden',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
96
109
|
},
|
|
97
110
|
},
|
|
98
111
|
|
|
99
112
|
elevation: mapContractVars(sys.elevation, (key) => ({
|
|
100
|
-
|
|
113
|
+
'@layer': {
|
|
114
|
+
[components]: {
|
|
115
|
+
boxShadow: sys.elevation[key],
|
|
116
|
+
},
|
|
117
|
+
},
|
|
101
118
|
})),
|
|
102
119
|
},
|
|
103
120
|
});
|
|
104
121
|
|
|
105
122
|
export type PopoverContentVariants = NonNullable<
|
|
106
|
-
RecipeVariants<typeof
|
|
123
|
+
RecipeVariants<typeof popoverContentRecipe>
|
|
107
124
|
>;
|
|
@@ -11,16 +11,24 @@ import {
|
|
|
11
11
|
import { Box, BoxProps } from '../box';
|
|
12
12
|
import { ScrollArea } from '../scroll-area';
|
|
13
13
|
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
popoverContentRecipe,
|
|
16
|
+
PopoverContentVariants,
|
|
17
|
+
} from './popover-content.css';
|
|
18
|
+
|
|
19
|
+
type BoxStyleProps = Pick<
|
|
20
|
+
BoxProps<'div'>,
|
|
21
|
+
'variant' | 'spacing' | 'radius' | 'elevation' | 'use'
|
|
22
|
+
>;
|
|
15
23
|
|
|
16
24
|
export type PopoverContentProps = {
|
|
17
25
|
portaled?: boolean;
|
|
18
26
|
maxHeight?: string;
|
|
19
27
|
scrollable?: boolean;
|
|
20
|
-
} &
|
|
21
|
-
PopoverContentVariants &
|
|
28
|
+
} & PopoverContentVariants &
|
|
22
29
|
ComponentPropsWithoutRef<typeof Portal> &
|
|
23
|
-
|
|
30
|
+
BoxStyleProps &
|
|
31
|
+
Omit<ComponentPropsWithRef<typeof Content>, keyof BoxStyleProps>;
|
|
24
32
|
|
|
25
33
|
export interface PopoverScrollableProps {
|
|
26
34
|
scrollable?: boolean;
|
|
@@ -47,6 +55,8 @@ export function PopoverContent({
|
|
|
47
55
|
children,
|
|
48
56
|
spacing = 4,
|
|
49
57
|
radius = 'medium',
|
|
58
|
+
variant,
|
|
59
|
+
use,
|
|
50
60
|
width,
|
|
51
61
|
portaled = true,
|
|
52
62
|
scrollable = true,
|
|
@@ -58,7 +68,7 @@ export function PopoverContent({
|
|
|
58
68
|
<Content
|
|
59
69
|
align={align}
|
|
60
70
|
className={clsx(
|
|
61
|
-
|
|
71
|
+
popoverContentRecipe({ width, scrollable, elevation }),
|
|
62
72
|
className,
|
|
63
73
|
)}
|
|
64
74
|
sideOffset={0}
|
|
@@ -66,7 +76,13 @@ export function PopoverContent({
|
|
|
66
76
|
collisionPadding={16}
|
|
67
77
|
{...props}
|
|
68
78
|
>
|
|
69
|
-
<Box
|
|
79
|
+
<Box
|
|
80
|
+
use={use}
|
|
81
|
+
variant={variant}
|
|
82
|
+
spacing={spacing}
|
|
83
|
+
radius={radius}
|
|
84
|
+
elevation={elevation}
|
|
85
|
+
>
|
|
70
86
|
<PopoverScrollable scrollable={scrollable} maxHeight={maxHeight}>
|
|
71
87
|
{children}
|
|
72
88
|
</PopoverScrollable>
|
|
@@ -33,7 +33,7 @@ export const scrollAreaViewport = style({
|
|
|
33
33
|
},
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
export const
|
|
36
|
+
export const scrollAreaScrollbarRecipe = recipe({
|
|
37
37
|
base: {
|
|
38
38
|
'@layer': {
|
|
39
39
|
[components]: {
|
|
@@ -87,11 +87,11 @@ export const scrollAreaThumb = style({
|
|
|
87
87
|
|
|
88
88
|
borderRadius: sys.shape.corner.small,
|
|
89
89
|
|
|
90
|
-
backgroundColor: sys.
|
|
90
|
+
backgroundColor: sys.surface.foreground,
|
|
91
91
|
},
|
|
92
92
|
},
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
export type ScrollAreaScrollbarVariants = NonNullable<
|
|
96
|
-
RecipeVariants<typeof
|
|
96
|
+
RecipeVariants<typeof scrollAreaScrollbarRecipe>
|
|
97
97
|
>;
|
|
@@ -8,7 +8,7 @@ import { clsx } from 'clsx';
|
|
|
8
8
|
import { ComponentPropsWithRef } from 'react';
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
|
-
|
|
11
|
+
scrollAreaScrollbarRecipe,
|
|
12
12
|
ScrollAreaScrollbarVariants,
|
|
13
13
|
scrollAreaThumb,
|
|
14
14
|
} from './scroll-area.css';
|
|
@@ -28,7 +28,7 @@ export function ScrollBar({
|
|
|
28
28
|
<ScrollAreaScrollbar
|
|
29
29
|
ref={ref}
|
|
30
30
|
orientation={orientation}
|
|
31
|
-
className={clsx(
|
|
31
|
+
className={clsx(scrollAreaScrollbarRecipe({ orientation }), className)}
|
|
32
32
|
{...props}
|
|
33
33
|
>
|
|
34
34
|
<ScrollAreaThumb className={scrollAreaThumb} />
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export { SelectContent } from './select-content';
|
|
2
|
-
export { Select } from './select';
|
|
3
|
-
export { SelectItem } from './select-item';
|
|
1
|
+
export { SelectContent, type SelectContentProps } from './select-content';
|
|
2
|
+
export { Select, type SelectProps } from './select';
|
|
3
|
+
export { SelectItem, type SelectItemProps } from './select-item';
|
|
4
4
|
export { SelectRoot } from './select-root';
|
|
5
|
-
export { SelectTrigger } from './select-trigger';
|
|
6
|
-
export { selectStyle } from './select.css';
|
|
5
|
+
export { SelectTrigger, type SelectTriggerProps } from './select-trigger';
|
|
@@ -4,7 +4,7 @@ import { Portal, Content, Viewport } from '@radix-ui/react-select';
|
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { popoverContentRecipe } from '../popover';
|
|
8
8
|
import { ScrollArea } from '../scroll-area';
|
|
9
9
|
|
|
10
10
|
import { SelectProps } from './select';
|
|
@@ -40,7 +40,7 @@ export function SelectContent({
|
|
|
40
40
|
return (
|
|
41
41
|
<SelectContentPortal container={container}>
|
|
42
42
|
<Content position={position} asChild {...props}>
|
|
43
|
-
<div className={clsx(selectContent,
|
|
43
|
+
<div className={clsx(selectContent, popoverContentRecipe())}>
|
|
44
44
|
<Viewport className={selectContentViewport}>
|
|
45
45
|
<ScrollArea maxHeight="16rem">{children}</ScrollArea>
|
|
46
46
|
</Viewport>
|
|
@@ -4,17 +4,25 @@ import { Item, ItemIndicator, ItemText } from '@radix-ui/react-select';
|
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { menuItemRecipe } from '../menu';
|
|
8
8
|
|
|
9
9
|
import { selectItemIndicator } from './select-item.css';
|
|
10
10
|
|
|
11
|
+
import type { Tone } from '../../styles';
|
|
12
|
+
|
|
11
13
|
export type SelectItemProps = ComponentPropsWithoutRef<typeof Item> & {
|
|
12
14
|
indicator?: ReactNode;
|
|
15
|
+
tone?: Tone;
|
|
13
16
|
};
|
|
14
17
|
|
|
15
|
-
export function SelectItem({
|
|
18
|
+
export function SelectItem({
|
|
19
|
+
children,
|
|
20
|
+
indicator,
|
|
21
|
+
tone,
|
|
22
|
+
...props
|
|
23
|
+
}: SelectItemProps) {
|
|
16
24
|
return (
|
|
17
|
-
<Item className={clsx(
|
|
25
|
+
<Item className={clsx(menuItemRecipe({ inset: true, tone }))} {...props}>
|
|
18
26
|
<ItemIndicator asChild>
|
|
19
27
|
{indicator || <div className={selectItemIndicator} />}
|
|
20
28
|
</ItemIndicator>
|
|
@@ -4,30 +4,26 @@ import { recipe } from '@vanilla-extract/recipes';
|
|
|
4
4
|
|
|
5
5
|
import { sys, transition } from '../../styles';
|
|
6
6
|
import { components } from '../../styles/layers.css';
|
|
7
|
-
import { inputAppearance } from '../input/input.css';
|
|
8
7
|
|
|
9
|
-
export const selectTrigger = style(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
gap: sys.spacing[4],
|
|
17
|
-
justifyContent: 'flex-start',
|
|
8
|
+
export const selectTrigger = style({
|
|
9
|
+
'@layer': {
|
|
10
|
+
[components]: {
|
|
11
|
+
display: 'flex',
|
|
12
|
+
alignItems: 'stretch',
|
|
13
|
+
gap: sys.spacing[4],
|
|
14
|
+
justifyContent: 'flex-start',
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
16
|
+
':before': {
|
|
17
|
+
content: '\x00',
|
|
18
|
+
width: 0,
|
|
19
|
+
overflow: 'hidden',
|
|
20
|
+
marginInlineEnd: calc.negate(sys.spacing[4]),
|
|
25
21
|
},
|
|
26
22
|
},
|
|
27
23
|
},
|
|
28
|
-
|
|
24
|
+
});
|
|
29
25
|
|
|
30
|
-
export const
|
|
26
|
+
export const openIndicatorRecipe = recipe({
|
|
31
27
|
base: {
|
|
32
28
|
'@layer': {
|
|
33
29
|
[components]: {
|
|
@@ -6,26 +6,36 @@ import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { buttonRecipe } from '../button/button.css';
|
|
8
8
|
import { useFormFieldItemContext, useFormFieldContext } from '../form-field';
|
|
9
|
+
import { inputAppearanceRecipe, type InputAppearanceVariants } from '../input';
|
|
9
10
|
|
|
10
|
-
import {
|
|
11
|
+
import { openIndicatorRecipe, selectTrigger } from './select-trigger.css';
|
|
11
12
|
|
|
12
|
-
export type SelectTriggerProps = ComponentPropsWithRef<typeof Trigger> &
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
export type SelectTriggerProps = ComponentPropsWithRef<typeof Trigger> &
|
|
14
|
+
Pick<InputAppearanceVariants, 'tone' | 'size' | 'variant'> & {
|
|
15
|
+
icon?: ReactNode;
|
|
16
|
+
};
|
|
15
17
|
|
|
16
18
|
export function SelectTrigger({
|
|
17
19
|
className,
|
|
18
20
|
children,
|
|
19
21
|
icon = null,
|
|
22
|
+
tone,
|
|
23
|
+
size,
|
|
24
|
+
variant,
|
|
20
25
|
...props
|
|
21
26
|
}: SelectTriggerProps) {
|
|
22
|
-
const { errors, label } = useFormFieldContext();
|
|
27
|
+
const { errors, label, tone: contextTone } = useFormFieldContext();
|
|
23
28
|
const { id } = useFormFieldItemContext();
|
|
29
|
+
const resolvedTone = tone ?? contextTone;
|
|
24
30
|
|
|
25
31
|
return (
|
|
26
32
|
<Trigger
|
|
27
33
|
id={id}
|
|
28
|
-
className={clsx(
|
|
34
|
+
className={clsx(
|
|
35
|
+
inputAppearanceRecipe({ tone: resolvedTone, size, variant }),
|
|
36
|
+
selectTrigger,
|
|
37
|
+
className,
|
|
38
|
+
)}
|
|
29
39
|
aria-invalid={errors ? 'true' : undefined}
|
|
30
40
|
aria-label={label}
|
|
31
41
|
{...props}
|
|
@@ -35,8 +45,8 @@ export function SelectTrigger({
|
|
|
35
45
|
<div
|
|
36
46
|
// Mimic the Combobox style
|
|
37
47
|
className={clsx(
|
|
38
|
-
buttonRecipe({ size: 'sm', variant: 'bare' }),
|
|
39
|
-
|
|
48
|
+
buttonRecipe({ size: 'sm', variant: 'bare', tone }),
|
|
49
|
+
openIndicatorRecipe({ fallback: !icon }),
|
|
40
50
|
)}
|
|
41
51
|
>
|
|
42
52
|
{icon}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Value } from '@radix-ui/react-select';
|
|
2
|
-
import { clsx } from 'clsx';
|
|
3
2
|
import { ComponentPropsWithoutRef, ComponentPropsWithRef } from 'react';
|
|
4
3
|
|
|
5
4
|
import {
|
|
@@ -15,7 +14,6 @@ import { InputAppearanceVariants } from '../input';
|
|
|
15
14
|
import { SelectContent } from './select-content';
|
|
16
15
|
import { SelectRoot } from './select-root';
|
|
17
16
|
import { SelectTrigger } from './select-trigger';
|
|
18
|
-
import { selectStyle } from './select.css';
|
|
19
17
|
|
|
20
18
|
export type SelectProps = ComponentPropsWithoutRef<typeof SelectRoot> &
|
|
21
19
|
Pick<ComponentPropsWithoutRef<typeof Value>, 'placeholder'> &
|
|
@@ -51,6 +49,8 @@ export function Select({
|
|
|
51
49
|
size = 'md',
|
|
52
50
|
ref,
|
|
53
51
|
className,
|
|
52
|
+
tone,
|
|
53
|
+
variant,
|
|
54
54
|
...props
|
|
55
55
|
}: SelectProps) {
|
|
56
56
|
return (
|
|
@@ -61,8 +61,9 @@ export function Select({
|
|
|
61
61
|
hideErrorMessage={hideErrorMessage}
|
|
62
62
|
disabled={disabled}
|
|
63
63
|
hideLabel={hideLabel}
|
|
64
|
+
tone={tone}
|
|
64
65
|
>
|
|
65
|
-
<FormFieldItem className={
|
|
66
|
+
<FormFieldItem className={className}>
|
|
66
67
|
<FormFieldLabel required={required} disabled={disabled} size={size}>
|
|
67
68
|
{label}
|
|
68
69
|
</FormFieldLabel>
|
|
@@ -75,14 +76,17 @@ export function Select({
|
|
|
75
76
|
onBlur={onBlur}
|
|
76
77
|
onFocus={onFocus}
|
|
77
78
|
aria-label={hideLabel ? label : undefined}
|
|
79
|
+
tone={tone}
|
|
80
|
+
size={size}
|
|
81
|
+
variant={variant}
|
|
78
82
|
>
|
|
79
|
-
<Value placeholder={placeholder}
|
|
83
|
+
<Value placeholder={placeholder} />
|
|
80
84
|
</SelectTrigger>
|
|
81
85
|
</FormFieldControl>
|
|
82
86
|
<SelectContent container={container}>{children}</SelectContent>
|
|
83
87
|
</SelectRoot>
|
|
84
|
-
<FormFieldDescription>{description}</FormFieldDescription>
|
|
85
|
-
<FormFieldError />
|
|
88
|
+
<FormFieldDescription size={size}>{description}</FormFieldDescription>
|
|
89
|
+
<FormFieldError size={size} />
|
|
86
90
|
</FormFieldItem>
|
|
87
91
|
</FormField>
|
|
88
92
|
);
|
|
@@ -6,3 +6,12 @@ export { SheetContent } from './sheet-content';
|
|
|
6
6
|
export { SheetBody } from './sheet-body';
|
|
7
7
|
export { SheetFooter } from './sheet-footer';
|
|
8
8
|
export { SheetOverlay } from './sheet-overlay';
|
|
9
|
+
|
|
10
|
+
export type { SheetContentVariants } from './sheet-content.css';
|
|
11
|
+
export type { SheetBodyProps } from './sheet-body';
|
|
12
|
+
export type { SheetContentProps } from './sheet-content';
|
|
13
|
+
export type { SheetDescriptionProps } from './sheet-description';
|
|
14
|
+
export type { SheetFooterProps } from './sheet-footer';
|
|
15
|
+
export type { SheetHeaderProps } from './sheet-header';
|
|
16
|
+
export type { SheetOverlayProps } from './sheet-overlay';
|
|
17
|
+
export type { SheetTitleProps } from './sheet-title';
|
|
@@ -28,7 +28,7 @@ const leave = keyframes({
|
|
|
28
28
|
},
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
export const
|
|
31
|
+
export const sheetContentRecipe = recipe({
|
|
32
32
|
base: {
|
|
33
33
|
'@layer': {
|
|
34
34
|
[components]: {
|
|
@@ -187,5 +187,5 @@ export const sheetContent = recipe({
|
|
|
187
187
|
});
|
|
188
188
|
|
|
189
189
|
export type SheetContentVariants = NonNullable<
|
|
190
|
-
RecipeVariants<typeof
|
|
190
|
+
RecipeVariants<typeof sheetContentRecipe>
|
|
191
191
|
>;
|
|
@@ -7,32 +7,50 @@ import { ComponentPropsWithRef, ElementType } from 'react';
|
|
|
7
7
|
import { Box, BoxProps } from '../box';
|
|
8
8
|
|
|
9
9
|
import { SheetPortal } from './sheet';
|
|
10
|
-
import {
|
|
10
|
+
import { sheetContentRecipe, SheetContentVariants } from './sheet-content.css';
|
|
11
11
|
import { SheetOverlay } from './sheet-overlay';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
type SheetPortalProps = ComponentPropsWithRef<typeof Portal>;
|
|
14
|
+
type BoxStyleProps<TUse extends ElementType> = Pick<
|
|
15
|
+
BoxProps<TUse>,
|
|
16
|
+
'variant' | 'radius' | 'elevation' | 'use'
|
|
17
|
+
>;
|
|
18
|
+
|
|
19
|
+
export type SheetContentProps<TUse extends ElementType> = SheetContentVariants &
|
|
20
|
+
BoxStyleProps<TUse> &
|
|
21
|
+
Omit<ComponentPropsWithRef<typeof Content>, keyof BoxStyleProps<TUse>> &
|
|
22
|
+
Omit<SheetPortalProps, keyof BoxStyleProps<TUse>>;
|
|
16
23
|
|
|
17
24
|
export function SheetContent<TUse extends ElementType>({
|
|
18
25
|
className,
|
|
19
26
|
children,
|
|
20
27
|
container,
|
|
28
|
+
forceMount,
|
|
21
29
|
side,
|
|
22
30
|
size,
|
|
23
31
|
ref,
|
|
24
32
|
spacing = 4,
|
|
33
|
+
variant,
|
|
34
|
+
elevation,
|
|
35
|
+
radius,
|
|
36
|
+
use,
|
|
25
37
|
...props
|
|
26
38
|
}: SheetContentProps<TUse>) {
|
|
27
39
|
return (
|
|
28
|
-
<SheetPortal container={container}>
|
|
40
|
+
<SheetPortal container={container} forceMount={forceMount}>
|
|
29
41
|
<SheetOverlay />
|
|
30
42
|
<Content asChild>
|
|
31
43
|
<Box
|
|
32
44
|
ref={ref}
|
|
33
|
-
|
|
45
|
+
use={use}
|
|
46
|
+
variant={variant ?? 'solid'}
|
|
34
47
|
spacing={spacing}
|
|
35
|
-
|
|
48
|
+
elevation={elevation}
|
|
49
|
+
radius={radius}
|
|
50
|
+
className={clsx(
|
|
51
|
+
sheetContentRecipe({ side, size, spacing }),
|
|
52
|
+
className,
|
|
53
|
+
)}
|
|
36
54
|
{...props}
|
|
37
55
|
>
|
|
38
56
|
{children}
|
|
@@ -3,19 +3,17 @@ import { ComponentPropsWithRef, ElementType } from 'react';
|
|
|
3
3
|
|
|
4
4
|
import { Text, TextProps } from '../text';
|
|
5
5
|
|
|
6
|
-
type
|
|
7
|
-
typeof Description
|
|
8
|
-
> &
|
|
9
|
-
TextProps<TUse>;
|
|
6
|
+
export type SheetDescriptionProps<TUse extends ElementType> =
|
|
7
|
+
ComponentPropsWithRef<typeof Description> & TextProps<TUse>;
|
|
10
8
|
|
|
11
9
|
export function SheetDescription<TUse extends ElementType>({
|
|
12
10
|
ref,
|
|
13
11
|
children,
|
|
14
12
|
...props
|
|
15
|
-
}:
|
|
13
|
+
}: SheetDescriptionProps<TUse>) {
|
|
16
14
|
return (
|
|
17
|
-
<Description ref={ref} asChild
|
|
18
|
-
<Text>{children}</Text>
|
|
15
|
+
<Description ref={ref} asChild>
|
|
16
|
+
<Text {...props}>{children}</Text>
|
|
19
17
|
</Description>
|
|
20
18
|
);
|
|
21
19
|
}
|
|
@@ -5,11 +5,13 @@ import { Cluster, ClusterProps } from '../cluster';
|
|
|
5
5
|
|
|
6
6
|
import { sheetFooter } from './sheet-footer.css';
|
|
7
7
|
|
|
8
|
+
export type SheetFooterProps<TUse extends ElementType> = ClusterProps<TUse>;
|
|
9
|
+
|
|
8
10
|
export function SheetFooter<TUse extends ElementType>({
|
|
9
11
|
spacing = 4,
|
|
10
12
|
className,
|
|
11
13
|
...props
|
|
12
|
-
}:
|
|
14
|
+
}: SheetFooterProps<TUse>) {
|
|
13
15
|
return (
|
|
14
16
|
<Cluster
|
|
15
17
|
spacing={spacing}
|
|
@@ -4,7 +4,7 @@ import { recipe } from '@vanilla-extract/recipes';
|
|
|
4
4
|
import { sys } from '../../styles';
|
|
5
5
|
import { components } from '../../styles/layers.css';
|
|
6
6
|
|
|
7
|
-
export const
|
|
7
|
+
export const sheetHeaderRecipe = recipe({
|
|
8
8
|
base: {
|
|
9
9
|
'@layer': {
|
|
10
10
|
[components]: {
|
|
@@ -4,9 +4,9 @@ import { Stack, StackProps } from '../stack';
|
|
|
4
4
|
|
|
5
5
|
import { SheetClose } from './sheet';
|
|
6
6
|
import { SheetContentVariants } from './sheet-content.css';
|
|
7
|
-
import {
|
|
7
|
+
import { sheetHeaderRecipe, sheetHeaderCloseBtn } from './sheet-header.css';
|
|
8
8
|
|
|
9
|
-
type SheetHeaderProps<TUse extends ElementType> = StackProps<TUse> & {
|
|
9
|
+
export type SheetHeaderProps<TUse extends ElementType> = StackProps<TUse> & {
|
|
10
10
|
side: SheetContentVariants['side'];
|
|
11
11
|
closeBtn: ReactNode;
|
|
12
12
|
};
|
|
@@ -20,7 +20,7 @@ export function SheetHeader<TUse extends ElementType>({
|
|
|
20
20
|
...props
|
|
21
21
|
}: SheetHeaderProps<TUse>) {
|
|
22
22
|
return (
|
|
23
|
-
<div ref={ref} className={
|
|
23
|
+
<div ref={ref} className={sheetHeaderRecipe({ side })}>
|
|
24
24
|
<Stack spacing={spacing} {...props}>
|
|
25
25
|
{children}
|
|
26
26
|
</Stack>
|
|
@@ -6,9 +6,8 @@ import { ComponentPropsWithRef } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { overlay } from '../overlay';
|
|
8
8
|
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}: ComponentPropsWithRef<typeof Overlay>) {
|
|
9
|
+
export type SheetOverlayProps = ComponentPropsWithRef<typeof Overlay>;
|
|
10
|
+
|
|
11
|
+
export function SheetOverlay({ className, ...props }: SheetOverlayProps) {
|
|
13
12
|
return <Overlay className={clsx(overlay, className)} {...props} />;
|
|
14
13
|
}
|