@kalink-ui/seedly 0.9.0 → 0.10.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 +14 -0
- package/package.json +12 -6
- package/src/components/box/box.css.ts +2 -2
- package/src/components/button/button.css.ts +45 -48
- package/src/components/button/button.tsx +11 -8
- package/src/components/button/index.ts +1 -1
- package/src/components/button-icon/button-icon.css.ts +90 -0
- package/src/components/button-icon/button-icon.tsx +23 -0
- package/src/components/button-icon/index.ts +1 -0
- package/src/components/card/card.tsx +7 -4
- package/src/components/card/index.ts +1 -1
- package/src/components/center/center.tsx +2 -2
- package/src/components/center/index.ts +1 -1
- package/src/components/cluster/cluster.css.ts +17 -0
- package/src/components/divider/divider.css.ts +11 -0
- package/src/components/divider/divider.tsx +11 -0
- package/src/components/divider/index.ts +1 -0
- package/src/components/form-field/form-field-context.ts +18 -0
- package/src/components/form-field/form-field-control.tsx +34 -0
- package/src/components/form-field/form-field-description.tsx +16 -0
- package/src/components/form-field/form-field-error.tsx +22 -0
- package/src/components/form-field/form-field-item-context.ts +6 -0
- package/src/components/form-field/form-field-item.tsx +28 -0
- package/src/components/form-field/form-field-label.tsx +27 -0
- package/src/components/form-field/form-field-message.tsx +33 -0
- package/src/components/form-field/form-field.css.ts +97 -0
- package/src/components/form-field/form-field.tsx +56 -0
- package/src/components/form-field/index.ts +9 -0
- package/src/components/frame/frame.css.ts +8 -8
- package/src/components/frame/frame.tsx +2 -6
- package/src/components/frame/index.ts +1 -1
- package/src/components/heading/heading.tsx +43 -8
- package/src/components/index.ts +27 -15
- package/src/components/input/index.ts +2 -0
- package/src/components/input/input-wrapper.tsx +58 -0
- package/src/components/input/input.css.ts +250 -0
- package/src/components/input/input.tsx +56 -0
- package/src/components/label/index.ts +1 -0
- package/src/components/label/label.css.ts +37 -0
- package/src/components/label/label.tsx +23 -0
- package/src/components/loader/index.ts +1 -0
- package/src/components/loader/loader.css.ts +109 -0
- package/src/components/loader/moon-loader.tsx +43 -0
- package/src/components/loader-overlay/index.ts +1 -0
- package/src/components/loader-overlay/loader-overlay.css.ts +35 -0
- package/src/components/loader-overlay/loader-overlay.tsx +28 -0
- package/src/components/menu/index.ts +2 -0
- package/src/components/menu/menu-item.css.ts +79 -0
- package/src/components/menu/menu-separator.css.ts +53 -0
- package/src/components/popover/index.ts +3 -0
- package/src/components/popover/popover-content.css.ts +107 -0
- package/src/components/popover/popover-content.tsx +78 -0
- package/src/components/popover/popover.tsx +6 -0
- package/src/components/scroll-area/index.ts +1 -0
- package/src/components/scroll-area/scroll-area.css.ts +72 -0
- package/src/components/scroll-area/scroll-area.tsx +39 -0
- package/src/components/scroll-area/scroll-bar.tsx +37 -0
- package/src/components/seed/seed.tsx +4 -4
- package/src/components/select/index.ts +5 -0
- package/src/components/select/select-content.css.ts +22 -0
- package/src/components/select/select-content.tsx +51 -0
- package/src/components/select/select-item.css.ts +24 -0
- package/src/components/select/select-item.tsx +24 -0
- package/src/components/select/select-root.tsx +14 -0
- package/src/components/select/select-trigger.css.ts +75 -0
- package/src/components/select/select-trigger.tsx +47 -0
- package/src/components/select/select.tsx +85 -0
- package/src/components/sheet/index.ts +5 -0
- package/src/components/sheet/sheet-content.css.ts +143 -0
- package/src/components/sheet/sheet-content.tsx +43 -0
- package/src/components/sheet/sheet-description.tsx +21 -0
- package/src/components/sheet/sheet-footer.tsx +15 -0
- package/src/components/sheet/sheet-header.css.ts +35 -0
- package/src/components/sheet/sheet-header.tsx +32 -0
- package/src/components/sheet/sheet-overlay.css.ts +43 -0
- package/src/components/sheet/sheet-overlay.tsx +14 -0
- package/src/components/sheet/sheet-title.tsx +31 -0
- package/src/components/sheet/sheet.tsx +8 -0
- package/src/components/stack/index.ts +1 -1
- package/src/components/stack/stack.tsx +2 -2
- package/src/components/text/index.ts +6 -0
- package/src/components/text/text.css.ts +31 -4
- package/src/components/text-field/index.ts +1 -0
- package/src/components/text-field/text-field.css.ts +3 -0
- package/src/components/text-field/text-field.tsx +64 -0
- package/src/components/textarea/index.ts +1 -0
- package/src/components/textarea/textarea-input.tsx +20 -0
- package/src/components/textarea/textarea.css.ts +10 -0
- package/src/components/textarea/textarea.tsx +69 -0
- package/src/styles/define-responsive-properties.ts +242 -0
- package/src/styles/extract-sprinkles-props.ts +29 -35
- package/src/styles/index.ts +9 -0
- package/src/styles/reset.css.ts +1 -0
- package/src/styles/visually-hidden.css.ts +21 -0
|
@@ -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
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ElementType, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Stack, StackProps } from '../stack';
|
|
4
|
+
|
|
5
|
+
import { SheetClose } from './sheet';
|
|
6
|
+
import { SheetContentVariants } from './sheet-content.css';
|
|
7
|
+
import { sheetHeader, sheetHeaderCloseBtn } from './sheet-header.css';
|
|
8
|
+
|
|
9
|
+
type SheetHeaderProps<TUse extends ElementType> = StackProps<TUse> & {
|
|
10
|
+
side: SheetContentVariants['side'];
|
|
11
|
+
closeBtn: ReactNode;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export function SheetHeader<TUse extends ElementType>({
|
|
15
|
+
ref,
|
|
16
|
+
spacing = 2,
|
|
17
|
+
children,
|
|
18
|
+
side,
|
|
19
|
+
closeBtn,
|
|
20
|
+
...props
|
|
21
|
+
}: SheetHeaderProps<TUse>) {
|
|
22
|
+
return (
|
|
23
|
+
<div ref={ref} className={sheetHeader({ side })}>
|
|
24
|
+
<Stack spacing={spacing} {...props}>
|
|
25
|
+
{children}
|
|
26
|
+
</Stack>
|
|
27
|
+
<SheetClose asChild className={sheetHeaderCloseBtn}>
|
|
28
|
+
{closeBtn}
|
|
29
|
+
</SheetClose>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { keyframes, style } from '@vanilla-extract/css';
|
|
2
|
+
|
|
3
|
+
import { sys } from '../../styles';
|
|
4
|
+
|
|
5
|
+
const enterAnimation = keyframes({
|
|
6
|
+
'0%': {
|
|
7
|
+
opacity: 0,
|
|
8
|
+
},
|
|
9
|
+
'100%': {
|
|
10
|
+
opacity: 1,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const exitAnimation = keyframes({
|
|
15
|
+
'0%': {
|
|
16
|
+
opacity: 1,
|
|
17
|
+
},
|
|
18
|
+
'100%': {
|
|
19
|
+
opacity: 0,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const sheetOverlay = style({
|
|
24
|
+
zIndex: 50,
|
|
25
|
+
|
|
26
|
+
position: 'fixed',
|
|
27
|
+
inset: 0,
|
|
28
|
+
|
|
29
|
+
backgroundColor: `color(from ${sys.color.background} srgb r g b / 0.5)`,
|
|
30
|
+
|
|
31
|
+
animationDuration: sys.motion.duration.medium[2],
|
|
32
|
+
animationTimingFunction: sys.motion.easing.standard,
|
|
33
|
+
backdropFilter: 'blur(4px)',
|
|
34
|
+
|
|
35
|
+
selectors: {
|
|
36
|
+
'&[data-state="open"]': {
|
|
37
|
+
animationName: enterAnimation,
|
|
38
|
+
},
|
|
39
|
+
'&[data-state="closed"]': {
|
|
40
|
+
animationName: exitAnimation,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Overlay } from '@radix-ui/react-dialog';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
5
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
6
|
+
|
|
7
|
+
import { sheetOverlay } from './sheet-overlay.css';
|
|
8
|
+
|
|
9
|
+
export function SheetOverlay({
|
|
10
|
+
className,
|
|
11
|
+
...props
|
|
12
|
+
}: ComponentPropsWithoutRef<typeof Overlay>) {
|
|
13
|
+
return <Overlay className={clsx(sheetOverlay, className)} {...props} />;
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Title } from '@radix-ui/react-dialog';
|
|
4
|
+
import { ComponentPropsWithRef } from 'react';
|
|
5
|
+
|
|
6
|
+
import { Heading, HeadingProps, HeadingTypes } from '../heading';
|
|
7
|
+
|
|
8
|
+
type SheetTitleProps<TUse extends HeadingTypes> = ComponentPropsWithRef<
|
|
9
|
+
typeof Title
|
|
10
|
+
> &
|
|
11
|
+
HeadingProps<TUse>;
|
|
12
|
+
|
|
13
|
+
export function SheetTitle<TUse extends HeadingTypes>(
|
|
14
|
+
props: SheetTitleProps<TUse>,
|
|
15
|
+
) {
|
|
16
|
+
const { use = 'h2', className, children, variant, size, ...rest } = props;
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<Title asChild>
|
|
20
|
+
<Heading
|
|
21
|
+
use={use as HeadingProps<TUse>['use']}
|
|
22
|
+
variant={variant}
|
|
23
|
+
size={size}
|
|
24
|
+
className={className}
|
|
25
|
+
{...rest}
|
|
26
|
+
>
|
|
27
|
+
{children}
|
|
28
|
+
</Heading>
|
|
29
|
+
</Title>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Stack } from './stack';
|
|
1
|
+
export { Stack, type StackProps } from './stack';
|
|
2
2
|
export { stackRecipe, type StackVariants } from './stack.css';
|
|
@@ -4,8 +4,8 @@ import { ElementType } from 'react';
|
|
|
4
4
|
|
|
5
5
|
import { stackRecipe, StackVariants } from './stack.css';
|
|
6
6
|
|
|
7
|
-
type StackProps<TUse extends ElementType> =
|
|
8
|
-
StackVariants;
|
|
7
|
+
export type StackProps<TUse extends ElementType> =
|
|
8
|
+
PolymorphicComponentProps<TUse> & StackVariants;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* A custom element for injecting white space (margin) between flow
|
|
@@ -3,7 +3,8 @@ import { recipe, type RecipeVariants } from '@vanilla-extract/recipes';
|
|
|
3
3
|
|
|
4
4
|
import { components } from '../../styles/layers.css';
|
|
5
5
|
|
|
6
|
-
const lineClampNumber = createVar();
|
|
6
|
+
export const lineClampNumber = createVar();
|
|
7
|
+
export const textAlign = createVar();
|
|
7
8
|
|
|
8
9
|
const lineClamp = style({
|
|
9
10
|
'@layer': {
|
|
@@ -17,6 +18,17 @@ const lineClamp = style({
|
|
|
17
18
|
});
|
|
18
19
|
|
|
19
20
|
export const textRecipe = recipe({
|
|
21
|
+
base: {
|
|
22
|
+
'@layer': {
|
|
23
|
+
[components]: {
|
|
24
|
+
textAlign,
|
|
25
|
+
|
|
26
|
+
vars: {
|
|
27
|
+
[textAlign]: 'inherit',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
20
32
|
variants: {
|
|
21
33
|
/**
|
|
22
34
|
* Controls the wrapping of the text.
|
|
@@ -131,21 +143,36 @@ export const textRecipe = recipe({
|
|
|
131
143
|
start: {
|
|
132
144
|
'@layer': {
|
|
133
145
|
[components]: {
|
|
134
|
-
|
|
146
|
+
vars: {
|
|
147
|
+
[textAlign]: 'start',
|
|
148
|
+
},
|
|
135
149
|
},
|
|
136
150
|
},
|
|
137
151
|
},
|
|
138
152
|
center: {
|
|
139
153
|
'@layer': {
|
|
140
154
|
[components]: {
|
|
141
|
-
|
|
155
|
+
vars: {
|
|
156
|
+
[textAlign]: 'center',
|
|
157
|
+
},
|
|
142
158
|
},
|
|
143
159
|
},
|
|
144
160
|
},
|
|
145
161
|
end: {
|
|
146
162
|
'@layer': {
|
|
147
163
|
[components]: {
|
|
148
|
-
|
|
164
|
+
vars: {
|
|
165
|
+
[textAlign]: 'end',
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
justify: {
|
|
171
|
+
'@layer': {
|
|
172
|
+
[components]: {
|
|
173
|
+
vars: {
|
|
174
|
+
[textAlign]: 'justify',
|
|
175
|
+
},
|
|
149
176
|
},
|
|
150
177
|
},
|
|
151
178
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TextField } from './text-field';
|