@astryxdesign/core 0.7.7-canary.bf14580 → 0.7.7-canary.c19ca12

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 (266) hide show
  1. package/dist/AlertDialog/AlertDialog.d.ts +4 -1
  2. package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
  3. package/dist/AlertDialog/AlertDialog.js +36 -6
  4. package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
  5. package/dist/BottomSheet/BottomSheet.js +76 -6
  6. package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
  7. package/dist/BottomSheet/BottomSheetPanel.js +23 -4
  8. package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
  9. package/dist/BottomSheet/bottomSheetStack.js +5 -4
  10. package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
  11. package/dist/BottomSheet/useSheetGestures.js +3 -1
  12. package/dist/Button/Button.d.ts.map +1 -1
  13. package/dist/Button/Button.js +47 -3
  14. package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
  15. package/dist/CheckboxInput/CheckboxInput.js +13 -2
  16. package/dist/ComplexSelector/ComplexSelector.d.ts +4 -1
  17. package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
  18. package/dist/ComplexSelector/ComplexSelector.js +14 -4
  19. package/dist/ContextMenu/ContextMenu.js +2 -2
  20. package/dist/DateInput/MonthScroller.d.ts.map +1 -1
  21. package/dist/DateInput/MonthScroller.js +13 -27
  22. package/dist/DateInput/Wheel.d.ts.map +1 -1
  23. package/dist/DateInput/Wheel.js +22 -41
  24. package/dist/Dialog/Dialog.d.ts.map +1 -1
  25. package/dist/Dialog/Dialog.js +7 -31
  26. package/dist/Field/Field.js +2 -2
  27. package/dist/HoverCard/HoverCard.d.ts +4 -3
  28. package/dist/HoverCard/HoverCard.d.ts.map +1 -1
  29. package/dist/HoverCard/HoverCard.js +27 -2
  30. package/dist/HoverCard/useHoverCard.d.ts +5 -4
  31. package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
  32. package/dist/HoverCard/useHoverCard.js +17 -31
  33. package/dist/Icon/Icon.d.ts +5 -1
  34. package/dist/Icon/Icon.d.ts.map +1 -1
  35. package/dist/Icon/Icon.js +5 -2
  36. package/dist/Layer/layerAnimations.stylex.d.ts +7 -8
  37. package/dist/Layer/layerAnimations.stylex.d.ts.map +1 -1
  38. package/dist/Layer/layerAnimations.stylex.js +25 -20
  39. package/dist/Layer/usePressPin.d.ts +17 -5
  40. package/dist/Layer/usePressPin.d.ts.map +1 -1
  41. package/dist/Layer/usePressPin.js +62 -12
  42. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  43. package/dist/Lightbox/Lightbox.js +18 -0
  44. package/dist/PowerSearch/PowerSearch.d.ts +36 -3
  45. package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
  46. package/dist/PowerSearch/PowerSearch.js +522 -269
  47. package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +100 -0
  48. package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -0
  49. package/dist/PowerSearch/PowerSearchBottomSheet.js +1913 -0
  50. package/dist/PowerSearch/PowerSearchEditPopover.d.ts +32 -1
  51. package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
  52. package/dist/PowerSearch/PowerSearchEditPopover.js +17 -6
  53. package/dist/PowerSearch/PowerSearchValueEditor.d.ts +38 -3
  54. package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
  55. package/dist/PowerSearch/PowerSearchValueEditor.js +170 -61
  56. package/dist/PowerSearch/formatFilterValue.d.ts +7 -0
  57. package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
  58. package/dist/PowerSearch/formatFilterValue.js +11 -1
  59. package/dist/PowerSearch/formatTokenValue.d.ts +28 -0
  60. package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -0
  61. package/dist/PowerSearch/formatTokenValue.js +160 -0
  62. package/dist/PowerSearch/powerSearchSheetUtils.d.ts +65 -0
  63. package/dist/PowerSearch/powerSearchSheetUtils.d.ts.map +1 -0
  64. package/dist/PowerSearch/powerSearchSheetUtils.js +168 -0
  65. package/dist/RadioList/RadioList.d.ts.map +1 -1
  66. package/dist/RadioList/RadioList.js +3 -2
  67. package/dist/RadioList/RadioListItem.d.ts +1 -1
  68. package/dist/RadioList/RadioListItem.d.ts.map +1 -1
  69. package/dist/RadioList/RadioListItem.js +5 -3
  70. package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -1
  71. package/dist/SegmentedControl/useSegmentedSelectionMotion.js +3 -3
  72. package/dist/Slider/sliderTouchController.js +2 -2
  73. package/dist/Spinner/Spinner.d.ts +1 -1
  74. package/dist/Spinner/Spinner.d.ts.map +1 -1
  75. package/dist/Spinner/Spinner.js +60 -58
  76. package/dist/Switch/useSwitchTouch.js +4 -4
  77. package/dist/Table/BaseTable.d.ts.map +1 -1
  78. package/dist/Table/BaseTable.js +29 -8
  79. package/dist/TextInput/TextInput.d.ts +2 -2
  80. package/dist/TextInput/TextInput.d.ts.map +1 -1
  81. package/dist/TextInput/TextInput.js +10 -7
  82. package/dist/Toast/Toast.d.ts +11 -1
  83. package/dist/Toast/Toast.d.ts.map +1 -1
  84. package/dist/Toast/Toast.js +25 -15
  85. package/dist/Toast/ToastViewport.d.ts.map +1 -1
  86. package/dist/Toast/ToastViewport.js +94 -34
  87. package/dist/Toast/types.d.ts +9 -3
  88. package/dist/Toast/types.d.ts.map +1 -1
  89. package/dist/Token/Token.d.ts +2 -2
  90. package/dist/Token/Token.d.ts.map +1 -1
  91. package/dist/Token/Token.js +12 -4
  92. package/dist/Token/TokenNamingContext.d.ts +14 -0
  93. package/dist/Token/TokenNamingContext.d.ts.map +1 -0
  94. package/dist/Token/TokenNamingContext.js +23 -0
  95. package/dist/Tooltip/useTooltip.d.ts +19 -1
  96. package/dist/Tooltip/useTooltip.d.ts.map +1 -1
  97. package/dist/Tooltip/useTooltip.js +34 -53
  98. package/dist/Typeahead/TypeaheadItem.d.ts +2 -1
  99. package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
  100. package/dist/animator/createAnimator.d.ts +98 -0
  101. package/dist/animator/createAnimator.d.ts.map +1 -0
  102. package/dist/animator/createAnimator.js +259 -0
  103. package/dist/astryx.css +22 -6
  104. package/dist/gestures/GestureHost.d.ts +27 -1
  105. package/dist/gestures/GestureHost.d.ts.map +1 -1
  106. package/dist/gestures/GestureHost.js +90 -8
  107. package/dist/gestures/PressTracker.d.ts.map +1 -1
  108. package/dist/gestures/PressTracker.js +4 -3
  109. package/dist/hooks/actionGroupTracker.d.ts +4 -1
  110. package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
  111. package/dist/hooks/actionGroupTracker.js +13 -3
  112. package/dist/hooks/index.d.ts +1 -0
  113. package/dist/hooks/index.d.ts.map +1 -1
  114. package/dist/hooks/index.js +1 -0
  115. package/dist/hooks/pressGroupContext.d.ts +6 -0
  116. package/dist/hooks/pressGroupContext.d.ts.map +1 -0
  117. package/dist/hooks/pressGroupContext.js +20 -0
  118. package/dist/hooks/useActionGroupTracking.d.ts +53 -0
  119. package/dist/hooks/useActionGroupTracking.d.ts.map +1 -0
  120. package/dist/hooks/useActionGroupTracking.js +174 -0
  121. package/dist/hooks/useAnimator.d.ts +41 -0
  122. package/dist/hooks/useAnimator.d.ts.map +1 -0
  123. package/dist/hooks/useAnimator.js +70 -0
  124. package/dist/hooks/useAttachment.d.ts +1 -1
  125. package/dist/hooks/useAttachment.js +1 -1
  126. package/dist/hooks/useInputStatusIcon.d.ts +1 -1
  127. package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
  128. package/dist/hooks/useInputStatusIcon.js +2 -2
  129. package/dist/hooks/useLongPress.d.ts +6 -2
  130. package/dist/hooks/useLongPress.d.ts.map +1 -1
  131. package/dist/hooks/useLongPress.js +95 -15
  132. package/dist/hooks/useMenuPress.d.ts.map +1 -1
  133. package/dist/hooks/useMenuPress.js +4 -2
  134. package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts +8 -0
  135. package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts.map +1 -0
  136. package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.js +42 -0
  137. package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.d.ts.map +1 -1
  138. package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.js +6 -0
  139. package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts +8 -0
  140. package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.d.ts.map +1 -0
  141. package/dist/i18n/generated-english/PowerSearch/formatTokenValue.generated.js +14 -0
  142. package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
  143. package/dist/i18n/generated-locales/en.generated.js +30 -0
  144. package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
  145. package/dist/i18n/generated-locales/pseudo.generated.js +30 -0
  146. package/dist/index.d.ts +1 -0
  147. package/dist/index.d.ts.map +1 -1
  148. package/dist/index.js +4 -0
  149. package/dist/internal/indicatorPress.stylex.d.ts +20 -0
  150. package/dist/internal/indicatorPress.stylex.d.ts.map +1 -0
  151. package/dist/internal/indicatorPress.stylex.js +26 -0
  152. package/dist/motion/animator.d.ts +14 -14
  153. package/dist/motion/animator.d.ts.map +1 -1
  154. package/dist/motion/animator.js +41 -18
  155. package/dist/motion/reducedMotion.d.ts +24 -0
  156. package/dist/motion/reducedMotion.d.ts.map +1 -1
  157. package/dist/motion/reducedMotion.js +78 -1
  158. package/dist/motion/uikit/alert.d.ts +41 -0
  159. package/dist/motion/uikit/alert.d.ts.map +1 -0
  160. package/dist/motion/uikit/alert.js +43 -0
  161. package/dist/privateAttributes/pressGroupItem.stylex.d.ts +15 -0
  162. package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -0
  163. package/dist/privateAttributes/pressGroupItem.stylex.js +23 -0
  164. package/dist/utils/clickGuard.d.ts +8 -1
  165. package/dist/utils/clickGuard.d.ts.map +1 -1
  166. package/dist/utils/clickGuard.js +24 -1
  167. package/dist/utils/dateParser.d.ts.map +1 -1
  168. package/dist/utils/dateParser.js +12 -0
  169. package/dist/utils/focusReturn.d.ts +15 -0
  170. package/dist/utils/focusReturn.d.ts.map +1 -1
  171. package/dist/utils/focusReturn.js +28 -0
  172. package/dist/utils/interactionOverlay.stylex.d.ts +3 -2
  173. package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
  174. package/dist/utils/interactionOverlay.stylex.js +3 -2
  175. package/dist/utils/pressFeedback.d.ts.map +1 -1
  176. package/dist/utils/pressFeedback.js +19 -6
  177. package/dist/utils/triggerFocus.d.ts +36 -0
  178. package/dist/utils/triggerFocus.d.ts.map +1 -0
  179. package/dist/utils/triggerFocus.js +65 -0
  180. package/locales/en.json +120 -0
  181. package/locales/pseudo.json +90 -0
  182. package/package.json +9 -4
  183. package/src/AlertDialog/AlertDialog.doc.mjs +2 -2
  184. package/src/AlertDialog/AlertDialog.tsx +37 -5
  185. package/src/BottomSheet/BottomSheet.tsx +85 -5
  186. package/src/BottomSheet/BottomSheetPanel.tsx +40 -5
  187. package/src/BottomSheet/bottomSheetStack.ts +8 -4
  188. package/src/BottomSheet/useSheetGestures.ts +3 -1
  189. package/src/Button/Button.tsx +63 -5
  190. package/src/CheckboxInput/CheckboxInput.doc.mjs +18 -0
  191. package/src/CheckboxInput/CheckboxInput.tsx +36 -9
  192. package/src/ComplexSelector/ComplexSelector.tsx +20 -5
  193. package/src/ContextMenu/ContextMenu.tsx +2 -2
  194. package/src/DateInput/MonthScroller.tsx +18 -22
  195. package/src/DateInput/Wheel.tsx +30 -32
  196. package/src/Dialog/Dialog.tsx +10 -31
  197. package/src/Field/Field.tsx +2 -2
  198. package/src/HoverCard/HoverCard.doc.mjs +4 -2
  199. package/src/HoverCard/HoverCard.tsx +35 -4
  200. package/src/HoverCard/useHoverCard.doc.mjs +178 -36
  201. package/src/HoverCard/useHoverCard.tsx +46 -52
  202. package/src/Icon/Icon.doc.mjs +49 -8
  203. package/src/Icon/Icon.tsx +15 -7
  204. package/src/Layer/layerAnimations.stylex.ts +24 -16
  205. package/src/Layer/usePressPin.ts +81 -15
  206. package/src/Lightbox/Lightbox.tsx +18 -0
  207. package/src/PowerSearch/PowerSearch.doc.mjs +54 -5
  208. package/src/PowerSearch/PowerSearch.tsx +734 -288
  209. package/src/PowerSearch/PowerSearchBottomSheet.tsx +2515 -0
  210. package/src/PowerSearch/PowerSearchEditPopover.tsx +28 -6
  211. package/src/PowerSearch/PowerSearchValueEditor.tsx +203 -38
  212. package/src/PowerSearch/formatFilterValue.ts +18 -1
  213. package/src/PowerSearch/formatTokenValue.ts +215 -0
  214. package/src/PowerSearch/powerSearchSheetUtils.ts +224 -0
  215. package/src/RadioList/RadioList.tsx +3 -2
  216. package/src/RadioList/RadioListItem.tsx +5 -3
  217. package/src/SegmentedControl/useSegmentedSelectionMotion.ts +6 -3
  218. package/src/Slider/sliderTouchController.ts +2 -2
  219. package/src/Spinner/Spinner.tsx +77 -63
  220. package/src/Switch/useSwitchTouch.ts +4 -4
  221. package/src/Table/BaseTable.tsx +46 -12
  222. package/src/TextInput/TextInput.tsx +11 -10
  223. package/src/Toast/Toast.doc.mjs +4 -3
  224. package/src/Toast/Toast.tsx +52 -32
  225. package/src/Toast/ToastViewport.tsx +121 -35
  226. package/src/Toast/types.ts +9 -3
  227. package/src/Token/Token.tsx +13 -4
  228. package/src/Token/TokenNamingContext.ts +28 -0
  229. package/src/Tooltip/useTooltip.doc.mjs +24 -0
  230. package/src/Tooltip/useTooltip.tsx +61 -56
  231. package/src/Typeahead/TypeaheadItem.doc.mjs +6 -3
  232. package/src/Typeahead/TypeaheadItem.tsx +2 -1
  233. package/src/animator/createAnimator.doc.mjs +153 -0
  234. package/src/animator/createAnimator.ts +324 -0
  235. package/src/gestures/GestureHost.ts +105 -10
  236. package/src/gestures/PressTracker.ts +4 -3
  237. package/src/gestures/README.md +7 -1
  238. package/src/hooks/actionGroupTracker.ts +20 -5
  239. package/src/hooks/index.ts +2 -0
  240. package/src/hooks/pressGroupContext.ts +21 -0
  241. package/src/hooks/useActionGroupTracking.ts +224 -0
  242. package/src/hooks/useAnimator.doc.mjs +109 -0
  243. package/src/hooks/useAnimator.ts +67 -0
  244. package/src/hooks/useAttachment.ts +1 -1
  245. package/src/hooks/useInputStatusIcon.tsx +3 -2
  246. package/src/hooks/useLongPress.doc.mjs +2 -2
  247. package/src/hooks/useLongPress.ts +136 -15
  248. package/src/hooks/useMenuPress.ts +8 -2
  249. package/src/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.ts +43 -0
  250. package/src/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.ts +6 -0
  251. package/src/i18n/generated-english/PowerSearch/formatTokenValue.generated.ts +15 -0
  252. package/src/i18n/generated-locales/en.generated.ts +41 -0
  253. package/src/i18n/generated-locales/pseudo.generated.ts +42 -0
  254. package/src/index.ts +13 -0
  255. package/src/internal/indicatorPress.stylex.ts +24 -0
  256. package/src/motion/README.md +8 -5
  257. package/src/motion/animator.ts +61 -29
  258. package/src/motion/reducedMotion.ts +79 -1
  259. package/src/motion/uikit/alert.ts +43 -0
  260. package/src/privateAttributes/pressGroupItem.stylex.ts +23 -0
  261. package/src/utils/clickGuard.ts +37 -1
  262. package/src/utils/dateParser.ts +16 -0
  263. package/src/utils/focusReturn.ts +30 -0
  264. package/src/utils/interactionOverlay.stylex.ts +3 -2
  265. package/src/utils/pressFeedback.ts +19 -6
  266. package/src/utils/triggerFocus.ts +80 -0
@@ -1,13 +1,15 @@
1
1
  /**
2
2
  * @file PowerSearchEditPopover.tsx
3
3
  * @input InternalConfig, PartialFilter
4
- * @output Edit popover content with field/operator selectors and value editor
4
+ * @output Edit popover content with field/operator selectors and value editor;
5
+ * the built-in NestedEditor the sheet presentation's value step shares
5
6
  * @position Sub-component; consumed by PowerSearch
6
7
  *
7
8
  * SYNC: When modified, update:
8
9
  * - /packages/core/src/PowerSearch/index.ts
9
10
  */
10
11
  import React from 'react';
12
+ import * as stylex from '@stylexjs/stylex';
11
13
  import type { InternalConfig } from './useInternalConfig.js';
12
14
  import type { PowerSearchFilter, PartialFilter } from './types.js';
13
15
  export interface PowerSearchEditPopoverProps {
@@ -27,5 +29,34 @@ export interface PowerSearchEditPopoverProps {
27
29
  /** Whether the filter is read-only. */
28
30
  isReadOnly?: boolean;
29
31
  }
32
+ export interface NestedEditorProps {
33
+ config: InternalConfig;
34
+ partialFilter: PartialFilter;
35
+ operatorOptions: {
36
+ value: string;
37
+ label: string;
38
+ }[];
39
+ onOperatorChange: (operatorKey: string) => void;
40
+ onPartialFilterChange: (filter: PartialFilter) => void;
41
+ maxMenuItems?: number;
42
+ isReadOnly: boolean;
43
+ /** Styles for the editor's tree root (the sheet makes it a query container). */
44
+ xstyle?: stylex.StyleXStyles;
45
+ /**
46
+ * Whether the tree root offers the group-operator picker when the field has
47
+ * several operators. The popover shows it; the sheet presentation's value
48
+ * step owns the operator choice in its own Operator group and hides it.
49
+ * @default true
50
+ */
51
+ hasRootOperatorPicker?: boolean;
52
+ }
53
+ /**
54
+ * The built-in editor for a `nested` value: a tree of sub-filters with Add,
55
+ * field/operator/value rows and removal. The popover renders it below its
56
+ * field selector; the sheet presentation's value step renders the same editor
57
+ * in its body, so a `nested` filter is created
58
+ * and edited the same way in both presentations.
59
+ */
60
+ export declare function NestedEditor({ config, partialFilter, operatorOptions, onOperatorChange, onPartialFilterChange, maxMenuItems, isReadOnly, xstyle, hasRootOperatorPicker, }: NestedEditorProps): React.JSX.Element;
30
61
  export declare function PowerSearchEditPopover({ config, filter: initialFilter, mode, onSave, onCancel, saveButtonLabel: saveButtonLabelFromProps, maxMenuItems, isReadOnly, }: PowerSearchEditPopoverProps): React.JSX.Element;
31
62
  //# sourceMappingURL=PowerSearchEditPopover.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PowerSearchEditPopover.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchEditPopover.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAA0D,MAAM,OAAO,CAAC;AAc/E,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EAId,MAAM,SAAS,CAAC;AAsEjB,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,cAAc,CAAC;IACvB,uCAAuC;IACvC,MAAM,EAAE,aAAa,CAAC;IACtB,qDAAqD;IACrD,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IACxB,6EAA6E;IAC7E,MAAM,EAAE,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,wDAAwD;IACxD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,kDAAkD;IAClD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AA0hBD,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,MAAM,EAAE,aAAa,EACrB,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,eAAe,EAAE,wBAAwB,EACzC,YAAY,EACZ,UAAkB,GACnB,EAAE,2BAA2B,qBAsS7B"}
1
+ {"version":3,"file":"PowerSearchEditPopover.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchEditPopover.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,KAA0D,MAAM,OAAO,CAAC;AAC/E,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAa3C,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EAId,MAAM,SAAS,CAAC;AAsEjB,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,cAAc,CAAC;IACvB,uCAAuC;IACvC,MAAM,EAAE,aAAa,CAAC;IACtB,qDAAqD;IACrD,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IACxB,6EAA6E;IAC7E,MAAM,EAAE,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,wDAAwD;IACxD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,kDAAkD;IAClD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAyQD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,cAAc,CAAC;IACvB,aAAa,EAAE,aAAa,CAAC;IAC7B,eAAe,EAAE;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IAClD,gBAAgB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,qBAAqB,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;IAC7B;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,UAAU,EACV,MAAM,EACN,qBAA4B,GAC7B,EAAE,iBAAiB,qBAwNnB;AA0CD,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,MAAM,EAAE,aAAa,EACrB,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,eAAe,EAAE,wBAAwB,EACzC,YAAY,EACZ,UAAkB,GACnB,EAAE,2BAA2B,qBAsS7B"}
@@ -5,7 +5,8 @@
5
5
  /**
6
6
  * @file PowerSearchEditPopover.tsx
7
7
  * @input InternalConfig, PartialFilter
8
- * @output Edit popover content with field/operator selectors and value editor
8
+ * @output Edit popover content with field/operator selectors and value editor;
9
+ * the built-in NestedEditor the sheet presentation's value step shares
9
10
  * @position Sub-component; consumed by PowerSearch
10
11
  *
11
12
  * SYNC: When modified, update:
@@ -241,14 +242,23 @@ function NestedSubFilterRow({
241
242
  // Nested editor
242
243
  // =============================================================================
243
244
 
244
- function NestedEditor({
245
+ /**
246
+ * The built-in editor for a `nested` value: a tree of sub-filters with Add,
247
+ * field/operator/value rows and removal. The popover renders it below its
248
+ * field selector; the sheet presentation's value step renders the same editor
249
+ * in its body, so a `nested` filter is created
250
+ * and edited the same way in both presentations.
251
+ */
252
+ export function NestedEditor({
245
253
  config,
246
254
  partialFilter,
247
255
  operatorOptions,
248
256
  onOperatorChange,
249
257
  onPartialFilterChange,
250
258
  maxMenuItems,
251
- isReadOnly
259
+ isReadOnly,
260
+ xstyle,
261
+ hasRootOperatorPicker = true
252
262
  }) {
253
263
  const t = useComponentTranslator();
254
264
  const [subFilters, setSubFilters] = useState(() => {
@@ -390,7 +400,7 @@ function NestedEditor({
390
400
  ...{
391
401
  className: "xcr08ib"
392
402
  },
393
- children: operatorOptions.length > 1 ? /*#__PURE__*/_jsx("div", {
403
+ children: hasRootOperatorPicker && operatorOptions.length > 1 ? /*#__PURE__*/_jsx("div", {
394
404
  ...{
395
405
  className: "x1iyjqo2 x2lah0s x193iq5w"
396
406
  },
@@ -403,7 +413,7 @@ function NestedEditor({
403
413
  isDisabled: isReadOnly,
404
414
  size: "md"
405
415
  })
406
- }) : operatorOptions[0]?.label ?? t('@astryx.powersearch.editor.group')
416
+ }) : operatorOptions.find(option => option.value === partialFilter.operator)?.label ?? operatorOptions[0]?.label ?? t('@astryx.powersearch.editor.group')
407
417
  });
408
418
  const items = [{
409
419
  id: 'nested-root',
@@ -413,7 +423,8 @@ function NestedEditor({
413
423
  }];
414
424
  return /*#__PURE__*/_jsx(TreeList, {
415
425
  items: items,
416
- density: "balanced"
426
+ density: "balanced",
427
+ xstyle: xstyle
417
428
  });
418
429
  }
419
430
 
@@ -1,8 +1,11 @@
1
1
  /**
2
2
  * @file PowerSearchValueEditor.tsx
3
- * @input OperatorValue, FilterValue, onChange callback
3
+ * @input OperatorValue, FilterValue, onChange callback, and the presentation
4
+ * the editor renders in
4
5
  * @output Renders the appropriate editor for a filter value type
5
- * @position Sub-component; consumed by PowerSearchEditPopover
6
+ * @position Sub-component; consumed by PowerSearchEditPopover (popover
7
+ * presentation) and PowerSearchBottomSheet (sheet presentation, which
8
+ * renders the closed vocabularies as rows itself)
6
9
  *
7
10
  * SYNC: When modified, update:
8
11
  * - /packages/core/src/PowerSearch/index.ts
@@ -10,6 +13,7 @@
10
13
  import React from 'react';
11
14
  import type { OperatorValue, FilterValue } from './types.js';
12
15
  import type { InternalConfig } from './useInternalConfig.js';
16
+ import type { TranslatorFn } from '../i18n/index.js';
13
17
  export interface PowerSearchValueEditorProps {
14
18
  operatorValue: OperatorValue;
15
19
  filterValue: FilterValue | undefined;
@@ -20,6 +24,37 @@ export interface PowerSearchValueEditorProps {
20
24
  maxMenuItems?: number;
21
25
  isDisabled?: boolean;
22
26
  timezoneID?: string;
27
+ /**
28
+ * Called when a staged value no longer stands — the number input's draft is
29
+ * empty or does not parse — so the sheet presentation's confirm action
30
+ * disables again. Only the `bottom-sheet` presentation stages as typed; the
31
+ * popover commits on blur or Enter and never calls this.
32
+ */
33
+ onUnstage?: () => void;
34
+ /**
35
+ * Where the editor renders. In the `bottom-sheet` presentation the inputs
36
+ * fill the sheet's width, number inputs stage every parseable keystroke
37
+ * (the sheet's footer confirms; there is no Enter-to-save), the date range
38
+ * shows one month, and list values open the Tokenizer's own sheet titled
39
+ * with `fieldLabel`.
40
+ * @default 'popover'
41
+ */
42
+ presentation?: 'popover' | 'bottom-sheet';
43
+ /** The field's label; names the Tokenizer sheet in the sheet presentation. */
44
+ fieldLabel?: string;
23
45
  }
24
- export declare function PowerSearchValueEditor({ operatorValue, filterValue, onChange, onEnter, maxMenuItems, isDisabled, }: PowerSearchValueEditorProps): React.JSX.Element | null;
46
+ /**
47
+ * The relative-date choices an operator offers, in display order. Shared by
48
+ * the popover's Selector and the sheet presentation's rows so both list the
49
+ * same values. With `t` the labels resolve through the catalog's ICU plural
50
+ * messages (the sheet presentation's rows); without it they are the popover
51
+ * editor's own literals. In English the two read identically.
52
+ */
53
+ export declare function buildRelativeDateOptions(operatorValue: OperatorValue & {
54
+ type: 'date_relative';
55
+ }, t?: TranslatorFn): {
56
+ value: string;
57
+ label: string;
58
+ }[];
59
+ export declare function PowerSearchValueEditor({ operatorValue, filterValue, onChange, onEnter, maxMenuItems, isDisabled, onUnstage, presentation, fieldLabel, }: PowerSearchValueEditorProps): React.JSX.Element | null;
25
60
  //# sourceMappingURL=PowerSearchValueEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PowerSearchValueEditor.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchValueEditor.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EAIZ,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AA4BxD,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IACrC,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,cAAc,CAAC;IACvB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AA4rBD,wBAAgB,sBAAsB,CAAC,EACrC,aAAa,EACb,WAAW,EACX,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,UAAU,GACX,EAAE,2BAA2B,4BA0I7B"}
1
+ {"version":3,"file":"PowerSearchValueEditor.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchValueEditor.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EAIZ,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAoBxD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAS1C,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IACrC,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,cAAc,CAAC;IACvB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,cAAc,CAAC;IAC1C,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AA6dD;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,aAAa,GAAG;IAAC,IAAI,EAAE,eAAe,CAAA;CAAC,EACtD,CAAC,CAAC,EAAE,YAAY,GACf;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,EAAE,CAsBlC;AA+TD,wBAAgB,sBAAsB,CAAC,EACrC,aAAa,EACb,WAAW,EACX,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,UAAU,EACV,SAAS,EACT,YAAwB,EACxB,UAAU,GACX,EAAE,2BAA2B,4BAsJ7B"}
@@ -4,9 +4,12 @@
4
4
 
5
5
  /**
6
6
  * @file PowerSearchValueEditor.tsx
7
- * @input OperatorValue, FilterValue, onChange callback
7
+ * @input OperatorValue, FilterValue, onChange callback, and the presentation
8
+ * the editor renders in
8
9
  * @output Renders the appropriate editor for a filter value type
9
- * @position Sub-component; consumed by PowerSearchEditPopover
10
+ * @position Sub-component; consumed by PowerSearchEditPopover (popover
11
+ * presentation) and PowerSearchBottomSheet (sheet presentation, which
12
+ * renders the closed vocabularies as rows itself)
10
13
  *
11
14
  * SYNC: When modified, update:
12
15
  * - /packages/core/src/PowerSearch/index.ts
@@ -21,7 +24,7 @@ import { DateRangeInput } from "../DateRangeInput/index.js";
21
24
  import { resolveDateTimeRangePart } from "./resolveDateTimeRangePart.js";
22
25
  import { TimeInput } from "../TimeInput/index.js";
23
26
  import { Selector } from "../Selector/index.js";
24
- import { Tokenizer } from "../Tokenizer/index.js";
27
+ import { Tokenizer } from "../Tokenizer/Tokenizer.js";
25
28
  import { Typeahead } from "../Typeahead/index.js";
26
29
  import { useLocale } from "../i18n/index.js";
27
30
  import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
@@ -63,9 +66,11 @@ function StringEditor({
63
66
  onChange,
64
67
  onEnter: _onEnter,
65
68
  maxMenuItems,
66
- isDisabled
69
+ isDisabled,
70
+ presentation
67
71
  }) {
68
72
  const t = useComponentTranslator();
73
+ const width = presentation === 'bottom-sheet' ? '100%' : undefined;
69
74
  const currentValue = filterValue?.type === 'string' ? filterValue.value : '';
70
75
 
71
76
  // When a searchSource is provided, render a typeahead instead of a plain
@@ -96,7 +101,8 @@ function StringEditor({
96
101
  },
97
102
  placeholder: t('@astryx.powersearch.valueEditor.searchPlaceholder'),
98
103
  debounceMs: 150,
99
- maxMenuItems: maxMenuItems
104
+ maxMenuItems: maxMenuItems,
105
+ width: width
100
106
  });
101
107
  }
102
108
  return /*#__PURE__*/_jsx(TextInput, {
@@ -110,7 +116,8 @@ function StringEditor({
110
116
  type: 'string',
111
117
  value
112
118
  });
113
- }
119
+ },
120
+ width: width
114
121
  });
115
122
  }
116
123
  function StringListEditor({
@@ -118,9 +125,12 @@ function StringListEditor({
118
125
  filterValue,
119
126
  onChange,
120
127
  maxMenuItems,
121
- isDisabled
128
+ isDisabled,
129
+ presentation,
130
+ fieldLabel
122
131
  }) {
123
132
  const t = useComponentTranslator();
133
+ const isSheet = presentation === 'bottom-sheet';
124
134
  const currentValue = useMemo(() => {
125
135
  if (filterValue?.type !== 'string_list') {
126
136
  return [];
@@ -144,8 +154,12 @@ function StringListEditor({
144
154
  // Enable creatable mode when no searchSource is provided (free-text tags)
145
155
  // or when isArbitraryStringAllowed is explicitly set (#1107).
146
156
  const hasCreate = operatorValue.isArbitraryStringAllowed || !operatorValue.searchSource;
157
+
158
+ // In the sheet presentation the list value edits through the Tokenizer's
159
+ // own sheet, titled with the field's label; a popover menu inside a sheet
160
+ // would stack a second anchored layer on a surface the person is already in.
147
161
  return /*#__PURE__*/_jsx(Tokenizer, {
148
- label: t('@astryx.powersearch.valueEditor.values'),
162
+ label: isSheet && fieldLabel != null ? fieldLabel : t('@astryx.powersearch.valueEditor.values'),
149
163
  isLabelHidden: true,
150
164
  isDisabled: isDisabled,
151
165
  searchSource: source,
@@ -159,7 +173,11 @@ function StringListEditor({
159
173
  placeholder: t('@astryx.powersearch.valueEditor.addValuesPlaceholder'),
160
174
  debounceMs: operatorValue.searchSource ? 150 : 0,
161
175
  hasCreate: hasCreate,
162
- maxMenuItems: maxMenuItems
176
+ maxMenuItems: maxMenuItems,
177
+ width: isSheet ? '100%' : undefined,
178
+ experimental: isSheet ? {
179
+ presentation: 'bottom-sheet'
180
+ } : undefined
163
181
  });
164
182
  }
165
183
  function useNumberEditorHandlers({
@@ -168,7 +186,9 @@ function useNumberEditorHandlers({
168
186
  max,
169
187
  isIntegerOnly,
170
188
  onChange,
171
- onEnter
189
+ onEnter,
190
+ onUnstage,
191
+ stagesAsTyped
172
192
  }) {
173
193
  const locale = useLocale();
174
194
  const pendingDecisionRef = useRef(null);
@@ -186,14 +206,23 @@ function useNumberEditorHandlers({
186
206
  pendingDecisionRef.current = null;
187
207
  }, []);
188
208
  const handleInput = useCallback(event => {
189
- pendingDecisionRef.current = resolveNumberInputCommit(event.currentTarget.value, {
209
+ const decision = resolveNumberInputCommit(event.currentTarget.value, {
190
210
  min,
191
211
  max,
192
212
  isIntegerOnly,
193
213
  locale,
194
214
  hasClear: false
195
215
  });
196
- }, [isIntegerOnly, locale, max, min]);
216
+ pendingDecisionRef.current = decision;
217
+ if (stagesAsTyped) {
218
+ if (decision.type === 'commit') {
219
+ onChange(toFilterValue(decision.value));
220
+ } else {
221
+ // Cleared, or not a number: nothing stands to confirm.
222
+ onUnstage?.();
223
+ }
224
+ }
225
+ }, [isIntegerOnly, locale, max, min, onChange, onUnstage, stagesAsTyped, toFilterValue]);
197
226
  const handleEnter = useCallback(() => {
198
227
  const decision = pendingDecisionRef.current;
199
228
  pendingDecisionRef.current = null;
@@ -221,7 +250,9 @@ function IntegerEditor({
221
250
  filterValue,
222
251
  onChange,
223
252
  onEnter,
224
- isDisabled
253
+ onUnstage,
254
+ isDisabled,
255
+ presentation
225
256
  }) {
226
257
  const t = useComponentTranslator();
227
258
  const currentValue = filterValue?.type === 'integer' ? filterValue.value : undefined;
@@ -231,7 +262,9 @@ function IntegerEditor({
231
262
  max: operatorValue.maxValue,
232
263
  isIntegerOnly: true,
233
264
  onChange,
234
- onEnter
265
+ onEnter,
266
+ onUnstage,
267
+ stagesAsTyped: presentation === 'bottom-sheet'
235
268
  });
236
269
  return /*#__PURE__*/_jsx(NumberInput, {
237
270
  label: t('@astryx.powersearch.valueEditor.value'),
@@ -247,7 +280,8 @@ function IntegerEditor({
247
280
  max: operatorValue.maxValue,
248
281
  units: operatorValue.units,
249
282
  isIntegerOnly: true,
250
- placeholder: t('@astryx.powersearch.valueEditor.enterNumberPlaceholder')
283
+ placeholder: t('@astryx.powersearch.valueEditor.enterNumberPlaceholder'),
284
+ width: presentation === 'bottom-sheet' ? '100%' : undefined
251
285
  });
252
286
  }
253
287
  function FloatEditor({
@@ -255,7 +289,9 @@ function FloatEditor({
255
289
  filterValue,
256
290
  onChange,
257
291
  onEnter,
258
- isDisabled
292
+ onUnstage,
293
+ isDisabled,
294
+ presentation
259
295
  }) {
260
296
  const t = useComponentTranslator();
261
297
  const currentValue = filterValue?.type === 'float' ? filterValue.value : undefined;
@@ -265,7 +301,9 @@ function FloatEditor({
265
301
  max: operatorValue.maxValue,
266
302
  isIntegerOnly: false,
267
303
  onChange,
268
- onEnter
304
+ onEnter,
305
+ onUnstage,
306
+ stagesAsTyped: presentation === 'bottom-sheet'
269
307
  });
270
308
  return /*#__PURE__*/_jsx(NumberInput, {
271
309
  label: t('@astryx.powersearch.valueEditor.value'),
@@ -280,14 +318,16 @@ function FloatEditor({
280
318
  min: operatorValue.minValue,
281
319
  max: operatorValue.maxValue,
282
320
  units: operatorValue.units,
283
- placeholder: t('@astryx.powersearch.valueEditor.enterNumberPlaceholder')
321
+ placeholder: t('@astryx.powersearch.valueEditor.enterNumberPlaceholder'),
322
+ width: presentation === 'bottom-sheet' ? '100%' : undefined
284
323
  });
285
324
  }
286
325
  function TimeEditor({
287
326
  operatorValue,
288
327
  filterValue,
289
328
  onChange,
290
- isDisabled
329
+ isDisabled,
330
+ presentation
291
331
  }) {
292
332
  const t = useComponentTranslator();
293
333
  const currentValue = filterValue?.type === 'time' ? filterValue.value : undefined;
@@ -305,13 +345,15 @@ function TimeEditor({
305
345
  }
306
346
  },
307
347
  min: operatorValue.minValue,
308
- max: operatorValue.maxValue
348
+ max: operatorValue.maxValue,
349
+ width: presentation === 'bottom-sheet' ? '100%' : undefined
309
350
  });
310
351
  }
311
352
  function DateAbsoluteEditor({
312
353
  filterValue,
313
354
  onChange,
314
- isDisabled
355
+ isDisabled,
356
+ presentation
315
357
  }) {
316
358
  const t = useComponentTranslator();
317
359
  // Convert unixSeconds to ISO date string for the date input
@@ -335,9 +377,68 @@ function DateAbsoluteEditor({
335
377
  unixSeconds
336
378
  });
337
379
  }
338
- }
380
+ },
381
+ width: presentation === 'bottom-sheet' ? '100%' : undefined
339
382
  });
340
383
  }
384
+ const RELATIVE_DATE_UNITS = [{
385
+ unit: 'day',
386
+ plural: 'days',
387
+ amounts: [1, 3, 7, 14, 30],
388
+ ago: '@astryx.powersearch.sheet.relativeDaysAgo',
389
+ fromNow: '@astryx.powersearch.sheet.relativeDaysFromNow'
390
+ }, {
391
+ unit: 'week',
392
+ plural: 'weeks',
393
+ amounts: [1, 2, 4],
394
+ ago: '@astryx.powersearch.sheet.relativeWeeksAgo',
395
+ fromNow: '@astryx.powersearch.sheet.relativeWeeksFromNow'
396
+ }, {
397
+ unit: 'month',
398
+ plural: 'months',
399
+ amounts: [1, 3, 6, 12],
400
+ ago: '@astryx.powersearch.sheet.relativeMonthsAgo',
401
+ fromNow: '@astryx.powersearch.sheet.relativeMonthsFromNow'
402
+ }];
403
+
404
+ /**
405
+ * The relative-date choices an operator offers, in display order. Shared by
406
+ * the popover's Selector and the sheet presentation's rows so both list the
407
+ * same values. With `t` the labels resolve through the catalog's ICU plural
408
+ * messages (the sheet presentation's rows); without it they are the popover
409
+ * editor's own literals. In English the two read identically.
410
+ */
411
+ export function buildRelativeDateOptions(operatorValue, t) {
412
+ const result = [];
413
+ for (const {
414
+ unit,
415
+ plural,
416
+ amounts,
417
+ ago,
418
+ fromNow
419
+ } of RELATIVE_DATE_UNITS) {
420
+ for (const amount of amounts) {
421
+ const unitWord = amount === 1 ? unit : plural;
422
+ if (operatorValue.isPastAllowed !== false) {
423
+ result.push({
424
+ value: `${amount}${unit[0]}_ago`,
425
+ label: t ? t(ago, {
426
+ count: amount
427
+ }) : `${amount} ${unitWord} ago`
428
+ });
429
+ }
430
+ if (operatorValue.isFutureAllowed !== false) {
431
+ result.push({
432
+ value: `${amount}${unit[0]}_from_now`,
433
+ label: t ? t(fromNow, {
434
+ count: amount
435
+ }) : `${amount} ${unitWord} from now`
436
+ });
437
+ }
438
+ }
439
+ }
440
+ return result;
441
+ }
341
442
  function DateRelativeEditor({
342
443
  operatorValue,
343
444
  filterValue,
@@ -346,40 +447,18 @@ function DateRelativeEditor({
346
447
  }) {
347
448
  const t = useComponentTranslator();
348
449
  const currentValue = filterValue?.type === 'date_relative' ? filterValue.value : undefined;
349
- const options = useMemo(() => {
350
- const result = [];
351
- const units = [{
352
- unit: 'day',
353
- plural: 'days'
354
- }, {
355
- unit: 'week',
356
- plural: 'weeks'
357
- }, {
358
- unit: 'month',
359
- plural: 'months'
360
- }];
361
- for (const {
362
- unit,
363
- plural
364
- } of units) {
365
- const amounts = unit === 'day' ? [1, 3, 7, 14, 30] : unit === 'week' ? [1, 2, 4] : [1, 3, 6, 12];
366
- for (const amount of amounts) {
367
- if (operatorValue.isPastAllowed !== false) {
368
- result.push({
369
- value: `${amount}${unit[0]}_ago`,
370
- label: `${amount} ${amount === 1 ? unit : plural} ago`
371
- });
372
- }
373
- if (operatorValue.isFutureAllowed !== false) {
374
- result.push({
375
- value: `${amount}${unit[0]}_from_now`,
376
- label: `${amount} ${amount === 1 ? unit : plural} from now`
377
- });
378
- }
379
- }
380
- }
381
- return result;
382
- }, [operatorValue.isPastAllowed, operatorValue.isFutureAllowed]);
450
+
451
+ // The choices depend on the two flags only; a config that rebuilds its
452
+ // operator objects per render keeps the same memoized list.
453
+ const {
454
+ isPastAllowed,
455
+ isFutureAllowed
456
+ } = operatorValue;
457
+ const options = useMemo(() => buildRelativeDateOptions({
458
+ type: 'date_relative',
459
+ isPastAllowed,
460
+ isFutureAllowed
461
+ }), [isPastAllowed, isFutureAllowed]);
383
462
  return /*#__PURE__*/_jsx(Selector, {
384
463
  label: t('@astryx.powersearch.valueEditor.relativeDate'),
385
464
  isLabelHidden: true,
@@ -397,7 +476,8 @@ function DateRelativeEditor({
397
476
  function DateRangeEditor({
398
477
  filterValue,
399
478
  onChange,
400
- isDisabled
479
+ isDisabled,
480
+ presentation
401
481
  }) {
402
482
  const t = useComponentTranslator();
403
483
  const currentValue = useMemo(() => {
@@ -448,6 +528,10 @@ function DateRangeEditor({
448
528
  value: currentValue,
449
529
  onChange: handleChange,
450
530
  hasClear: false
531
+ // A phone-wide sheet fits one month; the popover keeps the default.
532
+ ,
533
+ numberOfMonths: presentation === 'bottom-sheet' ? 1 : undefined,
534
+ width: presentation === 'bottom-sheet' ? '100%' : undefined
451
535
  })
452
536
  });
453
537
  }
@@ -525,9 +609,12 @@ function EntityListEditor({
525
609
  filterValue,
526
610
  onChange,
527
611
  maxMenuItems,
528
- isDisabled
612
+ isDisabled,
613
+ presentation,
614
+ fieldLabel
529
615
  }) {
530
616
  const t = useComponentTranslator();
617
+ const isSheet = presentation === 'bottom-sheet';
531
618
  const source = useMemo(() => {
532
619
  if (operatorValue.searchSource) {
533
620
  return operatorValue.searchSource;
@@ -551,8 +638,11 @@ function EntityListEditor({
551
638
  } : undefined
552
639
  }));
553
640
  }, [filterValue]);
641
+
642
+ // Sheet presentation: the Tokenizer's own sheet, titled with the field
643
+ // label, as for string_list.
554
644
  return /*#__PURE__*/_jsx(Tokenizer, {
555
- label: t('@astryx.powersearch.valueEditor.entities'),
645
+ label: isSheet && fieldLabel != null ? fieldLabel : t('@astryx.powersearch.valueEditor.entities'),
556
646
  isLabelHidden: true,
557
647
  isDisabled: isDisabled,
558
648
  searchSource: source,
@@ -576,7 +666,11 @@ function EntityListEditor({
576
666
  renderItem: operatorValue.renderItem,
577
667
  placeholder: t('@astryx.powersearch.valueEditor.searchPlaceholder'),
578
668
  debounceMs: operatorValue.searchSource ? 150 : 0,
579
- maxMenuItems: maxMenuItems
669
+ maxMenuItems: maxMenuItems,
670
+ width: isSheet ? '100%' : undefined,
671
+ experimental: isSheet ? {
672
+ presentation: 'bottom-sheet'
673
+ } : undefined
580
674
  });
581
675
  }
582
676
  function CustomEditor({
@@ -613,7 +707,10 @@ export function PowerSearchValueEditor({
613
707
  onChange,
614
708
  onEnter,
615
709
  maxMenuItems,
616
- isDisabled
710
+ isDisabled,
711
+ onUnstage,
712
+ presentation = 'popover',
713
+ fieldLabel
617
714
  }) {
618
715
  switch (operatorValue.type) {
619
716
  case 'empty':
@@ -621,6 +718,7 @@ export function PowerSearchValueEditor({
621
718
  case 'string':
622
719
  return /*#__PURE__*/_jsx(StringEditor, {
623
720
  isDisabled: isDisabled,
721
+ presentation: presentation,
624
722
  operatorValue: operatorValue,
625
723
  filterValue: filterValue,
626
724
  onChange: onChange,
@@ -630,6 +728,8 @@ export function PowerSearchValueEditor({
630
728
  case 'string_list':
631
729
  return /*#__PURE__*/_jsx(StringListEditor, {
632
730
  isDisabled: isDisabled,
731
+ presentation: presentation,
732
+ fieldLabel: fieldLabel,
633
733
  operatorValue: operatorValue,
634
734
  filterValue: filterValue,
635
735
  onChange: onChange,
@@ -638,6 +738,8 @@ export function PowerSearchValueEditor({
638
738
  case 'integer':
639
739
  return /*#__PURE__*/_jsx(IntegerEditor, {
640
740
  isDisabled: isDisabled,
741
+ presentation: presentation,
742
+ onUnstage: onUnstage,
641
743
  operatorValue: operatorValue,
642
744
  filterValue: filterValue,
643
745
  onChange: onChange,
@@ -646,6 +748,8 @@ export function PowerSearchValueEditor({
646
748
  case 'float':
647
749
  return /*#__PURE__*/_jsx(FloatEditor, {
648
750
  isDisabled: isDisabled,
751
+ presentation: presentation,
752
+ onUnstage: onUnstage,
649
753
  operatorValue: operatorValue,
650
754
  filterValue: filterValue,
651
755
  onChange: onChange,
@@ -654,6 +758,7 @@ export function PowerSearchValueEditor({
654
758
  case 'time':
655
759
  return /*#__PURE__*/_jsx(TimeEditor, {
656
760
  isDisabled: isDisabled,
761
+ presentation: presentation,
657
762
  operatorValue: operatorValue,
658
763
  filterValue: filterValue,
659
764
  onChange: onChange
@@ -661,6 +766,7 @@ export function PowerSearchValueEditor({
661
766
  case 'date_absolute':
662
767
  return /*#__PURE__*/_jsx(DateAbsoluteEditor, {
663
768
  isDisabled: isDisabled,
769
+ presentation: presentation,
664
770
  operatorValue: operatorValue,
665
771
  filterValue: filterValue,
666
772
  onChange: onChange
@@ -675,6 +781,7 @@ export function PowerSearchValueEditor({
675
781
  case 'date_range':
676
782
  return /*#__PURE__*/_jsx(DateRangeEditor, {
677
783
  isDisabled: isDisabled,
784
+ presentation: presentation,
678
785
  operatorValue: operatorValue,
679
786
  filterValue: filterValue,
680
787
  onChange: onChange
@@ -696,6 +803,8 @@ export function PowerSearchValueEditor({
696
803
  case 'entity_list':
697
804
  return /*#__PURE__*/_jsx(EntityListEditor, {
698
805
  isDisabled: isDisabled,
806
+ presentation: presentation,
807
+ fieldLabel: fieldLabel,
699
808
  operatorValue: operatorValue,
700
809
  filterValue: filterValue,
701
810
  onChange: onChange,
@@ -10,6 +10,13 @@
10
10
  import type { OperatorValue, FilterValue } from './types.js';
11
11
  import type { InternalConfig } from './useInternalConfig.js';
12
12
  import type { Locale, TranslatorFn } from '../i18n/index.js';
13
+ /**
14
+ * A number in the provider locale's digits, decimal mark, and — unless the
15
+ * options say otherwise — grouping. The shared number helper for
16
+ * PowerSearch's own readings of a value — this module owns the raw `Intl`
17
+ * access.
18
+ */
19
+ export declare function formatSharedNumber(value: number, locale: Locale, options?: Pick<Intl.NumberFormatOptions, 'useGrouping' | 'maximumFractionDigits'>): string;
13
20
  export declare function formatDateAbsolute(unixSeconds: number, locale: Locale, timezoneID?: string): string;
14
21
  /**
15
22
  * Compact date-only rendering (no time-of-day) for the token pill's inline