@kalink-ui/seedly 0.34.3 → 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.
Files changed (144) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +34 -0
  3. package/docs/component-theming.md +295 -0
  4. package/docs/theming-strategy.md +69 -0
  5. package/docs/tone-system.md +139 -0
  6. package/docs/value-and-scope.md +65 -0
  7. package/package.json +4 -3
  8. package/src/components/alert-dialog/alert-dialog-action.tsx +0 -2
  9. package/src/components/alert-dialog/alert-dialog-cancel.tsx +0 -1
  10. package/src/components/alert-dialog/alert-dialog-content.css.ts +1 -1
  11. package/src/components/alert-dialog/alert-dialog-content.tsx +13 -6
  12. package/src/components/alert-dialog/alert-dialog-footer.css.ts +3 -3
  13. package/src/components/alert-dialog/alert-dialog-footer.tsx +2 -2
  14. package/src/components/alert-dialog/alert-dialog-header.tsx +4 -4
  15. package/src/components/alert-dialog/index.ts +9 -0
  16. package/src/components/box/box.css.ts +137 -39
  17. package/src/components/box/box.responsive.ts +2 -2
  18. package/src/components/box/box.tsx +2 -3
  19. package/src/components/box/index.ts +1 -1
  20. package/src/components/button/button.css.ts +142 -149
  21. package/src/components/button/button.responsive.ts +2 -2
  22. package/src/components/button/button.tsx +44 -31
  23. package/src/components/button/index.ts +2 -2
  24. package/src/components/button-icon/button-icon.css.ts +26 -62
  25. package/src/components/button-icon/button-icon.responsive.ts +2 -2
  26. package/src/components/button-icon/button-icon.tsx +5 -7
  27. package/src/components/card/card.css.ts +1 -5
  28. package/src/components/card/card.tsx +11 -11
  29. package/src/components/center/center.css.ts +61 -21
  30. package/src/components/center/center.responsive.ts +2 -2
  31. package/src/components/center/center.tsx +4 -6
  32. package/src/components/center/index.ts +1 -1
  33. package/src/components/cluster/cluster.css.ts +37 -99
  34. package/src/components/cluster/cluster.responsive.ts +13 -2
  35. package/src/components/cluster/cluster.tsx +6 -5
  36. package/src/components/cluster/index.ts +5 -1
  37. package/src/components/command/command-empty.tsx +36 -4
  38. package/src/components/command/command-group.css.ts +23 -7
  39. package/src/components/command/command-group.tsx +30 -6
  40. package/src/components/command/command-input.css.ts +2 -2
  41. package/src/components/command/command-item.tsx +26 -2
  42. package/src/components/command/command-list.css.ts +2 -2
  43. package/src/components/command/command-list.responsive.ts +2 -2
  44. package/src/components/command/command-list.tsx +1 -2
  45. package/src/components/command/command-separator.tsx +7 -5
  46. package/src/components/cover/cover.css.ts +29 -8
  47. package/src/components/cover/cover.tsx +13 -13
  48. package/src/components/cover/index.ts +2 -2
  49. package/src/components/divider/divider.css.ts +9 -4
  50. package/src/components/form-field/form-field-context.ts +3 -0
  51. package/src/components/form-field/form-field-item.tsx +3 -3
  52. package/src/components/form-field/form-field-message.tsx +34 -3
  53. package/src/components/form-field/form-field.css.ts +78 -16
  54. package/src/components/form-field/form-field.tsx +5 -0
  55. package/src/components/form-field/index.ts +1 -1
  56. package/src/components/frame/frame.css.ts +96 -59
  57. package/src/components/frame/frame.responsive.ts +9 -0
  58. package/src/components/frame/frame.tsx +11 -5
  59. package/src/components/frame/index.ts +1 -1
  60. package/src/components/grid/grid-child.tsx +14 -10
  61. package/src/components/grid/grid.css.ts +56 -148
  62. package/src/components/grid/grid.tsx +40 -18
  63. package/src/components/grid/index.ts +4 -3
  64. package/src/components/heading/heading.css.ts +4 -4
  65. package/src/components/heading/heading.responsive.ts +6 -6
  66. package/src/components/heading/heading.tsx +3 -4
  67. package/src/components/heading/index.ts +1 -1
  68. package/src/components/input/index.ts +4 -1
  69. package/src/components/input/input-wrapper.tsx +20 -8
  70. package/src/components/input/input.css.ts +121 -93
  71. package/src/components/input/input.responsive.ts +9 -0
  72. package/src/components/input/input.tsx +7 -1
  73. package/src/components/label/label.css.ts +2 -2
  74. package/src/components/label/label.tsx +23 -3
  75. package/src/components/layout-maps.ts +120 -0
  76. package/src/components/loader/index.ts +2 -1
  77. package/src/components/loader/loader.css.ts +91 -54
  78. package/src/components/loader/moon-loader.responsive.ts +2 -2
  79. package/src/components/loader/moon-loader.tsx +4 -5
  80. package/src/components/loader-overlay/loader-overlay.css.ts +3 -3
  81. package/src/components/loader-overlay/loader-overlay.tsx +5 -2
  82. package/src/components/menu/index.ts +2 -2
  83. package/src/components/menu/menu-item.css.ts +102 -46
  84. package/src/components/menu/menu-separator.css.ts +27 -15
  85. package/src/components/menu/menu-separator.responsive.ts +2 -2
  86. package/src/components/overlay/overlay.css.ts +1 -1
  87. package/src/components/popover/index.ts +1 -1
  88. package/src/components/popover/popover-content.css.ts +69 -52
  89. package/src/components/popover/popover-content.tsx +22 -6
  90. package/src/components/scroll-area/scroll-area.css.ts +3 -3
  91. package/src/components/scroll-area/scroll-bar.tsx +2 -2
  92. package/src/components/select/index.ts +4 -5
  93. package/src/components/select/select-content.css.ts +1 -1
  94. package/src/components/select/select-content.tsx +2 -2
  95. package/src/components/select/select-item.tsx +11 -3
  96. package/src/components/select/select-trigger.css.ts +14 -18
  97. package/src/components/select/select-trigger.tsx +18 -8
  98. package/src/components/select/select.tsx +10 -6
  99. package/src/components/sheet/index.ts +12 -0
  100. package/src/components/sheet/sheet-content.css.ts +2 -2
  101. package/src/components/sheet/sheet-content.tsx +25 -7
  102. package/src/components/sheet/sheet-description.tsx +5 -7
  103. package/src/components/sheet/sheet-footer.tsx +3 -1
  104. package/src/components/sheet/sheet-header.css.ts +1 -1
  105. package/src/components/sheet/sheet-header.tsx +3 -3
  106. package/src/components/sheet/sheet-overlay.tsx +3 -4
  107. package/src/components/sheet/sheet-title.tsx +1 -1
  108. package/src/components/sidebar/index.ts +5 -1
  109. package/src/components/sidebar/sidebar.css.ts +35 -9
  110. package/src/components/sidebar/sidebar.tsx +7 -10
  111. package/src/components/skeleton/skeleton.css.ts +23 -14
  112. package/src/components/skeleton/skeleton.tsx +26 -7
  113. package/src/components/stack/index.ts +1 -1
  114. package/src/components/stack/stack.css.ts +18 -46
  115. package/src/components/stack/stack.tsx +1 -2
  116. package/src/components/switcher/index.ts +5 -1
  117. package/src/components/switcher/switcher.css.ts +105 -72
  118. package/src/components/switcher/switcher.responsive.ts +2 -2
  119. package/src/components/switcher/switcher.tsx +5 -5
  120. package/src/components/text/text.css.ts +93 -105
  121. package/src/components/text/text.responsive.ts +3 -63
  122. package/src/components/text/text.tsx +16 -28
  123. package/src/components/text-field/index.ts +1 -2
  124. package/src/components/text-field/text-field.tsx +5 -7
  125. package/src/components/textarea/textarea-input.tsx +30 -3
  126. package/src/components/textarea/textarea.css.ts +12 -7
  127. package/src/components/textarea/textarea.tsx +9 -3
  128. package/src/components/visually-hidden/visually-hidden.css.ts +16 -10
  129. package/src/styles/define-responsive-properties.ts +5 -1
  130. package/src/styles/index.ts +12 -0
  131. package/src/styles/responsive.ts +72 -43
  132. package/src/styles/system-contract.css.ts +22 -3
  133. package/src/styles/theme/sprout-ref.css.ts +107 -0
  134. package/src/styles/theme/sprout.css.ts +259 -0
  135. package/src/styles/tone.ts +69 -0
  136. package/src/styles/typography.responsive.css.ts +35 -0
  137. package/src/styles/typography.responsive.ts +104 -0
  138. package/src/utils/arg-types/index.ts +1 -0
  139. package/src/utils/arg-types/responsive-arg.ts +28 -0
  140. package/src/utils/index.ts +1 -0
  141. package/src/components/command/command-item.css.ts +0 -32
  142. package/src/components/select/select.css.ts +0 -3
  143. package/src/components/sheet/sheet-body.css.ts +0 -68
  144. 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 popoverContent = recipe({
30
+ export const popoverContentRecipe = recipe({
30
31
  base: {
31
- animationDuration: sys.motion.duration.short[2],
32
- animationTimingFunction: sys.motion.easing.standard,
33
- animationFillMode: 'forwards',
34
-
35
- opacity: 0,
36
- transform: `translate3d(${translateX}, ${translateY}, 0) scale3d(${scale}, ${scale}, ${scale})`,
37
-
38
- selectors: {
39
- '&[data-state="open"]': {
40
- animationName: enter,
41
- },
42
-
43
- '&[data-state="closed"]': {
44
- animationName: leave,
45
- },
46
-
47
- '&[data-side*="top"]': {
48
- vars: {
49
- [translateY]: sys.spacing[2],
50
- [offsetY]: calc.negate(sys.spacing[1]),
51
- },
52
- },
53
-
54
- '&[data-side*="right"]': {
55
- vars: {
56
- [translateX]: calc.negate(sys.spacing[1]),
57
- [offsetX]: sys.spacing[2],
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]: sys.spacing[3],
71
- [offsetY]: calc.negate(sys.spacing[1]),
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
- minWidth: 'var(--popover-trigger-width)',
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
- overflow: 'hidden',
104
+ '@layer': {
105
+ [components]: {
106
+ overflow: 'hidden',
107
+ },
108
+ },
96
109
  },
97
110
  },
98
111
 
99
112
  elevation: mapContractVars(sys.elevation, (key) => ({
100
- boxShadow: sys.elevation[key],
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 popoverContent>
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 { popoverContent, PopoverContentVariants } from './popover-content.css';
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
- } & ComponentPropsWithRef<typeof Content> &
21
- PopoverContentVariants &
28
+ } & PopoverContentVariants &
22
29
  ComponentPropsWithoutRef<typeof Portal> &
23
- BoxProps<'div'>;
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
- popoverContent({ width, scrollable, elevation }),
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 spacing={spacing} radius={radius}>
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 scrollAreaScrollbar = recipe({
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.color.foreground,
90
+ backgroundColor: sys.surface.foreground,
91
91
  },
92
92
  },
93
93
  });
94
94
 
95
95
  export type ScrollAreaScrollbarVariants = NonNullable<
96
- RecipeVariants<typeof scrollAreaScrollbar>
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
- scrollAreaScrollbar,
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(scrollAreaScrollbar({ orientation }), className)}
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';
@@ -6,7 +6,7 @@ import { components } from '../../styles/layers.css';
6
6
  export const selectContent = style({
7
7
  '@layer': {
8
8
  [components]: {
9
- backgroundColor: sys.color.background,
9
+ backgroundColor: sys.surface.background,
10
10
  },
11
11
  },
12
12
  });
@@ -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 { popoverContent } from '../popover';
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, popoverContent())}>
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 { menuItem } from '../menu';
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({ children, indicator, ...props }: SelectItemProps) {
18
+ export function SelectItem({
19
+ children,
20
+ indicator,
21
+ tone,
22
+ ...props
23
+ }: SelectItemProps) {
16
24
  return (
17
- <Item className={clsx(menuItem({ inset: true }))} {...props}>
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
- inputAppearance(),
11
- {
12
- '@layer': {
13
- [components]: {
14
- display: 'flex',
15
- alignItems: 'stretch',
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
- ':before': {
20
- content: '\x00',
21
- width: 0,
22
- overflow: 'hidden',
23
- marginInlineEnd: calc.negate(sys.spacing[4]),
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 openIndicator = recipe({
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 { openIndicator, selectTrigger } from './select-trigger.css';
11
+ import { openIndicatorRecipe, selectTrigger } from './select-trigger.css';
11
12
 
12
- export type SelectTriggerProps = ComponentPropsWithRef<typeof Trigger> & {
13
- icon?: ReactNode;
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(selectTrigger, className)}
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
- openIndicator({ fallback: !icon }),
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={clsx(selectStyle, 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} className="test" />
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
  );
@@ -3,3 +3,15 @@ export { SheetHeader } from './sheet-header';
3
3
  export { SheetTitle } from './sheet-title';
4
4
  export { SheetDescription } from './sheet-description';
5
5
  export { SheetContent } from './sheet-content';
6
+ export { SheetBody } from './sheet-body';
7
+ export { SheetFooter } from './sheet-footer';
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 sheetContent = recipe({
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 sheetContent>
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 { sheetContent, SheetContentVariants } from './sheet-content.css';
10
+ import { sheetContentRecipe, SheetContentVariants } from './sheet-content.css';
11
11
  import { SheetOverlay } from './sheet-overlay';
12
12
 
13
- export type SheetContentProps<TUse extends ElementType> = BoxProps<TUse> &
14
- ComponentPropsWithRef<typeof Portal> &
15
- SheetContentVariants;
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
- variant="solid"
45
+ use={use}
46
+ variant={variant ?? 'solid'}
34
47
  spacing={spacing}
35
- className={clsx(sheetContent({ side, size, spacing }), className)}
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 SheetDescriptionPros<TUse extends ElementType> = ComponentPropsWithRef<
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
- }: SheetDescriptionPros<TUse>) {
13
+ }: SheetDescriptionProps<TUse>) {
16
14
  return (
17
- <Description ref={ref} asChild {...props}>
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
- }: ClusterProps<TUse>) {
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 sheetHeader = recipe({
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 { sheetHeader, sheetHeaderCloseBtn } from './sheet-header.css';
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={sheetHeader({ side })}>
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 function SheetOverlay({
10
- className,
11
- ...props
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
  }