raft-ui 0.0.6 → 0.0.8
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 +7 -5
- package/dist/index.d.mts +618 -2
- package/dist/index.mjs +1205 -12
- package/{src → dist}/styles.css +0 -2
- package/{src/lib/styled-props.ts → dist/tv-UUMwNowu.d.mts} +6 -1
- package/dist/use-theme-Y_h1DKll.mjs +34 -0
- package/dist/wip.d.mts +15 -133
- package/dist/wip.mjs +23 -296
- package/package.json +4 -4
- package/dist/button-CJqMhTPQ.mjs +0 -621
- package/dist/index-CpGciYPW.d.mts +0 -267
- package/src/components/alert-dialog/alert-dialog.tsx +0 -215
- package/src/components/alert-dialog/index.ts +0 -30
- package/src/components/avatar/avatar.tsx +0 -375
- package/src/components/avatar/index.ts +0 -17
- package/src/components/badge/badge.tsx +0 -393
- package/src/components/badge/index.ts +0 -2
- package/src/components/banner/banner.tsx +0 -269
- package/src/components/banner/index.ts +0 -8
- package/src/components/bottom-sheet/bottom-sheet.tsx +0 -152
- package/src/components/bottom-sheet/index.ts +0 -22
- package/src/components/button/button.tsx +0 -499
- package/src/components/button/index.ts +0 -2
- package/src/components/checkbox/checkbox-indicator.tsx +0 -128
- package/src/components/checkbox/checkbox.tsx +0 -350
- package/src/components/checkbox/index.ts +0 -2
- package/src/components/combobox/combobox.tsx +0 -603
- package/src/components/combobox/index.ts +0 -52
- package/src/components/context-menu/context-menu.tsx +0 -380
- package/src/components/context-menu/index.ts +0 -34
- package/src/components/conversation-preview-card/conversation-preview-card.tsx +0 -336
- package/src/components/conversation-preview-card/index.ts +0 -32
- package/src/components/description-list/description-list.tsx +0 -116
- package/src/components/description-list/index.ts +0 -14
- package/src/components/dialog/dialog.tsx +0 -152
- package/src/components/dialog/index.ts +0 -26
- package/src/components/dropdown-menu/dropdown-menu.tsx +0 -405
- package/src/components/dropdown-menu/index.ts +0 -38
- package/src/components/empty-state/empty-state.tsx +0 -177
- package/src/components/empty-state/index.ts +0 -16
- package/src/components/field/field.tsx +0 -125
- package/src/components/field/index.ts +0 -18
- package/src/components/inline-code/index.ts +0 -2
- package/src/components/inline-code/inline-code.tsx +0 -35
- package/src/components/input/index.ts +0 -2
- package/src/components/input/input.tsx +0 -76
- package/src/components/input-group/index.ts +0 -7
- package/src/components/input-group/input-group.tsx +0 -215
- package/src/components/kbd/index.ts +0 -2
- package/src/components/kbd/kbd.tsx +0 -43
- package/src/components/label/index.ts +0 -2
- package/src/components/label/label.tsx +0 -99
- package/src/components/lightbox/index.ts +0 -24
- package/src/components/lightbox/lightbox.tsx +0 -245
- package/src/components/list-item/index.ts +0 -20
- package/src/components/list-item/list-item.tsx +0 -263
- package/src/components/media-list-item/index.ts +0 -20
- package/src/components/media-list-item/media-list-item.tsx +0 -169
- package/src/components/notification-center/index.ts +0 -39
- package/src/components/notification-center/notification-center.tsx +0 -558
- package/src/components/panel-header/index.ts +0 -22
- package/src/components/panel-header/panel-header.tsx +0 -199
- package/src/components/popover/index.ts +0 -30
- package/src/components/popover/popover.tsx +0 -248
- package/src/components/preview-shell/index.ts +0 -2
- package/src/components/preview-shell/preview-shell.tsx +0 -51
- package/src/components/quoted-message-card/index.ts +0 -36
- package/src/components/quoted-message-card/quoted-message-card.tsx +0 -391
- package/src/components/radio-group/index.ts +0 -2
- package/src/components/radio-group/radio-group.tsx +0 -119
- package/src/components/section-header/index.ts +0 -16
- package/src/components/section-header/section-header.tsx +0 -117
- package/src/components/section-label/index.ts +0 -2
- package/src/components/section-label/section-label.tsx +0 -38
- package/src/components/segmented-control/index.ts +0 -12
- package/src/components/segmented-control/segmented-control.tsx +0 -129
- package/src/components/select/index.ts +0 -40
- package/src/components/select/select.tsx +0 -382
- package/src/components/separator/index.ts +0 -2
- package/src/components/separator/separator.tsx +0 -40
- package/src/components/spinner/index.ts +0 -2
- package/src/components/spinner/spinner.tsx +0 -228
- package/src/components/status/index.ts +0 -2
- package/src/components/status/status.tsx +0 -152
- package/src/components/tabs/index.ts +0 -24
- package/src/components/tabs/tabs.tsx +0 -451
- package/src/components/text/index.ts +0 -2
- package/src/components/text/text.tsx +0 -131
- package/src/components/textarea/index.ts +0 -2
- package/src/components/textarea/textarea.tsx +0 -136
- package/src/components/toggle-group/index.ts +0 -7
- package/src/components/toggle-group/toggle-group.tsx +0 -111
- package/src/components/tooltip/index.ts +0 -8
- package/src/components/tooltip/tooltip.tsx +0 -212
- package/src/index.ts +0 -429
- package/src/legacy/AttentionDot.tsx +0 -28
- package/src/legacy/AvatarListRow.tsx +0 -87
- package/src/legacy/AvatarSlot.tsx +0 -157
- package/src/legacy/Badge.tsx +0 -95
- package/src/legacy/Banner.tsx +0 -74
- package/src/legacy/BottomSheet.tsx +0 -76
- package/src/legacy/CheckMarker.tsx +0 -72
- package/src/legacy/Checkbox.tsx +0 -81
- package/src/legacy/ConversationPreviewCard.tsx +0 -169
- package/src/legacy/DismissBackdrop.tsx +0 -68
- package/src/legacy/EmptyState.tsx +0 -63
- package/src/legacy/ExperimentalBadge.tsx +0 -19
- package/src/legacy/FormField.tsx +0 -106
- package/src/legacy/KeyValueRow.tsx +0 -67
- package/src/legacy/Lightbox.tsx +0 -119
- package/src/legacy/NotificationCenter.tsx +0 -217
- package/src/legacy/PanelHeader.tsx +0 -94
- package/src/legacy/PreviewShell.tsx +0 -40
- package/src/legacy/QuotedMessageCard.tsx +0 -181
- package/src/legacy/ReorderablePanelTabs.tsx +0 -156
- package/src/legacy/SandboxedPreviewFrame.tsx +0 -59
- package/src/legacy/SearchInput.tsx +0 -23
- package/src/legacy/SectionEyebrow.tsx +0 -60
- package/src/legacy/SectionHeader.tsx +0 -68
- package/src/legacy/SegmentedControl.tsx +0 -74
- package/src/legacy/SlugInput.tsx +0 -29
- package/src/legacy/Spinner.tsx +0 -89
- package/src/legacy/StatusDot.tsx +0 -51
- package/src/legacy/SurfaceListItem.tsx +0 -32
- package/src/legacy/Textarea.tsx +0 -137
- package/src/legacy/button.tsx +0 -100
- package/src/legacy/context-menu-divider.tsx +0 -12
- package/src/legacy/menu-item.tsx +0 -66
- package/src/legacy/selection-popover.tsx +0 -212
- package/src/legacy/server-switcher-menu.tsx +0 -203
- package/src/legacy/source.css +0 -240
- package/src/lib/cn.ts +0 -1
- package/src/lib/theme/theme-context.ts +0 -28
- package/src/lib/theme/theme-provider.tsx +0 -181
- package/src/lib/theme/use-theme.ts +0 -12
- package/src/lib/tv.ts +0 -29
- package/src/lib/without-children.ts +0 -6
- package/src/wip.ts +0 -291
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import type { ComponentPropsWithRef } from "react";
|
|
2
|
-
import { Radio as BaseRadio } from "@base-ui/react/radio";
|
|
3
|
-
import { RadioGroup as BaseRadioGroup } from "@base-ui/react/radio-group";
|
|
4
|
-
import { tv, type VariantProps } from "../../lib/tv";
|
|
5
|
-
import type { StyledProps } from "../../lib/styled-props";
|
|
6
|
-
import { useThemeFamily } from "../../lib/theme/use-theme";
|
|
7
|
-
|
|
8
|
-
const segmentedControl = tv({
|
|
9
|
-
slots: {
|
|
10
|
-
root: ["inline-flex max-w-full flex-wrap items-center gap-1"],
|
|
11
|
-
item: [
|
|
12
|
-
"inline-flex min-w-0 shrink-0 items-center gap-1.5",
|
|
13
|
-
"text-xs leading-4 transition-colors",
|
|
14
|
-
"outline-none disabled:pointer-events-none",
|
|
15
|
-
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
|
|
16
|
-
],
|
|
17
|
-
label: ["truncate"],
|
|
18
|
-
count: ["font-mono text-xs leading-4"],
|
|
19
|
-
},
|
|
20
|
-
variants: {
|
|
21
|
-
theme: {
|
|
22
|
-
brutal: {
|
|
23
|
-
item: [
|
|
24
|
-
"border-2 border-line-strong bg-layer-panel px-2 py-1.5 font-semibold text-foreground-strong",
|
|
25
|
-
"has-[svg]:pl-1.5 has-[[data-slot=segmented-control-count]]:pr-1.5",
|
|
26
|
-
"[&_svg]:stroke-[2.5]",
|
|
27
|
-
"hover:bg-primary-400/30 data-[checked]:bg-primary-400 data-[checked]:text-foreground-strong",
|
|
28
|
-
"data-[disabled]:cursor-not-allowed",
|
|
29
|
-
],
|
|
30
|
-
count: [
|
|
31
|
-
"font-bold text-foreground/65",
|
|
32
|
-
"group-data-[checked]/segmented-control-item:text-foreground/70",
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
elegant: {
|
|
36
|
-
root: ["gap-1.5"],
|
|
37
|
-
item: [
|
|
38
|
-
"rounded-sm bg-layer-panel px-2.5 py-2 font-medium text-foreground-strong antialiased",
|
|
39
|
-
"has-[svg]:pl-2 has-[[data-slot=segmented-control-count]]:pr-2",
|
|
40
|
-
"shadow-[inset_0_1px_0.5px_oklch(1_0_0_/_0.05),0_1px_1.5px_-1px_oklch(0_0_0_/_0.035),0_0_0_1px_var(--line-subtle)]",
|
|
41
|
-
"data-[unchecked]:hover:bg-[color-mix(in_oklch,var(--layer-muted)_55%,var(--layer-panel))]",
|
|
42
|
-
"data-[checked]:bg-primary-400 data-[checked]:text-primary-950 data-[checked]:hover:bg-[oklch(0.86_0.15_91.89)]",
|
|
43
|
-
"data-[checked]:shadow-[0_1px_1.5px_-1px_oklch(0.85_0.162_91.89_/_0.08),0_0_0_1px_oklch(0.83_0.14_91.89_/_0.68)]",
|
|
44
|
-
"focus-visible:ring-2 focus-visible:ring-line-focus",
|
|
45
|
-
"data-[disabled]:cursor-not-allowed",
|
|
46
|
-
],
|
|
47
|
-
count: [
|
|
48
|
-
"text-foreground-placeholder",
|
|
49
|
-
"group-data-[checked]/segmented-control-item:text-primary-950/60",
|
|
50
|
-
],
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
disabled: {
|
|
54
|
-
true: {
|
|
55
|
-
root: "opacity-50",
|
|
56
|
-
},
|
|
57
|
-
false: {
|
|
58
|
-
root: "",
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
defaultVariants: {
|
|
63
|
-
disabled: false,
|
|
64
|
-
},
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
export type SegmentedControlProps<T extends string = string> = StyledProps<
|
|
68
|
-
Omit<BaseRadioGroup.Props<T>, "aria-label">
|
|
69
|
-
> &
|
|
70
|
-
Omit<VariantProps<typeof segmentedControl>, "theme"> & {
|
|
71
|
-
ariaLabel?: string;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export function SegmentedControl<T extends string = string>({
|
|
75
|
-
ariaLabel,
|
|
76
|
-
disabled = false,
|
|
77
|
-
className,
|
|
78
|
-
...props
|
|
79
|
-
}: SegmentedControlProps<T>) {
|
|
80
|
-
const theme = useThemeFamily();
|
|
81
|
-
const { root } = segmentedControl({ disabled, theme });
|
|
82
|
-
return (
|
|
83
|
-
<BaseRadioGroup
|
|
84
|
-
aria-label={ariaLabel}
|
|
85
|
-
disabled={disabled}
|
|
86
|
-
data-slot="segmented-control"
|
|
87
|
-
className={root({ className })}
|
|
88
|
-
{...props}
|
|
89
|
-
/>
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export type SegmentedControlItemProps<T extends string = string> = StyledProps<
|
|
94
|
-
BaseRadio.Root.Props<T>
|
|
95
|
-
>;
|
|
96
|
-
|
|
97
|
-
export function SegmentedControlItem<T extends string = string>({
|
|
98
|
-
className,
|
|
99
|
-
...props
|
|
100
|
-
}: SegmentedControlItemProps<T>) {
|
|
101
|
-
const theme = useThemeFamily();
|
|
102
|
-
const { item } = segmentedControl({ theme });
|
|
103
|
-
return (
|
|
104
|
-
<BaseRadio.Root
|
|
105
|
-
render={<button type="button" />}
|
|
106
|
-
nativeButton
|
|
107
|
-
data-slot="segmented-control-item"
|
|
108
|
-
className={item({
|
|
109
|
-
className: `group/segmented-control-item ${className ?? ""}`.trim(),
|
|
110
|
-
})}
|
|
111
|
-
{...props}
|
|
112
|
-
/>
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export type SegmentedControlLabelProps = ComponentPropsWithRef<"span">;
|
|
117
|
-
|
|
118
|
-
export function SegmentedControlLabel({ className, ...props }: SegmentedControlLabelProps) {
|
|
119
|
-
const { label } = segmentedControl();
|
|
120
|
-
return <span data-slot="segmented-control-label" className={label({ className })} {...props} />;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export type SegmentedControlCountProps = ComponentPropsWithRef<"span">;
|
|
124
|
-
|
|
125
|
-
export function SegmentedControlCount({ className, ...props }: SegmentedControlCountProps) {
|
|
126
|
-
const theme = useThemeFamily();
|
|
127
|
-
const { count } = segmentedControl({ theme });
|
|
128
|
-
return <span data-slot="segmented-control-count" className={count({ className })} {...props} />;
|
|
129
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
Select,
|
|
3
|
-
SelectArrow,
|
|
4
|
-
SelectContent,
|
|
5
|
-
SelectGroup,
|
|
6
|
-
SelectGroupLabel,
|
|
7
|
-
SelectIcon,
|
|
8
|
-
SelectItem,
|
|
9
|
-
SelectItemIndicator,
|
|
10
|
-
SelectItemText,
|
|
11
|
-
SelectLabel,
|
|
12
|
-
SelectList,
|
|
13
|
-
SelectPopup,
|
|
14
|
-
SelectPortal,
|
|
15
|
-
SelectScrollDownArrow,
|
|
16
|
-
SelectScrollUpArrow,
|
|
17
|
-
SelectSeparator,
|
|
18
|
-
SelectTrigger,
|
|
19
|
-
SelectValue,
|
|
20
|
-
} from "./select";
|
|
21
|
-
export type {
|
|
22
|
-
SelectArrowProps,
|
|
23
|
-
SelectContentProps,
|
|
24
|
-
SelectGroupLabelProps,
|
|
25
|
-
SelectGroupProps,
|
|
26
|
-
SelectIconProps,
|
|
27
|
-
SelectItemIndicatorProps,
|
|
28
|
-
SelectItemProps,
|
|
29
|
-
SelectItemTextProps,
|
|
30
|
-
SelectLabelProps,
|
|
31
|
-
SelectListProps,
|
|
32
|
-
SelectPopupProps,
|
|
33
|
-
SelectPortalProps,
|
|
34
|
-
SelectProps,
|
|
35
|
-
SelectScrollDownArrowProps,
|
|
36
|
-
SelectScrollUpArrowProps,
|
|
37
|
-
SelectSeparatorProps,
|
|
38
|
-
SelectTriggerProps,
|
|
39
|
-
SelectValueProps,
|
|
40
|
-
} from "./select";
|
|
@@ -1,382 +0,0 @@
|
|
|
1
|
-
import type { ComponentPropsWithRef } from "react";
|
|
2
|
-
import { Select as BaseSelect } from "@base-ui/react/select";
|
|
3
|
-
import { Check, ChevronDown } from "lucide-react";
|
|
4
|
-
import { tv } from "../../lib/tv";
|
|
5
|
-
import type { StyledProps } from "../../lib/styled-props";
|
|
6
|
-
import { useThemeFamily } from "../../lib/theme/use-theme";
|
|
7
|
-
import { Button } from "../button/index";
|
|
8
|
-
|
|
9
|
-
const select = tv({
|
|
10
|
-
slots: {
|
|
11
|
-
trigger: [
|
|
12
|
-
"inline-flex select-none items-center justify-between gap-2",
|
|
13
|
-
"outline-none transition-colors",
|
|
14
|
-
"data-[placeholder]:text-foreground-placeholder",
|
|
15
|
-
"aria-invalid:border-danger-base/45 aria-invalid:hover:border-danger-base/75 aria-invalid:focus-visible:border-danger-base/75 aria-invalid:focus-visible:ring-3 aria-invalid:focus-visible:ring-danger-base/12",
|
|
16
|
-
"[&_[data-slot='button-content']]:w-full [&_[data-slot='button-content']]:justify-between",
|
|
17
|
-
"[&>span[data-slot='select-trigger-content']]:min-w-0 [&>span[data-slot='select-trigger-content']]:flex-1",
|
|
18
|
-
"[&_[data-slot='select-trigger-content']_svg]:!size-3.5 [&_[data-slot='select-trigger-content']_svg]:shrink-0 [&_[data-slot='select-trigger-content']_svg]:!stroke-[1.5] [&_[data-slot='select-trigger-content']_svg_*]:!stroke-[1.5]",
|
|
19
|
-
"[&_[data-slot='select-icon']]:!stroke-[1.5] [&_[data-slot='select-icon']_*]:!stroke-[1.5]",
|
|
20
|
-
],
|
|
21
|
-
icon: ["ml-auto flex shrink-0 items-center justify-center opacity-80"],
|
|
22
|
-
value: ["flex min-w-0 flex-1 truncate text-left"],
|
|
23
|
-
positioner: ["isolate z-50 outline-none"],
|
|
24
|
-
content: [
|
|
25
|
-
"relative max-h-[var(--available-height)] min-w-[max(var(--anchor-width),220px)] overflow-hidden bg-layer-panel",
|
|
26
|
-
"outline-none",
|
|
27
|
-
],
|
|
28
|
-
list: ["max-h-64 overflow-y-auto overscroll-contain scroll-py-6"],
|
|
29
|
-
item: [
|
|
30
|
-
"flex h-8 w-full shrink-0 cursor-default select-none items-center justify-between gap-2 overflow-hidden px-3",
|
|
31
|
-
"text-left outline-none transition-colors",
|
|
32
|
-
],
|
|
33
|
-
itemIndicator: ["pointer-events-none ml-auto flex shrink-0 items-center justify-center"],
|
|
34
|
-
itemText: ["min-w-0 flex-1 truncate font-normal"],
|
|
35
|
-
label: ["m-0 font-medium"],
|
|
36
|
-
groupLabel: ["px-3 py-2"],
|
|
37
|
-
separator: ["h-px shrink-0 border-0"],
|
|
38
|
-
scrollArrow: [
|
|
39
|
-
"absolute inset-x-0 z-10 flex h-6 w-full cursor-default items-center justify-center",
|
|
40
|
-
"outline-none transition-colors",
|
|
41
|
-
"data-[direction=up]:top-0 data-[direction=down]:bottom-0",
|
|
42
|
-
"[&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
43
|
-
],
|
|
44
|
-
empty: ["px-3 py-4 text-center text-sm"],
|
|
45
|
-
},
|
|
46
|
-
variants: {
|
|
47
|
-
theme: {
|
|
48
|
-
brutal: {
|
|
49
|
-
trigger: [
|
|
50
|
-
"font-sans text-sm font-semibold text-black",
|
|
51
|
-
"[&_[data-slot='button-content']]:font-semibold [&_[data-slot='select-value']]:font-semibold",
|
|
52
|
-
"[&_[data-slot='select-value']_svg]:!stroke-2 [&_[data-slot='select-value']_svg_*]:!stroke-2",
|
|
53
|
-
"data-[popup-open]:translate-x-0 data-[popup-open]:translate-y-0",
|
|
54
|
-
"data-[popup-open]:hover:translate-x-0 data-[popup-open]:hover:translate-y-0",
|
|
55
|
-
],
|
|
56
|
-
content: ["border-2 border-black bg-white shadow-lg"],
|
|
57
|
-
item: [
|
|
58
|
-
"border-b border-black/10 bg-white font-sans text-sm font-semibold leading-6 text-black last:border-b-0",
|
|
59
|
-
"[&_[data-slot='select-item-text']]:font-semibold",
|
|
60
|
-
"hover:bg-brutal-yellow/30 data-[highlighted]:bg-brutal-yellow/30",
|
|
61
|
-
"data-[selected]:bg-brutal-yellow/30",
|
|
62
|
-
"data-[disabled]:pointer-events-none data-[disabled]:text-black/30",
|
|
63
|
-
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:stroke-[1.5] [&_svg_*]:stroke-[1.5] [&_svg:not([class*='size-'])]:size-3",
|
|
64
|
-
"[&>svg]:!stroke-2 [&>svg_*]:!stroke-2",
|
|
65
|
-
],
|
|
66
|
-
itemIndicator: ["text-black [&_svg]:!stroke-[2.25] [&_svg_*]:!stroke-[2.25]"],
|
|
67
|
-
label: [
|
|
68
|
-
"font-sans text-[10px] font-semibold uppercase leading-none tracking-wide text-black",
|
|
69
|
-
],
|
|
70
|
-
groupLabel: [
|
|
71
|
-
"font-sans text-[10px] font-semibold uppercase leading-none tracking-wide text-black/60",
|
|
72
|
-
],
|
|
73
|
-
separator: ["bg-black"],
|
|
74
|
-
scrollArrow: [
|
|
75
|
-
"border-black bg-white text-black",
|
|
76
|
-
"data-[direction=up]:border-b data-[direction=down]:border-t",
|
|
77
|
-
],
|
|
78
|
-
empty: ["font-sans text-sm font-semibold text-black/50"],
|
|
79
|
-
},
|
|
80
|
-
elegant: {
|
|
81
|
-
trigger: [
|
|
82
|
-
"text-sm font-medium tracking-[-0.005em] text-foreground-muted",
|
|
83
|
-
"[&_[data-slot='button-content']]:font-medium [&_[data-slot='select-value']]:font-medium",
|
|
84
|
-
"[&_svg]:stroke-[1.5] [&_svg_*]:stroke-[1.5]",
|
|
85
|
-
],
|
|
86
|
-
content: ["rounded-md bg-layer-popover", "shadow-lg"],
|
|
87
|
-
list: ["flex flex-col gap-0.5 px-1 py-1"],
|
|
88
|
-
item: [
|
|
89
|
-
"rounded-sm bg-transparent px-2 text-sm font-normal tracking-[-0.005em] text-foreground-muted",
|
|
90
|
-
"transition-[background-color,color] duration-150",
|
|
91
|
-
"hover:bg-foreground/[0.04] hover:text-foreground-strong",
|
|
92
|
-
"data-[highlighted]:bg-foreground/[0.04] data-[highlighted]:text-foreground-strong",
|
|
93
|
-
"data-[selected]:bg-foreground/[0.04] data-[selected]:text-foreground-strong",
|
|
94
|
-
"data-[disabled]:pointer-events-none data-[disabled]:text-foreground-disabled",
|
|
95
|
-
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:stroke-[1.5] [&_svg_*]:stroke-[1.5] [&_svg:not([class*='size-'])]:size-3.5",
|
|
96
|
-
],
|
|
97
|
-
itemIndicator: ["text-foreground-strong"],
|
|
98
|
-
label: ["text-[11px] leading-none tracking-[-0.005em] text-foreground-strong"],
|
|
99
|
-
groupLabel: [
|
|
100
|
-
"px-2 text-[11px] font-medium leading-none tracking-[-0.005em] text-foreground/45",
|
|
101
|
-
],
|
|
102
|
-
separator: ["hidden bg-line-muted"],
|
|
103
|
-
scrollArrow: ["bg-layer-popover text-foreground-placeholder hover:text-foreground-muted"],
|
|
104
|
-
empty: ["text-foreground-muted"],
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
export type SelectProps<
|
|
111
|
-
Value,
|
|
112
|
-
Multiple extends boolean | undefined = false,
|
|
113
|
-
> = BaseSelect.Root.Props<Value, Multiple>;
|
|
114
|
-
|
|
115
|
-
export function Select<Value, Multiple extends boolean | undefined = false>(
|
|
116
|
-
props: SelectProps<Value, Multiple>,
|
|
117
|
-
) {
|
|
118
|
-
return <BaseSelect.Root data-slot="select" {...props} />;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export type SelectTriggerProps = StyledProps<BaseSelect.Trigger.Props>;
|
|
122
|
-
|
|
123
|
-
export function SelectTrigger({
|
|
124
|
-
className,
|
|
125
|
-
children,
|
|
126
|
-
render = <Button variant="outline" size="md" />,
|
|
127
|
-
...props
|
|
128
|
-
}: SelectTriggerProps) {
|
|
129
|
-
const theme = useThemeFamily();
|
|
130
|
-
const { trigger } = select({ theme });
|
|
131
|
-
return (
|
|
132
|
-
<BaseSelect.Trigger
|
|
133
|
-
data-slot="select-trigger"
|
|
134
|
-
render={render}
|
|
135
|
-
className={trigger({ className })}
|
|
136
|
-
{...props}
|
|
137
|
-
>
|
|
138
|
-
<span data-slot="select-trigger-content" className="flex min-w-0 flex-1 items-center gap-1.5">
|
|
139
|
-
{children}
|
|
140
|
-
</span>
|
|
141
|
-
</BaseSelect.Trigger>
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export type SelectValueProps = StyledProps<BaseSelect.Value.Props>;
|
|
146
|
-
|
|
147
|
-
export function SelectValue({ className, ...props }: SelectValueProps) {
|
|
148
|
-
const theme = useThemeFamily();
|
|
149
|
-
const { value } = select({ theme });
|
|
150
|
-
return <BaseSelect.Value data-slot="select-value" className={value({ className })} {...props} />;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export type SelectIconProps = StyledProps<BaseSelect.Icon.Props>;
|
|
154
|
-
|
|
155
|
-
export function SelectIcon({ className, children, ...props }: SelectIconProps) {
|
|
156
|
-
const theme = useThemeFamily();
|
|
157
|
-
const { icon } = select({ theme });
|
|
158
|
-
return (
|
|
159
|
-
<BaseSelect.Icon data-slot="select-icon" className={icon({ className })} {...props}>
|
|
160
|
-
{children ?? <ChevronDown aria-hidden className="size-3.5 shrink-0" />}
|
|
161
|
-
</BaseSelect.Icon>
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export type SelectPortalProps = BaseSelect.Portal.Props;
|
|
166
|
-
|
|
167
|
-
export function SelectPortal(props: SelectPortalProps) {
|
|
168
|
-
return <BaseSelect.Portal data-slot="select-portal" {...props} />;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export type SelectPopupProps = ComponentPropsWithRef<"div">;
|
|
172
|
-
|
|
173
|
-
export function SelectPopup({ className, ...props }: SelectPopupProps) {
|
|
174
|
-
const theme = useThemeFamily();
|
|
175
|
-
const { content } = select({ theme });
|
|
176
|
-
return <div data-slot="select-content" className={content({ className })} {...props} />;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export type SelectContentProps = StyledProps<BaseSelect.Popup.Props> &
|
|
180
|
-
Pick<
|
|
181
|
-
BaseSelect.Positioner.Props,
|
|
182
|
-
| "align"
|
|
183
|
-
| "alignItemWithTrigger"
|
|
184
|
-
| "alignOffset"
|
|
185
|
-
| "anchor"
|
|
186
|
-
| "arrowPadding"
|
|
187
|
-
| "collisionAvoidance"
|
|
188
|
-
| "collisionBoundary"
|
|
189
|
-
| "collisionPadding"
|
|
190
|
-
| "disableAnchorTracking"
|
|
191
|
-
| "positionMethod"
|
|
192
|
-
| "side"
|
|
193
|
-
| "sideOffset"
|
|
194
|
-
| "sticky"
|
|
195
|
-
> & {
|
|
196
|
-
portalProps?: SelectPortalProps;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
export function SelectContent({
|
|
200
|
-
align = "start",
|
|
201
|
-
alignItemWithTrigger = false,
|
|
202
|
-
alignOffset = 0,
|
|
203
|
-
anchor,
|
|
204
|
-
arrowPadding,
|
|
205
|
-
collisionAvoidance,
|
|
206
|
-
collisionBoundary,
|
|
207
|
-
collisionPadding,
|
|
208
|
-
disableAnchorTracking = true,
|
|
209
|
-
positionMethod = "fixed",
|
|
210
|
-
side = "bottom",
|
|
211
|
-
sideOffset = 4,
|
|
212
|
-
sticky,
|
|
213
|
-
portalProps,
|
|
214
|
-
className,
|
|
215
|
-
...props
|
|
216
|
-
}: SelectContentProps) {
|
|
217
|
-
const theme = useThemeFamily();
|
|
218
|
-
const { positioner, content } = select({ theme });
|
|
219
|
-
const positionerNode = (
|
|
220
|
-
<BaseSelect.Positioner
|
|
221
|
-
align={align}
|
|
222
|
-
alignItemWithTrigger={alignItemWithTrigger}
|
|
223
|
-
alignOffset={alignOffset}
|
|
224
|
-
anchor={anchor}
|
|
225
|
-
arrowPadding={arrowPadding}
|
|
226
|
-
collisionAvoidance={collisionAvoidance}
|
|
227
|
-
collisionBoundary={collisionBoundary}
|
|
228
|
-
collisionPadding={collisionPadding}
|
|
229
|
-
disableAnchorTracking={disableAnchorTracking}
|
|
230
|
-
positionMethod={positionMethod}
|
|
231
|
-
side={side}
|
|
232
|
-
sideOffset={sideOffset}
|
|
233
|
-
sticky={sticky}
|
|
234
|
-
className={positioner()}
|
|
235
|
-
>
|
|
236
|
-
<BaseSelect.Popup data-slot="select-content" className={content({ className })} {...props} />
|
|
237
|
-
</BaseSelect.Positioner>
|
|
238
|
-
);
|
|
239
|
-
|
|
240
|
-
return <BaseSelect.Portal {...portalProps}>{positionerNode}</BaseSelect.Portal>;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
export type SelectListProps = StyledProps<BaseSelect.List.Props>;
|
|
244
|
-
|
|
245
|
-
export function SelectList({ className, ...props }: SelectListProps) {
|
|
246
|
-
const theme = useThemeFamily();
|
|
247
|
-
const { list } = select({ theme });
|
|
248
|
-
return <BaseSelect.List data-slot="select-list" className={list({ className })} {...props} />;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
export type SelectItemProps = StyledProps<BaseSelect.Item.Props>;
|
|
252
|
-
|
|
253
|
-
export function SelectItem({ className, ...props }: SelectItemProps) {
|
|
254
|
-
const theme = useThemeFamily();
|
|
255
|
-
const { item } = select({ theme });
|
|
256
|
-
return <BaseSelect.Item data-slot="select-item" className={item({ className })} {...props} />;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
export type SelectItemIndicatorProps = StyledProps<BaseSelect.ItemIndicator.Props>;
|
|
260
|
-
|
|
261
|
-
export function SelectItemIndicator({ className, children, ...props }: SelectItemIndicatorProps) {
|
|
262
|
-
const theme = useThemeFamily();
|
|
263
|
-
const { itemIndicator } = select({ theme });
|
|
264
|
-
const defaultIndicator =
|
|
265
|
-
theme === "brutal" ? (
|
|
266
|
-
<Check aria-hidden size={12} className="shrink-0 !stroke-[2.25]" />
|
|
267
|
-
) : (
|
|
268
|
-
<Check aria-hidden className="size-3 shrink-0" />
|
|
269
|
-
);
|
|
270
|
-
|
|
271
|
-
return (
|
|
272
|
-
<BaseSelect.ItemIndicator
|
|
273
|
-
data-slot="select-item-indicator"
|
|
274
|
-
className={itemIndicator({ className })}
|
|
275
|
-
{...props}
|
|
276
|
-
>
|
|
277
|
-
{children ?? defaultIndicator}
|
|
278
|
-
</BaseSelect.ItemIndicator>
|
|
279
|
-
);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
export type SelectItemTextProps = StyledProps<BaseSelect.ItemText.Props>;
|
|
283
|
-
|
|
284
|
-
export function SelectItemText({ className, ...props }: SelectItemTextProps) {
|
|
285
|
-
const theme = useThemeFamily();
|
|
286
|
-
const { itemText } = select({ theme });
|
|
287
|
-
return (
|
|
288
|
-
<BaseSelect.ItemText
|
|
289
|
-
data-slot="select-item-text"
|
|
290
|
-
className={itemText({ className })}
|
|
291
|
-
{...props}
|
|
292
|
-
/>
|
|
293
|
-
);
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
export type SelectLabelProps = StyledProps<BaseSelect.Label.Props>;
|
|
297
|
-
|
|
298
|
-
export function SelectLabel({ className, ...props }: SelectLabelProps) {
|
|
299
|
-
const theme = useThemeFamily();
|
|
300
|
-
const { label } = select({ theme });
|
|
301
|
-
return <BaseSelect.Label data-slot="select-label" className={label({ className })} {...props} />;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
export type SelectGroupProps = StyledProps<BaseSelect.Group.Props>;
|
|
305
|
-
|
|
306
|
-
export function SelectGroup({ className, ...props }: SelectGroupProps) {
|
|
307
|
-
return <BaseSelect.Group data-slot="select-group" className={className} {...props} />;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
export type SelectGroupLabelProps = StyledProps<BaseSelect.GroupLabel.Props>;
|
|
311
|
-
|
|
312
|
-
export function SelectGroupLabel({ className, ...props }: SelectGroupLabelProps) {
|
|
313
|
-
const theme = useThemeFamily();
|
|
314
|
-
const { groupLabel } = select({ theme });
|
|
315
|
-
return (
|
|
316
|
-
<BaseSelect.GroupLabel
|
|
317
|
-
data-slot="select-group-label"
|
|
318
|
-
className={groupLabel({ className })}
|
|
319
|
-
{...props}
|
|
320
|
-
/>
|
|
321
|
-
);
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
export type SelectSeparatorProps = StyledProps<ComponentPropsWithRef<"div">>;
|
|
325
|
-
|
|
326
|
-
export function SelectSeparator({ className, ...props }: SelectSeparatorProps) {
|
|
327
|
-
const theme = useThemeFamily();
|
|
328
|
-
const { separator } = select({ theme });
|
|
329
|
-
return (
|
|
330
|
-
<div
|
|
331
|
-
role="separator"
|
|
332
|
-
aria-orientation="horizontal"
|
|
333
|
-
data-slot="select-separator"
|
|
334
|
-
className={separator({ className })}
|
|
335
|
-
{...props}
|
|
336
|
-
/>
|
|
337
|
-
);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
export type SelectScrollUpArrowProps = StyledProps<BaseSelect.ScrollUpArrow.Props>;
|
|
341
|
-
|
|
342
|
-
export function SelectScrollUpArrow({ className, children, ...props }: SelectScrollUpArrowProps) {
|
|
343
|
-
const theme = useThemeFamily();
|
|
344
|
-
const { scrollArrow } = select({ theme });
|
|
345
|
-
return (
|
|
346
|
-
<BaseSelect.ScrollUpArrow
|
|
347
|
-
data-slot="select-scroll-up-arrow"
|
|
348
|
-
data-direction="up"
|
|
349
|
-
className={scrollArrow({ className })}
|
|
350
|
-
{...props}
|
|
351
|
-
>
|
|
352
|
-
{children ?? <ChevronDown aria-hidden className="size-3.5 shrink-0 rotate-180" />}
|
|
353
|
-
</BaseSelect.ScrollUpArrow>
|
|
354
|
-
);
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
export type SelectScrollDownArrowProps = StyledProps<BaseSelect.ScrollDownArrow.Props>;
|
|
358
|
-
|
|
359
|
-
export function SelectScrollDownArrow({
|
|
360
|
-
className,
|
|
361
|
-
children,
|
|
362
|
-
...props
|
|
363
|
-
}: SelectScrollDownArrowProps) {
|
|
364
|
-
const theme = useThemeFamily();
|
|
365
|
-
const { scrollArrow } = select({ theme });
|
|
366
|
-
return (
|
|
367
|
-
<BaseSelect.ScrollDownArrow
|
|
368
|
-
data-slot="select-scroll-down-arrow"
|
|
369
|
-
data-direction="down"
|
|
370
|
-
className={scrollArrow({ className })}
|
|
371
|
-
{...props}
|
|
372
|
-
>
|
|
373
|
-
{children ?? <ChevronDown aria-hidden className="size-3.5 shrink-0" />}
|
|
374
|
-
</BaseSelect.ScrollDownArrow>
|
|
375
|
-
);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
export type SelectArrowProps = StyledProps<BaseSelect.Arrow.Props>;
|
|
379
|
-
|
|
380
|
-
export function SelectArrow({ className, ...props }: SelectArrowProps) {
|
|
381
|
-
return <BaseSelect.Arrow data-slot="select-arrow" className={className} {...props} />;
|
|
382
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Separator as BaseSeparator } from "@base-ui/react/separator";
|
|
2
|
-
import { tv } from "../../lib/tv";
|
|
3
|
-
import type { StyledProps } from "../../lib/styled-props";
|
|
4
|
-
import { useThemeFamily } from "../../lib/theme/use-theme";
|
|
5
|
-
|
|
6
|
-
const separator = tv({
|
|
7
|
-
base: [
|
|
8
|
-
"shrink-0",
|
|
9
|
-
"data-[orientation=horizontal]:w-full",
|
|
10
|
-
"data-[orientation=vertical]:self-stretch",
|
|
11
|
-
],
|
|
12
|
-
variants: {
|
|
13
|
-
theme: {
|
|
14
|
-
brutal: [
|
|
15
|
-
"data-[orientation=horizontal]:h-0 data-[orientation=horizontal]:border-t-2 data-[orientation=horizontal]:border-black",
|
|
16
|
-
"data-[orientation=vertical]:w-0 data-[orientation=vertical]:border-l-2 data-[orientation=vertical]:border-black",
|
|
17
|
-
],
|
|
18
|
-
elegant: [
|
|
19
|
-
"bg-line-muted",
|
|
20
|
-
"data-[orientation=horizontal]:h-px",
|
|
21
|
-
"data-[orientation=vertical]:w-px",
|
|
22
|
-
],
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export type SeparatorProps = StyledProps<BaseSeparator.Props>;
|
|
28
|
-
|
|
29
|
-
export function Separator({ className, orientation = "horizontal", ...props }: SeparatorProps) {
|
|
30
|
-
const theme = useThemeFamily();
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<BaseSeparator
|
|
34
|
-
data-slot="separator"
|
|
35
|
-
orientation={orientation}
|
|
36
|
-
className={separator({ theme, className })}
|
|
37
|
-
{...props}
|
|
38
|
-
/>
|
|
39
|
-
);
|
|
40
|
-
}
|