@fusion.dev/helix-headless 0.12.3 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/types/vue.d.ts CHANGED
@@ -40,6 +40,7 @@ import type {
40
40
  HelixHeadlessDrilldown,
41
41
  HelixHeadlessEmpty,
42
42
  HelixHeadlessFileInput,
43
+ HelixHeadlessFilterInput,
43
44
  HelixHeadlessFormatDate,
44
45
  HelixHeadlessHeatmap,
45
46
  HelixHeadlessIconButton,
@@ -2951,6 +2952,91 @@ export type HelixHeadlessFileInputVueEvents = {
2951
2952
  "helix-before-change": HelixHeadlessFileInputHelixBeforeChangeElementEvent;
2952
2953
  };
2953
2954
 
2955
+ /** `HelixHeadlessFilterInput` component event */
2956
+ export type HelixHeadlessFilterInputElementEvent<E = Event> = TypedEvent<
2957
+ HelixHeadlessFilterInput,
2958
+ E
2959
+ >;
2960
+ /** `helix-before-change` event type */
2961
+ export type HelixHeadlessFilterInputHelixBeforeChangeElementEvent =
2962
+ HelixHeadlessFilterInputElementEvent<HelixBeforeChangeEvent>;
2963
+
2964
+ export type HelixHeadlessFilterInputVueProps = {
2965
+ /** Whether the field offers a button that empties it.
2966
+
2967
+ The text only. The tokens are the consumer's markup and this element is not
2968
+ entitled to take them out of the document, which is the same reason
2969
+ `hideOverflow` marks the ones over the cap `hidden` rather than removing
2970
+ them. */
2971
+ clearable?: (HelixHeadlessFilterInput["clearable"]) | undefined;
2972
+ /** What the clear button is called, since an icon has no name of its own. */
2973
+ "clear-label"?: (HelixHeadlessFilterInput["clearLabel"]) | undefined;
2974
+ /** What the clear button is called, since an icon has no name of its own. */
2975
+ clearLabel?: (HelixHeadlessFilterInput["clearLabel"]) | undefined;
2976
+ /** Shown while the field is empty.
2977
+
2978
+ Not a label: it goes when typing starts. */
2979
+ placeholder?: (HelixHeadlessFilterInput["placeholder"]) | undefined;
2980
+ /** How many tokens to show before the rest become a count. */
2981
+ "max-tags"?: (HelixHeadlessFilterInput["maxTags"]) | undefined;
2982
+ /** How many tokens to show before the rest become a count. */
2983
+ maxTags?: (HelixHeadlessFilterInput["maxTags"]) | undefined;
2984
+ /** The value the markup declared, which is where a reset returns to. */
2985
+ "default-value"?: (HelixHeadlessFilterInput["defaultValue"]) | undefined;
2986
+ /** The value the markup declared, which is where a reset returns to. */
2987
+ defaultValue?: (HelixHeadlessFilterInput["defaultValue"]) | undefined;
2988
+ /** What the control holds now, and what its form submits.
2989
+
2990
+ One property, not two, so `input.value` answers the question anyone
2991
+ asking it meant. Writing always applies; `<helix-input value="x">` is the
2992
+ same statement in markup, and `default-value` is how markup seeds a value
2993
+ a reset should return to. */
2994
+ value?: (HelixHeadlessFilterInput["value"]) | undefined;
2995
+ /** What is wrong, in the reader's words rather than the browser's. */
2996
+ feedback?: (HelixHeadlessFilterInput["feedback"]) | undefined;
2997
+ /** Help under the control, shown while there is nothing wrong. */
2998
+ hint?: (HelixHeadlessFilterInput["hint"]) | undefined;
2999
+ /** The accessible name, and the fallback for the `label` slot. */
3000
+ label?: (HelixHeadlessFilterInput["label"]) | undefined;
3001
+ /** Whether the form refuses to submit without it. */
3002
+ required?: (HelixHeadlessFilterInput["required"]) | undefined;
3003
+ /** Whether the control is non-interactive.
3004
+
3005
+ Reflected, because the styled tier selects on it, and mirrored to
3006
+ `aria-disabled` rather than removing the element from the accessibility
3007
+ tree, so a screen reader can still announce that the control exists.
3008
+
3009
+ The mirror itself is in `willUpdate` below, here rather than in each
3010
+ control, because here is where `disabled` is. */
3011
+ disabled?: (HelixHeadlessFilterInput["disabled"]) | undefined;
3012
+ /** Name submitted with the form.
3013
+
3014
+ **Reflected, and it is the exception to "reflect only what CSS selects
3015
+ on".** The platform builds a form's entry list from the `name` *content
3016
+ attribute*, not from the property, so a control named through the property
3017
+ submitted under no name at all and was silently dropped. Measured: two
3018
+ inputs in one form, one named by attribute and one by property, and the
3019
+ form carried a single entry.
3020
+
3021
+ Safe for a React consumer, which is what the rule is protecting: React
3022
+ renders a custom element's props as attributes on the server, so the name
3023
+ is already in the markup being hydrated and reflecting it writes what is
3024
+ there. It is only a change to the markup when a consumer assigns it
3025
+ imperatively later, and nothing is hydrating by then.
3026
+
3027
+ Here rather than on each control. */
3028
+ name?: (HelixHeadlessFilterInput["name"]) | undefined;
3029
+ };
3030
+
3031
+ export type HelixHeadlessFilterInputVueEvents = {
3032
+ /** Relayed from the input once the reader has finished. */
3033
+ change: HelixHeadlessFilterInputElementEvent;
3034
+ /** Fired as the text changes, and cancelable. */
3035
+ "helix-before-change": HelixHeadlessFilterInputHelixBeforeChangeElementEvent;
3036
+ /** Announced once the text has moved. */
3037
+ input: HelixHeadlessFilterInputElementEvent;
3038
+ };
3039
+
2954
3040
  export type HelixHeadlessFormatDateVueProps = {
2955
3041
  /** The timestamp, as anything `Date` parses.
2956
3042
 
@@ -8222,6 +8308,12 @@ export interface WcToolkitVueGlobalComponents {
8222
8308
  HelixHeadlessFileInputVueProps,
8223
8309
  HelixHeadlessFileInputVueEvents
8224
8310
  >;
8311
+ /** **The tokens are the consumer's own elements, slotted.** What a filter narrows by belongs to the consumer's model rather than to this element: a facet with a prefix, a saved query, a range. So they are slotted rather than rendered from a list of strings, and removing one is a request this element makes rather than a change it applies. Combobox is the other way round, and that is the difference between the two: its tokens are a view of a selection it owns, drawn from options it was handed. **'value' is the text being typed, not the tokens**, which is what makes this a field a consumer can listen to. Every keystroke announces 'input' with the text on the element, so a table narrows as the reader types. The tokens need no reporting back, being markup the consumer already holds. Backspace on an empty field asks the last token to go, through the same 'helix-dismiss' its own remove control fires, so a consumer who handled the pointer has already handled the keyboard. */
8312
+ "helix-headless-filter-input": DefineCustomElement<
8313
+ HelixHeadlessFilterInput,
8314
+ HelixHeadlessFilterInputVueProps,
8315
+ HelixHeadlessFilterInputVueEvents
8316
+ >;
8225
8317
  /** A date in a page is almost never wanted as an ISO string, and formatting one in the consumer's own code means every consumer ships a copy of the same 'Intl' call and a different set of options. This is that call, as an element, so a date is written where it is shown. **'elapsed' is the mode a feed wants, and it stops being relative on purpose.** "42m", "3h", "1d" is what a row of activity reads as, and past a week the compact form is a lie: 'Intl.NumberFormat' narrow renders both 'minute' and 'month' as 'm' in en-US, so "3m" is three minutes at the top of a feed and three months further down it. Past six days this shows a date, which is shorter to read and impossible to misread. 'elapsedTime' in 'helix/core' carries the measurement. **The reading refreshes itself, from one timer the page shares.** A relative timestamp is correct for as long as its unit lasts and wrong afterwards, and a page left open is exactly where that shows. Each element asks to be woken when its own reading expires rather than polling, and an element showing a date asks for nothing at all: fifty rows and fifty intervals is fifty wakeups a second where one will do, and a feed of last month's notifications should cost nothing to leave open. **'<time datetime>' whatever the text says**, so a screen reader, a copy and paste, and anything parsing the page all get the real instant rather than "yesterday". */
8226
8318
  "helix-headless-format-date": DefineCustomElement<
8227
8319
  HelixHeadlessFormatDate,