@ferrlabs/ui-ng 1.65.0 → 1.66.1
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 +16 -12
- package/fesm2022/ferrlabs-ui-ng.mjs +2 -2
- package/fesm2022/ferrlabs-ui-ng.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -122,24 +122,28 @@ or removing a pane later keeps the live layout. A drag is cancelled if its handl
|
|
|
122
122
|
`flr-segmented` is a radio group drawn as a pill of options: `options` (`{ value, label, icon? }[]`),
|
|
123
123
|
`[(value)]`, `iconOnly`, and `aria-label` / `aria-labelledby` / `aria-describedby`.
|
|
124
124
|
|
|
125
|
-
The selected option
|
|
126
|
-
override: accent
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
accent
|
|
130
|
-
`--color-
|
|
125
|
+
The selected option is filled with `--color-accent`, so each app gets its own accent with no
|
|
126
|
+
override: an accent thumb with an accent border, and a label that turns black or white depending on
|
|
127
|
+
the accent's lightness (the rule `.btn-primary` uses), which keeps it above 4.5:1 on every product
|
|
128
|
+
accent. When the accent is too close to the track to be seen (the slate accent on a dark theme, a
|
|
129
|
+
near-white accent on a light one), the thumb border shifts towards `--color-ink`. A theme that
|
|
130
|
+
remaps `--color-accent`, `--color-app-bg-2`, `--color-ink`, `--color-ink-3` or `--color-rule` on the
|
|
131
|
+
`flr-segmented` host is followed automatically.
|
|
131
132
|
|
|
132
133
|
To set the selection by hand, declare any of these on `flr-segmented` or an ancestor:
|
|
133
134
|
|
|
134
|
-
| Custom property | Applies to
|
|
135
|
-
| ------------------------- |
|
|
136
|
-
| `--flr-seg-selected-bg` | Thumb background
|
|
137
|
-
| `--flr-seg-selected-rule` | Thumb border
|
|
138
|
-
| `--flr-seg-selected-ink` | Selected label and icon
|
|
135
|
+
| Custom property | Applies to | Default |
|
|
136
|
+
| ------------------------- | ----------------------- | --------------------------------------------------------------- |
|
|
137
|
+
| `--flr-seg-selected-bg` | Thumb background | `--color-accent` |
|
|
138
|
+
| `--flr-seg-selected-rule` | Thumb border | The thumb background |
|
|
139
|
+
| `--flr-seg-selected-ink` | Selected label and icon | `--color-on-accent`, else black or white from the thumb's light |
|
|
140
|
+
|
|
141
|
+
The focus ring is drawn inside the selected option in the label colour, so it stays visible on the
|
|
142
|
+
accent.
|
|
139
143
|
|
|
140
144
|
Hover on the other options keeps using `--color-ink`, and idle options `--color-ink-3`. Before the
|
|
141
145
|
thumb is placed (prerendered HTML that has not hydrated yet) the selected option carries the same
|
|
142
|
-
|
|
146
|
+
fill and border itself. In `forced-colors` mode the selection uses `Highlight` and `HighlightText`.
|
|
143
147
|
|
|
144
148
|
## Versioned docs (`@ferrlabs/ui-ng/docs`)
|
|
145
149
|
|
|
@@ -16420,7 +16420,7 @@ var SegmentedComponent = class SegmentedComponent {
|
|
|
16420
16420
|
],
|
|
16421
16421
|
ngImport: i0,
|
|
16422
16422
|
template: "<div\n #group\n class=\"flr-seg\"\n role=\"radiogroup\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n>\n <span #thumb class=\"flr-seg__thumb\" aria-hidden=\"true\" hidden></span>\n @for (option of options(); track option.value; let i = $index) {\n @let selected = option.value === value();\n <button\n #optionButton\n type=\"button\"\n role=\"radio\"\n class=\"flr-seg__option\"\n [class.flr-seg__option--selected]=\"selected\"\n [class.flr-seg__option--icon-only]=\"iconOnly() && option.icon\"\n [attr.aria-checked]=\"selected\"\n [attr.aria-label]=\"iconOnly() && option.icon ? option.label : null\"\n [attr.title]=\"iconOnly() && option.icon ? option.label : null\"\n [tabindex]=\"selected ? 0 : -1\"\n (click)=\"select(option)\"\n (keydown)=\"handleKeydown($event, i)\"\n >\n @let icon = trustedIcon(option.icon);\n @if (icon) {\n <span class=\"flr-seg__icon\" aria-hidden=\"true\" [innerHTML]=\"icon\"></span>\n }\n @if (!iconOnly() || !icon) {\n <span>{{ option.label }}</span>\n }\n </button>\n }\n</div>\n",
|
|
16423
|
-
styles: [":host{display:inline-block}.flr-seg{--flr-seg-pole: oklch(from var(--color-ink, #1e293b) clamp(0, (l - .6) * 1000, 1) 0 0);--flr-seg-probe: color-mix(in oklab, var(--
|
|
16423
|
+
styles: [":host{display:inline-block}.flr-seg{--flr-seg-tint: var(--flr-seg-selected-bg, var(--color-accent, #1e293b));--flr-seg-ink: var( --flr-seg-selected-ink, var(--color-on-accent, oklch(from var(--flr-seg-tint) clamp(0, (.564 - l) * 1000, 1) 0 0)) );--flr-seg-pole: oklch(from var(--color-ink, #1e293b) clamp(0, (l - .6) * 1000, 1) 0 0);--flr-seg-probe: color-mix(in oklab, var(--flr-seg-tint) 40%, var(--flr-seg-pole));--flr-seg-rim: oklch( from var(--flr-seg-probe) clamp(0, (l - .5) * 1000, 1) 0 0 / calc(clamp(0, (l - .34) * 1000, 1)*clamp(0, (.76 - l) * 1000, 1)/2) );--flr-seg-edge: var(--flr-seg-selected-rule, var(--flr-seg-rim));position:relative;display:inline-flex;overflow:hidden;gap:2px;padding:4px;border:1px solid var(--color-rule, rgba(30, 41, 59, .14));border-radius:var(--radius-card, 16px);corner-shape:var(--corner-shape, round);background:var(--color-app-bg-2, #f1f5f9)}.flr-seg__thumb{position:absolute;top:4px;bottom:4px;left:0;box-sizing:border-box;border:1px solid var(--flr-seg-edge);border-radius:var(--radius-control, 8px);corner-shape:var(--corner-shape, round);background:var(--flr-seg-tint);box-shadow:0 1px 2px #1e293b1f;pointer-events:none}.flr-seg__thumb[hidden]{display:none}.flr-seg__thumb--animated{transition:transform .26s cubic-bezier(.3,0,0,1),width .26s cubic-bezier(.3,0,0,1)}@media(prefers-reduced-motion:reduce){.flr-seg__thumb--animated{transition:none}}.flr-seg__option{position:relative;display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 12px;border:0;border-radius:var(--radius-control, 8px);corner-shape:var(--corner-shape, round);background:transparent;color:var(--color-ink-3, #64748b);font:inherit;font-size:13px;cursor:pointer;transition:color .12s ease,background-color .12s ease}.flr-seg__option:hover{color:var(--color-ink, #1e293b)}.flr-seg__option:focus-visible{outline:2px solid var(--color-ink, #1e293b);outline-offset:-2px}.flr-seg__option--selected:focus-visible{outline-color:var(--flr-seg-ink);outline-offset:-3px}.flr-seg__option--selected,.flr-seg__option--selected:hover{color:var(--flr-seg-ink)}.flr-seg__thumb[hidden]~.flr-seg__option--selected{background:var(--flr-seg-tint);box-shadow:inset 0 0 0 1px var(--flr-seg-edge)}@media(forced-colors:active){.flr-seg__thumb{border-color:Highlight;background:Highlight;forced-color-adjust:none}.flr-seg__option--selected,.flr-seg__option--selected:hover{color:HighlightText;forced-color-adjust:none}.flr-seg__thumb[hidden]~.flr-seg__option--selected{background:Highlight;box-shadow:none}}.flr-seg__option--icon-only{width:30px;padding:0;justify-content:center}.flr-seg__icon{display:inline-flex}.flr-seg__icon ::ng-deep svg{width:16px;height:16px}\n"],
|
|
16424
16424
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
16425
16425
|
});
|
|
16426
16426
|
}
|
|
@@ -16436,7 +16436,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
16436
16436
|
selector: "flr-segmented",
|
|
16437
16437
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16438
16438
|
template: "<div\n #group\n class=\"flr-seg\"\n role=\"radiogroup\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n>\n <span #thumb class=\"flr-seg__thumb\" aria-hidden=\"true\" hidden></span>\n @for (option of options(); track option.value; let i = $index) {\n @let selected = option.value === value();\n <button\n #optionButton\n type=\"button\"\n role=\"radio\"\n class=\"flr-seg__option\"\n [class.flr-seg__option--selected]=\"selected\"\n [class.flr-seg__option--icon-only]=\"iconOnly() && option.icon\"\n [attr.aria-checked]=\"selected\"\n [attr.aria-label]=\"iconOnly() && option.icon ? option.label : null\"\n [attr.title]=\"iconOnly() && option.icon ? option.label : null\"\n [tabindex]=\"selected ? 0 : -1\"\n (click)=\"select(option)\"\n (keydown)=\"handleKeydown($event, i)\"\n >\n @let icon = trustedIcon(option.icon);\n @if (icon) {\n <span class=\"flr-seg__icon\" aria-hidden=\"true\" [innerHTML]=\"icon\"></span>\n }\n @if (!iconOnly() || !icon) {\n <span>{{ option.label }}</span>\n }\n </button>\n }\n</div>\n",
|
|
16439
|
-
styles: [":host{display:inline-block}.flr-seg{--flr-seg-pole: oklch(from var(--color-ink, #1e293b) clamp(0, (l - .6) * 1000, 1) 0 0);--flr-seg-probe: color-mix(in oklab, var(--
|
|
16439
|
+
styles: [":host{display:inline-block}.flr-seg{--flr-seg-tint: var(--flr-seg-selected-bg, var(--color-accent, #1e293b));--flr-seg-ink: var( --flr-seg-selected-ink, var(--color-on-accent, oklch(from var(--flr-seg-tint) clamp(0, (.564 - l) * 1000, 1) 0 0)) );--flr-seg-pole: oklch(from var(--color-ink, #1e293b) clamp(0, (l - .6) * 1000, 1) 0 0);--flr-seg-probe: color-mix(in oklab, var(--flr-seg-tint) 40%, var(--flr-seg-pole));--flr-seg-rim: oklch( from var(--flr-seg-probe) clamp(0, (l - .5) * 1000, 1) 0 0 / calc(clamp(0, (l - .34) * 1000, 1)*clamp(0, (.76 - l) * 1000, 1)/2) );--flr-seg-edge: var(--flr-seg-selected-rule, var(--flr-seg-rim));position:relative;display:inline-flex;overflow:hidden;gap:2px;padding:4px;border:1px solid var(--color-rule, rgba(30, 41, 59, .14));border-radius:var(--radius-card, 16px);corner-shape:var(--corner-shape, round);background:var(--color-app-bg-2, #f1f5f9)}.flr-seg__thumb{position:absolute;top:4px;bottom:4px;left:0;box-sizing:border-box;border:1px solid var(--flr-seg-edge);border-radius:var(--radius-control, 8px);corner-shape:var(--corner-shape, round);background:var(--flr-seg-tint);box-shadow:0 1px 2px #1e293b1f;pointer-events:none}.flr-seg__thumb[hidden]{display:none}.flr-seg__thumb--animated{transition:transform .26s cubic-bezier(.3,0,0,1),width .26s cubic-bezier(.3,0,0,1)}@media(prefers-reduced-motion:reduce){.flr-seg__thumb--animated{transition:none}}.flr-seg__option{position:relative;display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 12px;border:0;border-radius:var(--radius-control, 8px);corner-shape:var(--corner-shape, round);background:transparent;color:var(--color-ink-3, #64748b);font:inherit;font-size:13px;cursor:pointer;transition:color .12s ease,background-color .12s ease}.flr-seg__option:hover{color:var(--color-ink, #1e293b)}.flr-seg__option:focus-visible{outline:2px solid var(--color-ink, #1e293b);outline-offset:-2px}.flr-seg__option--selected:focus-visible{outline-color:var(--flr-seg-ink);outline-offset:-3px}.flr-seg__option--selected,.flr-seg__option--selected:hover{color:var(--flr-seg-ink)}.flr-seg__thumb[hidden]~.flr-seg__option--selected{background:var(--flr-seg-tint);box-shadow:inset 0 0 0 1px var(--flr-seg-edge)}@media(forced-colors:active){.flr-seg__thumb{border-color:Highlight;background:Highlight;forced-color-adjust:none}.flr-seg__option--selected,.flr-seg__option--selected:hover{color:HighlightText;forced-color-adjust:none}.flr-seg__thumb[hidden]~.flr-seg__option--selected{background:Highlight;box-shadow:none}}.flr-seg__option--icon-only{width:30px;padding:0;justify-content:center}.flr-seg__icon{display:inline-flex}.flr-seg__icon ::ng-deep svg{width:16px;height:16px}\n"]
|
|
16440
16440
|
}]
|
|
16441
16441
|
}],
|
|
16442
16442
|
ctorParameters: () => [],
|