@astryxdesign/core 0.7.8-canary.5a373df → 0.7.8-canary.f50bc74

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.
@@ -4,8 +4,8 @@
4
4
  * useAdaptivePresentation, and PowerSearchBottomSheet (lazy)
5
5
  * @output Structured filter bar with token-based filter management
6
6
  * @position Main component; forwards DOM ref and exposes tokenizer control via
7
- * handleRef. The experimental `presentation` option swaps the tokenizer
8
- * field and editor popover for one trigger that opens PowerSearchBottomSheet.
7
+ * handleRef. The `presentation` prop swaps the tokenizer field and editor
8
+ * popover for one trigger that opens PowerSearchBottomSheet.
9
9
  *
10
10
  * SYNC: When modified, update:
11
11
  * - /packages/core/src/PowerSearch/index.ts
@@ -17,6 +17,7 @@ import type { BaseProps } from '../BaseProps.js';
17
17
  import { type TokenizerOverflowBehavior } from '../Tokenizer/index.js';
18
18
  import type { IconType } from '../Icon/index.js';
19
19
  import type { InputStatus } from '../Field/index.js';
20
+ import { type AdaptivePresentation } from '../hooks/useAdaptivePresentation.js';
20
21
  import type { PowerSearchConfig, PowerSearchFilter, PowerSearchChangeType, PowerSearchHandle, PowerSearchComponents } from './types.js';
21
22
  import type { FieldStatusPlacement } from '../Field/fieldStatusPlacement.js';
22
23
  export type PowerSearchSize = 'sm' | 'md' | 'lg';
@@ -122,36 +123,31 @@ export interface PowerSearchProps extends Omit<BaseProps<HTMLElement>, 'onChange
122
123
  */
123
124
  components?: PowerSearchComponents;
124
125
  /**
125
- * Experimental options, outside the stable compatibility promise: anything
126
- * in this object may change or be removed in a patch release. Omit it for
127
- * the stable behavior.
128
- * @experimental
126
+ * How the field presents filter editing.
127
+ * - `'popover'`: the tokenizer field with its typeahead and the editor
128
+ * popover, on every device.
129
+ * - `'bottom-sheet'`: the whole field is one trigger showing display-only
130
+ * filter tokens; it opens a stack of sheets. Filters lists the filters
131
+ * as rows that edit or remove one, with Add filter, Done, and Clear
132
+ * all, which asks first and keeps read-only filters. Add filter opens
133
+ * above it with the fields (or the content search with inline
134
+ * suggestions), and a value step opens above that, stages operator →
135
+ * value, and confirms from its footer. Dismissing a step reveals the
136
+ * one beneath. Suited to compact touch screens, where the editor
137
+ * popover competes with the software keyboard.
138
+ * - `'adaptive'`: the bottom sheet on compact coarse-pointer screens,
139
+ * otherwise the popover — the same resolution Selector uses. The server
140
+ * render and the hydrating render are the popover.
141
+ *
142
+ * In the sheet presentation `menuWidth` and `tokenOverflowBehavior` have
143
+ * no surface to act on and warn in development. Pass `'popover'` to keep
144
+ * the tokenizer field and the editor popover on every device.
145
+ * @default 'adaptive'
129
146
  */
130
- experimental?: {
131
- /**
132
- * How the field presents filter editing.
133
- * - `'popover'`: the tokenizer field with its typeahead and the editor
134
- * popover — the stable behavior.
135
- * - `'bottom-sheet'`: the whole field is one trigger showing display-only
136
- * filter tokens; it opens a stack of sheets. Filters lists the filters
137
- * as rows that edit or remove one, with Add filter, Done, and Clear
138
- * all, which asks first and keeps read-only filters. Add filter opens
139
- * above it with the fields (or the content search with inline
140
- * suggestions), and a value step opens above that, stages operator →
141
- * value, and confirms from its footer. Dismissing a step reveals the
142
- * one beneath. Suited to compact touch screens, where the editor
143
- * popover competes with the software keyboard.
144
- * - `'adaptive'`: the bottom sheet on compact coarse-pointer screens,
145
- * otherwise the popover — the same resolution Selector uses.
146
- *
147
- * In the sheet presentation `menuWidth` and `tokenOverflowBehavior` have
148
- * no surface to act on and warn in development.
149
- * @experimental
150
- * @default 'popover'
151
- */
152
- presentation?: 'popover' | 'bottom-sheet' | 'adaptive';
153
- };
147
+ presentation?: PowerSearchPresentation;
154
148
  }
149
+ /** How PowerSearch presents filter editing; see `PowerSearchProps.presentation`. */
150
+ export type PowerSearchPresentation = AdaptivePresentation;
155
151
  /**
156
152
  * Structured filter bar where each token represents a filter (field + operator + value).
157
153
  *
@@ -218,7 +214,7 @@ export interface PowerSearchProps extends Omit<BaseProps<HTMLElement>, 'onChange
218
214
  * };
219
215
  * ```
220
216
  */
221
- export declare function PowerSearch({ config: configProp, filters, onChange, label: labelFromProps, isLabelHidden, placeholder: placeholderFromProps, hasAutoFocus, hasClear, isReadOnly, isDisabled, disabledMessage, startIcon, onFocus, onBlur, status, statusVariant, menuWidth, maxTokenLength, maxOperatorMenuItems, maxSearchResults, popoverSaveButtonLabel: popoverSaveButtonLabelFromProps, timezoneID, tokenOverflowBehavior, endContent, resultCount, ref, handleRef, size: sizeProp, 'data-testid': testId, xstyle, className, style, components: componentOverrides, experimental, }: PowerSearchProps): React.JSX.Element;
217
+ export declare function PowerSearch({ config: configProp, filters, onChange, label: labelFromProps, isLabelHidden, placeholder: placeholderFromProps, hasAutoFocus, hasClear, isReadOnly, isDisabled, disabledMessage, startIcon, onFocus, onBlur, status, statusVariant, menuWidth, maxTokenLength, maxOperatorMenuItems, maxSearchResults, popoverSaveButtonLabel: popoverSaveButtonLabelFromProps, timezoneID, tokenOverflowBehavior, endContent, resultCount, ref, handleRef, size: sizeProp, 'data-testid': testId, xstyle, className, style, components: componentOverrides, presentation, }: PowerSearchProps): React.JSX.Element;
222
218
  export declare namespace PowerSearch {
223
219
  var displayName: string;
224
220
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PowerSearch.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearch.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,EAUZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EAGL,KAAK,yBAAyB,EAC/B,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEtC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAuC1C,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EAIjB,qBAAqB,EACrB,iBAAiB,EAGjB,qBAAqB,EAEtB,MA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EAAE,kBAAkB,EAC9B,YAAyB,GAC1B,EAAE,gBAAgB,qBAmiClB;yBAtkCe,WAAW"}
@@ -8,8 +8,8 @@
8
8
  * useAdaptivePresentation, and PowerSearchBottomSheet (lazy)
9
9
  * @output Structured filter bar with token-based filter management
10
10
  * @position Main component; forwards DOM ref and exposes tokenizer control via
11
- * handleRef. The experimental `presentation` option swaps the tokenizer
12
- * field and editor popover for one trigger that opens PowerSearchBottomSheet.
11
+ * handleRef. The `presentation` prop swaps the tokenizer field and editor
12
+ * popover for one trigger that opens PowerSearchBottomSheet.
13
13
  *
14
14
  * SYNC: When modified, update:
15
15
  * - /packages/core/src/PowerSearch/index.ts
@@ -181,6 +181,8 @@ function PowerSearchTokenValue({
181
181
  // Types
182
182
  // =============================================================================
183
183
 
184
+ /** How PowerSearch presents filter editing; see `PowerSearchProps.presentation`. */
185
+
184
186
  // =============================================================================
185
187
  // State
186
188
  // =============================================================================
@@ -297,7 +299,7 @@ export function PowerSearch({
297
299
  className,
298
300
  style,
299
301
  components: componentOverrides,
300
- experimental
302
+ presentation = 'adaptive'
301
303
  }) {
302
304
  const size = useSize(sizeProp, 'md');
303
305
  const config = useInternalConfig(configProp);
@@ -308,12 +310,6 @@ export function PowerSearch({
308
310
  const placeholder = placeholderFromProps ?? t('@astryx.powersearch.placeholder');
309
311
  const popoverSaveButtonLabel = popoverSaveButtonLabelFromProps ?? t('@astryx.powersearch.editor.apply');
310
312
  const tokenizerRef = useRef(null);
311
-
312
- // Experimental presentation. `adaptive`
313
- // resolves through the policy the selection controls share; an open flow
314
- // keeps its presentation until it closes, so a resolution change mid-task
315
- // cannot pull the surface out from under the person.
316
- const presentation = experimental?.presentation ?? 'popover';
317
313
  const resolvedPresentation = useAdaptivePresentation(presentation);
318
314
  const [isSheetOpen, setIsSheetOpen] = useState(false);
319
315
  // Latched for the flow's lifetime: the flow stays presented after it closes
@@ -387,8 +383,8 @@ export function PowerSearch({
387
383
  setIsSheetOpen(false);
388
384
  }
389
385
  }
390
- useDevWarning('PowerSearch', '`menuWidth` has no surface in the bottom-sheet presentation: the sheet flow has no typeahead popover to size. Scope it to the popover presentation or leave it out.', isSheetPresentation && menuWidth != null);
391
- useDevWarning('PowerSearch', '`tokenOverflowBehavior` has no surface in the bottom-sheet presentation: the trigger wraps its display-only tokens. Scope it to the popover presentation or leave it out.', isSheetPresentation && tokenOverflowBehavior != null);
386
+ useDevWarning('PowerSearch', '`menuWidth` has no surface in the bottom-sheet presentation: the sheet flow has no typeahead popover to size. Pass `presentation="popover"` to keep the popover on every device, or leave it out.', isSheetPresentation && menuWidth != null);
387
+ useDevWarning('PowerSearch', '`tokenOverflowBehavior` has no surface in the bottom-sheet presentation: the trigger wraps its display-only tokens. Pass `presentation="popover"` to keep the tokenizer field on every device, or leave it out.', isSheetPresentation && tokenOverflowBehavior != null);
392
388
  const [popoverState, setPopoverStateRaw] = useState({
393
389
  type: 'idle'
394
390
  });
@@ -6,7 +6,7 @@
6
6
  * RadioList, Text, TextInput, PowerSearchValueEditor, the internal sheet
7
7
  * confirmation and search-drag owners, i18n
8
8
  * @output Exports PowerSearchBottomSheet — the touch surface of
9
- * `PowerSearch experimental.presentation="bottom-sheet"`: a Filters sheet
9
+ * `PowerSearch presentation="bottom-sheet"`: a Filters sheet
10
10
  * with editable rows and trailing remove actions, Add filter in its fixed
11
11
  * header and Clear all / Done in its fixed footer, an Add filter sheet with
12
12
  * grouped field rows or the content search with inline suggestions, and a
@@ -10,7 +10,7 @@
10
10
  * RadioList, Text, TextInput, PowerSearchValueEditor, the internal sheet
11
11
  * confirmation and search-drag owners, i18n
12
12
  * @output Exports PowerSearchBottomSheet — the touch surface of
13
- * `PowerSearch experimental.presentation="bottom-sheet"`: a Filters sheet
13
+ * `PowerSearch presentation="bottom-sheet"`: a Filters sheet
14
14
  * with editable rows and trailing remove actions, Add filter in its fixed
15
15
  * header and Clear all / Done in its fixed footer, an Add filter sheet with
16
16
  * grouped field rows or the content search with inline suggestions, and a
@@ -7,7 +7,7 @@
7
7
  * SYNC: When adding new PowerSearch files, update exports here
8
8
  */
9
9
  export { PowerSearch } from './PowerSearch.js';
10
- export type { PowerSearchProps, PowerSearchSize } from './PowerSearch.js';
10
+ export type { PowerSearchPresentation, PowerSearchProps, PowerSearchSize, } from './PowerSearch.js';
11
11
  export { PowerSearchToken } from './PowerSearchToken.js';
12
12
  export { PowerSearchFilterEditor } from './PowerSearchFilterEditor.js';
13
13
  export { resolveOperatorLabel } from './resolveOperatorLabel.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,YAAY,EAAC,gBAAgB,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAErE,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAElE,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAC,eAAe,EAAE,SAAS,EAAC,MAAM,wBAAwB,CAAC;AAEvE,YAAY,EAEV,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAG9B,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EAGnB,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EAGjB,iBAAiB,EACjB,aAAa,EAGb,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,EAGjB,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,YAAY,EACV,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,GAChB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAElE,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAC,eAAe,EAAE,SAAS,EAAC,MAAM,wBAAwB,CAAC;AAEvE,YAAY,EAEV,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAG9B,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EAGnB,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EAGjB,iBAAiB,EACjB,aAAa,EAGb,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,EAGjB,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/core",
3
- "version": "0.7.8-canary.5a373df",
3
+ "version": "0.7.8-canary.f50bc74",
4
4
  "displayName": "Astryx Core",
5
5
  "description": "The component library. Accessible, themeable React components with built-in spacing, dark mode, and StyleX styling.",
6
6
  "author": "Meta Open Source",
@@ -870,9 +870,9 @@
870
870
  "react-dom": ">=19.0.0"
871
871
  },
872
872
  "devDependencies": {
873
- "@astryxdesign/a11y-spec": "0.7.8-canary.5a373df",
874
- "@astryxdesign/cli": "0.7.8-canary.5a373df",
875
- "@astryxdesign/interaction-harness": "0.7.8-canary.5a373df",
873
+ "@astryxdesign/a11y-spec": "0.7.8-canary.f50bc74",
874
+ "@astryxdesign/cli": "0.7.8-canary.f50bc74",
875
+ "@astryxdesign/interaction-harness": "0.7.8-canary.f50bc74",
876
876
  "@babel/cli": "^7.29.7",
877
877
  "@babel/core": "^7.29.7",
878
878
  "@babel/preset-react": "^7.29.7",
@@ -208,22 +208,22 @@ export const docs = {
208
208
  'StyleX styles for layout customization. Must be a stylex.create() value.',
209
209
  },
210
210
  {
211
- name: 'experimental',
212
- type: "{presentation?: 'popover' | 'bottom-sheet' | 'adaptive'}",
213
- stability: 'experimental',
211
+ name: 'presentation',
212
+ type: "'popover' | 'bottom-sheet' | 'adaptive'",
214
213
  description:
215
- "Experimental options: anything in this object may change or be removed in a patch release, and omitting it keeps the stable behavior. presentation (default 'popover') chooses how the field presents filter editing. popover is the tokenizer field with its typeahead and the editor popover. bottom-sheet makes the whole field one trigger showing display-only filter tokens: it opens a Filters sheet listing the filters as rows that edit or remove a filter, with Add filter, Done, and Clear all (which asks first and keeps read-only filters); an Add filter sheet with the fields (or the content search with inline suggestions) opens above it, and a value step that stages operator → value and confirms from its footer opens above that. Dismissing a step reveals the one beneath. List values edit through the Tokenizer's own sheet. adaptive uses the bottom sheet on compact touch screens and the popover otherwise, resolved the same way Selector resolves it. In the sheet presentation menuWidth and tokenOverflowBehavior have no surface to act on and warn in development.",
214
+ 'How the field presents filter editing. adaptive (the default) uses the bottom sheet on compact touch screens and the popover otherwise, resolved the same way Selector resolves it; the server render and the hydrating render are the popover. popover is the tokenizer field with its typeahead and the editor popover on every device. bottom-sheet makes the whole field, on every device, one trigger showing display-only filter tokens: it opens a Filters sheet listing the filters as rows that edit or remove a filter, with Add filter, Done, and Clear all (which asks first and keeps read-only filters); an Add filter sheet with the fields (or the content search with inline suggestions) opens above it, and a value step that stages operator → value and confirms from its footer opens above that. Dismissing a step reveals the one beneath. List values edit through the Tokenizer\'s own sheet. In the sheet presentation menuWidth and tokenOverflowBehavior have no surface to act on and warn in development. Pass presentation="popover" to keep the tokenizer field and the editor popover on every device.',
215
+ default: "'adaptive'",
216
216
  },
217
217
  ],
218
218
  examples: [
219
219
  {
220
- label: 'Touch sheet on compact screens (experimental)',
220
+ label: 'Keep the popover on every device',
221
221
  code: `const [filters, setFilters] = useState([]);
222
222
  <PowerSearch
223
223
  config={config}
224
224
  filters={filters}
225
225
  onChange={next => setFilters(next)}
226
- experimental={{presentation: 'adaptive'}}
226
+ presentation="popover"
227
227
  />`,
228
228
  },
229
229
  ],
@@ -481,11 +481,11 @@ export const docsZh = {
481
481
  description: '用于布局自定义的 StyleX 样式。必须是 stylex.create() 值。',
482
482
  },
483
483
  {
484
- name: 'experimental',
485
- type: "{presentation?: 'popover' | 'bottom-sheet' | 'adaptive'}",
486
- stability: 'experimental',
484
+ name: 'presentation',
485
+ type: "'popover' | 'bottom-sheet' | 'adaptive'",
487
486
  description:
488
- "实验性选项:此对象中的任何内容都可能在补丁版本中更改或移除;省略它即保持稳定行为。presentation(默认 'popover')决定字段如何呈现筛选编辑:popover 为带有预输入和编辑弹出层的标记字段;bottom-sheet 将整个字段变为一个显示只读筛选标记的触发按钮——点按后打开列出筛选项的「筛选」面板,每行可编辑或移除筛选(含添加筛选、完成、全部清除;全部清除会先确认,并保留只读筛选);列出字段(或带内联建议的内容搜索)的「添加筛选」面板在其上方打开,按运算符 → 值暂存并在底部确认的取值步骤再在其上方打开。关闭某一步会露出下方的那一步。列表值通过 Tokenizer 自身的面板编辑。adaptive 在紧凑触摸屏上使用底部面板,其他情况使用 popover,解析方式与 Selector 相同。在底部面板呈现中,menuWidth 和 tokenOverflowBehavior 没有作用对象,并会在开发环境中发出警告。",
487
+ '字段如何呈现筛选编辑。adaptive(默认)在紧凑触摸屏上使用底部面板,其他情况使用 popover,解析方式与 Selector 相同;服务端渲染和水合期间的渲染均为 popover。popover 在所有设备上为带有预输入和编辑弹出层的标记字段。bottom-sheet 在所有设备上将整个字段变为一个显示只读筛选标记的触发按钮——点按后打开列出筛选项的「筛选」面板,每行可编辑或移除筛选(含添加筛选、完成、全部清除;全部清除会先确认,并保留只读筛选);列出字段(或带内联建议的内容搜索)的「添加筛选」面板在其上方打开,按运算符 → 值暂存并在底部确认的取值步骤再在其上方打开。关闭某一步会露出下方的那一步。列表值通过 Tokenizer 自身的面板编辑。在底部面板呈现中,menuWidth 和 tokenOverflowBehavior 没有作用对象,并会在开发环境中发出警告。传入 presentation="popover" 可在所有设备上保留标记字段和编辑弹出层。',
488
+ default: "'adaptive'",
489
489
  },
490
490
  ],
491
491
  usage: {
@@ -582,7 +582,7 @@ export const docsDense = {
582
582
  size: 'Search input+token size.',
583
583
  xstyle:
584
584
  'StyleX styles for layout customization. Must be stylex.create() value.',
585
- experimental:
586
- "Experimental; may change in a patch. presentation: 'popover' (default, tokenizer field + editor popover) | 'bottom-sheet' (one trigger with display-only tokens + stacked Filters / Add filter / value sheets; rows remove inline; Clear all confirms, keeps read-only; list values via Tokenizer's sheet) | 'adaptive' (sheet on compact touch, else popover).",
585
+ presentation:
586
+ "'adaptive' (default: sheet on compact touch, else popover; SSR/hydration render popover) | 'popover' (tokenizer field + editor popover, every device) | 'bottom-sheet' (one trigger with display-only tokens + stacked Filters / Add filter / value sheets; rows remove inline; Clear all confirms, keeps read-only; list values via Tokenizer's sheet). Sheet: menuWidth/tokenOverflowBehavior inert (dev warning). presentation=\"popover\" keeps the popover on every device.",
587
587
  },
588
588
  };
@@ -8,8 +8,8 @@
8
8
  * useAdaptivePresentation, and PowerSearchBottomSheet (lazy)
9
9
  * @output Structured filter bar with token-based filter management
10
10
  * @position Main component; forwards DOM ref and exposes tokenizer control via
11
- * handleRef. The experimental `presentation` option swaps the tokenizer
12
- * field and editor popover for one trigger that opens PowerSearchBottomSheet.
11
+ * handleRef. The `presentation` prop swaps the tokenizer field and editor
12
+ * popover for one trigger that opens PowerSearchBottomSheet.
13
13
  *
14
14
  * SYNC: When modified, update:
15
15
  * - /packages/core/src/PowerSearch/index.ts
@@ -58,7 +58,10 @@ import {usePopover} from '../Popover/usePopover';
58
58
  import {useTooltip} from '../Tooltip/useTooltip';
59
59
  import {layerViewportInset} from '../Layer/layerViewportInset.stylex';
60
60
  import {useAnnounce} from '../hooks/useAnnounce';
61
- import {useAdaptivePresentation} from '../hooks/useAdaptivePresentation';
61
+ import {
62
+ type AdaptivePresentation,
63
+ useAdaptivePresentation,
64
+ } from '../hooks/useAdaptivePresentation';
62
65
  import {useDevWarning} from '../hooks/useDevWarning';
63
66
  import {useIsHydrating} from '../hooks/useIsHydrating';
64
67
  import {
@@ -416,39 +419,34 @@ export interface PowerSearchProps extends Omit<
416
419
  * Keys are operator value types (e.g. 'string', 'enum', 'date_absolute').
417
420
  */
418
421
  components?: PowerSearchComponents;
419
-
420
422
  /**
421
- * Experimental options, outside the stable compatibility promise: anything
422
- * in this object may change or be removed in a patch release. Omit it for
423
- * the stable behavior.
424
- * @experimental
423
+ * How the field presents filter editing.
424
+ * - `'popover'`: the tokenizer field with its typeahead and the editor
425
+ * popover, on every device.
426
+ * - `'bottom-sheet'`: the whole field is one trigger showing display-only
427
+ * filter tokens; it opens a stack of sheets. Filters lists the filters
428
+ * as rows that edit or remove one, with Add filter, Done, and Clear
429
+ * all, which asks first and keeps read-only filters. Add filter opens
430
+ * above it with the fields (or the content search with inline
431
+ * suggestions), and a value step opens above that, stages operator →
432
+ * value, and confirms from its footer. Dismissing a step reveals the
433
+ * one beneath. Suited to compact touch screens, where the editor
434
+ * popover competes with the software keyboard.
435
+ * - `'adaptive'`: the bottom sheet on compact coarse-pointer screens,
436
+ * otherwise the popover — the same resolution Selector uses. The server
437
+ * render and the hydrating render are the popover.
438
+ *
439
+ * In the sheet presentation `menuWidth` and `tokenOverflowBehavior` have
440
+ * no surface to act on and warn in development. Pass `'popover'` to keep
441
+ * the tokenizer field and the editor popover on every device.
442
+ * @default 'adaptive'
425
443
  */
426
- experimental?: {
427
- /**
428
- * How the field presents filter editing.
429
- * - `'popover'`: the tokenizer field with its typeahead and the editor
430
- * popover — the stable behavior.
431
- * - `'bottom-sheet'`: the whole field is one trigger showing display-only
432
- * filter tokens; it opens a stack of sheets. Filters lists the filters
433
- * as rows that edit or remove one, with Add filter, Done, and Clear
434
- * all, which asks first and keeps read-only filters. Add filter opens
435
- * above it with the fields (or the content search with inline
436
- * suggestions), and a value step opens above that, stages operator →
437
- * value, and confirms from its footer. Dismissing a step reveals the
438
- * one beneath. Suited to compact touch screens, where the editor
439
- * popover competes with the software keyboard.
440
- * - `'adaptive'`: the bottom sheet on compact coarse-pointer screens,
441
- * otherwise the popover — the same resolution Selector uses.
442
- *
443
- * In the sheet presentation `menuWidth` and `tokenOverflowBehavior` have
444
- * no surface to act on and warn in development.
445
- * @experimental
446
- * @default 'popover'
447
- */
448
- presentation?: 'popover' | 'bottom-sheet' | 'adaptive';
449
- };
444
+ presentation?: PowerSearchPresentation;
450
445
  }
451
446
 
447
+ /** How PowerSearch presents filter editing; see `PowerSearchProps.presentation`. */
448
+ export type PowerSearchPresentation = AdaptivePresentation;
449
+
452
450
  // =============================================================================
453
451
  // State
454
452
  // =============================================================================
@@ -583,7 +581,7 @@ export function PowerSearch({
583
581
  className,
584
582
  style,
585
583
  components: componentOverrides,
586
- experimental,
584
+ presentation = 'adaptive',
587
585
  }: PowerSearchProps) {
588
586
  const size = useSize(sizeProp, 'md');
589
587
  const config = useInternalConfig(configProp);
@@ -597,11 +595,6 @@ export function PowerSearch({
597
595
  popoverSaveButtonLabelFromProps ?? t('@astryx.powersearch.editor.apply');
598
596
  const tokenizerRef = useRef<TokenizerHandle>(null);
599
597
 
600
- // Experimental presentation. `adaptive`
601
- // resolves through the policy the selection controls share; an open flow
602
- // keeps its presentation until it closes, so a resolution change mid-task
603
- // cannot pull the surface out from under the person.
604
- const presentation = experimental?.presentation ?? 'popover';
605
598
  const resolvedPresentation = useAdaptivePresentation(presentation);
606
599
  const [isSheetOpen, setIsSheetOpen] = useState(false);
607
600
  // Latched for the flow's lifetime: the flow stays presented after it closes
@@ -687,12 +680,12 @@ export function PowerSearch({
687
680
  }
688
681
  useDevWarning(
689
682
  'PowerSearch',
690
- '`menuWidth` has no surface in the bottom-sheet presentation: the sheet flow has no typeahead popover to size. Scope it to the popover presentation or leave it out.',
683
+ '`menuWidth` has no surface in the bottom-sheet presentation: the sheet flow has no typeahead popover to size. Pass `presentation="popover"` to keep the popover on every device, or leave it out.',
691
684
  isSheetPresentation && menuWidth != null,
692
685
  );
693
686
  useDevWarning(
694
687
  'PowerSearch',
695
- '`tokenOverflowBehavior` has no surface in the bottom-sheet presentation: the trigger wraps its display-only tokens. Scope it to the popover presentation or leave it out.',
688
+ '`tokenOverflowBehavior` has no surface in the bottom-sheet presentation: the trigger wraps its display-only tokens. Pass `presentation="popover"` to keep the tokenizer field on every device, or leave it out.',
696
689
  isSheetPresentation && tokenOverflowBehavior != null,
697
690
  );
698
691
 
@@ -10,7 +10,7 @@
10
10
  * RadioList, Text, TextInput, PowerSearchValueEditor, the internal sheet
11
11
  * confirmation and search-drag owners, i18n
12
12
  * @output Exports PowerSearchBottomSheet — the touch surface of
13
- * `PowerSearch experimental.presentation="bottom-sheet"`: a Filters sheet
13
+ * `PowerSearch presentation="bottom-sheet"`: a Filters sheet
14
14
  * with editable rows and trailing remove actions, Add filter in its fixed
15
15
  * header and Clear all / Done in its fixed footer, an Add filter sheet with
16
16
  * grouped field rows or the content search with inline suggestions, and a
@@ -12,7 +12,11 @@
12
12
  */
13
13
 
14
14
  export {PowerSearch} from './PowerSearch';
15
- export type {PowerSearchProps, PowerSearchSize} from './PowerSearch';
15
+ export type {
16
+ PowerSearchPresentation,
17
+ PowerSearchProps,
18
+ PowerSearchSize,
19
+ } from './PowerSearch';
16
20
 
17
21
  export {PowerSearchToken} from './PowerSearchToken';
18
22
  export {PowerSearchFilterEditor} from './PowerSearchFilterEditor';