ng-hub-ui-forms 22.4.0 → 22.5.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/fesm2022/ng-hub-ui-forms.mjs +60 -36
- package/fesm2022/ng-hub-ui-forms.mjs.map +1 -1
- package/ng-hub-ui-forms-22.5.0.tgz +0 -0
- package/package.json +1 -1
- package/{src/lib/styles → styles}/_tokens.scss +5 -5
- package/{src/lib/styles → styles}/index.scss +2 -0
- package/styles/mixins/_forms-theme.scss +67 -0
- package/{src/lib/styles → styles}/mixins/_segmented-theme.scss +1 -1
- package/types/ng-hub-ui-forms.d.ts +12 -6
- package/ng-hub-ui-forms-22.4.0.tgz +0 -0
- /package/{src/lib/styles → styles}/_field.scss +0 -0
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ng-hub-ui-forms",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.5.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)",
|
|
@@ -221,11 +221,11 @@
|
|
|
221
221
|
|
|
222
222
|
// ── Segmented ───────────────────────────────────────────────────────────────
|
|
223
223
|
--hub-segmented-bg: var(--hub-sys-surface-elevated, #f8f9fa);
|
|
224
|
-
//
|
|
225
|
-
//
|
|
226
|
-
//
|
|
227
|
-
//
|
|
228
|
-
--hub-segmented-accent:
|
|
224
|
+
// Single-slot accent (mirrors `--hub-table-accent` / `--hub-btn-accent`). When a `[color]` is
|
|
225
|
+
// applied it is set — from a ds token or a literal colour — and the selected pill derives its
|
|
226
|
+
// surface and contrast text from it (see the `[data-variant]` rule in the component styles).
|
|
227
|
+
// With no `[color]` the neutral defaults below keep the white-pill look.
|
|
228
|
+
--hub-segmented-accent: var(--hub-sys-color-primary, #0d6efd);
|
|
229
229
|
--hub-segmented-selected-bg: var(--hub-sys-surface-page, #fff);
|
|
230
230
|
--hub-segmented-selected-color: var(--hub-sys-text-primary, #212529);
|
|
231
231
|
--hub-segmented-radius: var(--hub-ref-radius-md, 0.375rem);
|
|
@@ -13,4 +13,6 @@
|
|
|
13
13
|
@use 'field';
|
|
14
14
|
|
|
15
15
|
// One-call theming mixins (opt-in; forwarded so consumers can `@use` them from the package root).
|
|
16
|
+
// `hub-forms-theme` themes the shared field chrome; `hub-segmented-theme` tunes `<hub-segmented>`.
|
|
17
|
+
@forward 'mixins/forms-theme';
|
|
16
18
|
@forward 'mixins/segmented-theme';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
2
|
+
// hub-forms-theme — one-call theming for the shared `ng-hub-ui-forms` chrome
|
|
3
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
4
|
+
//
|
|
5
|
+
// Sets the cross-cutting `--hub-form-*` tokens that EVERY form control reads
|
|
6
|
+
// (focus ring, validation accents, disabled state, motion) in a single include.
|
|
7
|
+
// Every parameter is OPTIONAL and defaults to `null`: only the parameters you
|
|
8
|
+
// pass are emitted, so the rest keep the library defaults. Token-based and
|
|
9
|
+
// self-contained (no Bootstrap dependencies). For a specific control, layer the
|
|
10
|
+
// matching component mixin on top (e.g. `hub-segmented-theme`).
|
|
11
|
+
//
|
|
12
|
+
// Apply it inside any selector that wraps the fields — a form, a container, a
|
|
13
|
+
// route, or `:root` for a global theme.
|
|
14
|
+
//
|
|
15
|
+
// @example — brand focus ring + softer disabled state, globally:
|
|
16
|
+
//
|
|
17
|
+
// @use 'ng-hub-ui-forms/styles' as *;
|
|
18
|
+
//
|
|
19
|
+
// :root {
|
|
20
|
+
// @include hub-forms-theme(
|
|
21
|
+
// $focus-ring-color: var(--hub-sys-color-info-subtle),
|
|
22
|
+
// $disabled-opacity: 0.5
|
|
23
|
+
// );
|
|
24
|
+
// }
|
|
25
|
+
//
|
|
26
|
+
// scss-docs-start hub-forms-theme
|
|
27
|
+
@mixin hub-forms-theme(
|
|
28
|
+
// ── Focus ring (shared by every control) ──
|
|
29
|
+
$focus-ring-color: null, // focus-ring colour
|
|
30
|
+
$focus-ring-width: null, // focus-ring width
|
|
31
|
+
// ── Validation accents ──
|
|
32
|
+
$invalid-color: null, // invalid text + border colour
|
|
33
|
+
$valid-color: null, // valid text + border colour
|
|
34
|
+
// ── State ──
|
|
35
|
+
$disabled-opacity: null, // opacity applied to a disabled control
|
|
36
|
+
// ── Motion ──
|
|
37
|
+
$transition: null // border/box-shadow transition shared by inputs
|
|
38
|
+
) {
|
|
39
|
+
// Focus ring
|
|
40
|
+
@if $focus-ring-color != null {
|
|
41
|
+
--hub-form-focus-ring-color: #{$focus-ring-color};
|
|
42
|
+
}
|
|
43
|
+
@if $focus-ring-width != null {
|
|
44
|
+
--hub-form-focus-ring-width: #{$focus-ring-width};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Validation accents (text + border move together)
|
|
48
|
+
@if $invalid-color != null {
|
|
49
|
+
--hub-form-invalid-color: #{$invalid-color};
|
|
50
|
+
--hub-form-invalid-border-color: #{$invalid-color};
|
|
51
|
+
}
|
|
52
|
+
@if $valid-color != null {
|
|
53
|
+
--hub-form-valid-color: #{$valid-color};
|
|
54
|
+
--hub-form-valid-border-color: #{$valid-color};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// State
|
|
58
|
+
@if $disabled-opacity != null {
|
|
59
|
+
--hub-form-disabled-opacity: #{$disabled-opacity};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Motion
|
|
63
|
+
@if $transition != null {
|
|
64
|
+
--hub-form-transition: #{$transition};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// scss-docs-end hub-forms-theme
|
|
@@ -813,14 +813,20 @@ declare class HubSegmentedComponent extends HubFieldControl {
|
|
|
813
813
|
/** Visual density. */
|
|
814
814
|
readonly size: _angular_core.InputSignal<HubSegmentedSize>;
|
|
815
815
|
/**
|
|
816
|
-
*
|
|
817
|
-
*
|
|
818
|
-
*
|
|
819
|
-
*
|
|
820
|
-
*
|
|
821
|
-
*
|
|
816
|
+
* Accent for the selected pill. Accepts ANY colour value:
|
|
817
|
+
* - a built-in semantic name (`primary`, `success`, …) or any registered accent → resolves to
|
|
818
|
+
* the matching `--hub-sys-color-*` design-system token;
|
|
819
|
+
* - a literal colour (`#ff0000`, `rgb(...)`, `oklch(...)`, `rebeccapurple`) → used as-is.
|
|
820
|
+
* Both the sliding indicator and the multiple-mode pill follow it, and the selected label gets a
|
|
821
|
+
* derived contrast colour automatically. Empty string (default) keeps the neutral white-pill look.
|
|
822
822
|
*/
|
|
823
823
|
readonly color: _angular_core.InputSignal<string>;
|
|
824
|
+
/**
|
|
825
|
+
* Resolves {@link color} to a paintable accent for the `--hub-segmented-accent` slot: a bareword
|
|
826
|
+
* becomes a `--hub-sys-color-*` token with the word as raw fallback (so named CSS colours work
|
|
827
|
+
* too), while a literal `#hex` / `rgb()` / `oklch()` / `var()` is passed through unchanged.
|
|
828
|
+
*/
|
|
829
|
+
protected readonly accentVar: _angular_core.Signal<string | null>;
|
|
824
830
|
/** Label text. */
|
|
825
831
|
readonly label: _angular_core.InputSignal<string>;
|
|
826
832
|
/** Label display type (`stacked`, `horizontal`). */
|
|
Binary file
|
|
File without changes
|