@ferrlabs/ui-ng 1.63.0 → 1.64.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 +24 -0
- 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
|
@@ -93,6 +93,30 @@ direction is read from CSS `direction`. Stored sizes are restored once per `stor
|
|
|
93
93
|
or removing a pane later keeps the live layout. A drag is cancelled if its handle goes away
|
|
94
94
|
(for example when the splitter crosses `stackBelow`).
|
|
95
95
|
|
|
96
|
+
## Segmented
|
|
97
|
+
|
|
98
|
+
`flr-segmented` is a radio group drawn as a pill of options: `options` (`{ value, label, icon? }[]`),
|
|
99
|
+
`[(value)]`, `iconOnly`, and `aria-label` / `aria-labelledby` / `aria-describedby`.
|
|
100
|
+
|
|
101
|
+
The selected option takes its colour from `--color-accent`, so each app gets its own accent with no
|
|
102
|
+
override: accent text, an accent border, and a 12% accent tint over `--color-card`. The accent keeps
|
|
103
|
+
its hue and saturation, and its lightness is clamped against `--color-ink` (at most 0.45 in OKLab on
|
|
104
|
+
a light theme, at least 0.8 on a dark one) so the label stays above 4.5:1 on the tint whatever the
|
|
105
|
+
accent. A theme that remaps `--color-card`, `--color-app-bg-2`, `--color-ink`, `--color-ink-3` or
|
|
106
|
+
`--color-rule` on the `flr-segmented` host is followed automatically.
|
|
107
|
+
|
|
108
|
+
To set the selection by hand, declare any of these on `flr-segmented` or an ancestor:
|
|
109
|
+
|
|
110
|
+
| Custom property | Applies to | Default |
|
|
111
|
+
| ------------------------- | ----------------------------------- | -------------------------------- |
|
|
112
|
+
| `--flr-seg-selected-bg` | Thumb background | 12% clamped accent over the card |
|
|
113
|
+
| `--flr-seg-selected-rule` | Thumb border | Clamped accent |
|
|
114
|
+
| `--flr-seg-selected-ink` | Selected label and icon, focus ring | Clamped accent |
|
|
115
|
+
|
|
116
|
+
Hover on the other options keeps using `--color-ink`, and idle options `--color-ink-3`. Before the
|
|
117
|
+
thumb is placed (prerendered HTML that has not hydrated yet) the selected option carries the same
|
|
118
|
+
tint and border itself. In `forced-colors` mode the selection uses `Highlight` and `HighlightText`.
|
|
119
|
+
|
|
96
120
|
## Versioned docs (`@ferrlabs/ui-ng/docs`)
|
|
97
121
|
|
|
98
122
|
Brand-agnostic versioned-documentation layout, shared across product sites.
|
|
@@ -16120,7 +16120,7 @@ var SegmentedComponent = class SegmentedComponent {
|
|
|
16120
16120
|
],
|
|
16121
16121
|
ngImport: i0,
|
|
16122
16122
|
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",
|
|
16123
|
-
styles: [":host{display:inline-block}.flr-seg{position:relative;display:inline-flex;overflow:hidden;gap:2px;padding:3px;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:3px;bottom:3px;left:0;box-sizing:border-box;border:1px solid var(--
|
|
16123
|
+
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(--color-accent, #1e293b) 25%, var(--flr-seg-pole));--flr-seg-tone: oklab( from var(--flr-seg-probe) max(min(4 * l, .45), clamp(0, (l - .5) * 1000, 1) * max(4 * l - 3, .8)) calc(a*4) calc(b*4) );--flr-seg-ink: var(--flr-seg-selected-ink, var(--flr-seg-tone));--flr-seg-edge: var(--flr-seg-selected-rule, var(--flr-seg-tone));--flr-seg-tint: var( --flr-seg-selected-bg, color-mix(in srgb, var(--flr-seg-tone) 12%, var(--color-card, #ffffff)) );position:relative;display:inline-flex;overflow:hidden;gap:2px;padding:3px;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:3px;bottom:3px;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(--flr-seg-ink);outline-offset:-2px}.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"],
|
|
16124
16124
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
16125
16125
|
});
|
|
16126
16126
|
}
|
|
@@ -16136,7 +16136,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
16136
16136
|
selector: "flr-segmented",
|
|
16137
16137
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16138
16138
|
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",
|
|
16139
|
-
styles: [":host{display:inline-block}.flr-seg{position:relative;display:inline-flex;overflow:hidden;gap:2px;padding:3px;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:3px;bottom:3px;left:0;box-sizing:border-box;border:1px solid var(--
|
|
16139
|
+
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(--color-accent, #1e293b) 25%, var(--flr-seg-pole));--flr-seg-tone: oklab( from var(--flr-seg-probe) max(min(4 * l, .45), clamp(0, (l - .5) * 1000, 1) * max(4 * l - 3, .8)) calc(a*4) calc(b*4) );--flr-seg-ink: var(--flr-seg-selected-ink, var(--flr-seg-tone));--flr-seg-edge: var(--flr-seg-selected-rule, var(--flr-seg-tone));--flr-seg-tint: var( --flr-seg-selected-bg, color-mix(in srgb, var(--flr-seg-tone) 12%, var(--color-card, #ffffff)) );position:relative;display:inline-flex;overflow:hidden;gap:2px;padding:3px;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:3px;bottom:3px;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(--flr-seg-ink);outline-offset:-2px}.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"]
|
|
16140
16140
|
}]
|
|
16141
16141
|
}],
|
|
16142
16142
|
ctorParameters: () => [],
|