@sinequa/galactik 2.1.0 → 2.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sinequa/galactik",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -2264,6 +2264,8 @@ declare function injectPopover(options: {
2264
2264
  config: Signal<PopoverConfig>;
2265
2265
  lockPosition: Signal<boolean>;
2266
2266
  matchTriggerWidth: Signal<boolean>;
2267
+ /** Hides the popover (without closing it) while its trigger is scrolled out of sight. Optional, default `false`. */
2268
+ hideWhenTriggerHidden?: Signal<boolean>;
2267
2269
  }): {
2268
2270
  width: import("@angular/core").WritableSignal<number | undefined>;
2269
2271
  state: import("@angular/core").WritableSignal<"open" | "closed">;
@@ -2314,6 +2316,14 @@ export declare class PopoverDirective {
2314
2316
  * popover element itself instead.
2315
2317
  */
2316
2318
  matchTriggerWidth: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
2319
+ /**
2320
+ * When true, the popover is hidden (`visibility: hidden`, still open) while its trigger is scrolled
2321
+ * out of sight — out of the list or container it sits in — and reappears with it. Without it, a
2322
+ * popover in the top layer, which no ancestor clips, keeps floating over nothing.
2323
+ *
2324
+ * @default false
2325
+ */
2326
+ hideWhenTriggerHidden: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
2317
2327
  readonly elementRef: ElementRef<HTMLElement>;
2318
2328
  private readonly _isDropdown;
2319
2329
  private readonly _config;
@@ -2355,6 +2365,11 @@ export declare class PopoverDirective {
2355
2365
  "required": false;
2356
2366
  "isSignal": true;
2357
2367
  };
2368
+ "hideWhenTriggerHidden": {
2369
+ "alias": "hideWhenTriggerHidden";
2370
+ "required": false;
2371
+ "isSignal": true;
2372
+ };
2358
2373
  }, {}, never, never, true, never>;
2359
2374
  }
2360
2375
  /** What {@link injectFloatingPanel} needs to know about a panel and the element it hangs from. */
@@ -2393,6 +2408,17 @@ interface FloatingPanelOptions {
2393
2408
  * colours the arrow's visible sides.
2394
2409
  */
2395
2410
  arrow?: () => HTMLElement | null | undefined;
2411
+ /**
2412
+ * Name of a CSS custom property (`"--floating-max-h"`) that receives the height left on the side the panel ended up on
2413
+ * (after `flip`), in pixels, for the panel's own CSS (`max-h-[min(24rem,var(--floating-max-h))]`). Without it, a panel taller
2414
+ * than the room it has runs off the viewport.
2415
+ */
2416
+ maxHeightVariable?: string;
2417
+ /**
2418
+ * Hides the panel (`visibility: hidden`) while the anchor is out of sight — scrolled out of the list it sits in — so that a
2419
+ * panel in the top layer, which no ancestor clips any more, does not float over nothing. A signal read is fine.
2420
+ */
2421
+ hideWhenAnchorHidden?: boolean | (() => boolean);
2396
2422
  /** Runs after each position update, with the anchor and the panel (a submenu that mirrors the anchor's width in a signal…). */
2397
2423
  afterPosition?: (anchor: HTMLElement, panel: HTMLElement) => void;
2398
2424
  }
@@ -4663,6 +4689,11 @@ export declare class RowFeedComponent<T> extends RowListBase<T> {
4663
4689
  };
4664
4690
  }, {}, never, never, true, never>;
4665
4691
  }
4692
+ /**
4693
+ * On/off toggle. The projected content is its visible label: it renders to the right of the switch, inside
4694
+ * the switch's own `<label>`, so it names the switch and a click on it toggles the switch (RGAA 11.1 / 11.4).
4695
+ * Same contract as `Checkbox`.
4696
+ */
4666
4697
  export declare class SwitchComponent {
4667
4698
  readonly checked: import("@angular/core").ModelSignal<boolean>;
4668
4699
  readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
@@ -4671,15 +4702,16 @@ export declare class SwitchComponent {
4671
4702
  /**
4672
4703
  * Accessible name of the inner `<input>`, for a switch whose label is not projected.
4673
4704
  *
4674
- * A switch has no content, so without a name it is unlabelled (RGAA 11.1). Aliased on the
4705
+ * A switch with no projected content has no name, so it is unlabelled (RGAA 11.1). Aliased on the
4675
4706
  * attribute, as `Checkbox.ariaLabel` is, and applied to the `<input>`: the host is in
4676
4707
  * `display: contents` and carries no role, so a name on it would be read by nobody.
4677
4708
  */
4678
4709
  readonly ariaLabel: import("@angular/core").InputSignal<string | undefined>;
4679
4710
  /**
4680
4711
  * Id of the element that names the inner `<input>`, for a switch labelled by visible text elsewhere
4681
- * in the template. Wrapping the switch in a `<label>` is not an option: it already renders its own
4682
- * (nested labels are invalid, RGAA 8.2). Takes precedence over `aria-label`.
4712
+ * in the template (a label that must not toggle the switch, e.g. the header of an expandable card).
4713
+ * To label the switch with text that toggles it, project that text instead: it renders to the right of
4714
+ * the switch, inside the switch's own `<label>`. Takes precedence over `aria-label` and over the projected text.
4683
4715
  */
4684
4716
  readonly ariaLabelledby: import("@angular/core").InputSignal<string | undefined>;
4685
4717
  /**
@@ -4691,6 +4723,13 @@ export declare class SwitchComponent {
4691
4723
  * Le clic traverse vers le parent, et `:checked` continue de piloter le rendu.
4692
4724
  */
4693
4725
  readonly presentational: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
4726
+ /**
4727
+ * Drops the 44×44 touch target: the hitbox shrinks to the track (24 px in `small`, 18 px in `xsmall`).
4728
+ *
4729
+ * For a switch whose parent already is the touch target (a menu or list row, a toolbar). Implied by
4730
+ * `presentational`. Below the 24 px WCAG 2.5.8 minimum in `xsmall`/`xs`, so do not use it on a standalone switch.
4731
+ */
4732
+ readonly compact: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
4694
4733
  /**
4695
4734
  * Index de tabulation de l'`<input>`, pour un hôte qui possède l'ordre de tabulation.
4696
4735
  *
@@ -4741,6 +4780,11 @@ export declare class SwitchComponent {
4741
4780
  "required": false;
4742
4781
  "isSignal": true;
4743
4782
  };
4783
+ "compact": {
4784
+ "alias": "compact";
4785
+ "required": false;
4786
+ "isSignal": true;
4787
+ };
4744
4788
  "tabIndex": {
4745
4789
  "alias": "tabIndex";
4746
4790
  "required": false;
@@ -4748,9 +4792,11 @@ export declare class SwitchComponent {
4748
4792
  };
4749
4793
  }, {
4750
4794
  "checked": "checkedChange";
4751
- }, never, never, true, never>;
4795
+ }, never, ["*"], true, never>;
4752
4796
  }
4753
4797
  declare const SWITCH_INPUT_CLASS = "switch-input";
4798
+ declare const SWITCH_HITBOX_CLASS = "switch-hitbox";
4799
+ declare const SWITCH_LABEL_CLASS = "switch-label";
4754
4800
  declare const SWITCH_TRACK_CLASS = "switch-track";
4755
4801
  declare const SWITCH_THUMB_CLASS = "switch-thumb";
4756
4802
  declare const SWITCH_THUMB_ICON_CLASS = "switch-thumb-icon";
@@ -5887,25 +5933,14 @@ export declare const textareaWrapVariants: (props?: ({
5887
5933
  filled?: boolean | null | undefined;
5888
5934
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
5889
5935
  type TextareaWrapVariants = VariantProps<typeof textareaWrapVariants>;
5890
- export declare class SearchInputComponent implements FormValueControl<string> {
5936
+ /**
5937
+ * What the plain field and the one with suggestions share: every input, the value, the sizes and the clear button.
5938
+ * Not a component of its own: `SearchInputComponent` and `SearchInputSuggestionsComponent` differ only by the
5939
+ * `ngCombobox` on the inner `<input>`.
5940
+ */
5941
+ declare abstract class SearchInputBase implements FormValueControl<string> {
5891
5942
  cn: import("cn").CnFunction;
5892
5943
  searchInput: import("@angular/core").Signal<ElementRef<any>>;
5893
- /**
5894
- * The `ngCombobox` directive instance applied to the inner input element.
5895
- *
5896
- * @remarks
5897
- * Use this reference to attach a suggestions popup from the consumer side:
5898
- *
5899
- * ```html
5900
- * <SearchInput #si [(value)]="query" />
5901
- * <ng-template ngComboboxPopup [combobox]="si.combobox()">
5902
- * <ul ngComboboxWidget ngListbox #lb="ngListbox" [activeDescendant]="lb.activeDescendant()">
5903
- * <li ngOption [value]="suggestion">…</li>
5904
- * </ul>
5905
- * </ng-template>
5906
- * ```
5907
- */
5908
- combobox: import("@angular/core").Signal<Combobox>;
5909
5944
  /**
5910
5945
  * The search text, kept in sync with the inner input element.
5911
5946
  *
@@ -5957,10 +5992,9 @@ export declare class SearchInputComponent implements FormValueControl<string> {
5957
5992
  iconClass: import("@angular/core").Signal<"" | "size-3">;
5958
5993
  /** Leading magnifier: focus-rotation animation + size-aware sizing. */
5959
5994
  searchIconClass: import("@angular/core").Signal<string>;
5960
- constructor();
5961
5995
  clearSearch(e: Event): void;
5962
- static ɵfac: i0.ɵɵFactoryDeclaration<SearchInputComponent, never>;
5963
- static ɵcmp: i0.ɵɵComponentDeclaration<SearchInputComponent, "SearchInput, search-input, searchinput", never, {
5996
+ static ɵfac: i0.ɵɵFactoryDeclaration<SearchInputBase, never>;
5997
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SearchInputBase, never, never, {
5964
5998
  "value": {
5965
5999
  "alias": "value";
5966
6000
  "required": false;
@@ -6008,7 +6042,41 @@ export declare class SearchInputComponent implements FormValueControl<string> {
6008
6042
  };
6009
6043
  }, {
6010
6044
  "value": "valueChange";
6011
- }, never, ["*"], true, never>;
6045
+ }, never, never, true, never>;
6046
+ }
6047
+ /**
6048
+ * A search field: a native `<input type="search">`, with no combobox semantics.
6049
+ *
6050
+ * For a field that shows suggestions, write `<SearchInput suggestions>` and import
6051
+ * `SearchInputSuggestionsComponent` instead: that one is a real ARIA combobox.
6052
+ */
6053
+ export declare class SearchInputComponent extends SearchInputBase {
6054
+ static ɵfac: i0.ɵɵFactoryDeclaration<SearchInputComponent, never>;
6055
+ static ɵcmp: i0.ɵɵComponentDeclaration<SearchInputComponent, "SearchInput:not([suggestions]), search-input:not([suggestions]), searchinput:not([suggestions])", never, {}, {}, never, ["*"], true, never>;
6056
+ }
6057
+ /**
6058
+ * A search field with a suggestions popup: its inner `<input>` carries `ngCombobox`, so it is announced as a combobox.
6059
+ * Selected by the `suggestions` attribute, which must be static (`<SearchInput suggestions>`).
6060
+ */
6061
+ export declare class SearchInputSuggestionsComponent extends SearchInputBase {
6062
+ /**
6063
+ * The `ngCombobox` directive instance applied to the inner input element.
6064
+ *
6065
+ * @remarks
6066
+ * Use this reference to attach a suggestions popup from the consumer side:
6067
+ *
6068
+ * ```html
6069
+ * <SearchInput suggestions #si [(value)]="query" />
6070
+ * <ng-template ngComboboxPopup [combobox]="si.combobox()">
6071
+ * <ul ngComboboxWidget ngListbox #lb="ngListbox" [activeDescendant]="lb.activeDescendant()">
6072
+ * <li ngOption [value]="suggestion">…</li>
6073
+ * </ul>
6074
+ * </ng-template>
6075
+ * ```
6076
+ */
6077
+ combobox: import("@angular/core").Signal<Combobox>;
6078
+ static ɵfac: i0.ɵɵFactoryDeclaration<SearchInputSuggestionsComponent, never>;
6079
+ static ɵcmp: i0.ɵɵComponentDeclaration<SearchInputSuggestionsComponent, "SearchInput[suggestions], search-input[suggestions], searchinput[suggestions]", never, {}, {}, never, ["*"], true, never>;
6012
6080
  }
6013
6081
  /**
6014
6082
  * Makes the active option of an `ngListbox` follow the mouse pointer.
@@ -6036,47 +6104,17 @@ export declare class ListboxActivateOnHover {
6036
6104
  static ɵdir: i0.ɵɵDirectiveDeclaration<ListboxActivateOnHover, "[ngListbox][activateOnHover]", never, {}, {}, never, never, true, never>;
6037
6105
  }
6038
6106
  /**
6039
- * Workaround for https://github.com/angular/components/issues/33361.
6040
- *
6041
- * `@angular/aria`'s `keyboardEventRelayEffect` reads `controlTarget()` outside of `untracked()`, so it re-runs when the
6042
- * popup widget registers again on a later expansion and re-dispatches the LAST relayed keyboard event onto the fresh
6043
- * listbox: reopening the popup with ArrowDown lands on the 2nd option instead of the 1st. Clearing the relayed event
6044
- * whenever the popup collapses prevents the replay.
6045
- *
6046
- * Call it from the constructor (an injection context) of every component that owns an `ngCombobox`. It is the one place
6047
- * to delete once the issue is fixed upstream.
6048
- *
6049
- * ```ts
6050
- * private readonly combobox = viewChild.required(Combobox);
6051
- * constructor() {
6052
- * fixStaleComboboxRelay(() => this.combobox());
6053
- * }
6054
- * ```
6107
+ * What the plain bar and the one with suggestions share: every input, the value, the sizes and the buttons.
6108
+ * Not a component of its own: `SearchBarComponent` and `SearchBarSuggestionsComponent` differ only by the
6109
+ * `ngCombobox` on the inner `<input>`.
6055
6110
  */
6056
- export declare function fixStaleComboboxRelay(combobox: () => Combobox): void;
6057
- export declare class SearchBarComponent implements FormValueControl<string> {
6111
+ declare abstract class SearchBarBase implements FormValueControl<string> {
6058
6112
  cn: import("cn").CnFunction;
6059
6113
  searchBarVariants: (props?: ({
6060
6114
  size?: "small" | "medium" | "large" | null | undefined;
6061
6115
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6062
6116
  protected readonly searchNativeReset: string;
6063
6117
  searchInput: import("@angular/core").Signal<ElementRef<any>>;
6064
- /**
6065
- * The `ngCombobox` directive instance applied to the inner input element.
6066
- *
6067
- * @remarks
6068
- * Use this reference to attach a suggestions popup from the consumer side:
6069
- *
6070
- * ```html
6071
- * <SearchBar #sb [(value)]="query" />
6072
- * <ng-template ngComboboxPopup [combobox]="sb.combobox()">
6073
- * <ul ngComboboxWidget ngListbox #lb="ngListbox" [activeDescendant]="lb.activeDescendant()">
6074
- * <li ngOption [value]="suggestion">…</li>
6075
- * </ul>
6076
- * </ng-template>
6077
- * ```
6078
- */
6079
- combobox: import("@angular/core").Signal<Combobox>;
6080
6118
  /**
6081
6119
  * The search text, kept in sync with the inner input element.
6082
6120
  *
@@ -6090,11 +6128,12 @@ export declare class SearchBarComponent implements FormValueControl<string> {
6090
6128
  search: import("@angular/core").OutputEmitterRef<string>;
6091
6129
  placeholder: import("@angular/core").InputSignal<string>;
6092
6130
  /**
6093
- * Nom accessible du champ, posé sur l'`<input>` interne.
6131
+ * Accessible name of the inner `<input>`.
6094
6132
  *
6095
- * À utiliser plutôt qu'un `aria-label` sur `<SearchBar>` : l'hôte est un élément personnalisé
6096
- * sans rôle, où ARIA interdit `aria-label` — l'attribut y est ignoré et le champ retombe sur son
6097
- * `placeholder` pour tout nom accessible.
6133
+ * A placeholder is not a label: it disappears on the first keystroke and screen readers are not
6134
+ * required to announce it (RGAA 11.1). Aliased on the attribute, as `SearchInput.ariaLabel` and
6135
+ * `Badge.ariaLabel` are, so a caller writes `aria-label="…"` on the element and the name lands where
6136
+ * it is read: the `<input>`, this host being an unknown element with no role of its own.
6098
6137
  */
6099
6138
  ariaLabel: import("@angular/core").InputSignal<string | undefined>;
6100
6139
  /** Accessible name of the clear button. Nothing in the library translates: pass it translated. */
@@ -6132,11 +6171,10 @@ export declare class SearchBarComponent implements FormValueControl<string> {
6132
6171
  iconClass: import("@angular/core").Signal<string>;
6133
6172
  /** Leading magnifier class: focus-rotation animation + size-aware sizing. */
6134
6173
  searchIconClass: import("@angular/core").Signal<string>;
6135
- constructor();
6136
6174
  clearSearch(e: Event): void;
6137
6175
  emitSearch(e: Event): void;
6138
- static ɵfac: i0.ɵɵFactoryDeclaration<SearchBarComponent, never>;
6139
- static ɵcmp: i0.ɵɵComponentDeclaration<SearchBarComponent, "SearchBar, search-bar, searchbar", never, {
6176
+ static ɵfac: i0.ɵɵFactoryDeclaration<SearchBarBase, never>;
6177
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SearchBarBase, never, never, {
6140
6178
  "value": {
6141
6179
  "alias": "value";
6142
6180
  "required": false;
@@ -6148,7 +6186,7 @@ export declare class SearchBarComponent implements FormValueControl<string> {
6148
6186
  "isSignal": true;
6149
6187
  };
6150
6188
  "ariaLabel": {
6151
- "alias": "ariaLabel";
6189
+ "alias": "aria-label";
6152
6190
  "required": false;
6153
6191
  "isSignal": true;
6154
6192
  };
@@ -6185,7 +6223,41 @@ export declare class SearchBarComponent implements FormValueControl<string> {
6185
6223
  }, {
6186
6224
  "value": "valueChange";
6187
6225
  "search": "search";
6188
- }, never, ["*", "[slot='trailing']"], true, never>;
6226
+ }, never, never, true, never>;
6227
+ }
6228
+ /**
6229
+ * A search bar: a native `<input type="search">`, with no combobox semantics.
6230
+ *
6231
+ * For a bar that shows suggestions, write `<SearchBar suggestions>` and import `SearchBarSuggestionsComponent`
6232
+ * instead: that one is a real ARIA combobox.
6233
+ */
6234
+ export declare class SearchBarComponent extends SearchBarBase {
6235
+ static ɵfac: i0.ɵɵFactoryDeclaration<SearchBarComponent, never>;
6236
+ static ɵcmp: i0.ɵɵComponentDeclaration<SearchBarComponent, "SearchBar:not([suggestions]), search-bar:not([suggestions]), searchbar:not([suggestions])", never, {}, {}, never, ["*", "[slot='trailing']"], true, never>;
6237
+ }
6238
+ /**
6239
+ * A search bar with a suggestions popup: its inner `<input>` carries `ngCombobox`, so it is announced as a combobox.
6240
+ * Selected by the `suggestions` attribute, which must be static (`<SearchBar suggestions>`).
6241
+ */
6242
+ export declare class SearchBarSuggestionsComponent extends SearchBarBase {
6243
+ /**
6244
+ * The `ngCombobox` directive instance applied to the inner input element.
6245
+ *
6246
+ * @remarks
6247
+ * Use this reference to attach a suggestions popup from the consumer side:
6248
+ *
6249
+ * ```html
6250
+ * <SearchBar suggestions #sb [(value)]="query" />
6251
+ * <ng-template ngComboboxPopup [combobox]="sb.combobox()">
6252
+ * <ul ngComboboxWidget ngListbox #lb="ngListbox" [activeDescendant]="lb.activeDescendant()">
6253
+ * <li ngOption [value]="suggestion">…</li>
6254
+ * </ul>
6255
+ * </ng-template>
6256
+ * ```
6257
+ */
6258
+ combobox: import("@angular/core").Signal<Combobox>;
6259
+ static ɵfac: i0.ɵɵFactoryDeclaration<SearchBarSuggestionsComponent, never>;
6260
+ static ɵcmp: i0.ɵɵComponentDeclaration<SearchBarSuggestionsComponent, "SearchBar[suggestions], search-bar[suggestions], searchbar[suggestions]", never, {}, {}, never, ["*", "[slot='trailing']"], true, never>;
6189
6261
  }
6190
6262
  export declare const SB_ICON_CLASS = "sb-icon";
6191
6263
  export declare const SB_INPUT_CLASS = "sb-input";
@@ -6239,6 +6311,11 @@ export declare class DialogComponent {
6239
6311
  */
6240
6312
  isPopover: import("@angular/core").WritableSignal<boolean>;
6241
6313
  isModal: import("@angular/core").WritableSignal<boolean>;
6314
+ private readonly injector;
6315
+ /** Element focused before the `[dialog]` path opened, given its focus back on close. */
6316
+ private opener;
6317
+ private releaseInert;
6318
+ constructor();
6242
6319
  /**
6243
6320
  * Opens the dialog by displaying the modal.
6244
6321
  *
@@ -6258,6 +6335,13 @@ export declare class DialogComponent {
6258
6335
  * This method assumes that `dialog` is a reference to a native dialog element and `isOpen` is a state management property.
6259
6336
  */
6260
6337
  showModal(): void;
6338
+ /**
6339
+ * `[dialog]` path only — a native `<dialog>` gets all of this from `showModal()`. Makes the page
6340
+ * behind inert (no Tab out of the modal, hidden from assistive technology), then moves the focus in.
6341
+ * Inert first: the opener loses the focus it held, so nothing is left focused behind the scrim.
6342
+ */
6343
+ private holdBackground;
6344
+ private releaseBackground;
6261
6345
  /**
6262
6346
  * Shows the dialog as a popover element.
6263
6347
  *