@texturehq/edges 5.0.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -205,6 +205,93 @@ interface ColorFieldProps extends Omit<TextFieldProps$1, "isRequired" | "size" |
205
205
  */
206
206
  declare function ColorField({ label, description, errorMessage, size, tooltip, isRequired, transparent, className, validationResult, value: controlledValue, defaultValue, onChange, placeholder, showColorSwatch, reserveErrorSpace, ...props }: ColorFieldProps): react_jsx_runtime.JSX.Element;
207
207
 
208
+ interface MultiSelectOption {
209
+ value: string;
210
+ label: string;
211
+ /** Display-only decoration. Never contributes to the search key. */
212
+ count?: number;
213
+ disabled?: boolean;
214
+ group?: string;
215
+ }
216
+ type MultiSelectMatcher = (text: string, query: string) => boolean;
217
+ declare const defaultMultiSelectMatcher: MultiSelectMatcher;
218
+ /**
219
+ * The only strings an option is searchable by. Presentational decoration —
220
+ * `count`, badges, anything a renderer composes — is deliberately excluded:
221
+ * making facet-count digits searchable turned a query for `5` into a match on
222
+ * a substation labelled `28 (15656)`.
223
+ */
224
+ declare function multiSelectSearchKeys(option: MultiSelectOption): string[];
225
+ declare function filterMultiSelectOptions<T extends MultiSelectOption>(options: readonly T[], query: string, matcher?: MultiSelectMatcher): T[];
226
+ /**
227
+ * Whether the typed string should be offered as a selectable literal.
228
+ *
229
+ * The trigger is "the query is not already an identity in play" — not "nothing
230
+ * in the list matched". A match-count trigger is defeatable by any incidental
231
+ * substring hit, which is how single-digit values became unreachable in the
232
+ * control this component replaces.
233
+ */
234
+ declare function shouldOfferLiteralOption(args: {
235
+ query: string;
236
+ options: readonly MultiSelectOption[];
237
+ selected: readonly string[];
238
+ }): boolean;
239
+ interface MultiSelectSelectionEntry {
240
+ value: string;
241
+ label: string;
242
+ count?: number;
243
+ /** True when the value is not present in the current `options` set. */
244
+ isUnknown: boolean;
245
+ }
246
+ /**
247
+ * Selections in insertion order, hydrating labels from `options` where possible.
248
+ * Values with no matching option still produce an entry so URL-hydrated state is
249
+ * never silently dropped.
250
+ */
251
+ declare function multiSelectSelectionEntries(selected: readonly string[], options: readonly MultiSelectOption[]): MultiSelectSelectionEntry[];
252
+
253
+ interface MultiSelectProps {
254
+ options: readonly MultiSelectOption[];
255
+ /** Controlled selection. Order is insertion order. */
256
+ value?: readonly string[];
257
+ /** Uncontrolled initial selection. */
258
+ defaultValue?: readonly string[];
259
+ onChange: (next: string[]) => void;
260
+ label: string;
261
+ placeholder?: string;
262
+ size?: Size;
263
+ loading?: boolean;
264
+ disabled?: boolean;
265
+ maxSelected?: number;
266
+ /** Offer the typed string as a selectable value. Off by default. */
267
+ allowLiteral?: boolean;
268
+ /** Server-side search. Debouncing is the caller's job. */
269
+ onSearchChange?: (query: string) => void;
270
+ /** `options` is a clipped set rather than the whole domain. */
271
+ truncated?: boolean;
272
+ /** Size of the whole domain. Rendered with `truncated` as "showing N of M". */
273
+ totalCount?: number;
274
+ emptyMessage?: string;
275
+ showSelectAll?: boolean;
276
+ description?: string;
277
+ errorMessage?: string;
278
+ isRequired?: boolean;
279
+ /** Fires when the search input loses focus. Form adapters use this to mark the field touched. */
280
+ onBlur?: (event: React__default.FocusEvent<HTMLInputElement>) => void;
281
+ /** Ref to the search input, so callers (and `setFocus`) can focus the control. */
282
+ inputRef?: React__default.Ref<HTMLInputElement>;
283
+ className?: string;
284
+ id?: string;
285
+ }
286
+ /**
287
+ * MultiSelect
288
+ *
289
+ * A combobox whose popup is a multi-select listbox (W3C ARIA APG): a search
290
+ * input narrows a checkbox list, and current selections live in their own
291
+ * pinned region above it.
292
+ */
293
+ declare function MultiSelect({ options, value, defaultValue, onChange, label, placeholder, size, loading, disabled, maxSelected, allowLiteral, onSearchChange, truncated, totalCount, emptyMessage, showSelectAll, description, errorMessage, isRequired, onBlur, inputRef: forwardedInputRef, className, id, }: MultiSelectProps): react_jsx_runtime.JSX.Element;
294
+
208
295
  /**
209
296
  * NumberField
210
297
  *
@@ -546,4 +633,4 @@ interface TimeFieldProps extends Omit<TimeFieldProps$1<TimeValue>, "isRequired"
546
633
  */
547
634
  declare function TimeField({ label, description, errorMessage, size, tooltip, isRequired, isDisabled, isInvalid, reserveErrorSpace, validationResult, className, descriptionPlacement, ...props }: TimeFieldProps): react_jsx_runtime.JSX.Element;
548
635
 
549
- export { Autocomplete as A, Button as B, Checkbox as C, NumberField as N, RadioCardGroup as R, Select as S, TextArea as T, CheckboxGroup as a, ColorField as b, RadioGroup as c, Switch as d, TextField as e, type TimeFieldProps as f, type ButtonProps as g, type ColorFieldProps as h, Radio as i, RadioCard as j, type RadioCardGroupProps as k, type RadioCardProps as l, type SelectItem as m, TimeField as n };
636
+ export { Autocomplete as A, Button as B, Checkbox as C, MultiSelect as M, NumberField as N, RadioCardGroup as R, Select as S, TextArea as T, CheckboxGroup as a, ColorField as b, type MultiSelectOption as c, RadioGroup as d, Switch as e, TextField as f, type TimeFieldProps as g, type ButtonProps as h, type ColorFieldProps as i, type MultiSelectMatcher as j, type MultiSelectProps as k, type MultiSelectSelectionEntry as l, Radio as m, RadioCard as n, type RadioCardGroupProps as o, type RadioCardProps as p, type SelectItem as q, TimeField as r, defaultMultiSelectMatcher as s, filterMultiSelectOptions as t, multiSelectSearchKeys as u, multiSelectSelectionEntries as v, shouldOfferLiteralOption as w };
@@ -205,6 +205,93 @@ interface ColorFieldProps extends Omit<TextFieldProps$1, "isRequired" | "size" |
205
205
  */
206
206
  declare function ColorField({ label, description, errorMessage, size, tooltip, isRequired, transparent, className, validationResult, value: controlledValue, defaultValue, onChange, placeholder, showColorSwatch, reserveErrorSpace, ...props }: ColorFieldProps): react_jsx_runtime.JSX.Element;
207
207
 
208
+ interface MultiSelectOption {
209
+ value: string;
210
+ label: string;
211
+ /** Display-only decoration. Never contributes to the search key. */
212
+ count?: number;
213
+ disabled?: boolean;
214
+ group?: string;
215
+ }
216
+ type MultiSelectMatcher = (text: string, query: string) => boolean;
217
+ declare const defaultMultiSelectMatcher: MultiSelectMatcher;
218
+ /**
219
+ * The only strings an option is searchable by. Presentational decoration —
220
+ * `count`, badges, anything a renderer composes — is deliberately excluded:
221
+ * making facet-count digits searchable turned a query for `5` into a match on
222
+ * a substation labelled `28 (15656)`.
223
+ */
224
+ declare function multiSelectSearchKeys(option: MultiSelectOption): string[];
225
+ declare function filterMultiSelectOptions<T extends MultiSelectOption>(options: readonly T[], query: string, matcher?: MultiSelectMatcher): T[];
226
+ /**
227
+ * Whether the typed string should be offered as a selectable literal.
228
+ *
229
+ * The trigger is "the query is not already an identity in play" — not "nothing
230
+ * in the list matched". A match-count trigger is defeatable by any incidental
231
+ * substring hit, which is how single-digit values became unreachable in the
232
+ * control this component replaces.
233
+ */
234
+ declare function shouldOfferLiteralOption(args: {
235
+ query: string;
236
+ options: readonly MultiSelectOption[];
237
+ selected: readonly string[];
238
+ }): boolean;
239
+ interface MultiSelectSelectionEntry {
240
+ value: string;
241
+ label: string;
242
+ count?: number;
243
+ /** True when the value is not present in the current `options` set. */
244
+ isUnknown: boolean;
245
+ }
246
+ /**
247
+ * Selections in insertion order, hydrating labels from `options` where possible.
248
+ * Values with no matching option still produce an entry so URL-hydrated state is
249
+ * never silently dropped.
250
+ */
251
+ declare function multiSelectSelectionEntries(selected: readonly string[], options: readonly MultiSelectOption[]): MultiSelectSelectionEntry[];
252
+
253
+ interface MultiSelectProps {
254
+ options: readonly MultiSelectOption[];
255
+ /** Controlled selection. Order is insertion order. */
256
+ value?: readonly string[];
257
+ /** Uncontrolled initial selection. */
258
+ defaultValue?: readonly string[];
259
+ onChange: (next: string[]) => void;
260
+ label: string;
261
+ placeholder?: string;
262
+ size?: Size;
263
+ loading?: boolean;
264
+ disabled?: boolean;
265
+ maxSelected?: number;
266
+ /** Offer the typed string as a selectable value. Off by default. */
267
+ allowLiteral?: boolean;
268
+ /** Server-side search. Debouncing is the caller's job. */
269
+ onSearchChange?: (query: string) => void;
270
+ /** `options` is a clipped set rather than the whole domain. */
271
+ truncated?: boolean;
272
+ /** Size of the whole domain. Rendered with `truncated` as "showing N of M". */
273
+ totalCount?: number;
274
+ emptyMessage?: string;
275
+ showSelectAll?: boolean;
276
+ description?: string;
277
+ errorMessage?: string;
278
+ isRequired?: boolean;
279
+ /** Fires when the search input loses focus. Form adapters use this to mark the field touched. */
280
+ onBlur?: (event: React__default.FocusEvent<HTMLInputElement>) => void;
281
+ /** Ref to the search input, so callers (and `setFocus`) can focus the control. */
282
+ inputRef?: React__default.Ref<HTMLInputElement>;
283
+ className?: string;
284
+ id?: string;
285
+ }
286
+ /**
287
+ * MultiSelect
288
+ *
289
+ * A combobox whose popup is a multi-select listbox (W3C ARIA APG): a search
290
+ * input narrows a checkbox list, and current selections live in their own
291
+ * pinned region above it.
292
+ */
293
+ declare function MultiSelect({ options, value, defaultValue, onChange, label, placeholder, size, loading, disabled, maxSelected, allowLiteral, onSearchChange, truncated, totalCount, emptyMessage, showSelectAll, description, errorMessage, isRequired, onBlur, inputRef: forwardedInputRef, className, id, }: MultiSelectProps): react_jsx_runtime.JSX.Element;
294
+
208
295
  /**
209
296
  * NumberField
210
297
  *
@@ -546,4 +633,4 @@ interface TimeFieldProps extends Omit<TimeFieldProps$1<TimeValue>, "isRequired"
546
633
  */
547
634
  declare function TimeField({ label, description, errorMessage, size, tooltip, isRequired, isDisabled, isInvalid, reserveErrorSpace, validationResult, className, descriptionPlacement, ...props }: TimeFieldProps): react_jsx_runtime.JSX.Element;
548
635
 
549
- export { Autocomplete as A, Button as B, Checkbox as C, NumberField as N, RadioCardGroup as R, Select as S, TextArea as T, CheckboxGroup as a, ColorField as b, RadioGroup as c, Switch as d, TextField as e, type TimeFieldProps as f, type ButtonProps as g, type ColorFieldProps as h, Radio as i, RadioCard as j, type RadioCardGroupProps as k, type RadioCardProps as l, type SelectItem as m, TimeField as n };
636
+ export { Autocomplete as A, Button as B, Checkbox as C, MultiSelect as M, NumberField as N, RadioCardGroup as R, Select as S, TextArea as T, CheckboxGroup as a, ColorField as b, type MultiSelectOption as c, RadioGroup as d, Switch as e, TextField as f, type TimeFieldProps as g, type ButtonProps as h, type ColorFieldProps as i, type MultiSelectMatcher as j, type MultiSelectProps as k, type MultiSelectSelectionEntry as l, Radio as m, RadioCard as n, type RadioCardGroupProps as o, type RadioCardProps as p, type SelectItem as q, TimeField as r, defaultMultiSelectMatcher as s, filterMultiSelectOptions as t, multiSelectSearchKeys as u, multiSelectSelectionEntries as v, shouldOfferLiteralOption as w };