@arcfusionz/arc-primitive-ui 0.1.0 → 0.2.1
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/dist/components/AILoader/AILoader.d.ts +32 -0
- package/dist/components/AILoader/AILoader.js +157 -0
- package/dist/components/AILoader/index.d.ts +2 -0
- package/dist/components/AILoader/index.js +2 -0
- package/dist/components/Accordion/Accordion.d.ts +96 -0
- package/dist/components/Accordion/Accordion.js +149 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/Accordion/index.js +2 -0
- package/dist/components/Avatar/Avatar.d.ts +152 -0
- package/dist/components/Avatar/Avatar.js +216 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Avatar/index.js +2 -0
- package/dist/components/Badge/Badge.d.ts +87 -0
- package/dist/components/Badge/Badge.js +118 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/index.js +2 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +109 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +182 -0
- package/dist/components/Breadcrumb/index.d.ts +2 -0
- package/dist/components/Breadcrumb/index.js +2 -0
- package/dist/components/Button/Button.d.ts +57 -0
- package/dist/components/Button/Button.js +177 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Button/index.js +2 -0
- package/dist/components/Calendar/Calendar.d.ts +140 -0
- package/dist/components/Calendar/Calendar.js +468 -0
- package/dist/components/Calendar/index.d.ts +2 -0
- package/dist/components/Calendar/index.js +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +60 -0
- package/dist/components/Checkbox/Checkbox.js +129 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Checkbox/index.js +2 -0
- package/dist/components/Combobox/Combobox.d.ts +251 -0
- package/dist/components/Combobox/Combobox.js +354 -0
- package/dist/components/Combobox/index.d.ts +2 -0
- package/dist/components/Combobox/index.js +2 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +129 -0
- package/dist/components/ContextMenu/ContextMenu.js +93 -0
- package/dist/components/ContextMenu/index.d.ts +2 -0
- package/dist/components/ContextMenu/index.js +2 -0
- package/dist/components/DatePicker/DatePicker.d.ts +109 -0
- package/dist/components/DatePicker/DatePicker.js +145 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/index.js +2 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +107 -0
- package/dist/components/DateRangePicker/DateRangePicker.js +161 -0
- package/dist/components/DateRangePicker/index.d.ts +2 -0
- package/dist/components/DateRangePicker/index.js +2 -0
- package/dist/components/Dialog/Dialog.d.ts +112 -0
- package/dist/components/Dialog/Dialog.js +141 -0
- package/dist/components/Dialog/index.d.ts +2 -0
- package/dist/components/Dialog/index.js +2 -0
- package/dist/components/Drawer/Drawer.d.ts +188 -0
- package/dist/components/Drawer/Drawer.js +268 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/Drawer/index.js +2 -0
- package/dist/components/Field/Field.d.ts +123 -0
- package/dist/components/Field/Field.js +241 -0
- package/dist/components/Field/FieldContext.d.ts +43 -0
- package/dist/components/Field/FieldContext.js +28 -0
- package/dist/components/Field/index.d.ts +3 -0
- package/dist/components/Field/index.js +3 -0
- package/dist/components/Fieldset/Fieldset.d.ts +43 -0
- package/dist/components/Fieldset/Fieldset.js +48 -0
- package/dist/components/Fieldset/index.d.ts +2 -0
- package/dist/components/Fieldset/index.js +2 -0
- package/dist/components/Form/Form.d.ts +54 -0
- package/dist/components/Form/Form.js +57 -0
- package/dist/components/Form/index.d.ts +2 -0
- package/dist/components/Form/index.js +2 -0
- package/dist/components/Input/Input.d.ts +64 -0
- package/dist/components/Input/Input.js +111 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Input/index.js +2 -0
- package/dist/components/Menu/Menu.d.ts +212 -0
- package/dist/components/Menu/Menu.js +255 -0
- package/dist/components/Menu/index.d.ts +2 -0
- package/dist/components/Menu/index.js +2 -0
- package/dist/components/Popover/Popover.d.ts +122 -0
- package/dist/components/Popover/Popover.js +116 -0
- package/dist/components/Popover/index.d.ts +2 -0
- package/dist/components/Popover/index.js +2 -0
- package/dist/components/Progress/Progress.d.ts +87 -0
- package/dist/components/Progress/Progress.js +73 -0
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/Progress/index.js +2 -0
- package/dist/components/Radio/Radio.d.ts +65 -0
- package/dist/components/Radio/Radio.js +93 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Radio/index.js +2 -0
- package/dist/components/Select/Select.d.ts +136 -0
- package/dist/components/Select/Select.js +219 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Select/index.js +2 -0
- package/dist/components/Skeleton/Skeleton.d.ts +39 -0
- package/dist/components/Skeleton/Skeleton.js +44 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Skeleton/index.js +2 -0
- package/dist/components/Stepper/Stepper.d.ts +161 -0
- package/dist/components/Stepper/Stepper.js +344 -0
- package/dist/components/Stepper/index.d.ts +2 -0
- package/dist/components/Stepper/index.js +2 -0
- package/dist/components/Switch/Switch.d.ts +56 -0
- package/dist/components/Switch/Switch.js +87 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Switch/index.js +2 -0
- package/dist/components/Table/Table.d.ts +116 -0
- package/dist/components/Table/Table.js +143 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/Table/index.js +2 -0
- package/dist/components/Tabs/Tabs.d.ts +116 -0
- package/dist/components/Tabs/Tabs.js +158 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Tabs/index.js +2 -0
- package/dist/components/Timeline/Timeline.d.ts +137 -0
- package/dist/components/Timeline/Timeline.js +243 -0
- package/dist/components/Timeline/index.d.ts +2 -0
- package/dist/components/Timeline/index.js +2 -0
- package/dist/components/Toast/Toast.d.ts +135 -0
- package/dist/components/Toast/Toast.js +314 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Toast/index.js +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +104 -0
- package/dist/components/Tooltip/Tooltip.js +95 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/Tooltip/index.js +2 -0
- package/dist/components/Typography/Typography.d.ts +38 -0
- package/dist/components/Typography/Typography.js +53 -0
- package/dist/components/Typography/index.d.ts +2 -0
- package/dist/components/Typography/index.js +2 -0
- package/dist/index.d.ts +66 -3398
- package/dist/index.js +34 -5343
- package/dist/lib/cn.d.ts +6 -0
- package/dist/lib/cn.js +9 -0
- package/package.json +6 -2
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { cn } from "../../lib/cn.js";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Popover } from "@base-ui/react/popover";
|
|
5
|
+
//#region src/components/Popover/Popover.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Groups the popover parts and owns the open state. Accepts Base UI's Root
|
|
8
|
+
* props: `open`/`defaultOpen`/`onOpenChange` for control, `modal` to lock
|
|
9
|
+
* scroll or trap focus, and `handle`/`triggerId` for detached triggers.
|
|
10
|
+
*/
|
|
11
|
+
const Popover$1 = Popover.Root;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a handle that links `Popover` with `PopoverTrigger`s rendered
|
|
14
|
+
* elsewhere in the tree (toolbars, table rows). Triggers may attach a
|
|
15
|
+
* `payload`, which the `Popover` children render function receives.
|
|
16
|
+
*/
|
|
17
|
+
const createPopoverHandle = Popover.createHandle;
|
|
18
|
+
/**
|
|
19
|
+
* The button that opens the popover. Ships unstyled so the visual comes from
|
|
20
|
+
* composition — render the design system's Button:
|
|
21
|
+
*
|
|
22
|
+
* <PopoverTrigger render={<Button variant="outline" />}>Filters</PopoverTrigger>
|
|
23
|
+
*
|
|
24
|
+
* While its popup is open the element carries `data-popup-open`, the hook for
|
|
25
|
+
* a pressed look (e.g. `className="data-popup-open:bg-muted"`). Hover-card
|
|
26
|
+
* behavior comes from `openOnHover` with its `delay`/`closeDelay` (300/0ms
|
|
27
|
+
* defaults) — reserve it for previews; interactive content should open on
|
|
28
|
+
* click so it can't vanish mid-interaction.
|
|
29
|
+
*/
|
|
30
|
+
const PopoverTrigger = forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx(Popover.Trigger, {
|
|
31
|
+
ref,
|
|
32
|
+
className,
|
|
33
|
+
...rest
|
|
34
|
+
}));
|
|
35
|
+
PopoverTrigger.displayName = "PopoverTrigger";
|
|
36
|
+
const popupSurfaceClasses = "rounded-md border border-border bg-background p-4 font-sans text-sm text-foreground shadow-md outline-none";
|
|
37
|
+
const popupBehaviorClasses = "origin-[var(--transform-origin)] max-w-[min(20rem,var(--available-width))] motion-safe:transition-[scale,opacity] motion-safe:duration-150 motion-safe:ease-out data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0";
|
|
38
|
+
const arrowClasses = "relative block h-1.5 w-3 overflow-clip data-[side=bottom]:top-[-6px] data-[side=top]:bottom-[-6px] data-[side=top]:rotate-180 data-[side=left]:right-[-9px] data-[side=left]:rotate-90 data-[side=right]:left-[-9px] data-[side=right]:-rotate-90 before:absolute before:bottom-0 before:left-1/2 before:h-[calc(6px*sqrt(2))] before:w-[calc(6px*sqrt(2))] before:border before:border-border before:bg-background before:content-[''] before:[transform:translate(-50%,50%)_rotate(45deg)]";
|
|
39
|
+
const ARROW_PADDING = 8;
|
|
40
|
+
/**
|
|
41
|
+
* Class list for an element styled as the popover panel — for floating
|
|
42
|
+
* surfaces that don't come from Base UI (static previews, custom
|
|
43
|
+
* floating-ui popups) so every popup in the product shares one look.
|
|
44
|
+
*/
|
|
45
|
+
function popoverPopupVariants({ className } = {}) {
|
|
46
|
+
return cn(popupSurfaceClasses, className);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The floating panel, with the portal and positioning plumbing folded in.
|
|
50
|
+
* Anchored to its trigger by default; opens with a motion-safe scale/fade
|
|
51
|
+
* from the anchor-facing corner. When the popover holds no `PopoverTitle`,
|
|
52
|
+
* name the panel for assistive tech with `aria-label`.
|
|
53
|
+
*/
|
|
54
|
+
const PopoverPopup = forwardRef(({ side = "bottom", align = "center", sideOffset = 8, alignOffset = 0, collisionPadding, anchor, keepMounted = false, container, arrow = false, className, children, ...rest }, ref) => /* @__PURE__ */ jsx(Popover.Portal, {
|
|
55
|
+
container,
|
|
56
|
+
keepMounted,
|
|
57
|
+
children: /* @__PURE__ */ jsx(Popover.Positioner, {
|
|
58
|
+
side,
|
|
59
|
+
align,
|
|
60
|
+
sideOffset,
|
|
61
|
+
alignOffset,
|
|
62
|
+
collisionPadding,
|
|
63
|
+
anchor,
|
|
64
|
+
arrowPadding: ARROW_PADDING,
|
|
65
|
+
className: "z-50",
|
|
66
|
+
children: /* @__PURE__ */ jsxs(Popover.Popup, {
|
|
67
|
+
ref,
|
|
68
|
+
className: cn(popupSurfaceClasses, popupBehaviorClasses, className),
|
|
69
|
+
...rest,
|
|
70
|
+
children: [arrow && /* @__PURE__ */ jsx(Popover.Arrow, { className: arrowClasses }), children]
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
}));
|
|
74
|
+
PopoverPopup.displayName = "PopoverPopup";
|
|
75
|
+
/**
|
|
76
|
+
* Heading that names the popup — Base UI wires it to the panel via
|
|
77
|
+
* `aria-labelledby` automatically. An `<h2>` by default; pick the level from
|
|
78
|
+
* the surrounding outline with `render`, e.g. `render={<h3 />}`.
|
|
79
|
+
*/
|
|
80
|
+
const PopoverTitle = forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx(Popover.Title, {
|
|
81
|
+
ref,
|
|
82
|
+
className: cn("m-0 font-heading text-lg font-semibold text-foreground", className),
|
|
83
|
+
...rest
|
|
84
|
+
}));
|
|
85
|
+
PopoverTitle.displayName = "PopoverTitle";
|
|
86
|
+
/**
|
|
87
|
+
* Supporting copy announced with the popup — Base UI wires it via
|
|
88
|
+
* `aria-describedby` automatically.
|
|
89
|
+
*/
|
|
90
|
+
const PopoverDescription = forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx(Popover.Description, {
|
|
91
|
+
ref,
|
|
92
|
+
className: cn("m-0 font-sans text-sm text-muted-foreground", className),
|
|
93
|
+
...rest
|
|
94
|
+
}));
|
|
95
|
+
PopoverDescription.displayName = "PopoverDescription";
|
|
96
|
+
/**
|
|
97
|
+
* A button that closes the popup. Unstyled, like the trigger — compose the
|
|
98
|
+
* design system's Button for footer actions:
|
|
99
|
+
*
|
|
100
|
+
* <PopoverClose render={<Button size="sm" variant="outline" />}>Done</PopoverClose>
|
|
101
|
+
*
|
|
102
|
+
* or borrow its classes for a corner icon dismiss, which needs an accessible
|
|
103
|
+
* name:
|
|
104
|
+
*
|
|
105
|
+
* <PopoverClose aria-label="Close" className={buttonVariants({ variant: "ghost", size: "sm", iconOnly: true })}>
|
|
106
|
+
* <XIcon />
|
|
107
|
+
* </PopoverClose>
|
|
108
|
+
*/
|
|
109
|
+
const PopoverClose = forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx(Popover.Close, {
|
|
110
|
+
ref,
|
|
111
|
+
className,
|
|
112
|
+
...rest
|
|
113
|
+
}));
|
|
114
|
+
PopoverClose.displayName = "PopoverClose";
|
|
115
|
+
//#endregion
|
|
116
|
+
export { Popover$1 as Popover, PopoverClose, PopoverDescription, PopoverPopup, PopoverTitle, PopoverTrigger, createPopoverHandle, popoverPopupVariants };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Popover, PopoverAlign, PopoverClose, PopoverCloseProps, PopoverDescription, PopoverDescriptionProps, PopoverHandle, PopoverPopup, PopoverPopupProps, PopoverPopupVariantsOptions, PopoverProps, PopoverSide, PopoverTitle, PopoverTitleProps, PopoverTrigger, PopoverTriggerProps, createPopoverHandle, popoverPopupVariants } from "./Popover.js";
|
|
2
|
+
export { Popover, type PopoverAlign, PopoverClose, type PopoverCloseProps, PopoverDescription, type PopoverDescriptionProps, type PopoverHandle, PopoverPopup, type PopoverPopupProps, type PopoverPopupVariantsOptions, type PopoverProps, type PopoverSide, PopoverTitle, type PopoverTitleProps, PopoverTrigger, type PopoverTriggerProps, createPopoverHandle, popoverPopupVariants };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Popover, PopoverClose, PopoverDescription, PopoverPopup, PopoverTitle, PopoverTrigger, createPopoverHandle, popoverPopupVariants } from "./Popover.js";
|
|
2
|
+
export { Popover, PopoverClose, PopoverDescription, PopoverPopup, PopoverTitle, PopoverTrigger, createPopoverHandle, popoverPopupVariants };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { Progress } from "@base-ui/react/progress";
|
|
3
|
+
//#region src/components/Progress/Progress.d.ts
|
|
4
|
+
type ProgressSize = "sm" | "md" | "lg";
|
|
5
|
+
type ProgressVariant = "primary" | "success" | "warning" | "destructive";
|
|
6
|
+
interface ProgressTrackVariantsOptions {
|
|
7
|
+
size?: ProgressSize;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Class list for an element styled as a Progress track.
|
|
12
|
+
*
|
|
13
|
+
* Pair with `progressIndicatorVariants()` to build layouts the flattened
|
|
14
|
+
* component doesn't cover — e.g. a stacked storage bar. Such a composite is
|
|
15
|
+
* one image to assistive technology, so name the whole thing:
|
|
16
|
+
*
|
|
17
|
+
* <div role="img" aria-label="Storage: documents 45%, media 21%"
|
|
18
|
+
* className={progressTrackVariants({ size: "lg" })}>
|
|
19
|
+
* <div className="flex h-full gap-px">
|
|
20
|
+
* <div className={progressIndicatorVariants({ className: "rounded-none" })} style={{ width: "45%" }} />
|
|
21
|
+
* <div className={progressIndicatorVariants({ variant: "success", className: "rounded-none" })} style={{ width: "21%" }} />
|
|
22
|
+
* </div>
|
|
23
|
+
* </div>
|
|
24
|
+
*/
|
|
25
|
+
declare function progressTrackVariants({ size, className }?: ProgressTrackVariantsOptions): string;
|
|
26
|
+
interface ProgressIndicatorVariantsOptions {
|
|
27
|
+
variant?: ProgressVariant;
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
/** Class list for an element styled as a Progress fill — see `progressTrackVariants`. */
|
|
31
|
+
declare function progressIndicatorVariants({ variant, className }?: ProgressIndicatorVariantsOptions): string;
|
|
32
|
+
interface ProgressBaseProps extends Omit<ComponentPropsWithoutRef<typeof Progress.Root>, "className" | "value" | "children"> {
|
|
33
|
+
/**
|
|
34
|
+
* Completion within `[min, max]` (0–100 by default). Omit — or pass
|
|
35
|
+
* `null` — for an indeterminate bar while the amount of work is unknown.
|
|
36
|
+
* Never move it backwards; per NN/g, prefer indeterminate under ~10s and
|
|
37
|
+
* a percent-done readout beyond that.
|
|
38
|
+
*/
|
|
39
|
+
value?: number | null;
|
|
40
|
+
/** Track thickness: `sm` 4px · `md` 8px · `lg` 12px. Text and spacing are unaffected. */
|
|
41
|
+
size?: ProgressSize;
|
|
42
|
+
/**
|
|
43
|
+
* Semantic fill color. For informational statuses use `primary` — the
|
|
44
|
+
* palette's `info` alias shares the primary ramp. Every fill clears the
|
|
45
|
+
* WCAG 1.4.11 3:1 non-text contrast floor against the track. The fill does
|
|
46
|
+
* not change on completion; switch to `success` yourself if the surface
|
|
47
|
+
* calls for it (see `data-complete`).
|
|
48
|
+
*/
|
|
49
|
+
variant?: ProgressVariant;
|
|
50
|
+
/**
|
|
51
|
+
* Visible operation name (Base UI's Label part), rendered above the track
|
|
52
|
+
* and wired up as the accessible name. Without it, `aria-label` or
|
|
53
|
+
* `aria-labelledby` is required — enforced at the type level.
|
|
54
|
+
*/
|
|
55
|
+
label?: ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* Show the formatted value (Base UI's Value part) at the trailing edge of
|
|
58
|
+
* the header row — a percentage by default; `format` and `locale` on the
|
|
59
|
+
* root change the formatting. Renders nothing while indeterminate.
|
|
60
|
+
*/
|
|
61
|
+
showValue?: boolean;
|
|
62
|
+
className?: string;
|
|
63
|
+
}
|
|
64
|
+
/** A progressbar must expose an accessible name: a visible label or an aria attribute. */
|
|
65
|
+
type ProgressLabellingProps = {
|
|
66
|
+
label: ReactNode;
|
|
67
|
+
} | {
|
|
68
|
+
label?: never;
|
|
69
|
+
"aria-label": string;
|
|
70
|
+
} | {
|
|
71
|
+
label?: never;
|
|
72
|
+
"aria-labelledby": string;
|
|
73
|
+
};
|
|
74
|
+
type ProgressProps = ProgressBaseProps & ProgressLabellingProps;
|
|
75
|
+
/**
|
|
76
|
+
* Linear indicator for the status of a long-running task, built on Base UI's
|
|
77
|
+
* Progress. `value` fills the track (the width transition is motion-safe);
|
|
78
|
+
* omitting it renders the indeterminate sweep, which degrades to an opacity
|
|
79
|
+
* pulse under reduced motion so the bar never looks stalled. `min`, `max`,
|
|
80
|
+
* `format`, `locale`, `aria-valuetext`, and `getAriaValueText` pass through
|
|
81
|
+
* to Base UI's Root; `data-progressing` / `data-complete` /
|
|
82
|
+
* `data-indeterminate` are available as styling hooks. Linear only — for
|
|
83
|
+
* spinner-style ambient waits use AILoader.
|
|
84
|
+
*/
|
|
85
|
+
declare const Progress$1: import("react").ForwardRefExoticComponent<ProgressProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
86
|
+
//#endregion
|
|
87
|
+
export { Progress$1 as Progress, ProgressIndicatorVariantsOptions, ProgressProps, ProgressSize, ProgressTrackVariantsOptions, ProgressVariant, progressIndicatorVariants, progressTrackVariants };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { cn } from "../../lib/cn.js";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Progress } from "@base-ui/react/progress";
|
|
5
|
+
//#region src/components/Progress/Progress.tsx
|
|
6
|
+
const rootClasses = "flex w-full flex-col gap-1.5";
|
|
7
|
+
const headerClasses = "flex items-baseline gap-2";
|
|
8
|
+
const labelClasses = "font-sans text-sm font-medium text-foreground";
|
|
9
|
+
const valueClasses = "ms-auto font-sans text-sm text-muted-foreground tabular-nums";
|
|
10
|
+
const trackClasses = "relative w-full overflow-hidden rounded-full bg-muted";
|
|
11
|
+
const trackSizeClasses = {
|
|
12
|
+
sm: "h-1",
|
|
13
|
+
md: "h-2",
|
|
14
|
+
lg: "h-3"
|
|
15
|
+
};
|
|
16
|
+
const indicatorClasses = "h-full rounded-full motion-safe:transition-[width] motion-safe:duration-500 motion-safe:data-indeterminate:w-2/5 motion-safe:data-indeterminate:animate-progress-indeterminate motion-safe:data-indeterminate:will-change-transform motion-reduce:data-indeterminate:w-full motion-reduce:data-indeterminate:animate-pulse";
|
|
17
|
+
const indicatorVariantClasses = {
|
|
18
|
+
primary: "bg-primary",
|
|
19
|
+
success: "bg-success",
|
|
20
|
+
warning: "bg-warning-700",
|
|
21
|
+
destructive: "bg-destructive"
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Class list for an element styled as a Progress track.
|
|
25
|
+
*
|
|
26
|
+
* Pair with `progressIndicatorVariants()` to build layouts the flattened
|
|
27
|
+
* component doesn't cover — e.g. a stacked storage bar. Such a composite is
|
|
28
|
+
* one image to assistive technology, so name the whole thing:
|
|
29
|
+
*
|
|
30
|
+
* <div role="img" aria-label="Storage: documents 45%, media 21%"
|
|
31
|
+
* className={progressTrackVariants({ size: "lg" })}>
|
|
32
|
+
* <div className="flex h-full gap-px">
|
|
33
|
+
* <div className={progressIndicatorVariants({ className: "rounded-none" })} style={{ width: "45%" }} />
|
|
34
|
+
* <div className={progressIndicatorVariants({ variant: "success", className: "rounded-none" })} style={{ width: "21%" }} />
|
|
35
|
+
* </div>
|
|
36
|
+
* </div>
|
|
37
|
+
*/
|
|
38
|
+
function progressTrackVariants({ size = "md", className } = {}) {
|
|
39
|
+
return cn(trackClasses, trackSizeClasses[size], className);
|
|
40
|
+
}
|
|
41
|
+
/** Class list for an element styled as a Progress fill — see `progressTrackVariants`. */
|
|
42
|
+
function progressIndicatorVariants({ variant = "primary", className } = {}) {
|
|
43
|
+
return cn(indicatorClasses, indicatorVariantClasses[variant], className);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Linear indicator for the status of a long-running task, built on Base UI's
|
|
47
|
+
* Progress. `value` fills the track (the width transition is motion-safe);
|
|
48
|
+
* omitting it renders the indeterminate sweep, which degrades to an opacity
|
|
49
|
+
* pulse under reduced motion so the bar never looks stalled. `min`, `max`,
|
|
50
|
+
* `format`, `locale`, `aria-valuetext`, and `getAriaValueText` pass through
|
|
51
|
+
* to Base UI's Root; `data-progressing` / `data-complete` /
|
|
52
|
+
* `data-indeterminate` are available as styling hooks. Linear only — for
|
|
53
|
+
* spinner-style ambient waits use AILoader.
|
|
54
|
+
*/
|
|
55
|
+
const Progress$1 = forwardRef(({ value = null, size = "md", variant = "primary", label, showValue = false, className, ...rest }, ref) => /* @__PURE__ */ jsxs(Progress.Root, {
|
|
56
|
+
ref,
|
|
57
|
+
value,
|
|
58
|
+
className: cn(rootClasses, className),
|
|
59
|
+
...rest,
|
|
60
|
+
children: [(label != null || showValue) && /* @__PURE__ */ jsxs("div", {
|
|
61
|
+
className: headerClasses,
|
|
62
|
+
children: [label != null && /* @__PURE__ */ jsx(Progress.Label, {
|
|
63
|
+
className: labelClasses,
|
|
64
|
+
children: label
|
|
65
|
+
}), showValue && /* @__PURE__ */ jsx(Progress.Value, { className: valueClasses })]
|
|
66
|
+
}), /* @__PURE__ */ jsx(Progress.Track, {
|
|
67
|
+
className: progressTrackVariants({ size }),
|
|
68
|
+
children: /* @__PURE__ */ jsx(Progress.Indicator, { className: progressIndicatorVariants({ variant }) })
|
|
69
|
+
})]
|
|
70
|
+
}));
|
|
71
|
+
Progress$1.displayName = "Progress";
|
|
72
|
+
//#endregion
|
|
73
|
+
export { Progress$1 as Progress, progressIndicatorVariants, progressTrackVariants };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Progress, ProgressIndicatorVariantsOptions, ProgressProps, ProgressSize, ProgressTrackVariantsOptions, ProgressVariant, progressIndicatorVariants, progressTrackVariants } from "./Progress.js";
|
|
2
|
+
export { Progress, type ProgressIndicatorVariantsOptions, type ProgressProps, type ProgressSize, type ProgressTrackVariantsOptions, type ProgressVariant, progressIndicatorVariants, progressTrackVariants };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { Radio } from "@base-ui/react/radio";
|
|
3
|
+
import { RadioGroup } from "@base-ui/react/radio-group";
|
|
4
|
+
//#region src/components/Radio/Radio.d.ts
|
|
5
|
+
type RadioSize = "sm" | "md" | "lg";
|
|
6
|
+
interface RadioVariantsOptions {
|
|
7
|
+
size?: RadioSize;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Class list for the radio circle itself. State styling hangs off Base UI's
|
|
12
|
+
* data-attributes (`data-checked`, `data-disabled`, `data-readonly`,
|
|
13
|
+
* `data-invalid`) plus `aria-invalid` — useful when styling a sibling of the
|
|
14
|
+
* radio (e.g. a selection card) with the same look.
|
|
15
|
+
*/
|
|
16
|
+
declare function radioVariants({ size, className }?: RadioVariantsOptions): string;
|
|
17
|
+
interface RadioProps extends Omit<ComponentPropsWithoutRef<typeof Radio.Root>, "className"> {
|
|
18
|
+
/**
|
|
19
|
+
* Circle size. The 24px `lg` circle meets the WCAG 2.5.8 target-size floor
|
|
20
|
+
* on its own; `sm`/`md` rely on the clickable `label` (or surrounding
|
|
21
|
+
* spacing) to extend the target. Prefer `md`+ with a label on touch-first
|
|
22
|
+
* surfaces.
|
|
23
|
+
*/
|
|
24
|
+
size?: RadioSize;
|
|
25
|
+
/**
|
|
26
|
+
* Visible option label rendered in an enclosing `<label>`, so clicking it
|
|
27
|
+
* selects the radio and it names the option. Without it, provide an
|
|
28
|
+
* accessible name another way: `aria-label`, `aria-labelledby`, or an
|
|
29
|
+
* external `<label>`. Unlike Checkbox, `required` adds no asterisk here —
|
|
30
|
+
* a radio option is never required by itself; mark the group caption
|
|
31
|
+
* instead.
|
|
32
|
+
*/
|
|
33
|
+
label?: ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* Supporting copy below the label, linked via `aria-describedby`. Rendered
|
|
36
|
+
* outside the `<label>` element so screen readers announce it as the
|
|
37
|
+
* description instead of reading it into the accessible name.
|
|
38
|
+
*/
|
|
39
|
+
description?: ReactNode;
|
|
40
|
+
/** Applied to the radio circle itself, also when `label`/`description` wrap it. */
|
|
41
|
+
className?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* One option of a `RadioGroup`, built on Base UI's Radio. The indicator dot
|
|
45
|
+
* is built in and animates behind `motion-safe`. `ref` and `className`
|
|
46
|
+
* always target the circle element, whether or not the labelled layout
|
|
47
|
+
* wraps it. Radios only function inside a `RadioGroup`.
|
|
48
|
+
*/
|
|
49
|
+
declare const Radio$1: import("react").ForwardRefExoticComponent<RadioProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
50
|
+
interface RadioGroupProps extends Omit<ComponentPropsWithoutRef<typeof RadioGroup>, "className"> {
|
|
51
|
+
className?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Holds the single selected value (`value`/`defaultValue`/`onValueChange`)
|
|
55
|
+
* shared by child radios matched by their `value` prop, and submits it in
|
|
56
|
+
* forms via `name`. `disabled`, `readOnly`, and `required` apply group-wide.
|
|
57
|
+
* Lays the options out as a vertical stack — pass `className="flex-row"` for
|
|
58
|
+
* a horizontal row (arrow keys move the selection either way). The group
|
|
59
|
+
* needs an accessible name: `aria-labelledby` pointing at a caption, or
|
|
60
|
+
* `aria-label`; when the choice is required, mark that caption — not the
|
|
61
|
+
* individual options.
|
|
62
|
+
*/
|
|
63
|
+
declare const RadioGroup$1: import("react").ForwardRefExoticComponent<RadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
64
|
+
//#endregion
|
|
65
|
+
export { Radio$1 as Radio, RadioGroup$1 as RadioGroup, RadioGroupProps, RadioProps, RadioSize, RadioVariantsOptions, radioVariants };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { cn } from "../../lib/cn.js";
|
|
2
|
+
import { forwardRef, useId } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Radio } from "@base-ui/react/radio";
|
|
5
|
+
import { RadioGroup } from "@base-ui/react/radio-group";
|
|
6
|
+
//#region src/components/Radio/Radio.tsx
|
|
7
|
+
const circleClasses = "inline-flex shrink-0 cursor-pointer select-none items-center justify-center rounded-full border border-border bg-background text-primary-foreground transition-colors duration-150 hover:border-slate-300 data-checked:border-primary data-checked:bg-primary hover:data-checked:border-primary-700 hover:data-checked:bg-primary-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring aria-invalid:border-destructive data-invalid:border-destructive aria-invalid:focus-visible:outline-destructive data-invalid:focus-visible:outline-destructive data-readonly:cursor-default disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50";
|
|
8
|
+
const circleSizeClasses = {
|
|
9
|
+
sm: "size-4",
|
|
10
|
+
md: "size-5",
|
|
11
|
+
lg: "size-6"
|
|
12
|
+
};
|
|
13
|
+
const dotSizeClasses = {
|
|
14
|
+
sm: "size-1.5",
|
|
15
|
+
md: "size-2",
|
|
16
|
+
lg: "size-2.5"
|
|
17
|
+
};
|
|
18
|
+
const circleOffsetClasses = {
|
|
19
|
+
sm: "mt-0.5",
|
|
20
|
+
md: "",
|
|
21
|
+
lg: ""
|
|
22
|
+
};
|
|
23
|
+
const labelTextClasses = {
|
|
24
|
+
sm: "text-sm",
|
|
25
|
+
md: "text-sm",
|
|
26
|
+
lg: "text-base"
|
|
27
|
+
};
|
|
28
|
+
const descriptionTextClasses = {
|
|
29
|
+
sm: "text-xs ps-6",
|
|
30
|
+
md: "text-xs ps-7",
|
|
31
|
+
lg: "text-sm ps-8"
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Class list for the radio circle itself. State styling hangs off Base UI's
|
|
35
|
+
* data-attributes (`data-checked`, `data-disabled`, `data-readonly`,
|
|
36
|
+
* `data-invalid`) plus `aria-invalid` — useful when styling a sibling of the
|
|
37
|
+
* radio (e.g. a selection card) with the same look.
|
|
38
|
+
*/
|
|
39
|
+
function radioVariants({ size = "md", className } = {}) {
|
|
40
|
+
return cn(circleClasses, circleSizeClasses[size], className);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* One option of a `RadioGroup`, built on Base UI's Radio. The indicator dot
|
|
44
|
+
* is built in and animates behind `motion-safe`. `ref` and `className`
|
|
45
|
+
* always target the circle element, whether or not the labelled layout
|
|
46
|
+
* wraps it. Radios only function inside a `RadioGroup`.
|
|
47
|
+
*/
|
|
48
|
+
const Radio$1 = forwardRef(({ size = "md", label, description, className, "aria-describedby": ariaDescribedBy, ...rest }, ref) => {
|
|
49
|
+
const descriptionId = useId();
|
|
50
|
+
const hasLabel = label != null;
|
|
51
|
+
const hasText = hasLabel || description != null;
|
|
52
|
+
const control = /* @__PURE__ */ jsx(Radio.Root, {
|
|
53
|
+
ref,
|
|
54
|
+
"aria-describedby": [ariaDescribedBy, description != null ? descriptionId : void 0].filter(Boolean).join(" ") || void 0,
|
|
55
|
+
className: cn(radioVariants({ size }), hasText && "data-disabled:opacity-100", hasLabel && circleOffsetClasses[size], className),
|
|
56
|
+
...rest,
|
|
57
|
+
children: /* @__PURE__ */ jsx(Radio.Indicator, { className: cn("rounded-full bg-current", "motion-safe:transition-[scale,opacity] motion-safe:duration-200 motion-safe:ease-[cubic-bezier(0.34,1.56,0.64,1)]", "motion-safe:data-starting-style:scale-0 motion-safe:data-starting-style:opacity-0", "motion-safe:data-ending-style:scale-0 motion-safe:data-ending-style:opacity-0", "motion-safe:data-ending-style:duration-100 motion-safe:data-ending-style:ease-in", dotSizeClasses[size]) })
|
|
58
|
+
});
|
|
59
|
+
if (!hasText) return control;
|
|
60
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
61
|
+
className: cn("inline-flex max-w-full flex-col gap-1 font-sans", "has-data-disabled:pointer-events-none has-data-disabled:opacity-50"),
|
|
62
|
+
children: [hasLabel ? /* @__PURE__ */ jsxs("label", {
|
|
63
|
+
className: cn("inline-flex cursor-pointer items-start gap-2", "has-data-readonly:cursor-default"),
|
|
64
|
+
children: [control, /* @__PURE__ */ jsx("span", {
|
|
65
|
+
className: cn("font-medium text-foreground select-none", labelTextClasses[size]),
|
|
66
|
+
children: label
|
|
67
|
+
})]
|
|
68
|
+
}) : control, description != null && /* @__PURE__ */ jsx("span", {
|
|
69
|
+
id: descriptionId,
|
|
70
|
+
className: cn("text-muted-foreground", descriptionTextClasses[size]),
|
|
71
|
+
children: description
|
|
72
|
+
})]
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
Radio$1.displayName = "Radio";
|
|
76
|
+
/**
|
|
77
|
+
* Holds the single selected value (`value`/`defaultValue`/`onValueChange`)
|
|
78
|
+
* shared by child radios matched by their `value` prop, and submits it in
|
|
79
|
+
* forms via `name`. `disabled`, `readOnly`, and `required` apply group-wide.
|
|
80
|
+
* Lays the options out as a vertical stack — pass `className="flex-row"` for
|
|
81
|
+
* a horizontal row (arrow keys move the selection either way). The group
|
|
82
|
+
* needs an accessible name: `aria-labelledby` pointing at a caption, or
|
|
83
|
+
* `aria-label`; when the choice is required, mark that caption — not the
|
|
84
|
+
* individual options.
|
|
85
|
+
*/
|
|
86
|
+
const RadioGroup$1 = forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx(RadioGroup, {
|
|
87
|
+
ref,
|
|
88
|
+
className: cn("flex flex-col items-start gap-3", className),
|
|
89
|
+
...rest
|
|
90
|
+
}));
|
|
91
|
+
RadioGroup$1.displayName = "RadioGroup";
|
|
92
|
+
//#endregion
|
|
93
|
+
export { Radio$1 as Radio, RadioGroup$1 as RadioGroup, radioVariants };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { CSSProperties, ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { Select } from "@base-ui/react/select";
|
|
3
|
+
//#region src/components/Select/Select.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Groups the select parts and owns value + popup state. This is Base UI's
|
|
6
|
+
* `Select.Root` re-exported unchanged, so every root feature is available:
|
|
7
|
+
* `value`/`defaultValue`/`onValueChange(value, details)`, `multiple`,
|
|
8
|
+
* `items` (lets `SelectValue` display labels instead of raw values),
|
|
9
|
+
* `name`/`required`/`disabled`/`readOnly` form wiring, and object values via
|
|
10
|
+
* `isItemEqualToValue`/`itemToStringLabel`/`itemToStringValue`.
|
|
11
|
+
*/
|
|
12
|
+
declare const Select$1: typeof Select.Root;
|
|
13
|
+
type SelectProps<Value = unknown, Multiple extends boolean | undefined = false> = Select.Root.Props<Value, Multiple>;
|
|
14
|
+
interface SelectLabelProps extends Omit<ComponentPropsWithoutRef<typeof Select.Label>, "className"> {
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Visible label for the select — Base UI associates it with the trigger
|
|
19
|
+
* automatically, and clicking it focuses the trigger without opening the
|
|
20
|
+
* popup. Renders a `<div>`. When no visible label is rendered, give the
|
|
21
|
+
* trigger an accessible name with `aria-label` instead.
|
|
22
|
+
*/
|
|
23
|
+
declare const SelectLabel: import("react").ForwardRefExoticComponent<SelectLabelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
24
|
+
type SelectTriggerVariant = "outline" | "ghost";
|
|
25
|
+
type SelectTriggerSize = "sm" | "md" | "lg";
|
|
26
|
+
type BaseTriggerProps = ComponentPropsWithoutRef<typeof Select.Trigger>;
|
|
27
|
+
interface SelectTriggerVariantsOptions {
|
|
28
|
+
variant?: SelectTriggerVariant;
|
|
29
|
+
size?: SelectTriggerSize;
|
|
30
|
+
fullWidth?: boolean;
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Class list for an element styled as the select trigger — for select-shaped
|
|
35
|
+
* controls that don't come from Base UI (custom comboboxes, fake dropdowns
|
|
36
|
+
* in previews) so every value-picker in the product shares one look.
|
|
37
|
+
*/
|
|
38
|
+
declare function selectTriggerVariants({ variant, size, fullWidth, className }?: SelectTriggerVariantsOptions): string;
|
|
39
|
+
interface SelectTriggerProps extends Omit<BaseTriggerProps, "className"> {
|
|
40
|
+
/** Visual style: `outline` is the input-like default; `ghost` is borderless for toolbars and dense inline filters. */
|
|
41
|
+
variant?: SelectTriggerVariant;
|
|
42
|
+
/** Control height. `sm` (32px) meets the WCAG 2.5.8 AA target-size floor; prefer `md`/`lg` for touch-first surfaces. */
|
|
43
|
+
size?: SelectTriggerSize;
|
|
44
|
+
/** Stretch to fill the container width — the usual setting inside form layouts. `anchorWidth` takes precedence when both are set. */
|
|
45
|
+
fullWidth?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* CSS width of the trigger (the popup anchor). Accepts a number in pixels
|
|
48
|
+
* or any CSS width such as `"14rem"`, `"100%"`, or `"max-content"`.
|
|
49
|
+
* `"max-content"` keeps the control only as wide as the selected value,
|
|
50
|
+
* padding, and icon; the popup still grows when an option needs more room.
|
|
51
|
+
* A consumer `style.width` can override this convenience prop.
|
|
52
|
+
*/
|
|
53
|
+
anchorWidth?: CSSProperties["width"];
|
|
54
|
+
/** Replaces the dropdown chevron. Decorative — hidden from assistive technology. */
|
|
55
|
+
icon?: ReactNode;
|
|
56
|
+
className?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The button that shows the current value and opens the popup. Place a
|
|
60
|
+
* `SelectValue` inside it and the dropdown chevron is appended
|
|
61
|
+
* automatically. The trigger's accessible name comes from a sibling
|
|
62
|
+
* `SelectLabel` (or a composed `Field.Label`); without one, pass
|
|
63
|
+
* `aria-label`.
|
|
64
|
+
*/
|
|
65
|
+
declare const SelectTrigger: import("react").ForwardRefExoticComponent<SelectTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
66
|
+
interface SelectValueProps extends Omit<ComponentPropsWithoutRef<typeof Select.Value>, "className"> {
|
|
67
|
+
className?: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The selected value's text inside the trigger. Set `placeholder` for the
|
|
71
|
+
* empty state (rendered muted). With `items` on the root it shows the
|
|
72
|
+
* matching label instead of the raw value; pass a function as `children`
|
|
73
|
+
* to format the value yourself — the multi-select "+N more" pattern lives
|
|
74
|
+
* there.
|
|
75
|
+
*/
|
|
76
|
+
declare const SelectValue: import("react").ForwardRefExoticComponent<SelectValueProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
77
|
+
type BasePositionerProps = ComponentPropsWithoutRef<typeof Select.Positioner>;
|
|
78
|
+
type SelectAlign = NonNullable<BasePositionerProps["align"]>;
|
|
79
|
+
interface SelectPopupProps extends Omit<ComponentPropsWithoutRef<typeof Select.Popup>, "className"> {
|
|
80
|
+
/** How the popup lines up along the trigger's bottom (or top) edge. */
|
|
81
|
+
align?: SelectAlign;
|
|
82
|
+
/** Gap between trigger and popup in pixels. */
|
|
83
|
+
sideOffset?: BasePositionerProps["sideOffset"];
|
|
84
|
+
/** Additional shift along the alignment axis in pixels. */
|
|
85
|
+
alignOffset?: BasePositionerProps["alignOffset"];
|
|
86
|
+
/** Minimum space kept from the viewport (or collision boundary) edges when repositioning. */
|
|
87
|
+
collisionPadding?: BasePositionerProps["collisionPadding"];
|
|
88
|
+
/**
|
|
89
|
+
* Caps the popup's height so long lists scroll inside it — a number is
|
|
90
|
+
* pixels, a string is any CSS length. Whatever the value, the popup never
|
|
91
|
+
* exceeds the space between the trigger and the viewport edge.
|
|
92
|
+
*/
|
|
93
|
+
maxHeight?: number | string;
|
|
94
|
+
/** Portal destination. Defaults to `document.body`. */
|
|
95
|
+
container?: ComponentPropsWithoutRef<typeof Select.Portal>["container"];
|
|
96
|
+
/**
|
|
97
|
+
* Applied to the popup panel. Width hooks: the panel is at least as wide
|
|
98
|
+
* as the trigger — set `w-[var(--anchor-width)]` to match it exactly or
|
|
99
|
+
* `w-*`/`max-w-*` for a fixed width. Cap height with the `maxHeight` prop.
|
|
100
|
+
*/
|
|
101
|
+
className?: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The floating option list, with the portal, positioning, list, and
|
|
105
|
+
* hover-scroll arrow plumbing folded in. Always drops below the trigger and
|
|
106
|
+
* flips above it only when the space below runs out — never sideways. Long
|
|
107
|
+
* lists scroll inside the popup, up to `maxHeight`.
|
|
108
|
+
*/
|
|
109
|
+
declare const SelectPopup: import("react").ForwardRefExoticComponent<SelectPopupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
110
|
+
interface SelectItemProps extends Omit<ComponentPropsWithoutRef<typeof Select.Item>, "className"> {
|
|
111
|
+
className?: string;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* One option in the popup. Children render as the option's label (wrapped in
|
|
115
|
+
* Base UI's `ItemText`); a check mark appears at the item's right edge while
|
|
116
|
+
* selected. Set `label` when children aren't plain text so keyboard
|
|
117
|
+
* typeahead has something to match, and `disabled` for unavailable options.
|
|
118
|
+
*/
|
|
119
|
+
declare const SelectItem: import("react").ForwardRefExoticComponent<SelectItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
120
|
+
interface SelectGroupProps extends Omit<ComponentPropsWithoutRef<typeof Select.Group>, "className"> {
|
|
121
|
+
className?: string;
|
|
122
|
+
}
|
|
123
|
+
/** Groups related options under a `SelectGroupLabel`, announced together by assistive technology. */
|
|
124
|
+
declare const SelectGroup: import("react").ForwardRefExoticComponent<SelectGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
125
|
+
interface SelectGroupLabelProps extends Omit<ComponentPropsWithoutRef<typeof Select.GroupLabel>, "className"> {
|
|
126
|
+
className?: string;
|
|
127
|
+
}
|
|
128
|
+
/** Heading for a `SelectGroup` — visually a meta caption, wired to the group via `aria-labelledby`. */
|
|
129
|
+
declare const SelectGroupLabel: import("react").ForwardRefExoticComponent<SelectGroupLabelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
130
|
+
interface SelectSeparatorProps extends Omit<ComponentPropsWithoutRef<typeof Select.Separator>, "className"> {
|
|
131
|
+
className?: string;
|
|
132
|
+
}
|
|
133
|
+
/** Divider between option groups, exposed to screen readers as a separator. */
|
|
134
|
+
declare const SelectSeparator: import("react").ForwardRefExoticComponent<SelectSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
135
|
+
//#endregion
|
|
136
|
+
export { Select$1 as Select, SelectAlign, SelectGroup, SelectGroupLabel, SelectGroupLabelProps, SelectGroupProps, SelectItem, SelectItemProps, SelectLabel, SelectLabelProps, SelectPopup, SelectPopupProps, SelectProps, SelectSeparator, SelectSeparatorProps, SelectTrigger, SelectTriggerProps, SelectTriggerSize, SelectTriggerVariant, SelectTriggerVariantsOptions, SelectValue, SelectValueProps, selectTriggerVariants };
|