ng-hub-ui-forms 22.1.1 → 22.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.
Binary file
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "ng-hub-ui-forms",
3
- "version": "22.1.1",
3
+ "version": "22.2.0",
4
4
  "license": "MIT",
5
5
  "description": "Accessible, signal-based form fields for Angular (input, textarea, slider, select, datepicker) with automatic error display for controls, FormGroups and FormArrays. Reactive Forms today, Signal Forms ready. Part of the ng-hub-ui family.",
6
6
  "author": "Carlos Morcillo <carlos.morcillo@me.com> (https://www.carlosmorcillo.com)",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/carlos-morcillo/ng-hub-ui-forms.git"
9
+ "url": "git+https://github.com/carlos-morcillo/ng-hub-ui-forms.git"
10
10
  },
11
11
  "homepage": "https://hubui.dev/",
12
12
  "keywords": [
@@ -140,7 +140,9 @@
140
140
  --hub-select-option-padding-y: var(--hub-ref-space-2, 0.5rem);
141
141
  --hub-select-option-marked-bg: var(--hub-sys-surface-elevated, #f8f9fa);
142
142
  --hub-select-option-selected-bg: var(--hub-sys-color-primary, #0d6efd);
143
- --hub-select-option-selected-color: var(--hub-ref-color-white, #fff);
143
+ // Text on the selected option sits on the primary accent — read the derived
144
+ // contrast token so a light/custom primary keeps the label legible.
145
+ --hub-select-option-selected-color: var(--hub-sys-color-primary-on, var(--hub-ref-color-white, #fff));
144
146
  --hub-select-optgroup-color: var(--hub-sys-text-muted, #6c757d);
145
147
  --hub-select-value-bg: var(--hub-sys-surface-elevated, #f8f9fa);
146
148
  --hub-select-value-color: var(--hub-sys-text-primary, #212529);
@@ -168,10 +170,12 @@
168
170
  --hub-daterangepicker-cell-border-radius: var(--hub-ref-radius-sm, 0.25rem);
169
171
  --hub-daterangepicker-cell-hover-bg: var(--hub-sys-surface-elevated, #f8f9fa);
170
172
  --hub-daterangepicker-active-bg: var(--hub-sys-color-primary, #0d6efd);
171
- --hub-daterangepicker-active-color: var(--hub-ref-color-white, #fff);
172
- // Light primary tint (theme-aware): `--hub-sys-color-primary-subtle` is a *dark* navy in
173
- // this design system, so derive a soft tint from the primary instead.
174
- --hub-daterangepicker-in-range-bg: color-mix(in srgb, var(--hub-sys-color-primary, #0d6efd) 14%, transparent);
173
+ // Text on the active day sits on the primary accent — derived contrast token.
174
+ --hub-daterangepicker-active-color: var(--hub-sys-color-primary-on, var(--hub-ref-color-white, #fff));
175
+ // Soft primary tint for the in-range band. Mixed in OKLCH (perceptually even)
176
+ // rather than sRGB; kept independent of `-subtle` (which mixes over the page
177
+ // surface, not transparent) so the band reads as a translucent overlay.
178
+ --hub-daterangepicker-in-range-bg: color-mix(in oklch, var(--hub-sys-color-primary, #0d6efd) 14%, transparent);
175
179
  --hub-daterangepicker-off-color: var(--hub-sys-text-muted, #6c757d);
176
180
  --hub-daterangepicker-nav-arrow-color: var(--hub-sys-text-muted, #6c757d);
177
181
  --hub-daterangepicker-nav-arrow-hover-color: var(--hub-sys-text-primary, #212529);
@@ -184,6 +188,7 @@
184
188
  --hub-select-button-padding-y: var(--hub-ref-space-2, 0.5rem);
185
189
  --hub-select-button-gap: var(--hub-ref-space-2, 0.5rem);
186
190
  --hub-select-button-selected-bg: var(--hub-sys-color-primary, #0d6efd);
187
- --hub-select-button-selected-color: var(--hub-ref-color-white, #fff);
191
+ // Text on the selected button sits on the primary accent — derived contrast token.
192
+ --hub-select-button-selected-color: var(--hub-sys-color-primary-on, var(--hub-ref-color-white, #fff));
188
193
  --hub-select-button-selected-border-color: var(--hub-sys-color-primary, #0d6efd);
189
194
  }
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { OnInit, AfterContentInit, OnDestroy, TemplateRef, ElementRef, InjectionToken, EnvironmentProviders, PipeTransform, NgZone } from '@angular/core';
2
+ import { OnInit, AfterContentInit, OnDestroy, TemplateRef, ElementRef, InjectionToken, EnvironmentProviders, PipeTransform, NgZone, ViewContainerRef } from '@angular/core';
3
3
  import { NgControl, ControlContainer, ControlValueAccessor, ValidationErrors, AbstractControl, ValidatorFn } from '@angular/forms';
4
4
  import { Subject, OperatorFunction } from 'rxjs';
5
5
  import * as ng_hub_ui_forms from 'ng-hub-ui-forms';
@@ -1478,5 +1478,52 @@ declare function isMaskActive(mask: string | null | undefined): boolean;
1478
1478
  */
1479
1479
  declare function applyMask(value: string | null | undefined, mask: string): HubMaskResult;
1480
1480
 
1481
- export { FormTextTypes, HUB_FORMS_CONFIG, HubAutoresizeDirective, HubDatepickerComponent, HubFieldControl, HubFieldsetComponent, HubFormComponent, HubFormControl, HubFormTextDirective, HubGroupControl, HubInputComponent, HubInputFormats, HubInvertColorPipe, HubJoinButLastPipe, HubLabelTypes, HubLegendComponent, HubLegendDirective, HubMapPipe, HubOtpInputComponent, HubSafeUrlPipe, HubSelectComponent, HubSelectFormats, HubSliderComponent, HubSnakeUpperPipe, HubTextareaComponent, HubUcfirstPipe, HubValidationErrorDirective, NgClearButtonTemplateDirective, NgFooterTemplateDirective, NgHeaderTemplateDirective, NgLabelTemplateDirective, NgLoadingSpinnerTemplateDirective, NgLoadingTextTemplateDirective, NgMultiLabelTemplateDirective, NgNotFoundTemplateDirective, NgOptgroupTemplateDirective, NgOptionComponent, NgOptionTemplateDirective, NgSelectConfig, NgTagTemplateDirective, NgTypeToSearchTemplateDirective, applyMask, areEqual, camelToSnakeUpper, controlHasMinOrMaxValidator, defaultHubDatepickerConfig, defaultHubDatepickerLabels, defaultHubFormsConfig, defaultInvalidFeedback, get, getActiveElement, getMinOrMaxValueFromValidator, hubAreEqual, isDefined, isMaskActive, isString, joinButLast, provideHubForms, runInZone, uuid };
1482
- export type { FormTextType, HubDateRange, HubDateValue, HubDatepickerConfig, HubDatepickerLabels, HubDatepickerMode, HubFormsConfig, HubGroupErrorTrigger, HubInputFormat, HubLabelType, HubMaskResult, HubOtpMode, HubSelectFormat, HubSliderValue };
1481
+ /** A `{ value, label }` option for select-kind controls. */
1482
+ interface HubFormControlOption {
1483
+ value: unknown;
1484
+ label: string;
1485
+ }
1486
+ /**
1487
+ * Framework-neutral description of a primitive control to render dynamically.
1488
+ *
1489
+ * The shape mirrors (structurally) the contract other ng-hub-ui libraries expose
1490
+ * for optional control hosting (e.g. `ng-hub-ui-paginable`'s table), so this
1491
+ * adapter can be wired into them without either package importing the other.
1492
+ */
1493
+ interface HubFormControlConfig {
1494
+ kind: 'input' | 'select';
1495
+ value: unknown;
1496
+ type?: string;
1497
+ placeholder?: string;
1498
+ ariaLabel?: string;
1499
+ cssClass?: string;
1500
+ options?: ReadonlyArray<HubFormControlOption>;
1501
+ onValueChange: (value: unknown) => void;
1502
+ }
1503
+ /** Live handle to a control created by {@link hubFormControlAdapter}. */
1504
+ interface HubFormControlHandle {
1505
+ /** Pushes a new value into the control (external updates). */
1506
+ setValue(value: unknown): void;
1507
+ /** Destroys the control and releases its resources. */
1508
+ destroy(): void;
1509
+ }
1510
+ /** Adapter that renders primitive controls with the ng-hub-ui-forms components. */
1511
+ interface HubFormControlAdapter {
1512
+ create(container: ViewContainerRef, config: HubFormControlConfig): HubFormControlHandle;
1513
+ }
1514
+ /**
1515
+ * Ready-made {@link HubFormControlAdapter} backed by `HubInputComponent` /
1516
+ * `HubSelectComponent`.
1517
+ *
1518
+ * Wire it into any ng-hub-ui primitive that exposes an optional form-controls
1519
+ * token, e.g. `provideHubPaginableFormControls(hubFormControlAdapter)`. The host
1520
+ * library keeps **zero hard dependency** on `ng-hub-ui-forms`; only an app that
1521
+ * opts in pulls these components.
1522
+ *
1523
+ * Requires `provideHubForms()` (or the default config) to be available in the
1524
+ * environment so the field components can resolve their configuration.
1525
+ */
1526
+ declare const hubFormControlAdapter: HubFormControlAdapter;
1527
+
1528
+ export { FormTextTypes, HUB_FORMS_CONFIG, HubAutoresizeDirective, HubDatepickerComponent, HubFieldControl, HubFieldsetComponent, HubFormComponent, HubFormControl, HubFormTextDirective, HubGroupControl, HubInputComponent, HubInputFormats, HubInvertColorPipe, HubJoinButLastPipe, HubLabelTypes, HubLegendComponent, HubLegendDirective, HubMapPipe, HubOtpInputComponent, HubSafeUrlPipe, HubSelectComponent, HubSelectFormats, HubSliderComponent, HubSnakeUpperPipe, HubTextareaComponent, HubUcfirstPipe, HubValidationErrorDirective, NgClearButtonTemplateDirective, NgFooterTemplateDirective, NgHeaderTemplateDirective, NgLabelTemplateDirective, NgLoadingSpinnerTemplateDirective, NgLoadingTextTemplateDirective, NgMultiLabelTemplateDirective, NgNotFoundTemplateDirective, NgOptgroupTemplateDirective, NgOptionComponent, NgOptionTemplateDirective, NgSelectConfig, NgTagTemplateDirective, NgTypeToSearchTemplateDirective, applyMask, areEqual, camelToSnakeUpper, controlHasMinOrMaxValidator, defaultHubDatepickerConfig, defaultHubDatepickerLabels, defaultHubFormsConfig, defaultInvalidFeedback, get, getActiveElement, getMinOrMaxValueFromValidator, hubAreEqual, hubFormControlAdapter, isDefined, isMaskActive, isString, joinButLast, provideHubForms, runInZone, uuid };
1529
+ export type { FormTextType, HubDateRange, HubDateValue, HubDatepickerConfig, HubDatepickerLabels, HubDatepickerMode, HubFormControlAdapter, HubFormControlConfig, HubFormControlHandle, HubFormControlOption, HubFormsConfig, HubGroupErrorTrigger, HubInputFormat, HubLabelType, HubMaskResult, HubOtpMode, HubSelectFormat, HubSliderValue };
Binary file