@dreamtree-org/twreact-ui 1.3.11 → 2.0.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.
Files changed (164) hide show
  1. package/README.md +40 -6
  2. package/ai-skills/dreamtree-ui.md +47 -9
  3. package/codemods/v2.cjs +198 -0
  4. package/dist/ai-schema.json +609 -33
  5. package/dist/components/blocks/AppShell.d.ts.map +1 -1
  6. package/dist/components/blocks/BottomActionBar.d.ts +6 -0
  7. package/dist/components/blocks/BottomActionBar.d.ts.map +1 -0
  8. package/dist/components/blocks/ConfirmDialog.d.ts.map +1 -1
  9. package/dist/components/blocks/PageHeader.d.ts.map +1 -1
  10. package/dist/components/core/Checkbox.d.ts.map +1 -1
  11. package/dist/components/core/DatePicker.d.ts.map +1 -1
  12. package/dist/components/core/DateRangePicker.d.ts.map +1 -1
  13. package/dist/components/core/Form.d.ts.map +1 -1
  14. package/dist/components/core/Input.d.ts.map +1 -1
  15. package/dist/components/core/Popover.d.ts.map +1 -1
  16. package/dist/components/core/ProgressBar.d.ts.map +1 -1
  17. package/dist/components/core/Rate.d.ts.map +1 -1
  18. package/dist/components/core/SearchField.d.ts +9 -0
  19. package/dist/components/core/SearchField.d.ts.map +1 -0
  20. package/dist/components/core/SegmentedControl.d.ts +8 -0
  21. package/dist/components/core/SegmentedControl.d.ts.map +1 -0
  22. package/dist/components/core/Select.d.ts.map +1 -1
  23. package/dist/components/core/SwipeableListItem.d.ts +4 -0
  24. package/dist/components/core/SwipeableListItem.d.ts.map +1 -0
  25. package/dist/components/core/SwipeableListItemGesture.d.ts +58 -0
  26. package/dist/components/core/SwipeableListItemGesture.d.ts.map +1 -0
  27. package/dist/components/core/Switch.d.ts.map +1 -1
  28. package/dist/components/core/Table/ActionMenu.d.ts +10 -3
  29. package/dist/components/core/Table/ActionMenu.d.ts.map +1 -1
  30. package/dist/components/core/Table/MobileCard.d.ts +10 -1
  31. package/dist/components/core/Table/MobileCard.d.ts.map +1 -1
  32. package/dist/components/core/Table/MobileFilters.d.ts +8 -2
  33. package/dist/components/core/Table/MobileFilters.d.ts.map +1 -1
  34. package/dist/components/core/Table/Table.d.ts.map +1 -1
  35. package/dist/components/core/Table/TableRow.d.ts +2 -1
  36. package/dist/components/core/Table/TableRow.d.ts.map +1 -1
  37. package/dist/components/core/Tabs.d.ts +3 -3
  38. package/dist/components/core/Tabs.d.ts.map +1 -1
  39. package/dist/components/core/ThreeDotPopover.d.ts +10 -22
  40. package/dist/components/core/ThreeDotPopover.d.ts.map +1 -1
  41. package/dist/components/core/Tooltip.d.ts +2 -1
  42. package/dist/components/core/Tooltip.d.ts.map +1 -1
  43. package/dist/components/core/internal/Calendar.d.ts +77 -0
  44. package/dist/components/core/internal/Calendar.d.ts.map +1 -0
  45. package/dist/components/core/menu/ActionMenuSurface.d.ts +42 -0
  46. package/dist/components/core/menu/ActionMenuSurface.d.ts.map +1 -0
  47. package/dist/components/core/menu/ActionSheetMenu.d.ts +17 -0
  48. package/dist/components/core/menu/ActionSheetMenu.d.ts.map +1 -0
  49. package/dist/components/core/menu/MenuPopover.d.ts +21 -0
  50. package/dist/components/core/menu/MenuPopover.d.ts.map +1 -0
  51. package/dist/components/core/menu/menuItems.d.ts +21 -0
  52. package/dist/components/core/menu/menuItems.d.ts.map +1 -0
  53. package/dist/components/core/menu/menuKeyboard.d.ts +16 -0
  54. package/dist/components/core/menu/menuKeyboard.d.ts.map +1 -0
  55. package/dist/components/feedback/ActionSheet.d.ts +4 -0
  56. package/dist/components/feedback/ActionSheet.d.ts.map +1 -0
  57. package/dist/components/feedback/Alert.d.ts.map +1 -1
  58. package/dist/components/feedback/Dialog.d.ts.map +1 -1
  59. package/dist/components/feedback/Drawer.d.ts.map +1 -1
  60. package/dist/components/feedback/Sheet.d.ts +4 -0
  61. package/dist/components/feedback/Sheet.d.ts.map +1 -0
  62. package/dist/components/feedback/Toast.d.ts +4 -3
  63. package/dist/components/feedback/Toast.d.ts.map +1 -1
  64. package/dist/components/feedback/ToastItem.d.ts +47 -0
  65. package/dist/components/feedback/ToastItem.d.ts.map +1 -0
  66. package/dist/components/feedback/ToastStack.d.ts +20 -0
  67. package/dist/components/feedback/ToastStack.d.ts.map +1 -0
  68. package/dist/components/feedback/ToastSwipe.d.ts +22 -0
  69. package/dist/components/feedback/ToastSwipe.d.ts.map +1 -0
  70. package/dist/components/feedback/Tour.d.ts.map +1 -1
  71. package/dist/components/feedback/sheetCore.d.ts +30 -0
  72. package/dist/components/feedback/sheetCore.d.ts.map +1 -0
  73. package/dist/components/navigation/Navbar.d.ts.map +1 -1
  74. package/dist/components/navigation/Sidebar.d.ts +6 -0
  75. package/dist/components/navigation/Sidebar.d.ts.map +1 -1
  76. package/dist/components/rich-text/RichTextEditor.d.ts.map +1 -1
  77. package/dist/components/rich-text/RichTextToolbar.d.ts +6 -2
  78. package/dist/components/rich-text/RichTextToolbar.d.ts.map +1 -1
  79. package/dist/components/utility/PullToRefresh.d.ts +5 -0
  80. package/dist/components/utility/PullToRefresh.d.ts.map +1 -0
  81. package/dist/esm/components/blocks/AppShell.js +97 -90
  82. package/dist/esm/components/blocks/BottomActionBar.js +132 -0
  83. package/dist/esm/components/blocks/ConfirmDialog.js +40 -4
  84. package/dist/esm/components/blocks/PageHeader.js +16 -3
  85. package/dist/esm/components/core/Checkbox.js +13 -24
  86. package/dist/esm/components/core/DatePicker.js +117 -304
  87. package/dist/esm/components/core/DateRangePicker.js +260 -308
  88. package/dist/esm/components/core/Form.js +11 -2
  89. package/dist/esm/components/core/Input.js +13 -18
  90. package/dist/esm/components/core/Popover.js +59 -48
  91. package/dist/esm/components/core/ProgressBar.js +36 -64
  92. package/dist/esm/components/core/Rate.js +5 -10
  93. package/dist/esm/components/core/SearchField.js +311 -0
  94. package/dist/esm/components/core/SegmentedControl.js +189 -0
  95. package/dist/esm/components/core/Select.js +185 -190
  96. package/dist/esm/components/core/SwipeableListItem.js +286 -0
  97. package/dist/esm/components/core/SwipeableListItemGesture.js +219 -0
  98. package/dist/esm/components/core/Switch.js +11 -13
  99. package/dist/esm/components/core/Table/ActionMenu.js +45 -231
  100. package/dist/esm/components/core/Table/ColumnMenu.js +1 -1
  101. package/dist/esm/components/core/Table/MobileCard.js +66 -16
  102. package/dist/esm/components/core/Table/MobileFilters.js +181 -10
  103. package/dist/esm/components/core/Table/Table.js +149 -102
  104. package/dist/esm/components/core/Table/TableRow.js +10 -2
  105. package/dist/esm/components/core/Tabs.js +7 -7
  106. package/dist/esm/components/core/ThreeDotPopover.js +93 -99
  107. package/dist/esm/components/core/Tooltip.js +138 -145
  108. package/dist/esm/components/core/internal/Calendar.js +381 -0
  109. package/dist/esm/components/core/menu/ActionMenuSurface.js +110 -0
  110. package/dist/esm/components/core/menu/ActionSheetMenu.js +140 -0
  111. package/dist/esm/components/core/menu/MenuPopover.js +177 -0
  112. package/dist/esm/components/core/menu/menuItems.js +61 -0
  113. package/dist/esm/components/core/menu/menuKeyboard.js +54 -0
  114. package/dist/esm/components/feedback/ActionSheet.js +55 -0
  115. package/dist/esm/components/feedback/Alert.js +63 -53
  116. package/dist/esm/components/feedback/Dialog.js +141 -53
  117. package/dist/esm/components/feedback/Drawer.js +130 -132
  118. package/dist/esm/components/feedback/Sheet.js +125 -0
  119. package/dist/esm/components/feedback/Toast.js +21 -291
  120. package/dist/esm/components/feedback/ToastItem.js +348 -0
  121. package/dist/esm/components/feedback/ToastStack.js +130 -0
  122. package/dist/esm/components/feedback/ToastSwipe.js +52 -0
  123. package/dist/esm/components/feedback/Tour.js +107 -30
  124. package/dist/esm/components/feedback/sheetCore.js +494 -0
  125. package/dist/esm/components/navigation/Dropdown.js +1 -1
  126. package/dist/esm/components/navigation/Navbar.js +172 -37
  127. package/dist/esm/components/navigation/Sidebar.js +263 -111
  128. package/dist/esm/components/rich-text/RichTextEditor.js +9 -3
  129. package/dist/esm/components/rich-text/RichTextToolbar.js +29 -9
  130. package/dist/esm/components/utility/Portal.js +31 -0
  131. package/dist/esm/components/utility/PullToRefresh.js +229 -0
  132. package/dist/esm/hooks/useFloatingPosition.js +82 -0
  133. package/dist/esm/hooks/useHaptics.js +65 -0
  134. package/dist/esm/hooks/usePresence.js +58 -0
  135. package/dist/esm/hooks/usePresentation.js +21 -0
  136. package/dist/esm/hooks/useSheetDrag.js +220 -0
  137. package/dist/esm/index.js +13 -2
  138. package/dist/esm/utils/position.js +10 -63
  139. package/dist/hooks/useFloatingPosition.d.ts +8 -4
  140. package/dist/hooks/useFloatingPosition.d.ts.map +1 -1
  141. package/dist/hooks/useHaptics.d.ts +19 -0
  142. package/dist/hooks/useHaptics.d.ts.map +1 -0
  143. package/dist/hooks/useSheetDrag.d.ts +31 -0
  144. package/dist/hooks/useSheetDrag.d.ts.map +1 -0
  145. package/dist/index.css +1 -1
  146. package/dist/index.d.ts +9 -1
  147. package/dist/index.esm.css +1 -1
  148. package/dist/index.esm.js +8851 -3198
  149. package/dist/index.js +8856 -3195
  150. package/dist/rich-text/index.js +41 -11
  151. package/dist/types/blocks.d.ts +32 -2
  152. package/dist/types/blocks.d.ts.map +1 -1
  153. package/dist/types/index.d.ts +353 -19
  154. package/dist/types/index.d.ts.map +1 -1
  155. package/dist/types/rich-text.d.ts +5 -0
  156. package/dist/types/rich-text.d.ts.map +1 -1
  157. package/dist/utils/position.d.ts +0 -15
  158. package/dist/utils/position.d.ts.map +1 -1
  159. package/doc/README.md +15 -0
  160. package/mcp/catalog.snapshot.json +1398 -464
  161. package/package.json +7 -2
  162. package/dist/esm/hooks/useSwipeToClose.js +0 -66
  163. package/dist/hooks/useSwipeToClose.d.ts +0 -24
  164. package/dist/hooks/useSwipeToClose.d.ts.map +0 -1
@@ -0,0 +1,4 @@
1
+ export default ActionSheet;
2
+ declare const ActionSheet: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
3
+ import React from "react";
4
+ //# sourceMappingURL=ActionSheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionSheet.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/ActionSheet.jsx"],"names":[],"mappings":";AAcA,qFAwCE;kBAtDgB,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/Alert.jsx"],"names":[],"mappings":";AASA,+EA0FG;kBAnGe,OAAO"}
1
+ {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/Alert.jsx"],"names":[],"mappings":";AAoDA,+EAmEG;kBAvHe,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/Dialog.jsx"],"names":[],"mappings":";AAUA,gFA6GG;kBAvH6C,OAAO"}
1
+ {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/Dialog.jsx"],"names":[],"mappings":";AA2DA,gFAkJG;kBA7MoE,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/Drawer.jsx"],"names":[],"mappings":";AAqCA,gFAqHG;kBA1JkC,OAAO"}
1
+ {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/Drawer.jsx"],"names":[],"mappings":";AA8DA,gFA8EG;kBA5I+B,OAAO"}
@@ -0,0 +1,4 @@
1
+ export default Sheet;
2
+ declare const Sheet: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
3
+ import React from "react";
4
+ //# sourceMappingURL=Sheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/Sheet.jsx"],"names":[],"mappings":";AAkBA,+EA+CE;kBAjEgC,OAAO"}
@@ -1,7 +1,8 @@
1
1
  export default Toast;
2
- export const Toast: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
2
+ import Toast from './ToastItem';
3
3
  export function ToastContainer(props: any): import("react/jsx-runtime").JSX.Element | null;
4
- export function ToastProvider({ children, position, className, }: {
4
+ export function ToastProvider({ children, position, className, ...stackProps }: {
5
+ [x: string]: any;
5
6
  children: any;
6
7
  position?: string | undefined;
7
8
  className?: string | undefined;
@@ -22,5 +23,5 @@ export function useToast(): {
22
23
  clearToasts: () => void;
23
24
  addToast: (toastOptions: any) => any;
24
25
  };
25
- import React from 'react';
26
+ export { Toast };
26
27
  //# sourceMappingURL=Toast.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/Toast.jsx"],"names":[],"mappings":";AA4DA,8EAgOG;AA+CH,2FAOC;AA6CD;;;;4CAkBC;;;;AAMD;;;;;;;;;;;;EAIC;kBA3Z+G,OAAO"}
1
+ {"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/Toast.jsx"],"names":[],"mappings":";kBACkB,aAAa;AAW/B,2FAOC;AA6CD;;;;;4CAoBC;;;;AAMD;;;;;;;;;;;;EAIC"}
@@ -0,0 +1,47 @@
1
+ export namespace STATUS_CONFIG {
2
+ export namespace success {
3
+ export { CheckCircle2 as icon };
4
+ export let iconClass: string;
5
+ export let progressClass: string;
6
+ }
7
+ export namespace error {
8
+ export { XCircle as icon };
9
+ let iconClass_1: string;
10
+ export { iconClass_1 as iconClass };
11
+ let progressClass_1: string;
12
+ export { progressClass_1 as progressClass };
13
+ }
14
+ export namespace warning {
15
+ export { AlertTriangle as icon };
16
+ let iconClass_2: string;
17
+ export { iconClass_2 as iconClass };
18
+ let progressClass_2: string;
19
+ export { progressClass_2 as progressClass };
20
+ }
21
+ export namespace info {
22
+ export { Info as icon };
23
+ let iconClass_3: string;
24
+ export { iconClass_3 as iconClass };
25
+ let progressClass_3: string;
26
+ export { progressClass_3 as progressClass };
27
+ }
28
+ namespace _default {
29
+ export { Bell as icon };
30
+ let iconClass_4: string;
31
+ export { iconClass_4 as iconClass };
32
+ let progressClass_4: string;
33
+ export { progressClass_4 as progressClass };
34
+ }
35
+ export { _default as default };
36
+ }
37
+ export const MOBILE_OFFSET_VAR: "--dt-toast-mobile-offset";
38
+ export function toCssLength(value: any): any;
39
+ export default Toast;
40
+ import { CheckCircle2 } from 'lucide-react';
41
+ import { XCircle } from 'lucide-react';
42
+ import { AlertTriangle } from 'lucide-react';
43
+ import { Info } from 'lucide-react';
44
+ import { Bell } from 'lucide-react';
45
+ declare const Toast: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
46
+ import React from 'react';
47
+ //# sourceMappingURL=ToastItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToastItem.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/ToastItem.jsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,gCAAiC,0BAA0B,CAAC;AAGrD,6CAAiF;;6BAjDpB,cAAc;wBAAd,cAAc;8BAAd,cAAc;qBAAd,cAAc;qBAAd,cAAc;AAsFlF,+EA4QG;kBArWyE,OAAO"}
@@ -0,0 +1,20 @@
1
+ /** Inline transform for a collapsed toast `depth` steps behind the front one. */
2
+ export function collapsedStyle(depth: any, fromBottom: any, visibleToasts: any): {
3
+ transform: string;
4
+ transformOrigin: string;
5
+ zIndex: number;
6
+ opacity: number;
7
+ };
8
+ export default ToastStack;
9
+ declare function ToastStack({ toasts, position, onRemove, className, expand, visibleToasts, mobilePosition, mobileOffset, }: {
10
+ toasts?: never[] | undefined;
11
+ position?: string | undefined;
12
+ onRemove: any;
13
+ className?: string | undefined;
14
+ expand: any;
15
+ visibleToasts?: number | undefined;
16
+ mobilePosition?: string | undefined;
17
+ mobileOffset: any;
18
+ }): React.ReactPortal | null;
19
+ import React from 'react';
20
+ //# sourceMappingURL=ToastStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToastStack.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/ToastStack.jsx"],"names":[],"mappings":"AA+BA,iFAAiF;AACjF;;;;;EAOC;;AAED;;;;;;;;;6BA+FC;kBAxIuC,OAAO"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @param {{ enabled?: boolean, onDismiss: (direction: 1 | -1) => void }} options
3
+ * @returns {{
4
+ * offset: number, // px to translate the toast by (0 at rest)
5
+ * dragging: boolean,
6
+ * swipedOut: 0 | 1 | -1, // direction the toast left in, 0 while it stays
7
+ * dragProps: object, // pointer handlers for the toast root
8
+ * }}
9
+ */
10
+ export function useToastSwipe({ enabled, onDismiss }: {
11
+ enabled?: boolean;
12
+ onDismiss: (direction: 1 | -1) => void;
13
+ }): {
14
+ offset: number;
15
+ dragging: boolean;
16
+ swipedOut: 0 | 1 | -1;
17
+ dragProps: object;
18
+ };
19
+ export const SWIPE_DISTANCE: 64;
20
+ export const SWIPE_FLICK_VELOCITY: 0.5;
21
+ export default useToastSwipe;
22
+ //# sourceMappingURL=ToastSwipe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToastSwipe.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/ToastSwipe.js"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AACH,sDARW;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAA;CAAE,GAC3D;IACR,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB,CAqBH;AAhCD,6BAA8B,EAAE,CAAC;AACjC,mCAAoC,GAAG,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tour.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/Tour.jsx"],"names":[],"mappings":";AAsBA,8EAoIG;kBA1JoF,OAAO"}
1
+ {"version":3,"file":"Tour.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/Tour.jsx"],"names":[],"mappings":";AAwCA,8EA+LG;kBAvOoF,OAAO"}
@@ -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":"Navbar.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/Navbar.jsx"],"names":[],"mappings":"AAiMA,+EAwSG;;kBAxeqD,OAAO"}
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":";AAkFA;;;;;;;;;;;;;;;;;GAiBG;AACH,iFAohBG;kBAhnBI,OAAO"}
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,wFAsLE;kBAjN+E,OAAO"}
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":"AAuDA,uFAAuF;AACvF;;;;;;;;;;;;;;;;SAmBC;AAKD,0FAA0F;AAC1F,sDAMC;AAsFD;;;GAGG;AACH;;;;;;;4CAkFC;;;;;;;;QA3O0F,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;qBArCK,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
+ {"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"}
@@ -0,0 +1,5 @@
1
+ export function resist(distance: any, max: any): number;
2
+ export default PullToRefresh;
3
+ declare const PullToRefresh: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
4
+ import React from "react";
5
+ //# sourceMappingURL=PullToRefresh.d.ts.map
@@ -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,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, Fragment, jsx } from 'react/jsx-runtime';
3
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
4
4
  import React, { useState, useRef, useCallback } from 'react';
5
- import { X, Menu } from 'lucide-react';
5
+ import { Menu, X } from 'lucide-react';
6
6
  import { cn } from '../../utils/cn.js';
7
- import { useFocusTrap } from '../../hooks/useFocusTrap.js';
8
- import { useScrollLock } from '../../hooks/useScrollLock.js';
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 shell role tokens, so a brand file
13
- // restyles it. Nav items render with `linkAs` (pass Next.js Link) so links prefetch and open in new tabs.
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-white/15 px-2 py-0.5 text-xs font-semibold text-white",
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-white' : 'text-shell-foreground hover:bg-white/5 hover:text-white');
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
- // Mobile drawer is a modal dialog: focus moves in, Tab is trapped, Escape
115
- // closes, focus returns to the menu button, and the page behind is locked.
116
- useScrollLock(open);
117
- useFocusTrap(drawer, {
118
- active: open,
119
- onEscape: function onEscape() {
120
- var _menuButton$current;
121
- close();
122
- // Some browsers (Safari) don't focus a clicked button, so the opener may be <body>.
123
- (_menuButton$current = menuButton.current) === null || _menuButton$current === void 0 || _menuButton$current.focus();
124
- }
125
- });
126
- var sidebar = jsxs(Fragment, {
127
- children: [jsxs("div", {
128
- className: "flex items-center justify-between px-5 pb-4 pt-5 text-white",
129
- children: [jsx("div", {
130
- className: "min-w-0",
131
- children: brand
132
- }), jsx("button", {
133
- type: "button",
134
- className: "rounded-control p-1.5 text-shell-foreground hover:bg-white/10 lg:hidden",
135
- onClick: close,
136
- "aria-label": "Close navigation",
137
- children: jsx(X, {
138
- className: "h-5 w-5",
139
- "aria-hidden": "true"
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
- }), jsx(NavList, {
143
- nav: nav,
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-screen bg-background text-foreground lg:grid lg:grid-cols-[16rem_minmax(0,1fr)]', className)
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-50 focus:rounded-control focus:bg-surface focus:px-3 focus:py-2",
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-screen flex-col bg-shell lg:flex",
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
- }), open && jsxs("div", {
164
- className: "fixed inset-0 z-40 lg:hidden",
165
- children: [jsx("div", {
166
- className: "absolute inset-0 bg-secondary-900/50",
167
- onClick: close,
168
- "aria-hidden": "true"
169
- }), jsx("aside", {
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: [jsxs("header", {
181
- className: "sticky top-0 z-30 flex h-14 items-center gap-3 border-b border-line bg-surface px-4 lg:px-6",
182
- children: [jsx("button", {
183
- ref: menuButton,
184
- type: "button",
185
- className: "-ml-1 rounded-control p-2 text-muted hover:bg-secondary-100 lg:hidden",
186
- onClick: function onClick() {
187
- return setOpen(true);
188
- },
189
- "aria-label": "Open navigation",
190
- "aria-expanded": open,
191
- children: jsx(Menu, {
192
- className: "h-5 w-5"
193
- })
194
- }), pageTitle && jsx("span", {
195
- className: "truncate text-sm font-semibold lg:hidden",
196
- children: pageTitle
197
- }), jsx("div", {
198
- className: "ml-auto flex items-center gap-3",
199
- children: topbar
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
  });