@kalink-ui/seedly 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/package.json +14 -6
  3. package/src/components/box/box.css.ts +2 -2
  4. package/src/components/button/button.css.ts +52 -50
  5. package/src/components/button/button.tsx +15 -12
  6. package/src/components/button/index.ts +1 -1
  7. package/src/components/button-icon/button-icon.css.ts +90 -0
  8. package/src/components/button-icon/button-icon.tsx +23 -0
  9. package/src/components/button-icon/index.ts +1 -0
  10. package/src/components/card/card.tsx +7 -4
  11. package/src/components/card/index.ts +1 -1
  12. package/src/components/center/center.tsx +2 -2
  13. package/src/components/center/index.ts +1 -1
  14. package/src/components/cluster/cluster.css.ts +17 -0
  15. package/src/components/command/command-empty.tsx +14 -0
  16. package/src/components/command/command-group.css.ts +34 -0
  17. package/src/components/command/command-group.tsx +19 -0
  18. package/src/components/command/command-input.css.ts +31 -0
  19. package/src/components/command/command-input.tsx +44 -0
  20. package/src/components/command/command-item.css.ts +27 -0
  21. package/src/components/command/command-item.tsx +35 -0
  22. package/src/components/command/command-list.css.ts +14 -0
  23. package/src/components/command/command-list.tsx +19 -0
  24. package/src/components/command/command-separator.tsx +29 -0
  25. package/src/components/command/command.tsx +24 -0
  26. package/src/components/command/index.ts +7 -0
  27. package/src/components/cover/index.ts +1 -1
  28. package/src/components/divider/divider.css.ts +11 -0
  29. package/src/components/divider/divider.tsx +11 -0
  30. package/src/components/divider/index.ts +1 -0
  31. package/src/components/form-field/form-field-context.ts +18 -0
  32. package/src/components/form-field/form-field-control.tsx +34 -0
  33. package/src/components/form-field/form-field-description.tsx +16 -0
  34. package/src/components/form-field/form-field-error.tsx +22 -0
  35. package/src/components/form-field/form-field-item-context.ts +6 -0
  36. package/src/components/form-field/form-field-item.tsx +28 -0
  37. package/src/components/form-field/form-field-label.tsx +27 -0
  38. package/src/components/form-field/form-field-message.tsx +33 -0
  39. package/src/components/form-field/form-field.css.ts +97 -0
  40. package/src/components/form-field/form-field.tsx +56 -0
  41. package/src/components/form-field/index.ts +9 -0
  42. package/src/components/frame/frame.css.ts +8 -8
  43. package/src/components/frame/frame.tsx +2 -6
  44. package/src/components/frame/index.ts +1 -1
  45. package/src/components/heading/heading.tsx +43 -8
  46. package/src/components/index.ts +29 -15
  47. package/src/components/input/index.ts +2 -0
  48. package/src/components/input/input-wrapper.tsx +58 -0
  49. package/src/components/input/input.css.ts +250 -0
  50. package/src/components/input/input.tsx +56 -0
  51. package/src/components/label/index.ts +1 -0
  52. package/src/components/label/label.css.ts +37 -0
  53. package/src/components/label/label.tsx +23 -0
  54. package/src/components/loader/index.ts +1 -0
  55. package/src/components/loader/loader.css.ts +109 -0
  56. package/src/components/loader/moon-loader.tsx +43 -0
  57. package/src/components/loader-overlay/index.ts +1 -0
  58. package/src/components/loader-overlay/loader-overlay.css.ts +35 -0
  59. package/src/components/loader-overlay/loader-overlay.tsx +28 -0
  60. package/src/components/menu/index.ts +2 -0
  61. package/src/components/menu/menu-item.css.ts +79 -0
  62. package/src/components/menu/menu-separator.css.ts +53 -0
  63. package/src/components/popover/index.ts +3 -0
  64. package/src/components/popover/popover-content.css.ts +107 -0
  65. package/src/components/popover/popover-content.tsx +82 -0
  66. package/src/components/popover/popover.tsx +6 -0
  67. package/src/components/scroll-area/index.ts +1 -0
  68. package/src/components/scroll-area/scroll-area.css.ts +72 -0
  69. package/src/components/scroll-area/scroll-area.tsx +39 -0
  70. package/src/components/scroll-area/scroll-bar.tsx +37 -0
  71. package/src/components/seed/seed.tsx +4 -4
  72. package/src/components/select/index.ts +5 -0
  73. package/src/components/select/select-content.css.ts +22 -0
  74. package/src/components/select/select-content.tsx +51 -0
  75. package/src/components/select/select-item.css.ts +24 -0
  76. package/src/components/select/select-item.tsx +24 -0
  77. package/src/components/select/select-root.tsx +14 -0
  78. package/src/components/select/select-trigger.css.ts +75 -0
  79. package/src/components/select/select-trigger.tsx +47 -0
  80. package/src/components/select/select.tsx +85 -0
  81. package/src/components/sheet/index.ts +5 -0
  82. package/src/components/sheet/sheet-content.css.ts +143 -0
  83. package/src/components/sheet/sheet-content.tsx +43 -0
  84. package/src/components/sheet/sheet-description.tsx +21 -0
  85. package/src/components/sheet/sheet-footer.tsx +15 -0
  86. package/src/components/sheet/sheet-header.css.ts +35 -0
  87. package/src/components/sheet/sheet-header.tsx +32 -0
  88. package/src/components/sheet/sheet-overlay.css.ts +43 -0
  89. package/src/components/sheet/sheet-overlay.tsx +14 -0
  90. package/src/components/sheet/sheet-title.tsx +31 -0
  91. package/src/components/sheet/sheet.tsx +8 -0
  92. package/src/components/stack/index.ts +1 -1
  93. package/src/components/stack/stack.css.ts +5 -1
  94. package/src/components/stack/stack.tsx +2 -2
  95. package/src/components/text/index.ts +6 -0
  96. package/src/components/text/text.css.ts +31 -4
  97. package/src/components/text-field/index.ts +1 -0
  98. package/src/components/text-field/text-field.css.ts +3 -0
  99. package/src/components/text-field/text-field.tsx +64 -0
  100. package/src/components/textarea/index.ts +1 -0
  101. package/src/components/textarea/textarea-input.tsx +20 -0
  102. package/src/components/textarea/textarea.css.ts +10 -0
  103. package/src/components/textarea/textarea.tsx +69 -0
  104. package/src/styles/define-responsive-properties.ts +242 -0
  105. package/src/styles/extract-sprinkles-props.ts +29 -35
  106. package/src/styles/index.ts +9 -0
  107. package/src/styles/reset.css.ts +1 -0
  108. package/src/styles/visually-hidden.css.ts +21 -0
@@ -0,0 +1,37 @@
1
+ 'use client';
2
+
3
+ import {
4
+ ScrollAreaScrollbar,
5
+ ScrollAreaThumb,
6
+ } from '@radix-ui/react-scroll-area';
7
+ import { clsx } from 'clsx';
8
+ import { ComponentPropsWithRef } from 'react';
9
+
10
+ import {
11
+ scrollAreaScrollbar,
12
+ ScrollAreaScrollbarVariants,
13
+ scrollAreaThumb,
14
+ } from './scroll-area.css';
15
+
16
+ export type ScrollAreaScrollbarProps = ComponentPropsWithRef<
17
+ typeof ScrollAreaScrollbar
18
+ > &
19
+ ScrollAreaScrollbarVariants;
20
+
21
+ export function ScrollBar({
22
+ ref,
23
+ className,
24
+ orientation = 'vertical',
25
+ ...props
26
+ }: ScrollAreaScrollbarProps) {
27
+ return (
28
+ <ScrollAreaScrollbar
29
+ ref={ref}
30
+ orientation={orientation}
31
+ className={clsx(scrollAreaScrollbar({ orientation }), className)}
32
+ {...props}
33
+ >
34
+ <ScrollAreaThumb className={scrollAreaThumb} />
35
+ </ScrollAreaScrollbar>
36
+ );
37
+ }
@@ -1,6 +1,6 @@
1
1
  import { type PolymorphicComponentProps } from '@kalink-ui/dibbly';
2
2
  import { clsx } from 'clsx';
3
- import { ComponentType, type ElementType } from 'react';
3
+ import { type ElementType } from 'react';
4
4
 
5
5
  import {
6
6
  extractSprinklesProps,
@@ -19,10 +19,10 @@ export type SeedProps<
19
19
  TSprinklesFn extends SprinklesFnBase,
20
20
  > = PolymorphicComponentProps<TUse> & GetSprinkles<TSprinklesFn>;
21
21
 
22
- export type CreateSeedParams<SprinklesFn> = {
22
+ export interface CreateSeedParams<SprinklesFn> {
23
23
  sprinkles: SprinklesFn;
24
24
  defaultClassName?: string;
25
- };
25
+ }
26
26
 
27
27
  export function plantSeed<SprinklesFn extends SprinklesFnBase>({
28
28
  sprinkles,
@@ -57,7 +57,7 @@ export function withSeed<SprinklesFn extends SprinklesFnBase>({
57
57
  defaultClassName,
58
58
  }: CreateSeedParams<SprinklesFn>) {
59
59
  return function wrapWithSprinkles<TProps, TUse extends ElementType>(
60
- WrappedComponent: ComponentType<PolymorphicComponentProps<TUse> & TProps>,
60
+ WrappedComponent: ElementType<PolymorphicComponentProps<TUse> & TProps>,
61
61
  ) {
62
62
  const ComponentWithSeed = (
63
63
  props: SeedProps<TUse, SprinklesFn> & TProps,
@@ -0,0 +1,5 @@
1
+ export { SelectContent } from './select-content';
2
+ export { Select } from './select';
3
+ export { SelectItem } from './select-item';
4
+ export { SelectRoot } from './select-root';
5
+ export { SelectTrigger } from './select-trigger';
@@ -0,0 +1,22 @@
1
+ import { style } from '@vanilla-extract/css';
2
+
3
+ import { sys } from '../../styles';
4
+ import { components } from '../../styles/layers.css';
5
+
6
+ export const selectContent = style({
7
+ '@layer': {
8
+ [components]: {
9
+ backgroundColor: sys.color.background,
10
+ },
11
+ },
12
+ });
13
+
14
+ export const selectContentViewport = style({
15
+ '@layer': {
16
+ [components]: {
17
+ height: 'auto',
18
+ maxHeight: 'var(--radix-select-content-available-height)',
19
+ minWidth: 'var(--radix-select-trigger-width)',
20
+ },
21
+ },
22
+ });
@@ -0,0 +1,51 @@
1
+ 'use client';
2
+
3
+ import { Portal, Content, Viewport } from '@radix-ui/react-select';
4
+ import { clsx } from 'clsx';
5
+ import { ComponentPropsWithRef, ReactNode } from 'react';
6
+
7
+ import { popoverContent } from '../popover';
8
+ import { ScrollArea } from '../scroll-area';
9
+
10
+ import { SelectProps } from './select';
11
+ import { selectContent, selectContentViewport } from './select-content.css';
12
+
13
+ export type SelectContentProps = ComponentPropsWithRef<typeof Content> & {
14
+ container?: SelectProps['container'];
15
+ };
16
+
17
+ export interface SelectContentPortalProps {
18
+ children: ReactNode;
19
+ container?: SelectProps['container'];
20
+ }
21
+
22
+ const SelectContentPortal = ({
23
+ children,
24
+ container,
25
+ }: SelectContentPortalProps) => {
26
+ if (container === false) {
27
+ return children;
28
+ }
29
+
30
+ return <Portal container={container}>{children}</Portal>;
31
+ };
32
+
33
+ export function SelectContent({
34
+ className,
35
+ children,
36
+ position = 'popper',
37
+ container,
38
+ ...props
39
+ }: SelectContentProps) {
40
+ return (
41
+ <SelectContentPortal container={container}>
42
+ <Content position={position} asChild {...props}>
43
+ <div className={clsx(selectContent, popoverContent())}>
44
+ <Viewport className={selectContentViewport}>
45
+ <ScrollArea maxHeight="16rem">{children}</ScrollArea>
46
+ </Viewport>
47
+ </div>
48
+ </Content>
49
+ </SelectContentPortal>
50
+ );
51
+ }
@@ -0,0 +1,24 @@
1
+ import { style } from '@vanilla-extract/css';
2
+
3
+ import { sys } from '../../styles';
4
+ import { components } from '../../styles/layers.css';
5
+
6
+ export const selectItemIndicator = style({
7
+ '@layer': {
8
+ [components]: {
9
+ position: 'absolute',
10
+ top: '50%',
11
+ insetInlineStart: sys.spacing[2],
12
+
13
+ transform: 'translateY(-50%) translateX(-50%)',
14
+
15
+ '::before': {
16
+ content: '\u2022',
17
+
18
+ display: 'inline-block',
19
+
20
+ fontSize: '1em',
21
+ },
22
+ },
23
+ },
24
+ });
@@ -0,0 +1,24 @@
1
+ 'use client';
2
+
3
+ import { Item, ItemIndicator, ItemText } from '@radix-ui/react-select';
4
+ import { clsx } from 'clsx';
5
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
6
+
7
+ import { menuItem } from '../menu';
8
+
9
+ import { selectItemIndicator } from './select-item.css';
10
+
11
+ export type SelectItemProps = ComponentPropsWithoutRef<typeof Item> & {
12
+ indicator?: ReactNode;
13
+ };
14
+
15
+ export function SelectItem({ children, indicator, ...props }: SelectItemProps) {
16
+ return (
17
+ <Item className={clsx(menuItem({ inset: true }))} {...props}>
18
+ <ItemIndicator asChild>
19
+ {indicator || <div className={selectItemIndicator} />}
20
+ </ItemIndicator>
21
+ <ItemText>{children}</ItemText>
22
+ </Item>
23
+ );
24
+ }
@@ -0,0 +1,14 @@
1
+ 'use client';
2
+
3
+ import { Root } from '@radix-ui/react-select';
4
+ import { ComponentPropsWithRef } from 'react';
5
+
6
+ import { useFormFieldContext } from '../form-field';
7
+
8
+ export type SelectRootProps = ComponentPropsWithRef<typeof Root>;
9
+
10
+ export function SelectRoot(props: SelectRootProps) {
11
+ const { name } = useFormFieldContext();
12
+
13
+ return <Root name={name} {...props} />;
14
+ }
@@ -0,0 +1,75 @@
1
+ import { style } from '@vanilla-extract/css';
2
+ import { calc } from '@vanilla-extract/css-utils';
3
+ import { recipe } from '@vanilla-extract/recipes';
4
+
5
+ import { sys, transition } from '../../styles';
6
+ import { components } from '../../styles/layers.css';
7
+ import { inputAppearance } from '../input/input.css';
8
+
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',
18
+
19
+ ':before': {
20
+ content: '\x00',
21
+ width: 0,
22
+ overflow: 'hidden',
23
+ marginInlineEnd: calc.negate(sys.spacing[4]),
24
+ },
25
+ },
26
+ },
27
+ },
28
+ ]);
29
+
30
+ export const openIndicator = recipe({
31
+ base: {
32
+ '@layer': {
33
+ [components]: {
34
+ display: 'flex',
35
+ alignItems: 'center',
36
+ justifyContent: 'center',
37
+ aspectRatio: '1 / 1',
38
+ marginInlineStart: 'auto',
39
+
40
+ transition: transition(['transform'], {
41
+ duration: 'short.2',
42
+ easing: 'standard',
43
+ }),
44
+
45
+ selectors: {
46
+ '[data-state="open"] &': {
47
+ transform: 'rotate(180deg)',
48
+ },
49
+ },
50
+ },
51
+ },
52
+ },
53
+
54
+ variants: {
55
+ fallback: {
56
+ true: {
57
+ '@layer': {
58
+ [components]: {
59
+ '::after': {
60
+ content: '""',
61
+ display: 'block',
62
+
63
+ height: 12,
64
+ width: 12,
65
+
66
+ borderTop: `2px solid currentcolor`,
67
+ borderRight: `2px solid currentcolor`,
68
+ transform: 'rotate(135deg) translateX(-25%) translateY(25%)',
69
+ },
70
+ },
71
+ },
72
+ },
73
+ },
74
+ },
75
+ });
@@ -0,0 +1,47 @@
1
+ 'use client';
2
+
3
+ import { Trigger, Icon } from '@radix-ui/react-select';
4
+ import { clsx } from 'clsx';
5
+ import { ComponentPropsWithRef, ReactNode } from 'react';
6
+
7
+ import { buttonRecipe } from '../button/button.css';
8
+ import { useFormFieldItemContext, useFormFieldContext } from '../form-field';
9
+
10
+ import { openIndicator, selectTrigger } from './select-trigger.css';
11
+
12
+ export type SelectTriggerProps = ComponentPropsWithRef<typeof Trigger> & {
13
+ icon?: ReactNode;
14
+ };
15
+
16
+ export function SelectTrigger({
17
+ className,
18
+ children,
19
+ icon = null,
20
+ ...props
21
+ }: SelectTriggerProps) {
22
+ const { errors, label } = useFormFieldContext();
23
+ const { id } = useFormFieldItemContext();
24
+
25
+ return (
26
+ <Trigger
27
+ id={id}
28
+ className={clsx(selectTrigger, className)}
29
+ aria-invalid={errors ? 'true' : undefined}
30
+ aria-label={label}
31
+ {...props}
32
+ >
33
+ {children}
34
+ <Icon asChild>
35
+ <div
36
+ // Mimic the Combobox style
37
+ className={clsx(
38
+ buttonRecipe({ size: 'sm', variant: 'bare' }),
39
+ openIndicator({ fallback: !icon }),
40
+ )}
41
+ >
42
+ {icon}
43
+ </div>
44
+ </Icon>
45
+ </Trigger>
46
+ );
47
+ }
@@ -0,0 +1,85 @@
1
+ import { Value } from '@radix-ui/react-select';
2
+ import { ComponentPropsWithoutRef, ComponentPropsWithRef } from 'react';
3
+
4
+ import {
5
+ FormField,
6
+ FormFieldControl,
7
+ FormFieldDescription,
8
+ FormFieldError,
9
+ FormFieldItem,
10
+ FormFieldLabel,
11
+ } from '../form-field';
12
+ import { InputAppearanceVariants } from '../input';
13
+
14
+ import { SelectContent } from './select-content';
15
+ import { SelectRoot } from './select-root';
16
+ import { SelectTrigger } from './select-trigger';
17
+
18
+ export type SelectProps = ComponentPropsWithoutRef<typeof SelectRoot> &
19
+ Pick<ComponentPropsWithoutRef<typeof Value>, 'placeholder'> &
20
+ Pick<
21
+ ComponentPropsWithRef<typeof SelectTrigger>,
22
+ 'onBlur' | 'onFocus' | 'ref'
23
+ > &
24
+ InputAppearanceVariants & {
25
+ name: string;
26
+ label: string;
27
+ description?: string;
28
+ container?: HTMLElement | null | false;
29
+ hideLabel?: boolean;
30
+ errors: string;
31
+ hideErrorMessage?: boolean;
32
+ };
33
+
34
+ export function Select({
35
+ placeholder,
36
+ label,
37
+ children,
38
+ container,
39
+ description,
40
+ name,
41
+ hideErrorMessage = false,
42
+ hideLabel = false,
43
+ disabled,
44
+ errors,
45
+ onBlur,
46
+ onFocus,
47
+ required,
48
+ size = 'md',
49
+ ref,
50
+ ...props
51
+ }: SelectProps) {
52
+ return (
53
+ <FormField
54
+ name={name}
55
+ label={label}
56
+ errors={errors}
57
+ hideErrorMessage={hideErrorMessage}
58
+ disabled={disabled}
59
+ hideLabel={hideLabel}
60
+ >
61
+ <FormFieldItem>
62
+ <FormFieldLabel required={required} disabled={disabled} size={size}>
63
+ {label}
64
+ </FormFieldLabel>
65
+
66
+ <SelectRoot disabled={disabled} {...props}>
67
+ <FormFieldControl>
68
+ <SelectTrigger
69
+ ref={ref}
70
+ title={hideLabel ? label : undefined}
71
+ onBlur={onBlur}
72
+ onFocus={onFocus}
73
+ aria-label={hideLabel ? label : undefined}
74
+ >
75
+ <Value placeholder={placeholder} className="test" />
76
+ </SelectTrigger>
77
+ </FormFieldControl>
78
+ <SelectContent container={container}>{children}</SelectContent>
79
+ </SelectRoot>
80
+ <FormFieldDescription>{description}</FormFieldDescription>
81
+ <FormFieldError />
82
+ </FormFieldItem>
83
+ </FormField>
84
+ );
85
+ }
@@ -0,0 +1,5 @@
1
+ export { Sheet, SheetTrigger, SheetClose, SheetPortal } from './sheet';
2
+ export { SheetHeader } from './sheet-header';
3
+ export { SheetTitle } from './sheet-title';
4
+ export { SheetDescription } from './sheet-description';
5
+ export { SheetContent } from './sheet-content';
@@ -0,0 +1,143 @@
1
+ import { createVar, keyframes } from '@vanilla-extract/css';
2
+ import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
3
+
4
+ import { sys } from '../../styles';
5
+
6
+ const from = createVar();
7
+ const to = createVar();
8
+ const size = createVar();
9
+
10
+ const enter = keyframes({
11
+ '0%': {
12
+ transform: from,
13
+ },
14
+
15
+ '100%': {
16
+ transform: to,
17
+ },
18
+ });
19
+
20
+ const leave = keyframes({
21
+ '0%': {
22
+ transform: to,
23
+ },
24
+
25
+ '100%': {
26
+ transform: from,
27
+ },
28
+ });
29
+
30
+ export const sheetContent = recipe({
31
+ base: {
32
+ zIndex: 50,
33
+ maxWidth: '100vw',
34
+ maxHeight: '100vh',
35
+
36
+ position: 'fixed',
37
+
38
+ boxShadow: sys.elevation.high,
39
+
40
+ animationDuration: sys.motion.duration.medium[2],
41
+ animationTimingFunction: sys.motion.easing.standard,
42
+ animationFillMode: 'both',
43
+
44
+ selectors: {
45
+ '&[data-state="open"]': {
46
+ animationName: enter,
47
+
48
+ pointerEvents: 'auto',
49
+ },
50
+
51
+ '&[data-state="closed"]': {
52
+ animationName: leave,
53
+
54
+ pointerEvents: 'none',
55
+ },
56
+ },
57
+ },
58
+
59
+ variants: {
60
+ side: {
61
+ top: {
62
+ height: size,
63
+ width: '100vw',
64
+
65
+ insetBlockStart: 0,
66
+ insetInline: 0,
67
+
68
+ vars: {
69
+ [from]: 'translateY(-100%)',
70
+ [to]: 'translateY(0)',
71
+ },
72
+ },
73
+ right: {
74
+ height: '100vh',
75
+ width: size,
76
+
77
+ insetBlock: 0,
78
+ insetInlineEnd: 0,
79
+
80
+ vars: {
81
+ [from]: 'translateX(100%)',
82
+ [to]: 'translateX(0)',
83
+ },
84
+ },
85
+ bottom: {
86
+ height: size,
87
+ width: '100vw',
88
+
89
+ insetBlockEnd: 0,
90
+ insetInline: 0,
91
+
92
+ vars: {
93
+ [from]: 'translateY(100%)',
94
+ [to]: 'translateY(0)',
95
+ },
96
+ },
97
+ left: {
98
+ height: '100vh',
99
+ width: size,
100
+
101
+ insetBlock: 0,
102
+ insetInlineStart: 0,
103
+
104
+ vars: {
105
+ [from]: 'translateX(-100%)',
106
+ [to]: 'translateX(0)',
107
+ },
108
+ },
109
+ },
110
+
111
+ size: {
112
+ sm: {
113
+ vars: {
114
+ [size]: '300px',
115
+ },
116
+ },
117
+ base: {
118
+ vars: {
119
+ [size]: '400px',
120
+ },
121
+ },
122
+ md: {
123
+ vars: {
124
+ [size]: '500px',
125
+ },
126
+ },
127
+ lg: {
128
+ vars: {
129
+ [size]: '600px',
130
+ },
131
+ },
132
+ },
133
+ },
134
+
135
+ defaultVariants: {
136
+ side: 'right',
137
+ size: 'base',
138
+ },
139
+ });
140
+
141
+ export type SheetContentVariants = NonNullable<
142
+ RecipeVariants<typeof sheetContent>
143
+ >;
@@ -0,0 +1,43 @@
1
+ 'use client';
2
+
3
+ import { Content, Portal } from '@radix-ui/react-dialog';
4
+ import { clsx } from 'clsx';
5
+ import { ComponentPropsWithoutRef, ElementType } from 'react';
6
+
7
+ import { Box, BoxProps } from '../box';
8
+ import { ScrollArea } from '../scroll-area';
9
+
10
+ import { SheetPortal } from './sheet';
11
+ import { sheetContent, SheetContentVariants } from './sheet-content.css';
12
+ import { SheetOverlay } from './sheet-overlay';
13
+
14
+ export type SheetContentProps<TUse extends ElementType> = BoxProps<TUse> &
15
+ ComponentPropsWithoutRef<typeof Portal> &
16
+ SheetContentVariants;
17
+
18
+ export function SheetContent<TUse extends ElementType>({
19
+ className,
20
+ children,
21
+ container,
22
+ side,
23
+ size,
24
+ ref,
25
+ ...props
26
+ }: SheetContentProps<TUse>) {
27
+ return (
28
+ <SheetPortal container={container}>
29
+ <SheetOverlay />
30
+ <Content asChild>
31
+ <Box
32
+ ref={ref}
33
+ variant="solid"
34
+ className={clsx(sheetContent({ side, size }), className)}
35
+ >
36
+ <ScrollArea>
37
+ <Box {...props}>{children}</Box>
38
+ </ScrollArea>
39
+ </Box>
40
+ </Content>
41
+ </SheetPortal>
42
+ );
43
+ }
@@ -0,0 +1,21 @@
1
+ import { Description } from '@radix-ui/react-dialog';
2
+ import { ComponentPropsWithRef, ElementType } from 'react';
3
+
4
+ import { Text, TextProps } from '../text';
5
+
6
+ type SheetDescriptionPros<TUse extends ElementType> = ComponentPropsWithRef<
7
+ typeof Description
8
+ > &
9
+ TextProps<TUse>;
10
+
11
+ export function SheetDescription<TUse extends ElementType>({
12
+ ref,
13
+ children,
14
+ ...props
15
+ }: SheetDescriptionPros<TUse>) {
16
+ return (
17
+ <Description ref={ref} asChild {...props}>
18
+ <Text>{children}</Text>
19
+ </Description>
20
+ );
21
+ }
@@ -0,0 +1,15 @@
1
+ import { ElementType } from 'react';
2
+
3
+ import { Box, BoxProps } from '../box';
4
+
5
+ export function SheetFooter<TUse extends ElementType>(props: BoxProps<TUse>) {
6
+ return (
7
+ <Box
8
+ display="flex"
9
+ flexDirection={{ sm: 'column-reverse', md: 'row' }}
10
+ justifyContent={{ sm: 'flex-start', md: 'flex-end' }}
11
+ gap="sm"
12
+ {...props}
13
+ />
14
+ );
15
+ }
@@ -0,0 +1,35 @@
1
+ import { style } from '@vanilla-extract/css';
2
+ import { recipe } from '@vanilla-extract/recipes';
3
+
4
+ import { sys } from '../../styles';
5
+
6
+ export const sheetHeader = recipe({
7
+ base: {
8
+ display: 'flex',
9
+ alignItems: 'flex-start',
10
+ justifyContent: 'space-between',
11
+ flexWrap: 'nowrap',
12
+ gap: sys.spacing[4],
13
+ },
14
+
15
+ variants: {
16
+ side: {
17
+ top: {
18
+ flexDirection: 'row',
19
+ },
20
+ right: {
21
+ flexDirection: 'row-reverse',
22
+ },
23
+ bottom: {
24
+ flexDirection: 'row',
25
+ },
26
+ left: {
27
+ flexDirection: 'row',
28
+ },
29
+ },
30
+ },
31
+ });
32
+
33
+ export const sheetHeaderCloseBtn = style({
34
+ flexShrink: 0,
35
+ });