@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,307 @@
|
|
|
1
|
+
import { PreviewCard as BasePreviewCard } from '@base-ui/react/preview-card';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type PreviewCardSize = "sm" | "md" | "lg";
|
|
4
|
+
export interface PreviewCardRootProps<Payload = unknown> extends BasePreviewCard.Root.Props<Payload> {
|
|
5
|
+
/**
|
|
6
|
+
* Whether the card is open when it first mounts. For a controlled card use
|
|
7
|
+
* `open` instead.
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
defaultOpen?: BasePreviewCard.Root.Props<Payload>["defaultOpen"];
|
|
11
|
+
/**
|
|
12
|
+
* Whether the card is currently open. Pass this together with
|
|
13
|
+
* `onOpenChange` to control the card.
|
|
14
|
+
*/
|
|
15
|
+
open?: BasePreviewCard.Root.Props<Payload>["open"];
|
|
16
|
+
/**
|
|
17
|
+
* Called when the card wants to open or close. The second argument carries
|
|
18
|
+
* the reason (`'trigger-hover'`, `'trigger-focus'`, `'trigger-press'`,
|
|
19
|
+
* `'outside-press'`, `'escape-key'`, `'imperative-action'`, `'none'`), the
|
|
20
|
+
* trigger involved, and can `cancel()` the change.
|
|
21
|
+
*/
|
|
22
|
+
onOpenChange?: BasePreviewCard.Root.Props<Payload>["onOpenChange"];
|
|
23
|
+
/**
|
|
24
|
+
* Called after the open or close transition has finished. Use this rather
|
|
25
|
+
* than a timer when work has to wait for the card to actually leave.
|
|
26
|
+
*/
|
|
27
|
+
onOpenChangeComplete?: BasePreviewCard.Root.Props<Payload>["onOpenChangeComplete"];
|
|
28
|
+
/**
|
|
29
|
+
* Imperative escape hatch. `close()` closes the card; `unmount()` forces the
|
|
30
|
+
* popup out of the DOM, for when an exit animation is driven externally.
|
|
31
|
+
*/
|
|
32
|
+
actionsRef?: BasePreviewCard.Root.Props<Payload>["actionsRef"];
|
|
33
|
+
/**
|
|
34
|
+
* Associates this card with detached triggers created through
|
|
35
|
+
* `PreviewCard.createHandle()`, so one popup can serve triggers that live
|
|
36
|
+
* elsewhere in the tree.
|
|
37
|
+
*/
|
|
38
|
+
handle?: BasePreviewCard.Root.Props<Payload>["handle"];
|
|
39
|
+
/**
|
|
40
|
+
* Which trigger the card is currently attached to, for controlled
|
|
41
|
+
* multi-trigger setups. There is no separate `onTriggerIdChange` — read the
|
|
42
|
+
* new id off `eventDetails.trigger` inside `onOpenChange`.
|
|
43
|
+
*/
|
|
44
|
+
triggerId?: BasePreviewCard.Root.Props<Payload>["triggerId"];
|
|
45
|
+
/**
|
|
46
|
+
* The initially attached trigger id. Pairs with `defaultOpen` the way
|
|
47
|
+
* `triggerId` pairs with `open`.
|
|
48
|
+
*/
|
|
49
|
+
defaultTriggerId?: BasePreviewCard.Root.Props<Payload>["defaultTriggerId"];
|
|
50
|
+
/**
|
|
51
|
+
* The trigger and popup for this card. May also be a render function
|
|
52
|
+
* receiving `{ payload }` from the trigger that opened it.
|
|
53
|
+
*/
|
|
54
|
+
children?: BasePreviewCard.Root.Props<Payload>["children"];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Groups one preview card's trigger and popup, and owns its open state.
|
|
58
|
+
* Renders no DOM element, so it takes no `className`, `style` or `ref`.
|
|
59
|
+
*/
|
|
60
|
+
declare function PreviewCardRoot<Payload = unknown>(props: PreviewCardRootProps<Payload>): React.JSX.Element;
|
|
61
|
+
export interface PreviewCardTriggerProps<Payload = unknown> extends Omit<BasePreviewCard.Trigger.Props<Payload>, "className"> {
|
|
62
|
+
/**
|
|
63
|
+
* Where the link goes. Not optional in practice: the card is an enrichment
|
|
64
|
+
* of a link, and an `<a>` without `href` is neither focusable nor
|
|
65
|
+
* announced as a link — so leaving it off strands every keyboard user,
|
|
66
|
+
* who is also the one person for whom the card is not the point.
|
|
67
|
+
*/
|
|
68
|
+
href?: BasePreviewCard.Trigger.Props<Payload>["href"];
|
|
69
|
+
/**
|
|
70
|
+
* How long the pointer must rest on the link before the card opens, in
|
|
71
|
+
* milliseconds. Also the wait before a focused link opens it.
|
|
72
|
+
* @default 600
|
|
73
|
+
*/
|
|
74
|
+
delay?: BasePreviewCard.Trigger.Props<Payload>["delay"];
|
|
75
|
+
/**
|
|
76
|
+
* How long the card lingers after the pointer leaves, in milliseconds. The
|
|
77
|
+
* pointer only has to reach the popup within this window along a direct
|
|
78
|
+
* path — Base UI grants the diagonal — so this is the tolerance for
|
|
79
|
+
* overshooting, not the whole journey.
|
|
80
|
+
* @default 300
|
|
81
|
+
*/
|
|
82
|
+
closeDelay?: BasePreviewCard.Trigger.Props<Payload>["closeDelay"];
|
|
83
|
+
/**
|
|
84
|
+
* Associates a detached trigger with the `PreviewCard.Root` carrying the
|
|
85
|
+
* same handle, created once outside render with
|
|
86
|
+
* `PreviewCard.createHandle()`.
|
|
87
|
+
*/
|
|
88
|
+
handle?: BasePreviewCard.Trigger.Props<Payload>["handle"];
|
|
89
|
+
/**
|
|
90
|
+
* Data handed to the card when this trigger opens it, so one popup can
|
|
91
|
+
* render a different profile per link. Read it from the render-function
|
|
92
|
+
* form of `PreviewCard.Root`'s children.
|
|
93
|
+
*/
|
|
94
|
+
payload?: BasePreviewCard.Trigger.Props<Payload>["payload"];
|
|
95
|
+
/**
|
|
96
|
+
* Identifies the trigger. Also how `PreviewCard.Root`'s `triggerId` names
|
|
97
|
+
* the active trigger in controlled multi-trigger mode.
|
|
98
|
+
*/
|
|
99
|
+
id?: BasePreviewCard.Trigger.Props<Payload>["id"];
|
|
100
|
+
/**
|
|
101
|
+
* Replaces the rendered `<a>` with another element or component —
|
|
102
|
+
* `render={<Link href="/u/ada" />}` for a router link is the common case.
|
|
103
|
+
* The trigger's own link styling steps aside when this is present, so the
|
|
104
|
+
* two never fight over the cascade.
|
|
105
|
+
*/
|
|
106
|
+
render?: BasePreviewCard.Trigger.Props<Payload>["render"];
|
|
107
|
+
/**
|
|
108
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
109
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
110
|
+
*/
|
|
111
|
+
className?: string;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* `React.forwardRef` erases generics, so the exported value is re-typed with a
|
|
115
|
+
* generic call signature — the same shape Base UI itself exports — to keep
|
|
116
|
+
* `payload` and `handle` inferring together.
|
|
117
|
+
*/
|
|
118
|
+
interface PreviewCardTriggerComponent {
|
|
119
|
+
<Payload>(props: PreviewCardTriggerProps<Payload> & React.RefAttributes<HTMLAnchorElement>): React.JSX.Element;
|
|
120
|
+
}
|
|
121
|
+
type PositionerProps = BasePreviewCard.Positioner.Props;
|
|
122
|
+
export interface PreviewCardPopupProps extends Omit<BasePreviewCard.Popup.Props, "className"> {
|
|
123
|
+
/**
|
|
124
|
+
* Width cap for the card. The card shrinks to fit its content and only grows
|
|
125
|
+
* to this width when the content asks for it, so this is a ceiling rather
|
|
126
|
+
* than a fixed measure. Further clamped to the space the positioner reports
|
|
127
|
+
* as available.
|
|
128
|
+
* @default "md"
|
|
129
|
+
*/
|
|
130
|
+
size?: PreviewCardSize;
|
|
131
|
+
/**
|
|
132
|
+
* Which side of the link to place the card on. Flips automatically to avoid
|
|
133
|
+
* collisions. `"inline-start"` / `"inline-end"` follow writing direction.
|
|
134
|
+
* @default "bottom"
|
|
135
|
+
*/
|
|
136
|
+
side?: PositionerProps["side"];
|
|
137
|
+
/**
|
|
138
|
+
* How the card lines up with the link along the chosen side.
|
|
139
|
+
* @default "center"
|
|
140
|
+
*/
|
|
141
|
+
align?: PositionerProps["align"];
|
|
142
|
+
/**
|
|
143
|
+
* Gap between link and card, in pixels, or a function returning one. When an
|
|
144
|
+
* `Arrow` is rendered this must exceed the arrow's height or the arrow
|
|
145
|
+
* overlaps the link; the default leaves room for the default arrow.
|
|
146
|
+
*
|
|
147
|
+
* It is also the gap the pointer crosses on its way in. Base UI covers the
|
|
148
|
+
* trip with a safe polygon, so a wider offset is safe — but it is the one
|
|
149
|
+
* number that makes the card feel out of reach if it grows much past the
|
|
150
|
+
* text it belongs to.
|
|
151
|
+
* @default 8
|
|
152
|
+
*/
|
|
153
|
+
sideOffset?: PositionerProps["sideOffset"];
|
|
154
|
+
/**
|
|
155
|
+
* Shifts the card along the alignment axis, in pixels, or a function
|
|
156
|
+
* returning one.
|
|
157
|
+
* @default 0
|
|
158
|
+
*/
|
|
159
|
+
alignOffset?: PositionerProps["alignOffset"];
|
|
160
|
+
/**
|
|
161
|
+
* Minimum distance, in pixels, the arrow keeps from the card's corners
|
|
162
|
+
* before it is allowed to sit off-centre (`data-uncentered`).
|
|
163
|
+
* @default 5
|
|
164
|
+
*/
|
|
165
|
+
arrowPadding?: PositionerProps["arrowPadding"];
|
|
166
|
+
/**
|
|
167
|
+
* The element the card positions against, when it should not be the link.
|
|
168
|
+
* Accepts an element, a ref, a getter, or a virtual element.
|
|
169
|
+
*/
|
|
170
|
+
anchor?: PositionerProps["anchor"];
|
|
171
|
+
/**
|
|
172
|
+
* The boundary the card tries to stay inside of.
|
|
173
|
+
* @default "clipping-ancestors"
|
|
174
|
+
*/
|
|
175
|
+
collisionBoundary?: PositionerProps["collisionBoundary"];
|
|
176
|
+
/**
|
|
177
|
+
* Space, in pixels, kept between the card and the collision boundary.
|
|
178
|
+
* @default 5
|
|
179
|
+
*/
|
|
180
|
+
collisionPadding?: PositionerProps["collisionPadding"];
|
|
181
|
+
/**
|
|
182
|
+
* How the card reacts when it would overflow the boundary — whether it
|
|
183
|
+
* flips, shifts, or stays put.
|
|
184
|
+
*/
|
|
185
|
+
collisionAvoidance?: PositionerProps["collisionAvoidance"];
|
|
186
|
+
/**
|
|
187
|
+
* Keeps the card glued to the link while it scrolls out of view instead of
|
|
188
|
+
* letting it detach.
|
|
189
|
+
* @default false
|
|
190
|
+
*/
|
|
191
|
+
sticky?: PositionerProps["sticky"];
|
|
192
|
+
/**
|
|
193
|
+
* Whether the card is positioned with `position: absolute` or
|
|
194
|
+
* `position: fixed`.
|
|
195
|
+
* @default "absolute"
|
|
196
|
+
*/
|
|
197
|
+
positionMethod?: PositionerProps["positionMethod"];
|
|
198
|
+
/**
|
|
199
|
+
* Stops the card re-measuring the anchor on scroll and resize. Cheaper, but
|
|
200
|
+
* the card drifts if the anchor moves.
|
|
201
|
+
* @default false
|
|
202
|
+
*/
|
|
203
|
+
disableAnchorTracking?: PositionerProps["disableAnchorTracking"];
|
|
204
|
+
/**
|
|
205
|
+
* Keeps the portal — and therefore the card — in the DOM while it is closed.
|
|
206
|
+
* Needed when something inside must stay mounted (an iframe, a media
|
|
207
|
+
* element).
|
|
208
|
+
* @default false
|
|
209
|
+
*/
|
|
210
|
+
keepMounted?: BasePreviewCard.Portal.Props["keepMounted"];
|
|
211
|
+
/**
|
|
212
|
+
* Where the portal renders. Defaults to `document.body`; point it at a
|
|
213
|
+
* container when the card has to live inside a specific stacking or shadow
|
|
214
|
+
* root.
|
|
215
|
+
*/
|
|
216
|
+
container?: BasePreviewCard.Portal.Props["container"];
|
|
217
|
+
/**
|
|
218
|
+
* Additional class name(s) for the positioner element, which owns placement
|
|
219
|
+
* and `z-index`. Use it to re-stack a single card through
|
|
220
|
+
* `--forte-preview-card-z-index`.
|
|
221
|
+
*/
|
|
222
|
+
positionerClassName?: string;
|
|
223
|
+
/**
|
|
224
|
+
* Forwarded to the popup element.
|
|
225
|
+
*/
|
|
226
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
227
|
+
/**
|
|
228
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
229
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
230
|
+
*/
|
|
231
|
+
className?: string;
|
|
232
|
+
}
|
|
233
|
+
export interface PreviewCardArrowProps extends Omit<BasePreviewCard.Arrow.Props, "className"> {
|
|
234
|
+
/**
|
|
235
|
+
* Replaces the built-in wedge. The default SVG inherits the card's colours
|
|
236
|
+
* through `--forte-preview-card-bg`, so a custom skin usually needs nothing
|
|
237
|
+
* here.
|
|
238
|
+
*/
|
|
239
|
+
children?: React.ReactNode;
|
|
240
|
+
/**
|
|
241
|
+
* Forwarded to the arrow element.
|
|
242
|
+
*/
|
|
243
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
244
|
+
/**
|
|
245
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
246
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
247
|
+
*/
|
|
248
|
+
className?: string;
|
|
249
|
+
}
|
|
250
|
+
export interface PreviewCardViewportProps extends Omit<BasePreviewCard.Viewport.Props, "className"> {
|
|
251
|
+
/**
|
|
252
|
+
* The content that changes from link to link.
|
|
253
|
+
*/
|
|
254
|
+
children?: BasePreviewCard.Viewport.Props["children"];
|
|
255
|
+
/**
|
|
256
|
+
* Forwarded to the viewport element.
|
|
257
|
+
*/
|
|
258
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
259
|
+
/**
|
|
260
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
261
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
262
|
+
*/
|
|
263
|
+
className?: string;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* A card that previews where a link goes, revealed by resting on it. Built on
|
|
267
|
+
* Base UI's unstyled `PreviewCard` primitive.
|
|
268
|
+
*
|
|
269
|
+
* ```tsx
|
|
270
|
+
* <PreviewCard.Root>
|
|
271
|
+
* <PreviewCard.Trigger href="/u/ada">@ada</PreviewCard.Trigger>
|
|
272
|
+
* <PreviewCard.Popup>
|
|
273
|
+
* <PreviewCard.Arrow />
|
|
274
|
+
* …
|
|
275
|
+
* </PreviewCard.Popup>
|
|
276
|
+
* </PreviewCard.Root>
|
|
277
|
+
* ```
|
|
278
|
+
*
|
|
279
|
+
* ## Preview card, popover, or tooltip?
|
|
280
|
+
*
|
|
281
|
+
* All three are anchored surfaces; what separates them is who the content is
|
|
282
|
+
* for and how it is reached.
|
|
283
|
+
*
|
|
284
|
+
* - A `PreviewCard` enriches a **link**. It opens on hover or focus after a
|
|
285
|
+
* long delay, it is not announced, and it can hold a whole layout — but only
|
|
286
|
+
* as a summary of the destination, because a keyboard user never enters it.
|
|
287
|
+
* - A `Popover` is for content that **matters**: announced, tabbable, and
|
|
288
|
+
* openable by touch. Anything the user has to read or act on goes here.
|
|
289
|
+
* - A `Tooltip` labels a control that already does something else.
|
|
290
|
+
*
|
|
291
|
+
* The test is what happens if the surface never appears. A preview card that
|
|
292
|
+
* would be missed is a popover in the wrong component.
|
|
293
|
+
*
|
|
294
|
+
* Styling is driven by `data-*` attributes and `--forte-preview-card-*` custom
|
|
295
|
+
* properties, so it can be re-skinned from plain CSS or targeted with Tailwind
|
|
296
|
+
* arbitrary variants (`data-[side=top]:...`) without wrapping.
|
|
297
|
+
*/
|
|
298
|
+
export declare const PreviewCard: {
|
|
299
|
+
Root: typeof PreviewCardRoot;
|
|
300
|
+
Trigger: PreviewCardTriggerComponent;
|
|
301
|
+
Popup: React.ForwardRefExoticComponent<Omit<PreviewCardPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
302
|
+
Arrow: React.ForwardRefExoticComponent<Omit<PreviewCardArrowProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
303
|
+
Viewport: React.ForwardRefExoticComponent<Omit<PreviewCardViewportProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
304
|
+
/** Creates a handle that connects a `PreviewCard.Root` to detached triggers. */
|
|
305
|
+
createHandle: typeof BasePreviewCard.createHandle;
|
|
306
|
+
};
|
|
307
|
+
export {};
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { Progress as BaseProgress } from '@base-ui/react/progress';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type ProgressSize = "sm" | "md" | "lg";
|
|
4
|
+
export type ProgressTone = "primary" | "secondary" | "success" | "warning" | "danger" | "neutral";
|
|
5
|
+
type BaseRootProps = React.ComponentPropsWithoutRef<typeof BaseProgress.Root>;
|
|
6
|
+
export interface ProgressRootProps extends Omit<BaseRootProps, "className"> {
|
|
7
|
+
/**
|
|
8
|
+
* Thickness of the bar and the size of the label row — `4px`, `6px` or
|
|
9
|
+
* `10px` of track. The bar's *length* is not a size: it fills its container
|
|
10
|
+
* by default, and `--forte-progress-length` is the knob for anything else.
|
|
11
|
+
* @default "md"
|
|
12
|
+
*/
|
|
13
|
+
size?: ProgressSize;
|
|
14
|
+
/**
|
|
15
|
+
* Which semantic colour set the fill draws from. The rail stays neutral in
|
|
16
|
+
* every tone — it is the part that has *not* happened yet, and colouring it
|
|
17
|
+
* would compete with the fill it exists to contrast against.
|
|
18
|
+
* @default "primary"
|
|
19
|
+
*/
|
|
20
|
+
tone?: ProgressTone;
|
|
21
|
+
/**
|
|
22
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
23
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
24
|
+
*/
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Groups every part of the bar and owns its value. Renders a
|
|
29
|
+
* `<div role="progressbar">` laid out as a two-column grid: `Label` and
|
|
30
|
+
* `Value` share the first row, and `Track` spans both underneath.
|
|
31
|
+
*
|
|
32
|
+
* `value` is required and `null` is a meaningful setting — it is how you say
|
|
33
|
+
* "this is running and I cannot say how far along it is", which switches every
|
|
34
|
+
* part below into the indeterminate animation.
|
|
35
|
+
*
|
|
36
|
+
* ```tsx
|
|
37
|
+
* <Progress.Root value={62}>
|
|
38
|
+
* <Progress.Label>Uploading</Progress.Label>
|
|
39
|
+
* <Progress.Value />
|
|
40
|
+
* <Progress.Track>
|
|
41
|
+
* <Progress.Indicator />
|
|
42
|
+
* </Progress.Track>
|
|
43
|
+
* </Progress.Root>
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare const ProgressRoot: React.ForwardRefExoticComponent<ProgressRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
47
|
+
type BaseLabelProps = React.ComponentPropsWithoutRef<typeof BaseProgress.Label>;
|
|
48
|
+
export interface ProgressLabelProps extends Omit<BaseLabelProps, "className"> {
|
|
49
|
+
/**
|
|
50
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
51
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
52
|
+
*/
|
|
53
|
+
className?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Names what is being waited on. Renders a `<span>` wired to the root with
|
|
57
|
+
* `aria-labelledby`, so it is the bar's accessible name — a progress bar
|
|
58
|
+
* without one announces a bare percentage and leaves the listener to guess
|
|
59
|
+
* what it is a percentage of.
|
|
60
|
+
*
|
|
61
|
+
* Wrap it in `.forte-visually-hidden` when the surrounding page already says it
|
|
62
|
+
* in words; that keeps the name in the accessibility tree without repeating it
|
|
63
|
+
* on screen.
|
|
64
|
+
*/
|
|
65
|
+
export declare const ProgressLabel: React.ForwardRefExoticComponent<ProgressLabelProps & React.RefAttributes<HTMLSpanElement>>;
|
|
66
|
+
type BaseValueProps = React.ComponentPropsWithoutRef<typeof BaseProgress.Value>;
|
|
67
|
+
export interface ProgressValueProps extends Omit<BaseValueProps, "className"> {
|
|
68
|
+
/**
|
|
69
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
70
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
71
|
+
*/
|
|
72
|
+
className?: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The readout, formatted as a percentage by default. Renders an
|
|
76
|
+
* `aria-hidden` `<span>` — the root already publishes the same number through
|
|
77
|
+
* `aria-valuenow`, and announcing it twice is worse than once.
|
|
78
|
+
*
|
|
79
|
+
* It renders **nothing** while the bar is indeterminate, which is the point:
|
|
80
|
+
* there is no number to show, and a "0%" that never moves is a lie. Pass a
|
|
81
|
+
* function child to say something there instead:
|
|
82
|
+
*
|
|
83
|
+
* ```tsx
|
|
84
|
+
* <Progress.Value>
|
|
85
|
+
* {(formatted, value) => (value == null ? "Working…" : formatted)}
|
|
86
|
+
* </Progress.Value>
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* Set `format` on `Progress.Root` for units other than percent — `{ style:
|
|
90
|
+
* "unit", unit: "megabyte" }` turns the readout into "38 MB" while the bar
|
|
91
|
+
* keeps filling from `min` to `max`.
|
|
92
|
+
*/
|
|
93
|
+
export declare const ProgressValue: React.ForwardRefExoticComponent<ProgressValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
94
|
+
type BaseTrackProps = React.ComponentPropsWithoutRef<typeof BaseProgress.Track>;
|
|
95
|
+
export interface ProgressTrackProps extends Omit<BaseTrackProps, "className"> {
|
|
96
|
+
/**
|
|
97
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
98
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
99
|
+
*/
|
|
100
|
+
className?: string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The rail the fill runs along, and the only part with an explicit thickness —
|
|
104
|
+
* `Indicator` sizes its cross axis with `height: inherit`, so a track left to
|
|
105
|
+
* size itself leaves the fill with nothing to inherit and it collapses to
|
|
106
|
+
* zero.
|
|
107
|
+
*
|
|
108
|
+
* It also clips: the fill carries the same radius, so at 3% the rounded cap is
|
|
109
|
+
* cut to a sliver of the rail's own end rather than shrinking into a dot.
|
|
110
|
+
*/
|
|
111
|
+
export declare const ProgressTrack: React.ForwardRefExoticComponent<ProgressTrackProps & React.RefAttributes<HTMLDivElement>>;
|
|
112
|
+
type BaseIndicatorProps = React.ComponentPropsWithoutRef<typeof BaseProgress.Indicator>;
|
|
113
|
+
export interface ProgressIndicatorProps extends Omit<BaseIndicatorProps, "className"> {
|
|
114
|
+
/**
|
|
115
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
116
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
117
|
+
*/
|
|
118
|
+
className?: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The fill. Base UI gives it an inline `width: <percent>%` while the bar is
|
|
122
|
+
* determinate and *no* inline geometry at all while it is indeterminate, which
|
|
123
|
+
* is what lets one element be both the fill and the sweeping segment — see the
|
|
124
|
+
* note at the top of `Progress.module.css`.
|
|
125
|
+
*/
|
|
126
|
+
export declare const ProgressIndicator: React.ForwardRefExoticComponent<ProgressIndicatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
127
|
+
/**
|
|
128
|
+
* A linear progress bar built on Base UI's unstyled `Progress` primitive.
|
|
129
|
+
*
|
|
130
|
+
* ```tsx
|
|
131
|
+
* <Progress.Root value={62} tone="success">
|
|
132
|
+
* <Progress.Label>Restoring backup</Progress.Label>
|
|
133
|
+
* <Progress.Value />
|
|
134
|
+
* <Progress.Track>
|
|
135
|
+
* <Progress.Indicator />
|
|
136
|
+
* </Progress.Track>
|
|
137
|
+
* </Progress.Root>
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* Pass `value={null}` and the same markup becomes an indeterminate bar: the
|
|
141
|
+
* readout disappears, and the fill turns into a segment sweeping the rail.
|
|
142
|
+
* Nothing else about the tree changes, so a component that starts out not
|
|
143
|
+
* knowing its total can start reporting one without remounting.
|
|
144
|
+
*
|
|
145
|
+
* Reach for `ProgressCircle` where the bar's full width is not available — a
|
|
146
|
+
* button, a card corner, a tile — and for `Spinner` when the wait is short and
|
|
147
|
+
* a percentage would be noise.
|
|
148
|
+
*/
|
|
149
|
+
export declare const Progress: {
|
|
150
|
+
Root: React.ForwardRefExoticComponent<ProgressRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
151
|
+
Label: React.ForwardRefExoticComponent<ProgressLabelProps & React.RefAttributes<HTMLSpanElement>>;
|
|
152
|
+
Value: React.ForwardRefExoticComponent<ProgressValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
153
|
+
Track: React.ForwardRefExoticComponent<ProgressTrackProps & React.RefAttributes<HTMLDivElement>>;
|
|
154
|
+
Indicator: React.ForwardRefExoticComponent<ProgressIndicatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
155
|
+
};
|
|
156
|
+
export {};
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { Progress as BaseProgress } from '@base-ui/react/progress';
|
|
2
|
+
import { ProgressSize, ProgressTone } from './Progress';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
/**
|
|
5
|
+
* Same two axes as the bar, and deliberately the same union types: a design
|
|
6
|
+
* system that calls it `tone="success"` in one shape and `tone="positive"` in
|
|
7
|
+
* the other has two vocabularies, not one.
|
|
8
|
+
*/
|
|
9
|
+
export type ProgressCircleSize = ProgressSize;
|
|
10
|
+
export type ProgressCircleTone = ProgressTone;
|
|
11
|
+
type BaseRootProps = React.ComponentPropsWithoutRef<typeof BaseProgress.Root>;
|
|
12
|
+
export interface ProgressCircleRootProps extends Omit<BaseRootProps, "className"> {
|
|
13
|
+
/**
|
|
14
|
+
* Diameter of the ring — `2.5rem`, `3.5rem` or `5rem`. The stroke is
|
|
15
|
+
* measured in the ring's own coordinate space rather than in pixels, so it
|
|
16
|
+
* scales with the diameter and a `sm` circle is a smaller ring rather than a
|
|
17
|
+
* thinner one.
|
|
18
|
+
* @default "md"
|
|
19
|
+
*/
|
|
20
|
+
size?: ProgressCircleSize;
|
|
21
|
+
/**
|
|
22
|
+
* Which semantic colour set the arc draws from. The rail behind it stays
|
|
23
|
+
* neutral in every tone.
|
|
24
|
+
* @default "primary"
|
|
25
|
+
*/
|
|
26
|
+
tone?: ProgressCircleTone;
|
|
27
|
+
/**
|
|
28
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
29
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
30
|
+
*/
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Groups every part of the ring and owns its value. Renders a
|
|
35
|
+
* `<div role="progressbar">` laid out as a grid where `Track` and `Value`
|
|
36
|
+
* share one cell — which is what centres the readout inside the ring — and
|
|
37
|
+
* `Label` sits in a second row that only exists if you render one.
|
|
38
|
+
*
|
|
39
|
+
* `value` is required and `null` means indeterminate: the readout disappears
|
|
40
|
+
* and the arc starts rotating.
|
|
41
|
+
*
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <ProgressCircle.Root value={62}>
|
|
44
|
+
* <ProgressCircle.Track>
|
|
45
|
+
* <ProgressCircle.Indicator />
|
|
46
|
+
* </ProgressCircle.Track>
|
|
47
|
+
* <ProgressCircle.Value />
|
|
48
|
+
* <ProgressCircle.Label>Uploading</ProgressCircle.Label>
|
|
49
|
+
* </ProgressCircle.Root>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare const ProgressCircleRoot: React.ForwardRefExoticComponent<ProgressCircleRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
53
|
+
type BaseTrackProps = React.ComponentPropsWithoutRef<typeof BaseProgress.Track>;
|
|
54
|
+
export interface ProgressCircleTrackProps extends Omit<BaseTrackProps, "className" | "render"> {
|
|
55
|
+
/**
|
|
56
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
57
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
58
|
+
*/
|
|
59
|
+
className?: string;
|
|
60
|
+
/**
|
|
61
|
+
* A ref to the `<svg>`.
|
|
62
|
+
*/
|
|
63
|
+
ref?: React.Ref<SVGSVGElement>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The ring's canvas and the rail behind the arc. Renders an `<svg>` on a
|
|
67
|
+
* `0 0 100 100` viewBox — Base UI's `Track` is a `<div>` by default and is
|
|
68
|
+
* re-rendered through its `render` prop, which is also what keeps the
|
|
69
|
+
* `data-complete` / `data-progressing` / `data-indeterminate` attributes on
|
|
70
|
+
* it.
|
|
71
|
+
*
|
|
72
|
+
* The viewBox is what makes the stroke width scale: everything inside is
|
|
73
|
+
* measured against a ring 100 units across, and the size of a unit is whatever
|
|
74
|
+
* `--forte-progress-circle-size` says.
|
|
75
|
+
*
|
|
76
|
+
* `render` is intentionally not forwarded. Replacing the `<svg>` would take
|
|
77
|
+
* the coordinate space every rule in the stylesheet is written against with
|
|
78
|
+
* it, and the failure is silent — a ring that simply does not draw.
|
|
79
|
+
*/
|
|
80
|
+
export declare const ProgressCircleTrack: React.ForwardRefExoticComponent<Omit<ProgressCircleTrackProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
81
|
+
type BaseIndicatorProps = React.ComponentPropsWithoutRef<typeof BaseProgress.Indicator>;
|
|
82
|
+
export interface ProgressCircleIndicatorProps extends Omit<BaseIndicatorProps, "className" | "render"> {
|
|
83
|
+
/**
|
|
84
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
85
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
86
|
+
*/
|
|
87
|
+
className?: string;
|
|
88
|
+
/**
|
|
89
|
+
* A ref to the `<circle>`.
|
|
90
|
+
*/
|
|
91
|
+
ref?: React.Ref<SVGCircleElement>;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The arc. A `<circle>` with `pathLength="100"`, which renormalises its
|
|
95
|
+
* circumference to 100 units so `stroke-dashoffset` can be driven straight
|
|
96
|
+
* from the percentage without anyone computing 2πr — including when
|
|
97
|
+
* `--forte-progress-circle-thickness` changes the radius out from under it.
|
|
98
|
+
*
|
|
99
|
+
* Base UI still writes its inline `width` / `height` / `inset-inline-start`
|
|
100
|
+
* here while the bar is determinate. None of the three applies to a `<circle>`
|
|
101
|
+
* in CSS, so they are inert; the value reaches the arc through
|
|
102
|
+
* `--forte-progress-circle-percent` on the root instead.
|
|
103
|
+
*/
|
|
104
|
+
export declare const ProgressCircleIndicator: React.ForwardRefExoticComponent<Omit<ProgressCircleIndicatorProps, "ref"> & React.RefAttributes<SVGCircleElement>>;
|
|
105
|
+
type BaseValueProps = React.ComponentPropsWithoutRef<typeof BaseProgress.Value>;
|
|
106
|
+
export interface ProgressCircleValueProps extends Omit<BaseValueProps, "className"> {
|
|
107
|
+
/**
|
|
108
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
109
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
110
|
+
*/
|
|
111
|
+
className?: string;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The readout, centred inside the ring. Renders an `aria-hidden` `<span>` —
|
|
115
|
+
* the root already publishes the number through `aria-valuenow`.
|
|
116
|
+
*
|
|
117
|
+
* It renders nothing while the ring is indeterminate. Pass a function child to
|
|
118
|
+
* put something else there, and keep it short: at `sm` the ring's inner
|
|
119
|
+
* diameter is under 30px, and anything longer than three characters will need
|
|
120
|
+
* `size="lg"` or a label underneath instead.
|
|
121
|
+
*/
|
|
122
|
+
export declare const ProgressCircleValue: React.ForwardRefExoticComponent<ProgressCircleValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
123
|
+
type BaseLabelProps = React.ComponentPropsWithoutRef<typeof BaseProgress.Label>;
|
|
124
|
+
export interface ProgressCircleLabelProps extends Omit<BaseLabelProps, "className"> {
|
|
125
|
+
/**
|
|
126
|
+
* Additional class name(s). Applied after the internal styles so consumer
|
|
127
|
+
* utilities (e.g. Tailwind) win without needing `!important`.
|
|
128
|
+
*/
|
|
129
|
+
className?: string;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Names what is being waited on, underneath the ring. Renders a `<span>` wired
|
|
133
|
+
* to the root with `aria-labelledby`, so it is the ring's accessible name.
|
|
134
|
+
*
|
|
135
|
+
* Its row in the grid only exists when it is rendered, so a ring without a
|
|
136
|
+
* label has no dangling gap under it.
|
|
137
|
+
*/
|
|
138
|
+
export declare const ProgressCircleLabel: React.ForwardRefExoticComponent<ProgressCircleLabelProps & React.RefAttributes<HTMLSpanElement>>;
|
|
139
|
+
/**
|
|
140
|
+
* A circular progress indicator built on Base UI's unstyled `Progress`
|
|
141
|
+
* primitive — the same state machine and the same accessibility contract as
|
|
142
|
+
* `Progress`, drawn as a ring instead of a bar.
|
|
143
|
+
*
|
|
144
|
+
* ```tsx
|
|
145
|
+
* <ProgressCircle.Root value={62} size="lg" tone="success">
|
|
146
|
+
* <ProgressCircle.Track>
|
|
147
|
+
* <ProgressCircle.Indicator />
|
|
148
|
+
* </ProgressCircle.Track>
|
|
149
|
+
* <ProgressCircle.Value />
|
|
150
|
+
* <ProgressCircle.Label>Restoring backup</ProgressCircle.Label>
|
|
151
|
+
* </ProgressCircle.Root>
|
|
152
|
+
* ```
|
|
153
|
+
*
|
|
154
|
+
* Pass `value={null}` and the arc becomes a rotating segment. Reach for the
|
|
155
|
+
* ring where a bar's full width is not available — a card corner, a tile, a
|
|
156
|
+
* table cell — and for `Progress` where it is, because a bar's length is
|
|
157
|
+
* comparable at a glance across a list and a ring's angle is not.
|
|
158
|
+
*/
|
|
159
|
+
export declare const ProgressCircle: {
|
|
160
|
+
Root: React.ForwardRefExoticComponent<ProgressCircleRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
161
|
+
Track: React.ForwardRefExoticComponent<Omit<ProgressCircleTrackProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
162
|
+
Indicator: React.ForwardRefExoticComponent<Omit<ProgressCircleIndicatorProps, "ref"> & React.RefAttributes<SVGCircleElement>>;
|
|
163
|
+
Value: React.ForwardRefExoticComponent<ProgressCircleValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
164
|
+
Label: React.ForwardRefExoticComponent<ProgressCircleLabelProps & React.RefAttributes<HTMLSpanElement>>;
|
|
165
|
+
};
|
|
166
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { a as e, i as t, n, o as r, r as i, t as a } from "../../ProgressCircle-j6XBl0fk.js";
|
|
3
|
+
export { a as ProgressCircle, n as ProgressCircleIndicator, i as ProgressCircleLabel, t as ProgressCircleRoot, e as ProgressCircleTrack, r as ProgressCircleValue };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { Progress } from './Progress';
|
|
2
|
+
export type { ProgressSize, ProgressTone, ProgressRootProps, ProgressLabelProps, ProgressValueProps, ProgressTrackProps, ProgressIndicatorProps, } from './Progress';
|
|
3
|
+
export { ProgressCircle } from './ProgressCircle';
|
|
4
|
+
export type { ProgressCircleSize, ProgressCircleTone, ProgressCircleRootProps, ProgressCircleTrackProps, ProgressCircleIndicatorProps, ProgressCircleValueProps, ProgressCircleLabelProps, } from './ProgressCircle';
|