@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,237 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "./clsx-By2n9mTe.js";
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
import { Select as i } from "@base-ui/react/select";
|
|
6
|
+
import './styles/Select.css';var a = {
|
|
7
|
+
label: "_label_10jh1_54",
|
|
8
|
+
trigger: "_trigger_10jh1_81",
|
|
9
|
+
value: "_value_10jh1_229",
|
|
10
|
+
icon: "_icon_10jh1_246",
|
|
11
|
+
caret: "_caret_10jh1_268",
|
|
12
|
+
backdrop: "_backdrop_10jh1_284",
|
|
13
|
+
positioner: "_positioner_10jh1_309",
|
|
14
|
+
popup: "_popup_10jh1_324",
|
|
15
|
+
list: "_list_10jh1_44",
|
|
16
|
+
counterFold: "_counterFold_10jh1_1",
|
|
17
|
+
scrollArrow: "_scrollArrow_10jh1_602",
|
|
18
|
+
item: "_item_10jh1_676",
|
|
19
|
+
itemIndicator: "_itemIndicator_10jh1_728",
|
|
20
|
+
itemText: "_itemText_10jh1_746",
|
|
21
|
+
group: "_group_10jh1_756",
|
|
22
|
+
groupLabel: "_groupLabel_10jh1_760",
|
|
23
|
+
separator: "_separator_10jh1_793"
|
|
24
|
+
}, o = typeof process < "u" && process.env.NODE_ENV !== "production";
|
|
25
|
+
function s(e) {
|
|
26
|
+
return /* @__PURE__ */ r("svg", {
|
|
27
|
+
width: "16",
|
|
28
|
+
height: "16",
|
|
29
|
+
viewBox: "0 0 16 16",
|
|
30
|
+
fill: "currentColor",
|
|
31
|
+
"aria-hidden": "true",
|
|
32
|
+
focusable: "false",
|
|
33
|
+
...e,
|
|
34
|
+
style: {
|
|
35
|
+
display: "block",
|
|
36
|
+
...e.style
|
|
37
|
+
},
|
|
38
|
+
children: [/* @__PURE__ */ n("path", {
|
|
39
|
+
className: a.caret,
|
|
40
|
+
"data-direction": "up",
|
|
41
|
+
d: "M11 6H5l3-3.5z"
|
|
42
|
+
}), /* @__PURE__ */ n("path", {
|
|
43
|
+
className: a.caret,
|
|
44
|
+
"data-direction": "down",
|
|
45
|
+
d: "M11 10H5l3 3.5z"
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function c(e) {
|
|
50
|
+
return /* @__PURE__ */ n("svg", {
|
|
51
|
+
width: "16",
|
|
52
|
+
height: "16",
|
|
53
|
+
viewBox: "0 0 16 16",
|
|
54
|
+
fill: "none",
|
|
55
|
+
stroke: "currentColor",
|
|
56
|
+
strokeWidth: "1.5",
|
|
57
|
+
strokeLinecap: "round",
|
|
58
|
+
strokeLinejoin: "round",
|
|
59
|
+
"aria-hidden": "true",
|
|
60
|
+
focusable: "false",
|
|
61
|
+
...e,
|
|
62
|
+
style: {
|
|
63
|
+
display: "block",
|
|
64
|
+
...e.style
|
|
65
|
+
},
|
|
66
|
+
children: /* @__PURE__ */ n("path", { d: "m2.5 8.5 4 4 7-9" })
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function l(e) {
|
|
70
|
+
return /* @__PURE__ */ n("svg", {
|
|
71
|
+
width: "16",
|
|
72
|
+
height: "16",
|
|
73
|
+
viewBox: "0 0 16 16",
|
|
74
|
+
fill: "currentColor",
|
|
75
|
+
"aria-hidden": "true",
|
|
76
|
+
focusable: "false",
|
|
77
|
+
...e,
|
|
78
|
+
style: {
|
|
79
|
+
display: "block",
|
|
80
|
+
...e.style
|
|
81
|
+
},
|
|
82
|
+
children: /* @__PURE__ */ n("path", { d: "M12 10H4l4-4.5z" })
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function u(e) {
|
|
86
|
+
return /* @__PURE__ */ n("svg", {
|
|
87
|
+
width: "16",
|
|
88
|
+
height: "16",
|
|
89
|
+
viewBox: "0 0 16 16",
|
|
90
|
+
fill: "currentColor",
|
|
91
|
+
"aria-hidden": "true",
|
|
92
|
+
focusable: "false",
|
|
93
|
+
...e,
|
|
94
|
+
style: {
|
|
95
|
+
display: "block",
|
|
96
|
+
...e.style
|
|
97
|
+
},
|
|
98
|
+
children: /* @__PURE__ */ n("path", { d: "M12 6H4l4 4.5z" })
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function d(e) {
|
|
102
|
+
return /* @__PURE__ */ n(i.Root, { ...e });
|
|
103
|
+
}
|
|
104
|
+
var f = t.forwardRef(function({ className: t, ...r }, o) {
|
|
105
|
+
return /* @__PURE__ */ n(i.Label, {
|
|
106
|
+
ref: o,
|
|
107
|
+
className: e(a.label, t),
|
|
108
|
+
"data-forte": "select-label",
|
|
109
|
+
...r
|
|
110
|
+
});
|
|
111
|
+
}), p = t.forwardRef(function({ variant: r = "outline", size: s = "md", fullWidth: c = !1, className: l, ...u }, d) {
|
|
112
|
+
let f = t.useRef(null), p = t.useCallback((e) => {
|
|
113
|
+
f.current = e, typeof d == "function" ? d(e) : d && (d.current = e);
|
|
114
|
+
}, [d]), m = t.useRef(!1);
|
|
115
|
+
return t.useEffect(() => {
|
|
116
|
+
if (!o) return;
|
|
117
|
+
let e = setTimeout(() => {
|
|
118
|
+
let e = f.current;
|
|
119
|
+
!e || m.current || !e.getAttribute("aria-label") && !e.getAttribute("aria-labelledby") && (m.current = !0, console.warn("[forte-ui] <Select.Trigger> has no accessible name. Render a <Select.Label> inside the same <Select.Root>, a <Field.Label nativeLabel={false}> in the same <Field.Root>, or pass aria-label to the trigger."));
|
|
120
|
+
}, 0);
|
|
121
|
+
return () => clearTimeout(e);
|
|
122
|
+
}), /* @__PURE__ */ n(i.Trigger, {
|
|
123
|
+
ref: p,
|
|
124
|
+
className: e(a.trigger, "forte-focus-ring", l),
|
|
125
|
+
"data-forte": "select-trigger",
|
|
126
|
+
"data-variant": r,
|
|
127
|
+
"data-size": s,
|
|
128
|
+
"data-full-width": c || void 0,
|
|
129
|
+
...u
|
|
130
|
+
});
|
|
131
|
+
}), m = t.forwardRef(function({ className: t, ...r }, o) {
|
|
132
|
+
return /* @__PURE__ */ n(i.Value, {
|
|
133
|
+
ref: o,
|
|
134
|
+
className: e(a.value, t),
|
|
135
|
+
"data-forte": "select-value",
|
|
136
|
+
...r
|
|
137
|
+
});
|
|
138
|
+
}), h = t.forwardRef(function({ className: t, children: r, ...o }, c) {
|
|
139
|
+
return /* @__PURE__ */ n(i.Icon, {
|
|
140
|
+
ref: c,
|
|
141
|
+
className: e(a.icon, t),
|
|
142
|
+
"data-forte": "select-icon",
|
|
143
|
+
...o,
|
|
144
|
+
children: r ?? /* @__PURE__ */ n(s, {})
|
|
145
|
+
});
|
|
146
|
+
}), g = t.forwardRef(function({ children: t, alignItemWithTrigger: o = !0, side: s, align: c, sideOffset: d = 4, alignOffset: f, collisionPadding: p, container: m, backdrop: h = !1, scrollArrows: g = !0, className: _, positionerClassName: v, ...y }, b) {
|
|
147
|
+
return /* @__PURE__ */ r(i.Portal, {
|
|
148
|
+
container: m,
|
|
149
|
+
children: [h ? /* @__PURE__ */ n(i.Backdrop, {
|
|
150
|
+
className: e(a.backdrop, "forte-scrim"),
|
|
151
|
+
"data-forte": "select-backdrop"
|
|
152
|
+
}) : null, /* @__PURE__ */ n(i.Positioner, {
|
|
153
|
+
className: e(a.positioner, v),
|
|
154
|
+
"data-forte": "select-positioner",
|
|
155
|
+
alignItemWithTrigger: o,
|
|
156
|
+
side: s,
|
|
157
|
+
align: c,
|
|
158
|
+
sideOffset: d,
|
|
159
|
+
alignOffset: f,
|
|
160
|
+
collisionPadding: p,
|
|
161
|
+
children: /* @__PURE__ */ r(i.Popup, {
|
|
162
|
+
ref: b,
|
|
163
|
+
className: e(a.popup, "forte-hc-surface", _),
|
|
164
|
+
"data-forte": "select-popup",
|
|
165
|
+
...y,
|
|
166
|
+
children: [
|
|
167
|
+
g ? /* @__PURE__ */ n(i.ScrollUpArrow, {
|
|
168
|
+
className: a.scrollArrow,
|
|
169
|
+
"data-forte": "select-scroll-arrow",
|
|
170
|
+
children: /* @__PURE__ */ n(l, {})
|
|
171
|
+
}) : null,
|
|
172
|
+
/* @__PURE__ */ n(i.List, {
|
|
173
|
+
className: a.list,
|
|
174
|
+
"data-forte": "select-list",
|
|
175
|
+
children: t
|
|
176
|
+
}),
|
|
177
|
+
g ? /* @__PURE__ */ n(i.ScrollDownArrow, {
|
|
178
|
+
className: a.scrollArrow,
|
|
179
|
+
"data-forte": "select-scroll-arrow",
|
|
180
|
+
children: /* @__PURE__ */ n(u, {})
|
|
181
|
+
}) : null
|
|
182
|
+
]
|
|
183
|
+
})
|
|
184
|
+
})]
|
|
185
|
+
});
|
|
186
|
+
}), _ = t.forwardRef(function({ children: t, indicator: o, className: s, ...l }, u) {
|
|
187
|
+
return /* @__PURE__ */ r(i.Item, {
|
|
188
|
+
ref: u,
|
|
189
|
+
className: e(a.item, "forte-focus-ring", s),
|
|
190
|
+
"data-forte": "select-item",
|
|
191
|
+
"data-focus-inset": "",
|
|
192
|
+
...l,
|
|
193
|
+
children: [/* @__PURE__ */ n(i.ItemIndicator, {
|
|
194
|
+
className: a.itemIndicator,
|
|
195
|
+
"data-forte": "select-item-indicator",
|
|
196
|
+
children: o ?? /* @__PURE__ */ n(c, {})
|
|
197
|
+
}), /* @__PURE__ */ n(i.ItemText, {
|
|
198
|
+
className: a.itemText,
|
|
199
|
+
"data-forte": "select-item-text",
|
|
200
|
+
children: t
|
|
201
|
+
})]
|
|
202
|
+
});
|
|
203
|
+
}), v = t.forwardRef(function({ className: t, ...r }, o) {
|
|
204
|
+
return /* @__PURE__ */ n(i.Group, {
|
|
205
|
+
ref: o,
|
|
206
|
+
className: e(a.group, t),
|
|
207
|
+
"data-forte": "select-group",
|
|
208
|
+
...r
|
|
209
|
+
});
|
|
210
|
+
}), y = t.forwardRef(function({ className: t, ...r }, o) {
|
|
211
|
+
return /* @__PURE__ */ n(i.GroupLabel, {
|
|
212
|
+
ref: o,
|
|
213
|
+
className: e(a.groupLabel, t),
|
|
214
|
+
"data-forte": "select-group-label",
|
|
215
|
+
...r
|
|
216
|
+
});
|
|
217
|
+
}), b = t.forwardRef(function({ className: t, ...r }, o) {
|
|
218
|
+
return /* @__PURE__ */ n(i.Separator, {
|
|
219
|
+
ref: o,
|
|
220
|
+
className: e(a.separator, t),
|
|
221
|
+
"data-forte": "select-separator",
|
|
222
|
+
...r
|
|
223
|
+
});
|
|
224
|
+
}), x = {
|
|
225
|
+
Root: d,
|
|
226
|
+
Label: f,
|
|
227
|
+
Trigger: p,
|
|
228
|
+
Value: m,
|
|
229
|
+
Icon: h,
|
|
230
|
+
Popup: g,
|
|
231
|
+
Item: _,
|
|
232
|
+
Group: v,
|
|
233
|
+
GroupLabel: y,
|
|
234
|
+
Separator: b
|
|
235
|
+
};
|
|
236
|
+
//#endregion
|
|
237
|
+
export { _ as a, d as c, m as d, h as i, b as l, v as n, f as o, y as r, g as s, x as t, p as u };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "./clsx-By2n9mTe.js";
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
import { Separator as r } from "@base-ui/react/separator";
|
|
6
|
+
import './styles/Separator.css';var i = { root: "_root_1460e_33" }, a = {
|
|
7
|
+
role: "none",
|
|
8
|
+
"aria-orientation": void 0
|
|
9
|
+
}, o = t.forwardRef(function({ orientation: t = "horizontal", variant: o = "solid", decorative: s = !1, className: c, ...l }, u) {
|
|
10
|
+
return /* @__PURE__ */ n(r, {
|
|
11
|
+
ref: u,
|
|
12
|
+
orientation: t,
|
|
13
|
+
className: e(i.root, c),
|
|
14
|
+
"data-forte": "separator",
|
|
15
|
+
"data-variant": o,
|
|
16
|
+
...s ? a : null,
|
|
17
|
+
...l
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
//#endregion
|
|
21
|
+
export { o as t };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "./clsx-By2n9mTe.js";
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import './styles/Skeleton.css';var a = {
|
|
6
|
+
root: "_root_1bsip_52",
|
|
7
|
+
content: "_content_1bsip_170",
|
|
8
|
+
"forte-skeleton-pulse": "_forte-skeleton-pulse_1bsip_1",
|
|
9
|
+
"forte-skeleton-breathe": "_forte-skeleton-breathe_1bsip_1",
|
|
10
|
+
"forte-skeleton-sweep": "_forte-skeleton-sweep_1bsip_1",
|
|
11
|
+
text: "_text_1bsip_230",
|
|
12
|
+
group: "_group_1bsip_254"
|
|
13
|
+
}, o = t.createContext(null);
|
|
14
|
+
function s(e) {
|
|
15
|
+
if (e !== void 0) return typeof e == "number" ? `${e}px` : e;
|
|
16
|
+
}
|
|
17
|
+
var c = t.forwardRef(function({ variant: i = "rect", animation: c, loading: l, width: u, height: d, className: f, style: p, children: m, ...h }, g) {
|
|
18
|
+
let _ = t.useContext(o), v = c ?? _?.animation ?? "pulse";
|
|
19
|
+
return l ?? _?.loading ?? !0 ? /* @__PURE__ */ r("span", {
|
|
20
|
+
ref: g,
|
|
21
|
+
className: e(a.root, f),
|
|
22
|
+
"data-forte": "skeleton",
|
|
23
|
+
"data-variant": i,
|
|
24
|
+
"data-animation": v,
|
|
25
|
+
"aria-hidden": "true",
|
|
26
|
+
style: {
|
|
27
|
+
"--forte-skeleton-width": s(u),
|
|
28
|
+
"--forte-skeleton-height": s(d),
|
|
29
|
+
...p
|
|
30
|
+
},
|
|
31
|
+
...h,
|
|
32
|
+
children: m === void 0 ? null : /* @__PURE__ */ r("span", {
|
|
33
|
+
className: a.content,
|
|
34
|
+
"data-forte": "skeleton-content",
|
|
35
|
+
children: m
|
|
36
|
+
})
|
|
37
|
+
}) : /* @__PURE__ */ r(n, { children: m });
|
|
38
|
+
}), l = {
|
|
39
|
+
Root: c,
|
|
40
|
+
Text: t.forwardRef(function({ lines: n = 3, lastLineWidth: i = "60%", animation: s, loading: l, className: u, ...d }, f) {
|
|
41
|
+
let p = t.useContext(o);
|
|
42
|
+
return l ?? p?.loading ?? !0 ? /* @__PURE__ */ r("span", {
|
|
43
|
+
ref: f,
|
|
44
|
+
className: e(a.text, u),
|
|
45
|
+
"data-forte": "skeleton-text",
|
|
46
|
+
...d,
|
|
47
|
+
children: Array.from({ length: Math.max(0, n) }, (e, t) => /* @__PURE__ */ r(c, {
|
|
48
|
+
variant: "text",
|
|
49
|
+
animation: s,
|
|
50
|
+
loading: l,
|
|
51
|
+
width: t === n - 1 && n > 1 ? i : void 0
|
|
52
|
+
}, t))
|
|
53
|
+
}) : null;
|
|
54
|
+
}),
|
|
55
|
+
Group: t.forwardRef(function({ loading: n = !0, label: s = "Loading", doneLabel: c, animation: l = "pulse", className: u, children: d, ...f }, p) {
|
|
56
|
+
let m = t.useMemo(() => ({
|
|
57
|
+
animation: l,
|
|
58
|
+
loading: n
|
|
59
|
+
}), [l, n]);
|
|
60
|
+
return /* @__PURE__ */ r(o.Provider, {
|
|
61
|
+
value: m,
|
|
62
|
+
children: /* @__PURE__ */ i("div", {
|
|
63
|
+
ref: p,
|
|
64
|
+
className: e(a.group, u),
|
|
65
|
+
"data-forte": "skeleton-group",
|
|
66
|
+
"data-loading": n || void 0,
|
|
67
|
+
"aria-busy": n,
|
|
68
|
+
...f,
|
|
69
|
+
children: [/* @__PURE__ */ r("span", {
|
|
70
|
+
className: "forte-visually-hidden",
|
|
71
|
+
role: "status",
|
|
72
|
+
children: n ? s : c
|
|
73
|
+
}), d]
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
})
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
export { l as t };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "./clsx-By2n9mTe.js";
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
import { Slider as r } from "@base-ui/react/slider";
|
|
6
|
+
import './styles/Slider.css';var i = {
|
|
7
|
+
root: "_root_o49p8_63",
|
|
8
|
+
label: "_label_o49p8_240",
|
|
9
|
+
value: "_value_o49p8_251",
|
|
10
|
+
control: "_control_o49p8_27",
|
|
11
|
+
track: "_track_o49p8_311",
|
|
12
|
+
indicator: "_indicator_o49p8_330",
|
|
13
|
+
thumb: "_thumb_o49p8_341"
|
|
14
|
+
}, a = t.createContext({
|
|
15
|
+
size: "md",
|
|
16
|
+
tone: "primary"
|
|
17
|
+
});
|
|
18
|
+
function o({ size: o = "md", tone: s = "primary", className: c, ...l }) {
|
|
19
|
+
let u = t.useMemo(() => ({
|
|
20
|
+
size: o,
|
|
21
|
+
tone: s
|
|
22
|
+
}), [o, s]);
|
|
23
|
+
return /* @__PURE__ */ n(a.Provider, {
|
|
24
|
+
value: u,
|
|
25
|
+
children: /* @__PURE__ */ n(r.Root, {
|
|
26
|
+
className: e(i.root, c),
|
|
27
|
+
"data-forte": "slider",
|
|
28
|
+
"data-size": o,
|
|
29
|
+
"data-tone": s,
|
|
30
|
+
...l
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
var s = t.forwardRef(function({ className: o, ...s }, c) {
|
|
35
|
+
let { size: l, tone: u } = t.useContext(a);
|
|
36
|
+
return /* @__PURE__ */ n(r.Label, {
|
|
37
|
+
ref: c,
|
|
38
|
+
className: e(i.label, o),
|
|
39
|
+
"data-forte": "slider-label",
|
|
40
|
+
"data-size": l,
|
|
41
|
+
"data-tone": u,
|
|
42
|
+
...s
|
|
43
|
+
});
|
|
44
|
+
}), c = t.forwardRef(function({ className: o, ...s }, c) {
|
|
45
|
+
let { size: l, tone: u } = t.useContext(a);
|
|
46
|
+
return /* @__PURE__ */ n(r.Value, {
|
|
47
|
+
ref: c,
|
|
48
|
+
className: e(i.value, o),
|
|
49
|
+
"data-forte": "slider-value",
|
|
50
|
+
"data-size": l,
|
|
51
|
+
"data-tone": u,
|
|
52
|
+
...s
|
|
53
|
+
});
|
|
54
|
+
}), l = t.forwardRef(function({ className: o, ...s }, c) {
|
|
55
|
+
let { size: l, tone: u } = t.useContext(a);
|
|
56
|
+
return /* @__PURE__ */ n(r.Control, {
|
|
57
|
+
ref: c,
|
|
58
|
+
className: e(i.control, o),
|
|
59
|
+
"data-forte": "slider-control",
|
|
60
|
+
"data-size": l,
|
|
61
|
+
"data-tone": u,
|
|
62
|
+
...s
|
|
63
|
+
});
|
|
64
|
+
}), u = t.forwardRef(function({ className: o, ...s }, c) {
|
|
65
|
+
let { size: l, tone: u } = t.useContext(a);
|
|
66
|
+
return /* @__PURE__ */ n(r.Track, {
|
|
67
|
+
ref: c,
|
|
68
|
+
className: e(i.track, o),
|
|
69
|
+
"data-forte": "slider-track",
|
|
70
|
+
"data-size": l,
|
|
71
|
+
"data-tone": u,
|
|
72
|
+
...s
|
|
73
|
+
});
|
|
74
|
+
}), d = t.forwardRef(function({ className: o, ...s }, c) {
|
|
75
|
+
let { size: l, tone: u } = t.useContext(a);
|
|
76
|
+
return /* @__PURE__ */ n(r.Indicator, {
|
|
77
|
+
ref: c,
|
|
78
|
+
className: e(i.indicator, o),
|
|
79
|
+
"data-forte": "slider-indicator",
|
|
80
|
+
"data-size": l,
|
|
81
|
+
"data-tone": u,
|
|
82
|
+
...s
|
|
83
|
+
});
|
|
84
|
+
}), f = t.forwardRef(function({ className: o, ...s }, c) {
|
|
85
|
+
let { size: l, tone: u } = t.useContext(a);
|
|
86
|
+
return /* @__PURE__ */ n(r.Thumb, {
|
|
87
|
+
ref: c,
|
|
88
|
+
className: e(i.thumb, "forte-focus-ring-within", "forte-target", o),
|
|
89
|
+
"data-forte": "slider-thumb",
|
|
90
|
+
"data-size": l,
|
|
91
|
+
"data-tone": u,
|
|
92
|
+
...s
|
|
93
|
+
});
|
|
94
|
+
}), p = {
|
|
95
|
+
Root: o,
|
|
96
|
+
Label: s,
|
|
97
|
+
Value: c,
|
|
98
|
+
Control: l,
|
|
99
|
+
Track: u,
|
|
100
|
+
Indicator: d,
|
|
101
|
+
Thumb: f
|
|
102
|
+
};
|
|
103
|
+
//#endregion
|
|
104
|
+
export { o as a, c, s as i, l as n, f as o, d as r, u as s, p as t };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "./clsx-By2n9mTe.js";
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
import './styles/Spinner.css';var i = {
|
|
6
|
+
root: "_root_7sirh_32",
|
|
7
|
+
indicator: "_indicator_7sirh_117",
|
|
8
|
+
label: "_label_7sirh_132",
|
|
9
|
+
"forte-spinner-spin": "_forte-spinner-spin_7sirh_1",
|
|
10
|
+
"forte-spinner-breathe": "_forte-spinner-breathe_7sirh_1",
|
|
11
|
+
part: "_part_7sirh_227",
|
|
12
|
+
"forte-spinner-hop": "_forte-spinner-hop_7sirh_1",
|
|
13
|
+
"forte-spinner-sweep": "_forte-spinner-sweep_7sirh_1",
|
|
14
|
+
"forte-spinner-ripple": "_forte-spinner-ripple_7sirh_1"
|
|
15
|
+
}, a = {
|
|
16
|
+
ring: 0,
|
|
17
|
+
dots: 3,
|
|
18
|
+
bars: 8,
|
|
19
|
+
pulse: 2
|
|
20
|
+
}, o = t.forwardRef(function({ variant: t = "ring", size: o = "md", tone: s = "primary", label: c = "Loading", labelPlacement: l = "hidden", decorative: u = !1, className: d, style: f, ...p }, m) {
|
|
21
|
+
let h = a[t];
|
|
22
|
+
return /* @__PURE__ */ r("span", {
|
|
23
|
+
ref: m,
|
|
24
|
+
className: e(i.root, d),
|
|
25
|
+
"data-forte": "spinner",
|
|
26
|
+
"data-variant": t,
|
|
27
|
+
"data-size": o,
|
|
28
|
+
"data-tone": s,
|
|
29
|
+
"data-label-placement": l,
|
|
30
|
+
role: u ? void 0 : "status",
|
|
31
|
+
style: {
|
|
32
|
+
"--forte-spinner-count": h,
|
|
33
|
+
...f
|
|
34
|
+
},
|
|
35
|
+
...p,
|
|
36
|
+
children: [/* @__PURE__ */ n("span", {
|
|
37
|
+
className: i.indicator,
|
|
38
|
+
"data-forte": "spinner-indicator",
|
|
39
|
+
"aria-hidden": "true",
|
|
40
|
+
children: Array.from({ length: h }, (e, t) => /* @__PURE__ */ n("span", {
|
|
41
|
+
className: i.part,
|
|
42
|
+
"data-forte": "spinner-part",
|
|
43
|
+
style: { "--forte-spinner-i": t }
|
|
44
|
+
}, t))
|
|
45
|
+
}), u && l === "hidden" ? null : /* @__PURE__ */ n("span", {
|
|
46
|
+
className: e(l === "hidden" ? "forte-visually-hidden" : i.label),
|
|
47
|
+
"data-forte": "spinner-label",
|
|
48
|
+
children: c
|
|
49
|
+
})]
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
//#endregion
|
|
53
|
+
export { o as t };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "./clsx-By2n9mTe.js";
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
import { Switch as r } from "@base-ui/react/switch";
|
|
6
|
+
import './styles/Switch.css';var i = {
|
|
7
|
+
root: "_root_1jatm_32",
|
|
8
|
+
thumb: "_thumb_1jatm_135",
|
|
9
|
+
icon: "_icon_1jatm_213"
|
|
10
|
+
}, a = t.forwardRef(function({ size: t = "md", stateIcon: a = !0, className: o, thumbClassName: s, ...c }, l) {
|
|
11
|
+
return /* @__PURE__ */ n(r.Root, {
|
|
12
|
+
ref: l,
|
|
13
|
+
className: e(i.root, "forte-focus-ring", "forte-target", o),
|
|
14
|
+
"data-forte": "switch",
|
|
15
|
+
"data-size": t,
|
|
16
|
+
...c,
|
|
17
|
+
children: /* @__PURE__ */ n(r.Thumb, {
|
|
18
|
+
className: e(i.thumb, s),
|
|
19
|
+
"data-forte": "switch-thumb",
|
|
20
|
+
children: a ? /* @__PURE__ */ n("svg", {
|
|
21
|
+
className: e(i.icon, "forte-icon"),
|
|
22
|
+
"data-forte": "switch-icon",
|
|
23
|
+
viewBox: "0 0 12 12",
|
|
24
|
+
"aria-hidden": "true",
|
|
25
|
+
focusable: "false",
|
|
26
|
+
children: /* @__PURE__ */ n("path", {
|
|
27
|
+
d: "M2.6 6.3 4.9 8.6 9.4 3.7",
|
|
28
|
+
fill: "none",
|
|
29
|
+
stroke: "currentColor",
|
|
30
|
+
strokeWidth: "1.75",
|
|
31
|
+
strokeLinecap: "round",
|
|
32
|
+
strokeLinejoin: "round"
|
|
33
|
+
})
|
|
34
|
+
}) : null
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
//#endregion
|
|
39
|
+
export { a as t };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "./clsx-By2n9mTe.js";
|
|
3
|
+
import { t } from "./ScrollArea-CBMGJ6hh.js";
|
|
4
|
+
import * as n from "react";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
import { Tabs as i } from "@base-ui/react/tabs";
|
|
7
|
+
import './styles/Tabs.css';var a = {
|
|
8
|
+
root: "_root_dql63_26",
|
|
9
|
+
list: "_list_dql63_172",
|
|
10
|
+
scroller: "_scroller_dql63_172",
|
|
11
|
+
panel: "_panel_dql63_181",
|
|
12
|
+
content: "_content_dql63_255",
|
|
13
|
+
tab: "_tab_dql63_295",
|
|
14
|
+
indicator: "_indicator_dql63_405"
|
|
15
|
+
}, o = typeof document < "u" ? n.useLayoutEffect : n.useEffect, s = n.createContext({
|
|
16
|
+
variant: "line",
|
|
17
|
+
overflow: "scroll"
|
|
18
|
+
}), c = n.forwardRef(function({ variant: t = "line", overflow: o = "scroll", className: c, children: l, ...u }, d) {
|
|
19
|
+
let f = n.useMemo(() => ({
|
|
20
|
+
variant: t,
|
|
21
|
+
overflow: o
|
|
22
|
+
}), [t, o]);
|
|
23
|
+
return /* @__PURE__ */ r(s.Provider, {
|
|
24
|
+
value: f,
|
|
25
|
+
children: /* @__PURE__ */ r(i.Root, {
|
|
26
|
+
ref: d,
|
|
27
|
+
className: e(a.root, c),
|
|
28
|
+
"data-forte": "tabs",
|
|
29
|
+
"data-variant": t,
|
|
30
|
+
"data-overflow": o,
|
|
31
|
+
...u,
|
|
32
|
+
children: l
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
}), l = (e) => parseFloat(e) || 0;
|
|
36
|
+
function u(e, t, n) {
|
|
37
|
+
let r = e.getBoundingClientRect(), i = t.getBoundingClientRect(), a = getComputedStyle(e), o = getComputedStyle(t), s = i.left - l(o.scrollMarginLeft) - (r.left + l(a.scrollPaddingLeft)), c = i.right + l(o.scrollMarginRight) - (r.right - l(a.scrollPaddingRight)), u = i.top - l(o.scrollMarginTop) - (r.top + l(a.scrollPaddingTop)), d = i.bottom + l(o.scrollMarginBottom) - (r.bottom - l(a.scrollPaddingBottom)), f = s < 0 ? s : Math.max(c, 0), p = u < 0 ? u : Math.max(d, 0);
|
|
38
|
+
(f !== 0 || p !== 0) && e.scrollBy({
|
|
39
|
+
left: f,
|
|
40
|
+
top: p,
|
|
41
|
+
behavior: n
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function d(e) {
|
|
45
|
+
return getComputedStyle(e).getPropertyValue("--forte-motion-ok").trim() === "0" ? "auto" : "smooth";
|
|
46
|
+
}
|
|
47
|
+
var f = {
|
|
48
|
+
Root: c,
|
|
49
|
+
List: n.forwardRef(function({ activateOnFocus: c = !1, loopFocus: l = !0, className: f, children: p, ...m }, h) {
|
|
50
|
+
let { variant: g, overflow: _ } = n.useContext(s), v = n.useRef(null), y = n.useRef(null), b = n.useCallback((e) => {
|
|
51
|
+
y.current = e, typeof h == "function" ? h(e) : h && (h.current = e);
|
|
52
|
+
}, [h]), x = n.useCallback((e) => {
|
|
53
|
+
let t = v.current, n = y.current;
|
|
54
|
+
if (!t || !n) return;
|
|
55
|
+
let r = n.querySelector("[data-forte=\"tabs-tab\"][data-active]");
|
|
56
|
+
r && u(t, r, e);
|
|
57
|
+
}, []);
|
|
58
|
+
o(() => {
|
|
59
|
+
x("auto");
|
|
60
|
+
}, [x]), n.useEffect(() => {
|
|
61
|
+
let e = v.current, t = y.current;
|
|
62
|
+
if (!e || !t) return;
|
|
63
|
+
let n = new MutationObserver(() => x(d(e)));
|
|
64
|
+
n.observe(t, {
|
|
65
|
+
subtree: !0,
|
|
66
|
+
attributes: !0,
|
|
67
|
+
attributeFilter: ["data-active"]
|
|
68
|
+
});
|
|
69
|
+
let r = new ResizeObserver(() => x("auto"));
|
|
70
|
+
return r.observe(e), () => {
|
|
71
|
+
n.disconnect(), r.disconnect();
|
|
72
|
+
};
|
|
73
|
+
}, [x]);
|
|
74
|
+
let S = /* @__PURE__ */ r(i.List, {
|
|
75
|
+
ref: b,
|
|
76
|
+
className: e(a.list, f),
|
|
77
|
+
"data-forte": "tabs-list",
|
|
78
|
+
activateOnFocus: c,
|
|
79
|
+
loopFocus: l,
|
|
80
|
+
"data-variant": g,
|
|
81
|
+
...m,
|
|
82
|
+
children: p
|
|
83
|
+
});
|
|
84
|
+
return _ === "scroll" ? /* @__PURE__ */ r(t.Root, {
|
|
85
|
+
className: a.scroller,
|
|
86
|
+
children: /* @__PURE__ */ r(t.Viewport, {
|
|
87
|
+
ref: v,
|
|
88
|
+
children: /* @__PURE__ */ r(t.Content, {
|
|
89
|
+
className: a.content,
|
|
90
|
+
children: S
|
|
91
|
+
})
|
|
92
|
+
})
|
|
93
|
+
}) : S;
|
|
94
|
+
}),
|
|
95
|
+
Tab: n.forwardRef(function({ className: t, children: o, ...c }, l) {
|
|
96
|
+
let { variant: u } = n.useContext(s);
|
|
97
|
+
return /* @__PURE__ */ r(i.Tab, {
|
|
98
|
+
ref: l,
|
|
99
|
+
className: e(a.tab, "forte-focus-ring", t),
|
|
100
|
+
"data-forte": "tabs-tab",
|
|
101
|
+
"data-focus-inset": "",
|
|
102
|
+
"data-variant": u,
|
|
103
|
+
...c,
|
|
104
|
+
children: o
|
|
105
|
+
});
|
|
106
|
+
}),
|
|
107
|
+
Indicator: n.forwardRef(function({ renderBeforeHydration: t = !0, className: o, ...c }, l) {
|
|
108
|
+
let { variant: u } = n.useContext(s);
|
|
109
|
+
return /* @__PURE__ */ r(i.Indicator, {
|
|
110
|
+
ref: l,
|
|
111
|
+
className: e(a.indicator, o),
|
|
112
|
+
"data-forte": "tabs-indicator",
|
|
113
|
+
renderBeforeHydration: t,
|
|
114
|
+
"data-variant": u,
|
|
115
|
+
...c
|
|
116
|
+
});
|
|
117
|
+
}),
|
|
118
|
+
Panel: n.forwardRef(function({ keepMounted: t = !1, className: o, children: c, ...l }, u) {
|
|
119
|
+
let { variant: d } = n.useContext(s);
|
|
120
|
+
return /* @__PURE__ */ r(i.Panel, {
|
|
121
|
+
ref: u,
|
|
122
|
+
className: e(a.panel, "forte-focus-ring", o),
|
|
123
|
+
"data-forte": "tabs-panel",
|
|
124
|
+
keepMounted: t,
|
|
125
|
+
"data-variant": d,
|
|
126
|
+
...l,
|
|
127
|
+
children: c
|
|
128
|
+
});
|
|
129
|
+
})
|
|
130
|
+
};
|
|
131
|
+
//#endregion
|
|
132
|
+
export { f as t };
|