gridsmith-ui 0.33.0 → 0.33.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/CHANGELOG.md +31 -0
- package/dist/charts.js +7 -7
- package/dist/chat.js +6 -6
- package/dist/{chunk-WSKPESAX.js → chunk-4FX6UCSS.js} +5 -5
- package/dist/{chunk-WSKPESAX.js.map → chunk-4FX6UCSS.js.map} +1 -1
- package/dist/{chunk-OWGF362U.js → chunk-4TQVFRKK.js} +6 -6
- package/dist/{chunk-OWGF362U.js.map → chunk-4TQVFRKK.js.map} +1 -1
- package/dist/{chunk-HCEHTJ5E.js → chunk-77X7AHFB.js} +3 -3
- package/dist/{chunk-HCEHTJ5E.js.map → chunk-77X7AHFB.js.map} +1 -1
- package/dist/{chunk-AVSP6NDX.js → chunk-BL2C35BN.js} +42 -32
- package/dist/chunk-BL2C35BN.js.map +1 -0
- package/dist/{chunk-2724SJO2.js → chunk-HDFTENVW.js} +7 -3
- package/dist/chunk-HDFTENVW.js.map +1 -0
- package/dist/{chunk-6XCWKLJZ.js → chunk-MPXE2XOP.js} +5 -5
- package/dist/{chunk-6XCWKLJZ.js.map → chunk-MPXE2XOP.js.map} +1 -1
- package/dist/{chunk-FF57N3P7.js → chunk-MW5CJOJN.js} +4 -4
- package/dist/{chunk-FF57N3P7.js.map → chunk-MW5CJOJN.js.map} +1 -1
- package/dist/{chunk-UBLBVCQN.js → chunk-N6QLEZFH.js} +5 -5
- package/dist/{chunk-UBLBVCQN.js.map → chunk-N6QLEZFH.js.map} +1 -1
- package/dist/{chunk-TMPPBXX3.js → chunk-NFVJEICH.js} +3 -3
- package/dist/{chunk-TMPPBXX3.js.map → chunk-NFVJEICH.js.map} +1 -1
- package/dist/{chunk-AB4UQ4G5.js → chunk-NJG6JQGC.js} +7 -7
- package/dist/{chunk-AB4UQ4G5.js.map → chunk-NJG6JQGC.js.map} +1 -1
- package/dist/{chunk-6NRLTG5W.js → chunk-PT4HYHI3.js} +7 -7
- package/dist/{chunk-6NRLTG5W.js.map → chunk-PT4HYHI3.js.map} +1 -1
- package/dist/{chunk-F2XMZOUP.js → chunk-T33JK3ZE.js} +4 -4
- package/dist/{chunk-F2XMZOUP.js.map → chunk-T33JK3ZE.js.map} +1 -1
- package/dist/{chunk-ZQV26NND.js → chunk-UI4BSRCQ.js} +3 -3
- package/dist/{chunk-ZQV26NND.js.map → chunk-UI4BSRCQ.js.map} +1 -1
- package/dist/{chunk-WD6T57ZJ.js → chunk-XJGFZ5CP.js} +5 -5
- package/dist/{chunk-WD6T57ZJ.js.map → chunk-XJGFZ5CP.js.map} +1 -1
- package/dist/{chunk-R2IAK3J3.js → chunk-ZTS6HJAU.js} +3 -3
- package/dist/{chunk-R2IAK3J3.js.map → chunk-ZTS6HJAU.js.map} +1 -1
- package/dist/dashboard.js +6 -6
- package/dist/data-grid.js +7 -7
- package/dist/editor-mentions.js +2 -2
- package/dist/editor.js +2 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.js +78 -42
- package/dist/index.js.map +1 -1
- package/dist/kanban.js +7 -7
- package/dist/resizable.js +7 -7
- package/dist/utils.js.map +1 -1
- package/dist/virtualized.js +7 -7
- package/package.json +1 -1
- package/dist/chunk-2724SJO2.js.map +0 -1
- package/dist/chunk-AVSP6NDX.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { localeCache, startOfDay, addDays, useWeekStart, useDateWords, localeDayFirst, dayKey, moveDay, addMonths, DateSegmentFields, getMonthGrid, isSameMonth, isSameDay, DatePicker, timeSegments, pad2, inferColumnKinds, useCardsSwitch, CARDS_BELOW, kindOfRenderedText, Checkbox, CardValue, SortIndicator, startOfWeek, endOfWeek, addMonthsClamped, isExcludedDay, CutCell, CutEmail, stepValue, separatorMovesOn, TIME_SEPARATORS, typeDigit, getEventsForDay, layoutWeek, isWeekend, getWeekDays, isBarEvent, layoutPieces, dayPieces, groupEventsByDay, timeToFraction } from './chunk-
|
|
3
|
-
export { Checkbox, CheckboxGroup, CheckboxGroupItem, DatePicker, HoverCard, TextOverflow } from './chunk-
|
|
4
|
-
import { useWholeListCheck, pagerPart, Pagination, NumberInput } from './chunk-
|
|
5
|
-
export { NumberInput, Pagination, Popover, usePagination } from './chunk-
|
|
6
|
-
import { useAppShell, REACT_VERSION_PROBLEM, Breadcrumbs, useCrumbFollow, crumbGoes, useCornerInset, NAVBAR_INSET_PRIORITY, useScrollbarInset, useBulkBarHost, DrawerFooterCtx, BulkBarHostCtx, AsideSlotContext, BulkBarSpacer, bulkBarRoom, insetLessScrollbar, BULK_BAR_LAYER, BulkBarPresenceCtx, BULK_BAR_WINDOW_LAYER, DrawerPanel, useCloseSettle, besideRoom, PANEL_INSET_PRIORITY, Drawer, LAUNCHER_INSET_PRIORITY, TOAST_INSET_VARS, useRememberedWidth, pxOf, ResizeEdge, defaultMaxWidth } from './chunk-
|
|
7
|
-
export { AppShell, Breadcrumbs, Drawer, SkipLink, useAppShell, useUnsavedChanges } from './chunk-
|
|
2
|
+
import { localeCache, startOfDay, addDays, useWeekStart, useDateWords, localeDayFirst, dayKey, moveDay, addMonths, DateSegmentFields, getMonthGrid, isSameMonth, isSameDay, DatePicker, timeSegments, pad2, inferColumnKinds, useCardsSwitch, CARDS_BELOW, kindOfRenderedText, Checkbox, CardValue, SortIndicator, startOfWeek, endOfWeek, addMonthsClamped, isExcludedDay, CutCell, CutEmail, stepValue, separatorMovesOn, TIME_SEPARATORS, typeDigit, getEventsForDay, layoutWeek, isWeekend, getWeekDays, isBarEvent, layoutPieces, dayPieces, groupEventsByDay, timeToFraction } from './chunk-PT4HYHI3.js';
|
|
3
|
+
export { Checkbox, CheckboxGroup, CheckboxGroupItem, DatePicker, HoverCard, TextOverflow } from './chunk-PT4HYHI3.js';
|
|
4
|
+
import { useWholeListCheck, pagerPart, Pagination, NumberInput } from './chunk-BL2C35BN.js';
|
|
5
|
+
export { NumberInput, Pagination, Popover, usePagination } from './chunk-BL2C35BN.js';
|
|
6
|
+
import { useAppShell, REACT_VERSION_PROBLEM, Breadcrumbs, useCrumbFollow, crumbGoes, useCornerInset, NAVBAR_INSET_PRIORITY, useScrollbarInset, useBulkBarHost, DrawerFooterCtx, BulkBarHostCtx, AsideSlotContext, BulkBarSpacer, bulkBarRoom, insetLessScrollbar, BULK_BAR_LAYER, BulkBarPresenceCtx, BULK_BAR_WINDOW_LAYER, DrawerPanel, useCloseSettle, besideRoom, PANEL_INSET_PRIORITY, Drawer, LAUNCHER_INSET_PRIORITY, TOAST_INSET_VARS, useRememberedWidth, pxOf, ResizeEdge, defaultMaxWidth } from './chunk-NJG6JQGC.js';
|
|
7
|
+
export { AppShell, Breadcrumbs, Drawer, SkipLink, useAppShell, useUnsavedChanges } from './chunk-NJG6JQGC.js';
|
|
8
8
|
import { useShellPreferences, PREFERENCE_HOUSE_DEFAULTS, formatRelativeTime, thresholdOf, toMillis, formatFullTime, datedMillis, preferenceActionKey, DAY, HOUR, MINUTE } from './chunk-QOMP4D6V.js';
|
|
9
9
|
export { PreferencesContext, formatFullTime, formatRelativeTime, preferenceActionKey, usePreferences } from './chunk-QOMP4D6V.js';
|
|
10
|
-
import { CELL_FRAME, Skeleton, CELL_HIDE, TITLE_FLOOR, CELL_ROOM, TITLE_TEXT, CELL_STAT_ROOM, CELL_STAT_ROOM_END, CELL_STAT_TILE, CELL_ROOM_INNER, SegmentedControl } from './chunk-
|
|
11
|
-
export { SegmentedControl, Skeleton } from './chunk-
|
|
10
|
+
import { CELL_FRAME, Skeleton, CELL_HIDE, TITLE_FLOOR, CELL_ROOM, TITLE_TEXT, CELL_STAT_ROOM, CELL_STAT_ROOM_END, CELL_STAT_TILE, CELL_ROOM_INNER, SegmentedControl } from './chunk-MPXE2XOP.js';
|
|
11
|
+
export { SegmentedControl, Skeleton } from './chunk-MPXE2XOP.js';
|
|
12
12
|
import { useFormatLocale, LocaleContext } from './chunk-R7FG4ZQ5.js';
|
|
13
13
|
export { useFormatLocale } from './chunk-R7FG4ZQ5.js';
|
|
14
|
-
import { Input, CHECK_FILL, Dropdown, FilterRowContext, SWITCH_KNOB_ON, SWITCH_KNOB_OFF, SWITCH_KNOB_MOTION, SWITCH_TRACK_ON, SWITCH_TRACK_OFF, useFieldControl, useField, OutsideField, InlineFieldError, Label, AddAnotherRowCtx, Field } from './chunk-
|
|
15
|
-
export { Dropdown, Field, InlineFieldError, Input, Label, Textarea, Toggle } from './chunk-
|
|
14
|
+
import { Input, CHECK_FILL, Dropdown, FilterRowContext, SWITCH_KNOB_ON, SWITCH_KNOB_OFF, SWITCH_KNOB_MOTION, SWITCH_TRACK_ON, SWITCH_TRACK_OFF, useFieldControl, useField, OutsideField, InlineFieldError, Label, AddAnotherRowCtx, Field } from './chunk-4TQVFRKK.js';
|
|
15
|
+
export { Dropdown, Field, InlineFieldError, Input, Label, Textarea, Toggle } from './chunk-4TQVFRKK.js';
|
|
16
16
|
import { formatLocale, localeChoice } from './chunk-7QLXYRPD.js';
|
|
17
17
|
import { useScrollEdges, EDGE_FADE } from './chunk-3BRQRKDO.js';
|
|
18
|
-
import { Avatar, foldForSearch, useActiveOptionInView, shownMentions, matchMentions, mentionOptionId, MentionList, initialsOf } from './chunk-
|
|
19
|
-
export { Avatar } from './chunk-
|
|
20
|
-
import { Link } from './chunk-
|
|
21
|
-
export { CodeBlock, Divider, Link } from './chunk-
|
|
18
|
+
import { Avatar, foldForSearch, useActiveOptionInView, shownMentions, matchMentions, mentionOptionId, MentionList, initialsOf } from './chunk-NFVJEICH.js';
|
|
19
|
+
export { Avatar } from './chunk-NFVJEICH.js';
|
|
20
|
+
import { Link } from './chunk-N6QLEZFH.js';
|
|
21
|
+
export { CodeBlock, Divider, Link } from './chunk-N6QLEZFH.js';
|
|
22
22
|
import { CardSurfaceCtx, useScrollsInside, useRunsEdgeToEdge, SplitPaneCtx, PanePaddedCtx, RowsCtx, PageActionsCtx, PANE_HEADING_CANCEL, SurfaceBoundary, useFramesItself, TableCardCtx, useWantsInset } from './chunk-RS624TD5.js';
|
|
23
|
-
import { Badge } from './chunk-
|
|
24
|
-
export { Badge } from './chunk-
|
|
25
|
-
import { useTextOverflow } from './chunk-
|
|
26
|
-
export { useTextOverflow } from './chunk-
|
|
27
|
-
import { useOverlayMark, useDirtyGuard, OverlayMarkScope, OverlayCloseCtx, DiscardConfirm, OVERLAY_ROOT_ATTR, OverlayMarkCtx, useCompact, useElementWidth } from './chunk-
|
|
23
|
+
import { Badge } from './chunk-4FX6UCSS.js';
|
|
24
|
+
export { Badge } from './chunk-4FX6UCSS.js';
|
|
25
|
+
import { useTextOverflow } from './chunk-ZTS6HJAU.js';
|
|
26
|
+
export { useTextOverflow } from './chunk-ZTS6HJAU.js';
|
|
27
|
+
import { useOverlayMark, useDirtyGuard, OverlayMarkScope, OverlayCloseCtx, DiscardConfirm, OVERLAY_ROOT_ATTR, OverlayMarkCtx, useCompact, useElementWidth } from './chunk-UI4BSRCQ.js';
|
|
28
28
|
import { useHydrated, useToday } from './chunk-GIA4BMGI.js';
|
|
29
29
|
export { useHydrated } from './chunk-GIA4BMGI.js';
|
|
30
30
|
import { FormChangeCtx, useReportedChange, useOptionalFormContext, FormCtx } from './chunk-72SDAX54.js';
|
|
31
31
|
export { useFormContext } from './chunk-72SDAX54.js';
|
|
32
|
-
import { DropdownMenu } from './chunk-
|
|
33
|
-
export { DropdownMenu } from './chunk-
|
|
32
|
+
import { DropdownMenu } from './chunk-XJGFZ5CP.js';
|
|
33
|
+
export { DropdownMenu } from './chunk-XJGFZ5CP.js';
|
|
34
34
|
import { useFillHeight, FillContext } from './chunk-SS3C24IJ.js';
|
|
35
|
-
import { Button, elementType, ControlSizeContext, triggerType, Spinner } from './chunk-
|
|
36
|
-
export { Button, ButtonSizeContext, ControlSizeContext, Spinner } from './chunk-
|
|
35
|
+
import { Button, elementType, ControlSizeContext, triggerType, Spinner } from './chunk-MW5CJOJN.js';
|
|
36
|
+
export { Button, ButtonSizeContext, ControlSizeContext, Spinner } from './chunk-MW5CJOJN.js';
|
|
37
37
|
import { useBreakpoint, readBreakpointPx } from './chunk-ZHUVLBCC.js';
|
|
38
38
|
export { BreakpointWidthProvider, useBreakpoint } from './chunk-ZHUVLBCC.js';
|
|
39
39
|
import { inputModality, useInputModality } from './chunk-7RKC5C7G.js';
|
|
40
40
|
export { INPUT_MODALITY_ATTR, inputModality, installInputModality, useInputModality } from './chunk-7RKC5C7G.js';
|
|
41
|
-
import { useKeyboardScroll } from './chunk-
|
|
42
|
-
import { AutoTooltip, mergeRefs, useRevealFocus } from './chunk-
|
|
43
|
-
export { Tooltip, useRevealFocus } from './chunk-
|
|
41
|
+
import { useKeyboardScroll } from './chunk-T33JK3ZE.js';
|
|
42
|
+
import { AutoTooltip, mergeRefs, useRevealFocus } from './chunk-77X7AHFB.js';
|
|
43
|
+
export { Tooltip, useRevealFocus } from './chunk-77X7AHFB.js';
|
|
44
44
|
import { Icon, slotIcon, warnOnce } from './chunk-53F7GVBQ.js';
|
|
45
|
-
import { cn, FOCUS_RING, focusAfterSelfRemoval, FOCUSABLE, GLASS_SURFACE, FOCUS_INSET_WHILE_STOP, useFocusKeptInList, FOCUS_INSET, useLatest, PEER_FOCUS_RING, GLASS_BACKDROP, OPEN_TO_FOCUS, focusOutOf, FIELD, ZOOM_KEYS, rovingTabStop, FOCUS_ROOM, useOverlayLayer, useFocusTrap, useFocusBeforeOpen, rememberOpener, focusInitial, lockBodyScroll, unlockBodyScroll, OVERLAY_CLOSE_ATTR, OVERLAY_SURFACE, GLASS_OVERLAY, usePopupFocus, pointOf, pageAddress, registerOpenerRoot, rememberFocus, usePosition, ERROR_HAS_FOCUS_RING, FIELD_HAS_FOCUS_RING,
|
|
46
|
-
export { useGridKeyboard } from './chunk-
|
|
45
|
+
import { cn, FOCUS_RING, focusAfterSelfRemoval, FOCUSABLE, GLASS_SURFACE, FOCUS_INSET_WHILE_STOP, useFocusKeptInList, FOCUS_INSET, useLatest, PEER_FOCUS_RING, GLASS_BACKDROP, OPEN_TO_FOCUS, focusOutOf, FIELD, ZOOM_KEYS, rovingTabStop, FOCUS_ROOM, useOverlayLayer, useFocusTrap, useFocusBeforeOpen, rememberOpener, focusInitial, lockBodyScroll, unlockBodyScroll, OVERLAY_CLOSE_ATTR, OVERLAY_SURFACE, GLASS_OVERLAY, usePopupFocus, tabStops, CONTROL_ANCESTOR, pointOf, pageAddress, registerOpenerRoot, rememberFocus, usePosition, ERROR_HAS_FOCUS_RING, FIELD_HAS_FOCUS_RING, GROUP_FOCUS_RING, useGridKeyboard, ERROR_ACTIVE_RING, ACTIVE_RING, ERROR_FOCUS_WITHIN_RING, FIELD_FOCUS_WITHIN_RING, focusAfterRemoval, placesOf, GLASS_DROPDOWN, ERROR_FOCUS_RING, FIELD_FOCUS_RING, openToFocus, atLeastFocusRoom, useNonModalDialog, useReturnFocus, onMovingOn } from './chunk-HDFTENVW.js';
|
|
46
|
+
export { useGridKeyboard } from './chunk-HDFTENVW.js';
|
|
47
47
|
import { forwardRef, useRef, useId, useEffect, useState, createContext, useCallback, useLayoutEffect, useMemo, useContext, isValidElement, memo, useImperativeHandle, useSyncExternalStore, Children, Fragment as Fragment$1, cloneElement, useReducer } from 'react';
|
|
48
48
|
import { createPortal, flushSync } from 'react-dom';
|
|
49
49
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
@@ -2576,7 +2576,7 @@ function SliderRange({
|
|
|
2576
2576
|
const valueText = (v) => formatValue ? formatValue(v) : void 0;
|
|
2577
2577
|
const handleChange = useCallback(
|
|
2578
2578
|
(which, raw) => {
|
|
2579
|
-
const v = Math.round(raw / step) * step;
|
|
2579
|
+
const v = Number((Math.round(raw / step) * step).toFixed(placesOf(step)));
|
|
2580
2580
|
const clamped = Math.max(min, Math.min(max, v));
|
|
2581
2581
|
if (isRange) {
|
|
2582
2582
|
if (which === "low") onChange([Math.min(clamped, high), high]);
|
|
@@ -11028,7 +11028,7 @@ var StackedList = forwardRef(function StackedList2({
|
|
|
11028
11028
|
}, [ref]);
|
|
11029
11029
|
const stackMeta = isPhone && articles;
|
|
11030
11030
|
const selectable = selectedId !== void 0 || items.some((i) => i.selected !== void 0);
|
|
11031
|
-
const inset = articles ? inCard ? "px-ds-5" : "px-0" : inCard ? "px-ds-5" : inPane ? "pl-ds-3 pr-ds-4" : selectable ? "pl-ds-3 pr-0" : "px-0";
|
|
11031
|
+
const inset = articles ? inCard ? "px-ds-5" : "px-0" : inCard ? selectable ? "pl-[calc(var(--ds-space-5)_-_var(--ds-nav-v-active-rail)*1.5)] pr-ds-5" : "px-ds-5" : inPane ? "pl-ds-3 pr-ds-4" : selectable ? "pl-ds-3 pr-0" : "px-0";
|
|
11032
11032
|
const list2 = /* @__PURE__ */ jsx(
|
|
11033
11033
|
"ul",
|
|
11034
11034
|
{
|
|
@@ -13031,7 +13031,7 @@ function getTabsFromDOM(el) {
|
|
|
13031
13031
|
const tablist = el.closest('[role="tablist"]');
|
|
13032
13032
|
if (!tablist) return [];
|
|
13033
13033
|
return Array.from(tablist.querySelectorAll('[role="tab"]')).map((btn) => ({
|
|
13034
|
-
id: btn.
|
|
13034
|
+
id: btn.dataset.tab ?? "",
|
|
13035
13035
|
disabled: btn.getAttribute("aria-disabled") === "true"
|
|
13036
13036
|
}));
|
|
13037
13037
|
}
|
|
@@ -13064,11 +13064,12 @@ function handleTabKeyDown(e, currentId, getTabs, orientation, select) {
|
|
|
13064
13064
|
e.preventDefault();
|
|
13065
13065
|
if (targetId && targetId !== currentId) {
|
|
13066
13066
|
select?.(targetId);
|
|
13067
|
-
|
|
13067
|
+
e.currentTarget.closest('[role="tablist"]')?.querySelector(`[data-tab="${CSS.escape(targetId)}"]`)?.focus();
|
|
13068
13068
|
}
|
|
13069
13069
|
}
|
|
13070
13070
|
function TabButton({
|
|
13071
13071
|
id,
|
|
13072
|
+
scope,
|
|
13072
13073
|
label,
|
|
13073
13074
|
count,
|
|
13074
13075
|
icon,
|
|
@@ -13095,8 +13096,8 @@ function TabButton({
|
|
|
13095
13096
|
if (!e.currentTarget.closest('[role="tablist"]')?.contains(e.relatedTarget)) forget();
|
|
13096
13097
|
}
|
|
13097
13098
|
};
|
|
13098
|
-
const tabId = `ds-tab-${id}`;
|
|
13099
|
-
const panelId = hasPanel === false ? void 0 : `ds-tabpanel-${id}`;
|
|
13099
|
+
const tabId = `ds-tab-${scope}${id}`;
|
|
13100
|
+
const panelId = hasPanel === false ? void 0 : `ds-tabpanel-${scope}${id}`;
|
|
13100
13101
|
const badgeBg = orientation === "vertical" ? "bg-[var(--ds-nav-v-badge-bg)]" : "bg-[var(--ds-nav-h-badge-bg)]";
|
|
13101
13102
|
const countBadge = count !== void 0 ? /* @__PURE__ */ jsx("span", { className: cn(
|
|
13102
13103
|
orientation === "vertical" ? "ml-ds-2" : "",
|
|
@@ -13109,6 +13110,7 @@ function TabButton({
|
|
|
13109
13110
|
{
|
|
13110
13111
|
type: "button",
|
|
13111
13112
|
id: tabId,
|
|
13113
|
+
"data-tab": id,
|
|
13112
13114
|
role: "tab",
|
|
13113
13115
|
"aria-selected": isActive2,
|
|
13114
13116
|
"aria-controls": panelId,
|
|
@@ -13145,6 +13147,7 @@ function TabButton({
|
|
|
13145
13147
|
{
|
|
13146
13148
|
type: "button",
|
|
13147
13149
|
id: tabId,
|
|
13150
|
+
"data-tab": id,
|
|
13148
13151
|
role: "tab",
|
|
13149
13152
|
"aria-selected": isActive2,
|
|
13150
13153
|
"aria-controls": panelId,
|
|
@@ -13201,11 +13204,12 @@ function TabsList({ children, className }) {
|
|
|
13201
13204
|
return /* @__PURE__ */ jsx(TabStrip, { overflow, fullWidth, track, label, className, children });
|
|
13202
13205
|
}
|
|
13203
13206
|
function TabsTrigger({ value, children, count, icon, disabled, truncate, className }) {
|
|
13204
|
-
const { activeTab, onTabChange, orientation, fullWidth, overflow, activation, stopTab, setFocusedTab } = useTabsCtx();
|
|
13207
|
+
const { activeTab, onTabChange, orientation, fullWidth, overflow, activation, stopTab, setFocusedTab, scope } = useTabsCtx();
|
|
13205
13208
|
return /* @__PURE__ */ jsx(
|
|
13206
13209
|
TabButton,
|
|
13207
13210
|
{
|
|
13208
13211
|
id: value,
|
|
13212
|
+
scope,
|
|
13209
13213
|
label: children,
|
|
13210
13214
|
count,
|
|
13211
13215
|
icon,
|
|
@@ -13222,16 +13226,47 @@ function TabsTrigger({ value, children, count, icon, disabled, truncate, classNa
|
|
|
13222
13226
|
}
|
|
13223
13227
|
);
|
|
13224
13228
|
}
|
|
13229
|
+
function needsStop(panel) {
|
|
13230
|
+
const stops = tabStops(panel);
|
|
13231
|
+
if (!stops.length) return true;
|
|
13232
|
+
const walk = panel.ownerDocument.createTreeWalker(panel, NodeFilter.SHOW_TEXT);
|
|
13233
|
+
for (let text = walk.nextNode(); text; text = walk.nextNode()) {
|
|
13234
|
+
const at = text.parentElement;
|
|
13235
|
+
if (!at || !text.textContent?.trim()) continue;
|
|
13236
|
+
return !stops.some((stop) => stop.contains(at)) && !panel.contains(at.closest(CONTROL_ANCESTOR));
|
|
13237
|
+
}
|
|
13238
|
+
return false;
|
|
13239
|
+
}
|
|
13240
|
+
function keepPanelStop(panel) {
|
|
13241
|
+
const read = () => {
|
|
13242
|
+
if (panel.ownerDocument.activeElement === panel) return;
|
|
13243
|
+
const stop = needsStop(panel);
|
|
13244
|
+
if (stop !== (panel.getAttribute("tabindex") === "0")) {
|
|
13245
|
+
if (stop) panel.tabIndex = 0;
|
|
13246
|
+
else panel.removeAttribute("tabindex");
|
|
13247
|
+
}
|
|
13248
|
+
};
|
|
13249
|
+
read();
|
|
13250
|
+
const watch = new MutationObserver(read);
|
|
13251
|
+
watch.observe(panel, { subtree: true, childList: true, characterData: true, attributes: true, attributeFilter: ["tabindex", "disabled", "hidden", "inert", "href", "role"] });
|
|
13252
|
+
panel.addEventListener("focusout", read);
|
|
13253
|
+
return () => {
|
|
13254
|
+
watch.disconnect();
|
|
13255
|
+
panel.removeEventListener("focusout", read);
|
|
13256
|
+
};
|
|
13257
|
+
}
|
|
13225
13258
|
function TabsContent({ value, children, className }) {
|
|
13226
|
-
const { activeTab } = useTabsCtx();
|
|
13259
|
+
const { activeTab, scope } = useTabsCtx();
|
|
13260
|
+
const [panel, setPanel] = useState(null);
|
|
13261
|
+
useLayoutEffect(() => panel ? keepPanelStop(panel) : void 0, [panel]);
|
|
13227
13262
|
if (activeTab !== value) return null;
|
|
13228
13263
|
return /* @__PURE__ */ jsx(
|
|
13229
13264
|
"div",
|
|
13230
13265
|
{
|
|
13231
|
-
|
|
13266
|
+
ref: setPanel,
|
|
13267
|
+
id: `ds-tabpanel-${scope}${value}`,
|
|
13232
13268
|
role: "tabpanel",
|
|
13233
|
-
"aria-labelledby": `ds-tab-${value}`,
|
|
13234
|
-
tabIndex: 0,
|
|
13269
|
+
"aria-labelledby": `ds-tab-${scope}${value}`,
|
|
13235
13270
|
className: cn(FOCUS_RING, className),
|
|
13236
13271
|
children
|
|
13237
13272
|
}
|
|
@@ -13254,6 +13289,7 @@ function TabsRoot(props) {
|
|
|
13254
13289
|
const arrayOverflow = arrayApi && props.tabs.some((t) => t.truncate) ? "truncate" : overflow;
|
|
13255
13290
|
const [focusedTab, setFocusedTab] = useState(null);
|
|
13256
13291
|
const stopTab = focusedTab ?? activeTab;
|
|
13292
|
+
const scope = useId();
|
|
13257
13293
|
const track = useScrollTrack(stopTab, arrayApi && effectiveOrientation === "horizontal" && arrayOverflow === "scroll");
|
|
13258
13294
|
if ("tabs" in props && props.tabs) {
|
|
13259
13295
|
const { tabs, mobile = "scroll" } = props;
|
|
@@ -13295,14 +13331,14 @@ function TabsRoot(props) {
|
|
|
13295
13331
|
children: tab.group
|
|
13296
13332
|
}
|
|
13297
13333
|
),
|
|
13298
|
-
/* @__PURE__ */ jsx(TabButton, { hasPanel: false, ...tab, orientation: effectiveOrientation, activeTab, onTabChange, fullWidth, isTabStop: i === stopIndex, setFocusedTab, onKeyDown: (e) => handleTabKeyDown(e, tab.id, () => tabs, effectiveOrientation, select) })
|
|
13334
|
+
/* @__PURE__ */ jsx(TabButton, { hasPanel: false, ...tab, scope, orientation: effectiveOrientation, activeTab, onTabChange, fullWidth, isTabStop: i === stopIndex, setFocusedTab, onKeyDown: (e) => handleTabKeyDown(e, tab.id, () => tabs, effectiveOrientation, select) })
|
|
13299
13335
|
] }, tab.id))
|
|
13300
13336
|
}
|
|
13301
13337
|
);
|
|
13302
13338
|
}
|
|
13303
|
-
return /* @__PURE__ */ jsx(TabStrip, { overflow: arrayOverflow, fullWidth, track, label: ariaLabel, className, children: tabs.map((tab, i) => /* @__PURE__ */ jsx(TabButton, { hasPanel: false, ...tab, orientation: effectiveOrientation, activeTab, onTabChange, fullWidth, isTabStop: i === stopIndex, setFocusedTab, onKeyDown: (e) => handleTabKeyDown(e, tab.id, () => tabs, effectiveOrientation, select) }, tab.id)) });
|
|
13339
|
+
return /* @__PURE__ */ jsx(TabStrip, { overflow: arrayOverflow, fullWidth, track, label: ariaLabel, className, children: tabs.map((tab, i) => /* @__PURE__ */ jsx(TabButton, { hasPanel: false, ...tab, scope, orientation: effectiveOrientation, activeTab, onTabChange, fullWidth, isTabStop: i === stopIndex, setFocusedTab, onKeyDown: (e) => handleTabKeyDown(e, tab.id, () => tabs, effectiveOrientation, select) }, tab.id)) });
|
|
13304
13340
|
}
|
|
13305
|
-
return /* @__PURE__ */ jsx(TabsContext.Provider, { value: { activeTab, onTabChange, orientation: effectiveOrientation, fullWidth, overflow, activation, stopTab, setFocusedTab, label: ariaLabel }, children: /* @__PURE__ */ jsx("div", { className, children: props.children }) });
|
|
13341
|
+
return /* @__PURE__ */ jsx(TabsContext.Provider, { value: { activeTab, onTabChange, orientation: effectiveOrientation, fullWidth, overflow, activation, stopTab, setFocusedTab, label: ariaLabel, scope }, children: /* @__PURE__ */ jsx("div", { className, children: props.children }) });
|
|
13306
13342
|
}
|
|
13307
13343
|
var Tabs = Object.assign(TabsRoot, {
|
|
13308
13344
|
List: TabsList,
|