@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.
Files changed (94) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/package.json +12 -6
  3. package/src/components/box/box.css.ts +2 -2
  4. package/src/components/button/button.css.ts +45 -48
  5. package/src/components/button/button.tsx +11 -8
  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/divider/divider.css.ts +11 -0
  16. package/src/components/divider/divider.tsx +11 -0
  17. package/src/components/divider/index.ts +1 -0
  18. package/src/components/form-field/form-field-context.ts +18 -0
  19. package/src/components/form-field/form-field-control.tsx +34 -0
  20. package/src/components/form-field/form-field-description.tsx +16 -0
  21. package/src/components/form-field/form-field-error.tsx +22 -0
  22. package/src/components/form-field/form-field-item-context.ts +6 -0
  23. package/src/components/form-field/form-field-item.tsx +28 -0
  24. package/src/components/form-field/form-field-label.tsx +27 -0
  25. package/src/components/form-field/form-field-message.tsx +33 -0
  26. package/src/components/form-field/form-field.css.ts +97 -0
  27. package/src/components/form-field/form-field.tsx +56 -0
  28. package/src/components/form-field/index.ts +9 -0
  29. package/src/components/frame/frame.css.ts +8 -8
  30. package/src/components/frame/frame.tsx +2 -6
  31. package/src/components/frame/index.ts +1 -1
  32. package/src/components/heading/heading.tsx +43 -8
  33. package/src/components/index.ts +27 -15
  34. package/src/components/input/index.ts +2 -0
  35. package/src/components/input/input-wrapper.tsx +58 -0
  36. package/src/components/input/input.css.ts +250 -0
  37. package/src/components/input/input.tsx +56 -0
  38. package/src/components/label/index.ts +1 -0
  39. package/src/components/label/label.css.ts +37 -0
  40. package/src/components/label/label.tsx +23 -0
  41. package/src/components/loader/index.ts +1 -0
  42. package/src/components/loader/loader.css.ts +109 -0
  43. package/src/components/loader/moon-loader.tsx +43 -0
  44. package/src/components/loader-overlay/index.ts +1 -0
  45. package/src/components/loader-overlay/loader-overlay.css.ts +35 -0
  46. package/src/components/loader-overlay/loader-overlay.tsx +28 -0
  47. package/src/components/menu/index.ts +2 -0
  48. package/src/components/menu/menu-item.css.ts +79 -0
  49. package/src/components/menu/menu-separator.css.ts +53 -0
  50. package/src/components/popover/index.ts +3 -0
  51. package/src/components/popover/popover-content.css.ts +107 -0
  52. package/src/components/popover/popover-content.tsx +78 -0
  53. package/src/components/popover/popover.tsx +6 -0
  54. package/src/components/scroll-area/index.ts +1 -0
  55. package/src/components/scroll-area/scroll-area.css.ts +72 -0
  56. package/src/components/scroll-area/scroll-area.tsx +39 -0
  57. package/src/components/scroll-area/scroll-bar.tsx +37 -0
  58. package/src/components/seed/seed.tsx +4 -4
  59. package/src/components/select/index.ts +5 -0
  60. package/src/components/select/select-content.css.ts +22 -0
  61. package/src/components/select/select-content.tsx +51 -0
  62. package/src/components/select/select-item.css.ts +24 -0
  63. package/src/components/select/select-item.tsx +24 -0
  64. package/src/components/select/select-root.tsx +14 -0
  65. package/src/components/select/select-trigger.css.ts +75 -0
  66. package/src/components/select/select-trigger.tsx +47 -0
  67. package/src/components/select/select.tsx +85 -0
  68. package/src/components/sheet/index.ts +5 -0
  69. package/src/components/sheet/sheet-content.css.ts +143 -0
  70. package/src/components/sheet/sheet-content.tsx +43 -0
  71. package/src/components/sheet/sheet-description.tsx +21 -0
  72. package/src/components/sheet/sheet-footer.tsx +15 -0
  73. package/src/components/sheet/sheet-header.css.ts +35 -0
  74. package/src/components/sheet/sheet-header.tsx +32 -0
  75. package/src/components/sheet/sheet-overlay.css.ts +43 -0
  76. package/src/components/sheet/sheet-overlay.tsx +14 -0
  77. package/src/components/sheet/sheet-title.tsx +31 -0
  78. package/src/components/sheet/sheet.tsx +8 -0
  79. package/src/components/stack/index.ts +1 -1
  80. package/src/components/stack/stack.tsx +2 -2
  81. package/src/components/text/index.ts +6 -0
  82. package/src/components/text/text.css.ts +31 -4
  83. package/src/components/text-field/index.ts +1 -0
  84. package/src/components/text-field/text-field.css.ts +3 -0
  85. package/src/components/text-field/text-field.tsx +64 -0
  86. package/src/components/textarea/index.ts +1 -0
  87. package/src/components/textarea/textarea-input.tsx +20 -0
  88. package/src/components/textarea/textarea.css.ts +10 -0
  89. package/src/components/textarea/textarea.tsx +69 -0
  90. package/src/styles/define-responsive-properties.ts +242 -0
  91. package/src/styles/extract-sprinkles-props.ts +29 -35
  92. package/src/styles/index.ts +9 -0
  93. package/src/styles/reset.css.ts +1 -0
  94. package/src/styles/visually-hidden.css.ts +21 -0
@@ -0,0 +1,53 @@
1
+ import { createVar } from '@vanilla-extract/css';
2
+ import { calc } from '@vanilla-extract/css-utils';
3
+ import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
4
+
5
+ import { mapContractVars, sys } from '../../styles';
6
+ import { components } from '../../styles/layers.css';
7
+
8
+ const spaceVar = createVar();
9
+
10
+ export const menuSeparator = recipe({
11
+ base: {
12
+ paddingBlock: spaceVar,
13
+ marginInline: sys.spacing[2],
14
+
15
+ position: 'relative',
16
+
17
+ '::after': {
18
+ content: '""',
19
+
20
+ height: '1px',
21
+ width: '100%',
22
+
23
+ position: 'absolute',
24
+ top: '50%',
25
+
26
+ backgroundColor: sys.color.foreground,
27
+
28
+ transform: 'translateY(-50%)',
29
+ },
30
+ },
31
+
32
+ variants: {
33
+ offset: {
34
+ true: {
35
+ marginInline: calc.negate(sys.spacing[2]),
36
+ },
37
+ },
38
+
39
+ spacing: mapContractVars(sys.spacing, (key) => ({
40
+ '@layer': {
41
+ [components]: {
42
+ vars: {
43
+ [spaceVar]: sys.spacing[key],
44
+ },
45
+ },
46
+ },
47
+ })),
48
+ },
49
+ });
50
+
51
+ export type MenuSeparatorVariants = NonNullable<
52
+ RecipeVariants<typeof menuSeparator>
53
+ >;
@@ -0,0 +1,3 @@
1
+ export { Popover, PopoverTrigger } from './popover';
2
+ export { PopoverContent } from './popover-content';
3
+ export { popoverContent } from './popover-content.css';
@@ -0,0 +1,107 @@
1
+ import { createVar, keyframes } from '@vanilla-extract/css';
2
+ import { calc } from '@vanilla-extract/css-utils';
3
+ import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
4
+
5
+ import { sys } from '../../styles';
6
+
7
+ const translateX = createVar();
8
+ const offsetX = createVar();
9
+ const translateY = createVar();
10
+ const offsetY = createVar();
11
+ const scale = createVar();
12
+
13
+ const enter = keyframes({
14
+ '100%': {
15
+ opacity: 1,
16
+ transform: `translateX(${offsetX}) translateY(${offsetY})`,
17
+ pointerEvents: 'auto',
18
+ },
19
+ });
20
+
21
+ const leave = keyframes({
22
+ '0%': {
23
+ opacity: 1,
24
+ transform: `translateX(${offsetX}) translateY(${offsetY})`,
25
+ pointerEvents: 'auto',
26
+ },
27
+ });
28
+
29
+ export const popoverContent = recipe({
30
+ base: {
31
+ padding: sys.spacing[1],
32
+
33
+ boxShadow: sys.elevation.high,
34
+
35
+ animationDuration: sys.motion.duration.short[2],
36
+ animationTimingFunction: sys.motion.easing.standard,
37
+ animationFillMode: 'forwards',
38
+
39
+ opacity: 0,
40
+ transform: `translate3d(${translateX}, ${translateY}, 0) scale3d(${scale}, ${scale}, ${scale})`,
41
+
42
+ selectors: {
43
+ '&[data-state="open"]': {
44
+ animationName: enter,
45
+ },
46
+
47
+ '&[data-state="closed"]': {
48
+ animationName: leave,
49
+ },
50
+
51
+ '&[data-side*="top"]': {
52
+ vars: {
53
+ [translateY]: sys.spacing[2],
54
+ [offsetY]: calc.negate(sys.spacing[1]),
55
+ },
56
+ },
57
+
58
+ '&[data-side*="right"]': {
59
+ vars: {
60
+ [translateX]: calc.negate(sys.spacing[1]),
61
+ [offsetX]: sys.spacing[2],
62
+ },
63
+ },
64
+
65
+ '&[data-side*="bottom"]': {
66
+ vars: {
67
+ [translateY]: calc.negate(sys.spacing[1]),
68
+ [offsetY]: sys.spacing[2],
69
+ },
70
+ },
71
+
72
+ '&[data-side*="left"]': {
73
+ vars: {
74
+ [translateX]: sys.spacing[3],
75
+ [offsetY]: calc.negate(sys.spacing[1]),
76
+ },
77
+ },
78
+ },
79
+
80
+ vars: {
81
+ [translateX]: '0',
82
+ [translateY]: '0',
83
+ [offsetX]: '0',
84
+ [offsetY]: '0',
85
+ [scale]: '0.98',
86
+ '--popover-trigger-width': 'var(--radix-popover-trigger-width)',
87
+ },
88
+ },
89
+
90
+ variants: {
91
+ width: {
92
+ trigger: {
93
+ minWidth: 'var(--popover-trigger-width)',
94
+ },
95
+ },
96
+
97
+ scrollable: {
98
+ true: {
99
+ overflow: 'hidden',
100
+ },
101
+ },
102
+ },
103
+ });
104
+
105
+ export type PopoverContentVariants = NonNullable<
106
+ RecipeVariants<typeof popoverContent>
107
+ >;
@@ -0,0 +1,78 @@
1
+ 'use client';
2
+
3
+ import { Portal, Content } from '@radix-ui/react-popover';
4
+ import { clsx } from 'clsx';
5
+ import {
6
+ ComponentPropsWithoutRef,
7
+ ComponentPropsWithRef,
8
+ ReactNode,
9
+ } from 'react';
10
+
11
+ import { Box, BoxProps } from '../box';
12
+ import { ScrollArea } from '../scroll-area';
13
+
14
+ import { popoverContent, PopoverContentVariants } from './popover-content.css';
15
+
16
+ export type PopoverContentProps = {
17
+ portaled?: boolean;
18
+ maxHeight?: string;
19
+ scrollable?: boolean;
20
+ } & ComponentPropsWithRef<typeof Content> &
21
+ PopoverContentVariants &
22
+ ComponentPropsWithoutRef<typeof Portal> &
23
+ BoxProps<'div'>;
24
+
25
+ export interface PopoverScrollableProps {
26
+ scrollable?: boolean;
27
+ maxHeight?: string;
28
+ children?: ReactNode;
29
+ }
30
+
31
+ export function PopoverScrollable({
32
+ children,
33
+ scrollable = true,
34
+ maxHeight,
35
+ }: PopoverScrollableProps) {
36
+ if (scrollable === false) {
37
+ return children;
38
+ }
39
+
40
+ return <ScrollArea maxHeight={maxHeight}>{children}</ScrollArea>;
41
+ }
42
+
43
+ export function PopoverContent({
44
+ className,
45
+ align = 'center',
46
+ container,
47
+ children,
48
+ spacing = 4,
49
+ radius = 'medium',
50
+ width,
51
+ portaled = true,
52
+ scrollable = true,
53
+ maxHeight = 'var(--radix-popover-content-available-height)',
54
+ ...props
55
+ }: PopoverContentProps) {
56
+ const content = (
57
+ <Content
58
+ align={align}
59
+ className={clsx(popoverContent({ width, scrollable }), className)}
60
+ sideOffset={0}
61
+ asChild
62
+ collisionPadding={16}
63
+ {...props}
64
+ >
65
+ <Box spacing={spacing} radius={radius}>
66
+ <PopoverScrollable scrollable={scrollable} maxHeight={maxHeight}>
67
+ {children}
68
+ </PopoverScrollable>
69
+ </Box>
70
+ </Content>
71
+ );
72
+
73
+ return portaled === true ? (
74
+ <Portal container={container}>{content}</Portal>
75
+ ) : (
76
+ content
77
+ );
78
+ }
@@ -0,0 +1,6 @@
1
+ 'use client';
2
+
3
+ import { Root, Trigger } from '@radix-ui/react-popover';
4
+
5
+ export const Popover = Root;
6
+ export const PopoverTrigger = Trigger;
@@ -0,0 +1 @@
1
+ export { ScrollArea } from './scroll-area';
@@ -0,0 +1,72 @@
1
+ import { createVar, style } from '@vanilla-extract/css';
2
+ import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
3
+
4
+ import { sys, transition } from '../../styles';
5
+
6
+ export const viewportMaxHeight = createVar();
7
+
8
+ export const scrollArea = style({
9
+ overflow: 'hidden',
10
+ height: '100%',
11
+
12
+ position: 'relative',
13
+ });
14
+
15
+ export const scrollAreaViewport = style({
16
+ height: '100%',
17
+ maxHeight: viewportMaxHeight,
18
+ width: '100%',
19
+
20
+ borderRadius: 'inherit',
21
+
22
+ vars: {
23
+ [viewportMaxHeight]: 'initial',
24
+ },
25
+ });
26
+
27
+ export const scrollAreaScrollbar = recipe({
28
+ base: {
29
+ display: 'flex',
30
+
31
+ padding: 1,
32
+
33
+ transition: transition(['color', 'background-color', 'border-color'], {
34
+ duration: 'medium.2',
35
+ }),
36
+ userSelect: 'none',
37
+ },
38
+
39
+ variants: {
40
+ orientation: {
41
+ vertical: {
42
+ height: '100%',
43
+ width: 10,
44
+
45
+ borderInlineStartWidth: 1,
46
+ borderInlineStartColor: 'transparent',
47
+ },
48
+
49
+ horizontal: {
50
+ height: 10,
51
+ width: '100%',
52
+
53
+ borderBlockStartWidth: 1,
54
+ borderBlockStartColor: 'transparent',
55
+ },
56
+ },
57
+ },
58
+ });
59
+
60
+ export const scrollAreaThumb = style({
61
+ flexGrow: 1,
62
+
63
+ position: 'relative',
64
+
65
+ borderRadius: sys.shape.corner.small,
66
+
67
+ backgroundColor: sys.color.foreground,
68
+ });
69
+
70
+ export type ScrollAreaScrollbarVariants = NonNullable<
71
+ RecipeVariants<typeof scrollAreaScrollbar>
72
+ >;
@@ -0,0 +1,39 @@
1
+ 'use client';
2
+
3
+ import { Corner, Root, Viewport } from '@radix-ui/react-scroll-area';
4
+ import { assignInlineVars } from '@vanilla-extract/dynamic';
5
+ import { ComponentPropsWithRef } from 'react';
6
+
7
+ import {
8
+ scrollArea,
9
+ scrollAreaViewport,
10
+ viewportMaxHeight,
11
+ } from './scroll-area.css';
12
+ import { ScrollBar } from './scroll-bar';
13
+
14
+ export type ScrollAreaProps = ComponentPropsWithRef<typeof Root> & {
15
+ maxHeight?: string;
16
+ };
17
+
18
+ export function ScrollArea({
19
+ ref,
20
+ className,
21
+ children,
22
+ maxHeight = 'initial',
23
+ ...props
24
+ }: ScrollAreaProps) {
25
+ return (
26
+ <Root ref={ref} className={scrollArea} {...props}>
27
+ <Viewport
28
+ className={scrollAreaViewport}
29
+ style={assignInlineVars({
30
+ [viewportMaxHeight]: maxHeight,
31
+ })}
32
+ >
33
+ {children}
34
+ </Viewport>
35
+ <ScrollBar />
36
+ <Corner />
37
+ </Root>
38
+ );
39
+ }
@@ -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
+ });