@4sh/ui-kit 0.6.1 → 0.8.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.
Files changed (154) hide show
  1. package/README.fr.md +47 -22
  2. package/README.md +46 -23
  3. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +1 -1
  4. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
  5. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +5 -3
  6. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
  7. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
  8. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +439 -0
  9. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -0
  10. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs.map +1 -1
  11. package/fesm2022/4sh-ui-kit-base-ui-image.mjs +111 -10
  12. package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
  13. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +14 -6
  14. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
  15. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
  16. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +655 -92
  17. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
  18. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +1107 -0
  19. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -0
  20. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +43 -3
  21. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
  22. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +5 -3
  23. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
  24. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
  25. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +8 -2
  26. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
  27. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +15 -2
  28. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
  29. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
  30. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +8 -4
  31. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
  32. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +40 -4
  33. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
  34. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs +282 -0
  35. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs.map +1 -0
  36. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs +2 -2
  37. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs.map +1 -1
  38. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +1 -1
  39. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
  40. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
  41. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
  42. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +6 -4
  43. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
  44. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +8 -3
  45. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
  46. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
  47. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +317 -0
  48. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -0
  49. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +8 -2
  50. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
  51. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +374 -0
  52. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -0
  53. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
  54. package/fesm2022/4sh-ui-kit-forms.mjs +49 -14
  55. package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
  56. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
  57. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
  58. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs.map +1 -1
  59. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs.map +1 -1
  60. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +2 -2
  61. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
  62. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +2 -2
  63. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
  64. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs.map +1 -1
  65. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs.map +1 -1
  66. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
  67. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs.map +1 -1
  68. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs.map +1 -1
  69. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs.map +1 -1
  70. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs.map +1 -1
  71. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs +2 -2
  72. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs.map +1 -1
  73. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
  74. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +2 -2
  75. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
  76. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs.map +1 -1
  77. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
  78. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +45 -4
  79. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
  80. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs.map +1 -1
  81. package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -1
  82. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs +370 -0
  83. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs.map +1 -0
  84. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +2 -2
  85. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
  86. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs +5 -3
  87. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs.map +1 -1
  88. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +5 -3
  89. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
  90. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +5 -3
  91. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
  92. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +22 -10
  93. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
  94. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +19 -4
  95. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
  96. package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -1
  97. package/fesm2022/4sh-ui-kit-ripple.mjs +298 -0
  98. package/fesm2022/4sh-ui-kit-ripple.mjs.map +1 -0
  99. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +5 -3
  100. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
  101. package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2 -2
  102. package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
  103. package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -1
  104. package/fesm2022/4sh-ui-kit.mjs.map +1 -1
  105. package/mcp/data/text-search-docs.json +1083 -83
  106. package/mcp/data/ui-config.json +5592 -2586
  107. package/mcp/index.js +682 -410
  108. package/mcp/package.json +1 -1
  109. package/package.json +29 -1
  110. package/schematics/index.cjs +1 -1
  111. package/styles/base/_ripple.scss +53 -0
  112. package/styles/component-vars.scss +177 -2
  113. package/styles/generated/_tokens-breakpoint.scss +1 -1
  114. package/styles/generated/_tokens-metrics.scss +1 -1
  115. package/styles/generated/_tokens-primitives.scss +1 -1
  116. package/styles/generated/_tokens-responsive.scss +17 -17
  117. package/styles/generated/_tokens-semantics.scss +15 -15
  118. package/styles/generated/_tokens-styles.scss +1 -1
  119. package/styles/generated/_tokens-transitions.scss +1 -1
  120. package/styles/generated/_tokens-typography.scss +1 -1
  121. package/styles/generated/_tokens.scss +1 -1
  122. package/styles/index.scss +1 -0
  123. package/styles/settings/_ui-config.scss +9 -0
  124. package/styles/utils/_helpers.scss +15 -0
  125. package/styles/utils/_mixins.scss +17 -1
  126. package/styles.css +1 -1
  127. package/types/4sh-ui-kit-actions-ui-button.d.ts +3 -1
  128. package/types/4sh-ui-kit-actions-ui-speed-dial.d.ts +234 -0
  129. package/types/4sh-ui-kit-base-ui-image.d.ts +16 -3
  130. package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +7 -2
  131. package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +242 -37
  132. package/types/4sh-ui-kit-forms-ui-editor.d.ts +481 -0
  133. package/types/4sh-ui-kit-forms-ui-field.d.ts +32 -2
  134. package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +3 -1
  135. package/types/4sh-ui-kit-forms-ui-input-mask.d.ts +4 -0
  136. package/types/4sh-ui-kit-forms-ui-input-number.d.ts +9 -0
  137. package/types/4sh-ui-kit-forms-ui-input-tags.d.ts +4 -1
  138. package/types/4sh-ui-kit-forms-ui-input.d.ts +28 -2
  139. package/types/4sh-ui-kit-forms-ui-knob.d.ts +93 -0
  140. package/types/4sh-ui-kit-forms-ui-segment-control.d.ts +3 -1
  141. package/types/4sh-ui-kit-forms-ui-select.d.ts +5 -1
  142. package/types/4sh-ui-kit-forms-ui-swatch-picker.d.ts +126 -0
  143. package/types/4sh-ui-kit-forms-ui-textarea.d.ts +4 -0
  144. package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +222 -0
  145. package/types/4sh-ui-kit-forms.d.ts +38 -7
  146. package/types/4sh-ui-kit-layout-ui-modal.d.ts +7 -0
  147. package/types/4sh-ui-kit-navigation-ui-bottom-tab-bar.d.ts +201 -0
  148. package/types/4sh-ui-kit-navigation-ui-context-menu.d.ts +3 -1
  149. package/types/4sh-ui-kit-navigation-ui-menu.d.ts +3 -1
  150. package/types/4sh-ui-kit-navigation-ui-sidebar.d.ts +3 -1
  151. package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +8 -3
  152. package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +16 -3
  153. package/types/4sh-ui-kit-ripple.d.ts +156 -0
  154. package/types/4sh-ui-kit-table-ui-paginator.d.ts +3 -1
@@ -41,12 +41,24 @@ declare class UiInput extends BaseFormField<string> {
41
41
  value: _angular_core.InputSignal<string | undefined>;
42
42
  /** `aria-haspopup` forwarded to the native input (popup trigger hosts). */
43
43
  ariaHasPopup: _angular_core.InputSignal<"menu" | "listbox" | "tree" | "grid" | "dialog" | undefined>;
44
- /** `aria-expanded` forwarded to the native input (popup trigger hosts). */
44
+ /**
45
+ * `aria-expanded` forwarded to the native input (popup trigger hosts).
46
+ * Setting it also promotes the input to `role="combobox"`: `aria-expanded`
47
+ * is not allowed on the implicit `textbox` role, so screen readers would
48
+ * silently drop the popup state without it.
49
+ */
45
50
  ariaExpanded: _angular_core.InputSignal<boolean | undefined>;
46
51
  /** `aria-controls` forwarded to the native input (popup trigger hosts). */
47
52
  ariaControls: _angular_core.InputSignal<string | undefined>;
48
53
  /** Native placeholder. */
49
54
  placeholder: _angular_core.InputSignal<string | undefined>;
55
+ /**
56
+ * id of an external element describing this control further (e.g. a composite host's own
57
+ * format hint), chained onto `aria-describedby` alongside the helper/error message rather than
58
+ * replacing it — a plain `[attr.aria-describedby]` override on the host would clobber whichever
59
+ * of the two lands last.
60
+ */
61
+ ariaDescribedBy: _angular_core.InputSignal<string | undefined>;
50
62
  /** Suffix unit (e.g. "%", "@domain"). Shown when provided. */
51
63
  unit: _angular_core.InputSignal<string | undefined>;
52
64
  /** Left FontAwesome icon name (decorative). */
@@ -82,6 +94,12 @@ declare class UiInput extends BaseFormField<string> {
82
94
  private readonly inputEl;
83
95
  /** @ignore Icon size aligned with the field size. */
84
96
  protected readonly iconSize: _angular_core.Signal<UiIconSize>;
97
+ /** @ignore Text rendered in the input: display-only `value` wins over the model. */
98
+ protected readonly renderedValue: _angular_core.Signal<string>;
99
+ /** @ignore Keeps a floating label raised once focus leaves. */
100
+ protected readonly isFilled: _angular_core.Signal<boolean>;
101
+ /** @ignore At rest the floating label already holds that spot. */
102
+ protected readonly effectivePlaceholder: _angular_core.Signal<string>;
85
103
  /** @ignore Input wins over the projected `#iconLeft` template. */
86
104
  protected readonly resolvedIconLeftTemplate: _angular_core.Signal<TemplateRef<UiInputIconContext> | undefined>;
87
105
  /** @ignore Input wins over the projected `#iconRight` template. */
@@ -92,6 +110,14 @@ declare class UiInput extends BaseFormField<string> {
92
110
  protected readonly rightIconContext: _angular_core.Signal<UiInputIconContext>;
93
111
  /** @ignore The right icon is an action zone (has an accessible name). */
94
112
  protected readonly hasRightAction: _angular_core.Signal<boolean>;
113
+ /** @ignore Full `aria-describedby`: the helper/error message id (only when a message is
114
+ * actually rendered) plus the externally supplied `ariaDescribedBy`, space-joined — `null`
115
+ * when neither applies (native attribute is then omitted, not left dangling). */
116
+ protected readonly resolvedAriaDescribedBy: _angular_core.Signal<string | null>;
117
+ /** @ignore ARIA 1.2: only `combobox` (not the implicit `textbox`) accepts
118
+ * `aria-expanded`. Stays null for plain text fields so their announcement
119
+ * ("edit text") is untouched. */
120
+ protected readonly nativeRole: _angular_core.Signal<"combobox" | null>;
95
121
  /** Focuses the input. */
96
122
  focus(options?: FocusOptions): void;
97
123
  /** Native `<input>` element — composite hosts that own `value` (e.g. `ui-datepicker`)
@@ -102,7 +128,7 @@ declare class UiInput extends BaseFormField<string> {
102
128
  /** @ignore */
103
129
  protected onBlur(event: FocusEvent): void;
104
130
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiInput, never>;
105
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiInput, "ui-input", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "ariaHasPopup": { "alias": "ariaHasPopup"; "required": false; "isSignal": true; }; "ariaExpanded": { "alias": "ariaExpanded"; "required": false; "isSignal": true; }; "ariaControls": { "alias": "ariaControls"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "unit": { "alias": "unit"; "required": false; "isSignal": true; }; "iconLeft": { "alias": "iconLeft"; "required": false; "isSignal": true; }; "iconRight": { "alias": "iconRight"; "required": false; "isSignal": true; }; "iconRightAriaLabel": { "alias": "iconRightAriaLabel"; "required": false; "isSignal": true; }; "autocomplete": { "alias": "autocomplete"; "required": false; "isSignal": true; }; "maxlength": { "alias": "maxlength"; "required": false; "isSignal": true; }; "iconLeftTemplate": { "alias": "iconLeftTemplate"; "required": false; "isSignal": true; }; "iconRightTemplate": { "alias": "iconRightTemplate"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "iconRightClick": "iconRightClick"; "inputFocus": "inputFocus"; "inputBlur": "inputBlur"; }, ["iconLeftTemplateContent", "iconRightTemplateContent"], never, true, never>;
131
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiInput, "ui-input", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "ariaHasPopup": { "alias": "ariaHasPopup"; "required": false; "isSignal": true; }; "ariaExpanded": { "alias": "ariaExpanded"; "required": false; "isSignal": true; }; "ariaControls": { "alias": "ariaControls"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; "isSignal": true; }; "unit": { "alias": "unit"; "required": false; "isSignal": true; }; "iconLeft": { "alias": "iconLeft"; "required": false; "isSignal": true; }; "iconRight": { "alias": "iconRight"; "required": false; "isSignal": true; }; "iconRightAriaLabel": { "alias": "iconRightAriaLabel"; "required": false; "isSignal": true; }; "autocomplete": { "alias": "autocomplete"; "required": false; "isSignal": true; }; "maxlength": { "alias": "maxlength"; "required": false; "isSignal": true; }; "iconLeftTemplate": { "alias": "iconLeftTemplate"; "required": false; "isSignal": true; }; "iconRightTemplate": { "alias": "iconRightTemplate"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "iconRightClick": "iconRightClick"; "inputFocus": "inputFocus"; "inputBlur": "inputBlur"; }, ["iconLeftTemplateContent", "iconRightTemplateContent"], never, true, never>;
106
132
  }
107
133
 
108
134
  export { UiInput };
@@ -0,0 +1,93 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { BaseFieldControl } from '@4sh/ui-kit/forms';
3
+
4
+ type UiKnobSize = 'small' | 'default' | 'large';
5
+ /**
6
+ * ui-knob — headless circular dial to pick a numeric value.
7
+ *
8
+ * Follows the WAI-ARIA slider pattern: the dial is a single `role="slider"`
9
+ * stop exposing `aria-valuemin/max/now`, driven at the keyboard (arrows,
10
+ * Page Up/Down, Home/End) and by pointer (mouse, touch, pen) through one code
11
+ * path. The drawing is an SVG arc in a 100×100 viewBox, so it scales with the
12
+ * rendered diameter; every colour comes from the design tokens and can be
13
+ * repainted per instance.
14
+ *
15
+ * Works standalone, with `[(ngModel)]`, Reactive Forms or Signal Forms
16
+ * (`[formField]`) — it is a `ControlValueAccessor`.
17
+ */
18
+ declare class UiKnob extends BaseFieldControl<number> {
19
+ /** Minimum boundary value. */
20
+ min: _angular_core.InputSignalWithTransform<number, unknown>;
21
+ /** Maximum boundary value. */
22
+ max: _angular_core.InputSignalWithTransform<number, unknown>;
23
+ /** Increment/decrement granularity (drag snapping + keyboard step). */
24
+ step: _angular_core.InputSignalWithTransform<number, unknown>;
25
+ /** Diameter preset (override any diameter with the `--ui-knob-size` hook). */
26
+ size: _angular_core.InputSignal<UiKnobSize>;
27
+ /** Arc thickness, in viewBox units (100 = the diameter), so it scales with the knob. */
28
+ strokeWidth: _angular_core.InputSignalWithTransform<number, unknown>;
29
+ /** Renders the value at the centre of the dial. */
30
+ showValue: _angular_core.InputSignalWithTransform<boolean, unknown>;
31
+ /** Template of the centre label, `{value}` being the placeholder. */
32
+ valueTemplate: _angular_core.InputSignal<string>;
33
+ /** Colour of the filled arc (any CSS colour). Sets `--ui-knob-value-color`. */
34
+ valueColor: _angular_core.InputSignal<string | undefined>;
35
+ /** Colour of the track behind it. Sets `--ui-knob-range-color`. */
36
+ rangeColor: _angular_core.InputSignal<string | undefined>;
37
+ /** Colour of the centre label. Sets `--ui-knob-text-color`. */
38
+ textColor: _angular_core.InputSignal<string | undefined>;
39
+ /** Emitted on every value change (drag, keyboard, click on the dial). */
40
+ knobChange: _angular_core.OutputEmitterRef<number>;
41
+ /** @ignore Pointer target, focus stop and % reference of the dial. */
42
+ private readonly root;
43
+ /** @ignore True while a drag is in progress. */
44
+ private dragging;
45
+ constructor();
46
+ /** @ignore Current value, clamped to the boundaries (falls back to `min`). */
47
+ protected readonly currentValue: _angular_core.Signal<number>;
48
+ /** @ignore Centre label, with `{value}` substituted. */
49
+ protected readonly displayValue: _angular_core.Signal<string>;
50
+ /** @ignore Announced only when the label differs from the raw value. */
51
+ protected readonly ariaValueText: _angular_core.Signal<string | null>;
52
+ /** @ignore Radius of the arc centreline, inset so the stroke fits the box. */
53
+ private readonly radius;
54
+ /** @ignore The full track. */
55
+ protected readonly rangePath: _angular_core.Signal<string>;
56
+ /** @ignore Arc drawn from the origin (0, or the nearest boundary) to the value. */
57
+ protected readonly valuePath: _angular_core.Signal<string>;
58
+ /** @ignore */
59
+ protected readonly classes: _angular_core.Signal<string>;
60
+ /** @ignore */
61
+ protected uidPrefix(): string;
62
+ /** Focus the dial programmatically. */
63
+ focus(options?: FocusOptions): void;
64
+ /** @ignore */
65
+ protected onPointerDown(event: PointerEvent): void;
66
+ /** @ignore */
67
+ protected onPointerMove(event: PointerEvent): void;
68
+ /** @ignore */
69
+ protected onPointerUp(event: PointerEvent): void;
70
+ /** @ignore */
71
+ protected onKeyDown(event: KeyboardEvent): void;
72
+ /** @ignore */
73
+ protected onBlur(): void;
74
+ /** @ignore Effective step (never 0). */
75
+ private stepSize;
76
+ /** @ignore Angle of the value on the dial. */
77
+ private valueRadians;
78
+ /** @ignore Angle the filled arc starts from: zero when it is inside the boundaries. */
79
+ private originRadians;
80
+ /** @ignore Pointer position → value, or `null` inside the bottom gap. */
81
+ private updateFromPointer;
82
+ /** @ignore Round to the step's decimal precision (avoids float drift). */
83
+ private round;
84
+ /** @ignore Clamp to [min, max]. */
85
+ private clamp;
86
+ /** @ignore Snap to the step grid, clamp, then propagate if it moved. */
87
+ private commit;
88
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiKnob, never>;
89
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiKnob, "ui-knob", never, { "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "strokeWidth": { "alias": "strokeWidth"; "required": false; "isSignal": true; }; "showValue": { "alias": "showValue"; "required": false; "isSignal": true; }; "valueTemplate": { "alias": "valueTemplate"; "required": false; "isSignal": true; }; "valueColor": { "alias": "valueColor"; "required": false; "isSignal": true; }; "rangeColor": { "alias": "rangeColor"; "required": false; "isSignal": true; }; "textColor": { "alias": "textColor"; "required": false; "isSignal": true; }; }, { "knobChange": "knobChange"; }, never, never, true, never>;
90
+ }
91
+
92
+ export { UiKnob };
93
+ export type { UiKnobSize };
@@ -100,6 +100,8 @@ declare class UiSegmentControl<T = unknown> extends BaseFieldControl<SegmentCont
100
100
  dataKey: _angular_core.InputSignal<string | undefined>;
101
101
  /** Allow selecting several values at once (the model becomes an array). */
102
102
  multiple: _angular_core.InputSignalWithTransform<boolean, unknown>;
103
+ /** Ripple Effect */
104
+ ripple: _angular_core.InputSignalWithTransform<boolean, unknown>;
103
105
  /** Whether the selection can be fully cleared (single) / emptied (multiple). */
104
106
  allowEmpty: _angular_core.InputSignalWithTransform<boolean, unknown>;
105
107
  /** Size. */
@@ -177,7 +179,7 @@ declare class UiSegmentControl<T = unknown> extends BaseFieldControl<SegmentCont
177
179
  /** @ignore Value equality — by `dataKey` for objects, strict otherwise. */
178
180
  private equals;
179
181
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiSegmentControl<any>, never>;
180
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiSegmentControl<any>, "ui-segment-control", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionDisabled": { "alias": "optionDisabled"; "required": false; "isSignal": true; }; "optionIcon": { "alias": "optionIcon"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "allowEmpty": { "alias": "allowEmpty"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "fluid": { "alias": "fluid"; "required": false; "isSignal": true; }; "motion": { "alias": "motion"; "required": false; "isSignal": true; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; "optionClick": "optionClick"; }, never, never, true, never>;
182
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiSegmentControl<any>, "ui-segment-control", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionDisabled": { "alias": "optionDisabled"; "required": false; "isSignal": true; }; "optionIcon": { "alias": "optionIcon"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "ripple": { "alias": "ripple"; "required": false; "isSignal": true; }; "allowEmpty": { "alias": "allowEmpty"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "fluid": { "alias": "fluid"; "required": false; "isSignal": true; }; "motion": { "alias": "motion"; "required": false; "isSignal": true; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; "optionClick": "optionClick"; }, never, never, true, never>;
181
183
  }
182
184
 
183
185
  export { UiSegmentControl };
@@ -139,6 +139,8 @@ declare class UiSelect<T = unknown> extends BaseFormField<SelectValue<T>> {
139
139
  autofocusFilter: _angular_core.InputSignalWithTransform<boolean, unknown>;
140
140
  /** Reset the filter text when the panel closes. */
141
141
  resetFilterOnHide: _angular_core.InputSignalWithTransform<boolean, unknown>;
142
+ /** Ripple Effect */
143
+ ripple: _angular_core.InputSignalWithTransform<boolean, unknown>;
142
144
  /** Message shown when there is no option. */
143
145
  emptyMessage: _angular_core.InputSignal<string>;
144
146
  /** Message shown when the filter matches nothing. */
@@ -277,6 +279,8 @@ declare class UiSelect<T = unknown> extends BaseFormField<SelectValue<T>> {
277
279
  protected readonly selectedItemContexts: _angular_core.Signal<SelectSelectedItemContext<T>[]>;
278
280
  /** @ignore Text rendered in the trigger (and in the editable input). */
279
281
  protected readonly selectedLabel: _angular_core.Signal<string>;
282
+ /** @ignore At rest the floating label already holds that spot. */
283
+ protected readonly effectivePlaceholder: _angular_core.Signal<string>;
280
284
  /** @ignore The clear action is shown. */
281
285
  protected readonly showClearButton: _angular_core.Signal<boolean>;
282
286
  /** @ignore id of the visually focused option (for aria-activedescendant). */
@@ -385,7 +389,7 @@ declare class UiSelect<T = unknown> extends BaseFormField<SelectValue<T>> {
385
389
  /** @ignore Value equality — by `dataKey` for objects, strict otherwise. */
386
390
  private equals;
387
391
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiSelect<any>, never>;
388
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiSelect<any>, "ui-select", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionDisabled": { "alias": "optionDisabled"; "required": false; "isSignal": true; }; "group": { "alias": "group"; "required": false; "isSignal": true; }; "optionGroupLabel": { "alias": "optionGroupLabel"; "required": false; "isSignal": true; }; "optionGroupChildren": { "alias": "optionGroupChildren"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "checkmark": { "alias": "checkmark"; "required": false; "isSignal": true; }; "checkbox": { "alias": "checkbox"; "required": false; "isSignal": true; }; "maxSelectedLabels": { "alias": "maxSelectedLabels"; "required": false; "isSignal": true; }; "overflowLabel": { "alias": "overflowLabel"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "showClear": { "alias": "showClear"; "required": false; "isSignal": true; }; "clearAriaLabel": { "alias": "clearAriaLabel"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "filterPlaceholder": { "alias": "filterPlaceholder"; "required": false; "isSignal": true; }; "filterAriaLabel": { "alias": "filterAriaLabel"; "required": false; "isSignal": true; }; "filterBy": { "alias": "filterBy"; "required": false; "isSignal": true; }; "autofocusFilter": { "alias": "autofocusFilter"; "required": false; "isSignal": true; }; "resetFilterOnHide": { "alias": "resetFilterOnHide"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "emptyFilterMessage": { "alias": "emptyFilterMessage"; "required": false; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "autoOptionFocus": { "alias": "autoOptionFocus"; "required": false; "isSignal": true; }; "selectOnFocus": { "alias": "selectOnFocus"; "required": false; "isSignal": true; }; "focusOnHover": { "alias": "focusOnHover"; "required": false; "isSignal": true; }; "virtualScroll": { "alias": "virtualScroll"; "required": false; "isSignal": true; }; "virtualScrollItemSize": { "alias": "virtualScrollItemSize"; "required": false; "isSignal": true; }; "lazy": { "alias": "lazy"; "required": false; "isSignal": true; }; "scrollHeight": { "alias": "scrollHeight"; "required": false; "isSignal": true; }; "autoFlip": { "alias": "autoFlip"; "required": false; "isSignal": true; }; "panelStyleClass": { "alias": "panelStyleClass"; "required": false; "isSignal": true; }; "panelWidth": { "alias": "panelWidth"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "opened": "opened"; "closed": "closed"; "cleared": "cleared"; "filterChange": "filterChange"; "lazyLoad": "lazyLoad"; "inputFocus": "inputFocus"; "inputBlur": "inputBlur"; }, ["itemTemplate", "selectedItemTemplate", "groupTemplate", "headerTemplate", "footerTemplate", "emptyTemplate"], never, true, never>;
392
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiSelect<any>, "ui-select", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionDisabled": { "alias": "optionDisabled"; "required": false; "isSignal": true; }; "group": { "alias": "group"; "required": false; "isSignal": true; }; "optionGroupLabel": { "alias": "optionGroupLabel"; "required": false; "isSignal": true; }; "optionGroupChildren": { "alias": "optionGroupChildren"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "checkmark": { "alias": "checkmark"; "required": false; "isSignal": true; }; "checkbox": { "alias": "checkbox"; "required": false; "isSignal": true; }; "maxSelectedLabels": { "alias": "maxSelectedLabels"; "required": false; "isSignal": true; }; "overflowLabel": { "alias": "overflowLabel"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "showClear": { "alias": "showClear"; "required": false; "isSignal": true; }; "clearAriaLabel": { "alias": "clearAriaLabel"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "filterPlaceholder": { "alias": "filterPlaceholder"; "required": false; "isSignal": true; }; "filterAriaLabel": { "alias": "filterAriaLabel"; "required": false; "isSignal": true; }; "filterBy": { "alias": "filterBy"; "required": false; "isSignal": true; }; "autofocusFilter": { "alias": "autofocusFilter"; "required": false; "isSignal": true; }; "resetFilterOnHide": { "alias": "resetFilterOnHide"; "required": false; "isSignal": true; }; "ripple": { "alias": "ripple"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "emptyFilterMessage": { "alias": "emptyFilterMessage"; "required": false; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "autoOptionFocus": { "alias": "autoOptionFocus"; "required": false; "isSignal": true; }; "selectOnFocus": { "alias": "selectOnFocus"; "required": false; "isSignal": true; }; "focusOnHover": { "alias": "focusOnHover"; "required": false; "isSignal": true; }; "virtualScroll": { "alias": "virtualScroll"; "required": false; "isSignal": true; }; "virtualScrollItemSize": { "alias": "virtualScrollItemSize"; "required": false; "isSignal": true; }; "lazy": { "alias": "lazy"; "required": false; "isSignal": true; }; "scrollHeight": { "alias": "scrollHeight"; "required": false; "isSignal": true; }; "autoFlip": { "alias": "autoFlip"; "required": false; "isSignal": true; }; "panelStyleClass": { "alias": "panelStyleClass"; "required": false; "isSignal": true; }; "panelWidth": { "alias": "panelWidth"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "opened": "opened"; "closed": "closed"; "cleared": "cleared"; "filterChange": "filterChange"; "lazyLoad": "lazyLoad"; "inputFocus": "inputFocus"; "inputBlur": "inputBlur"; }, ["itemTemplate", "selectedItemTemplate", "groupTemplate", "headerTemplate", "footerTemplate", "emptyTemplate"], never, true, never>;
389
393
  }
390
394
 
391
395
  export { UiSelect };
@@ -0,0 +1,126 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { ConnectedPosition } from '@angular/cdk/overlay';
3
+
4
+ /** Density: `default`, or `small` for compact toolbars/popups. */
5
+ type SwatchPickerSize = 'default' | 'small';
6
+ /** One selectable color entry. */
7
+ interface UiSwatch {
8
+ /** Stable identifier, also the value carried by `value`/`swatchSelect`. */
9
+ key: string;
10
+ /** CSS variable rendering the swatch (e.g. `--primitives-red-500`). */
11
+ cssVar: string;
12
+ /** Accessible name (never just the color: sighted/non-sighted parity). */
13
+ label: string;
14
+ }
15
+ /** A labeled section of the grid (rendered as consecutive cells, same columns). */
16
+ interface UiSwatchGroup {
17
+ /** Section label (rendered for screen readers via `aria-label` on the group). */
18
+ label: string;
19
+ /** Swatches of the section, in row-major (left-to-right, top-to-bottom) order. */
20
+ swatches: UiSwatch[];
21
+ }
22
+ /** @ignore Internal flat entry (real swatch, or the synthetic "no color" one). */
23
+ interface FlatSwatch {
24
+ key: string | null;
25
+ cssVar: string | null;
26
+ label: string;
27
+ }
28
+ /**
29
+ * Default palette: a 7×5 grid (7 hues × 5 shades, dark → light) derived from
30
+ * the `primitives.*` tokens, plus `black`/`white`. Never hardcode a hex here —
31
+ * every swatch is a semantic pointer to a `--primitives-*` CSS variable, so a
32
+ * brand rebind (Brand 2 / Brand 3) changes what the grid shows for free.
33
+ */
34
+ declare const DEFAULT_SWATCH_PALETTE: UiSwatchGroup[];
35
+ /**
36
+ * ui-swatch-picker — headless color grid, static or popup, for a single-value
37
+ * choice among a `UiSwatchGroup[]` palette (see {@link DEFAULT_SWATCH_PALETTE}).
38
+ *
39
+ * No trigger button of its own — same composition contract as {@link UiMenu}:
40
+ * a caller wires its own `ui-button` to `toggle(event)` / `show(event)` and
41
+ * reads the selection from `value` (two-way) or `swatchSelect`. Reuses
42
+ * `ui-menu`'s overlay mechanics (`CdkConnectedOverlay`, auto-flip, scroll
43
+ * re-position) and the shared `overlay-panel` shell.
44
+ *
45
+ * Every swatch is a real `<button>` (`role="option"`, `aria-selected`) inside
46
+ * a `role="listbox"`; 2D roving-tabindex keyboard navigation (arrows,
47
+ * Home/End) mirrors `ui-menu`'s roving focus, adapted to a grid.
48
+ */
49
+ declare class UiSwatchPicker {
50
+ /** Palette rendered as sections of swatches (see {@link UiSwatchGroup}). */
51
+ palette: _angular_core.InputSignal<UiSwatchGroup[]>;
52
+ /** Selected swatch `key` (two-way bindable), or `null` for "no color". */
53
+ value: _angular_core.ModelSignal<string | null>;
54
+ /** Popup mode: the panel opens in an overlay via `toggle(event)` / `show(event)`. */
55
+ popup: _angular_core.InputSignalWithTransform<boolean, unknown>;
56
+ /** Density: `default`, or `small` for compact toolbars/popups. */
57
+ size: _angular_core.InputSignal<SwatchPickerSize>;
58
+ /** Renders a "no color" swatch at the start of the grid, emitting `null`. */
59
+ allowClear: _angular_core.InputSignalWithTransform<boolean, unknown>;
60
+ /** Accessible name of the grid (`aria-label` on `role="listbox"`). */
61
+ ariaLabel: _angular_core.InputSignal<string | undefined>;
62
+ /** Emitted on user selection (`null` when the "no color" swatch is picked). */
63
+ swatchSelect: _angular_core.OutputEmitterRef<UiSwatch | null>;
64
+ /** Emitted when the popup opens. */
65
+ opened: _angular_core.OutputEmitterRef<void>;
66
+ /** Emitted when the popup closes. */
67
+ closed: _angular_core.OutputEmitterRef<void>;
68
+ /** @ignore Panel root (overlay or inline) — keyboard focus queries. */
69
+ private readonly panelEl;
70
+ /** @ignore The popup's overlay (repositioning on scroll). */
71
+ private readonly connectedOverlay;
72
+ /** @ignore */
73
+ private readonly doc;
74
+ /** Unique id of the panel (public: wire the trigger's `aria-controls` to it). */
75
+ readonly uid: string;
76
+ /** @ignore Popup open state. */
77
+ protected readonly popupOpen: _angular_core.WritableSignal<boolean>;
78
+ /** @ignore Element the overlay is anchored to (the `toggle(event)` trigger). */
79
+ protected readonly overlayOrigin: _angular_core.WritableSignal<Element | null>;
80
+ /** @ignore Key of the swatch owning the roving tabindex (`''` = the clear
81
+ * swatch, `undefined` = nothing focused yet). */
82
+ private readonly focusedKey;
83
+ constructor();
84
+ /** @ignore */
85
+ private overlayRef;
86
+ /** @ignore Below the trigger, flipping above when space is lacking. */
87
+ protected readonly overlayPositions: ConnectedPosition[];
88
+ /** @ignore Flat, render-ready swatch list (the synthetic "no color" one first). */
89
+ protected readonly flatSwatches: _angular_core.Signal<FlatSwatch[]>;
90
+ /** @ignore Keys of the focusable entries, in grid order (roving focus path). Uses `''` as the clear swatch's key (`null` is reserved for "nothing focused"). */
91
+ private readonly focusableKeys;
92
+ /** @ignore Key owning the tab stop: last focused, else the selected value, else first. */
93
+ protected readonly tabStopKey: _angular_core.Signal<string | null>;
94
+ /** @ignore */
95
+ protected readonly panelClasses: _angular_core.Signal<string>;
96
+ /** Toggles the popup relative to the event's `currentTarget`. */
97
+ toggle(event: Event): void;
98
+ /** Opens the popup anchored to the event's `currentTarget`. */
99
+ show(event: Event): void;
100
+ /** Closes the popup. */
101
+ hide(focusTrigger?: boolean): void;
102
+ /** @ignore Swatch key used as `data-key` / DOM id (empty string for "no color"). */
103
+ protected swatchKey(swatch: FlatSwatch): string;
104
+ /** @ignore Selection state of a swatch. */
105
+ protected isSelected(swatch: FlatSwatch): boolean;
106
+ /** @ignore Activation (click / Enter / Space): select, emit, popup auto-close. */
107
+ protected onSwatchClick(swatch: FlatSwatch): void;
108
+ /** @ignore */
109
+ protected onSwatchFocus(swatch: FlatSwatch): void;
110
+ /** @ignore 2D roving keyboard navigation (arrow grid, Home/End). */
111
+ protected onGridKeydown(event: KeyboardEvent): void;
112
+ /** @ignore Popup outside interaction. */
113
+ protected onPopupOutsideClick(): void;
114
+ /** @ignore Key of the entry currently holding DOM focus. */
115
+ private currentFocusKey;
116
+ /** @ignore Move DOM focus (and the tab stop) to the entry with the given key. */
117
+ private focusByKey;
118
+ /** @ignore Focus the roving tab stop once the panel is rendered
119
+ * (macrotask, not rAF: rAF never fires in throttled/background tabs). */
120
+ private queueFocusTabStop;
121
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiSwatchPicker, never>;
122
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiSwatchPicker, "ui-swatch-picker", never, { "palette": { "alias": "palette"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "popup": { "alias": "popup"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "allowClear": { "alias": "allowClear"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "swatchSelect": "swatchSelect"; "opened": "opened"; "closed": "closed"; }, never, never, true, never>;
123
+ }
124
+
125
+ export { DEFAULT_SWATCH_PALETTE, UiSwatchPicker };
126
+ export type { SwatchPickerSize, UiSwatch, UiSwatchGroup };
@@ -38,6 +38,10 @@ declare class UiTextarea extends BaseFormField<string> {
38
38
  protected readonly effectiveResize: _angular_core.Signal<TextareaResize>;
39
39
  /** @ignore Current character count. */
40
40
  protected readonly charCount: _angular_core.Signal<number>;
41
+ /** @ignore Keeps a floating label raised once focus leaves. */
42
+ protected readonly isFilled: _angular_core.Signal<boolean>;
43
+ /** @ignore At rest the floating label already holds that spot. */
44
+ protected readonly effectivePlaceholder: _angular_core.Signal<string>;
41
45
  /** @ignore Over the maxlength (only reachable programmatically). */
42
46
  protected readonly overLimit: _angular_core.Signal<boolean>;
43
47
  /** @ignore id of the character counter (for `aria-describedby`). */
@@ -0,0 +1,222 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { TemplateRef } from '@angular/core';
3
+ import { BaseFieldControl } from '@4sh/ui-kit/forms';
4
+ import { UiIconSize } from '@4sh/ui-kit/base/ui-icon';
5
+ import { UiLevel } from '@4sh/ui-kit/types';
6
+
7
+ type ToggleButtonSize = 'default' | 'small' | 'large';
8
+ /** Habillage de l'état **non** sélectionné (l'état sélectionné est toujours plein). */
9
+ type ToggleButtonVariant = 'outlined' | 'filled' | 'ghost';
10
+ type ToggleButtonIconPos = 'left' | 'right';
11
+ type ToggleButtonOrientation = 'horizontal' | 'vertical';
12
+ /** Model value: one of the `trueValue`/`falseValue` pair (single), or the array of pressed option values (group). */
13
+ type ToggleButtonValue<T> = T | T[] | null;
14
+ /**
15
+ * Rich option shape for the group mode. Options may also be primitives
16
+ * (`string`/`number`) or any object, in which case `optionLabel` /
17
+ * `optionValue` / `optionDisabled` / `optionIcon` tell the control how to read
18
+ * them.
19
+ */
20
+ interface ToggleButtonOption<T = unknown> {
21
+ /** Text shown inside the button. */
22
+ label?: string;
23
+ /** Value carried into the model when the button is pressed. */
24
+ value: T;
25
+ /** Icon name (design-system icon). */
26
+ icon?: string;
27
+ /** Icon substituted while the button is pressed. */
28
+ selectedIcon?: string;
29
+ /** Disables just this button. */
30
+ disabled?: boolean;
31
+ /** Accessible name (required for an icon-only button). */
32
+ ariaLabel?: string;
33
+ }
34
+ /** Context handed to the `icon` / `content` templates (single mode). */
35
+ interface ToggleButtonStateContext {
36
+ /** Whether the button is currently pressed (default `$implicit`). */
37
+ $implicit: boolean;
38
+ /** Same as `$implicit`, named for readability. */
39
+ checked: boolean;
40
+ }
41
+ /** Context handed to the `item` template (group mode). */
42
+ interface ToggleButtonItemContext<T = unknown> {
43
+ /** The original option (default `$implicit`). */
44
+ $implicit: T;
45
+ /** Same as `$implicit`, named for readability. */
46
+ option: T;
47
+ /** Whether this button is currently pressed. */
48
+ selected: boolean;
49
+ /** Index of the option in the list. */
50
+ index: number;
51
+ }
52
+ /** Payload emitted when a group button is clicked. */
53
+ interface ToggleButtonOptionClickEvent<T = unknown> {
54
+ /** The original option (as passed in `options`). */
55
+ option: T;
56
+ /** The resolved value of that option. */
57
+ value: T;
58
+ /** Index of the option in the list. */
59
+ index: number;
60
+ /** Pressed state after the click. */
61
+ selected: boolean;
62
+ /** Originating DOM event. */
63
+ originalEvent: Event;
64
+ }
65
+ /** @ignore Internal, normalized view of a group option. */
66
+ interface NormalizedToggle {
67
+ key: string;
68
+ index: number;
69
+ value: unknown;
70
+ label: string | null;
71
+ icon: string | null;
72
+ ariaLabel: string | null;
73
+ disabled: boolean;
74
+ selected: boolean;
75
+ iconOnly: boolean;
76
+ original: unknown;
77
+ }
78
+ /**
79
+ * ui-toggle-button — a button that holds a pressed state.
80
+ *
81
+ * Two modes, one component:
82
+ * - **single** (default): one native `<button aria-pressed>` backing a boolean
83
+ * (or the `trueValue`/`falseValue` pair). Labels and icons may differ per
84
+ * state (`onLabel`/`offLabel`, `onIcon`/`offIcon`).
85
+ * - **group** (`options` set): one button per option, `role="group"` on the
86
+ * host, model = the array of pressed values. Deliberately always
87
+ * multi-select: an exclusive choice is `ui-segment-control`'s job, which says
88
+ * it with `radiogroup` semantics instead of `aria-pressed`.
89
+ *
90
+ * `level` colours the pressed state, `variant` draws the released one, both
91
+ * from the `actions.*` token sets. Interactive states (hover/focus/pressed/
92
+ * disabled) are pure CSS.
93
+ *
94
+ * Works standalone, with `[(ngModel)]`, reactive forms, or signal forms
95
+ * (`[formField]`) — it is a `ControlValueAccessor`.
96
+ *
97
+ * @example
98
+ * ```html
99
+ * <ui-toggle-button [(ngModel)]="bold" label="Gras" icon="bold" />
100
+ * <ui-toggle-button [(ngModel)]="days" [options]="dayOptions" ariaLabel="Jours ouvrés" />
101
+ * ```
102
+ */
103
+ declare class UiToggleButton<T = boolean> extends BaseFieldControl<ToggleButtonValue<T>> {
104
+ /** Label shown in both states (fallback of `onLabel` / `offLabel`). */
105
+ label: _angular_core.InputSignal<string | undefined>;
106
+ /** Label shown while pressed. */
107
+ onLabel: _angular_core.InputSignal<string | undefined>;
108
+ /** Label shown while released. */
109
+ offLabel: _angular_core.InputSignal<string | undefined>;
110
+ /** Icon shown in both states (fallback of `onIcon` / `offIcon`). */
111
+ icon: _angular_core.InputSignal<string | undefined>;
112
+ /** Icon shown while pressed. */
113
+ onIcon: _angular_core.InputSignal<string | undefined>;
114
+ /** Icon shown while released. */
115
+ offIcon: _angular_core.InputSignal<string | undefined>;
116
+ /** Side of the label the icon sits on. */
117
+ iconPos: _angular_core.InputSignal<ToggleButtonIconPos>;
118
+ /** Model value emitted when pressed. */
119
+ trueValue: _angular_core.InputSignal<T>;
120
+ /** Model value emitted when released. */
121
+ falseValue: _angular_core.InputSignal<T>;
122
+ /** Options to display, one button each. Presence switches the host to group mode. */
123
+ options: _angular_core.InputSignal<readonly (T | ToggleButtonOption<T>)[] | undefined>;
124
+ /** Field name to read a label from, when options are objects. */
125
+ optionLabel: _angular_core.InputSignal<string | undefined>;
126
+ /** Field name to read the value from, when options are objects. */
127
+ optionValue: _angular_core.InputSignal<string | undefined>;
128
+ /** Field name to read the disabled flag from, when options are objects. */
129
+ optionDisabled: _angular_core.InputSignal<string | undefined>;
130
+ /** Field name to read an icon name from, when options are objects. */
131
+ optionIcon: _angular_core.InputSignal<string | undefined>;
132
+ /** Property used to compare object values for equality (selection matching). */
133
+ dataKey: _angular_core.InputSignal<string | undefined>;
134
+ /** Layout axis of the group. */
135
+ orientation: _angular_core.InputSignal<ToggleButtonOrientation>;
136
+ /** Colour family of the pressed state. */
137
+ level: _angular_core.InputSignal<UiLevel>;
138
+ /** How the released state is drawn. */
139
+ variant: _angular_core.InputSignal<ToggleButtonVariant>;
140
+ /** Size. */
141
+ size: _angular_core.InputSignal<ToggleButtonSize>;
142
+ /** Span the full width of the parent (group buttons share the width evenly). */
143
+ fluid: _angular_core.InputSignalWithTransform<boolean, unknown>;
144
+ /** Ripple Effect */
145
+ ripple: _angular_core.InputSignalWithTransform<boolean, unknown>;
146
+ /** Pill shape. */
147
+ rounded: _angular_core.InputSignalWithTransform<boolean, unknown>;
148
+ /** Whether the last pressed button can be released (single), or the group emptied. */
149
+ allowEmpty: _angular_core.InputSignalWithTransform<boolean, unknown>;
150
+ /** Replaces the icon, single mode (receives `{ $implicit, checked }`). */
151
+ iconTemplate: _angular_core.InputSignal<TemplateRef<ToggleButtonStateContext> | undefined>;
152
+ /** Replaces the whole button content, single mode (receives `{ $implicit, checked }`). */
153
+ contentTemplate: _angular_core.InputSignal<TemplateRef<ToggleButtonStateContext> | undefined>;
154
+ /** Replaces a group button's content (receives `{ $implicit, option, selected, index }`). */
155
+ itemTemplate: _angular_core.InputSignal<TemplateRef<ToggleButtonItemContext<T>> | undefined>;
156
+ /** Emitted on user interaction with the new model value. */
157
+ toggleChange: _angular_core.OutputEmitterRef<ToggleButtonValue<T>>;
158
+ /** Emitted when a group button is clicked (even if it does not change the value). */
159
+ optionClick: _angular_core.OutputEmitterRef<ToggleButtonOptionClickEvent<T>>;
160
+ /** Emitted when a button receives focus. */
161
+ toggleFocus: _angular_core.OutputEmitterRef<FocusEvent>;
162
+ /** Emitted when a button loses focus. */
163
+ toggleBlur: _angular_core.OutputEmitterRef<FocusEvent>;
164
+ /** @ignore */
165
+ private readonly buttons;
166
+ /** @ignore */
167
+ private readonly resolver;
168
+ constructor();
169
+ /** @ignore Group mode: an `options` list was provided. */
170
+ protected readonly isGroup: _angular_core.Signal<boolean>;
171
+ /** @ignore */
172
+ protected readonly iconSize: _angular_core.Signal<UiIconSize>;
173
+ /** @ignore */
174
+ protected readonly hostClasses: _angular_core.Signal<string>;
175
+ /** @ignore Only the group carries the group-level ARIA naming. */
176
+ protected readonly groupAriaLabel: _angular_core.Signal<string | null>;
177
+ /** @ignore */
178
+ protected readonly groupAriaLabelledBy: _angular_core.Signal<string | null>;
179
+ /** @ignore */
180
+ protected readonly checked: _angular_core.Signal<boolean>;
181
+ /** @ignore */
182
+ protected readonly hasStateLabels: _angular_core.Signal<boolean>;
183
+ /** @ignore Label of the current state, falling back to the shared one. */
184
+ protected readonly currentLabel: _angular_core.Signal<string | null>;
185
+ /** @ignore Icon of the current state, falling back to the shared one. */
186
+ protected readonly currentIcon: _angular_core.Signal<string | null>;
187
+ /** @ignore Square button: an icon, no text. */
188
+ protected readonly isIconOnly: _angular_core.Signal<boolean>;
189
+ /** @ignore */
190
+ protected readonly iconBefore: _angular_core.Signal<boolean>;
191
+ /** @ignore */
192
+ protected readonly stateContext: _angular_core.Signal<ToggleButtonStateContext>;
193
+ /** @ignore Accessible name of the single button (never empty-stringed). */
194
+ protected readonly buttonAriaLabel: _angular_core.Signal<string | null>;
195
+ /** @ignore Options resolved to a flat, render-ready shape. */
196
+ protected readonly normalizedOptions: _angular_core.Signal<NormalizedToggle[]>;
197
+ /** @ignore */
198
+ protected itemContext(item: NormalizedToggle): ToggleButtonItemContext<T>;
199
+ /** @ignore */
200
+ protected uidPrefix(): string;
201
+ /** Focus the button (the first enabled one in group mode). */
202
+ focus(options?: FocusOptions): void;
203
+ /** @ignore Single mode: flip the boolean pair. */
204
+ protected toggle(): void;
205
+ /** @ignore Group mode: press / release one option. */
206
+ protected toggleOption(item: NormalizedToggle, event: Event): void;
207
+ /** @ignore */
208
+ protected onBlur(event: FocusEvent): void;
209
+ /** @ignore Rich option shape (`{ value }`) resolves without a field mapping. */
210
+ private resolveValue;
211
+ /** @ignore An option object with no label key stays label-less (icon-only button). */
212
+ private resolveLabel;
213
+ /** @ignore */
214
+ private resolveIcon;
215
+ /** @ignore A group's model is the array of pressed values. */
216
+ private isPressed;
217
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiToggleButton<any>, never>;
218
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiToggleButton<any>, "ui-toggle-button", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "onLabel": { "alias": "onLabel"; "required": false; "isSignal": true; }; "offLabel": { "alias": "offLabel"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "onIcon": { "alias": "onIcon"; "required": false; "isSignal": true; }; "offIcon": { "alias": "offIcon"; "required": false; "isSignal": true; }; "iconPos": { "alias": "iconPos"; "required": false; "isSignal": true; }; "trueValue": { "alias": "trueValue"; "required": false; "isSignal": true; }; "falseValue": { "alias": "falseValue"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionDisabled": { "alias": "optionDisabled"; "required": false; "isSignal": true; }; "optionIcon": { "alias": "optionIcon"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "level": { "alias": "level"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "fluid": { "alias": "fluid"; "required": false; "isSignal": true; }; "ripple": { "alias": "ripple"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "allowEmpty": { "alias": "allowEmpty"; "required": false; "isSignal": true; }; "iconTemplate": { "alias": "iconTemplate"; "required": false; "isSignal": true; }; "contentTemplate": { "alias": "contentTemplate"; "required": false; "isSignal": true; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; "isSignal": true; }; }, { "toggleChange": "toggleChange"; "optionClick": "optionClick"; "toggleFocus": "toggleFocus"; "toggleBlur": "toggleBlur"; }, never, never, true, never>;
219
+ }
220
+
221
+ export { UiToggleButton };
222
+ export type { ToggleButtonIconPos, ToggleButtonItemContext, ToggleButtonOption, ToggleButtonOptionClickEvent, ToggleButtonOrientation, ToggleButtonSize, ToggleButtonStateContext, ToggleButtonValue, ToggleButtonVariant };