@blenx-dev/core 0.1.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 +77 -0
- package/LICENSE +21 -0
- package/package.json +49 -0
- package/src/DataTable/data-table-column-toggle.tsx +73 -0
- package/src/DataTable/data-table-empty.tsx +27 -0
- package/src/DataTable/data-table-error.tsx +25 -0
- package/src/DataTable/data-table-infinite-loader.tsx +73 -0
- package/src/DataTable/data-table-loading.tsx +67 -0
- package/src/DataTable/data-table-pagination.tsx +80 -0
- package/src/DataTable/data-table-toolbar.tsx +62 -0
- package/src/DataTable/data-table.css.ts +420 -0
- package/src/DataTable/data-table.tsx +507 -0
- package/src/DataTable/index.ts +24 -0
- package/src/DataTable/types.ts +169 -0
- package/src/DataTable/use-infinite-scroll.ts +67 -0
- package/src/components/Accordion/accordion.css.ts +84 -0
- package/src/components/Accordion/accordion.tsx +87 -0
- package/src/components/Accordion/index.ts +8 -0
- package/src/components/Alert/alert.css.ts +29 -0
- package/src/components/Alert/alert.tsx +40 -0
- package/src/components/Alert/index.ts +1 -0
- package/src/components/AlertDialog/alert-dialog.css.ts +62 -0
- package/src/components/AlertDialog/alert-dialog.tsx +199 -0
- package/src/components/AlertDialog/index.ts +1 -0
- package/src/components/AspectRatio/aspect-ratio.css.ts +7 -0
- package/src/components/AspectRatio/aspect-ratio.tsx +20 -0
- package/src/components/AspectRatio/index.ts +1 -0
- package/src/components/Autocomplete/autocomplete.css.ts +167 -0
- package/src/components/Autocomplete/autocomplete.tsx +226 -0
- package/src/components/Autocomplete/index.ts +1 -0
- package/src/components/Avatar/avatar.css.ts +65 -0
- package/src/components/Avatar/avatar.tsx +44 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Badge/badge.css.ts +180 -0
- package/src/components/Badge/badge.tsx +47 -0
- package/src/components/Badge/index.ts +1 -0
- package/src/components/Box/box.css.ts +5 -0
- package/src/components/Box/box.tsx +21 -0
- package/src/components/Box/index.ts +1 -0
- package/src/components/Breadcrumbs/breadcrumbs.css.ts +72 -0
- package/src/components/Breadcrumbs/breadcrumbs.tsx +79 -0
- package/src/components/Breadcrumbs/index.ts +9 -0
- package/src/components/Button/button.css.ts +200 -0
- package/src/components/Button/button.tsx +55 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Calendar/calendar.css.ts +187 -0
- package/src/components/Calendar/calendar.tsx +143 -0
- package/src/components/Calendar/index.ts +1 -0
- package/src/components/Card/card.tsx +32 -0
- package/src/components/Card/index.ts +1 -0
- package/src/components/Checkbox/checkbox.css.ts +76 -0
- package/src/components/Checkbox/checkbox.tsx +94 -0
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/CloseButton/close-button.css.ts +11 -0
- package/src/components/CloseButton/close-button.tsx +15 -0
- package/src/components/CloseButton/index.ts +2 -0
- package/src/components/ColorPicker/color-picker.tsx +123 -0
- package/src/components/ColorPicker/index.ts +1 -0
- package/src/components/ColorSwatch/color-swatch.tsx +21 -0
- package/src/components/ColorSwatch/index.ts +1 -0
- package/src/components/Combobox/combobox.css.ts +333 -0
- package/src/components/Combobox/combobox.tsx +350 -0
- package/src/components/Combobox/index.ts +1 -0
- package/src/components/Command/command.css.ts +130 -0
- package/src/components/Command/command.tsx +413 -0
- package/src/components/Command/index.ts +7 -0
- package/src/components/Container/container.css.ts +41 -0
- package/src/components/Container/container.tsx +25 -0
- package/src/components/Container/index.ts +1 -0
- package/src/components/CopyButton/copy-button.css.ts +11 -0
- package/src/components/CopyButton/copy-button.tsx +45 -0
- package/src/components/CopyButton/index.ts +2 -0
- package/src/components/DatePicker/date-picker.tsx +75 -0
- package/src/components/DatePicker/index.ts +1 -0
- package/src/components/Dialog/dialog.css.ts +57 -0
- package/src/components/Dialog/dialog.tsx +181 -0
- package/src/components/Dialog/index.ts +1 -0
- package/src/components/Drawer/drawer.css.ts +404 -0
- package/src/components/Drawer/drawer.tsx +573 -0
- package/src/components/Drawer/index.ts +1 -0
- package/src/components/Field/field.css.ts +35 -0
- package/src/components/Field/field.tsx +101 -0
- package/src/components/Field/index.ts +1 -0
- package/src/components/Grid/grid.css.ts +12 -0
- package/src/components/Grid/grid.tsx +32 -0
- package/src/components/Grid/index.ts +1 -0
- package/src/components/Icon/icon.css.ts +10 -0
- package/src/components/Icon/icon.tsx +15 -0
- package/src/components/Icon/index.ts +1 -0
- package/src/components/IconButton/icon-button.css.ts +6 -0
- package/src/components/IconButton/icon-button.tsx +11 -0
- package/src/components/IconButton/index.ts +2 -0
- package/src/components/Input/index.ts +1 -0
- package/src/components/Input/input.css.ts +72 -0
- package/src/components/Input/input.tsx +50 -0
- package/src/components/InputGroup/index.ts +1 -0
- package/src/components/InputGroup/input-group.css.ts +156 -0
- package/src/components/InputGroup/input-group.tsx +133 -0
- package/src/components/Menu/index.ts +1 -0
- package/src/components/Menu/menu.css.ts +121 -0
- package/src/components/Menu/menu.tsx +115 -0
- package/src/components/OTPField/index.ts +1 -0
- package/src/components/OTPField/otp-field.css.ts +54 -0
- package/src/components/OTPField/otp-field.tsx +46 -0
- package/src/components/Popover/index.ts +1 -0
- package/src/components/Popover/popover.css.ts +81 -0
- package/src/components/Popover/popover.tsx +113 -0
- package/src/components/Progress/index.ts +7 -0
- package/src/components/Progress/progress.css.ts +37 -0
- package/src/components/Progress/progress.tsx +62 -0
- package/src/components/Radio/index.ts +1 -0
- package/src/components/Radio/radio.css.ts +72 -0
- package/src/components/Radio/radio.tsx +49 -0
- package/src/components/ScrollArea/index.ts +1 -0
- package/src/components/ScrollArea/scroll-area.css.ts +79 -0
- package/src/components/ScrollArea/scroll-area.tsx +96 -0
- package/src/components/SegmentedControl/index.ts +1 -0
- package/src/components/SegmentedControl/segmented-control.tsx +42 -0
- package/src/components/Select/index.ts +1 -0
- package/src/components/Select/select.css.ts +182 -0
- package/src/components/Select/select.tsx +165 -0
- package/src/components/Separator/index.ts +1 -0
- package/src/components/Separator/separator.css.ts +59 -0
- package/src/components/Separator/separator.tsx +34 -0
- package/src/components/Sheet/index.ts +1 -0
- package/src/components/Sheet/sheet.css.ts +184 -0
- package/src/components/Sheet/sheet.tsx +215 -0
- package/src/components/Slider/index.ts +1 -0
- package/src/components/Slider/slider.css.ts +81 -0
- package/src/components/Slider/slider.tsx +100 -0
- package/src/components/Spinner/index.ts +1 -0
- package/src/components/Spinner/spinner.css.ts +17 -0
- package/src/components/Spinner/spinner.tsx +15 -0
- package/src/components/Splitter/index.ts +1 -0
- package/src/components/Splitter/splitter.css.ts +69 -0
- package/src/components/Splitter/splitter.tsx +521 -0
- package/src/components/Stack/index.ts +1 -0
- package/src/components/Stack/stack.css.ts +42 -0
- package/src/components/Stack/stack.tsx +32 -0
- package/src/components/Surface/index.ts +1 -0
- package/src/components/Surface/surface.css.ts +40 -0
- package/src/components/Surface/surface.tsx +19 -0
- package/src/components/Switch/index.ts +1 -0
- package/src/components/Switch/switch.css.ts +46 -0
- package/src/components/Switch/switch.tsx +25 -0
- package/src/components/Table/index.ts +2 -0
- package/src/components/Table/table.css.ts +71 -0
- package/src/components/Table/table.tsx +117 -0
- package/src/components/Tabs/index.ts +1 -0
- package/src/components/Tabs/tabs.css.ts +250 -0
- package/src/components/Tabs/tabs.tsx +119 -0
- package/src/components/Text/index.ts +2 -0
- package/src/components/Text/text.css.ts +118 -0
- package/src/components/Text/text.tsx +66 -0
- package/src/components/Textarea/index.ts +1 -0
- package/src/components/Textarea/textarea.css.ts +66 -0
- package/src/components/Textarea/textarea.tsx +48 -0
- package/src/components/Toggle/index.ts +1 -0
- package/src/components/Toggle/toggle.css.ts +91 -0
- package/src/components/Toggle/toggle.tsx +44 -0
- package/src/components/ToggleGroup/index.ts +1 -0
- package/src/components/ToggleGroup/toggle-group.css.ts +77 -0
- package/src/components/ToggleGroup/toggle-group.tsx +131 -0
- package/src/components/index.ts +54 -0
- package/src/index.ts +3 -0
- package/src/utils/drawer-styles.css.ts +85 -0
- package/src/utils/heights.ts +16 -0
- package/src/utils/sprinkles.css.ts +197 -0
- package/src/utils/sprinkles.tokens.ts +74 -0
- package/src/utils/types.ts +10 -0
- package/src/utils/ve-style.utils.ts +51 -0
- package/tsconfig.json +10 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import {
|
|
4
|
+
trigger,
|
|
5
|
+
popup,
|
|
6
|
+
item,
|
|
7
|
+
itemDestructive,
|
|
8
|
+
separator,
|
|
9
|
+
groupLabel,
|
|
10
|
+
inset,
|
|
11
|
+
shortcut,
|
|
12
|
+
} from "./menu.css";
|
|
13
|
+
|
|
14
|
+
interface MenuProps extends MenuPrimitive.Root.Props {
|
|
15
|
+
variant?: "default" | "destructive";
|
|
16
|
+
}
|
|
17
|
+
const Menu = MenuPrimitive.Root;
|
|
18
|
+
|
|
19
|
+
function MenuTrigger({
|
|
20
|
+
className,
|
|
21
|
+
style,
|
|
22
|
+
...props
|
|
23
|
+
}: MenuPrimitive.Trigger.Props & { className?: string; style?: React.CSSProperties }) {
|
|
24
|
+
return <MenuPrimitive.Trigger className={clsx(trigger, className)} style={style} {...props} />;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
type MenuPopupProps = MenuPrimitive.Popup.Props & {
|
|
28
|
+
align?: "start" | "center" | "end";
|
|
29
|
+
sideOffset?: number;
|
|
30
|
+
className?: string;
|
|
31
|
+
style?: React.CSSProperties;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
function MenuPopup({
|
|
35
|
+
align = "start",
|
|
36
|
+
sideOffset = 4,
|
|
37
|
+
className,
|
|
38
|
+
style,
|
|
39
|
+
...props
|
|
40
|
+
}: MenuPopupProps) {
|
|
41
|
+
return (
|
|
42
|
+
<MenuPrimitive.Portal>
|
|
43
|
+
<MenuPrimitive.Positioner align={align} sideOffset={sideOffset}>
|
|
44
|
+
<MenuPrimitive.Popup className={clsx(popup, className)} style={style} {...props} />
|
|
45
|
+
</MenuPrimitive.Positioner>
|
|
46
|
+
</MenuPrimitive.Portal>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
type MenuItemProps = MenuPrimitive.Item.Props & {
|
|
51
|
+
variant?: "default" | "destructive";
|
|
52
|
+
className?: string;
|
|
53
|
+
style?: React.CSSProperties;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
function MenuItem({ variant = "default", className, style, ...props }: MenuItemProps) {
|
|
57
|
+
return (
|
|
58
|
+
<MenuPrimitive.Item
|
|
59
|
+
className={clsx(item, variant === "destructive" && itemDestructive, className)}
|
|
60
|
+
style={style}
|
|
61
|
+
{...props}
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
type MenuSeparatorProps = MenuPrimitive.Separator.Props & {
|
|
67
|
+
className?: string;
|
|
68
|
+
style?: React.CSSProperties;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
function MenuSeparator({ className, style, ...props }: MenuSeparatorProps) {
|
|
72
|
+
return (
|
|
73
|
+
<MenuPrimitive.Separator className={clsx(separator, className)} style={style} {...props} />
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
type MenuGroupLabelProps = MenuPrimitive.GroupLabel.Props & {
|
|
78
|
+
inset?: boolean;
|
|
79
|
+
className?: string;
|
|
80
|
+
style?: React.CSSProperties;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
function MenuGroupLabel({ inset: hasInset, className, style, ...props }: MenuGroupLabelProps) {
|
|
84
|
+
return (
|
|
85
|
+
<MenuPrimitive.GroupLabel
|
|
86
|
+
className={clsx(groupLabel, hasInset && inset, className)}
|
|
87
|
+
style={style}
|
|
88
|
+
{...props}
|
|
89
|
+
/>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
type MenuShortcutProps = {
|
|
94
|
+
children?: React.ReactNode;
|
|
95
|
+
className?: string;
|
|
96
|
+
style?: React.CSSProperties;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
function MenuShortcut({ children, className, style }: MenuShortcutProps) {
|
|
100
|
+
return (
|
|
101
|
+
<span className={clsx(shortcut, className)} style={style}>
|
|
102
|
+
{children}
|
|
103
|
+
</span>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export type {
|
|
108
|
+
MenuGroupLabelProps,
|
|
109
|
+
MenuItemProps,
|
|
110
|
+
MenuPopupProps,
|
|
111
|
+
MenuProps,
|
|
112
|
+
MenuSeparatorProps,
|
|
113
|
+
MenuShortcutProps,
|
|
114
|
+
};
|
|
115
|
+
export { Menu, MenuGroupLabel, MenuItem, MenuPopup, MenuSeparator, MenuShortcut, MenuTrigger };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./otp-field";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { style } from "@vanilla-extract/css";
|
|
2
|
+
import { recipe } from "@vanilla-extract/recipes";
|
|
3
|
+
import { semanticVars, tokenVars } from "@blenx-dev/theme/contract";
|
|
4
|
+
|
|
5
|
+
export const root = style({
|
|
6
|
+
display: "flex",
|
|
7
|
+
alignItems: "center",
|
|
8
|
+
gap: tokenVars.spacing["1"],
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const input = recipe({
|
|
12
|
+
base: {
|
|
13
|
+
display: "flex",
|
|
14
|
+
alignItems: "center",
|
|
15
|
+
justifyContent: "center",
|
|
16
|
+
textAlign: "center",
|
|
17
|
+
borderRadius: tokenVars.borderRadius.default,
|
|
18
|
+
borderWidth: 1,
|
|
19
|
+
borderStyle: "solid",
|
|
20
|
+
borderColor: semanticVars.border.default,
|
|
21
|
+
backgroundColor: semanticVars.background.default,
|
|
22
|
+
color: semanticVars.text.primary,
|
|
23
|
+
outline: "none",
|
|
24
|
+
caretColor: semanticVars.interactive.primary.default,
|
|
25
|
+
transition: "box-shadow 0.15s ease, border-color 0.15s ease",
|
|
26
|
+
padding: 0,
|
|
27
|
+
margin: 0,
|
|
28
|
+
},
|
|
29
|
+
variants: {
|
|
30
|
+
size: {
|
|
31
|
+
default: {
|
|
32
|
+
width: tokenVars.spacing["9"],
|
|
33
|
+
height: tokenVars.spacing["9"],
|
|
34
|
+
fontSize: tokenVars.fontSize.md,
|
|
35
|
+
},
|
|
36
|
+
lg: {
|
|
37
|
+
width: tokenVars.spacing["10"],
|
|
38
|
+
height: tokenVars.spacing["10"],
|
|
39
|
+
fontSize: tokenVars.fontSize.lg,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: {
|
|
44
|
+
size: "default",
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export const separator = style({
|
|
49
|
+
backgroundColor: semanticVars.border.default,
|
|
50
|
+
borderRadius: "999px",
|
|
51
|
+
width: tokenVars.spacing["3"],
|
|
52
|
+
height: tokenVars.spacing["0.5"],
|
|
53
|
+
flexShrink: 0,
|
|
54
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { OTPField as OTPFieldPreview } from "@base-ui/react/otp-field";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import type React from "react";
|
|
4
|
+
import { root, input as inputRecipe, separator } from "./otp-field.css";
|
|
5
|
+
|
|
6
|
+
type OTPFieldSize = "default" | "lg";
|
|
7
|
+
|
|
8
|
+
type OTPFieldProps = Omit<React.ComponentProps<typeof OTPFieldPreview.Root>, "style"> & {
|
|
9
|
+
size?: OTPFieldSize;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type OTPFieldInputProps = Omit<
|
|
14
|
+
React.ComponentProps<typeof OTPFieldPreview.Input>,
|
|
15
|
+
"style" | "size"
|
|
16
|
+
> & {
|
|
17
|
+
size?: OTPFieldSize;
|
|
18
|
+
className?: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
type OTPFieldSeparatorProps = {
|
|
22
|
+
className?: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export function OTPField({ size = "default", className, ...props }: OTPFieldProps) {
|
|
26
|
+
return (
|
|
27
|
+
<OTPFieldPreview.Root
|
|
28
|
+
className={clsx(root, className)}
|
|
29
|
+
data-size={size}
|
|
30
|
+
{...(props as React.ComponentProps<typeof OTPFieldPreview.Root>)}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function OTPFieldInput({ size = "default", className, ...props }: OTPFieldInputProps) {
|
|
36
|
+
return (
|
|
37
|
+
<OTPFieldPreview.Input
|
|
38
|
+
className={clsx(inputRecipe({ size }), className)}
|
|
39
|
+
{...(props as React.ComponentProps<typeof OTPFieldPreview.Input>)}
|
|
40
|
+
/>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function OTPFieldSeparator({ className }: OTPFieldSeparatorProps) {
|
|
45
|
+
return <OTPFieldPreview.Separator render={<div className={clsx(separator, className)} />} />;
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./popover";
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { style } from "@vanilla-extract/css";
|
|
2
|
+
import { semanticVars, tokenVars } from "@blenx-dev/theme/contract";
|
|
3
|
+
|
|
4
|
+
export const backdrop = style({
|
|
5
|
+
position: "fixed",
|
|
6
|
+
inset: 0,
|
|
7
|
+
zIndex: 50,
|
|
8
|
+
backgroundColor: "rgba(0, 0, 0, 0.32)",
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const positioner = style({
|
|
12
|
+
zIndex: 50,
|
|
13
|
+
outline: "none",
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const popup = style({
|
|
17
|
+
boxSizing: "border-box",
|
|
18
|
+
minWidth: 160,
|
|
19
|
+
width: "max(var(--anchor-width), 240px)",
|
|
20
|
+
maxWidth: "calc(100vw - 16px)",
|
|
21
|
+
padding: tokenVars.spacing.sm,
|
|
22
|
+
backgroundColor: semanticVars.surface.default,
|
|
23
|
+
borderWidth: tokenVars.borderWidth.thin,
|
|
24
|
+
borderStyle: "solid",
|
|
25
|
+
borderColor: semanticVars.border.default,
|
|
26
|
+
borderRadius: tokenVars.borderRadius.lg,
|
|
27
|
+
boxShadow: tokenVars.shadow.lg,
|
|
28
|
+
outline: "none",
|
|
29
|
+
transformOrigin: "var(--transform-origin)",
|
|
30
|
+
transitionProperty: "opacity, scale",
|
|
31
|
+
transitionDuration: "150ms",
|
|
32
|
+
transitionTimingFunction: "ease",
|
|
33
|
+
selectors: {
|
|
34
|
+
"&[data-starting-style]": {
|
|
35
|
+
opacity: 0,
|
|
36
|
+
scale: 0.95,
|
|
37
|
+
},
|
|
38
|
+
"&[data-ending-style]": {
|
|
39
|
+
opacity: 0,
|
|
40
|
+
scale: 0.95,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
"@media": {
|
|
44
|
+
"(prefers-reduced-motion: reduce)": {
|
|
45
|
+
transitionProperty: "none",
|
|
46
|
+
transitionDuration: "0ms",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export const arrow = style({
|
|
52
|
+
position: "absolute",
|
|
53
|
+
width: 10,
|
|
54
|
+
height: 10,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export const arrowFill = style({
|
|
58
|
+
width: "100%",
|
|
59
|
+
height: "100%",
|
|
60
|
+
backgroundColor: semanticVars.surface.default,
|
|
61
|
+
borderWidth: tokenVars.borderWidth.thin,
|
|
62
|
+
borderStyle: "solid",
|
|
63
|
+
borderColor: semanticVars.border.default,
|
|
64
|
+
borderRadius: 2,
|
|
65
|
+
transform: "rotate(45deg)",
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export const title = style({
|
|
69
|
+
fontSize: tokenVars.fontSize.md,
|
|
70
|
+
fontWeight: tokenVars.fontWeight.semibold,
|
|
71
|
+
color: semanticVars.text.primary,
|
|
72
|
+
margin: 0,
|
|
73
|
+
paddingBottom: tokenVars.spacing.xs,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
export const description = style({
|
|
77
|
+
fontSize: tokenVars.fontSize.sm,
|
|
78
|
+
color: semanticVars.text.secondary,
|
|
79
|
+
margin: 0,
|
|
80
|
+
paddingBottom: tokenVars.spacing.xs,
|
|
81
|
+
});
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import type React from "react";
|
|
6
|
+
import { backdrop, positioner, popup, arrow, arrowFill, title, description } from "./popover.css";
|
|
7
|
+
|
|
8
|
+
export const PopoverCreateHandle: typeof PopoverPrimitive.createHandle =
|
|
9
|
+
PopoverPrimitive.createHandle;
|
|
10
|
+
|
|
11
|
+
export function Popover(props: PopoverPrimitive.Root.Props): React.ReactElement {
|
|
12
|
+
return <PopoverPrimitive.Root {...props} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function PopoverTrigger(props: PopoverPrimitive.Trigger.Props): React.ReactElement {
|
|
16
|
+
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function PopoverClose(props: PopoverPrimitive.Close.Props): React.ReactElement {
|
|
20
|
+
return <PopoverPrimitive.Close data-slot="popover-close" {...props} />;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function PopoverPortal(props: PopoverPrimitive.Portal.Props): React.ReactElement {
|
|
24
|
+
return <PopoverPrimitive.Portal {...props} />;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function PopoverPositioner({
|
|
28
|
+
sideOffset = 4,
|
|
29
|
+
side = "bottom",
|
|
30
|
+
align = "center",
|
|
31
|
+
className,
|
|
32
|
+
style,
|
|
33
|
+
...props
|
|
34
|
+
}: PopoverPrimitive.Positioner.Props & {
|
|
35
|
+
className?: string;
|
|
36
|
+
style?: React.CSSProperties;
|
|
37
|
+
}): React.ReactElement {
|
|
38
|
+
return (
|
|
39
|
+
<PopoverPrimitive.Positioner
|
|
40
|
+
sideOffset={sideOffset}
|
|
41
|
+
side={side}
|
|
42
|
+
align={align}
|
|
43
|
+
className={clsx(positioner, className)}
|
|
44
|
+
style={style}
|
|
45
|
+
data-slot="popover-positioner"
|
|
46
|
+
{...props}
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function PopoverPopup({
|
|
52
|
+
className,
|
|
53
|
+
style,
|
|
54
|
+
...props
|
|
55
|
+
}: PopoverPrimitive.Popup.Props & {
|
|
56
|
+
className?: string;
|
|
57
|
+
style?: React.CSSProperties;
|
|
58
|
+
}): React.ReactElement {
|
|
59
|
+
return (
|
|
60
|
+
<PopoverPortal>
|
|
61
|
+
<PopoverPositioner>
|
|
62
|
+
<PopoverPrimitive.Popup
|
|
63
|
+
className={clsx(popup, className)}
|
|
64
|
+
style={style}
|
|
65
|
+
data-slot="popover-popup"
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
</PopoverPositioner>
|
|
69
|
+
</PopoverPortal>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function PopoverArrow(props: PopoverPrimitive.Arrow.Props): React.ReactElement {
|
|
74
|
+
return (
|
|
75
|
+
<PopoverPrimitive.Arrow className={arrow} data-slot="popover-arrow" {...props}>
|
|
76
|
+
<div className={arrowFill} />
|
|
77
|
+
</PopoverPrimitive.Arrow>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function PopoverBackdrop(props: PopoverPrimitive.Backdrop.Props): React.ReactElement {
|
|
82
|
+
return <PopoverPrimitive.Backdrop className={backdrop} data-slot="popover-backdrop" {...props} />;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function PopoverTitle(props: PopoverPrimitive.Title.Props): React.ReactElement {
|
|
86
|
+
return <PopoverPrimitive.Title className={title} data-slot="popover-title" {...props} />;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function PopoverDescription(props: PopoverPrimitive.Description.Props): React.ReactElement {
|
|
90
|
+
return (
|
|
91
|
+
<PopoverPrimitive.Description
|
|
92
|
+
className={description}
|
|
93
|
+
data-slot="popover-description"
|
|
94
|
+
{...props}
|
|
95
|
+
/>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export const PopoverRoot = Popover;
|
|
100
|
+
|
|
101
|
+
export const PopoverCompound = {
|
|
102
|
+
Root: Popover,
|
|
103
|
+
Trigger: PopoverTrigger,
|
|
104
|
+
Close: PopoverClose,
|
|
105
|
+
Portal: PopoverPortal,
|
|
106
|
+
Positioner: PopoverPositioner,
|
|
107
|
+
Popup: PopoverPopup,
|
|
108
|
+
Arrow: PopoverArrow,
|
|
109
|
+
Backdrop: PopoverBackdrop,
|
|
110
|
+
Title: PopoverTitle,
|
|
111
|
+
Description: PopoverDescription,
|
|
112
|
+
createHandle: PopoverCreateHandle,
|
|
113
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { style } from "@vanilla-extract/css";
|
|
2
|
+
import { semanticVars, tokenVars } from "@blenx-dev/theme/contract";
|
|
3
|
+
|
|
4
|
+
export const root = style({
|
|
5
|
+
display: "flex",
|
|
6
|
+
width: "100%",
|
|
7
|
+
flexDirection: "column",
|
|
8
|
+
gap: tokenVars.spacing["2"],
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const track = style({
|
|
12
|
+
display: "block",
|
|
13
|
+
height: 6,
|
|
14
|
+
width: "100%",
|
|
15
|
+
overflow: "hidden",
|
|
16
|
+
borderRadius: tokenVars.borderRadius.full,
|
|
17
|
+
backgroundColor: semanticVars.surface.default,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const indicator = style({
|
|
21
|
+
height: "100%",
|
|
22
|
+
backgroundColor: semanticVars.interactive.primary.default,
|
|
23
|
+
borderRadius: tokenVars.borderRadius.full,
|
|
24
|
+
transitionProperty: "width, background-color",
|
|
25
|
+
transitionDuration: tokenVars.duration.slow,
|
|
26
|
+
transitionTimingFunction: "ease",
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const progressLabel = style({
|
|
30
|
+
fontSize: tokenVars.fontSize.md,
|
|
31
|
+
fontWeight: tokenVars.fontWeight.medium,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export const value = style({
|
|
35
|
+
fontSize: tokenVars.fontSize.sm,
|
|
36
|
+
fontVariantNumeric: "tabular-nums",
|
|
37
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Progress as ProgressPrimitive } from "@base-ui/react/progress";
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import * as styles from "./progress.css";
|
|
6
|
+
import type { _BaseDivProps } from "../../utils/types";
|
|
7
|
+
|
|
8
|
+
type ProgressRootProps = _BaseDivProps & ProgressPrimitive.Root.Props;
|
|
9
|
+
|
|
10
|
+
function Progress({ children, className, style, ...props }: ProgressRootProps) {
|
|
11
|
+
return (
|
|
12
|
+
<ProgressPrimitive.Root className={clsx(styles.root, className)} style={style} {...props}>
|
|
13
|
+
{children ?? (
|
|
14
|
+
<ProgressTrack>
|
|
15
|
+
<ProgressIndicator />
|
|
16
|
+
</ProgressTrack>
|
|
17
|
+
)}
|
|
18
|
+
</ProgressPrimitive.Root>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type ProgressLabelProps = _BaseDivProps & ProgressPrimitive.Label.Props;
|
|
23
|
+
|
|
24
|
+
export function ProgressLabel({ className, style, ...props }: ProgressLabelProps) {
|
|
25
|
+
return (
|
|
26
|
+
<ProgressPrimitive.Label
|
|
27
|
+
className={clsx(styles.progressLabel, className)}
|
|
28
|
+
style={style}
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
type ProgressTrackProps = _BaseDivProps & ProgressPrimitive.Track.Props;
|
|
35
|
+
|
|
36
|
+
export function ProgressTrack({ className, style, ...props }: ProgressTrackProps) {
|
|
37
|
+
return (
|
|
38
|
+
<ProgressPrimitive.Track className={clsx(styles.track, className)} style={style} {...props} />
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
type ProgressIndicatorProps = _BaseDivProps & ProgressPrimitive.Indicator.Props;
|
|
43
|
+
|
|
44
|
+
export function ProgressIndicator({ className, style, ...props }: ProgressIndicatorProps) {
|
|
45
|
+
return (
|
|
46
|
+
<ProgressPrimitive.Indicator
|
|
47
|
+
className={clsx(styles.indicator, className)}
|
|
48
|
+
style={style}
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
type ProgressValueProps = _BaseDivProps & ProgressPrimitive.Value.Props;
|
|
55
|
+
|
|
56
|
+
export function ProgressValue({ className, style, ...props }: ProgressValueProps) {
|
|
57
|
+
return (
|
|
58
|
+
<ProgressPrimitive.Value className={clsx(styles.value, className)} style={style} {...props} />
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { Progress };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Radio, RadioGroup, RadioGroupItem } from "./radio";
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { style } from "@vanilla-extract/css";
|
|
2
|
+
import { semanticVars, tokenVars } from "@blenx-dev/theme/contract";
|
|
3
|
+
|
|
4
|
+
export const root = style({
|
|
5
|
+
position: "relative",
|
|
6
|
+
display: "inline-flex",
|
|
7
|
+
alignItems: "center",
|
|
8
|
+
justifyContent: "center",
|
|
9
|
+
flexShrink: 0,
|
|
10
|
+
width: 18,
|
|
11
|
+
height: 18,
|
|
12
|
+
borderRadius: tokenVars.borderRadius.full,
|
|
13
|
+
borderWidth: tokenVars.borderWidth.thin,
|
|
14
|
+
borderStyle: "solid",
|
|
15
|
+
borderColor: semanticVars.border.default,
|
|
16
|
+
backgroundColor: semanticVars.background.default,
|
|
17
|
+
outline: "none",
|
|
18
|
+
transitionProperty: "box-shadow",
|
|
19
|
+
transitionDuration: "150ms",
|
|
20
|
+
selectors: {
|
|
21
|
+
"&:focus-visible": {
|
|
22
|
+
boxShadow: `0 0 0 2px ${semanticVars.focus.ring}`,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
"@media": {
|
|
26
|
+
"screen and (min-width: 640px)": {
|
|
27
|
+
width: 16,
|
|
28
|
+
height: 16,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const rootDisabled = style({
|
|
34
|
+
cursor: "not-allowed",
|
|
35
|
+
opacity: 0.64,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const group = style({
|
|
39
|
+
display: "flex",
|
|
40
|
+
flexDirection: "column",
|
|
41
|
+
gap: tokenVars.spacing.sm,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export const indicator = style({
|
|
45
|
+
display: "none",
|
|
46
|
+
position: "absolute",
|
|
47
|
+
top: -1,
|
|
48
|
+
left: -1,
|
|
49
|
+
right: -1,
|
|
50
|
+
bottom: -1,
|
|
51
|
+
alignItems: "center",
|
|
52
|
+
justifyContent: "center",
|
|
53
|
+
borderRadius: tokenVars.borderRadius.full,
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export const indicatorChecked = style({
|
|
57
|
+
display: "flex",
|
|
58
|
+
backgroundColor: semanticVars.interactive.primary.default,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export const dot = style({
|
|
62
|
+
width: 8,
|
|
63
|
+
height: 8,
|
|
64
|
+
borderRadius: tokenVars.borderRadius.full,
|
|
65
|
+
backgroundColor: semanticVars.interactive.primaryFg,
|
|
66
|
+
"@media": {
|
|
67
|
+
"screen and (min-width: 640px)": {
|
|
68
|
+
width: 6,
|
|
69
|
+
height: 6,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Radio as RadioPrimitive } from "@base-ui/react/radio";
|
|
4
|
+
import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group";
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import { group, root, rootDisabled, indicator, indicatorChecked, dot } from "./radio.css";
|
|
7
|
+
|
|
8
|
+
type RadioGroupProps = Omit<RadioGroupPrimitive.Props, "style" | "className"> & {
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type RadioProps = Omit<RadioPrimitive.Root.Props, "style" | "className"> & {
|
|
14
|
+
className?: string;
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export function RadioGroup({ className, style, ...props }: RadioGroupProps) {
|
|
19
|
+
return (
|
|
20
|
+
<RadioGroupPrimitive
|
|
21
|
+
className={clsx(group, className)}
|
|
22
|
+
style={style}
|
|
23
|
+
data-slot="radio-group"
|
|
24
|
+
{...props}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function Radio({ className, style, ...props }: RadioProps) {
|
|
30
|
+
return (
|
|
31
|
+
<RadioPrimitive.Root
|
|
32
|
+
{...props}
|
|
33
|
+
render={(rootProps, { checked, disabled }) => (
|
|
34
|
+
<span
|
|
35
|
+
{...rootProps}
|
|
36
|
+
className={clsx(root, disabled && rootDisabled, className)}
|
|
37
|
+
style={style}
|
|
38
|
+
data-slot="radio"
|
|
39
|
+
>
|
|
40
|
+
<RadioPrimitive.Indicator className={clsx(indicator, checked && indicatorChecked)}>
|
|
41
|
+
{checked && <span className={dot} />}
|
|
42
|
+
</RadioPrimitive.Indicator>
|
|
43
|
+
</span>
|
|
44
|
+
)}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { Radio as RadioGroupItem };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./scroll-area";
|