@box-kite/react 0.0.1 → 2.0.0
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/.claude/rules/box-kite-rules.md +65 -0
- package/.claude/skills/box-kite/SKILL.md +138 -0
- package/.claude/skills/box-kite/references/components.md +235 -0
- package/.claude/skills/box-kite/references/extending.md +42 -0
- package/.claude/skills/box-kite/references/patterns.md +27 -0
- package/.claude/skills/box-kite/references/styling.md +222 -0
- package/.cursor/rules/box-kite.mdc +73 -0
- package/AGENTS.md +102 -0
- package/BOX_AI_CONTEXT.md +2804 -0
- package/BOX_KITE_AI_CONTEXT.md +2804 -0
- package/LICENSE +21 -0
- package/README.md +744 -7
- package/a11y.cjs +1 -0
- package/a11y.d.ts +15 -0
- package/a11y.mjs +4 -0
- package/anchor.cjs +1 -0
- package/anchor.d.ts +14 -0
- package/anchor.mjs +3 -0
- package/behavior.cjs +1 -0
- package/behavior.mjs +277 -0
- package/box.cjs +1 -0
- package/box.d.ts +46 -0
- package/box.mjs +23 -0
- package/client.cjs +1 -0
- package/client.mjs +164 -0
- package/components/accordion.cjs +1 -0
- package/components/accordion.d.ts +114 -0
- package/components/accordion.mjs +251 -0
- package/components/baseSvg.cjs +1 -0
- package/components/baseSvg.d.ts +5 -0
- package/components/baseSvg.mjs +21 -0
- package/components/button.cjs +1 -0
- package/components/button.d.ts +19 -0
- package/components/button.mjs +19 -0
- package/components/chart.cjs +1 -0
- package/components/chart.d.ts +83 -0
- package/components/chart.mjs +236 -0
- package/components/checkbox.cjs +1 -0
- package/components/checkbox.d.ts +36 -0
- package/components/checkbox.mjs +38 -0
- package/components/combobox/comboboxChips.d.ts +21 -0
- package/components/combobox/comboboxListbox.d.ts +47 -0
- package/components/combobox.cjs +1 -0
- package/components/combobox.d.ts +121 -0
- package/components/combobox.mjs +563 -0
- package/components/dataGrid/components/dataGridAggregateValue.d.ts +10 -0
- package/components/dataGrid/components/dataGridBody.d.ts +7 -0
- package/components/dataGrid/components/dataGridBottomBar.d.ts +6 -0
- package/components/dataGrid/components/dataGridCell.d.ts +16 -0
- package/components/dataGrid/components/dataGridCellEditor.d.ts +15 -0
- package/components/dataGrid/components/dataGridCellPlaceholder.d.ts +14 -0
- package/components/dataGrid/components/dataGridCellRowDetail.d.ts +6 -0
- package/components/dataGrid/components/dataGridCellRowSelection.d.ts +6 -0
- package/components/dataGrid/components/dataGridCellText.d.ts +6 -0
- package/components/dataGrid/components/dataGridCellTree.d.ts +16 -0
- package/components/dataGrid/components/dataGridColumnFilter.d.ts +9 -0
- package/components/dataGrid/components/dataGridColumnGroups.d.ts +7 -0
- package/components/dataGrid/components/dataGridContent.d.ts +6 -0
- package/components/dataGrid/components/dataGridDataSourceError.d.ts +12 -0
- package/components/dataGrid/components/dataGridDetailRow.d.ts +8 -0
- package/components/dataGrid/components/dataGridEmptyColumns.d.ts +6 -0
- package/components/dataGrid/components/dataGridExport.d.ts +10 -0
- package/components/dataGrid/components/dataGridFilterCell.d.ts +11 -0
- package/components/dataGrid/components/dataGridFilterRow.d.ts +6 -0
- package/components/dataGrid/components/dataGridFooter.d.ts +11 -0
- package/components/dataGrid/components/dataGridGlobalFilter.d.ts +6 -0
- package/components/dataGrid/components/dataGridGroupRow.d.ts +8 -0
- package/components/dataGrid/components/dataGridHeader.d.ts +6 -0
- package/components/dataGrid/components/dataGridHeaderCell.d.ts +9 -0
- package/components/dataGrid/components/dataGridHeaderCellContextMenu.d.ts +11 -0
- package/components/dataGrid/components/dataGridHeaderCellResizer.d.ts +14 -0
- package/components/dataGrid/components/dataGridLoader.d.ts +11 -0
- package/components/dataGrid/components/dataGridPagination.d.ts +6 -0
- package/components/dataGrid/components/dataGridRow.d.ts +8 -0
- package/components/dataGrid/components/dataGridTopBar.d.ts +6 -0
- package/components/dataGrid/components/dataGridTopBarContextMenu.d.ts +6 -0
- package/components/dataGrid/contracts/dataGridContract.d.ts +671 -0
- package/components/dataGrid/export/gridExport.d.ts +10 -0
- package/components/dataGrid/gridNavigationContext.d.ts +32 -0
- package/components/dataGrid/models/aggregateCellModel.d.ts +34 -0
- package/components/dataGrid/models/aggregationModel.d.ts +32 -0
- package/components/dataGrid/models/cellKeys.d.ts +11 -0
- package/components/dataGrid/models/cellModel.d.ts +44 -0
- package/components/dataGrid/models/columnModel.d.ts +160 -0
- package/components/dataGrid/models/columnVisibilityModel.d.ts +24 -0
- package/components/dataGrid/models/dataSourceModel.d.ts +177 -0
- package/components/dataGrid/models/detailRowModel.d.ts +22 -0
- package/components/dataGrid/models/editModel.d.ts +77 -0
- package/components/dataGrid/models/exportModel.d.ts +51 -0
- package/components/dataGrid/models/filterModel.d.ts +22 -0
- package/components/dataGrid/models/gridModel.d.ts +293 -0
- package/components/dataGrid/models/groupRowCellModel.d.ts +34 -0
- package/components/dataGrid/models/groupRowModel.d.ts +68 -0
- package/components/dataGrid/models/headerCellModel.d.ts +83 -0
- package/components/dataGrid/models/paginationModel.d.ts +32 -0
- package/components/dataGrid/models/rowModel.d.ts +46 -0
- package/components/dataGrid/models/sourceGroupRowModel.d.ts +45 -0
- package/components/dataGrid/models/sourceLevel.d.ts +71 -0
- package/components/dataGrid/models/sourceRowModel.d.ts +29 -0
- package/components/dataGrid/models/sourceTreeRowModel.d.ts +23 -0
- package/components/dataGrid/models/treeModel.d.ts +94 -0
- package/components/dataGrid/models/treeRow.d.ts +22 -0
- package/components/dataGrid/models/treeRowModel.d.ts +50 -0
- package/components/dataGrid/models/viewportModel.d.ts +44 -0
- package/components/dataGrid/useGrid.d.ts +8 -0
- package/components/dataGrid/useGridNavigation.d.ts +21 -0
- package/components/dataGrid.cjs +1 -0
- package/components/dataGrid.d.ts +4 -0
- package/components/dataGrid.mjs +4907 -0
- package/components/dialog.cjs +1 -0
- package/components/dialog.d.ts +151 -0
- package/components/dialog.mjs +223 -0
- package/components/dropdown/dropdownContext.d.ts +44 -0
- package/components/dropdown/dropdownItems.d.ts +22 -0
- package/components/dropdown/dropdownRowRenderer.d.ts +8 -0
- package/components/dropdown/dropdownSearch.d.ts +21 -0
- package/components/dropdown/utils.d.ts +1 -0
- package/components/dropdown.cjs +1 -0
- package/components/dropdown.d.ts +77 -0
- package/components/dropdown.mjs +491 -0
- package/components/flex.cjs +1 -0
- package/components/flex.d.ts +6 -0
- package/components/flex.mjs +16 -0
- package/components/form.cjs +1 -0
- package/components/form.d.ts +10 -0
- package/components/form.mjs +58 -0
- package/components/grid.cjs +1 -0
- package/components/grid.d.ts +6 -0
- package/components/grid.mjs +16 -0
- package/components/icon.cjs +1 -0
- package/components/icon.d.ts +37 -0
- package/components/icon.mjs +41 -0
- package/components/menu.cjs +1 -0
- package/components/menu.d.ts +234 -0
- package/components/menu.mjs +422 -0
- package/components/overlay.cjs +1 -0
- package/components/overlay.d.ts +47 -0
- package/components/overlay.mjs +52 -0
- package/components/popover.cjs +1 -0
- package/components/popover.d.ts +100 -0
- package/components/popover.mjs +69 -0
- package/components/presence.cjs +1 -0
- package/components/presence.d.ts +36 -0
- package/components/presence.mjs +11 -0
- package/components/progress.cjs +1 -0
- package/components/progress.d.ts +47 -0
- package/components/progress.mjs +28 -0
- package/components/radioButton.cjs +1 -0
- package/components/radioButton.d.ts +32 -0
- package/components/radioButton.mjs +32 -0
- package/components/radioGroup.cjs +1 -0
- package/components/radioGroup.d.ts +51 -0
- package/components/radioGroup.mjs +83 -0
- package/components/select.cjs +1 -0
- package/components/select.d.ts +51 -0
- package/components/select.mjs +36 -0
- package/components/semantics.cjs +1 -0
- package/components/semantics.d.ts +39 -0
- package/components/semantics.mjs +17 -0
- package/components/slider.cjs +1 -0
- package/components/slider.d.ts +98 -0
- package/components/slider.mjs +250 -0
- package/components/svg.cjs +1 -0
- package/components/svg.d.ts +65 -0
- package/components/svg.mjs +141 -0
- package/components/switch.cjs +1 -0
- package/components/switch.d.ts +29 -0
- package/components/switch.mjs +25 -0
- package/components/tabs.cjs +1 -0
- package/components/tabs.d.ts +87 -0
- package/components/tabs.mjs +324 -0
- package/components/textarea.cjs +1 -0
- package/components/textarea.d.ts +41 -0
- package/components/textarea.mjs +33 -0
- package/components/textbox.cjs +1 -0
- package/components/textbox.d.ts +38 -0
- package/components/textbox.mjs +33 -0
- package/components/toaster.cjs +1 -0
- package/components/toaster.d.ts +106 -0
- package/components/toaster.mjs +295 -0
- package/components/tooltip.cjs +1 -0
- package/components/tooltip.d.ts +98 -0
- package/components/tooltip.mjs +110 -0
- package/components/visuallyHidden.cjs +1 -0
- package/components/visuallyHidden.d.ts +6 -0
- package/components/visuallyHidden.mjs +23 -0
- package/docs/a11y.md +199 -0
- package/docs/anchor.md +139 -0
- package/docs/components.md +48 -0
- package/docs/index.md +11 -0
- package/docs/props.md +1777 -0
- package/effects.cjs +1 -0
- package/effects.mjs +6 -0
- package/forms.cjs +1 -0
- package/forms.mjs +21 -0
- package/gridExport.cjs +2 -0
- package/gridExport.mjs +244 -0
- package/icons/dotsIcon.d.ts +2 -0
- package/icons/expandIcon.d.ts +2 -0
- package/icons/groupingIcon.d.ts +2 -0
- package/icons/pinIcon.d.ts +2 -0
- package/icons/searchIcon.d.ts +2 -0
- package/icons/sortIcon.d.ts +2 -0
- package/identity.cjs +1 -0
- package/identity.mjs +12 -0
- package/keyboard.cjs +1 -0
- package/keyboard.mjs +30 -0
- package/layer.cjs +1 -0
- package/layer.mjs +127 -0
- package/motion.cjs +1 -0
- package/motion.mjs +66 -0
- package/package.json +327 -7
- package/placement.cjs +1 -0
- package/placement.mjs +180 -0
- package/platform.cjs +1 -0
- package/platform.mjs +45 -0
- package/react/a11y/callbacks.d.ts +12 -0
- package/react/a11y/useControllableState.d.ts +25 -0
- package/react/a11y/useDismiss.d.ts +25 -0
- package/react/a11y/useFocusReturn.d.ts +18 -0
- package/react/a11y/useRovingFocus.d.ts +84 -0
- package/react/anchor/useAnchorPosition.d.ts +79 -0
- package/react/animation/usePresence.d.ts +32 -0
- package/react/boxClassNames.d.ts +25 -0
- package/react/boxProps.d.ts +49 -0
- package/react/boxTagProps.d.ts +7 -0
- package/react/clientRuntime.d.ts +11 -0
- package/react/dialog/useScrollLock.d.ts +12 -0
- package/react/effects.d.ts +10 -0
- package/react/forms/labelledControl.d.ts +17 -0
- package/react/forms/placeholderProp.d.ts +13 -0
- package/react/hooks/usePortalContainer.d.ts +6 -0
- package/react/hooks/useVirtualization.d.ts +32 -0
- package/react/hooks/useVisibility.d.ts +9 -0
- package/react/identity/useIdentifier.d.ts +17 -0
- package/react/popover/usePopoverLayer.d.ts +87 -0
- package/react/reactTypes.d.ts +10 -0
- package/react/resolveStyles.d.ts +18 -0
- package/react/styleElements.d.ts +3 -0
- package/react/svg/attributesInProps.d.ts +4 -0
- package/react/svg/svgNaming.d.ts +15 -0
- package/react/theme/theme.d.ts +26 -0
- package/react/theme/themeContext.d.ts +7 -0
- package/react/useStyles.d.ts +22 -0
- package/react-shared.cjs +1 -0
- package/react-shared.mjs +122 -0
- package/rolldown-runtime.cjs +1 -0
- package/rsc.cjs +1 -0
- package/rsc.d.ts +27 -0
- package/rsc.mjs +18 -0
- package/ssg.cjs +1 -0
- package/ssg.d.ts +24 -0
- package/ssg.mjs +25 -0
- package/utils/accordion/accordionUtils.d.ts +48 -0
- package/utils/anchor/anchorUtils.d.ts +79 -0
- package/utils/animation/animationUtils.d.ts +29 -0
- package/utils/array/arrayUtils.d.ts +15 -0
- package/utils/array/lazyList.d.ts +10 -0
- package/utils/box/boxUtils.d.ts +5 -0
- package/utils/chart/chartPalette.d.ts +15 -0
- package/utils/chart/chartUtils.d.ts +92 -0
- package/utils/combobox/comboboxUtils.d.ts +89 -0
- package/utils/dom/domUtils.d.ts +32 -0
- package/utils/environment/environmentUtils.d.ts +28 -0
- package/utils/export/csvUtils.d.ts +23 -0
- package/utils/export/downloadUtils.d.ts +12 -0
- package/utils/export/xlsxUtils.d.ts +56 -0
- package/utils/export/zipUtils.d.ts +26 -0
- package/utils/fn/fnUtils.d.ts +4 -0
- package/utils/form/formUtils.d.ts +8 -0
- package/utils/keyboard/typeaheadUtils.d.ts +31 -0
- package/utils/memo.d.ts +10 -0
- package/utils/menu/menuUtils.d.ts +25 -0
- package/utils/object/objectUtils.d.ts +13 -0
- package/utils/slider/sliderUtils.d.ts +67 -0
- package/utils/string/fuzzySearch.d.ts +27 -0
- package/utils/string/stringUtils.d.ts +4 -0
- package/utils/tabs/tabsUtils.d.ts +75 -0
- package/utils/toast/toastStore.d.ts +73 -0
- package/utils/virtual/virtualUtils.d.ts +47 -0
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { a as e, t } from "../platform.mjs";
|
|
3
|
+
import { t as n } from "../client.mjs";
|
|
4
|
+
import { n as r } from "../effects.mjs";
|
|
5
|
+
import i from "../box.mjs";
|
|
6
|
+
import { t as a } from "../motion.mjs";
|
|
7
|
+
import { useCallback as o, useRef as s, useState as c } from "react";
|
|
8
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
|
+
import { createPortal as d } from "react-dom";
|
|
10
|
+
import { useSyncExternalStore as f } from "use-sync-external-store/shim";
|
|
11
|
+
//#region src/utils/toast/toastStore.ts
|
|
12
|
+
var p = {
|
|
13
|
+
toasts: [],
|
|
14
|
+
overflow: 0
|
|
15
|
+
}, m = 0;
|
|
16
|
+
function h() {
|
|
17
|
+
return m += 1, `toast-${m}`;
|
|
18
|
+
}
|
|
19
|
+
function g(e) {
|
|
20
|
+
let t = [], n = p, r = e?.limit ?? 3, i = e?.duration ?? 5e3, a = !1, o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Map(), c = (e) => {
|
|
21
|
+
let t = s.get(e);
|
|
22
|
+
t?.handle && clearTimeout(t.handle), s.delete(e);
|
|
23
|
+
}, l = () => {
|
|
24
|
+
let e = 0;
|
|
25
|
+
t = t.map((t) => {
|
|
26
|
+
let n = !t.open || e++ < r;
|
|
27
|
+
return t.visible === n ? t : {
|
|
28
|
+
...t,
|
|
29
|
+
visible: n
|
|
30
|
+
};
|
|
31
|
+
}), n = {
|
|
32
|
+
toasts: t,
|
|
33
|
+
overflow: Math.max(0, e - r)
|
|
34
|
+
}, u(), o.forEach((e) => e());
|
|
35
|
+
};
|
|
36
|
+
function u() {
|
|
37
|
+
let e = /* @__PURE__ */ new Set();
|
|
38
|
+
for (let n of t) {
|
|
39
|
+
if (!n.open || !n.visible || !Number.isFinite(n.duration)) continue;
|
|
40
|
+
e.add(n.id);
|
|
41
|
+
let t = s.get(n.id) ?? {
|
|
42
|
+
handle: null,
|
|
43
|
+
remaining: n.duration,
|
|
44
|
+
startedAt: 0
|
|
45
|
+
};
|
|
46
|
+
s.set(n.id, t), !(a || t.handle) && (t.startedAt = Date.now(), t.handle = setTimeout(() => {
|
|
47
|
+
s.delete(n.id), f(n.id, "timeout");
|
|
48
|
+
}, t.remaining));
|
|
49
|
+
}
|
|
50
|
+
for (let t of [...s.keys()]) e.has(t) || c(t);
|
|
51
|
+
}
|
|
52
|
+
let d = (e, t) => t ?? (e === "loading" ? Infinity : i);
|
|
53
|
+
function f(e, n = "imperative") {
|
|
54
|
+
let r = [];
|
|
55
|
+
t = t.map((t) => !t.open || e !== void 0 && t.id !== e ? t : (r.push(t), c(t.id), {
|
|
56
|
+
...t,
|
|
57
|
+
open: !1
|
|
58
|
+
})), r.length && (l(), r.forEach((e) => e.onDismiss?.(n)));
|
|
59
|
+
}
|
|
60
|
+
function m(e, n, r) {
|
|
61
|
+
let i = !1;
|
|
62
|
+
t = t.map((t) => {
|
|
63
|
+
if (t.id !== e) return t;
|
|
64
|
+
i = !0, c(e);
|
|
65
|
+
let a = r?.kind ?? t.kind;
|
|
66
|
+
return {
|
|
67
|
+
...t,
|
|
68
|
+
...r,
|
|
69
|
+
id: e,
|
|
70
|
+
message: n,
|
|
71
|
+
kind: a,
|
|
72
|
+
duration: r?.duration ?? (r?.kind ? d(a) : t.duration),
|
|
73
|
+
open: !0
|
|
74
|
+
};
|
|
75
|
+
}), i && l();
|
|
76
|
+
}
|
|
77
|
+
function g(e, n) {
|
|
78
|
+
let r = n?.id ?? h();
|
|
79
|
+
if (n?.id && t.some((e) => e.id === r)) return m(r, e, n), r;
|
|
80
|
+
let i = n?.kind ?? "default";
|
|
81
|
+
return t = [...t, {
|
|
82
|
+
id: r,
|
|
83
|
+
kind: i,
|
|
84
|
+
message: e,
|
|
85
|
+
description: n?.description,
|
|
86
|
+
duration: d(i, n?.duration),
|
|
87
|
+
action: n?.action,
|
|
88
|
+
dismissible: n?.dismissible ?? !0,
|
|
89
|
+
onDismiss: n?.onDismiss,
|
|
90
|
+
open: !0,
|
|
91
|
+
visible: !1
|
|
92
|
+
}], l(), r;
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
subscribe(e) {
|
|
96
|
+
return o.add(e), () => o.delete(e);
|
|
97
|
+
},
|
|
98
|
+
getSnapshot: () => n,
|
|
99
|
+
getServerSnapshot: () => p,
|
|
100
|
+
add: g,
|
|
101
|
+
update: m,
|
|
102
|
+
dismiss: f,
|
|
103
|
+
remove(e) {
|
|
104
|
+
let n = t.filter((t) => t.id !== e);
|
|
105
|
+
n.length !== t.length && (c(e), t = n, l());
|
|
106
|
+
},
|
|
107
|
+
setLimit(e) {
|
|
108
|
+
e !== r && (r = e, l());
|
|
109
|
+
},
|
|
110
|
+
setDefaultDuration(e) {
|
|
111
|
+
i = e;
|
|
112
|
+
},
|
|
113
|
+
pause() {
|
|
114
|
+
if (!a) {
|
|
115
|
+
a = !0;
|
|
116
|
+
for (let e of s.values()) e.handle && (clearTimeout(e.handle), e.handle = null, e.remaining = Math.max(0, e.remaining - (Date.now() - e.startedAt)));
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
resume() {
|
|
120
|
+
a && (a = !1, u());
|
|
121
|
+
},
|
|
122
|
+
reset() {
|
|
123
|
+
for (let e of [...s.keys()]) c(e);
|
|
124
|
+
t = [], n = p, o.forEach((e) => e());
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/components/toaster.tsx
|
|
130
|
+
var _ = g(), v = (e) => (t, n) => _.add(t, {
|
|
131
|
+
...n,
|
|
132
|
+
kind: e
|
|
133
|
+
}), y = Object.assign((e, t) => _.add(e, t), {
|
|
134
|
+
success: v("success"),
|
|
135
|
+
error: v("error"),
|
|
136
|
+
warning: v("warning"),
|
|
137
|
+
info: v("info"),
|
|
138
|
+
loading: v("loading"),
|
|
139
|
+
update: (e, t, n) => _.update(e, t, n),
|
|
140
|
+
dismiss: (e) => _.dismiss(e, "imperative"),
|
|
141
|
+
promise(e, t, n) {
|
|
142
|
+
let r = _.add(t.loading, {
|
|
143
|
+
...n,
|
|
144
|
+
id: n?.id,
|
|
145
|
+
kind: "loading"
|
|
146
|
+
}), i = (e, t) => typeof e == "function" ? e(t) : e;
|
|
147
|
+
return e.then((e) => _.update(r, i(t.success, e), { kind: "success" }), (e) => _.update(r, i(t.error, e), { kind: "error" })), e;
|
|
148
|
+
}
|
|
149
|
+
}), b = {
|
|
150
|
+
"top-start": "topStart",
|
|
151
|
+
"top-center": "topCenter",
|
|
152
|
+
"top-end": "topEnd",
|
|
153
|
+
"bottom-start": "bottomStart",
|
|
154
|
+
"bottom-center": "bottomCenter",
|
|
155
|
+
"bottom-end": "bottomEnd"
|
|
156
|
+
};
|
|
157
|
+
function x(e, t) {
|
|
158
|
+
let n = t.toLowerCase().split("+"), r = n[n.length - 1], i = new Set(n.slice(0, -1));
|
|
159
|
+
return e.key.toLowerCase() === r && e.altKey === i.has("alt") && e.ctrlKey === i.has("ctrl") && e.shiftKey === i.has("shift") && e.metaKey === i.has("meta");
|
|
160
|
+
}
|
|
161
|
+
function S(e) {
|
|
162
|
+
let { toast: t, store: n, fromTop: o, closeLabel: s } = e, { mounted: c, ref: d, props: f } = a({ present: t.open });
|
|
163
|
+
if (r(() => {
|
|
164
|
+
c || n.remove(t.id);
|
|
165
|
+
}, [
|
|
166
|
+
c,
|
|
167
|
+
n,
|
|
168
|
+
t.id
|
|
169
|
+
]), !c) return null;
|
|
170
|
+
let p = t.action, m = () => {
|
|
171
|
+
p?.onClick(), p?.closeOnClick !== !1 && n.dismiss(t.id, "action");
|
|
172
|
+
};
|
|
173
|
+
return /* @__PURE__ */ u(i, {
|
|
174
|
+
ref: d,
|
|
175
|
+
component: "toaster.toast",
|
|
176
|
+
variant: {
|
|
177
|
+
[t.kind]: t.kind !== "default",
|
|
178
|
+
fromTop: o
|
|
179
|
+
},
|
|
180
|
+
props: {
|
|
181
|
+
...t.kind === "error" ? { role: "alert" } : {},
|
|
182
|
+
"data-toast-id": t.id,
|
|
183
|
+
...f
|
|
184
|
+
},
|
|
185
|
+
children: [
|
|
186
|
+
/* @__PURE__ */ l(i, {
|
|
187
|
+
component: "toaster.message",
|
|
188
|
+
children: t.message
|
|
189
|
+
}),
|
|
190
|
+
t.description !== void 0 && /* @__PURE__ */ l(i, {
|
|
191
|
+
component: "toaster.description",
|
|
192
|
+
children: t.description
|
|
193
|
+
}),
|
|
194
|
+
p && /* @__PURE__ */ l(i, {
|
|
195
|
+
tag: "button",
|
|
196
|
+
component: "toaster.action",
|
|
197
|
+
props: {
|
|
198
|
+
type: "button",
|
|
199
|
+
onClick: m
|
|
200
|
+
},
|
|
201
|
+
children: p.label
|
|
202
|
+
}),
|
|
203
|
+
t.dismissible && /* @__PURE__ */ l(i, {
|
|
204
|
+
tag: "button",
|
|
205
|
+
component: "toaster.close",
|
|
206
|
+
props: {
|
|
207
|
+
type: "button",
|
|
208
|
+
"aria-label": s,
|
|
209
|
+
onClick: () => n.dismiss(t.id, "close")
|
|
210
|
+
}
|
|
211
|
+
})
|
|
212
|
+
]
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
function C(a) {
|
|
216
|
+
let { position: p = "bottom-end", limit: m = 3, duration: h = 5e3, label: g = "Notifications", closeLabel: v = "Close", overflowLabel: y = (e) => `+${e} more`, hotkey: C = "F6", store: w = _, props: T, ...E } = a, D = f(w.subscribe, w.getSnapshot, w.getServerSnapshot), [O, k] = c(!0), A = n(!O), j = s(null), M = s(null), N = s({
|
|
217
|
+
hovered: !1,
|
|
218
|
+
focused: !1,
|
|
219
|
+
hidden: !1
|
|
220
|
+
}), P = o(() => {
|
|
221
|
+
let { hovered: e, focused: t, hidden: n } = N.current;
|
|
222
|
+
e || t || n ? w.pause() : w.resume();
|
|
223
|
+
}, [w]);
|
|
224
|
+
r(() => {
|
|
225
|
+
e() || k(!1);
|
|
226
|
+
}, []), r(() => w.setLimit(m), [w, m]), r(() => w.setDefaultDuration(h), [w, h]), r(() => {
|
|
227
|
+
let t = j.current;
|
|
228
|
+
!O || !e() || !t || !t.isConnected || t.matches(":popover-open") || t.showPopover();
|
|
229
|
+
}), r(() => {
|
|
230
|
+
let e = t();
|
|
231
|
+
if (!e) return;
|
|
232
|
+
let n = new AbortController();
|
|
233
|
+
return e.addEventListener("visibilitychange", () => {
|
|
234
|
+
N.current.hidden = e.hidden, P();
|
|
235
|
+
}, { signal: n.signal }), () => n.abort();
|
|
236
|
+
}, [P]), r(() => {
|
|
237
|
+
let e = t();
|
|
238
|
+
if (!C || !e) return;
|
|
239
|
+
let n = new AbortController();
|
|
240
|
+
return e.addEventListener("keydown", (t) => {
|
|
241
|
+
!x(t, C) || !j.current || (t.preventDefault(), M.current = e.activeElement, j.current.focus());
|
|
242
|
+
}, { signal: n.signal }), () => n.abort();
|
|
243
|
+
}, [C]);
|
|
244
|
+
let F = (e) => !!e && !!j.current?.contains(e), I = () => {
|
|
245
|
+
N.current.hovered = !0, P();
|
|
246
|
+
}, L = (e) => {
|
|
247
|
+
F(e.relatedTarget) || (N.current.hovered = !1, P());
|
|
248
|
+
}, R = (e) => {
|
|
249
|
+
N.current.focused = !0, P(), F(e.relatedTarget) || (M.current = e.relatedTarget);
|
|
250
|
+
}, z = (e) => {
|
|
251
|
+
F(e.relatedTarget) || (N.current.focused = !1, P());
|
|
252
|
+
}, B = (e) => {
|
|
253
|
+
if (e.key !== "Escape") return;
|
|
254
|
+
let t = (e.target.closest?.("[data-toast-id]"))?.getAttribute("data-toast-id");
|
|
255
|
+
t && w.dismiss(t, "close"), w.getSnapshot().toasts.some((e) => e.open) ? j.current?.focus() : M.current?.focus();
|
|
256
|
+
}, V = p.startsWith("top"), H = D.toasts.filter((e) => e.visible), U = V ? [...H].reverse() : H, W = D.overflow > 0 && /* @__PURE__ */ l(i, {
|
|
257
|
+
component: "toaster.overflow",
|
|
258
|
+
children: y(D.overflow)
|
|
259
|
+
}), G = /* @__PURE__ */ u(i, {
|
|
260
|
+
tag: "section",
|
|
261
|
+
ref: j,
|
|
262
|
+
component: "toaster",
|
|
263
|
+
...E,
|
|
264
|
+
variant: [E.variant, { [b[p]]: !0 }],
|
|
265
|
+
props: {
|
|
266
|
+
...O ? { popover: "manual" } : {},
|
|
267
|
+
"aria-live": "polite",
|
|
268
|
+
"aria-atomic": "false",
|
|
269
|
+
"aria-relevant": "additions text",
|
|
270
|
+
"aria-label": g,
|
|
271
|
+
tabIndex: -1,
|
|
272
|
+
...T,
|
|
273
|
+
onPointerOver: I,
|
|
274
|
+
onPointerOut: L,
|
|
275
|
+
onFocus: R,
|
|
276
|
+
onBlur: z,
|
|
277
|
+
onKeyDown: B
|
|
278
|
+
},
|
|
279
|
+
children: [
|
|
280
|
+
!V && W,
|
|
281
|
+
U.map((e) => /* @__PURE__ */ l(S, {
|
|
282
|
+
toast: e,
|
|
283
|
+
store: w,
|
|
284
|
+
fromTop: V,
|
|
285
|
+
closeLabel: v
|
|
286
|
+
}, e.id)),
|
|
287
|
+
V && W
|
|
288
|
+
]
|
|
289
|
+
});
|
|
290
|
+
return O ? G : A ? d(G, A) : null;
|
|
291
|
+
}
|
|
292
|
+
var w = C;
|
|
293
|
+
w.displayName = "Toaster";
|
|
294
|
+
//#endregion
|
|
295
|
+
export { g as createToastStore, w as default, _ as defaultToastStore, y as toast };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../behavior.cjs"),t=require("../identity.cjs"),n=require("./overlay.cjs"),r=require("./presence.cjs");let i=require("react"),a=require("react/jsx-runtime");function o(o){let{content:s,children:c,open:l,defaultOpen:u=!1,onOpenChange:d,openDelay:f=300,closeDelay:p=150,side:m=`bottom`,align:h=`center`,offset:g=1,flip:_=!0,props:v,...y}=o,b=t.t(`tooltip`),x=y.id??b,[S,C]=e.i({value:l,defaultValue:u,onChange:d}),[w,T]=(0,i.useState)(null),E=(0,i.useRef)(null),D=(0,i.useRef)(void 0),O=(0,i.useRef)(!1),k=(0,i.useRef)(!1),A=(0,i.useRef)(!1),j=(0,i.useRef)(!1),M=(0,i.useCallback)(()=>{clearTimeout(D.current),D.current=void 0},[]),N=(0,i.useCallback)((e,t)=>{if(M(),e<=0){t();return}D.current=setTimeout(()=>{D.current=void 0,t()},e)},[M]),P=(0,i.useCallback)((e,t)=>{N(p,()=>{O.current||k.current||A.current||C(!1,{reason:e,event:t})})},[p,N,C]);e.r({enabled:S,outsidePointer:!1,inside:[E],onDismiss:(e,t)=>{M(),j.current=!0,C(!1,{reason:e,event:t})}}),(0,i.useEffect)(()=>M,[M]);let F=S&&s!=null,I=e.a(e=>{O.current=!0,!j.current&&N(f,()=>C(!0,{reason:`hover`,event:e}))}),L=e.a(e=>{O.current=!1,j.current=!1,P(`pointer-leave`,e)}),R=e.a(e=>{A.current=!0,M(),C(!0,{reason:`focus`,event:e})}),z=e.a(e=>{A.current=!1,j.current=!1,P(`blur`,e)}),B=e.a(()=>{k.current=!0,M()}),V=e.a(e=>{k.current=!1,P(`pointer-leave`,e)}),H=(0,i.useMemo)(()=>({ref:T,props:{"aria-describedby":F?x:void 0,onPointerEnter:I,onPointerLeave:L,onFocus:R,onBlur:z}}),[z,I,R,L,F,x]);return(0,a.jsxs)(a.Fragment,{children:[c(H),(0,a.jsx)(r.default,{present:F,children:e=>(0,a.jsx)(n.default,{ref:E,contentRef:e.ref,anchor:w,side:m,align:h,offset:g,flip:_,matchWidth:!1,component:`tooltip`,...y,variant:[y.variant,{closed:!e.present}],id:x,props:{role:`tooltip`,...e.props,...v,onPointerEnter:B,onPointerLeave:V},children:s})})]})}o.displayName=`Tooltip`,exports.default=o;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { BoxProps } from '../box';
|
|
2
|
+
import { ChangeHandler } from '../react/a11y/useControllableState';
|
|
3
|
+
import { ComponentsAndVariants } from '@box-kite/core/types';
|
|
4
|
+
import { AnchorAlign, AnchorSide } from '../utils/anchor/anchorUtils';
|
|
5
|
+
/** Why the tooltip opened or closed — `onOpenChange` gets this alongside the event that did it. */
|
|
6
|
+
export type TooltipReason = 'hover' | 'focus' | 'pointer-leave' | 'blur' | 'escape';
|
|
7
|
+
/** The DOM attributes and handlers the trigger has to carry. */
|
|
8
|
+
export interface TooltipTriggerAttributes {
|
|
9
|
+
'aria-describedby'?: string;
|
|
10
|
+
onPointerEnter(event: React.PointerEvent): void;
|
|
11
|
+
onPointerLeave(event: React.PointerEvent): void;
|
|
12
|
+
onFocus(event: React.FocusEvent): void;
|
|
13
|
+
onBlur(event: React.FocusEvent): void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* What the trigger has to carry: spread it onto the control itself, not a wrapper, because
|
|
17
|
+
* `aria-describedby` only means something on the element the user lands on. The `ref` is what the
|
|
18
|
+
* tooltip is positioned against, so it is not optional decoration (see `anchor` on `Overlay`).
|
|
19
|
+
*
|
|
20
|
+
* ```tsx
|
|
21
|
+
* {(trigger) => <Button {...trigger}>Delete</Button>} // a Box component
|
|
22
|
+
* {(trigger) => <button ref={trigger.ref} {...trigger.props}>} // a plain element
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export interface TooltipTrigger {
|
|
26
|
+
ref: React.RefCallback<HTMLElement>;
|
|
27
|
+
props: TooltipTriggerAttributes;
|
|
28
|
+
}
|
|
29
|
+
type TooltipBoxProps<TKey extends keyof ComponentsAndVariants> = Omit<BoxProps<'div', TKey>, 'children' | 'content' | 'open' | 'flip'>;
|
|
30
|
+
interface Props<TKey extends keyof ComponentsAndVariants> extends TooltipBoxProps<TKey> {
|
|
31
|
+
/** The description itself. Nothing renders while this is empty. */
|
|
32
|
+
content?: React.ReactNode;
|
|
33
|
+
/** The trigger, handed the ref and props that wire it to the tooltip. */
|
|
34
|
+
children: (trigger: TooltipTrigger) => React.ReactNode;
|
|
35
|
+
/** Controlled open state. Leave it out and the tooltip owns it. */
|
|
36
|
+
open?: boolean;
|
|
37
|
+
/** Whether it starts open, when the tooltip owns its own state. */
|
|
38
|
+
defaultOpen?: boolean;
|
|
39
|
+
/** Fires with the new state and why it changed — `'hover'`, `'focus'`, `'pointer-leave'`, `'blur'`
|
|
40
|
+
* or `'escape'`. */
|
|
41
|
+
onOpenChange?: ChangeHandler<boolean, TooltipReason>;
|
|
42
|
+
/**
|
|
43
|
+
* How long the pointer has to rest on the trigger, in ms. Default 300 — sweeping across a toolbar should
|
|
44
|
+
* not light every control up. Focus ignores it: a keyboard user asked for the tooltip by arriving.
|
|
45
|
+
*/
|
|
46
|
+
openDelay?: number;
|
|
47
|
+
/** The grace period after the pointer leaves, in ms. Default 150, so the pointer can reach the tooltip (WCAG 1.4.13). */
|
|
48
|
+
closeDelay?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Which side of the trigger the bubble sits on — `top`/`bottom` are the block axis, `start`/`end` the
|
|
51
|
+
* inline one. Default `'bottom'`, and a side with no room flips to its opposite either way.
|
|
52
|
+
*/
|
|
53
|
+
side?: AnchorSide;
|
|
54
|
+
/** Which of the trigger's edges to line the bubble up with along the other axis. Default `'center'`. */
|
|
55
|
+
align?: AnchorAlign;
|
|
56
|
+
/**
|
|
57
|
+
* The gap between trigger and bubble, on the ÷4 spacing scale. Default 1 — 4px, which is near enough
|
|
58
|
+
* for the pointer to cross without leaving the trigger (WCAG 1.4.13) and far enough to read as a layer.
|
|
59
|
+
*/
|
|
60
|
+
offset?: number;
|
|
61
|
+
/** Whether a side with no room may be swapped for its opposite. Default `true`. */
|
|
62
|
+
flip?: boolean;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The APG tooltip: a description that appears on hover *and* on focus and stays until the user is done
|
|
66
|
+
* with it.
|
|
67
|
+
*
|
|
68
|
+
* ```tsx
|
|
69
|
+
* <Tooltip content="Deletes the row for good">{(trigger) => <Button {...trigger}>Delete</Button>}</Tooltip>
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* The trigger is a render prop rather than a cloned child: cloning would have to guess where a child
|
|
73
|
+
* wants its DOM attributes (Box takes a `props` bag, a `<button>` takes them on top), and guessing wrong
|
|
74
|
+
* on `aria-describedby` costs the thing the pattern is for. The component owns `role="tooltip"`, the
|
|
75
|
+
* `aria-describedby`, and WCAG 1.4.13's three obligations — dismissible with Escape without moving focus,
|
|
76
|
+
* hoverable, and never closed on a timer. Focus never enters it: a focusable tooltip is a mislabelled dialog.
|
|
77
|
+
*
|
|
78
|
+
* @pattern https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/
|
|
79
|
+
* @a11y `role="tooltip"` on the bubble and `aria-describedby` on the trigger, so the description is read
|
|
80
|
+
* as part of the control rather than as text that happens to be nearby.
|
|
81
|
+
* @a11y WCAG 1.4.13, all three parts: Escape dismisses it without moving focus, the pointer can travel
|
|
82
|
+
* onto the bubble and read it, and nothing hides it on a timer.
|
|
83
|
+
* @a11y The bubble is never in the tab order — a focusable tooltip is a dialog with the wrong role — and
|
|
84
|
+
* it renders nothing at all while `content` is empty.
|
|
85
|
+
* @keyboard Tab — Shows it as soon as the trigger has focus, ignoring `openDelay`: a keyboard user asked
|
|
86
|
+
* for it by arriving.
|
|
87
|
+
* @keyboard Escape — Hides it, leaving focus on the trigger. It stays hidden until the pointer or focus
|
|
88
|
+
* leaves and comes back.
|
|
89
|
+
* @keyboard Tab, again — Reaches the next control, and the tooltip closes behind it.
|
|
90
|
+
* @keyboard (Pointer) Resting on the trigger — Shows it after `openDelay`, 300 ms by default: sweeping
|
|
91
|
+
* across a toolbar should not light every control up.
|
|
92
|
+
* @keyboard (Pointer) Leaving the trigger — Hides it after `closeDelay`, 150 ms — unless the pointer
|
|
93
|
+
* lands on the tooltip itself.
|
|
94
|
+
* @keyboard (Pointer) Moving onto the tooltip — Keeps it open for as long as the pointer is there, so a
|
|
95
|
+
* long description can be read or selected.
|
|
96
|
+
*/
|
|
97
|
+
declare function Tooltip<TKey extends keyof ComponentsAndVariants = 'tooltip'>(props: Props<TKey>): import("react").JSX.Element;
|
|
98
|
+
export default Tooltip;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { a as e, i as t, r as n } from "../behavior.mjs";
|
|
3
|
+
import { t as r } from "../identity.mjs";
|
|
4
|
+
import i from "./overlay.mjs";
|
|
5
|
+
import a from "./presence.mjs";
|
|
6
|
+
import { useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
7
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/tooltip.tsx
|
|
9
|
+
function m(m) {
|
|
10
|
+
let { content: h, children: g, open: _, defaultOpen: v = !1, onOpenChange: y, openDelay: b = 300, closeDelay: x = 150, side: S = "bottom", align: C = "center", offset: w = 1, flip: T = !0, props: E, ...D } = m, O = r("tooltip"), k = D.id ?? O, [A, j] = t({
|
|
11
|
+
value: _,
|
|
12
|
+
defaultValue: v,
|
|
13
|
+
onChange: y
|
|
14
|
+
}), [M, N] = u(null), P = l(null), F = l(void 0), I = l(!1), L = l(!1), R = l(!1), z = l(!1), B = o(() => {
|
|
15
|
+
clearTimeout(F.current), F.current = void 0;
|
|
16
|
+
}, []), V = o((e, t) => {
|
|
17
|
+
if (B(), e <= 0) {
|
|
18
|
+
t();
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
F.current = setTimeout(() => {
|
|
22
|
+
F.current = void 0, t();
|
|
23
|
+
}, e);
|
|
24
|
+
}, [B]), H = o((e, t) => {
|
|
25
|
+
V(x, () => {
|
|
26
|
+
I.current || L.current || R.current || j(!1, {
|
|
27
|
+
reason: e,
|
|
28
|
+
event: t
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}, [
|
|
32
|
+
x,
|
|
33
|
+
V,
|
|
34
|
+
j
|
|
35
|
+
]);
|
|
36
|
+
n({
|
|
37
|
+
enabled: A,
|
|
38
|
+
outsidePointer: !1,
|
|
39
|
+
inside: [P],
|
|
40
|
+
onDismiss: (e, t) => {
|
|
41
|
+
B(), z.current = !0, j(!1, {
|
|
42
|
+
reason: e,
|
|
43
|
+
event: t
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}), s(() => B, [B]);
|
|
47
|
+
let U = A && h != null, W = e((e) => {
|
|
48
|
+
I.current = !0, !z.current && V(b, () => j(!0, {
|
|
49
|
+
reason: "hover",
|
|
50
|
+
event: e
|
|
51
|
+
}));
|
|
52
|
+
}), G = e((e) => {
|
|
53
|
+
I.current = !1, z.current = !1, H("pointer-leave", e);
|
|
54
|
+
}), K = e((e) => {
|
|
55
|
+
R.current = !0, B(), j(!0, {
|
|
56
|
+
reason: "focus",
|
|
57
|
+
event: e
|
|
58
|
+
});
|
|
59
|
+
}), q = e((e) => {
|
|
60
|
+
R.current = !1, z.current = !1, H("blur", e);
|
|
61
|
+
}), J = e(() => {
|
|
62
|
+
L.current = !0, B();
|
|
63
|
+
}), Y = e((e) => {
|
|
64
|
+
L.current = !1, H("pointer-leave", e);
|
|
65
|
+
}), X = c(() => ({
|
|
66
|
+
ref: N,
|
|
67
|
+
props: {
|
|
68
|
+
"aria-describedby": U ? k : void 0,
|
|
69
|
+
onPointerEnter: W,
|
|
70
|
+
onPointerLeave: G,
|
|
71
|
+
onFocus: K,
|
|
72
|
+
onBlur: q
|
|
73
|
+
}
|
|
74
|
+
}), [
|
|
75
|
+
q,
|
|
76
|
+
W,
|
|
77
|
+
K,
|
|
78
|
+
G,
|
|
79
|
+
U,
|
|
80
|
+
k
|
|
81
|
+
]);
|
|
82
|
+
return /* @__PURE__ */ p(d, { children: [g(X), /* @__PURE__ */ f(a, {
|
|
83
|
+
present: U,
|
|
84
|
+
children: (e) => /* @__PURE__ */ f(i, {
|
|
85
|
+
ref: P,
|
|
86
|
+
contentRef: e.ref,
|
|
87
|
+
anchor: M,
|
|
88
|
+
side: S,
|
|
89
|
+
align: C,
|
|
90
|
+
offset: w,
|
|
91
|
+
flip: T,
|
|
92
|
+
matchWidth: !1,
|
|
93
|
+
component: "tooltip",
|
|
94
|
+
...D,
|
|
95
|
+
variant: [D.variant, { closed: !e.present }],
|
|
96
|
+
id: k,
|
|
97
|
+
props: {
|
|
98
|
+
role: "tooltip",
|
|
99
|
+
...e.props,
|
|
100
|
+
...E,
|
|
101
|
+
onPointerEnter: J,
|
|
102
|
+
onPointerLeave: Y
|
|
103
|
+
},
|
|
104
|
+
children: h
|
|
105
|
+
})
|
|
106
|
+
})] });
|
|
107
|
+
}
|
|
108
|
+
m.displayName = "Tooltip";
|
|
109
|
+
//#endregion
|
|
110
|
+
export { m as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../rolldown-runtime.cjs");let t=require("react"),n=require("react/jsx-runtime"),r=require("@box-kite/react");r=e.t(r,1);var i=.25;function a(e,t){return(0,n.jsx)(r.default,{ref:t,position:`absolute`,width:i,height:i,p:0,b:0,overflow:`hidden`,whiteSpace:`nowrap`,clipPath:`inset(50%)`,...e})}var o=(0,t.forwardRef)(a);o.displayName=`VisuallyHidden`,exports.default=o;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RefAttributes } from 'react';
|
|
2
|
+
import { BoxProps } from '../box';
|
|
3
|
+
import { ExtractElementFromTag } from '../react/reactTypes';
|
|
4
|
+
import { ComponentsAndVariants } from '@box-kite/core/types';
|
|
5
|
+
declare const _default: <TTag extends keyof React.JSX.IntrinsicElements = "div", TKey extends keyof ComponentsAndVariants = never>(props: BoxProps<TTag, TKey> & RefAttributes<ExtractElementFromTag<TTag>>) => React.ReactNode;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { forwardRef as e } from "react";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import n from "@box-kite/react";
|
|
4
|
+
//#region src/components/visuallyHidden.tsx
|
|
5
|
+
var r = .25;
|
|
6
|
+
function i(e, i) {
|
|
7
|
+
return /* @__PURE__ */ t(n, {
|
|
8
|
+
ref: i,
|
|
9
|
+
position: "absolute",
|
|
10
|
+
width: r,
|
|
11
|
+
height: r,
|
|
12
|
+
p: 0,
|
|
13
|
+
b: 0,
|
|
14
|
+
overflow: "hidden",
|
|
15
|
+
whiteSpace: "nowrap",
|
|
16
|
+
clipPath: "inset(50%)",
|
|
17
|
+
...e
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
var a = e(i);
|
|
21
|
+
a.displayName = "VisuallyHidden";
|
|
22
|
+
//#endregion
|
|
23
|
+
export { a as default };
|