@dreamtree-org/twreact-ui 1.3.10 → 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/README.md +70 -6
- package/ai-skills/dreamtree-ui.md +58 -15
- package/codemods/v2.cjs +198 -0
- package/dist/ai-schema.json +745 -53
- package/dist/charts/index.js +195 -66
- package/dist/components/blocks/AppShell.d.ts.map +1 -1
- package/dist/components/blocks/BottomActionBar.d.ts +6 -0
- package/dist/components/blocks/BottomActionBar.d.ts.map +1 -0
- package/dist/components/blocks/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/blocks/PageHeader.d.ts.map +1 -1
- package/dist/components/charts/CartesianChart.d.ts.map +1 -1
- package/dist/components/charts/ChartFrame.d.ts.map +1 -1
- package/dist/components/charts/useChartLayout.d.ts +25 -0
- package/dist/components/charts/useChartLayout.d.ts.map +1 -0
- package/dist/components/core/Button.d.ts.map +1 -1
- package/dist/components/core/Checkbox.d.ts.map +1 -1
- package/dist/components/core/ColorPicker.d.ts.map +1 -1
- package/dist/components/core/DatePicker.d.ts.map +1 -1
- package/dist/components/core/DateRangePicker.d.ts.map +1 -1
- package/dist/components/core/Form.d.ts.map +1 -1
- package/dist/components/core/Input.d.ts.map +1 -1
- package/dist/components/core/Loader.d.ts.map +1 -1
- package/dist/components/core/LocationPicker.d.ts.map +1 -1
- package/dist/components/core/Popover.d.ts.map +1 -1
- package/dist/components/core/ProgressBar.d.ts.map +1 -1
- package/dist/components/core/Radio.d.ts.map +1 -1
- package/dist/components/core/Rate.d.ts.map +1 -1
- package/dist/components/core/RoundedTag.d.ts.map +1 -1
- package/dist/components/core/SearchField.d.ts +9 -0
- package/dist/components/core/SearchField.d.ts.map +1 -0
- package/dist/components/core/SegmentedControl.d.ts +8 -0
- package/dist/components/core/SegmentedControl.d.ts.map +1 -0
- package/dist/components/core/Select.d.ts.map +1 -1
- package/dist/components/core/Skeleton.d.ts.map +1 -1
- package/dist/components/core/Slider.d.ts.map +1 -1
- package/dist/components/core/SpeechToText.d.ts.map +1 -1
- package/dist/components/core/SwipeableListItem.d.ts +4 -0
- package/dist/components/core/SwipeableListItem.d.ts.map +1 -0
- package/dist/components/core/SwipeableListItemGesture.d.ts +58 -0
- package/dist/components/core/SwipeableListItemGesture.d.ts.map +1 -0
- package/dist/components/core/Switch.d.ts.map +1 -1
- package/dist/components/core/Table/ActionMenu.d.ts +10 -3
- package/dist/components/core/Table/ActionMenu.d.ts.map +1 -1
- package/dist/components/core/Table/MobileCard.d.ts +10 -1
- package/dist/components/core/Table/MobileCard.d.ts.map +1 -1
- package/dist/components/core/Table/MobileFilters.d.ts +8 -2
- package/dist/components/core/Table/MobileFilters.d.ts.map +1 -1
- package/dist/components/core/Table/Table.d.ts.map +1 -1
- package/dist/components/core/Table/TableRow.d.ts +2 -1
- package/dist/components/core/Table/TableRow.d.ts.map +1 -1
- package/dist/components/core/Tabs.d.ts +5 -8
- package/dist/components/core/Tabs.d.ts.map +1 -1
- package/dist/components/core/Textarea.d.ts.map +1 -1
- package/dist/components/core/ThreeDotPopover.d.ts +10 -22
- package/dist/components/core/ThreeDotPopover.d.ts.map +1 -1
- package/dist/components/core/Tooltip.d.ts +2 -1
- package/dist/components/core/Tooltip.d.ts.map +1 -1
- package/dist/components/core/internal/Calendar.d.ts +77 -0
- package/dist/components/core/internal/Calendar.d.ts.map +1 -0
- package/dist/components/core/menu/ActionMenuSurface.d.ts +42 -0
- package/dist/components/core/menu/ActionMenuSurface.d.ts.map +1 -0
- package/dist/components/core/menu/ActionSheetMenu.d.ts +17 -0
- package/dist/components/core/menu/ActionSheetMenu.d.ts.map +1 -0
- package/dist/components/core/menu/MenuPopover.d.ts +21 -0
- package/dist/components/core/menu/MenuPopover.d.ts.map +1 -0
- package/dist/components/core/menu/menuItems.d.ts +21 -0
- package/dist/components/core/menu/menuItems.d.ts.map +1 -0
- package/dist/components/core/menu/menuKeyboard.d.ts +16 -0
- package/dist/components/core/menu/menuKeyboard.d.ts.map +1 -0
- package/dist/components/feedback/ActionSheet.d.ts +4 -0
- package/dist/components/feedback/ActionSheet.d.ts.map +1 -0
- package/dist/components/feedback/Alert.d.ts.map +1 -1
- package/dist/components/feedback/Dialog.d.ts.map +1 -1
- package/dist/components/feedback/Drawer.d.ts.map +1 -1
- package/dist/components/feedback/Sheet.d.ts +4 -0
- package/dist/components/feedback/Sheet.d.ts.map +1 -0
- package/dist/components/feedback/Toast.d.ts +4 -3
- package/dist/components/feedback/Toast.d.ts.map +1 -1
- package/dist/components/feedback/ToastItem.d.ts +47 -0
- package/dist/components/feedback/ToastItem.d.ts.map +1 -0
- package/dist/components/feedback/ToastStack.d.ts +20 -0
- package/dist/components/feedback/ToastStack.d.ts.map +1 -0
- package/dist/components/feedback/ToastSwipe.d.ts +22 -0
- package/dist/components/feedback/ToastSwipe.d.ts.map +1 -0
- package/dist/components/feedback/Tour.d.ts.map +1 -1
- package/dist/components/feedback/sheetCore.d.ts +30 -0
- package/dist/components/feedback/sheetCore.d.ts.map +1 -0
- package/dist/components/navigation/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/navigation/FootNav.d.ts.map +1 -1
- package/dist/components/navigation/Navbar.d.ts.map +1 -1
- package/dist/components/navigation/Sidebar.d.ts +6 -0
- package/dist/components/navigation/Sidebar.d.ts.map +1 -1
- package/dist/components/rich-text/RichTextEditor.d.ts.map +1 -1
- package/dist/components/rich-text/RichTextToolbar.d.ts +6 -2
- package/dist/components/rich-text/RichTextToolbar.d.ts.map +1 -1
- package/dist/components/utility/Avatar.d.ts +8 -0
- package/dist/components/utility/Avatar.d.ts.map +1 -1
- package/dist/components/utility/AvatarGroup.d.ts +4 -0
- package/dist/components/utility/AvatarGroup.d.ts.map +1 -0
- package/dist/components/utility/Badge.d.ts.map +1 -1
- package/dist/components/utility/Card.d.ts.map +1 -1
- package/dist/components/utility/Carousel.d.ts.map +1 -1
- package/dist/components/utility/FileUpload.d.ts.map +1 -1
- package/dist/components/utility/Pagination.d.ts.map +1 -1
- package/dist/components/utility/PullToRefresh.d.ts +5 -0
- package/dist/components/utility/PullToRefresh.d.ts.map +1 -0
- package/dist/components/utility/Sortable.d.ts.map +1 -1
- package/dist/components/utility/Stepper.d.ts.map +1 -1
- package/dist/esm/components/blocks/AppShell.js +97 -90
- package/dist/esm/components/blocks/BottomActionBar.js +132 -0
- package/dist/esm/components/blocks/ConfirmDialog.js +40 -4
- package/dist/esm/components/blocks/EmptyState.js +1 -1
- package/dist/esm/components/blocks/ErrorState.js +1 -1
- package/dist/esm/components/blocks/LoadingState.js +4 -4
- package/dist/esm/components/blocks/PageHeader.js +16 -3
- package/dist/esm/components/blocks/StatCard.js +6 -6
- package/dist/esm/components/blocks/StatusPill.js +5 -8
- package/dist/esm/components/charts/CartesianChart.js +85 -62
- package/dist/esm/components/charts/ChartFrame.js +12 -5
- package/dist/esm/components/charts/useChartLayout.js +105 -0
- package/dist/esm/components/core/Button.js +49 -25
- package/dist/esm/components/core/Checkbox.js +72 -57
- package/dist/esm/components/core/ColorPicker.js +31 -42
- package/dist/esm/components/core/DatePicker.js +117 -304
- package/dist/esm/components/core/DateRangePicker.js +260 -308
- package/dist/esm/components/core/Form.js +11 -2
- package/dist/esm/components/core/Input.js +100 -38
- package/dist/esm/components/core/Loader.js +30 -44
- package/dist/esm/components/core/LocationPicker.js +82 -16
- package/dist/esm/components/core/Popover.js +59 -48
- package/dist/esm/components/core/ProgressBar.js +40 -72
- package/dist/esm/components/core/Radio.js +10 -12
- package/dist/esm/components/core/Rate.js +77 -14
- package/dist/esm/components/core/RoundedTag.js +5 -5
- package/dist/esm/components/core/SearchField.js +311 -0
- package/dist/esm/components/core/SegmentedControl.js +189 -0
- package/dist/esm/components/core/Select.js +185 -190
- package/dist/esm/components/core/Skeleton.js +13 -14
- package/dist/esm/components/core/Slider.js +24 -6
- package/dist/esm/components/core/SpeechToText.js +68 -16
- package/dist/esm/components/core/SwipeableListItem.js +286 -0
- package/dist/esm/components/core/SwipeableListItemGesture.js +219 -0
- package/dist/esm/components/core/Switch.js +98 -28
- package/dist/esm/components/core/Table/ActionMenu.js +45 -231
- package/dist/esm/components/core/Table/ColumnMenu.js +1 -1
- package/dist/esm/components/core/Table/MobileCard.js +66 -16
- package/dist/esm/components/core/Table/MobileFilters.js +181 -10
- package/dist/esm/components/core/Table/Table.js +149 -102
- package/dist/esm/components/core/Table/TableRow.js +10 -2
- package/dist/esm/components/core/Tabs.js +186 -39
- package/dist/esm/components/core/Textarea.js +10 -2
- package/dist/esm/components/core/ThreeDotPopover.js +93 -99
- package/dist/esm/components/core/Tooltip.js +138 -145
- package/dist/esm/components/core/internal/Calendar.js +381 -0
- package/dist/esm/components/core/menu/ActionMenuSurface.js +110 -0
- package/dist/esm/components/core/menu/ActionSheetMenu.js +140 -0
- package/dist/esm/components/core/menu/MenuPopover.js +177 -0
- package/dist/esm/components/core/menu/menuItems.js +61 -0
- package/dist/esm/components/core/menu/menuKeyboard.js +54 -0
- package/dist/esm/components/feedback/ActionSheet.js +55 -0
- package/dist/esm/components/feedback/Alert.js +63 -53
- package/dist/esm/components/feedback/Dialog.js +141 -53
- package/dist/esm/components/feedback/Drawer.js +130 -132
- package/dist/esm/components/feedback/Sheet.js +125 -0
- package/dist/esm/components/feedback/Toast.js +21 -291
- package/dist/esm/components/feedback/ToastItem.js +348 -0
- package/dist/esm/components/feedback/ToastStack.js +130 -0
- package/dist/esm/components/feedback/ToastSwipe.js +52 -0
- package/dist/esm/components/feedback/Tour.js +107 -30
- package/dist/esm/components/feedback/sheetCore.js +494 -0
- package/dist/esm/components/navigation/Breadcrumbs.js +97 -35
- package/dist/esm/components/navigation/Dropdown.js +1 -1
- package/dist/esm/components/navigation/FootNav.js +102 -13
- package/dist/esm/components/navigation/Navbar.js +172 -37
- package/dist/esm/components/navigation/Sidebar.js +263 -111
- package/dist/esm/components/rich-text/RichTextEditor.js +9 -3
- package/dist/esm/components/rich-text/RichTextToolbar.js +29 -9
- package/dist/esm/components/utility/Avatar.js +14 -12
- package/dist/esm/components/utility/AvatarGroup.js +56 -0
- package/dist/esm/components/utility/Badge.js +43 -23
- package/dist/esm/components/utility/Card.js +32 -8
- package/dist/esm/components/utility/Carousel.js +139 -29
- package/dist/esm/components/utility/FileUpload.js +106 -31
- package/dist/esm/components/utility/Pagination.js +31 -13
- package/dist/esm/components/utility/Portal.js +31 -0
- package/dist/esm/components/utility/PullToRefresh.js +229 -0
- package/dist/esm/components/utility/Sortable.js +6 -2
- package/dist/esm/components/utility/Stepper.js +110 -47
- package/dist/esm/hooks/useFloatingPosition.js +82 -0
- package/dist/esm/hooks/useHaptics.js +65 -0
- package/dist/esm/hooks/usePresence.js +58 -0
- package/dist/esm/hooks/usePresentation.js +21 -0
- package/dist/esm/hooks/useSheetDrag.js +220 -0
- package/dist/esm/hooks/useSliderValues.js +8 -2
- package/dist/esm/hooks/useSortable.js +107 -5
- package/dist/esm/index.js +14 -2
- package/dist/esm/utils/position.js +10 -63
- package/dist/esm/utils/touchTarget.js +4 -1
- package/dist/hooks/useFloatingPosition.d.ts +8 -4
- package/dist/hooks/useFloatingPosition.d.ts.map +1 -1
- package/dist/hooks/useHaptics.d.ts +19 -0
- package/dist/hooks/useHaptics.d.ts.map +1 -0
- package/dist/hooks/useSheetDrag.d.ts +31 -0
- package/dist/hooks/useSheetDrag.d.ts.map +1 -0
- package/dist/hooks/useSliderValues.d.ts +6 -2
- package/dist/hooks/useSliderValues.d.ts.map +1 -1
- package/dist/hooks/useSortable.d.ts +11 -1
- package/dist/hooks/useSortable.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +11 -2
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +10645 -3842
- package/dist/index.js +10657 -3845
- package/dist/rich-text/index.js +41 -11
- package/dist/types/blocks.d.ts +32 -2
- package/dist/types/blocks.d.ts.map +1 -1
- package/dist/types/charts.d.ts +3 -1
- package/dist/types/charts.d.ts.map +1 -1
- package/dist/types/index.d.ts +409 -26
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/rich-text.d.ts +5 -0
- package/dist/types/rich-text.d.ts.map +1 -1
- package/dist/utils/position.d.ts +0 -15
- package/dist/utils/position.d.ts.map +1 -1
- package/doc/README.md +16 -0
- package/mcp/catalog.snapshot.json +1540 -407
- package/package.json +7 -2
- package/dist/esm/hooks/useSwipeToClose.js +0 -66
- package/dist/hooks/useSwipeToClose.d.ts +0 -24
- package/dist/hooks/useSwipeToClose.d.ts.map +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Calls the consumer's handler first, then ours. */
|
|
2
|
+
export function mergeHandlers(ours: any, theirs: any): {};
|
|
3
|
+
export const SHEET_PLACEMENTS: string[];
|
|
4
|
+
/**
|
|
5
|
+
* Context for parts rendered inside the core: drag handlers for the grab zone
|
|
6
|
+
* (header) and the scrolling body, ids, and `requestClose(reason)`.
|
|
7
|
+
*/
|
|
8
|
+
export const SheetContext: React.Context<null>;
|
|
9
|
+
/**
|
|
10
|
+
* The shared sheet core. Internal: `Sheet` and `Drawer` wrap it.
|
|
11
|
+
*
|
|
12
|
+
* Beyond Sheet's own props it takes the chrome its wrappers vary:
|
|
13
|
+
* - `dragEnabled` (default true): turns the drag gesture on.
|
|
14
|
+
* - `hasTitle` / `hasDescription`: wire `aria-labelledby` / `aria-describedby`.
|
|
15
|
+
* - `idPrefix`, `testIdPrefix`: ids (`<prefix>-title-…`) and test ids
|
|
16
|
+
* (`<prefix>-backdrop`, `<prefix>-handle`).
|
|
17
|
+
* - `panelClassName`: base + placement + size classes for the panel.
|
|
18
|
+
* - `handleBarClassName`: the grab handle's bar.
|
|
19
|
+
* - `renderHeader({ titleId, descriptionId, requestClose, showHandle, side })`:
|
|
20
|
+
* rendered before `children`, inside the context.
|
|
21
|
+
*/
|
|
22
|
+
export const SheetCore: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
23
|
+
export function SheetCloseButton({ onClick, label, className }: {
|
|
24
|
+
onClick: any;
|
|
25
|
+
label: any;
|
|
26
|
+
className: any;
|
|
27
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export default SheetCore;
|
|
29
|
+
import React from "react";
|
|
30
|
+
//# sourceMappingURL=sheetCore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheetCore.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/sheetCore.jsx"],"names":[],"mappings":"AA0HA,qDAAqD;AACrD,0DASC;AAjHD,wCAAmE;AAmHnE;;;GAGG;AACH,+CAAgD;AAEhD;;;;;;;;;;;;GAYG;AACH,kFAwSE;AAKK;;;;4CAcN;;kBApdoH,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/Breadcrumbs.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/Breadcrumbs.jsx"],"names":[],"mappings":";AA4BA,qFA4GG;kBAxIgD,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FootNav.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/FootNav.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"FootNav.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/FootNav.jsx"],"names":[],"mappings":";AAoDA,iFAuFG;kBA3Ie,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Navbar.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/Navbar.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Navbar.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/Navbar.jsx"],"names":[],"mappings":"AAmQA,+EAiYG;;kBAnoBmF,OAAO"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export const SIDEBAR_DESKTOP_QUERY: "(min-width: 768px)";
|
|
1
2
|
export default Sidebar;
|
|
2
3
|
/**
|
|
3
4
|
* Sidebar component with custom tooltip for collapsed mode.
|
|
@@ -16,6 +17,11 @@ export default Sidebar;
|
|
|
16
17
|
* - drawerPosition: 'left' | 'right'
|
|
17
18
|
* - isMobileOpen, setIsMobileOpen
|
|
18
19
|
* - showCollapsedTooltips: boolean (default true)
|
|
20
|
+
* - swipeable: boolean (default true) — phones: swipe in from the screen edge
|
|
21
|
+
* to open the drawer, swipe it back toward its edge to close
|
|
22
|
+
*
|
|
23
|
+
* The content renders once: a sticky column from `md` up, an off-canvas
|
|
24
|
+
* drawer (modal dialog while open) below.
|
|
19
25
|
*/
|
|
20
26
|
declare const Sidebar: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
21
27
|
import React from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/Sidebar.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/Sidebar.jsx"],"names":[],"mappings":"AAqBA,oCAAqC,oBAAoB,CAAC;;AAoJ1D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,iFA0kBG;kBAlwBI,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.d.ts","sourceRoot":"","sources":["../../../src/components/rich-text/RichTextEditor.jsx"],"names":[],"mappings":";AA2BA,
|
|
1
|
+
{"version":3,"file":"RichTextEditor.d.ts","sourceRoot":"","sources":["../../../src/components/rich-text/RichTextEditor.jsx"],"names":[],"mappings":";AA2BA,wFA2LE;kBAtN+E,OAAO"}
|
|
@@ -18,17 +18,21 @@ export function selectToolbarState(editor: any): {
|
|
|
18
18
|
} | null;
|
|
19
19
|
/** Normalises a typed URL; returns null for schemes we refuse (javascript:, data:, …). */
|
|
20
20
|
export function normalizeUrl(raw: any): string | null;
|
|
21
|
+
/** `top` offset for a sticky toolbar: `true` → 0, a number → px, a string → any CSS length. */
|
|
22
|
+
export function stickyTop(sticky: any): string;
|
|
21
23
|
/**
|
|
22
24
|
* A WAI-ARIA toolbar: one tab stop, arrow keys / Home / End move between the
|
|
23
|
-
* buttons (roving tabindex), toggles report `aria-pressed`.
|
|
25
|
+
* buttons (roving tabindex), toggles report `aria-pressed`. With `sticky` it
|
|
26
|
+
* stays pinned to the top of the scrolling page while the content scrolls.
|
|
24
27
|
*/
|
|
25
|
-
export function RichTextToolbar({ editor, state, items, disabled, controlsId, label }: {
|
|
28
|
+
export function RichTextToolbar({ editor, state, items, disabled, controlsId, label, sticky }: {
|
|
26
29
|
editor: any;
|
|
27
30
|
state: any;
|
|
28
31
|
items: any;
|
|
29
32
|
disabled: any;
|
|
30
33
|
controlsId: any;
|
|
31
34
|
label?: string | undefined;
|
|
35
|
+
sticky?: boolean | undefined;
|
|
32
36
|
}): import("react/jsx-runtime").JSX.Element;
|
|
33
37
|
export namespace TOOLBAR_ITEMS {
|
|
34
38
|
namespace bold {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/rich-text/RichTextToolbar.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RichTextToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/rich-text/RichTextToolbar.jsx"],"names":[],"mappings":"AAwDA,uFAAuF;AACvF;;;;;;;;;;;;;;;;SAmBC;AAKD,0FAA0F;AAC1F,sDAMC;AA4FD,+FAA+F;AAC/F,+CAIC;AAED;;;;GAIG;AACH;;;;;;;;4CAyFC;;;;;;;;QAhQ0F,iCAAqB;;;;;;;;;;;;QACf,mCAAuB;;;;;;;;;;;;;QACH,mCAAuB;;;;;;;;;;;;;QAC1C,mCAAqB;;;;;;;;;;;;;QACV,mCAAoC;;;;;;;;;;;;;QACpC,mCAAoC;;;;;;;;;;;;;QACpC,mCAAoC;;;;;;;;;;;;;QAChC,mCAA2B;;;;;;;;;;;;;QACnB,mCAA4B;;;;;;;;;;;;;QAC3C,mCAA2B;;;;;;;;;;;;;QACpB,oCAA0B;;;;;;;;;;;;;;;;;;;;QAE5D,oCAAe;;;;;;;;;;;QACT,oCAAe;;;;AAGpG,uCAaE;qBAtCK,cAAc;uBAAd,cAAc;8BAAd,cAAc;qBAAd,cAAc;yBAAd,cAAc;yBAAd,cAAc;yBAAd,cAAc;qBAAd,cAAc;4BAAd,cAAc;sBAAd,cAAc;2BAAd,cAAc;iCAAd,cAAc;qBAAd,cAAc;qBAAd,cAAc"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
export const AVATAR_SIZES: {
|
|
2
|
+
xs: string;
|
|
3
|
+
sm: string;
|
|
4
|
+
md: string;
|
|
5
|
+
lg: string;
|
|
6
|
+
xl: string;
|
|
7
|
+
'2xl': string;
|
|
8
|
+
};
|
|
1
9
|
export default Avatar;
|
|
2
10
|
declare const Avatar: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
3
11
|
import React from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/components/utility/Avatar.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/components/utility/Avatar.jsx"],"names":[],"mappings":"AAKA;;;;;;;EAOE;;AAEF,gFA6GG;kBA3He,OAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AvatarGroup.d.ts","sourceRoot":"","sources":["../../../src/components/utility/AvatarGroup.jsx"],"names":[],"mappings":";AAkBA,qFA2CG;kBA7De,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/utility/Badge.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/utility/Badge.jsx"],"names":[],"mappings":";AA8BA,+EAuCG;kBArEe,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/utility/Card.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/utility/Card.jsx"],"names":[],"mappings":";AAYA,8EAyCG;kBArDe,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../../src/components/utility/Carousel.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../../src/components/utility/Carousel.jsx"],"names":[],"mappings":"AA2BA,iFAkME;;kBA7NgB,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUpload.d.ts","sourceRoot":"","sources":["../../../src/components/utility/FileUpload.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"FileUpload.d.ts","sourceRoot":"","sources":["../../../src/components/utility/FileUpload.jsx"],"names":[],"mappings":";AAqBA,oFA4OG;kBAjQkD,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/components/utility/Pagination.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/components/utility/Pagination.jsx"],"names":[],"mappings":";AAkBA,oFA4IG;kBA9Je,OAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PullToRefresh.d.ts","sourceRoot":"","sources":["../../../src/components/utility/PullToRefresh.jsx"],"names":[],"mappings":"AAeA,wDAGC;;AAED,uFAkMG;kBAtN4D,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sortable.d.ts","sourceRoot":"","sources":["../../../src/components/utility/Sortable.jsx"],"names":[],"mappings":";AAqBA,
|
|
1
|
+
{"version":3,"file":"Sortable.d.ts","sourceRoot":"","sources":["../../../src/components/utility/Sortable.jsx"],"names":[],"mappings":";AAqBA,kFAsHG;kBA3I0G,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../../src/components/utility/Stepper.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../../src/components/utility/Stepper.jsx"],"names":[],"mappings":";AAgEA,iFAqIG;kBArMe,OAAO"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2, createForOfIteratorHelper as _createForOfIteratorHelper } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
-
import { jsxs,
|
|
3
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import React, { useState, useRef, useCallback } from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { Menu, X } from 'lucide-react';
|
|
6
6
|
import { cn } from '../../utils/cn.js';
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
7
|
+
import { TOUCH_TARGET } from '../../utils/touchTarget.js';
|
|
8
|
+
import Sheet from '../feedback/Sheet.js';
|
|
9
|
+
import FootNav from '../navigation/FootNav.js';
|
|
9
10
|
|
|
10
|
-
var _excluded = ["brand", "nav", "sidebarFooter", "topbar", "pageTitle", "linkAs", "children", "className"];
|
|
11
|
+
var _excluded = ["brand", "nav", "sidebarFooter", "topbar", "pageTitle", "bottomNav", "linkAs", "children", "className"];
|
|
11
12
|
// Extracted from procurementpro/components/app-shell.tsx (12 of 13 products hand-roll a shell).
|
|
12
|
-
// Sidebar on lg+, top bar + drawer below. Colours come from the
|
|
13
|
-
//
|
|
13
|
+
// Sidebar on lg+, top bar + drawer below, optional bottom nav on phones. Colours come from the
|
|
14
|
+
// shell / role tokens, so a brand file restyles it and dark mode needs no extra classes. Nav items
|
|
15
|
+
// render with `linkAs` (pass Next.js Link) so links prefetch and open in new tabs.
|
|
14
16
|
var NavList = function NavList(_ref) {
|
|
15
17
|
var nav = _ref.nav,
|
|
16
18
|
Link = _ref.Link,
|
|
@@ -41,7 +43,7 @@ var NavList = function NavList(_ref) {
|
|
|
41
43
|
}
|
|
42
44
|
return jsx("nav", {
|
|
43
45
|
"aria-label": "Main navigation",
|
|
44
|
-
className: "flex-1 overflow-y-auto px-3 pb-4",
|
|
46
|
+
className: "flex-1 overflow-y-auto overscroll-contain px-3 pb-4",
|
|
45
47
|
children: groups.map(function (g) {
|
|
46
48
|
return jsxs("div", {
|
|
47
49
|
className: "mb-3",
|
|
@@ -60,11 +62,11 @@ var NavList = function NavList(_ref) {
|
|
|
60
62
|
className: "flex-1 truncate",
|
|
61
63
|
children: item.label
|
|
62
64
|
}), item.count > 0 && jsx("span", {
|
|
63
|
-
className: "rounded-full bg-
|
|
65
|
+
className: "rounded-full bg-shell-foreground/15 px-2 py-0.5 text-xs font-semibold text-shell-foreground",
|
|
64
66
|
children: item.count
|
|
65
67
|
})]
|
|
66
68
|
});
|
|
67
|
-
var cls = cn('flex h-10 w-full items-center gap-3 rounded-control px-3 text-sm transition-colors focus:outline-none focus:ring-2 focus:ring-primary-400', item.active ? 'bg-shell-active font-semibold text-
|
|
69
|
+
var cls = cn('flex h-10 w-full items-center gap-3 rounded-control px-3 text-sm transition-colors duration-fast motion-reduce:transition-none', '[@media(pointer:coarse)]:h-11', 'focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-400', item.active ? 'bg-shell-active font-semibold text-shell-foreground' : 'text-shell-foreground/85 hover:bg-shell-active/60 hover:text-shell-foreground');
|
|
68
70
|
var handle = function handle() {
|
|
69
71
|
var _item$onClick;
|
|
70
72
|
(_item$onClick = item.onClick) === null || _item$onClick === void 0 || _item$onClick.call(item);
|
|
@@ -97,6 +99,7 @@ var AppShell = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
|
97
99
|
sidebarFooter = _ref2.sidebarFooter,
|
|
98
100
|
topbar = _ref2.topbar,
|
|
99
101
|
pageTitle = _ref2.pageTitle,
|
|
102
|
+
bottomNav = _ref2.bottomNav,
|
|
100
103
|
_ref2$linkAs = _ref2.linkAs,
|
|
101
104
|
Link = _ref2$linkAs === void 0 ? 'a' : _ref2$linkAs,
|
|
102
105
|
children = _ref2.children,
|
|
@@ -107,102 +110,106 @@ var AppShell = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
|
107
110
|
open = _useState2[0],
|
|
108
111
|
setOpen = _useState2[1];
|
|
109
112
|
var menuButton = useRef(null);
|
|
110
|
-
var drawer = useRef(null);
|
|
111
113
|
var close = useCallback(function () {
|
|
112
114
|
return setOpen(false);
|
|
113
115
|
}, []);
|
|
114
|
-
//
|
|
115
|
-
//
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
116
|
+
// The mobile drawer is a left Sheet: a modal dialog that moves focus in, traps
|
|
117
|
+
// Tab, closes on Escape / backdrop / drag, locks the page behind and returns
|
|
118
|
+
// focus to the menu button.
|
|
119
|
+
var onDrawerClose = function onDrawerClose(reason) {
|
|
120
|
+
var _menuButton$current;
|
|
121
|
+
close();
|
|
122
|
+
// Some browsers (Safari) don't focus a clicked button, so the opener may be <body>.
|
|
123
|
+
if (reason === 'escape') (_menuButton$current = menuButton.current) === null || _menuButton$current === void 0 || _menuButton$current.focus();
|
|
124
|
+
};
|
|
125
|
+
var sidebar = function sidebar(inDrawer) {
|
|
126
|
+
return jsxs(Fragment, {
|
|
127
|
+
children: [jsxs("div", {
|
|
128
|
+
className: "flex items-center justify-between px-5 pb-4 pt-5 text-shell-foreground",
|
|
129
|
+
children: [jsx("div", {
|
|
130
|
+
className: "min-w-0",
|
|
131
|
+
children: brand
|
|
132
|
+
}), inDrawer && jsx("button", {
|
|
133
|
+
type: "button",
|
|
134
|
+
className: cn('inline-flex items-center justify-center rounded-control p-1.5 text-shell-foreground hover:bg-shell-active', 'focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-400', TOUCH_TARGET),
|
|
135
|
+
onClick: close,
|
|
136
|
+
"aria-label": "Close navigation",
|
|
137
|
+
children: jsx(X, {
|
|
138
|
+
className: "h-5 w-5",
|
|
139
|
+
"aria-hidden": "true"
|
|
140
|
+
})
|
|
141
|
+
})]
|
|
142
|
+
}), jsx(NavList, {
|
|
143
|
+
nav: nav,
|
|
144
|
+
Link: Link,
|
|
145
|
+
onNavigate: close
|
|
146
|
+
}), sidebarFooter && jsx("div", {
|
|
147
|
+
className: "border-t border-shell-active p-3",
|
|
148
|
+
children: sidebarFooter
|
|
141
149
|
})]
|
|
142
|
-
})
|
|
143
|
-
|
|
144
|
-
Link: Link,
|
|
145
|
-
onNavigate: close
|
|
146
|
-
}), sidebarFooter && jsx("div", {
|
|
147
|
-
className: "border-t border-white/10 p-3",
|
|
148
|
-
children: sidebarFooter
|
|
149
|
-
})]
|
|
150
|
-
});
|
|
150
|
+
});
|
|
151
|
+
};
|
|
151
152
|
return jsxs("div", _objectSpread2(_objectSpread2({
|
|
152
153
|
ref: ref,
|
|
153
|
-
className: cn('min-h-
|
|
154
|
+
className: cn('min-h-dvh bg-background text-foreground lg:grid lg:grid-cols-[16rem_minmax(0,1fr)]', className)
|
|
154
155
|
}, props), {}, {
|
|
155
156
|
children: [jsx("a", {
|
|
156
157
|
href: "#main",
|
|
157
|
-
className: "sr-only focus:not-sr-only focus:absolute focus:left-2 focus:top-2 focus:z-
|
|
158
|
+
className: "sr-only focus:not-sr-only focus:absolute focus:left-2 focus:top-2 focus:z-toast focus:rounded-control focus:bg-surface focus:px-3 focus:py-2 focus:text-foreground focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
158
159
|
children: "Skip to content"
|
|
159
160
|
}), jsx("aside", {
|
|
160
|
-
className: "sticky top-0 hidden h-
|
|
161
|
+
className: "sticky top-0 hidden h-dvh flex-col bg-shell pb-safe pl-safe pt-safe lg:flex",
|
|
161
162
|
"aria-label": "Sidebar",
|
|
162
|
-
children: sidebar
|
|
163
|
-
}),
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
ref: drawer,
|
|
171
|
-
role: "dialog",
|
|
172
|
-
"aria-modal": "true",
|
|
173
|
-
"aria-label": "Navigation",
|
|
174
|
-
tabIndex: -1,
|
|
175
|
-
className: "absolute inset-y-0 left-0 flex w-72 max-w-[85%] flex-col bg-shell focus:outline-none",
|
|
176
|
-
children: sidebar
|
|
177
|
-
})]
|
|
163
|
+
children: sidebar(false)
|
|
164
|
+
}), jsx(Sheet, {
|
|
165
|
+
open: open,
|
|
166
|
+
onClose: onDrawerClose,
|
|
167
|
+
placement: "left",
|
|
168
|
+
"aria-label": "Navigation",
|
|
169
|
+
className: "w-72 max-w-[85%] border-shell-active bg-shell text-shell-foreground",
|
|
170
|
+
children: sidebar(true)
|
|
178
171
|
}), jsxs("div", {
|
|
179
172
|
className: "flex min-w-0 flex-col",
|
|
180
|
-
children: [
|
|
181
|
-
className: "sticky top-0 z-
|
|
182
|
-
children:
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
173
|
+
children: [jsx("header", {
|
|
174
|
+
className: "sticky top-0 z-sticky border-b border-line bg-surface pt-safe px-safe",
|
|
175
|
+
children: jsxs("div", {
|
|
176
|
+
className: "flex h-14 items-center gap-3 px-4 lg:px-6",
|
|
177
|
+
children: [jsx("button", {
|
|
178
|
+
ref: menuButton,
|
|
179
|
+
type: "button",
|
|
180
|
+
className: cn('-ml-1 inline-flex items-center justify-center rounded-control p-2 text-muted hover:bg-muted/10 hover:text-foreground lg:hidden', 'focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500', TOUCH_TARGET),
|
|
181
|
+
onClick: function onClick() {
|
|
182
|
+
return setOpen(true);
|
|
183
|
+
},
|
|
184
|
+
"aria-label": "Open navigation",
|
|
185
|
+
"aria-expanded": open,
|
|
186
|
+
"aria-haspopup": "dialog",
|
|
187
|
+
children: jsx(Menu, {
|
|
188
|
+
className: "h-5 w-5",
|
|
189
|
+
"aria-hidden": "true"
|
|
190
|
+
})
|
|
191
|
+
}), pageTitle && jsx("span", {
|
|
192
|
+
className: "truncate text-sm font-semibold text-foreground lg:hidden",
|
|
193
|
+
children: pageTitle
|
|
194
|
+
}), jsx("div", {
|
|
195
|
+
className: "ml-auto flex items-center gap-3",
|
|
196
|
+
children: topbar
|
|
197
|
+
})]
|
|
198
|
+
})
|
|
199
|
+
}), jsxs("div", {
|
|
200
|
+
className: "flex flex-1 flex-col px-safe",
|
|
201
|
+
children: [jsx("main", {
|
|
202
|
+
id: "main",
|
|
203
|
+
className: "mx-auto w-full max-w-7xl flex-1 px-4 py-6 md:px-8 md:py-8",
|
|
204
|
+
children: children
|
|
205
|
+
}), bottomNav && jsx(FootNav.Spacer, {
|
|
206
|
+
"data-slot": "bottom-nav-spacer"
|
|
200
207
|
})]
|
|
201
|
-
}), jsx("main", {
|
|
202
|
-
id: "main",
|
|
203
|
-
className: "mx-auto w-full max-w-7xl flex-1 px-4 py-6 md:px-8 md:py-8",
|
|
204
|
-
children: children
|
|
205
208
|
})]
|
|
209
|
+
}), bottomNav && jsx("div", {
|
|
210
|
+
className: "md:hidden",
|
|
211
|
+
"data-slot": "bottom-nav",
|
|
212
|
+
children: bottomNav
|
|
206
213
|
})]
|
|
207
214
|
}));
|
|
208
215
|
});
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import React, { useRef, useCallback, useSyncExternalStore, useEffect } from 'react';
|
|
5
|
+
import { cn } from '../../utils/cn.js';
|
|
6
|
+
import { setRefs } from '../../utils/position.js';
|
|
7
|
+
|
|
8
|
+
var _excluded = ["children", "position", "align", "fullWidth", "stackOnMobile", "keyboardAware", "className", "style"],
|
|
9
|
+
_excluded2 = ["className"];
|
|
10
|
+
// Sticky bar at the bottom of the screen for the primary action on forms and
|
|
11
|
+
// checkout pages (DTUI-57). Pads the home indicator (pb-safe), sits on the
|
|
12
|
+
// z-sticky layer and rides above the on-screen keyboard via visualViewport.
|
|
13
|
+
/** CSS variable the bar publishes with its height, read by BottomActionBar.Spacer. */
|
|
14
|
+
var BAR_HEIGHT_VAR = '--dt-bottom-action-bar-height';
|
|
15
|
+
// Part of the layout viewport the on-screen keyboard covers (0 without visualViewport).
|
|
16
|
+
function readKeyboardOffset() {
|
|
17
|
+
if (typeof window === 'undefined') return 0;
|
|
18
|
+
var vv = window.visualViewport;
|
|
19
|
+
if (!vv) return 0;
|
|
20
|
+
var inner = window.innerHeight || 0;
|
|
21
|
+
return Math.max(0, Math.round(inner - (vv.height || inner) - (vv.offsetTop || 0)));
|
|
22
|
+
}
|
|
23
|
+
var getServerOffset = function getServerOffset() {
|
|
24
|
+
return 0;
|
|
25
|
+
};
|
|
26
|
+
/** Keyboard offset in px while `active`; 0 on the server and without visualViewport. */
|
|
27
|
+
function useKeyboardOffset(active) {
|
|
28
|
+
var subscribe = useCallback(function (onChange) {
|
|
29
|
+
var _vv$addEventListener, _vv$addEventListener2;
|
|
30
|
+
if (!active || typeof window === 'undefined') return function () {};
|
|
31
|
+
var vv = window.visualViewport;
|
|
32
|
+
vv === null || vv === void 0 || (_vv$addEventListener = vv.addEventListener) === null || _vv$addEventListener === void 0 || _vv$addEventListener.call(vv, 'resize', onChange);
|
|
33
|
+
vv === null || vv === void 0 || (_vv$addEventListener2 = vv.addEventListener) === null || _vv$addEventListener2 === void 0 || _vv$addEventListener2.call(vv, 'scroll', onChange);
|
|
34
|
+
window.addEventListener('resize', onChange);
|
|
35
|
+
return function () {
|
|
36
|
+
var _vv$removeEventListen, _vv$removeEventListen2;
|
|
37
|
+
vv === null || vv === void 0 || (_vv$removeEventListen = vv.removeEventListener) === null || _vv$removeEventListen === void 0 || _vv$removeEventListen.call(vv, 'resize', onChange);
|
|
38
|
+
vv === null || vv === void 0 || (_vv$removeEventListen2 = vv.removeEventListener) === null || _vv$removeEventListen2 === void 0 || _vv$removeEventListen2.call(vv, 'scroll', onChange);
|
|
39
|
+
window.removeEventListener('resize', onChange);
|
|
40
|
+
};
|
|
41
|
+
}, [active]);
|
|
42
|
+
var getSnapshot = function getSnapshot() {
|
|
43
|
+
return active ? readKeyboardOffset() : 0;
|
|
44
|
+
};
|
|
45
|
+
return useSyncExternalStore(subscribe, getSnapshot, getServerOffset);
|
|
46
|
+
}
|
|
47
|
+
/** Publishes the fixed bar's height as a CSS variable on <html> so the Spacer can match it. */
|
|
48
|
+
function usePublishedHeight(nodeRef, enabled) {
|
|
49
|
+
useEffect(function () {
|
|
50
|
+
var node = nodeRef.current;
|
|
51
|
+
if (!enabled || !node || typeof document === 'undefined') return undefined;
|
|
52
|
+
var root = document.documentElement;
|
|
53
|
+
var publish = function publish() {
|
|
54
|
+
var _node$getBoundingClie;
|
|
55
|
+
var h = ((_node$getBoundingClie = node.getBoundingClientRect) === null || _node$getBoundingClie === void 0 ? void 0 : _node$getBoundingClie.call(node).height) || 0;
|
|
56
|
+
if (h > 0) root.style.setProperty(BAR_HEIGHT_VAR, "".concat(Math.round(h), "px"));
|
|
57
|
+
};
|
|
58
|
+
publish();
|
|
59
|
+
var observer;
|
|
60
|
+
if (typeof window.ResizeObserver === 'function') {
|
|
61
|
+
observer = new window.ResizeObserver(publish);
|
|
62
|
+
observer.observe(node);
|
|
63
|
+
}
|
|
64
|
+
return function () {
|
|
65
|
+
var _observer;
|
|
66
|
+
(_observer = observer) === null || _observer === void 0 || _observer.disconnect();
|
|
67
|
+
root.style.removeProperty(BAR_HEIGHT_VAR);
|
|
68
|
+
};
|
|
69
|
+
}, [nodeRef, enabled]);
|
|
70
|
+
}
|
|
71
|
+
var ALIGN = {
|
|
72
|
+
start: 'justify-start',
|
|
73
|
+
center: 'justify-center',
|
|
74
|
+
end: 'justify-end',
|
|
75
|
+
between: 'justify-between'
|
|
76
|
+
};
|
|
77
|
+
var BottomActionBar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
78
|
+
var children = _ref.children,
|
|
79
|
+
_ref$position = _ref.position,
|
|
80
|
+
position = _ref$position === void 0 ? 'fixed' : _ref$position,
|
|
81
|
+
_ref$align = _ref.align,
|
|
82
|
+
align = _ref$align === void 0 ? 'end' : _ref$align,
|
|
83
|
+
_ref$fullWidth = _ref.fullWidth,
|
|
84
|
+
fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,
|
|
85
|
+
_ref$stackOnMobile = _ref.stackOnMobile,
|
|
86
|
+
stackOnMobile = _ref$stackOnMobile === void 0 ? false : _ref$stackOnMobile,
|
|
87
|
+
_ref$keyboardAware = _ref.keyboardAware,
|
|
88
|
+
keyboardAware = _ref$keyboardAware === void 0 ? true : _ref$keyboardAware,
|
|
89
|
+
className = _ref.className,
|
|
90
|
+
style = _ref.style,
|
|
91
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
92
|
+
var localRef = useRef(null);
|
|
93
|
+
var setRef = useCallback(function (node) {
|
|
94
|
+
return setRefs(node, localRef, ref);
|
|
95
|
+
}, [ref]);
|
|
96
|
+
var fixed = position !== 'sticky';
|
|
97
|
+
var offset = useKeyboardOffset(keyboardAware);
|
|
98
|
+
usePublishedHeight(localRef, fixed);
|
|
99
|
+
// Above the keyboard the home indicator is covered, so the safe-area pad goes.
|
|
100
|
+
var lifted = offset > 0;
|
|
101
|
+
var barStyle = lifted ? _objectSpread2(_objectSpread2({}, style), {}, {
|
|
102
|
+
bottom: "".concat(offset, "px")
|
|
103
|
+
}) : style;
|
|
104
|
+
return jsx("div", _objectSpread2(_objectSpread2({
|
|
105
|
+
ref: setRef,
|
|
106
|
+
"data-position": fixed ? 'fixed' : 'sticky',
|
|
107
|
+
"data-keyboard": lifted ? 'open' : undefined,
|
|
108
|
+
className: cn(fixed ? 'fixed inset-x-0 bottom-0' : 'sticky bottom-0', 'z-sticky border-t border-line bg-surface text-foreground px-safe', 'shadow-[0_-4px_12px_-4px_rgb(0_0_0/calc(0.12*var(--dt-shadow-strength,1)))]', 'transition-[bottom] duration-fast ease-standard motion-reduce:transition-none', !lifted && 'pb-safe', className),
|
|
109
|
+
style: barStyle
|
|
110
|
+
}, props), {}, {
|
|
111
|
+
children: jsx("div", {
|
|
112
|
+
className: cn('mx-auto flex w-full max-w-7xl items-center gap-3 px-4 py-3 md:px-8', ALIGN[align] || ALIGN.end, fullWidth && 'max-sm:[&>*]:flex-1', stackOnMobile && 'max-sm:flex-col-reverse max-sm:items-stretch max-sm:[&>*]:w-full'),
|
|
113
|
+
children: children
|
|
114
|
+
})
|
|
115
|
+
}));
|
|
116
|
+
});
|
|
117
|
+
BottomActionBar.displayName = 'BottomActionBar';
|
|
118
|
+
// Reserves the fixed bar's height (published by the bar, 4.5rem + safe area
|
|
119
|
+
// before it measures) so the last rows of the page aren't hidden behind it.
|
|
120
|
+
var BottomActionBarSpacer = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
121
|
+
var className = _ref2.className,
|
|
122
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
123
|
+
return jsx("div", _objectSpread2({
|
|
124
|
+
ref: ref,
|
|
125
|
+
"aria-hidden": "true",
|
|
126
|
+
className: cn('h-[var(--dt-bottom-action-bar-height,calc(4.5rem+env(safe-area-inset-bottom,0px)))] shrink-0', className)
|
|
127
|
+
}, props));
|
|
128
|
+
});
|
|
129
|
+
BottomActionBarSpacer.displayName = 'BottomActionBar.Spacer';
|
|
130
|
+
BottomActionBar.Spacer = BottomActionBarSpacer;
|
|
131
|
+
|
|
132
|
+
export { BAR_HEIGHT_VAR, BottomActionBar as default };
|