@forte-ui/react 1.0.0-alpha.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/README.md +240 -0
- package/dist/Accordion-9JunkjgY.js +111 -0
- package/dist/Alert-Cn_WUF3L.js +183 -0
- package/dist/AspectRatio-gSjpTVk-.js +39 -0
- package/dist/Avatar-BuitDluH.js +87 -0
- package/dist/Badge-sArNWMre.js +33 -0
- package/dist/Breadcrumb-Cq7tFtMX.js +170 -0
- package/dist/Button-AiyKnx5I.js +42 -0
- package/dist/ButtonGroup-C-CrwPXP.js +54 -0
- package/dist/Calendar-D7Q-QJ_e.js +503 -0
- package/dist/Checkbox-DfNbmOed.js +56 -0
- package/dist/Collapsible-D8UKiGip.js +86 -0
- package/dist/ColorPicker-B-eCI31W.js +612 -0
- package/dist/Combobox-D-BN-Tvp.js +302 -0
- package/dist/ContextMenu-D81uDaMG.js +44 -0
- package/dist/DatePicker-CfkMsaI-.js +192 -0
- package/dist/Dialog-_n8FpFs5.js +432 -0
- package/dist/Drawer-DKQF3OO7.js +158 -0
- package/dist/Field-FLFEO70D.js +58 -0
- package/dist/Fieldset-CYhh71Qt.js +28 -0
- package/dist/Form-DVPmW9XV.js +17 -0
- package/dist/Input-BgGWhO2q.js +18 -0
- package/dist/InputGroup-DsZyDXNn.js +89 -0
- package/dist/Menu-CKu9xE2h.js +261 -0
- package/dist/Menubar-Dax027Db.js +19 -0
- package/dist/NavList-DGvcIoJm.js +176 -0
- package/dist/NavigationMenu-BayQkUUb.js +209 -0
- package/dist/NumberField-P55SA8T7.js +191 -0
- package/dist/OTPField-CjHvBNSN.js +55 -0
- package/dist/Popover-BXhn2Wwt.js +142 -0
- package/dist/PreviewCard-Dnitrky0.js +99 -0
- package/dist/Progress-BlomDp-X.js +81 -0
- package/dist/ProgressCircle-j6XBl0fk.js +112 -0
- package/dist/Radio-BIcX4INJ.js +37 -0
- package/dist/Resizable-7nJJM97e.js +609 -0
- package/dist/ScrollArea-CBMGJ6hh.js +83 -0
- package/dist/Select-BP-zvdXm.js +237 -0
- package/dist/Separator-DewJBzaJ.js +21 -0
- package/dist/Skeleton-zr6ObCCq.js +79 -0
- package/dist/Slider-Bh8_cti1.js +104 -0
- package/dist/Spinner-BF0uD4hR.js +53 -0
- package/dist/Switch-OBewMMvM.js +39 -0
- package/dist/Tabs-LgkSbPSF.js +132 -0
- package/dist/Textarea-CqZJL41e.js +51 -0
- package/dist/Toast-BWayxAcd.js +304 -0
- package/dist/Toggle-BrhMnkF5.js +45 -0
- package/dist/Toolbar-OmOVCk3i.js +88 -0
- package/dist/Tooltip-CI4chsRw.js +101 -0
- package/dist/clsx-By2n9mTe.js +16 -0
- package/dist/cn.d.ts +8 -0
- package/dist/cn.js +11 -0
- package/dist/components/accordion/Accordion.d.ts +117 -0
- package/dist/components/accordion/Accordion.js +3 -0
- package/dist/components/accordion/index.d.ts +2 -0
- package/dist/components/accordion/index.js +2 -0
- package/dist/components/alert/Alert.d.ts +167 -0
- package/dist/components/alert/Alert.js +3 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert/index.js +2 -0
- package/dist/components/aspect-ratio/AspectRatio.d.ts +128 -0
- package/dist/components/aspect-ratio/AspectRatio.js +3 -0
- package/dist/components/aspect-ratio/index.d.ts +2 -0
- package/dist/components/aspect-ratio/index.js +2 -0
- package/dist/components/avatar/Avatar.d.ts +176 -0
- package/dist/components/avatar/Avatar.js +3 -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 +117 -0
- package/dist/components/badge/Badge.js +3 -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 +244 -0
- package/dist/components/breadcrumb/Breadcrumb.js +3 -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 +73 -0
- package/dist/components/button/Button.js +3 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.js +2 -0
- package/dist/components/button-group/ButtonGroup.d.ts +113 -0
- package/dist/components/button-group/ButtonGroup.js +3 -0
- package/dist/components/button-group/index.d.ts +2 -0
- package/dist/components/button-group/index.js +2 -0
- package/dist/components/calendar/Calendar.d.ts +201 -0
- package/dist/components/calendar/Calendar.js +3 -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 +130 -0
- package/dist/components/checkbox/Checkbox.js +3 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/index.js +2 -0
- package/dist/components/collapsible/Collapsible.d.ts +91 -0
- package/dist/components/collapsible/Collapsible.js +3 -0
- package/dist/components/collapsible/index.d.ts +2 -0
- package/dist/components/collapsible/index.js +2 -0
- package/dist/components/color-picker/ColorPicker.d.ts +553 -0
- package/dist/components/color-picker/ColorPicker.js +4 -0
- package/dist/components/color-picker/color.d.ts +102 -0
- package/dist/components/color-picker/color.js +249 -0
- package/dist/components/color-picker/index.d.ts +2 -0
- package/dist/components/color-picker/index.js +3 -0
- package/dist/components/combobox/Combobox.d.ts +553 -0
- package/dist/components/combobox/Combobox.js +3 -0
- package/dist/components/combobox/index.d.ts +2 -0
- package/dist/components/combobox/index.js +2 -0
- package/dist/components/context-menu/ContextMenu.d.ts +103 -0
- package/dist/components/context-menu/ContextMenu.js +3 -0
- package/dist/components/context-menu/index.d.ts +3 -0
- package/dist/components/context-menu/index.js +2 -0
- package/dist/components/date-picker/DatePicker.d.ts +268 -0
- package/dist/components/date-picker/DatePicker.js +3 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-picker/index.js +2 -0
- package/dist/components/dialog/Dialog.d.ts +567 -0
- package/dist/components/dialog/Dialog.js +3 -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 +351 -0
- package/dist/components/drawer/Drawer.js +3 -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 +170 -0
- package/dist/components/field/Field.js +3 -0
- package/dist/components/field/index.d.ts +2 -0
- package/dist/components/field/index.js +2 -0
- package/dist/components/fieldset/Fieldset.d.ts +60 -0
- package/dist/components/fieldset/Fieldset.js +3 -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 +76 -0
- package/dist/components/form/Form.js +3 -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 +67 -0
- package/dist/components/input/Input.js +3 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/index.js +2 -0
- package/dist/components/input-group/InputGroup.d.ts +214 -0
- package/dist/components/input-group/InputGroup.js +3 -0
- package/dist/components/input-group/index.d.ts +2 -0
- package/dist/components/input-group/index.js +2 -0
- package/dist/components/menu/Menu.d.ts +587 -0
- package/dist/components/menu/Menu.js +3 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/index.js +2 -0
- package/dist/components/menubar/Menubar.d.ts +104 -0
- package/dist/components/menubar/Menubar.js +3 -0
- package/dist/components/menubar/index.d.ts +2 -0
- package/dist/components/menubar/index.js +2 -0
- package/dist/components/nav-list/NavList.d.ts +290 -0
- package/dist/components/nav-list/NavList.js +3 -0
- package/dist/components/nav-list/index.d.ts +2 -0
- package/dist/components/nav-list/index.js +2 -0
- package/dist/components/navigation-menu/NavigationMenu.d.ts +483 -0
- package/dist/components/navigation-menu/NavigationMenu.js +3 -0
- package/dist/components/navigation-menu/index.d.ts +2 -0
- package/dist/components/navigation-menu/index.js +2 -0
- package/dist/components/number-field/NumberField.d.ts +303 -0
- package/dist/components/number-field/NumberField.js +3 -0
- package/dist/components/number-field/index.d.ts +2 -0
- package/dist/components/number-field/index.js +2 -0
- package/dist/components/otp-field/OTPField.d.ts +206 -0
- package/dist/components/otp-field/OTPField.js +3 -0
- package/dist/components/otp-field/index.d.ts +2 -0
- package/dist/components/otp-field/index.js +2 -0
- package/dist/components/popover/Popover.d.ts +394 -0
- package/dist/components/popover/Popover.js +3 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/index.js +2 -0
- package/dist/components/preview-card/PreviewCard.d.ts +307 -0
- package/dist/components/preview-card/PreviewCard.js +3 -0
- package/dist/components/preview-card/index.d.ts +2 -0
- package/dist/components/preview-card/index.js +2 -0
- package/dist/components/progress/Progress.d.ts +156 -0
- package/dist/components/progress/Progress.js +3 -0
- package/dist/components/progress/ProgressCircle.d.ts +166 -0
- package/dist/components/progress/ProgressCircle.js +3 -0
- package/dist/components/progress/index.d.ts +4 -0
- package/dist/components/progress/index.js +3 -0
- package/dist/components/radio/Radio.d.ts +144 -0
- package/dist/components/radio/Radio.js +3 -0
- package/dist/components/radio/index.d.ts +2 -0
- package/dist/components/radio/index.js +2 -0
- package/dist/components/resizable/Resizable.d.ts +211 -0
- package/dist/components/resizable/Resizable.js +3 -0
- package/dist/components/resizable/index.d.ts +2 -0
- package/dist/components/resizable/index.js +2 -0
- package/dist/components/scroll-area/ScrollArea.d.ts +113 -0
- package/dist/components/scroll-area/ScrollArea.js +3 -0
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/index.js +2 -0
- package/dist/components/select/Select.d.ts +345 -0
- package/dist/components/select/Select.js +3 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/index.js +2 -0
- package/dist/components/separator/Separator.d.ts +75 -0
- package/dist/components/separator/Separator.js +3 -0
- package/dist/components/separator/index.d.ts +2 -0
- package/dist/components/separator/index.js +2 -0
- package/dist/components/skeleton/Skeleton.d.ts +169 -0
- package/dist/components/skeleton/Skeleton.js +3 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/index.js +2 -0
- package/dist/components/slider/Slider.d.ts +208 -0
- package/dist/components/slider/Slider.js +3 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/index.js +2 -0
- package/dist/components/spinner/Spinner.d.ts +92 -0
- package/dist/components/spinner/Spinner.js +3 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/spinner/index.js +2 -0
- package/dist/components/switch/Switch.d.ts +80 -0
- package/dist/components/switch/Switch.js +3 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/index.js +2 -0
- package/dist/components/tabs/Tabs.d.ts +125 -0
- package/dist/components/tabs/Tabs.js +3 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tabs/index.js +2 -0
- package/dist/components/textarea/Textarea.d.ts +119 -0
- package/dist/components/textarea/Textarea.js +3 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/index.js +2 -0
- package/dist/components/toast/Toast.d.ts +517 -0
- package/dist/components/toast/Toast.js +3 -0
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toast/index.js +2 -0
- package/dist/components/toggle/Toggle.d.ts +171 -0
- package/dist/components/toggle/Toggle.js +3 -0
- package/dist/components/toggle/index.d.ts +2 -0
- package/dist/components/toggle/index.js +2 -0
- package/dist/components/toolbar/Toolbar.d.ts +318 -0
- package/dist/components/toolbar/Toolbar.js +3 -0
- package/dist/components/toolbar/index.d.ts +2 -0
- package/dist/components/toolbar/index.js +2 -0
- package/dist/components/tooltip/Tooltip.d.ts +361 -0
- package/dist/components/tooltip/Tooltip.js +3 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.js +2 -0
- package/dist/index.d.ts +92 -0
- package/dist/index.js +86 -0
- package/dist/styles/Accordion.css +1 -0
- package/dist/styles/Alert.css +1 -0
- package/dist/styles/AspectRatio.css +1 -0
- package/dist/styles/Avatar.css +1 -0
- package/dist/styles/Badge.css +1 -0
- package/dist/styles/Breadcrumb.css +1 -0
- package/dist/styles/Button.css +1 -0
- package/dist/styles/ButtonGroup.css +1 -0
- package/dist/styles/Calendar.css +1 -0
- package/dist/styles/Checkbox.css +1 -0
- package/dist/styles/Collapsible.css +1 -0
- package/dist/styles/ColorPicker.css +1 -0
- package/dist/styles/Combobox.css +1 -0
- package/dist/styles/ContextMenu.css +1 -0
- package/dist/styles/DatePicker.css +1 -0
- package/dist/styles/Dialog.css +1 -0
- package/dist/styles/Drawer.css +1 -0
- package/dist/styles/Field.css +1 -0
- package/dist/styles/Fieldset.css +1 -0
- package/dist/styles/Form.css +1 -0
- package/dist/styles/Input.css +1 -0
- package/dist/styles/InputGroup.css +1 -0
- package/dist/styles/Menu.css +1 -0
- package/dist/styles/Menubar.css +1 -0
- package/dist/styles/NavList.css +1 -0
- package/dist/styles/NavigationMenu.css +1 -0
- package/dist/styles/NumberField.css +1 -0
- package/dist/styles/OTPField.css +1 -0
- package/dist/styles/Popover.css +1 -0
- package/dist/styles/PreviewCard.css +1 -0
- package/dist/styles/Progress.css +1 -0
- package/dist/styles/ProgressCircle.css +1 -0
- package/dist/styles/Radio.css +1 -0
- package/dist/styles/Resizable.css +1 -0
- package/dist/styles/ScrollArea.css +1 -0
- package/dist/styles/Select.css +1 -0
- package/dist/styles/Separator.css +1 -0
- package/dist/styles/Skeleton.css +1 -0
- package/dist/styles/Slider.css +1 -0
- package/dist/styles/Spinner.css +1 -0
- package/dist/styles/Switch.css +1 -0
- package/dist/styles/Tabs.css +1 -0
- package/dist/styles/Textarea.css +1 -0
- package/dist/styles/Toast.css +1 -0
- package/dist/styles/Toggle.css +1 -0
- package/dist/styles/Toolbar.css +1 -0
- package/dist/styles/Tooltip.css +1 -0
- package/dist/styles/a11y.css +119 -0
- package/dist/styles/layers.css +39 -0
- package/dist/styles/motion.css +194 -0
- package/dist/styles/patterns.css +236 -0
- package/dist/styles/properties.css +62 -0
- package/dist/styles/reset.css +11 -0
- package/dist/styles/tailwind.css +281 -0
- package/dist/styles/theme.css +57 -0
- package/dist/styles/tokens.color.css +223 -0
- package/dist/styles/tokens.css +460 -0
- package/dist/tailwind-merge.d.ts +52 -0
- package/dist/tailwind-merge.js +52 -0
- package/docs-data/props.json +8047 -0
- package/docs-data/theming.json +9600 -0
- package/docs-data/tokens.json +4070 -0
- package/package.json +78 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type BadgeVariant = "solid" | "soft" | "outline" | "ghost";
|
|
4
|
+
export type BadgeTone = "primary" | "secondary" | "neutral" | "danger" | "success" | "warning" | "info";
|
|
5
|
+
export type BadgeSize = "sm" | "md" | "lg";
|
|
6
|
+
export type BadgeShape = "rounded" | "pill";
|
|
7
|
+
export interface BadgeProps extends Omit<React.ComponentPropsWithoutRef<"span">, "className"> {
|
|
8
|
+
/**
|
|
9
|
+
* How much visual weight the badge carries.
|
|
10
|
+
*
|
|
11
|
+
* `soft` is the default because a badge annotates something else on the
|
|
12
|
+
* page and should not outrank it — a row of solid chips down a table column
|
|
13
|
+
* reads as the content rather than as labels on it. Reach for `solid` when
|
|
14
|
+
* the badge IS the message, which is usually a count or a single alarm.
|
|
15
|
+
* @default "soft"
|
|
16
|
+
*/
|
|
17
|
+
variant?: BadgeVariant;
|
|
18
|
+
/**
|
|
19
|
+
* Which semantic colour set the badge draws from. Combines freely with
|
|
20
|
+
* `variant` — every pairing is a complete colour set, so
|
|
21
|
+
* `tone="success" variant="outline"` needs nothing added to work.
|
|
22
|
+
*
|
|
23
|
+
* The four status tones are the reason this component has seven rather than
|
|
24
|
+
* the four `Button` has: a badge is where an app says "Active", "Pending",
|
|
25
|
+
* "Failed", and an app that has to reach for a hex value to say it has lost
|
|
26
|
+
* theming, dark mode and forced-colors support in one line.
|
|
27
|
+
* @default "primary"
|
|
28
|
+
*/
|
|
29
|
+
tone?: BadgeTone;
|
|
30
|
+
/**
|
|
31
|
+
* Size of the badge. The three differ mostly in how much air surrounds the
|
|
32
|
+
* label: the type scale bottoms out at `--forte-font-size-1`, so `sm` and
|
|
33
|
+
* `md` share it and `lg` steps up.
|
|
34
|
+
*
|
|
35
|
+
* Unlike a control, a badge is not resized by `data-forte-density` — its
|
|
36
|
+
* height comes from the text it sits beside, which is the thing it should
|
|
37
|
+
* track.
|
|
38
|
+
* @default "md"
|
|
39
|
+
*/
|
|
40
|
+
size?: BadgeSize;
|
|
41
|
+
/**
|
|
42
|
+
* Corner treatment. `rounded` follows `--forte-radius-control`, so it moves
|
|
43
|
+
* with a `data-forte-radius` preset like everything else; `pill` is fully
|
|
44
|
+
* round, which is the conventional shape for a count.
|
|
45
|
+
* @default "rounded"
|
|
46
|
+
*/
|
|
47
|
+
shape?: BadgeShape;
|
|
48
|
+
/**
|
|
49
|
+
* Draw a small filled dot before the label — the status-chip convention.
|
|
50
|
+
*
|
|
51
|
+
* It is decorative and `aria-hidden`: the status is in the words. A dot
|
|
52
|
+
* that carried meaning on its own would be colour as the sole cue, which is
|
|
53
|
+
* the failure (SC 1.4.1) this component is otherwise careful to avoid.
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
dot?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The number this badge is showing — an unread tally, a pending count.
|
|
59
|
+
*
|
|
60
|
+
* Passing it does two separate things. It renders the number (capped by
|
|
61
|
+
* `max`), and it switches the badge to count geometry: figures stop changing
|
|
62
|
+
* width as the tally ticks over, the inline padding tightens, and the badge
|
|
63
|
+
* takes a minimum inline size equal to its own height. That last pair is
|
|
64
|
+
* what makes a single digit a circle rather than a slot — with a word's
|
|
65
|
+
* padding, `1` already measures wider than the badge is tall.
|
|
66
|
+
*
|
|
67
|
+
* `children` still win over the rendered number, and that is the hook for
|
|
68
|
+
* anything `max` cannot express: `<Badge count={1240}>1.2k</Badge>` keeps
|
|
69
|
+
* your formatting and the geometry both.
|
|
70
|
+
*/
|
|
71
|
+
count?: number;
|
|
72
|
+
/**
|
|
73
|
+
* The largest number `count` will print. Above it the badge shows
|
|
74
|
+
* `${max}+` instead, so a tally cannot widen the chip without limit.
|
|
75
|
+
*
|
|
76
|
+
* 99 matches what a notification badge conventionally does. Pass
|
|
77
|
+
* `Infinity` to print the number whatever it reaches.
|
|
78
|
+
* @default 99
|
|
79
|
+
*/
|
|
80
|
+
max?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Replaces the rendered `<span>` with another element or component.
|
|
83
|
+
* `render={<a href="/releases" />}` or `render={<Link href="/inbox" />}` is
|
|
84
|
+
* how a badge becomes navigable.
|
|
85
|
+
*
|
|
86
|
+
* There is no `interactive` prop to go with it: the styles read the element
|
|
87
|
+
* itself, so an `<a href>` or a `<button>` picks up the pointer cursor, the
|
|
88
|
+
* hover wash and a 24×24 hit target on its own, and a plain `<span>` never
|
|
89
|
+
* pretends to be clickable.
|
|
90
|
+
*/
|
|
91
|
+
render?: useRender.RenderProp;
|
|
92
|
+
/**
|
|
93
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
94
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
95
|
+
*/
|
|
96
|
+
className?: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* A small label for status, counts and categories.
|
|
100
|
+
*
|
|
101
|
+
* Base UI has no badge primitive — there is no interaction to model and no
|
|
102
|
+
* state machine to get right — so this is built on `useRender` alone, which is
|
|
103
|
+
* what gives it the `render` prop the rest of the library has.
|
|
104
|
+
*
|
|
105
|
+
* ```tsx
|
|
106
|
+
* <Badge>Beta</Badge>
|
|
107
|
+
* <Badge tone="success" dot>Active</Badge>
|
|
108
|
+
* <Badge variant="solid" tone="danger" shape="pill" count={12} />
|
|
109
|
+
* <Badge variant="solid" tone="danger" shape="pill" count={480} /> // 99+
|
|
110
|
+
* <Badge tone="neutral" variant="outline" render={<a href="/tags/css" />}>css</Badge>
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* Styling is driven by `data-*` attributes and `--forte-badge-*` custom
|
|
114
|
+
* properties, so it can be re-skinned from plain CSS or targeted with Tailwind
|
|
115
|
+
* arbitrary variants (`data-[tone=success]:...`) without wrapping.
|
|
116
|
+
*/
|
|
117
|
+
export declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type BreadcrumbSize = "sm" | "md" | "lg";
|
|
4
|
+
export type BreadcrumbVariant = "plain" | "chip";
|
|
5
|
+
export type BreadcrumbOverflow = "wrap" | "scroll";
|
|
6
|
+
export interface BreadcrumbRootProps extends Omit<React.ComponentPropsWithoutRef<"nav">, "className"> {
|
|
7
|
+
/**
|
|
8
|
+
* Text size, crumb padding and separator size for the whole trail.
|
|
9
|
+
* @default "md"
|
|
10
|
+
*/
|
|
11
|
+
size?: BreadcrumbSize;
|
|
12
|
+
/**
|
|
13
|
+
* How loud the crumbs are. `"plain"` is text that underlines on hover.
|
|
14
|
+
* `"chip"` gives every crumb a rounded fill — a hover tint on the links and
|
|
15
|
+
* a resting one on the current page, which is what you want when the trail
|
|
16
|
+
* sits on a busy toolbar rather than above a document.
|
|
17
|
+
* @default "plain"
|
|
18
|
+
*/
|
|
19
|
+
variant?: BreadcrumbVariant;
|
|
20
|
+
/**
|
|
21
|
+
* What to draw between crumbs. Any node — a `/`, a `·`, an icon. Set once
|
|
22
|
+
* here and every gap in the trail uses it; a `Breadcrumb.Separator` written
|
|
23
|
+
* by hand with its own children still wins locally.
|
|
24
|
+
* @default a chevron
|
|
25
|
+
*/
|
|
26
|
+
separator?: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* What a trail too long for its container does. `"wrap"` lets it run onto a
|
|
29
|
+
* second line. `"scroll"` keeps it on one line in a horizontal scroller
|
|
30
|
+
* that starts scrolled to the current page — the end of the trail is the
|
|
31
|
+
* part a reader needs, and it is the part that falls off the edge.
|
|
32
|
+
* @default "wrap"
|
|
33
|
+
*/
|
|
34
|
+
overflow?: BreadcrumbOverflow;
|
|
35
|
+
/**
|
|
36
|
+
* Replaces the rendered `<nav>` with another element or component — pass
|
|
37
|
+
* `render={<div />}` when the trail sits inside a `<nav>` landmark you
|
|
38
|
+
* already own, so the page does not grow a second one.
|
|
39
|
+
*/
|
|
40
|
+
render?: useRender.RenderProp;
|
|
41
|
+
/**
|
|
42
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
43
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
44
|
+
*/
|
|
45
|
+
className?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The trail container. Renders a `<nav aria-label="Breadcrumb">`.
|
|
49
|
+
*
|
|
50
|
+
* ```tsx
|
|
51
|
+
* <Breadcrumb.Root>
|
|
52
|
+
* <Breadcrumb.List>
|
|
53
|
+
* <Breadcrumb.Item>
|
|
54
|
+
* <Breadcrumb.Link href="/">Home</Breadcrumb.Link>
|
|
55
|
+
* </Breadcrumb.Item>
|
|
56
|
+
* <Breadcrumb.Item>
|
|
57
|
+
* <Breadcrumb.Page>Invoices</Breadcrumb.Page>
|
|
58
|
+
* </Breadcrumb.Item>
|
|
59
|
+
* </Breadcrumb.List>
|
|
60
|
+
* </Breadcrumb.Root>
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* The label is what tells this landmark apart from the page's other
|
|
64
|
+
* navigation landmarks in a screen reader's landmark list, so it is set by
|
|
65
|
+
* default rather than left to be forgotten. Override it if the page carries
|
|
66
|
+
* more than one trail.
|
|
67
|
+
*/
|
|
68
|
+
export declare const BreadcrumbRoot: React.ForwardRefExoticComponent<BreadcrumbRootProps & React.RefAttributes<HTMLElement>>;
|
|
69
|
+
export interface BreadcrumbListProps extends Omit<React.ComponentPropsWithoutRef<"ol">, "className"> {
|
|
70
|
+
/**
|
|
71
|
+
* Insert a `Breadcrumb.Separator` between every pair of children. On by
|
|
72
|
+
* default — hand-interleaving separators is the step everyone forgets, and
|
|
73
|
+
* a trail is the one place where the count is always "one fewer than the
|
|
74
|
+
* items". Turning it off leaves the children exactly as written.
|
|
75
|
+
*
|
|
76
|
+
* Writing even one `Breadcrumb.Separator` by hand also turns it off for
|
|
77
|
+
* that list, so the two styles never double up.
|
|
78
|
+
* @default true
|
|
79
|
+
*/
|
|
80
|
+
separators?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
83
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
84
|
+
*/
|
|
85
|
+
className?: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The `<ol>` holding the crumbs. An ordered list on purpose: the trail's
|
|
89
|
+
* meaning *is* the order, and a screen reader announcing "list, 4 items" tells
|
|
90
|
+
* the reader how deep they are before they walk it.
|
|
91
|
+
*
|
|
92
|
+
* It interleaves the separators itself. `React.Children.toArray` flattens the
|
|
93
|
+
* array a `.map()` produces, so a generated trail gets them too — and `null`
|
|
94
|
+
* children are dropped before the count is taken, which is what keeps a
|
|
95
|
+
* conditionally rendered crumb from leaving a separator pointing at nothing.
|
|
96
|
+
*
|
|
97
|
+
* Under the root's `overflow="scroll"` it also wraps itself in a
|
|
98
|
+
* `ScrollArea` — see the `scroller` note below.
|
|
99
|
+
*/
|
|
100
|
+
export declare const BreadcrumbList: React.ForwardRefExoticComponent<BreadcrumbListProps & React.RefAttributes<HTMLOListElement>>;
|
|
101
|
+
export interface BreadcrumbItemProps extends Omit<React.ComponentPropsWithoutRef<"li">, "className"> {
|
|
102
|
+
/**
|
|
103
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
104
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
105
|
+
*/
|
|
106
|
+
className?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* One crumb's `<li>`. Structural — the `Link`, `Page` or `Ellipsis` inside it
|
|
110
|
+
* is what the reader sees.
|
|
111
|
+
*/
|
|
112
|
+
export declare const BreadcrumbItem: React.ForwardRefExoticComponent<BreadcrumbItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
113
|
+
export interface BreadcrumbLinkProps extends Omit<React.ComponentPropsWithoutRef<"a">, "className"> {
|
|
114
|
+
/**
|
|
115
|
+
* Replaces the rendered `<a>` with another element or component —
|
|
116
|
+
* `render={<Link href="/invoices" />}` is how a framework's router link goes
|
|
117
|
+
* in without losing the crumb's styling and states.
|
|
118
|
+
*/
|
|
119
|
+
render?: useRender.RenderProp;
|
|
120
|
+
/**
|
|
121
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
122
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
123
|
+
*/
|
|
124
|
+
className?: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* An ancestor crumb — a real `<a>`, so it opens in a new tab, shows its target
|
|
128
|
+
* in the status bar and is found by every keyboard the platform ships.
|
|
129
|
+
*
|
|
130
|
+
* Children lay out on a flex row, so an icon in front of the label needs no
|
|
131
|
+
* wrapper and rides `currentColor` through rest and hover.
|
|
132
|
+
*/
|
|
133
|
+
export declare const BreadcrumbLink: React.ForwardRefExoticComponent<BreadcrumbLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
134
|
+
export interface BreadcrumbPageProps extends Omit<React.ComponentPropsWithoutRef<"span">, "className"> {
|
|
135
|
+
/**
|
|
136
|
+
* Replaces the rendered `<span>` with another element or component.
|
|
137
|
+
*/
|
|
138
|
+
render?: useRender.RenderProp;
|
|
139
|
+
/**
|
|
140
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
141
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
142
|
+
*/
|
|
143
|
+
className?: string;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* The last crumb: where the reader is. Renders a `<span aria-current="page">`.
|
|
147
|
+
*
|
|
148
|
+
* Deliberately not a link. A link to the page you are already on is a control
|
|
149
|
+
* that does nothing, and the trail's whole job at this position is to say
|
|
150
|
+
* "here" — `aria-current` says it in the accessibility tree, and the weight
|
|
151
|
+
* and colour change say it on screen, so the cue is never colour alone.
|
|
152
|
+
*/
|
|
153
|
+
export declare const BreadcrumbPage: React.ForwardRefExoticComponent<BreadcrumbPageProps & React.RefAttributes<HTMLSpanElement>>;
|
|
154
|
+
export interface BreadcrumbSeparatorProps extends Omit<React.ComponentPropsWithoutRef<"li">, "className"> {
|
|
155
|
+
/**
|
|
156
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
157
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
158
|
+
*/
|
|
159
|
+
className?: string;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* The mark between two crumbs. `Breadcrumb.List` inserts these for you — write
|
|
163
|
+
* one by hand only to give a single gap its own content, which also switches
|
|
164
|
+
* that list to fully manual so the two never double up.
|
|
165
|
+
*
|
|
166
|
+
* Renders an `<li role="presentation" aria-hidden="true">`: it is punctuation,
|
|
167
|
+
* and a screen reader reading "greater than" between every crumb is noise. The
|
|
168
|
+
* `role` also keeps it out of the list's item count, so "list, 4 items" stays
|
|
169
|
+
* the number of crumbs.
|
|
170
|
+
*/
|
|
171
|
+
export declare const BreadcrumbSeparator: React.ForwardRefExoticComponent<BreadcrumbSeparatorProps & React.RefAttributes<HTMLLIElement>>;
|
|
172
|
+
export interface BreadcrumbEllipsisProps extends Omit<React.ComponentPropsWithoutRef<"span">, "className"> {
|
|
173
|
+
/**
|
|
174
|
+
* The accessible name, in a visually hidden span. Three dots have no text of
|
|
175
|
+
* their own, so without this the control is announced as "button" and
|
|
176
|
+
* nothing else. Pass `""` in the rare case where `children` is already text
|
|
177
|
+
* that names it, so the name is not said twice.
|
|
178
|
+
* @default "More"
|
|
179
|
+
*/
|
|
180
|
+
label?: string;
|
|
181
|
+
/**
|
|
182
|
+
* Replaces the rendered `<span>` with another element or component. Pass
|
|
183
|
+
* `render={<Menu.Trigger />}` to make the collapsed crumbs reachable — see
|
|
184
|
+
* the collapsed example in the docs.
|
|
185
|
+
*/
|
|
186
|
+
render?: useRender.RenderProp;
|
|
187
|
+
/**
|
|
188
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
189
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
190
|
+
*/
|
|
191
|
+
className?: string;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Stands in for the crumbs in the middle of a deep trail. Renders a `<span>`,
|
|
195
|
+
* which is inert — a trail is not the place to hide a page behind something
|
|
196
|
+
* unclickable, so reach for this WITH a menu:
|
|
197
|
+
*
|
|
198
|
+
* ```tsx
|
|
199
|
+
* <Menu.Root>
|
|
200
|
+
* <Breadcrumb.Ellipsis render={<Menu.Trigger />} label="Show 3 more" />
|
|
201
|
+
* <Menu.Popup>…</Menu.Popup>
|
|
202
|
+
* </Menu.Root>
|
|
203
|
+
* ```
|
|
204
|
+
*
|
|
205
|
+
* The stylesheet keys its cursor off the rendered element, so the span stays
|
|
206
|
+
* `default` and a `<button>` becomes `pointer` without a prop to pass.
|
|
207
|
+
*/
|
|
208
|
+
export declare const BreadcrumbEllipsis: React.ForwardRefExoticComponent<BreadcrumbEllipsisProps & React.RefAttributes<HTMLSpanElement>>;
|
|
209
|
+
/**
|
|
210
|
+
* The trail of ancestors above the current page: `Home › Settings › Billing`.
|
|
211
|
+
*
|
|
212
|
+
* ```tsx
|
|
213
|
+
* <Breadcrumb.Root>
|
|
214
|
+
* <Breadcrumb.List>
|
|
215
|
+
* <Breadcrumb.Item>
|
|
216
|
+
* <Breadcrumb.Link href="/">Home</Breadcrumb.Link>
|
|
217
|
+
* </Breadcrumb.Item>
|
|
218
|
+
* <Breadcrumb.Item>
|
|
219
|
+
* <Breadcrumb.Link href="/settings">Settings</Breadcrumb.Link>
|
|
220
|
+
* </Breadcrumb.Item>
|
|
221
|
+
* <Breadcrumb.Item>
|
|
222
|
+
* <Breadcrumb.Page>Billing</Breadcrumb.Page>
|
|
223
|
+
* </Breadcrumb.Item>
|
|
224
|
+
* </Breadcrumb.List>
|
|
225
|
+
* </Breadcrumb.Root>
|
|
226
|
+
* ```
|
|
227
|
+
*
|
|
228
|
+
* Separators are inserted by `List`, not written by hand. The last crumb is a
|
|
229
|
+
* `Page`, not a `Link` — a link to where you already are is a control that
|
|
230
|
+
* does nothing.
|
|
231
|
+
*
|
|
232
|
+
* Styling is driven entirely by `data-*` attributes and `--forte-breadcrumb-*`
|
|
233
|
+
* custom properties, so it can be re-skinned from plain CSS or targeted with
|
|
234
|
+
* Tailwind arbitrary variants (`data-[variant=chip]:...`) without wrapping.
|
|
235
|
+
*/
|
|
236
|
+
export declare const Breadcrumb: {
|
|
237
|
+
Root: React.ForwardRefExoticComponent<BreadcrumbRootProps & React.RefAttributes<HTMLElement>>;
|
|
238
|
+
List: React.ForwardRefExoticComponent<BreadcrumbListProps & React.RefAttributes<HTMLOListElement>>;
|
|
239
|
+
Item: React.ForwardRefExoticComponent<BreadcrumbItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
240
|
+
Link: React.ForwardRefExoticComponent<BreadcrumbLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
241
|
+
Page: React.ForwardRefExoticComponent<BreadcrumbPageProps & React.RefAttributes<HTMLSpanElement>>;
|
|
242
|
+
Separator: React.ForwardRefExoticComponent<BreadcrumbSeparatorProps & React.RefAttributes<HTMLLIElement>>;
|
|
243
|
+
Ellipsis: React.ForwardRefExoticComponent<BreadcrumbEllipsisProps & React.RefAttributes<HTMLSpanElement>>;
|
|
244
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../../Breadcrumb-Cq7tFtMX.js";
|
|
3
|
+
export { s as Breadcrumb, r as BreadcrumbEllipsis, a as BreadcrumbItem, n as BreadcrumbLink, e as BreadcrumbList, i as BreadcrumbPage, o as BreadcrumbRoot, t as BreadcrumbSeparator };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { Breadcrumb } from './Breadcrumb';
|
|
2
|
+
export type { BreadcrumbSize, BreadcrumbVariant, BreadcrumbOverflow, BreadcrumbRootProps, BreadcrumbListProps, BreadcrumbItemProps, BreadcrumbLinkProps, BreadcrumbPageProps, BreadcrumbSeparatorProps, BreadcrumbEllipsisProps, } from './Breadcrumb';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Button as BaseButton } from '@base-ui/react/button';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type ButtonVariant = "solid" | "soft" | "outline" | "ghost";
|
|
4
|
+
export type ButtonTone = "primary" | "secondary" | "danger" | "neutral";
|
|
5
|
+
export type ButtonSize = "sm" | "md" | "lg";
|
|
6
|
+
type BaseButtonProps = React.ComponentPropsWithoutRef<typeof BaseButton>;
|
|
7
|
+
export interface ButtonProps extends Omit<BaseButtonProps, "className"> {
|
|
8
|
+
/**
|
|
9
|
+
* How much visual weight the button carries.
|
|
10
|
+
* @default "solid"
|
|
11
|
+
*/
|
|
12
|
+
variant?: ButtonVariant;
|
|
13
|
+
/**
|
|
14
|
+
* Which semantic colour set the button draws from. Combines freely with
|
|
15
|
+
* `variant` — `tone="danger" variant="outline"` is a low-emphasis
|
|
16
|
+
* destructive action.
|
|
17
|
+
* @default "primary"
|
|
18
|
+
*/
|
|
19
|
+
tone?: ButtonTone;
|
|
20
|
+
/**
|
|
21
|
+
* Size of the button. Actual dimensions also follow the ambient
|
|
22
|
+
* `data-forte-density` setting.
|
|
23
|
+
* @default "md"
|
|
24
|
+
*/
|
|
25
|
+
size?: ButtonSize;
|
|
26
|
+
/**
|
|
27
|
+
* Stretch the button to fill the width of its container.
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
fullWidth?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Render as a square button sized for a single icon. Enforces the 24px
|
|
33
|
+
* minimum hit target from WCAG SC 2.5.8. Always pair with `aria-label`.
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
iconOnly?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Show a busy indicator and block interaction. The label keeps its space so
|
|
39
|
+
* the button cannot resize mid-interaction.
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
loading?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Announced to assistive technology while `loading` is true. Without it, a
|
|
45
|
+
* screen reader user gets no signal that anything is happening.
|
|
46
|
+
* @default "Loading"
|
|
47
|
+
*/
|
|
48
|
+
loadingLabel?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Keep the button focusable while it is disabled. A native `disabled`
|
|
51
|
+
* button is blurred by the browser, which drops focus to `<body>` and loses
|
|
52
|
+
* the user's place in the tab order — and takes `aria-busy` and
|
|
53
|
+
* `loadingLabel` out of earshot with it. Left unset, this turns itself on
|
|
54
|
+
* for the duration of `loading` so the busy state is actually announced;
|
|
55
|
+
* pass it explicitly to override.
|
|
56
|
+
* @default true while `loading`, otherwise false
|
|
57
|
+
*/
|
|
58
|
+
focusableWhenDisabled?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
61
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
62
|
+
*/
|
|
63
|
+
className?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* A button built on Base UI's unstyled `Button` primitive.
|
|
67
|
+
*
|
|
68
|
+
* Styling is driven entirely by `data-*` attributes and `--forte-button-*`
|
|
69
|
+
* custom properties, so it can be re-skinned from plain CSS or targeted with
|
|
70
|
+
* Tailwind arbitrary variants (`data-[variant=solid]:...`) without wrapping.
|
|
71
|
+
*/
|
|
72
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { Separator as BaseSeparator } from '@base-ui/react/separator';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
export type ButtonGroupOrientation = "horizontal" | "vertical";
|
|
5
|
+
type BaseSeparatorProps = React.ComponentPropsWithoutRef<typeof BaseSeparator>;
|
|
6
|
+
export interface ButtonGroupRootProps extends Omit<React.ComponentPropsWithoutRef<"div">, "className"> {
|
|
7
|
+
/**
|
|
8
|
+
* Which way the controls fuse — a row or a column. Layout only: unlike
|
|
9
|
+
* [`Toolbar`](/components/toolbar), a button group adds no keyboard
|
|
10
|
+
* behaviour, so there is no arrow-key axis to move.
|
|
11
|
+
* @default "horizontal"
|
|
12
|
+
*/
|
|
13
|
+
orientation?: ButtonGroupOrientation;
|
|
14
|
+
/**
|
|
15
|
+
* Replaces the rendered `<div>` with another element or component.
|
|
16
|
+
*/
|
|
17
|
+
render?: useRender.RenderProp;
|
|
18
|
+
/**
|
|
19
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
20
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The group container. Renders a `<div role="group">`.
|
|
26
|
+
*
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <ButtonGroup.Root aria-label="Message actions">
|
|
29
|
+
* <Button variant="outline" tone="neutral">Archive</Button>
|
|
30
|
+
* <Button variant="outline" tone="neutral">Report</Button>
|
|
31
|
+
* <Button variant="outline" tone="neutral">Snooze</Button>
|
|
32
|
+
* </ButtonGroup.Root>
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* Direct children are fused: inner corners squared, one hairline between
|
|
36
|
+
* neighbours, outer corners kept. The children stay ordinary components with
|
|
37
|
+
* their own props — the group never reaches into them beyond that edge.
|
|
38
|
+
*
|
|
39
|
+
* `role="group"` has no name of its own, so give the group `aria-label` (or
|
|
40
|
+
* point `aria-labelledby` at a heading) when the grouping carries meaning a
|
|
41
|
+
* screen reader should hear — without one it is purely visual.
|
|
42
|
+
*/
|
|
43
|
+
export declare const ButtonGroupRoot: React.ForwardRefExoticComponent<ButtonGroupRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
44
|
+
export interface ButtonGroupSeparatorProps extends Omit<BaseSeparatorProps, "className"> {
|
|
45
|
+
/**
|
|
46
|
+
* Which way the line runs. Defaults to the *opposite* of the group's
|
|
47
|
+
* orientation — a row gets vertical seams — which is almost always what you
|
|
48
|
+
* want, so leave it unset.
|
|
49
|
+
*/
|
|
50
|
+
orientation?: ButtonGroupOrientation;
|
|
51
|
+
/**
|
|
52
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
53
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
54
|
+
*/
|
|
55
|
+
className?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The seam between two fused controls that have no visible border of their
|
|
59
|
+
* own. Renders a `<div role="separator">`.
|
|
60
|
+
*
|
|
61
|
+
* Reach for it between `solid` or `soft` buttons — fused bare they read as
|
|
62
|
+
* one unbroken slab of colour. `outline` neighbours need none: their own
|
|
63
|
+
* borders already draw the seam, and a separator there doubles the line.
|
|
64
|
+
*/
|
|
65
|
+
export declare const ButtonGroupSeparator: React.ForwardRefExoticComponent<ButtonGroupSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
66
|
+
export interface ButtonGroupTextProps extends Omit<React.ComponentPropsWithoutRef<"div">, "className"> {
|
|
67
|
+
/**
|
|
68
|
+
* Replaces the rendered `<div>` with another element or component — pass
|
|
69
|
+
* `render={<label htmlFor="…" />}` when the cell names the input fused
|
|
70
|
+
* beside it, so clicking it focuses the field.
|
|
71
|
+
*/
|
|
72
|
+
render?: useRender.RenderProp;
|
|
73
|
+
/**
|
|
74
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
75
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
76
|
+
*/
|
|
77
|
+
className?: string;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* A non-interactive cell fused in with the controls — a unit, a prefix, a
|
|
81
|
+
* count. Renders a `<div>`.
|
|
82
|
+
*
|
|
83
|
+
* It has no height of its own on purpose: the group stretches it to match
|
|
84
|
+
* whatever control it sits beside, so one cell serves every size.
|
|
85
|
+
*/
|
|
86
|
+
export declare const ButtonGroupText: React.ForwardRefExoticComponent<ButtonGroupTextProps & React.RefAttributes<HTMLDivElement>>;
|
|
87
|
+
/**
|
|
88
|
+
* A set of related controls fused into one visual object: inner corners
|
|
89
|
+
* squared off, one hairline between neighbours, outer corners kept.
|
|
90
|
+
*
|
|
91
|
+
* ```tsx
|
|
92
|
+
* <ButtonGroup.Root aria-label="Pagination">
|
|
93
|
+
* <Button variant="outline" tone="neutral">Previous</Button>
|
|
94
|
+
* <Button variant="outline" tone="neutral">Next</Button>
|
|
95
|
+
* </ButtonGroup.Root>
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* Purely visual and semantic — it adds `role="group"` and the fused styling,
|
|
99
|
+
* and no keyboard behaviour: every control keeps its own tab stop. When the
|
|
100
|
+
* set should cost one Tab press instead, reach for
|
|
101
|
+
* [`Toolbar`](/components/toolbar).
|
|
102
|
+
*
|
|
103
|
+
* Styling is driven by `data-*` attributes and `--forte-button-group-*` custom
|
|
104
|
+
* properties, so it can be re-skinned from plain CSS or targeted with
|
|
105
|
+
* Tailwind arbitrary variants (`data-[orientation=vertical]:...`) without
|
|
106
|
+
* wrapping.
|
|
107
|
+
*/
|
|
108
|
+
export declare const ButtonGroup: {
|
|
109
|
+
Root: React.ForwardRefExoticComponent<ButtonGroupRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
110
|
+
Separator: React.ForwardRefExoticComponent<ButtonGroupSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
111
|
+
Text: React.ForwardRefExoticComponent<ButtonGroupTextProps & React.RefAttributes<HTMLDivElement>>;
|
|
112
|
+
};
|
|
113
|
+
export {};
|