ng-hub-ui-forms 22.44.2 → 22.45.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/README.md +28 -0
- package/fesm2022/ng-hub-ui-forms.mjs +85 -26
- package/fesm2022/ng-hub-ui-forms.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/_tokens.scss +31 -19
- package/styles/index.scss +1 -0
- package/styles/mixins/_select-chip.scss +108 -0
- package/types/ng-hub-ui-forms.d.ts +17 -2
package/README.md
CHANGED
|
@@ -1005,6 +1005,32 @@ check mark (unset, each mark is black or white, whichever reads on its swatch).
|
|
|
1005
1005
|
|
|
1006
1006
|
**Width of the list** — the panel is never narrower than the control and grows to its longest option, up to `--hub-select-dropdown-max-width` (default `24rem`) and never past the screen. When it would run off the screen from the control's start, it lines up with the control's end.
|
|
1007
1007
|
|
|
1008
|
+
**Filter chips** — a select that narrows a list can wear the pill a filter usually wears: the `prepend` as the filter's name, the value, and the clear button as the chip's ×. Classes do it, with no Sass; `hub-select-chip-<accent>` takes any of the nine accents a button takes, `primary` when none is given:
|
|
1009
|
+
|
|
1010
|
+
```html
|
|
1011
|
+
<hub-select
|
|
1012
|
+
class="hub-select-chip hub-select-chip-success"
|
|
1013
|
+
label="Company"
|
|
1014
|
+
labelType="visually-hidden"
|
|
1015
|
+
[prepend]="['Company']"
|
|
1016
|
+
[items]="companies"
|
|
1017
|
+
[searchable]="false"
|
|
1018
|
+
placeholder="All"
|
|
1019
|
+
/>
|
|
1020
|
+
```
|
|
1021
|
+
|
|
1022
|
+
For a class of your own, or a colour outside the nine, include the mixin:
|
|
1023
|
+
|
|
1024
|
+
```scss
|
|
1025
|
+
@use 'ng-hub-ui-forms/styles' as *;
|
|
1026
|
+
|
|
1027
|
+
.filter-chip {
|
|
1028
|
+
@include hub-select-chip($accent: var(--hub-sys-color-brand));
|
|
1029
|
+
}
|
|
1030
|
+
```
|
|
1031
|
+
|
|
1032
|
+
The chip's open list starts under the filter's name and is at least as wide as the pill. That comes from `--hub-select-dropdown-anchor`: `control` by default (the part that holds the value), `group` for the whole field with its prepend and append, read each time the list opens.
|
|
1033
|
+
|
|
1008
1034
|
**`hub-datepicker` inside a modal** — the same guarantee, through `--hub-datepicker-overlay-zindex` (default `calc(var(--hub-sys-zindex-modal, 1055) + 5)`): a calendar opened inside a `HubModal` is drawn over the dialog, and its backdrop one layer under the calendar but still over the dialog, so clicking outside closes it. One token moves both:
|
|
1009
1035
|
|
|
1010
1036
|
```css
|
|
@@ -1025,6 +1051,8 @@ check mark (unset, each mark is black or white, whichever reads on its swatch).
|
|
|
1025
1051
|
|
|
1026
1052
|
In single-select mode the selected pill slides between options (`--hub-segmented-indicator-transition`, default `0.2s ease`; disabled under `prefers-reduced-motion`).
|
|
1027
1053
|
|
|
1054
|
+
`readonly` shows the value at full strength and lets nothing change it; the options stay focusable. `disabled` fades only the options that are not selected, so the one that is stays readable (`--hub-segmented-disabled-selected-bg`, `--hub-segmented-disabled-selected-color`).
|
|
1055
|
+
|
|
1028
1056
|
---
|
|
1029
1057
|
|
|
1030
1058
|
## ✨ Signal Forms (opt-in)
|