@cngx/common 0.1.0-rc.8 → 0.3.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/a11y/README.md +15 -2
- package/button/README.md +258 -0
- package/command/README.md +42 -2
- package/data/README.md +15 -12
- package/fesm2022/cngx-common-a11y.mjs +1076 -319
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +99 -77
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-button.mjs +1084 -0
- package/fesm2022/cngx-common-button.mjs.map +1 -0
- package/fesm2022/cngx-common-card.mjs +138 -78
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +799 -327
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +101 -25
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +861 -423
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +198 -160
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +693 -329
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +7303 -2774
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +2174 -442
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-menu-button.mjs +557 -0
- package/fesm2022/cngx-common-menu-button.mjs.map +1 -0
- package/fesm2022/cngx-common-popover.mjs +2109 -557
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +548 -419
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +442 -331
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +44 -71
- package/fesm2022/cngx-common-timeline.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +10 -10
- package/fesm2022/cngx-common.mjs.map +1 -1
- package/interactive/README.md +30 -19
- package/layout/README.md +17 -1
- package/menu-button/README.md +234 -0
- package/package.json +31 -8
- package/popover/README.md +81 -4
- package/popover/tooltip-indicator.scss +52 -0
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +9 -0
- package/schematics/ng-add/schema.json +96 -0
- package/schematics/package.json +3 -0
- package/stepper/README.md +5 -5
- package/theming/components/cngx-accordion.css +36 -7
- package/theming/components/cngx-async.css +185 -37
- package/theming/components/cngx-backdrop.css +3 -1
- package/theming/components/cngx-badge.css +20 -5
- package/theming/components/cngx-bottom-sheet.css +2 -0
- package/theming/components/cngx-breadcrumb.css +3 -1
- package/theming/components/cngx-button-group.css +325 -0
- package/theming/components/cngx-button-toggle.css +55 -23
- package/theming/components/cngx-button.css +975 -0
- package/theming/components/cngx-data-grid.css +2 -0
- package/theming/components/cngx-dialog.css +3 -1
- package/theming/components/cngx-divider.css +24 -9
- package/theming/components/cngx-drawer.css +153 -0
- package/theming/components/cngx-icon-glyph.css +76 -0
- package/theming/components/cngx-listbox.css +79 -25
- package/theming/components/cngx-menu.css +112 -52
- package/theming/components/cngx-nav.css +1220 -0
- package/theming/components/cngx-popover-sheet.css +434 -0
- package/theming/components/cngx-popover.css +37 -9
- package/theming/components/cngx-recycler-placeholder.css +2 -0
- package/theming/components/cngx-ripple.css +74 -16
- package/theming/components/cngx-sidebar.css +71 -0
- package/theming/components/cngx-slider.css +3 -1
- package/theming/components/cngx-tooltip.css +2 -0
- package/timeline/README.md +2 -2
- package/types/cngx-common-a11y.d.ts +488 -112
- package/types/cngx-common-audio.d.ts +60 -88
- package/types/cngx-common-button.d.ts +698 -0
- package/types/cngx-common-card.d.ts +104 -78
- package/types/cngx-common-chart.d.ts +677 -389
- package/types/cngx-common-command.d.ts +55 -41
- package/types/cngx-common-data.d.ts +506 -360
- package/types/cngx-common-dialog.d.ts +94 -127
- package/types/cngx-common-display.d.ts +475 -300
- package/types/cngx-common-interactive.d.ts +4383 -1721
- package/types/cngx-common-layout.d.ts +1399 -288
- package/types/cngx-common-menu-button.d.ts +382 -0
- package/types/cngx-common-popover.d.ts +990 -268
- package/types/cngx-common-stepper.d.ts +374 -465
- package/types/cngx-common-tabs.d.ts +309 -403
- package/types/cngx-common-timeline.d.ts +50 -109
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, ViewEncapsulation, ChangeDetectionStrategy, Component, InjectionToken, inject, computed, Directive, linkedSignal, ElementRef, contentChildren, afterRenderEffect, Renderer2, effect, DestroyRef, output, booleanAttribute,
|
|
2
|
+
import { input, ViewEncapsulation, ChangeDetectionStrategy, Component, RendererStyleFlags2, InjectionToken, inject, computed, Directive, linkedSignal, ElementRef, contentChildren, afterRenderEffect, Renderer2, effect, DestroyRef, output, booleanAttribute, afterNextRender, makeEnvironmentProviders, TemplateRef, contentChild, untracked } from '@angular/core';
|
|
3
3
|
import { formatMessage, createNestedLanguageSection, createSectionBundle } from '@cngx/core/i18n';
|
|
4
4
|
import { createOverrideMerge, injectLocale, numberFormatterFor, nextUid, memoize, dateTimeFormatterFor } from '@cngx/core/utils';
|
|
5
|
+
import { CNGX_ICON_X, CNGX_ICON_QUESTION, CNGX_ICON_INFO, CNGX_ICON_EXCLAMATION_SOLID, CNGX_ICON_CHECK, cngxDevWarn, CNGX_ICON_MINUS } from '@cngx/utils';
|
|
5
6
|
import { NgTemplateOutlet } from '@angular/common';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -11,28 +12,27 @@ import { NgTemplateOutlet } from '@angular/common';
|
|
|
11
12
|
* Decorative by default (`aria-hidden="true"`); set `label` to make it
|
|
12
13
|
* informative (`role="img"`, `aria-label`).
|
|
13
14
|
*
|
|
14
|
-
* @category common/display
|
|
15
|
-
* @docsKind primary
|
|
16
15
|
* @wcag AA
|
|
17
16
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/icon/icon.component.ts
|
|
18
17
|
* @selector cngx-icon
|
|
19
|
-
* @since 0.
|
|
18
|
+
* @since 0.3.0
|
|
20
19
|
* @relatedTo CngxAvatar, CngxBadge, CngxChip
|
|
21
|
-
* <example-url
|
|
22
|
-
* <example-url
|
|
23
|
-
* <example-url
|
|
24
|
-
* <example-url
|
|
25
|
-
* <example-url
|
|
26
|
-
* <example-url
|
|
27
|
-
* <example-url
|
|
28
|
-
* <example-url
|
|
29
|
-
* <example-url
|
|
30
|
-
* <example-url
|
|
31
|
-
* <example-url
|
|
32
|
-
* <example-url
|
|
33
|
-
* <example-url
|
|
34
|
-
* <example-url
|
|
35
|
-
* <example-url
|
|
20
|
+
* <example-url>/#/common/display/icon/decorative-vs-informative</example-url>
|
|
21
|
+
* <example-url>/#/common/display/icon/sizes</example-url>
|
|
22
|
+
* <example-url>/#/common/display/tag/app-wide-defaults-via-providetagconfig</example-url>
|
|
23
|
+
* <example-url>/#/common/display/tag/color-palette</example-url>
|
|
24
|
+
* <example-url>/#/common/display/tag/composition-with-cngxicon</example-url>
|
|
25
|
+
* <example-url>/#/common/display/tag/density</example-url>
|
|
26
|
+
* <example-url>/#/common/display/tag/group-semantic-list</example-url>
|
|
27
|
+
* <example-url>/#/common/display/tag/group-with-header-accessory</example-url>
|
|
28
|
+
* <example-url>/#/common/display/tag/layout-only-alignment</example-url>
|
|
29
|
+
* <example-url>/#/common/display/tag/layout-only-gap-variants</example-url>
|
|
30
|
+
* <example-url>/#/common/display/tag/link-mode</example-url>
|
|
31
|
+
* <example-url>/#/common/display/tag/slot-overrides-custom-label</example-url>
|
|
32
|
+
* <example-url>/#/common/display/tag/slot-overrides-prefix-label-suffix</example-url>
|
|
33
|
+
* <example-url>/#/common/display/tag/truncate-maxwidth</example-url>
|
|
34
|
+
* <example-url>/#/common/display/tag/variant-matrix</example-url>
|
|
35
|
+
* @axis level atom
|
|
36
36
|
*/
|
|
37
37
|
class CngxIcon {
|
|
38
38
|
/** Accessible label. When set, the icon is treated as informative content. */
|
|
@@ -40,7 +40,7 @@ class CngxIcon {
|
|
|
40
40
|
/** Size preset. Maps to CSS custom properties on the host. */
|
|
41
41
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
42
42
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxIcon, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
43
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.4", type: CngxIcon, isStandalone: true, selector: "cngx-icon, [cngxIcon]", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.role": "label() ? \"img\" : null", "attr.aria-label": "label() ?? null", "attr.aria-hidden": "label() ? null : \"true\"", "class.cngx-icon--xs": "size() === \"xs\"", "class.cngx-icon--sm": "size() === \"sm\"", "class.cngx-icon--md": "size() === \"md\"", "class.cngx-icon--lg": "size() === \"lg\"", "class.cngx-icon--xl": "size() === \"xl\"" }, classAttribute: "cngx-icon" }, exportAs: ["cngxIcon"], ngImport: i0, template: '<ng-content />', isInline: true, styles: ["@layer cngx.tokens{@property --cngx-icon-
|
|
43
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.4", type: CngxIcon, isStandalone: true, selector: "cngx-icon, [cngxIcon]", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.role": "label() ? \"img\" : null", "attr.aria-label": "label() ?? null", "attr.aria-hidden": "label() ? null : \"true\"", "class.cngx-icon--xs": "size() === \"xs\"", "class.cngx-icon--sm": "size() === \"sm\"", "class.cngx-icon--md": "size() === \"md\"", "class.cngx-icon--lg": "size() === \"lg\"", "class.cngx-icon--xl": "size() === \"xl\"" }, classAttribute: "cngx-icon" }, exportAs: ["cngxIcon"], ngImport: i0, template: '<ng-content />', isInline: true, styles: ["@layer cngx.tokens{@property --cngx-icon-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}:root{--cngx-icon-size-xs: max(.75em, 12px);--cngx-icon-stroke-width-xs: 2.5;--cngx-icon-size-sm: 1em;--cngx-icon-size-md: 1.25em;--cngx-icon-size-lg: 1.5em;--cngx-icon-size-xl: 2em}}@layer cngx.components{@scope(.cngx-icon){:scope{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;line-height:1;flex:0 0 auto;--cngx-icon-size: var(--cngx-icon-size-md, 1.25em);font-size:round(nearest,var(--cngx-icon-size, 1.25em),1px);color:var(--cngx-icon-color, currentColor)}:scope:where(.cngx-icon--xs){--cngx-icon-size: var(--cngx-icon-size-xs, max(.75em, 12px));--cngx-icon-svg-stroke-width: var(--cngx-icon-stroke-width-xs, 2.5)}:scope:where(.cngx-icon--sm){--cngx-icon-size: var(--cngx-icon-size-sm, 1em)}:scope:where(.cngx-icon--lg){--cngx-icon-size: var(--cngx-icon-size-lg, 1.5em)}:scope:where(.cngx-icon--xl){--cngx-icon-size: var(--cngx-icon-size-xl, 2em)}:scope>svg{width:1em;height:1em;display:block}:scope>svg:not([fill]){fill:currentColor}}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
44
44
|
}
|
|
45
45
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxIcon, decorators: [{
|
|
46
46
|
type: Component,
|
|
@@ -54,15 +54,215 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
54
54
|
'[class.cngx-icon--md]': 'size() === "md"',
|
|
55
55
|
'[class.cngx-icon--lg]': 'size() === "lg"',
|
|
56
56
|
'[class.cngx-icon--xl]': 'size() === "xl"',
|
|
57
|
-
}, styles: ["@layer cngx.tokens{@property --cngx-icon-
|
|
57
|
+
}, styles: ["@layer cngx.tokens{@property --cngx-icon-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}:root{--cngx-icon-size-xs: max(.75em, 12px);--cngx-icon-stroke-width-xs: 2.5;--cngx-icon-size-sm: 1em;--cngx-icon-size-md: 1.25em;--cngx-icon-size-lg: 1.5em;--cngx-icon-size-xl: 2em}}@layer cngx.components{@scope(.cngx-icon){:scope{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;line-height:1;flex:0 0 auto;--cngx-icon-size: var(--cngx-icon-size-md, 1.25em);font-size:round(nearest,var(--cngx-icon-size, 1.25em),1px);color:var(--cngx-icon-color, currentColor)}:scope:where(.cngx-icon--xs){--cngx-icon-size: var(--cngx-icon-size-xs, max(.75em, 12px));--cngx-icon-svg-stroke-width: var(--cngx-icon-stroke-width-xs, 2.5)}:scope:where(.cngx-icon--sm){--cngx-icon-size: var(--cngx-icon-size-sm, 1em)}:scope:where(.cngx-icon--lg){--cngx-icon-size: var(--cngx-icon-size-lg, 1.5em)}:scope:where(.cngx-icon--xl){--cngx-icon-size: var(--cngx-icon-size-xl, 2em)}:scope>svg{width:1em;height:1em;display:block}:scope>svg:not([fill]){fill:currentColor}}}\n"] }]
|
|
58
58
|
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Draws one default cngx glyph from its `CngxIconData` onto the host
|
|
62
|
+
* `<svg>`. Decorative only (`aria-hidden`, `focusable="false"`): the
|
|
63
|
+
* meaning lives in the owning component's ARIA, never in the glyph.
|
|
64
|
+
*
|
|
65
|
+
* Sizes to `1em` and paints in `currentColor`, so it follows the text it
|
|
66
|
+
* sits in. Works standalone in a glyph span or projected into
|
|
67
|
+
* `<cngx-icon>`, which then owns the box. A stroke icon binds
|
|
68
|
+
* `fill="none"` because `<cngx-icon>` fills every svg without a `fill`
|
|
69
|
+
* attribute.
|
|
70
|
+
*
|
|
71
|
+
* An icon with a 12-grid `micro` drawing gets a second path,
|
|
72
|
+
* `.cngx-icon-svg__micro`, scaled onto the shared 24 viewBox, and a 16-grid
|
|
73
|
+
* `small` drawing a third, `.cngx-icon-svg__small`. Both carry
|
|
74
|
+
* `display="none"`, `fill="currentColor"` and `stroke="none"` as
|
|
75
|
+
* presentation attributes, so without `cngx.css` the 24-grid path shows
|
|
76
|
+
* alone. With `cngx.css` loaded, the `.cngx-icon-glyph` container rules show
|
|
77
|
+
* the micro path in a 10 to 14px box and the small path in a 15 to 19px box,
|
|
78
|
+
* each instead of the 24-grid path. DOM order is always 24 path, micro, small.
|
|
79
|
+
*
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
82
|
+
class CngxIconSvg {
|
|
83
|
+
/** Path data of the glyph to draw. */
|
|
84
|
+
icon = input.required({ ...(ngDevMode ? { debugName: "icon" } : /* istanbul ignore next */ {}), alias: 'cngxIconSvg' });
|
|
85
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxIconSvg, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
86
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxIconSvg, isStandalone: true, selector: "svg[cngxIconSvg]", inputs: { icon: { classPropertyName: "icon", publicName: "cngxIconSvg", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "aria-hidden": "true", "focusable": "false" }, properties: { "attr.viewBox": "icon().viewBox", "attr.fill": "icon().paint === \"stroke\" ? \"none\" : null", "class.cngx-icon-svg--stroke": "icon().paint === \"stroke\"" }, classAttribute: "cngx-icon-svg cngx-icon-glyph" }, ngImport: i0, template: `
|
|
87
|
+
<svg:path class="cngx-icon-svg__path" [attr.d]="icon().d" />
|
|
88
|
+
@if (icon().micro; as micro) {
|
|
89
|
+
<svg:path
|
|
90
|
+
class="cngx-icon-svg__micro"
|
|
91
|
+
transform="scale(2)"
|
|
92
|
+
fill="currentColor"
|
|
93
|
+
stroke="none"
|
|
94
|
+
display="none"
|
|
95
|
+
[attr.d]="micro.d"
|
|
96
|
+
/>
|
|
97
|
+
}
|
|
98
|
+
@if (icon().small; as small) {
|
|
99
|
+
<svg:path
|
|
100
|
+
class="cngx-icon-svg__small"
|
|
101
|
+
transform="scale(1.5)"
|
|
102
|
+
fill="currentColor"
|
|
103
|
+
stroke="none"
|
|
104
|
+
display="none"
|
|
105
|
+
[attr.d]="small.d"
|
|
106
|
+
/>
|
|
107
|
+
}
|
|
108
|
+
`, isInline: true, styles: ["@layer cngx.tokens{:root{--cngx-icon-svg-size: 1em;--cngx-icon-svg-micro-floor: .75rem;--cngx-icon-svg-stroke-width: 2}}@layer cngx.components{@scope(.cngx-icon-svg){:scope{display:inline-block;flex:none;vertical-align:middle;overflow:visible;fill:currentColor;inline-size:round(nearest,var(--cngx-icon-svg-size, 1em),1px);block-size:round(nearest,var(--cngx-icon-svg-size, 1em),1px)}:scope.cngx-icon-svg--stroke{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:var(--cngx-icon-svg-stroke-width, 2)}}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
109
|
+
}
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxIconSvg, decorators: [{
|
|
111
|
+
type: Component,
|
|
112
|
+
args: [{ selector: 'svg[cngxIconSvg]', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: `
|
|
113
|
+
<svg:path class="cngx-icon-svg__path" [attr.d]="icon().d" />
|
|
114
|
+
@if (icon().micro; as micro) {
|
|
115
|
+
<svg:path
|
|
116
|
+
class="cngx-icon-svg__micro"
|
|
117
|
+
transform="scale(2)"
|
|
118
|
+
fill="currentColor"
|
|
119
|
+
stroke="none"
|
|
120
|
+
display="none"
|
|
121
|
+
[attr.d]="micro.d"
|
|
122
|
+
/>
|
|
123
|
+
}
|
|
124
|
+
@if (icon().small; as small) {
|
|
125
|
+
<svg:path
|
|
126
|
+
class="cngx-icon-svg__small"
|
|
127
|
+
transform="scale(1.5)"
|
|
128
|
+
fill="currentColor"
|
|
129
|
+
stroke="none"
|
|
130
|
+
display="none"
|
|
131
|
+
[attr.d]="small.d"
|
|
132
|
+
/>
|
|
133
|
+
}
|
|
134
|
+
`, host: {
|
|
135
|
+
class: 'cngx-icon-svg cngx-icon-glyph',
|
|
136
|
+
'aria-hidden': 'true',
|
|
137
|
+
focusable: 'false',
|
|
138
|
+
'[attr.viewBox]': 'icon().viewBox',
|
|
139
|
+
'[attr.fill]': 'icon().paint === "stroke" ? "none" : null',
|
|
140
|
+
'[class.cngx-icon-svg--stroke]': 'icon().paint === "stroke"',
|
|
141
|
+
}, styles: ["@layer cngx.tokens{:root{--cngx-icon-svg-size: 1em;--cngx-icon-svg-micro-floor: .75rem;--cngx-icon-svg-stroke-width: 2}}@layer cngx.components{@scope(.cngx-icon-svg){:scope{display:inline-block;flex:none;vertical-align:middle;overflow:visible;fill:currentColor;inline-size:round(nearest,var(--cngx-icon-svg-size, 1em),1px);block-size:round(nearest,var(--cngx-icon-svg-size, 1em),1px)}:scope.cngx-icon-svg--stroke{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:var(--cngx-icon-svg-stroke-width, 2)}}}\n"] }]
|
|
142
|
+
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "cngxIconSvg", required: true }] }] } });
|
|
143
|
+
|
|
144
|
+
// Whole pixels, as in `icon-svg.component.css`.
|
|
145
|
+
const ICON_BOX_SIZE = 'round(nearest, var(--cngx-icon-svg-size, 1em), 1px)';
|
|
146
|
+
/**
|
|
147
|
+
* Imperative twin of `CngxIconSvg` for DOM a directive inserts into
|
|
148
|
+
* consumer-projected content, where no component instance can render.
|
|
149
|
+
*
|
|
150
|
+
* The glyph is legible without any stylesheet: paint travels as SVG
|
|
151
|
+
* presentation attributes (`fill` / `stroke`, round caps and joins), so
|
|
152
|
+
* any class rule of the owning surface still wins over them, and the box
|
|
153
|
+
* and stroke width read `--cngx-icon-svg-size` (rounded to whole
|
|
154
|
+
* pixels) and `--cngx-icon-svg-stroke-width` through inline styles, so a
|
|
155
|
+
* surface sizes it by setting those tokens. `className` is the surface's own
|
|
156
|
+
* hook; a stroke icon adds `<className>--stroke`. The svg also carries the
|
|
157
|
+
* shared `cngx-icon-glyph` class and its 24-grid path `cngx-icon-svg__path`.
|
|
158
|
+
*
|
|
159
|
+
* An icon with a 12-grid `micro` drawing gets a second path,
|
|
160
|
+
* `cngx-icon-svg__micro`, scaled onto the 24 viewBox and hidden, and a
|
|
161
|
+
* 16-grid `small` drawing a third, `cngx-icon-svg__small`; both are filled and
|
|
162
|
+
* unstroked by presentation attributes. DOM order is always 24 path, micro,
|
|
163
|
+
* small - a micro added to an svg that already has a small path is inserted
|
|
164
|
+
* before it. Bare, the 24-grid path shows alone; with `cngx.css` loaded, the
|
|
165
|
+
* `.cngx-icon-glyph` container rules show the micro path in a 10 to 14px box
|
|
166
|
+
* and the small path in a 15 to 19px box.
|
|
167
|
+
*
|
|
168
|
+
* Decorative only (`aria-hidden`, `focusable="false"`).
|
|
169
|
+
*
|
|
170
|
+
* @internal
|
|
171
|
+
*/
|
|
172
|
+
function createIconSvgElement(renderer, icon, className) {
|
|
173
|
+
const svg = renderer.createElement('svg', 'svg');
|
|
174
|
+
renderer.addClass(svg, className);
|
|
175
|
+
renderer.addClass(svg, 'cngx-icon-glyph');
|
|
176
|
+
renderer.setAttribute(svg, 'aria-hidden', 'true');
|
|
177
|
+
renderer.setAttribute(svg, 'focusable', 'false');
|
|
178
|
+
renderer.setAttribute(svg, 'overflow', 'visible');
|
|
179
|
+
setTokenStyle(renderer, svg, 'inline-size', ICON_BOX_SIZE);
|
|
180
|
+
setTokenStyle(renderer, svg, 'block-size', ICON_BOX_SIZE);
|
|
181
|
+
const path = renderer.createElement('path', 'svg');
|
|
182
|
+
renderer.addClass(path, 'cngx-icon-svg__path');
|
|
183
|
+
renderer.appendChild(svg, path);
|
|
184
|
+
let micro = null;
|
|
185
|
+
let small = null;
|
|
186
|
+
const setSmall = (d) => {
|
|
187
|
+
if (d === undefined) {
|
|
188
|
+
if (small) {
|
|
189
|
+
renderer.removeChild(svg, small);
|
|
190
|
+
small = null;
|
|
191
|
+
}
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
small ??= createSmallPath(renderer, svg);
|
|
195
|
+
renderer.setAttribute(small, 'd', d);
|
|
196
|
+
};
|
|
197
|
+
const setMicro = (d) => {
|
|
198
|
+
if (d === undefined) {
|
|
199
|
+
if (micro) {
|
|
200
|
+
renderer.removeChild(svg, micro);
|
|
201
|
+
micro = null;
|
|
202
|
+
}
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
// Pinned DOM order is 24 path, micro, small: a micro created while a small
|
|
206
|
+
// path already exists is inserted before it, never appended after it.
|
|
207
|
+
micro ??= createMicroPath(renderer, svg, small);
|
|
208
|
+
renderer.setAttribute(micro, 'd', d);
|
|
209
|
+
};
|
|
210
|
+
const strokeClassName = `${className}--stroke`;
|
|
211
|
+
const setIcon = (next) => {
|
|
212
|
+
renderer.setAttribute(svg, 'viewBox', next.viewBox);
|
|
213
|
+
renderer.setAttribute(path, 'd', next.d);
|
|
214
|
+
setMicro(next.micro?.d);
|
|
215
|
+
setSmall(next.small?.d);
|
|
216
|
+
if (next.paint === 'stroke') {
|
|
217
|
+
renderer.addClass(svg, strokeClassName);
|
|
218
|
+
renderer.setAttribute(svg, 'fill', 'none');
|
|
219
|
+
renderer.setAttribute(svg, 'stroke', 'currentColor');
|
|
220
|
+
renderer.setAttribute(svg, 'stroke-linecap', 'round');
|
|
221
|
+
renderer.setAttribute(svg, 'stroke-linejoin', 'round');
|
|
222
|
+
setTokenStyle(renderer, svg, 'stroke-width', 'var(--cngx-icon-svg-stroke-width, 2)');
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
renderer.removeClass(svg, strokeClassName);
|
|
226
|
+
renderer.setAttribute(svg, 'fill', 'currentColor');
|
|
227
|
+
renderer.removeAttribute(svg, 'stroke');
|
|
228
|
+
renderer.removeAttribute(svg, 'stroke-linecap');
|
|
229
|
+
renderer.removeAttribute(svg, 'stroke-linejoin');
|
|
230
|
+
renderer.removeStyle(svg, 'stroke-width', RendererStyleFlags2.DashCase);
|
|
231
|
+
};
|
|
232
|
+
setIcon(icon);
|
|
233
|
+
return { element: svg, setIcon };
|
|
234
|
+
}
|
|
235
|
+
function createMicroPath(renderer, svg, before) {
|
|
236
|
+
const micro = renderer.createElement('path', 'svg');
|
|
237
|
+
renderer.addClass(micro, 'cngx-icon-svg__micro');
|
|
238
|
+
renderer.setAttribute(micro, 'transform', 'scale(2)');
|
|
239
|
+
renderer.setAttribute(micro, 'fill', 'currentColor');
|
|
240
|
+
renderer.setAttribute(micro, 'stroke', 'none');
|
|
241
|
+
renderer.setAttribute(micro, 'display', 'none');
|
|
242
|
+
// `before` is the small path when one exists (null appends), keeping the
|
|
243
|
+
// 24 path, micro, small order.
|
|
244
|
+
renderer.insertBefore(svg, micro, before);
|
|
245
|
+
return micro;
|
|
246
|
+
}
|
|
247
|
+
function createSmallPath(renderer, svg) {
|
|
248
|
+
const small = renderer.createElement('path', 'svg');
|
|
249
|
+
renderer.addClass(small, 'cngx-icon-svg__small');
|
|
250
|
+
renderer.setAttribute(small, 'transform', 'scale(1.5)');
|
|
251
|
+
renderer.setAttribute(small, 'fill', 'currentColor');
|
|
252
|
+
renderer.setAttribute(small, 'stroke', 'none');
|
|
253
|
+
renderer.setAttribute(small, 'display', 'none');
|
|
254
|
+
renderer.appendChild(svg, small);
|
|
255
|
+
return small;
|
|
256
|
+
}
|
|
257
|
+
function setTokenStyle(renderer, el, property, value) {
|
|
258
|
+
renderer.setStyle(el, property, value, RendererStyleFlags2.DashCase);
|
|
259
|
+
}
|
|
260
|
+
|
|
60
261
|
/**
|
|
61
262
|
* The English display section: the single source of the display atoms'
|
|
62
263
|
* English copy. `CNGX_DISPLAY_I18N` defaults to it.
|
|
63
264
|
*
|
|
64
|
-
* @
|
|
65
|
-
* @since 0.1.0
|
|
265
|
+
* @since 0.3.0
|
|
66
266
|
* @relatedTo CNGX_DISPLAY_I18N
|
|
67
267
|
*/
|
|
68
268
|
const CNGX_DISPLAY_LANGUAGE_EN = {
|
|
@@ -119,30 +319,24 @@ const displayBundle = createSectionBundle({
|
|
|
119
319
|
* for the app locale; the value is a `Signal`, shared by every reader under
|
|
120
320
|
* one injector.
|
|
121
321
|
*
|
|
122
|
-
* @category common/display/i18n
|
|
123
322
|
* @wcag AA
|
|
124
323
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/i18n/display-i18n.ts
|
|
125
|
-
* @since 0.
|
|
324
|
+
* @since 0.3.0
|
|
126
325
|
* @relatedTo CngxAvatar, CngxAvatarGroup, CngxSegmentedProgress, CngxChip
|
|
127
326
|
*/
|
|
128
327
|
const CNGX_DISPLAY_I18N = new InjectionToken('CngxDisplayI18n', {
|
|
129
328
|
providedIn: 'root',
|
|
130
329
|
factory: () => displayBundle.build(),
|
|
131
330
|
});
|
|
132
|
-
/** @internal */
|
|
133
|
-
function defineDisplayI18nFeature(fn) {
|
|
134
|
-
return Object.assign(fn, { _target: 'i18n' });
|
|
135
|
-
}
|
|
136
331
|
/**
|
|
137
332
|
* Override display labels via a partial bundle - unset keys keep the
|
|
138
333
|
* language pack's copy, or the English default. Pass a `Signal` of a partial
|
|
139
334
|
* bundle to switch languages at runtime.
|
|
140
335
|
*
|
|
141
|
-
* @
|
|
142
|
-
* @since 0.1.0
|
|
336
|
+
* @since 0.3.0
|
|
143
337
|
*/
|
|
144
338
|
function withDisplayI18nLabels(overrides) {
|
|
145
|
-
return
|
|
339
|
+
return (bundle) => createOverrideMerge(bundle, overrides);
|
|
146
340
|
}
|
|
147
341
|
/**
|
|
148
342
|
* Provider for the display i18n bundle. Returns a plain `Provider`, so it also
|
|
@@ -162,8 +356,7 @@ function withDisplayI18nLabels(overrides) {
|
|
|
162
356
|
* });
|
|
163
357
|
* ```
|
|
164
358
|
*
|
|
165
|
-
* @
|
|
166
|
-
* @since 0.1.0
|
|
359
|
+
* @since 0.3.0
|
|
167
360
|
*/
|
|
168
361
|
function provideDisplayI18n(...features) {
|
|
169
362
|
return {
|
|
@@ -175,8 +368,7 @@ function provideDisplayI18n(...features) {
|
|
|
175
368
|
* Inject the resolved display i18n bundle signal. Read it inside a
|
|
176
369
|
* `computed()` or template so a runtime override flip re-derives.
|
|
177
370
|
*
|
|
178
|
-
* @
|
|
179
|
-
* @since 0.1.0
|
|
371
|
+
* @since 0.3.0
|
|
180
372
|
*/
|
|
181
373
|
function injectDisplayI18n() {
|
|
182
374
|
return displayBundle.resolve(inject(CNGX_DISPLAY_I18N));
|
|
@@ -200,15 +392,14 @@ const segmentsEqual = (a, b) => a.length === b.length && a.every((s, i) => s ===
|
|
|
200
392
|
* <cngx-segmented-progress [segments]="['done', 'error', 'active', 'todo']" />
|
|
201
393
|
* ```
|
|
202
394
|
*
|
|
203
|
-
* @category common/display
|
|
204
|
-
* @docsKind primary
|
|
205
395
|
* @wcag AA
|
|
206
396
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/segmented-progress/segmented-progress.component.ts
|
|
207
|
-
* @since 0.
|
|
397
|
+
* @since 0.3.0
|
|
208
398
|
* @relatedTo CngxStepper, CngxBadge
|
|
209
|
-
* <example-url
|
|
210
|
-
* <example-url
|
|
211
|
-
* <example-url
|
|
399
|
+
* <example-url>/#/common/display/segmented-progress/value-total</example-url>
|
|
400
|
+
* <example-url>/#/common/display/segmented-progress/lightbox-position</example-url>
|
|
401
|
+
* <example-url>/#/common/display/segmented-progress/error-segment</example-url>
|
|
402
|
+
* @axis level atom
|
|
212
403
|
*/
|
|
213
404
|
class CngxSegmentedProgress {
|
|
214
405
|
i18n = injectDisplayI18n();
|
|
@@ -295,14 +486,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
295
486
|
* `--cngx-divider-inset`). Consumers apply their own styles through
|
|
296
487
|
* `.cngx-divider` or override the variables.
|
|
297
488
|
*
|
|
298
|
-
* @category common/display
|
|
299
|
-
* @docsKind primary
|
|
300
489
|
* @wcag AA
|
|
301
490
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/divider/divider.directive.ts
|
|
302
491
|
* @selector cngx-divider
|
|
303
|
-
* @since 0.
|
|
304
|
-
* <example-url
|
|
305
|
-
* <example-url
|
|
492
|
+
* @since 0.3.0
|
|
493
|
+
* <example-url>/#/common/display/divider/horizontal-vs-vertical</example-url>
|
|
494
|
+
* <example-url>/#/common/display/divider/inset</example-url>
|
|
495
|
+
* @axis level atom
|
|
306
496
|
*/
|
|
307
497
|
class CngxDivider {
|
|
308
498
|
/** Layout axis. Horizontal dividers sit between rows; vertical between columns. */
|
|
@@ -339,15 +529,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
339
529
|
* Optional status indicator dot via `status`. Size and shape driven by
|
|
340
530
|
* CSS custom properties.
|
|
341
531
|
*
|
|
342
|
-
* @category common/display
|
|
343
|
-
* @docsKind primary
|
|
344
532
|
* @wcag AA
|
|
345
533
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/avatar/avatar.component.ts
|
|
346
|
-
* @since 0.
|
|
534
|
+
* @since 0.3.0
|
|
347
535
|
* @relatedTo CngxIcon, CngxBadge, CngxChip
|
|
348
|
-
* <example-url
|
|
349
|
-
* <example-url
|
|
350
|
-
* <example-url
|
|
536
|
+
* <example-url>/#/common/display/avatar/cascade-image-initials-fallback</example-url>
|
|
537
|
+
* <example-url>/#/common/display/avatar/shapes-and-status</example-url>
|
|
538
|
+
* <example-url>/#/common/display/avatar/sizes</example-url>
|
|
539
|
+
* @axis level atom
|
|
351
540
|
*/
|
|
352
541
|
class CngxAvatar {
|
|
353
542
|
i18n = injectDisplayI18n();
|
|
@@ -424,7 +613,7 @@ class CngxAvatar {
|
|
|
424
613
|
[attr.aria-label]="statusAriaLabel()"
|
|
425
614
|
></span>
|
|
426
615
|
}
|
|
427
|
-
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-avatar-size{syntax: \"*\"; inherits: false; initial-value: 2.5rem;}@property --cngx-avatar-font-size{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-avatar-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.92 .01 240);}@property --cngx-avatar-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.28 0 0);}@property --cngx-avatar-circle-radius{syntax: \"<length>\"; inherits: false; initial-value: 999px;}@property --cngx-avatar-square-radius{syntax: \"<length>\"; inherits: false; initial-value: 6px;}@property --cngx-avatar-size-xs{syntax: \"*\"; inherits: false; initial-value: 1.5rem;}@property --cngx-avatar-size-sm{syntax: \"*\"; inherits: false; initial-value: 2rem;}@property --cngx-avatar-size-md{syntax: \"*\"; inherits: false; initial-value: 2.5rem;}@property --cngx-avatar-size-lg{syntax: \"*\"; inherits: false; initial-value: 3rem;}@property --cngx-avatar-size-xl{syntax: \"*\"; inherits: false; initial-value: 4rem;}@property --cngx-avatar-font-size-xs{syntax: \"*\"; inherits: false; initial-value: .625rem;}@property --cngx-avatar-font-size-sm{syntax: \"*\"; inherits: false; initial-value: .75rem;}@property --cngx-avatar-font-size-md{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-avatar-font-size-lg{syntax: \"*\"; inherits: false; initial-value: 1.125rem;}@property --cngx-avatar-font-size-xl{syntax: \"*\"; inherits: false; initial-value: 1.5rem;}@property --cngx-avatar-status-size{syntax: \"*\"; inherits: false; initial-value: .65em;}@property --cngx-avatar-status-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-avatar-status-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 240);}@property --cngx-avatar-status-online{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .18 145);}@property --cngx-avatar-status-offline{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 240);}@property --cngx-avatar-status-busy{syntax: \"<color>\"; inherits: true; initial-value: oklch(.62 .22 25);}@property --cngx-avatar-status-away{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .18 70);}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-avatar-bg: oklch(.36 .01 250);--cngx-avatar-color: oklch(.92 .01 250);--cngx-avatar-status-border: oklch(.2 .01 250)}}[data-color-scheme=dark],.dark{--cngx-avatar-bg: oklch(.36 .01 250);--cngx-avatar-color: oklch(.92 .01 250);--cngx-avatar-status-border: oklch(.2 .01 250)}[data-color-scheme=light],.light{--cngx-avatar-bg: oklch(.92 .01 240);--cngx-avatar-color: oklch(.28 0 0);--cngx-avatar-status-border: oklch(1 0 0)}}@layer cngx.components{@scope(.cngx-avatar){:scope{display:inline-flex;align-items:center;justify-content:center;position:relative;flex:0 0 auto;-webkit-user-select:none;user-select:none;overflow:visible;line-height:1;font-weight:600;width:var(--cngx-avatar-size
|
|
616
|
+
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-avatar-size{syntax: \"*\"; inherits: false; initial-value: 2.5rem;}@property --cngx-avatar-font-size{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-avatar-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.92 .01 240);}@property --cngx-avatar-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.28 0 0);}@property --cngx-avatar-circle-radius{syntax: \"<length>\"; inherits: false; initial-value: 999px;}@property --cngx-avatar-square-radius{syntax: \"<length>\"; inherits: false; initial-value: 6px;}@property --cngx-avatar-size-xs{syntax: \"*\"; inherits: false; initial-value: 1.5rem;}@property --cngx-avatar-size-sm{syntax: \"*\"; inherits: false; initial-value: 2rem;}@property --cngx-avatar-size-md{syntax: \"*\"; inherits: false; initial-value: 2.5rem;}@property --cngx-avatar-size-lg{syntax: \"*\"; inherits: false; initial-value: 3rem;}@property --cngx-avatar-size-xl{syntax: \"*\"; inherits: false; initial-value: 4rem;}@property --cngx-avatar-font-size-xs{syntax: \"*\"; inherits: false; initial-value: .625rem;}@property --cngx-avatar-font-size-sm{syntax: \"*\"; inherits: false; initial-value: .75rem;}@property --cngx-avatar-font-size-md{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-avatar-font-size-lg{syntax: \"*\"; inherits: false; initial-value: 1.125rem;}@property --cngx-avatar-font-size-xl{syntax: \"*\"; inherits: false; initial-value: 1.5rem;}@property --cngx-avatar-status-size{syntax: \"*\"; inherits: false; initial-value: .65em;}@property --cngx-avatar-status-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-avatar-status-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 240);}@property --cngx-avatar-status-online{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .18 145);}@property --cngx-avatar-status-offline{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 240);}@property --cngx-avatar-status-busy{syntax: \"<color>\"; inherits: true; initial-value: oklch(.62 .22 25);}@property --cngx-avatar-status-away{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .18 70);}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-avatar-bg: oklch(.36 .01 250);--cngx-avatar-color: oklch(.92 .01 250);--cngx-avatar-status-border: oklch(.2 .01 250)}}[data-color-scheme=dark],.dark{--cngx-avatar-bg: oklch(.36 .01 250);--cngx-avatar-color: oklch(.92 .01 250);--cngx-avatar-status-border: oklch(.2 .01 250)}[data-color-scheme=light],.light{--cngx-avatar-bg: oklch(.92 .01 240);--cngx-avatar-color: oklch(.28 0 0);--cngx-avatar-status-border: oklch(1 0 0)}.cngx-avatar{--cngx-avatar-circle-radius: var(--cngx-radius-pill);--cngx-avatar-status-online: var(--cngx-color-success);--cngx-avatar-status-busy: var(--cngx-color-danger);--cngx-avatar-status-away: var(--cngx-color-warning)}}@layer cngx.components{@scope(.cngx-avatar){:scope{display:inline-flex;align-items:center;justify-content:center;position:relative;flex:0 0 auto;-webkit-user-select:none;user-select:none;overflow:visible;line-height:1;font-weight:600;width:var(--cngx-avatar-size);height:var(--cngx-avatar-size);font-size:var(--cngx-avatar-font-size);background:var(--cngx-avatar-bg);color:var(--cngx-avatar-color)}:scope.cngx-avatar--circle{border-radius:var(--cngx-avatar-circle-radius)}:scope.cngx-avatar--square{border-radius:var(--cngx-avatar-square-radius, 6px)}:scope.cngx-avatar--xs{--cngx-avatar-size: var(--cngx-avatar-size-xs, 1.5rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-xs, .625rem)}:scope.cngx-avatar--sm{--cngx-avatar-size: var(--cngx-avatar-size-sm, 2rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-sm, .75rem)}:scope.cngx-avatar--md{--cngx-avatar-size: var(--cngx-avatar-size-md, 2.5rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-md, 1rem)}:scope.cngx-avatar--lg{--cngx-avatar-size: var(--cngx-avatar-size-lg, 3rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-lg, 1.125rem)}:scope.cngx-avatar--xl{--cngx-avatar-size: var(--cngx-avatar-size-xl, 4rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-xl, 1.5rem)}.cngx-avatar__img{width:100%;height:100%;object-fit:cover;border-radius:inherit}.cngx-avatar__initials{text-transform:uppercase}.cngx-avatar__status{position:absolute;inset-inline-end:-2px;bottom:-2px;width:var(--cngx-avatar-status-size, .65em);height:var(--cngx-avatar-status-size, .65em);border-radius:var(--cngx-radius-pill, 999px);border:2px solid var(--cngx-avatar-status-border);background:var(--cngx-avatar-status-bg, oklch(.68 .01 240))}.cngx-avatar__status--online{background:var(--cngx-avatar-status-online)}.cngx-avatar__status--offline{background:var(--cngx-avatar-status-offline, oklch(.68 .01 240))}.cngx-avatar__status--busy{background:var(--cngx-avatar-status-busy)}.cngx-avatar__status--away{background:var(--cngx-avatar-status-away)}}}@media(forced-colors:active){.cngx-avatar{outline:1px solid CanvasText;outline-offset:-1px}.cngx-avatar .cngx-avatar__status{width:max(var(--cngx-avatar-status-size, .65em),.8em);height:max(var(--cngx-avatar-status-size, .65em),.8em);forced-color-adjust:none;border-color:Canvas;background:CanvasText}.cngx-avatar .cngx-avatar__status--offline{background:Canvas;box-shadow:inset 0 0 0 1.5px CanvasText}.cngx-avatar .cngx-avatar__status--away{background:linear-gradient(90deg,CanvasText 50%,Canvas 50%);box-shadow:inset 0 0 0 1.5px CanvasText}.cngx-avatar .cngx-avatar__status--busy{background:linear-gradient(Canvas 0 0) center / 60% 22% no-repeat,CanvasText}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
428
617
|
}
|
|
429
618
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxAvatar, decorators: [{
|
|
430
619
|
type: Component,
|
|
@@ -462,7 +651,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
462
651
|
[attr.aria-label]="statusAriaLabel()"
|
|
463
652
|
></span>
|
|
464
653
|
}
|
|
465
|
-
`, styles: ["@layer cngx.tokens{@property --cngx-avatar-size{syntax: \"*\"; inherits: false; initial-value: 2.5rem;}@property --cngx-avatar-font-size{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-avatar-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.92 .01 240);}@property --cngx-avatar-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.28 0 0);}@property --cngx-avatar-circle-radius{syntax: \"<length>\"; inherits: false; initial-value: 999px;}@property --cngx-avatar-square-radius{syntax: \"<length>\"; inherits: false; initial-value: 6px;}@property --cngx-avatar-size-xs{syntax: \"*\"; inherits: false; initial-value: 1.5rem;}@property --cngx-avatar-size-sm{syntax: \"*\"; inherits: false; initial-value: 2rem;}@property --cngx-avatar-size-md{syntax: \"*\"; inherits: false; initial-value: 2.5rem;}@property --cngx-avatar-size-lg{syntax: \"*\"; inherits: false; initial-value: 3rem;}@property --cngx-avatar-size-xl{syntax: \"*\"; inherits: false; initial-value: 4rem;}@property --cngx-avatar-font-size-xs{syntax: \"*\"; inherits: false; initial-value: .625rem;}@property --cngx-avatar-font-size-sm{syntax: \"*\"; inherits: false; initial-value: .75rem;}@property --cngx-avatar-font-size-md{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-avatar-font-size-lg{syntax: \"*\"; inherits: false; initial-value: 1.125rem;}@property --cngx-avatar-font-size-xl{syntax: \"*\"; inherits: false; initial-value: 1.5rem;}@property --cngx-avatar-status-size{syntax: \"*\"; inherits: false; initial-value: .65em;}@property --cngx-avatar-status-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-avatar-status-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 240);}@property --cngx-avatar-status-online{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .18 145);}@property --cngx-avatar-status-offline{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 240);}@property --cngx-avatar-status-busy{syntax: \"<color>\"; inherits: true; initial-value: oklch(.62 .22 25);}@property --cngx-avatar-status-away{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .18 70);}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-avatar-bg: oklch(.36 .01 250);--cngx-avatar-color: oklch(.92 .01 250);--cngx-avatar-status-border: oklch(.2 .01 250)}}[data-color-scheme=dark],.dark{--cngx-avatar-bg: oklch(.36 .01 250);--cngx-avatar-color: oklch(.92 .01 250);--cngx-avatar-status-border: oklch(.2 .01 250)}[data-color-scheme=light],.light{--cngx-avatar-bg: oklch(.92 .01 240);--cngx-avatar-color: oklch(.28 0 0);--cngx-avatar-status-border: oklch(1 0 0)}}@layer cngx.components{@scope(.cngx-avatar){:scope{display:inline-flex;align-items:center;justify-content:center;position:relative;flex:0 0 auto;-webkit-user-select:none;user-select:none;overflow:visible;line-height:1;font-weight:600;width:var(--cngx-avatar-size
|
|
654
|
+
`, styles: ["@layer cngx.tokens{@property --cngx-avatar-size{syntax: \"*\"; inherits: false; initial-value: 2.5rem;}@property --cngx-avatar-font-size{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-avatar-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.92 .01 240);}@property --cngx-avatar-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.28 0 0);}@property --cngx-avatar-circle-radius{syntax: \"<length>\"; inherits: false; initial-value: 999px;}@property --cngx-avatar-square-radius{syntax: \"<length>\"; inherits: false; initial-value: 6px;}@property --cngx-avatar-size-xs{syntax: \"*\"; inherits: false; initial-value: 1.5rem;}@property --cngx-avatar-size-sm{syntax: \"*\"; inherits: false; initial-value: 2rem;}@property --cngx-avatar-size-md{syntax: \"*\"; inherits: false; initial-value: 2.5rem;}@property --cngx-avatar-size-lg{syntax: \"*\"; inherits: false; initial-value: 3rem;}@property --cngx-avatar-size-xl{syntax: \"*\"; inherits: false; initial-value: 4rem;}@property --cngx-avatar-font-size-xs{syntax: \"*\"; inherits: false; initial-value: .625rem;}@property --cngx-avatar-font-size-sm{syntax: \"*\"; inherits: false; initial-value: .75rem;}@property --cngx-avatar-font-size-md{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-avatar-font-size-lg{syntax: \"*\"; inherits: false; initial-value: 1.125rem;}@property --cngx-avatar-font-size-xl{syntax: \"*\"; inherits: false; initial-value: 1.5rem;}@property --cngx-avatar-status-size{syntax: \"*\"; inherits: false; initial-value: .65em;}@property --cngx-avatar-status-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-avatar-status-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 240);}@property --cngx-avatar-status-online{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .18 145);}@property --cngx-avatar-status-offline{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 240);}@property --cngx-avatar-status-busy{syntax: \"<color>\"; inherits: true; initial-value: oklch(.62 .22 25);}@property --cngx-avatar-status-away{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .18 70);}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-avatar-bg: oklch(.36 .01 250);--cngx-avatar-color: oklch(.92 .01 250);--cngx-avatar-status-border: oklch(.2 .01 250)}}[data-color-scheme=dark],.dark{--cngx-avatar-bg: oklch(.36 .01 250);--cngx-avatar-color: oklch(.92 .01 250);--cngx-avatar-status-border: oklch(.2 .01 250)}[data-color-scheme=light],.light{--cngx-avatar-bg: oklch(.92 .01 240);--cngx-avatar-color: oklch(.28 0 0);--cngx-avatar-status-border: oklch(1 0 0)}.cngx-avatar{--cngx-avatar-circle-radius: var(--cngx-radius-pill);--cngx-avatar-status-online: var(--cngx-color-success);--cngx-avatar-status-busy: var(--cngx-color-danger);--cngx-avatar-status-away: var(--cngx-color-warning)}}@layer cngx.components{@scope(.cngx-avatar){:scope{display:inline-flex;align-items:center;justify-content:center;position:relative;flex:0 0 auto;-webkit-user-select:none;user-select:none;overflow:visible;line-height:1;font-weight:600;width:var(--cngx-avatar-size);height:var(--cngx-avatar-size);font-size:var(--cngx-avatar-font-size);background:var(--cngx-avatar-bg);color:var(--cngx-avatar-color)}:scope.cngx-avatar--circle{border-radius:var(--cngx-avatar-circle-radius)}:scope.cngx-avatar--square{border-radius:var(--cngx-avatar-square-radius, 6px)}:scope.cngx-avatar--xs{--cngx-avatar-size: var(--cngx-avatar-size-xs, 1.5rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-xs, .625rem)}:scope.cngx-avatar--sm{--cngx-avatar-size: var(--cngx-avatar-size-sm, 2rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-sm, .75rem)}:scope.cngx-avatar--md{--cngx-avatar-size: var(--cngx-avatar-size-md, 2.5rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-md, 1rem)}:scope.cngx-avatar--lg{--cngx-avatar-size: var(--cngx-avatar-size-lg, 3rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-lg, 1.125rem)}:scope.cngx-avatar--xl{--cngx-avatar-size: var(--cngx-avatar-size-xl, 4rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-xl, 1.5rem)}.cngx-avatar__img{width:100%;height:100%;object-fit:cover;border-radius:inherit}.cngx-avatar__initials{text-transform:uppercase}.cngx-avatar__status{position:absolute;inset-inline-end:-2px;bottom:-2px;width:var(--cngx-avatar-status-size, .65em);height:var(--cngx-avatar-status-size, .65em);border-radius:var(--cngx-radius-pill, 999px);border:2px solid var(--cngx-avatar-status-border);background:var(--cngx-avatar-status-bg, oklch(.68 .01 240))}.cngx-avatar__status--online{background:var(--cngx-avatar-status-online)}.cngx-avatar__status--offline{background:var(--cngx-avatar-status-offline, oklch(.68 .01 240))}.cngx-avatar__status--busy{background:var(--cngx-avatar-status-busy)}.cngx-avatar__status--away{background:var(--cngx-avatar-status-away)}}}@media(forced-colors:active){.cngx-avatar{outline:1px solid CanvasText;outline-offset:-1px}.cngx-avatar .cngx-avatar__status{width:max(var(--cngx-avatar-status-size, .65em),.8em);height:max(var(--cngx-avatar-status-size, .65em),.8em);forced-color-adjust:none;border-color:Canvas;background:CanvasText}.cngx-avatar .cngx-avatar__status--offline{background:Canvas;box-shadow:inset 0 0 0 1.5px CanvasText}.cngx-avatar .cngx-avatar__status--away{background:linear-gradient(90deg,CanvasText 50%,Canvas 50%);box-shadow:inset 0 0 0 1.5px CanvasText}.cngx-avatar .cngx-avatar__status--busy{background:linear-gradient(Canvas 0 0) center / 60% 22% no-repeat,CanvasText}}\n"] }]
|
|
466
655
|
}], propDecorators: { src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], initials: [{ type: i0.Input, args: [{ isSignal: true, alias: "initials", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], statusLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusLabel", required: false }] }] } });
|
|
467
656
|
|
|
468
657
|
/**
|
|
@@ -483,12 +672,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
483
672
|
* </cngx-avatar-group>
|
|
484
673
|
* ```
|
|
485
674
|
*
|
|
486
|
-
* @category common/display
|
|
487
|
-
* @docsKind primary
|
|
488
675
|
* @wcag AA
|
|
489
676
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/avatar-group/avatar-group.component.ts
|
|
490
|
-
* @since 0.
|
|
677
|
+
* @since 0.3.0
|
|
491
678
|
* @relatedTo CngxAvatar
|
|
679
|
+
* @axis level molecule
|
|
492
680
|
*/
|
|
493
681
|
class CngxAvatarGroup {
|
|
494
682
|
i18n = injectDisplayI18n();
|
|
@@ -597,15 +785,14 @@ const NUMBER_FORMAT = {};
|
|
|
597
785
|
* - String values (rendered verbatim)
|
|
598
786
|
* - Boolean `true` (dot mode, no text)
|
|
599
787
|
*
|
|
600
|
-
* @category common/display
|
|
601
|
-
* @docsKind primary
|
|
602
788
|
* @wcag AA
|
|
603
789
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/badge/badge.directive.ts
|
|
604
|
-
* @since 0.
|
|
790
|
+
* @since 0.3.0
|
|
605
791
|
* @relatedTo CngxAvatar, CngxIcon, CngxChip
|
|
606
|
-
* <example-url
|
|
607
|
-
* <example-url
|
|
608
|
-
* <example-url
|
|
792
|
+
* <example-url>/#/common/display/badge/colors-and-dot-mode</example-url>
|
|
793
|
+
* <example-url>/#/common/display/badge/counts-with-overflow</example-url>
|
|
794
|
+
* <example-url>/#/common/display/badge/inline-and-hidden</example-url>
|
|
795
|
+
* @axis level atom
|
|
609
796
|
*/
|
|
610
797
|
class CngxBadge {
|
|
611
798
|
/**
|
|
@@ -771,21 +958,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
771
958
|
* decides whether to write state directly or route through a commit
|
|
772
959
|
* flow. This keeps the chip usable from any level of the stack.
|
|
773
960
|
*
|
|
774
|
-
* @category common/display
|
|
775
|
-
* @docsKind primary
|
|
776
961
|
* @wcag AA
|
|
777
962
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/chip/chip.component.ts
|
|
778
|
-
* @since 0.
|
|
963
|
+
* @since 0.3.0
|
|
779
964
|
* @relatedTo CngxTag, CngxTagGroup, CngxBadge
|
|
780
|
-
* <example-url
|
|
781
|
-
* <example-url
|
|
782
|
-
* <example-url
|
|
783
|
-
* <example-url
|
|
784
|
-
* <example-url
|
|
785
|
-
* <example-url
|
|
786
|
-
* <example-url
|
|
787
|
-
* <example-url
|
|
788
|
-
* <example-url
|
|
965
|
+
* <example-url>/#/common/display/chip/basic</example-url>
|
|
966
|
+
* <example-url>/#/common/display/chip/removable</example-url>
|
|
967
|
+
* <example-url>/#/common/display/chip/color-palette</example-url>
|
|
968
|
+
* <example-url>/#/common/display/chip/custom-close-icon</example-url>
|
|
969
|
+
* <example-url>/#/common/interactive/chip/group/basic-pick-exactly-one-size</example-url>
|
|
970
|
+
* <example-url>/#/common/interactive/chip/interaction/basic-toggle-on-click-space-or-enter</example-url>
|
|
971
|
+
* <example-url>/#/common/interactive/chip/interaction/disabled-state</example-url>
|
|
972
|
+
* <example-url>/#/common/interactive/chip/interaction/removable-with-removerequest-on-backspace-delete</example-url>
|
|
973
|
+
* <example-url>/#/common/interactive/chip/multi-group/multi-select-chips-with-selection-count</example-url>
|
|
974
|
+
* @axis level atom
|
|
789
975
|
*/
|
|
790
976
|
class CngxChip {
|
|
791
977
|
i18n = injectDisplayI18n();
|
|
@@ -810,6 +996,8 @@ class CngxChip {
|
|
|
810
996
|
*/
|
|
811
997
|
removeAriaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "removeAriaLabel" }] : /* istanbul ignore next */ []));
|
|
812
998
|
resolvedRemoveAriaLabel = computed(() => this.removeAriaLabel() ?? this.i18n().chipRemove, ...(ngDevMode ? [{ debugName: "resolvedRemoveAriaLabel" }] : /* istanbul ignore next */ []));
|
|
999
|
+
/** @internal - default X glyph of the close button, from the shared icon set. */
|
|
1000
|
+
removeIcon = CNGX_ICON_X;
|
|
813
1001
|
/** Fires when the user clicks the close button. */
|
|
814
1002
|
remove = output();
|
|
815
1003
|
autoId = nextUid('cngx-chip');
|
|
@@ -833,7 +1021,7 @@ class CngxChip {
|
|
|
833
1021
|
>
|
|
834
1022
|
<!--
|
|
835
1023
|
Named content slot for the close glyph. Default renders the
|
|
836
|
-
|
|
1024
|
+
shared X icon - consumers project any icon component by tagging
|
|
837
1025
|
it with the attribute:
|
|
838
1026
|
|
|
839
1027
|
<cngx-chip [removable]="true">
|
|
@@ -846,15 +1034,15 @@ class CngxChip {
|
|
|
846
1034
|
the TemplateRef/outlet dance.
|
|
847
1035
|
-->
|
|
848
1036
|
<ng-content select="[cngxChipClose]">
|
|
849
|
-
<
|
|
1037
|
+
<svg class="cngx-chip__remove-icon" [cngxIconSvg]="removeIcon"></svg>
|
|
850
1038
|
</ng-content>
|
|
851
1039
|
</button>
|
|
852
1040
|
}
|
|
853
|
-
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-chip-inner-gap{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-chip-padding-block{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-padding-inline{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-chip-radius{syntax: \"<length>\"; inherits: false; initial-value: 999px;}@property --cngx-chip-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50 / .12);}@property --cngx-chip-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-chip-border{syntax: \"*\"; inherits: false; initial-value: 0 solid transparent;}@property --cngx-chip-font-size{syntax: \"*\"; inherits: false;
|
|
1041
|
+
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-chip-inner-gap{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-chip-padding-block{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-padding-inline{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-chip-radius{syntax: \"<length>\"; inherits: false; initial-value: 999px;}@property --cngx-chip-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50 / .12);}@property --cngx-chip-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-chip-border{syntax: \"*\"; inherits: false; initial-value: 0 solid transparent;}@property --cngx-chip-font-size{syntax: \"*\"; inherits: false;}@property --cngx-chip-transition{syntax: \"*\"; inherits: false; initial-value: background-color .15s ease,color .15s ease,border-color .15s ease;}:where(.cngx-chip){--cngx-chip-transition: background-color var(--cngx-duration-fast) ease, color var(--cngx-duration-fast) ease, border-color var(--cngx-duration-fast) ease}@property --cngx-chip-hover-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50 / .2);}@property --cngx-chip-hover-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-chip-focus-outline{syntax: \"*\"; inherits: false;}@property --cngx-chip-focus-outline-offset{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-selected-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50 / .32);}@property --cngx-chip-selected-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-chip-info-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .12 240 / .16);}@property --cngx-chip-info-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 .12 240);}@property --cngx-chip-success-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .15 145 / .16);}@property --cngx-chip-success-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 .15 145);}@property --cngx-chip-warning-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .15 75 / .18);}@property --cngx-chip-warning-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .15 75);}@property --cngx-chip-danger-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .22 25 / .18);}@property --cngx-chip-danger-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .2 25);}@property --cngx-chip-remove-radius{syntax: \"<length>\"; inherits: false; initial-value: 999px;}@property --cngx-chip-remove-focus-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-remove-focus-color{syntax: \"*\"; inherits: true;}@property --cngx-chip-remove-focus-offset{syntax: \"<length>\"; inherits: false; initial-value: -3px;}:root{--cngx-chip-bg: color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 12%, transparent);--cngx-chip-hover-bg: color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 20%, transparent);--cngx-chip-selected-bg: color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 32%, transparent)}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-chip-info-color: oklch(.85 .13 250);--cngx-chip-success-color: oklch(.85 .13 145);--cngx-chip-warning-color: oklch(.88 .14 75);--cngx-chip-danger-color: oklch(.82 .15 25)}}[data-color-scheme=dark],.dark{--cngx-chip-info-color: oklch(.85 .13 250);--cngx-chip-success-color: oklch(.85 .13 145);--cngx-chip-warning-color: oklch(.88 .14 75);--cngx-chip-danger-color: oklch(.82 .15 25);--cngx-chip-bg: color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 12%, transparent);--cngx-chip-hover-bg: color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 20%, transparent);--cngx-chip-selected-bg: color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 32%, transparent)}[data-color-scheme=light],.light{--cngx-chip-info-color: oklch(.45 .12 240);--cngx-chip-success-color: oklch(.45 .15 145);--cngx-chip-warning-color: oklch(.5 .15 75);--cngx-chip-danger-color: oklch(.5 .2 25);--cngx-chip-bg: color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 12%, transparent);--cngx-chip-hover-bg: color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 20%, transparent);--cngx-chip-selected-bg: color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 32%, transparent)}.cngx-chip{--cngx-chip-radius: var(--cngx-radius-pill)}.cngx-chip__remove{--cngx-chip-remove-radius: var(--cngx-radius-pill)}}@layer cngx.components{@scope(.cngx-chip){:scope{display:inline-flex;align-items:center;line-height:1.25;max-width:100%;box-sizing:border-box;--cngx-chip-inner-gap: var(--cngx-space-xs);--cngx-chip-padding-block: var(--cngx-space-xs);--cngx-chip-padding-inline: var(--cngx-space-sm);gap:var(--cngx-chip-inner-gap);padding-block:var(--cngx-chip-padding-block, 2px);padding-inline:var(--cngx-chip-padding-inline);border-radius:var(--cngx-chip-radius);background:var(--cngx-chip-bg);color:var(--cngx-chip-color, inherit);border:var(--cngx-chip-border, 0 solid transparent);font-size:var(--cngx-chip-font-size, var(--cngx-font-size-sm, .8125rem));transition:var( --cngx-chip-transition, background-color .15s ease, color .15s ease, border-color .15s ease )}:scope[role=button],:scope[tabindex],:scope:has(.cngx-chip__remove){cursor:pointer;justify-content:center;min-block-size:var(--cngx-target-min, 0px);min-inline-size:var(--cngx-target-min, 0px)}:scope[role=button]:hover,:scope[tabindex]:hover,:scope:has(.cngx-chip__remove):hover{background:var(--cngx-chip-hover-bg);color:var(--cngx-chip-hover-color, inherit)}:scope:focus-visible{outline:var( --cngx-chip-focus-outline, 2px solid var(--cngx-color-primary, oklch(.66 .19 50)) );outline-offset:var(--cngx-chip-focus-outline-offset, 2px)}:scope[aria-selected=true],:scope[aria-pressed=true]{background:var(--cngx-chip-selected-bg);color:var(--cngx-chip-selected-color, inherit)}:scope[data-color=info]{background:var(--cngx-chip-info-bg);color:var(--cngx-chip-info-color)}:scope[data-color=success]{background:var(--cngx-chip-success-bg);color:var(--cngx-chip-success-color)}:scope[data-color=warning]{background:var(--cngx-chip-warning-bg);color:var(--cngx-chip-warning-color)}:scope[data-color=danger]{background:var(--cngx-chip-danger-bg);color:var(--cngx-chip-danger-color)}:scope[aria-disabled=true],:scope:disabled{background:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 6%,transparent);color:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 38%,transparent);cursor:not-allowed;pointer-events:none}:scope:is([aria-disabled=true],:disabled):is([aria-selected=true],[aria-pressed=true]){background:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 16%,transparent)}.cngx-chip__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.cngx-chip__remove{appearance:none;border:0;background:transparent;color:inherit;cursor:pointer;padding:0 2px;font:inherit;line-height:1;flex:0 0 auto;color:color-mix(in oklab,currentColor 70%,transparent);border-radius:var(--cngx-chip-remove-radius);display:inline-flex;align-items:center;justify-content:center;min-inline-size:max(var(--cngx-chip-remove-target, 1.5rem),var(--cngx-target-min, 0px));min-block-size:max(var(--cngx-chip-remove-target, 1.5rem),var(--cngx-target-min, 0px));margin:calc(-.5*max(0px,var(--cngx-chip-remove-target, 1.5rem) - max(1em,var(--cngx-target-min, 0px))))}.cngx-chip__remove-icon{--cngx-icon-svg-size: 1rem;display:block}.cngx-chip__remove:hover{color:inherit}.cngx-chip__remove:focus-visible{outline:var(--cngx-chip-remove-focus-width, 2px) solid var(--cngx-chip-remove-focus-color, var(--cngx-color-primary, oklch(.66 .19 50)));outline-offset:var(--cngx-chip-remove-focus-offset, -3px)}}}@media(forced-colors:active){.cngx-chip{border:1px solid ButtonBorder}.cngx-chip[aria-selected=true],.cngx-chip[aria-pressed=true]{background:Highlight!important;color:HighlightText!important;border-color:Highlight!important;forced-color-adjust:none;--_cngx-forced-ink: HighlightText}.cngx-chip:is([aria-disabled=true],:disabled){color:GrayText;border-color:GrayText}.cngx-chip:is([aria-disabled=true],:disabled):is([aria-selected=true],[aria-pressed=true]){background:GrayText!important;color:Canvas!important;border-color:GrayText!important}}\n"], dependencies: [{ kind: "component", type: CngxIconSvg, selector: "svg[cngxIconSvg]", inputs: ["cngxIconSvg"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
854
1042
|
}
|
|
855
1043
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxChip, decorators: [{
|
|
856
1044
|
type: Component,
|
|
857
|
-
args: [{ selector: 'cngx-chip', exportAs: 'cngxChip', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
1045
|
+
args: [{ selector: 'cngx-chip', exportAs: 'cngxChip', standalone: true, imports: [CngxIconSvg], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
858
1046
|
class: 'cngx-chip',
|
|
859
1047
|
'[attr.id]': 'resolvedId()',
|
|
860
1048
|
}, template: `
|
|
@@ -870,7 +1058,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
870
1058
|
>
|
|
871
1059
|
<!--
|
|
872
1060
|
Named content slot for the close glyph. Default renders the
|
|
873
|
-
|
|
1061
|
+
shared X icon - consumers project any icon component by tagging
|
|
874
1062
|
it with the attribute:
|
|
875
1063
|
|
|
876
1064
|
<cngx-chip [removable]="true">
|
|
@@ -883,20 +1071,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
883
1071
|
the TemplateRef/outlet dance.
|
|
884
1072
|
-->
|
|
885
1073
|
<ng-content select="[cngxChipClose]">
|
|
886
|
-
<
|
|
1074
|
+
<svg class="cngx-chip__remove-icon" [cngxIconSvg]="removeIcon"></svg>
|
|
887
1075
|
</ng-content>
|
|
888
1076
|
</button>
|
|
889
1077
|
}
|
|
890
|
-
`, styles: ["@layer cngx.tokens{@property --cngx-chip-inner-gap{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-chip-padding-block{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-padding-inline{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-chip-radius{syntax: \"<length>\"; inherits: false; initial-value: 999px;}@property --cngx-chip-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50 / .12);}@property --cngx-chip-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-chip-border{syntax: \"*\"; inherits: false; initial-value: 0 solid transparent;}@property --cngx-chip-font-size{syntax: \"*\"; inherits: false;
|
|
1078
|
+
`, styles: ["@layer cngx.tokens{@property --cngx-chip-inner-gap{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-chip-padding-block{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-padding-inline{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-chip-radius{syntax: \"<length>\"; inherits: false; initial-value: 999px;}@property --cngx-chip-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50 / .12);}@property --cngx-chip-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-chip-border{syntax: \"*\"; inherits: false; initial-value: 0 solid transparent;}@property --cngx-chip-font-size{syntax: \"*\"; inherits: false;}@property --cngx-chip-transition{syntax: \"*\"; inherits: false; initial-value: background-color .15s ease,color .15s ease,border-color .15s ease;}:where(.cngx-chip){--cngx-chip-transition: background-color var(--cngx-duration-fast) ease, color var(--cngx-duration-fast) ease, border-color var(--cngx-duration-fast) ease}@property --cngx-chip-hover-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50 / .2);}@property --cngx-chip-hover-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-chip-focus-outline{syntax: \"*\"; inherits: false;}@property --cngx-chip-focus-outline-offset{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-selected-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50 / .32);}@property --cngx-chip-selected-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-chip-info-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .12 240 / .16);}@property --cngx-chip-info-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 .12 240);}@property --cngx-chip-success-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .15 145 / .16);}@property --cngx-chip-success-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 .15 145);}@property --cngx-chip-warning-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .15 75 / .18);}@property --cngx-chip-warning-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .15 75);}@property --cngx-chip-danger-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .22 25 / .18);}@property --cngx-chip-danger-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .2 25);}@property --cngx-chip-remove-radius{syntax: \"<length>\"; inherits: false; initial-value: 999px;}@property --cngx-chip-remove-focus-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-remove-focus-color{syntax: \"*\"; inherits: true;}@property --cngx-chip-remove-focus-offset{syntax: \"<length>\"; inherits: false; initial-value: -3px;}:root{--cngx-chip-bg: color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 12%, transparent);--cngx-chip-hover-bg: color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 20%, transparent);--cngx-chip-selected-bg: color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 32%, transparent)}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-chip-info-color: oklch(.85 .13 250);--cngx-chip-success-color: oklch(.85 .13 145);--cngx-chip-warning-color: oklch(.88 .14 75);--cngx-chip-danger-color: oklch(.82 .15 25)}}[data-color-scheme=dark],.dark{--cngx-chip-info-color: oklch(.85 .13 250);--cngx-chip-success-color: oklch(.85 .13 145);--cngx-chip-warning-color: oklch(.88 .14 75);--cngx-chip-danger-color: oklch(.82 .15 25);--cngx-chip-bg: color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 12%, transparent);--cngx-chip-hover-bg: color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 20%, transparent);--cngx-chip-selected-bg: color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 32%, transparent)}[data-color-scheme=light],.light{--cngx-chip-info-color: oklch(.45 .12 240);--cngx-chip-success-color: oklch(.45 .15 145);--cngx-chip-warning-color: oklch(.5 .15 75);--cngx-chip-danger-color: oklch(.5 .2 25);--cngx-chip-bg: color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 12%, transparent);--cngx-chip-hover-bg: color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 20%, transparent);--cngx-chip-selected-bg: color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 32%, transparent)}.cngx-chip{--cngx-chip-radius: var(--cngx-radius-pill)}.cngx-chip__remove{--cngx-chip-remove-radius: var(--cngx-radius-pill)}}@layer cngx.components{@scope(.cngx-chip){:scope{display:inline-flex;align-items:center;line-height:1.25;max-width:100%;box-sizing:border-box;--cngx-chip-inner-gap: var(--cngx-space-xs);--cngx-chip-padding-block: var(--cngx-space-xs);--cngx-chip-padding-inline: var(--cngx-space-sm);gap:var(--cngx-chip-inner-gap);padding-block:var(--cngx-chip-padding-block, 2px);padding-inline:var(--cngx-chip-padding-inline);border-radius:var(--cngx-chip-radius);background:var(--cngx-chip-bg);color:var(--cngx-chip-color, inherit);border:var(--cngx-chip-border, 0 solid transparent);font-size:var(--cngx-chip-font-size, var(--cngx-font-size-sm, .8125rem));transition:var( --cngx-chip-transition, background-color .15s ease, color .15s ease, border-color .15s ease )}:scope[role=button],:scope[tabindex],:scope:has(.cngx-chip__remove){cursor:pointer;justify-content:center;min-block-size:var(--cngx-target-min, 0px);min-inline-size:var(--cngx-target-min, 0px)}:scope[role=button]:hover,:scope[tabindex]:hover,:scope:has(.cngx-chip__remove):hover{background:var(--cngx-chip-hover-bg);color:var(--cngx-chip-hover-color, inherit)}:scope:focus-visible{outline:var( --cngx-chip-focus-outline, 2px solid var(--cngx-color-primary, oklch(.66 .19 50)) );outline-offset:var(--cngx-chip-focus-outline-offset, 2px)}:scope[aria-selected=true],:scope[aria-pressed=true]{background:var(--cngx-chip-selected-bg);color:var(--cngx-chip-selected-color, inherit)}:scope[data-color=info]{background:var(--cngx-chip-info-bg);color:var(--cngx-chip-info-color)}:scope[data-color=success]{background:var(--cngx-chip-success-bg);color:var(--cngx-chip-success-color)}:scope[data-color=warning]{background:var(--cngx-chip-warning-bg);color:var(--cngx-chip-warning-color)}:scope[data-color=danger]{background:var(--cngx-chip-danger-bg);color:var(--cngx-chip-danger-color)}:scope[aria-disabled=true],:scope:disabled{background:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 6%,transparent);color:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 38%,transparent);cursor:not-allowed;pointer-events:none}:scope:is([aria-disabled=true],:disabled):is([aria-selected=true],[aria-pressed=true]){background:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 16%,transparent)}.cngx-chip__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.cngx-chip__remove{appearance:none;border:0;background:transparent;color:inherit;cursor:pointer;padding:0 2px;font:inherit;line-height:1;flex:0 0 auto;color:color-mix(in oklab,currentColor 70%,transparent);border-radius:var(--cngx-chip-remove-radius);display:inline-flex;align-items:center;justify-content:center;min-inline-size:max(var(--cngx-chip-remove-target, 1.5rem),var(--cngx-target-min, 0px));min-block-size:max(var(--cngx-chip-remove-target, 1.5rem),var(--cngx-target-min, 0px));margin:calc(-.5*max(0px,var(--cngx-chip-remove-target, 1.5rem) - max(1em,var(--cngx-target-min, 0px))))}.cngx-chip__remove-icon{--cngx-icon-svg-size: 1rem;display:block}.cngx-chip__remove:hover{color:inherit}.cngx-chip__remove:focus-visible{outline:var(--cngx-chip-remove-focus-width, 2px) solid var(--cngx-chip-remove-focus-color, var(--cngx-color-primary, oklch(.66 .19 50)));outline-offset:var(--cngx-chip-remove-focus-offset, -3px)}}}@media(forced-colors:active){.cngx-chip{border:1px solid ButtonBorder}.cngx-chip[aria-selected=true],.cngx-chip[aria-pressed=true]{background:Highlight!important;color:HighlightText!important;border-color:Highlight!important;forced-color-adjust:none;--_cngx-forced-ink: HighlightText}.cngx-chip:is([aria-disabled=true],:disabled){color:GrayText;border-color:GrayText}.cngx-chip:is([aria-disabled=true],:disabled):is([aria-selected=true],[aria-pressed=true]){background:GrayText!important;color:Canvas!important;border-color:GrayText!important}}\n"] }]
|
|
891
1079
|
}], propDecorators: { removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], removeAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeAriaLabel", required: false }] }], remove: [{ type: i0.Output, args: ["remove"] }] } });
|
|
892
1080
|
|
|
893
1081
|
/** Tone glyph rendered inside the decorative dot - the non-colour signal. */
|
|
894
|
-
const
|
|
895
|
-
success:
|
|
896
|
-
warning:
|
|
897
|
-
danger:
|
|
898
|
-
info:
|
|
899
|
-
neutral:
|
|
1082
|
+
const TONE_ICON = {
|
|
1083
|
+
success: CNGX_ICON_CHECK,
|
|
1084
|
+
warning: CNGX_ICON_EXCLAMATION_SOLID,
|
|
1085
|
+
danger: CNGX_ICON_X,
|
|
1086
|
+
info: CNGX_ICON_INFO,
|
|
1087
|
+
neutral: CNGX_ICON_QUESTION,
|
|
900
1088
|
};
|
|
901
1089
|
/**
|
|
902
1090
|
* Semantic health indicator - a decorative tone dot paired with a visible
|
|
@@ -927,15 +1115,14 @@ const TONE_GLYPH = {
|
|
|
927
1115
|
* visible `label`: without the glyph, colour is the dot's only signal, which a
|
|
928
1116
|
* sighted colour-blind reader cannot resolve (a dev-mode warning enforces this).
|
|
929
1117
|
*
|
|
930
|
-
* @category common/display
|
|
931
|
-
* @docsKind primary
|
|
932
1118
|
* @wcag AA
|
|
933
1119
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/status/status.component.ts
|
|
934
|
-
* @since 0.
|
|
1120
|
+
* @since 0.3.0
|
|
935
1121
|
* @relatedTo CngxBadge, CngxTag, CngxChip
|
|
936
1122
|
*
|
|
937
|
-
* <example-url
|
|
938
|
-
* <example-url
|
|
1123
|
+
* <example-url>/#/common/display/status/tone-matrix</example-url>
|
|
1124
|
+
* <example-url>/#/common/display/status/dot-only</example-url>
|
|
1125
|
+
* @axis level atom
|
|
939
1126
|
*/
|
|
940
1127
|
class CngxStatus {
|
|
941
1128
|
elRef = inject((ElementRef));
|
|
@@ -954,19 +1141,19 @@ class CngxStatus {
|
|
|
954
1141
|
* since colour alone fails a sighted colour-blind reader (Pillar 2).
|
|
955
1142
|
*/
|
|
956
1143
|
glyph = input(true, { ...(ngDevMode ? { debugName: "glyph" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
957
|
-
/** @internal Tone glyph
|
|
958
|
-
|
|
1144
|
+
/** @internal Tone glyph drawn into the decorative dot. */
|
|
1145
|
+
toneIcon = computed(() => TONE_ICON[this.tone()], ...(ngDevMode ? [{ debugName: "toneIcon" }] : /* istanbul ignore next */ []));
|
|
959
1146
|
constructor() {
|
|
960
|
-
if (
|
|
1147
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
961
1148
|
afterNextRender(() => {
|
|
962
1149
|
const el = this.elRef.nativeElement;
|
|
963
|
-
if (!this.label() &&
|
|
964
|
-
|
|
965
|
-
'
|
|
966
|
-
'
|
|
1150
|
+
if (!this.label() && el.getAttribute('aria-hidden') !== 'true') {
|
|
1151
|
+
cngxDevWarn('CNGX1016', '[cngx-status] no `label`; the status has no accessible name and reads only as a ' +
|
|
1152
|
+
'coloured dot. Set [label]: the host has no role, so an aria-label or ' +
|
|
1153
|
+
'aria-labelledby on it is not a valid name.');
|
|
967
1154
|
}
|
|
968
1155
|
if (!this.glyph() && !this.label()) {
|
|
969
|
-
|
|
1156
|
+
cngxDevWarn('CNGX1017', '[cngx-status] [glyph]="false" with no visible `label`; a bare coloured ' +
|
|
970
1157
|
'dot is colour-only for a sighted colour-blind reader even with an ' +
|
|
971
1158
|
'aria-label. Set [label] or show the glyph.');
|
|
972
1159
|
}
|
|
@@ -975,15 +1162,15 @@ class CngxStatus {
|
|
|
975
1162
|
}
|
|
976
1163
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxStatus, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
977
1164
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxStatus, isStandalone: true, selector: "cngx-status", inputs: { tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, live: { classPropertyName: "live", publicName: "live", isSignal: true, isRequired: false, transformFunction: null }, glyph: { classPropertyName: "glyph", publicName: "glyph", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.cngx-status--success": "tone() === 'success'", "class.cngx-status--warning": "tone() === 'warning'", "class.cngx-status--danger": "tone() === 'danger'", "class.cngx-status--info": "tone() === 'info'", "class.cngx-status--neutral": "tone() === 'neutral'", "attr.aria-live": "live()" }, classAttribute: "cngx-status" }, ngImport: i0, template: `
|
|
978
|
-
<span class="cngx-status__dot" aria-hidden="true">@if (glyph()) {
|
|
1165
|
+
<span class="cngx-status__dot" aria-hidden="true">@if (glyph()) {<svg [cngxIconSvg]="toneIcon()"></svg>}</span>
|
|
979
1166
|
@if (label()) {
|
|
980
1167
|
<span class="cngx-status__label">{{ label() }}</span>
|
|
981
1168
|
}
|
|
982
|
-
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-status-gap{syntax: \"<length>\"; inherits: true; initial-value: 6px;}@property --cngx-status-dot-size{syntax: \"<length>\"; inherits: true; initial-value: 16px;}@property --cngx-status-
|
|
1169
|
+
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-status-gap{syntax: \"<length>\"; inherits: true; initial-value: 6px;}@property --cngx-status-dot-size{syntax: \"<length>\"; inherits: true; initial-value: 16px;}@property --cngx-status-dot-fg{syntax: \"<color>\"; inherits: true; initial-value: white;}@property --cngx-status-size{syntax: \"*\"; inherits: true; initial-value: .8125rem;}@property --cngx-status-weight{syntax: \"<number>\"; inherits: true; initial-value: 500;}@property --cngx-status-success-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .18 145);}@property --cngx-status-warning-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.75 .15 85);}@property --cngx-status-danger-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .22 25);}@property --cngx-status-info-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .14 250);}@property --cngx-status-neutral-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .02 290);}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-status-success-color: oklch(.78 .16 145);--cngx-status-warning-color: oklch(.82 .13 85);--cngx-status-danger-color: oklch(.75 .18 25);--cngx-status-info-color: oklch(.72 .12 250);--cngx-status-neutral-color: oklch(.7 .02 290)}}[data-color-scheme=dark],.dark{--cngx-status-success-color: oklch(.78 .16 145);--cngx-status-warning-color: oklch(.82 .13 85);--cngx-status-danger-color: oklch(.75 .18 25);--cngx-status-info-color: oklch(.72 .12 250);--cngx-status-neutral-color: oklch(.7 .02 290)}[data-color-scheme=light],.light{--cngx-status-success-color: oklch(.65 .18 145);--cngx-status-warning-color: oklch(.75 .15 85);--cngx-status-danger-color: oklch(.65 .22 25);--cngx-status-info-color: oklch(.6 .14 250);--cngx-status-neutral-color: oklch(.6 .02 290)}}@layer cngx.components{@scope(.cngx-status){:scope{--cngx-status-gap: var(--cngx-space-sm);display:inline-flex;align-items:center;gap:var(--cngx-status-gap, 6px);font-size:var(--cngx-status-size, .8125rem);font-weight:var(--cngx-status-weight, 500)}.cngx-status__dot{display:inline-flex;align-items:center;justify-content:center;flex:none;inline-size:var(--cngx-status-dot-size, 16px);block-size:var(--cngx-status-dot-size, 16px);border-radius:50%;line-height:1;color:var(--cngx-status-dot-fg, white);background:var(--cngx-status-neutral-color, oklch(.6 .02 290))}:scope.cngx-status--success .cngx-status__dot{background:var(--cngx-status-success-color)}:scope.cngx-status--warning .cngx-status__dot{background:var(--cngx-status-warning-color, oklch(.75 .15 85))}:scope.cngx-status--danger .cngx-status__dot{background:var(--cngx-status-danger-color)}:scope.cngx-status--info .cngx-status__dot{background:var(--cngx-status-info-color, oklch(.6 .14 250))}:scope.cngx-status--neutral .cngx-status__dot{background:var(--cngx-status-neutral-color, oklch(.6 .02 290))}:scope .cngx-status__dot>.cngx-icon-svg{--cngx-icon-svg-size: calc(var(--cngx-status-dot-size, 16px) * .75)}}}@media(forced-colors:active){.cngx-status .cngx-status__dot:empty{background:CanvasText}}\n"], dependencies: [{ kind: "component", type: CngxIconSvg, selector: "svg[cngxIconSvg]", inputs: ["cngxIconSvg"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
983
1170
|
}
|
|
984
1171
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxStatus, decorators: [{
|
|
985
1172
|
type: Component,
|
|
986
|
-
args: [{ selector: 'cngx-status', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
1173
|
+
args: [{ selector: 'cngx-status', standalone: true, imports: [CngxIconSvg], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
987
1174
|
class: 'cngx-status',
|
|
988
1175
|
'[class.cngx-status--success]': "tone() === 'success'",
|
|
989
1176
|
'[class.cngx-status--warning]': "tone() === 'warning'",
|
|
@@ -992,11 +1179,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
992
1179
|
'[class.cngx-status--neutral]': "tone() === 'neutral'",
|
|
993
1180
|
'[attr.aria-live]': 'live()',
|
|
994
1181
|
}, template: `
|
|
995
|
-
<span class="cngx-status__dot" aria-hidden="true">@if (glyph()) {
|
|
1182
|
+
<span class="cngx-status__dot" aria-hidden="true">@if (glyph()) {<svg [cngxIconSvg]="toneIcon()"></svg>}</span>
|
|
996
1183
|
@if (label()) {
|
|
997
1184
|
<span class="cngx-status__label">{{ label() }}</span>
|
|
998
1185
|
}
|
|
999
|
-
`, styles: ["@layer cngx.tokens{@property --cngx-status-gap{syntax: \"<length>\"; inherits: true; initial-value: 6px;}@property --cngx-status-dot-size{syntax: \"<length>\"; inherits: true; initial-value: 16px;}@property --cngx-status-
|
|
1186
|
+
`, styles: ["@layer cngx.tokens{@property --cngx-status-gap{syntax: \"<length>\"; inherits: true; initial-value: 6px;}@property --cngx-status-dot-size{syntax: \"<length>\"; inherits: true; initial-value: 16px;}@property --cngx-status-dot-fg{syntax: \"<color>\"; inherits: true; initial-value: white;}@property --cngx-status-size{syntax: \"*\"; inherits: true; initial-value: .8125rem;}@property --cngx-status-weight{syntax: \"<number>\"; inherits: true; initial-value: 500;}@property --cngx-status-success-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .18 145);}@property --cngx-status-warning-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.75 .15 85);}@property --cngx-status-danger-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .22 25);}@property --cngx-status-info-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .14 250);}@property --cngx-status-neutral-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .02 290);}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-status-success-color: oklch(.78 .16 145);--cngx-status-warning-color: oklch(.82 .13 85);--cngx-status-danger-color: oklch(.75 .18 25);--cngx-status-info-color: oklch(.72 .12 250);--cngx-status-neutral-color: oklch(.7 .02 290)}}[data-color-scheme=dark],.dark{--cngx-status-success-color: oklch(.78 .16 145);--cngx-status-warning-color: oklch(.82 .13 85);--cngx-status-danger-color: oklch(.75 .18 25);--cngx-status-info-color: oklch(.72 .12 250);--cngx-status-neutral-color: oklch(.7 .02 290)}[data-color-scheme=light],.light{--cngx-status-success-color: oklch(.65 .18 145);--cngx-status-warning-color: oklch(.75 .15 85);--cngx-status-danger-color: oklch(.65 .22 25);--cngx-status-info-color: oklch(.6 .14 250);--cngx-status-neutral-color: oklch(.6 .02 290)}}@layer cngx.components{@scope(.cngx-status){:scope{--cngx-status-gap: var(--cngx-space-sm);display:inline-flex;align-items:center;gap:var(--cngx-status-gap, 6px);font-size:var(--cngx-status-size, .8125rem);font-weight:var(--cngx-status-weight, 500)}.cngx-status__dot{display:inline-flex;align-items:center;justify-content:center;flex:none;inline-size:var(--cngx-status-dot-size, 16px);block-size:var(--cngx-status-dot-size, 16px);border-radius:50%;line-height:1;color:var(--cngx-status-dot-fg, white);background:var(--cngx-status-neutral-color, oklch(.6 .02 290))}:scope.cngx-status--success .cngx-status__dot{background:var(--cngx-status-success-color)}:scope.cngx-status--warning .cngx-status__dot{background:var(--cngx-status-warning-color, oklch(.75 .15 85))}:scope.cngx-status--danger .cngx-status__dot{background:var(--cngx-status-danger-color)}:scope.cngx-status--info .cngx-status__dot{background:var(--cngx-status-info-color, oklch(.6 .14 250))}:scope.cngx-status--neutral .cngx-status__dot{background:var(--cngx-status-neutral-color, oklch(.6 .02 290))}:scope .cngx-status__dot>.cngx-icon-svg{--cngx-icon-svg-size: calc(var(--cngx-status-dot-size, 16px) * .75)}}}@media(forced-colors:active){.cngx-status .cngx-status__dot:empty{background:CanvasText}}\n"] }]
|
|
1000
1187
|
}], ctorParameters: () => [], propDecorators: { tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], live: [{ type: i0.Input, args: [{ isSignal: true, alias: "live", required: false }] }], glyph: [{ type: i0.Input, args: [{ isSignal: true, alias: "glyph", required: false }] }] } });
|
|
1001
1188
|
|
|
1002
1189
|
/**
|
|
@@ -1008,12 +1195,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1008
1195
|
* Presentational by design (see {@link CngxMeta}): it is not a semantic list.
|
|
1009
1196
|
* Tune the spacing / colour through the `--cngx-meta-list-*` custom properties.
|
|
1010
1197
|
*
|
|
1011
|
-
* @category common/display
|
|
1012
1198
|
* @wcag AA
|
|
1013
1199
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/meta/meta-list.component.ts
|
|
1014
|
-
* @since 0.
|
|
1200
|
+
* @since 0.3.0
|
|
1015
1201
|
* @relatedTo CngxMeta
|
|
1016
|
-
* <example-url
|
|
1202
|
+
* <example-url>/#/common/display/meta/metadata-line</example-url>
|
|
1203
|
+
* @axis level atom
|
|
1017
1204
|
*/
|
|
1018
1205
|
class CngxMetaList {
|
|
1019
1206
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxMetaList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -1036,12 +1223,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1036
1223
|
* need real term/description semantics for a longer or more structured block,
|
|
1037
1224
|
* reach for a definition list instead - `CngxMeta` deliberately stays flat.
|
|
1038
1225
|
*
|
|
1039
|
-
* @category common/display
|
|
1040
1226
|
* @wcag AA
|
|
1041
1227
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/meta/meta.component.ts
|
|
1042
|
-
* @since 0.
|
|
1228
|
+
* @since 0.3.0
|
|
1043
1229
|
* @relatedTo CngxMetaList
|
|
1044
|
-
* <example-url
|
|
1230
|
+
* <example-url>/#/common/display/meta/metadata-line</example-url>
|
|
1045
1231
|
*/
|
|
1046
1232
|
class CngxMeta {
|
|
1047
1233
|
/** The metadata key. Rendered bold before the value; omit for a value-only item. */
|
|
@@ -1064,9 +1250,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1064
1250
|
* Presentational checkbox / checkmark indicator.
|
|
1065
1251
|
*
|
|
1066
1252
|
* **Why this exists.**
|
|
1067
|
-
* Across the library, "is this row selected?" shows up as a
|
|
1068
|
-
*
|
|
1069
|
-
* a future grid/tree cell will want a checkbox with indeterminate state, and
|
|
1253
|
+
* Across the library, "is this row selected?" shows up as a check mark
|
|
1254
|
+
* in the forms/select panel, a future grid/tree cell will want a checkbox with indeterminate state, and
|
|
1070
1255
|
* `ng decompose cngx-*` schematics should emit a consistent indicator shape
|
|
1071
1256
|
* regardless of which list-like component they originated from. This atom
|
|
1072
1257
|
* unifies all three surfaces behind a single presentational molecule -
|
|
@@ -1088,16 +1273,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1088
1273
|
* truth about "selected" is communicated by the row's own `aria-selected`
|
|
1089
1274
|
* / `role="option"` ARIA, not by this decoration.
|
|
1090
1275
|
*
|
|
1091
|
-
* @category common/display
|
|
1092
|
-
* @docsKind primary
|
|
1093
1276
|
* @wcag AA
|
|
1094
1277
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/checkbox-indicator/checkbox-indicator.component.ts
|
|
1095
|
-
* @since 0.
|
|
1278
|
+
* @since 0.3.0
|
|
1096
1279
|
* @relatedTo CngxRadioIndicator, CngxIcon
|
|
1097
|
-
* <example-url
|
|
1098
|
-
* <example-url
|
|
1099
|
-
* <example-url
|
|
1100
|
-
* <example-url
|
|
1280
|
+
* <example-url>/#/common/display/checkbox-indicator/states</example-url>
|
|
1281
|
+
* <example-url>/#/common/display/checkbox-indicator/variant-matrix</example-url>
|
|
1282
|
+
* <example-url>/#/common/display/checkbox-indicator/sizes</example-url>
|
|
1283
|
+
* <example-url>/#/common/display/checkbox-indicator/custom-glyph</example-url>
|
|
1284
|
+
* @axis level atom
|
|
1101
1285
|
*/
|
|
1102
1286
|
class CngxCheckboxIndicator {
|
|
1103
1287
|
/**
|
|
@@ -1124,8 +1308,8 @@ class CngxCheckboxIndicator {
|
|
|
1124
1308
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1125
1309
|
/**
|
|
1126
1310
|
* Consumer-supplied template for the check glyph. When `null` (default),
|
|
1127
|
-
* the built-in `<span class="cngx-checkbox-indicator__check"
|
|
1128
|
-
* is rendered. When set, the consumer template replaces the glyph span
|
|
1311
|
+
* the built-in `<span class="cngx-checkbox-indicator__check">` with the
|
|
1312
|
+
* default check svg is rendered. When set, the consumer template replaces the glyph span
|
|
1129
1313
|
* entirely - the `__check` class is NOT applied to the custom content
|
|
1130
1314
|
* (consumers own the styling of their replacement).
|
|
1131
1315
|
*
|
|
@@ -1138,16 +1322,22 @@ class CngxCheckboxIndicator {
|
|
|
1138
1322
|
/**
|
|
1139
1323
|
* Consumer-supplied template for the indeterminate dash glyph. Mirrors
|
|
1140
1324
|
* {@link checkGlyph} - defaults to the built-in
|
|
1141
|
-
* `<span class="cngx-checkbox-indicator__dash"
|
|
1325
|
+
* `<span class="cngx-checkbox-indicator__dash">` with the default minus svg.
|
|
1142
1326
|
*/
|
|
1143
1327
|
dashGlyph = input(null, ...(ngDevMode ? [{ debugName: "dashGlyph" }] : /* istanbul ignore next */ []));
|
|
1328
|
+
checkIcon = CNGX_ICON_CHECK;
|
|
1329
|
+
dashIcon = CNGX_ICON_MINUS;
|
|
1144
1330
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCheckboxIndicator, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1145
1331
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxCheckboxIndicator, isStandalone: true, selector: "cngx-checkbox-indicator", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, checkGlyph: { classPropertyName: "checkGlyph", publicName: "checkGlyph", isSignal: true, isRequired: false, transformFunction: null }, dashGlyph: { classPropertyName: "dashGlyph", publicName: "dashGlyph", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" }, properties: { "class.cngx-checkbox-indicator--checkbox": "variant() === 'checkbox'", "class.cngx-checkbox-indicator--checkmark": "variant() === 'checkmark'", "class.cngx-checkbox-indicator--checked": "checked()", "class.cngx-checkbox-indicator--indeterminate": "indeterminate()", "class.cngx-checkbox-indicator--disabled": "disabled()", "class.cngx-checkbox-indicator--sm": "size() === 'sm'", "class.cngx-checkbox-indicator--md": "size() === 'md'", "class.cngx-checkbox-indicator--lg": "size() === 'lg'" }, classAttribute: "cngx-checkbox-indicator" }, exportAs: ["cngxCheckboxIndicator"], ngImport: i0, template: `
|
|
1146
1332
|
<ng-template #defaultDashGlyph>
|
|
1147
|
-
<span aria-hidden="true" class="cngx-checkbox-indicator__dash"
|
|
1333
|
+
<span aria-hidden="true" class="cngx-checkbox-indicator__dash">
|
|
1334
|
+
<svg [cngxIconSvg]="dashIcon"></svg>
|
|
1335
|
+
</span>
|
|
1148
1336
|
</ng-template>
|
|
1149
1337
|
<ng-template #defaultCheckGlyph>
|
|
1150
|
-
<span aria-hidden="true" class="cngx-checkbox-indicator__check"
|
|
1338
|
+
<span aria-hidden="true" class="cngx-checkbox-indicator__check">
|
|
1339
|
+
<svg [cngxIconSvg]="checkIcon"></svg>
|
|
1340
|
+
</span>
|
|
1151
1341
|
</ng-template>
|
|
1152
1342
|
|
|
1153
1343
|
@if (variant() === 'checkbox') {
|
|
@@ -1165,11 +1355,11 @@ class CngxCheckboxIndicator {
|
|
|
1165
1355
|
<ng-container *ngTemplateOutlet="checkGlyph() ?? defaultCheckGlyph" />
|
|
1166
1356
|
}
|
|
1167
1357
|
}
|
|
1168
|
-
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-checkbox-size{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-checkbox-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-checkbox-bg{syntax: \"*\"; inherits: true; initial-value: transparent;}@property --cngx-checkbox-border{syntax: \"*\"; inherits: true; initial-value: 1.5px solid currentColor;}@property --cngx-checkbox-radius{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --cngx-checkbox-checked-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-checkbox-checked-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-checkbox-size-sm{syntax: \"*\"; inherits: true; initial-value: .875em;}@property --cngx-checkbox-size-md{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-checkbox-size-lg{syntax: \"*\"; inherits: true; initial-value: 1.25em;}:root{--cngx-checkbox-checked-bg: var(--cngx-color-primary)}}@layer cngx.components{@scope(.cngx-checkbox-indicator){:scope{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;line-height:1;flex:0 0 auto;color:var(--cngx-checkbox-color, currentColor);width:var(--cngx-checkbox-size, 1em);height:var(--cngx-checkbox-size, 1em);box-sizing:border-box;overflow:hidden}:scope.cngx-checkbox-indicator--sm{--cngx-checkbox-size: var(--cngx-checkbox-size-sm, .875em)}:scope.cngx-checkbox-indicator--md{--cngx-checkbox-size: var(--cngx-checkbox-size-md, 1em)}:scope.cngx-checkbox-indicator--lg{--cngx-checkbox-size: var(--cngx-checkbox-size-lg, 1.25em)}.cngx-checkbox-indicator__box{display:inline-flex;align-items:center;justify-content:center;color:inherit;line-height:1;box-sizing:border-box;width:var(--cngx-checkbox-size, 1em);height:var(--cngx-checkbox-size, 1em);border:var(--cngx-checkbox-border, 1.5px solid currentColor);border-radius:var(--cngx-checkbox-radius
|
|
1358
|
+
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-checkbox-size{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-checkbox-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-checkbox-bg{syntax: \"*\"; inherits: true; initial-value: transparent;}@property --cngx-checkbox-border{syntax: \"*\"; inherits: true; initial-value: 1.5px solid currentColor;}@property --cngx-checkbox-radius{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --cngx-checkbox-checked-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-checkbox-checked-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-checkbox-size-sm{syntax: \"*\"; inherits: true; initial-value: .875em;}@property --cngx-checkbox-size-md{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-checkbox-size-lg{syntax: \"*\"; inherits: true; initial-value: 1.25em;}@property --cngx-checkbox-glyph-stroke-width{syntax: \"<number>\"; inherits: true; initial-value: 3;}:root{--cngx-checkbox-checked-bg: var(--cngx-color-primary)}.cngx-checkbox-indicator{--cngx-checkbox-radius: var(--cngx-radius-sm)}}@layer cngx.components{@scope(.cngx-checkbox-indicator){:scope{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;line-height:1;flex:0 0 auto;color:var(--cngx-checkbox-color, currentColor);width:var(--cngx-checkbox-size, 1em);height:var(--cngx-checkbox-size, 1em);box-sizing:border-box;overflow:hidden}:scope.cngx-checkbox-indicator--sm{--cngx-checkbox-size: var(--cngx-checkbox-size-sm, .875em)}:scope.cngx-checkbox-indicator--md{--cngx-checkbox-size: var(--cngx-checkbox-size-md, 1em)}:scope.cngx-checkbox-indicator--lg{--cngx-checkbox-size: var(--cngx-checkbox-size-lg, 1.25em);--cngx-checkbox-glyph-box-factor: .8}.cngx-checkbox-indicator__box{display:inline-flex;align-items:center;justify-content:center;color:inherit;line-height:1;box-sizing:border-box;width:var(--cngx-checkbox-size, 1em);height:var(--cngx-checkbox-size, 1em);border:var(--cngx-checkbox-border, 1.5px solid currentColor);border-radius:var(--cngx-checkbox-radius);background:var(--cngx-checkbox-bg, transparent)}:scope.cngx-checkbox-indicator--checked .cngx-checkbox-indicator__box,:scope.cngx-checkbox-indicator--indeterminate .cngx-checkbox-indicator__box{background:var(--cngx-checkbox-checked-bg);border-color:var(--cngx-checkbox-checked-bg);color:var(--cngx-checkbox-checked-color, oklch(1 0 0))}:scope.cngx-checkbox-indicator--disabled{--cngx-checkbox-checked-bg: color-mix(in oklab, var(--cngx-color-text, oklch(.2 .01 250)) 38%, transparent);--cngx-checkbox-checked-color: var(--cngx-color-surface, oklch(1 0 0));color:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 38%,transparent)}.cngx-checkbox-indicator__check,.cngx-checkbox-indicator__dash{display:inline-flex;line-height:1;-webkit-user-select:none;user-select:none;--cngx-icon-svg-size: max( calc(var(--cngx-checkbox-size, 1em) * var(--cngx-checkbox-glyph-box-factor, .75)), var(--cngx-icon-svg-micro-floor, .75rem) );--cngx-icon-svg-stroke-width: var(--cngx-checkbox-glyph-stroke-width, 3)}:scope.cngx-checkbox-indicator--checkmark .cngx-checkbox-indicator__check,:scope.cngx-checkbox-indicator--checkmark .cngx-checkbox-indicator__dash{color:var(--cngx-checkbox-color);--cngx-icon-svg-size: max( calc(var(--cngx-checkbox-size, 1em) * .75), var(--cngx-icon-svg-micro-floor, .75rem), min(var(--cngx-checkbox-size, 1em), calc((var(--cngx-checkbox-size, 1em) - 14.5px) * 1000)) )}}}@media(forced-colors:active){.cngx-checkbox-indicator:is(.cngx-checkbox-indicator--checked,.cngx-checkbox-indicator--indeterminate) .cngx-checkbox-indicator__box{background:transparent;border-color:currentColor;color:currentColor}.cngx-checkbox-indicator.cngx-checkbox-indicator--checkmark :is(.cngx-checkbox-indicator__check,.cngx-checkbox-indicator__dash){color:currentColor}.cngx-checkbox-indicator.cngx-checkbox-indicator--disabled{color:GrayText}.cngx-checkbox-indicator.cngx-checkbox-indicator--disabled:is(.cngx-checkbox-indicator--checked,.cngx-checkbox-indicator--indeterminate) .cngx-checkbox-indicator__box{forced-color-adjust:none;background:GrayText;border-color:GrayText;color:Canvas}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: CngxIconSvg, selector: "svg[cngxIconSvg]", inputs: ["cngxIconSvg"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1169
1359
|
}
|
|
1170
1360
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCheckboxIndicator, decorators: [{
|
|
1171
1361
|
type: Component,
|
|
1172
|
-
args: [{ selector: 'cngx-checkbox-indicator', exportAs: 'cngxCheckboxIndicator', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [NgTemplateOutlet], host: {
|
|
1362
|
+
args: [{ selector: 'cngx-checkbox-indicator', exportAs: 'cngxCheckboxIndicator', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [NgTemplateOutlet, CngxIconSvg], host: {
|
|
1173
1363
|
class: 'cngx-checkbox-indicator',
|
|
1174
1364
|
'aria-hidden': 'true',
|
|
1175
1365
|
'[class.cngx-checkbox-indicator--checkbox]': "variant() === 'checkbox'",
|
|
@@ -1182,10 +1372,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1182
1372
|
'[class.cngx-checkbox-indicator--lg]': "size() === 'lg'",
|
|
1183
1373
|
}, template: `
|
|
1184
1374
|
<ng-template #defaultDashGlyph>
|
|
1185
|
-
<span aria-hidden="true" class="cngx-checkbox-indicator__dash"
|
|
1375
|
+
<span aria-hidden="true" class="cngx-checkbox-indicator__dash">
|
|
1376
|
+
<svg [cngxIconSvg]="dashIcon"></svg>
|
|
1377
|
+
</span>
|
|
1186
1378
|
</ng-template>
|
|
1187
1379
|
<ng-template #defaultCheckGlyph>
|
|
1188
|
-
<span aria-hidden="true" class="cngx-checkbox-indicator__check"
|
|
1380
|
+
<span aria-hidden="true" class="cngx-checkbox-indicator__check">
|
|
1381
|
+
<svg [cngxIconSvg]="checkIcon"></svg>
|
|
1382
|
+
</span>
|
|
1189
1383
|
</ng-template>
|
|
1190
1384
|
|
|
1191
1385
|
@if (variant() === 'checkbox') {
|
|
@@ -1203,11 +1397,71 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1203
1397
|
<ng-container *ngTemplateOutlet="checkGlyph() ?? defaultCheckGlyph" />
|
|
1204
1398
|
}
|
|
1205
1399
|
}
|
|
1206
|
-
`, styles: ["@layer cngx.tokens{@property --cngx-checkbox-size{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-checkbox-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-checkbox-bg{syntax: \"*\"; inherits: true; initial-value: transparent;}@property --cngx-checkbox-border{syntax: \"*\"; inherits: true; initial-value: 1.5px solid currentColor;}@property --cngx-checkbox-radius{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --cngx-checkbox-checked-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-checkbox-checked-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-checkbox-size-sm{syntax: \"*\"; inherits: true; initial-value: .875em;}@property --cngx-checkbox-size-md{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-checkbox-size-lg{syntax: \"*\"; inherits: true; initial-value: 1.25em;}:root{--cngx-checkbox-checked-bg: var(--cngx-color-primary)}}@layer cngx.components{@scope(.cngx-checkbox-indicator){:scope{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;line-height:1;flex:0 0 auto;color:var(--cngx-checkbox-color, currentColor);width:var(--cngx-checkbox-size, 1em);height:var(--cngx-checkbox-size, 1em);box-sizing:border-box;overflow:hidden}:scope.cngx-checkbox-indicator--sm{--cngx-checkbox-size: var(--cngx-checkbox-size-sm, .875em)}:scope.cngx-checkbox-indicator--md{--cngx-checkbox-size: var(--cngx-checkbox-size-md, 1em)}:scope.cngx-checkbox-indicator--lg{--cngx-checkbox-size: var(--cngx-checkbox-size-lg, 1.25em)}.cngx-checkbox-indicator__box{display:inline-flex;align-items:center;justify-content:center;color:inherit;line-height:1;box-sizing:border-box;width:var(--cngx-checkbox-size, 1em);height:var(--cngx-checkbox-size, 1em);border:var(--cngx-checkbox-border, 1.5px solid currentColor);border-radius:var(--cngx-checkbox-radius
|
|
1400
|
+
`, styles: ["@layer cngx.tokens{@property --cngx-checkbox-size{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-checkbox-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-checkbox-bg{syntax: \"*\"; inherits: true; initial-value: transparent;}@property --cngx-checkbox-border{syntax: \"*\"; inherits: true; initial-value: 1.5px solid currentColor;}@property --cngx-checkbox-radius{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --cngx-checkbox-checked-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-checkbox-checked-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-checkbox-size-sm{syntax: \"*\"; inherits: true; initial-value: .875em;}@property --cngx-checkbox-size-md{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-checkbox-size-lg{syntax: \"*\"; inherits: true; initial-value: 1.25em;}@property --cngx-checkbox-glyph-stroke-width{syntax: \"<number>\"; inherits: true; initial-value: 3;}:root{--cngx-checkbox-checked-bg: var(--cngx-color-primary)}.cngx-checkbox-indicator{--cngx-checkbox-radius: var(--cngx-radius-sm)}}@layer cngx.components{@scope(.cngx-checkbox-indicator){:scope{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;line-height:1;flex:0 0 auto;color:var(--cngx-checkbox-color, currentColor);width:var(--cngx-checkbox-size, 1em);height:var(--cngx-checkbox-size, 1em);box-sizing:border-box;overflow:hidden}:scope.cngx-checkbox-indicator--sm{--cngx-checkbox-size: var(--cngx-checkbox-size-sm, .875em)}:scope.cngx-checkbox-indicator--md{--cngx-checkbox-size: var(--cngx-checkbox-size-md, 1em)}:scope.cngx-checkbox-indicator--lg{--cngx-checkbox-size: var(--cngx-checkbox-size-lg, 1.25em);--cngx-checkbox-glyph-box-factor: .8}.cngx-checkbox-indicator__box{display:inline-flex;align-items:center;justify-content:center;color:inherit;line-height:1;box-sizing:border-box;width:var(--cngx-checkbox-size, 1em);height:var(--cngx-checkbox-size, 1em);border:var(--cngx-checkbox-border, 1.5px solid currentColor);border-radius:var(--cngx-checkbox-radius);background:var(--cngx-checkbox-bg, transparent)}:scope.cngx-checkbox-indicator--checked .cngx-checkbox-indicator__box,:scope.cngx-checkbox-indicator--indeterminate .cngx-checkbox-indicator__box{background:var(--cngx-checkbox-checked-bg);border-color:var(--cngx-checkbox-checked-bg);color:var(--cngx-checkbox-checked-color, oklch(1 0 0))}:scope.cngx-checkbox-indicator--disabled{--cngx-checkbox-checked-bg: color-mix(in oklab, var(--cngx-color-text, oklch(.2 .01 250)) 38%, transparent);--cngx-checkbox-checked-color: var(--cngx-color-surface, oklch(1 0 0));color:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 38%,transparent)}.cngx-checkbox-indicator__check,.cngx-checkbox-indicator__dash{display:inline-flex;line-height:1;-webkit-user-select:none;user-select:none;--cngx-icon-svg-size: max( calc(var(--cngx-checkbox-size, 1em) * var(--cngx-checkbox-glyph-box-factor, .75)), var(--cngx-icon-svg-micro-floor, .75rem) );--cngx-icon-svg-stroke-width: var(--cngx-checkbox-glyph-stroke-width, 3)}:scope.cngx-checkbox-indicator--checkmark .cngx-checkbox-indicator__check,:scope.cngx-checkbox-indicator--checkmark .cngx-checkbox-indicator__dash{color:var(--cngx-checkbox-color);--cngx-icon-svg-size: max( calc(var(--cngx-checkbox-size, 1em) * .75), var(--cngx-icon-svg-micro-floor, .75rem), min(var(--cngx-checkbox-size, 1em), calc((var(--cngx-checkbox-size, 1em) - 14.5px) * 1000)) )}}}@media(forced-colors:active){.cngx-checkbox-indicator:is(.cngx-checkbox-indicator--checked,.cngx-checkbox-indicator--indeterminate) .cngx-checkbox-indicator__box{background:transparent;border-color:currentColor;color:currentColor}.cngx-checkbox-indicator.cngx-checkbox-indicator--checkmark :is(.cngx-checkbox-indicator__check,.cngx-checkbox-indicator__dash){color:currentColor}.cngx-checkbox-indicator.cngx-checkbox-indicator--disabled{color:GrayText}.cngx-checkbox-indicator.cngx-checkbox-indicator--disabled:is(.cngx-checkbox-indicator--checked,.cngx-checkbox-indicator--indeterminate) .cngx-checkbox-indicator__box{forced-color-adjust:none;background:GrayText;border-color:GrayText;color:Canvas}}\n"] }]
|
|
1207
1401
|
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], checkGlyph: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkGlyph", required: false }] }], dashGlyph: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashGlyph", required: false }] }] } });
|
|
1208
1402
|
|
|
1403
|
+
/**
|
|
1404
|
+
* Library defaults for the radio indicator configuration cascade.
|
|
1405
|
+
*
|
|
1406
|
+
* Exported for intra-lib consumers (`provideRadioConfig` merges over
|
|
1407
|
+
* this base) but **NOT** re-exported from `public-api.ts` - downstream
|
|
1408
|
+
* consumers reach the defaults via `inject(CNGX_RADIO_CONFIG)` so
|
|
1409
|
+
* `provideRadioConfig` / `provideRadioConfigAt` overrides take
|
|
1410
|
+
* precedence.
|
|
1411
|
+
*
|
|
1412
|
+
* @internal
|
|
1413
|
+
*/
|
|
1414
|
+
const CNGX_RADIO_DEFAULTS = {
|
|
1415
|
+
skin: 'default',
|
|
1416
|
+
};
|
|
1417
|
+
/**
|
|
1418
|
+
* App-wide configuration cascade for the radio indicator. Resolves in
|
|
1419
|
+
* priority order:
|
|
1420
|
+
*
|
|
1421
|
+
* 1. Per-instance `[skin]` binding (indicator, radio or group).
|
|
1422
|
+
* 2. `provideRadioConfigAt(...)` in a parent component's `viewProviders`.
|
|
1423
|
+
* 3. `provideRadioConfig(...)` at the application root.
|
|
1424
|
+
* 4. Library defaults (this token's `factory`).
|
|
1425
|
+
*
|
|
1426
|
+
* `providedIn: 'root'` with a default factory means consumers never
|
|
1427
|
+
* need to provide the token explicitly - `inject(CNGX_RADIO_CONFIG)`
|
|
1428
|
+
* always resolves. Lives in `@cngx/common/display` next to the
|
|
1429
|
+
* indicator, so it reaches every `cngx-radio-indicator`, including the
|
|
1430
|
+
* ones a select panel renders for its radio variant.
|
|
1431
|
+
*
|
|
1432
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/radio-indicator/config/radio.config.defaults.ts
|
|
1433
|
+
* @since 0.3.0
|
|
1434
|
+
*/
|
|
1435
|
+
const CNGX_RADIO_CONFIG = new InjectionToken('CNGX_RADIO_CONFIG', {
|
|
1436
|
+
providedIn: 'root',
|
|
1437
|
+
factory: () => CNGX_RADIO_DEFAULTS,
|
|
1438
|
+
});
|
|
1439
|
+
|
|
1440
|
+
/**
|
|
1441
|
+
* Convenience accessor for the radio indicator configuration cascade.
|
|
1442
|
+
* Runs in injection context; resolves through the priority chain
|
|
1443
|
+
* (`provideRadioConfigAt` → `provideRadioConfig` → library defaults).
|
|
1444
|
+
*
|
|
1445
|
+
* Equivalent to `inject(CNGX_RADIO_CONFIG)` - the helper exists so
|
|
1446
|
+
* consumers don't need to import the token directly. Mirrors
|
|
1447
|
+
* `injectTagConfig`.
|
|
1448
|
+
*
|
|
1449
|
+
* ```ts
|
|
1450
|
+
* export class MyChoiceCard {
|
|
1451
|
+
* private readonly radioConfig = injectRadioConfig();
|
|
1452
|
+
* protected readonly skin = computed(() => this.radioConfig.skin ?? 'default');
|
|
1453
|
+
* }
|
|
1454
|
+
* ```
|
|
1455
|
+
*/
|
|
1456
|
+
function injectRadioConfig() {
|
|
1457
|
+
return inject(CNGX_RADIO_CONFIG);
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1209
1460
|
/**
|
|
1210
1461
|
* Presentational radio indicator - circle with a centred dot when checked.
|
|
1462
|
+
* Ring and dot are two circles in one 24x24 SVG, so the dot shares the
|
|
1463
|
+
* ring's coordinate system and stays centred at every size and device
|
|
1464
|
+
* pixel ratio.
|
|
1211
1465
|
*
|
|
1212
1466
|
* **Why this exists.**
|
|
1213
1467
|
* The library's `@cngx/forms/select` panel currently composes
|
|
@@ -1223,7 +1477,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1223
1477
|
* land in their own phase.
|
|
1224
1478
|
*
|
|
1225
1479
|
* **Responsibilities (intentionally narrow).**
|
|
1226
|
-
* - Render a circle frame and
|
|
1480
|
+
* - Render a circle frame and a centred dot that scales in when `checked`
|
|
1481
|
+
* is true (always in the DOM, so the change transitions both ways).
|
|
1227
1482
|
* - Express checked / disabled visual state via host classes the
|
|
1228
1483
|
* consumer (or upstream CSS) can theme.
|
|
1229
1484
|
* - Apply size presets (`sm` / `md` / `lg`) as CSS-custom-property
|
|
@@ -1240,34 +1495,51 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1240
1495
|
* Selection is announced via the row's `role="radio"` /
|
|
1241
1496
|
* `aria-checked` ARIA, never by this decoration.
|
|
1242
1497
|
*
|
|
1243
|
-
* @category common/display
|
|
1244
|
-
* @docsKind primary
|
|
1245
1498
|
* @wcag AA
|
|
1246
1499
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/radio-indicator/radio-indicator.component.ts
|
|
1247
|
-
* @since 0.
|
|
1500
|
+
* @since 0.3.0
|
|
1248
1501
|
* @relatedTo CngxCheckboxIndicator, CngxIcon
|
|
1249
|
-
* <example-url
|
|
1250
|
-
* <example-url
|
|
1251
|
-
* <example-url
|
|
1252
|
-
* <example-url
|
|
1253
|
-
* <example-url
|
|
1502
|
+
* <example-url>/#/common/display/radio-indicator/custom-dotglyph</example-url>
|
|
1503
|
+
* <example-url>/#/common/display/radio-indicator/default-unchecked-vs-checked</example-url>
|
|
1504
|
+
* <example-url>/#/common/display/radio-indicator/disabled</example-url>
|
|
1505
|
+
* <example-url>/#/common/display/radio-indicator/sizes</example-url>
|
|
1506
|
+
* <example-url>/#/common/display/radio-indicator/skins</example-url>
|
|
1507
|
+
* <example-url>/#/common/display/radio-indicator/theming-via-css-custom-properties</example-url>
|
|
1508
|
+
* <example-url>/#/common/interactive/radio/group-skin</example-url>
|
|
1509
|
+
* <example-url>/#/forms/select/single-select/selection-indicator-variant-radio-check-skin</example-url>
|
|
1510
|
+
* @axis level atom
|
|
1254
1511
|
*/
|
|
1255
1512
|
class CngxRadioIndicator {
|
|
1256
1513
|
/** Whether the current value is selected. */
|
|
1257
1514
|
checked = input(false, ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
1258
1515
|
/**
|
|
1259
|
-
* Disabled visual state. Purely cosmetic (
|
|
1516
|
+
* Disabled visual state. Purely cosmetic (disabled text colour) - the indicator
|
|
1260
1517
|
* never intercepts events, so this is a hint, not a block.
|
|
1261
1518
|
*/
|
|
1262
1519
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1263
1520
|
/** Size preset. Maps to a `--cngx-radio-indicator-size` custom property. */
|
|
1264
1521
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1522
|
+
/**
|
|
1523
|
+
* Visual skin. `undefined` (default) falls back to the `CNGX_RADIO_CONFIG`
|
|
1524
|
+
* cascade (`provideRadioConfigAt` / `provideRadioConfig`), then to
|
|
1525
|
+
* `'default'`. `cngx-radio` binds this from its own or its group's
|
|
1526
|
+
* `[skin]`. Reflected as `[data-skin]` on the host.
|
|
1527
|
+
*/
|
|
1528
|
+
skin = input(undefined, ...(ngDevMode ? [{ debugName: "skin" }] : /* istanbul ignore next */ []));
|
|
1529
|
+
config = injectRadioConfig();
|
|
1530
|
+
resolvedSkin = computed(() => this.skin() ?? this.config.skin ?? 'default', ...(ngDevMode ? [{ debugName: "resolvedSkin" }] : /* istanbul ignore next */ []));
|
|
1531
|
+
checkIcon = CNGX_ICON_CHECK;
|
|
1265
1532
|
/**
|
|
1266
1533
|
* Consumer-supplied template for the centred dot. When `null` (default),
|
|
1267
|
-
* the built-in `<
|
|
1268
|
-
* rendered
|
|
1269
|
-
*
|
|
1270
|
-
*
|
|
1534
|
+
* the built-in SVG `<circle class="cngx-radio-indicator__dot">` is
|
|
1535
|
+
* rendered (the `__mark` check path under the `check` skin). When set,
|
|
1536
|
+
* neither is rendered; the consumer
|
|
1537
|
+
* template renders only while `checked` is true, inside a
|
|
1538
|
+
* `<span class="cngx-radio-indicator__glyph">` stacked over the SVG ring
|
|
1539
|
+
* and centred in the same box. The `__dot` class is NOT applied to the
|
|
1540
|
+
* custom content (consumers own the styling of their replacement). The
|
|
1541
|
+
* wrapper's `color` is the checked colour (the mark colour under the
|
|
1542
|
+
* `check` skin), so a `currentColor` glyph paints like the built-in dot.
|
|
1271
1543
|
*
|
|
1272
1544
|
* Convention-compatible with `CngxCheckboxIndicator.checkGlyph`: pass a
|
|
1273
1545
|
* `TemplateRef<void>` obtained via `#myDotTpl`. Useful for
|
|
@@ -1276,17 +1548,25 @@ class CngxRadioIndicator {
|
|
|
1276
1548
|
*/
|
|
1277
1549
|
dotGlyph = input(null, ...(ngDevMode ? [{ debugName: "dotGlyph" }] : /* istanbul ignore next */ []));
|
|
1278
1550
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxRadioIndicator, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1279
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxRadioIndicator, isStandalone: true, selector: "cngx-radio-indicator", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, dotGlyph: { classPropertyName: "dotGlyph", publicName: "dotGlyph", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" }, properties: { "class.cngx-radio-indicator--checked": "checked()", "class.cngx-radio-indicator--disabled": "disabled()", "class.cngx-radio-indicator--sm": "size() === 'sm'", "class.cngx-radio-indicator--md": "size() === 'md'", "class.cngx-radio-indicator--lg": "size() === 'lg'" }, classAttribute: "cngx-radio-indicator" }, exportAs: ["cngxRadioIndicator"], ngImport: i0, template: `
|
|
1280
|
-
<
|
|
1281
|
-
<
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1551
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxRadioIndicator, isStandalone: true, selector: "cngx-radio-indicator", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, skin: { classPropertyName: "skin", publicName: "skin", isSignal: true, isRequired: false, transformFunction: null }, dotGlyph: { classPropertyName: "dotGlyph", publicName: "dotGlyph", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" }, properties: { "class.cngx-radio-indicator--checked": "checked()", "class.cngx-radio-indicator--disabled": "disabled()", "class.cngx-radio-indicator--sm": "size() === 'sm'", "class.cngx-radio-indicator--md": "size() === 'md'", "class.cngx-radio-indicator--lg": "size() === 'lg'", "attr.data-skin": "resolvedSkin()" }, classAttribute: "cngx-radio-indicator" }, exportAs: ["cngxRadioIndicator"], ngImport: i0, template: `
|
|
1552
|
+
<svg class="cngx-radio-indicator__svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
|
1553
|
+
<circle class="cngx-radio-indicator__circle" cx="12" cy="12" r="11.25" />
|
|
1554
|
+
@if (!dotGlyph()) {
|
|
1555
|
+
@if (resolvedSkin() === 'check') {
|
|
1556
|
+
<path class="cngx-radio-indicator__mark" [attr.d]="checkIcon.d" />
|
|
1557
|
+
} @else {
|
|
1558
|
+
<circle class="cngx-radio-indicator__dot" cx="12" cy="12" r="12" />
|
|
1559
|
+
}
|
|
1287
1560
|
}
|
|
1288
|
-
</
|
|
1289
|
-
|
|
1561
|
+
</svg>
|
|
1562
|
+
@if (checked()) {
|
|
1563
|
+
@if (dotGlyph(); as glyph) {
|
|
1564
|
+
<span class="cngx-radio-indicator__glyph">
|
|
1565
|
+
<ng-container *ngTemplateOutlet="glyph" />
|
|
1566
|
+
</span>
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-radio-indicator-size{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-radio-indicator-color{syntax: \"*\"; inherits: true; initial-value: color-mix(in oklab,currentColor 55%,transparent);}@property --cngx-radio-indicator-bg{syntax: \"*\"; inherits: true; initial-value: transparent;}@property --cngx-radio-indicator-border-width{syntax: \"<number>\"; inherits: true; initial-value: 1.5;}@property --cngx-radio-indicator-checked-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-radio-indicator-transition{syntax: \"*\"; inherits: false; initial-value: fill .12s ease,stroke .12s ease,transform .12s ease,opacity .12s ease;}:where(.cngx-radio-indicator,.cngx-radio-indicator *){--cngx-radio-indicator-transition: fill var(--cngx-duration-fast, .12s) ease, stroke var(--cngx-duration-fast, .12s) ease, transform var(--cngx-duration-fast, .12s) ease, opacity var(--cngx-duration-fast, .12s) ease}:root{--cngx-radio-indicator-dot-scale: .54;--cngx-radio-indicator-mark-color: var(--cngx-color-surface, oklch(1 0 0));--cngx-radio-indicator-mark-scale: .75;--cngx-radio-indicator-mark-stroke-width: 3;--cngx-radio-indicator-tinted-dot-scale: .42}@property --cngx-radio-indicator-size-sm{syntax: \"*\"; inherits: true; initial-value: .875em;}@property --cngx-radio-indicator-size-md{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-radio-indicator-size-lg{syntax: \"*\"; inherits: true; initial-value: 1.25em;}:root{--cngx-radio-indicator-checked-color: var(--cngx-color-primary)}}@layer cngx.components{@scope(.cngx-radio-indicator){:scope{display:inline-grid;vertical-align:middle;line-height:1;flex:0 0 auto;inline-size:var(--cngx-radio-indicator-size, 1em);block-size:var(--cngx-radio-indicator-size, 1em);color:var(--cngx-radio-indicator-color)}:scope.cngx-radio-indicator--sm{--cngx-radio-indicator-size: var(--cngx-radio-indicator-size-sm, .875em)}:scope.cngx-radio-indicator--md{--cngx-radio-indicator-size: var(--cngx-radio-indicator-size-md, 1em)}:scope.cngx-radio-indicator--lg{--cngx-radio-indicator-size: var(--cngx-radio-indicator-size-lg, 1.25em)}.cngx-radio-indicator__svg{grid-area:1 / 1;display:block;inline-size:100%;block-size:100%;overflow:visible}.cngx-radio-indicator__circle{fill:var(--cngx-radio-indicator-bg, transparent);stroke:currentColor;stroke-width:var(--cngx-radio-indicator-border-width, 1.5);transition:var(--cngx-radio-indicator-transition)}:scope.cngx-radio-indicator--checked .cngx-radio-indicator__circle{stroke:var(--cngx-radio-indicator-checked-color)}.cngx-radio-indicator__dot{fill:var(--cngx-radio-indicator-checked-color);transform-box:fill-box;transform-origin:center;transform:scale(0);transition:var(--cngx-radio-indicator-transition)}:scope.cngx-radio-indicator--checked .cngx-radio-indicator__dot{transform:scale(var(--cngx-radio-indicator-dot-scale, .54))}.cngx-radio-indicator__mark{fill:none;stroke:var(--cngx-radio-indicator-mark-color, var(--cngx-color-surface, oklch(1 0 0)));stroke-width:var(--cngx-radio-indicator-mark-stroke-width, 3);stroke-linecap:round;stroke-linejoin:round;transform-box:view-box;transform-origin:center;transform:scale(var(--cngx-radio-indicator-mark-scale, .75));opacity:0;transition:var(--cngx-radio-indicator-transition)}.cngx-radio-indicator__glyph{grid-area:1 / 1;display:inline-flex;align-items:center;justify-content:center;color:var(--cngx-radio-indicator-checked-color)}:scope.cngx-radio-indicator--disabled{--cngx-radio-indicator-checked-color: currentColor;color:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 38%,transparent)}@media(prefers-reduced-motion:reduce){.cngx-radio-indicator__circle,.cngx-radio-indicator__dot,.cngx-radio-indicator__mark{transition:none}}}}@scope(.cngx-radio-indicator[data-skin=check]){:scope.cngx-radio-indicator--checked .cngx-radio-indicator__circle{fill:var(--cngx-radio-indicator-checked-color)}:scope.cngx-radio-indicator--checked .cngx-radio-indicator__mark{opacity:1}.cngx-radio-indicator__glyph{color:var(--cngx-radio-indicator-mark-color, var(--cngx-color-surface, oklch(1 0 0)))}}@scope(.cngx-radio-indicator[data-skin=tinted]){:scope.cngx-radio-indicator--checked .cngx-radio-indicator__circle{fill:color-mix(in oklab,var(--cngx-radio-indicator-checked-color) 16%,transparent)}:scope.cngx-radio-indicator--checked .cngx-radio-indicator__dot{transform:scale(var(--cngx-radio-indicator-tinted-dot-scale, .42))}}@media(forced-colors:active){.cngx-radio-indicator .cngx-radio-indicator__circle{stroke:var(--_cngx-forced-ink, CanvasText)}.cngx-radio-indicator .cngx-radio-indicator__dot{fill:var(--_cngx-forced-ink, CanvasText)}.cngx-radio-indicator .cngx-radio-indicator__glyph{color:var(--_cngx-forced-ink, CanvasText)}.cngx-radio-indicator[data-skin].cngx-radio-indicator--checked .cngx-radio-indicator__circle{fill:none}.cngx-radio-indicator[data-skin=check] .cngx-radio-indicator__mark{stroke:var(--_cngx-forced-ink, CanvasText)}.cngx-radio-indicator[data-skin=check] .cngx-radio-indicator__glyph{color:var(--_cngx-forced-ink, CanvasText)}.cngx-radio-indicator.cngx-radio-indicator--disabled{color:GrayText}.cngx-radio-indicator.cngx-radio-indicator--disabled .cngx-radio-indicator__circle{stroke:GrayText}.cngx-radio-indicator.cngx-radio-indicator--disabled .cngx-radio-indicator__dot{fill:GrayText}.cngx-radio-indicator.cngx-radio-indicator--disabled .cngx-radio-indicator__mark,.cngx-radio-indicator.cngx-radio-indicator--disabled .cngx-radio-indicator__glyph{stroke:GrayText;color:GrayText}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1290
1570
|
}
|
|
1291
1571
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxRadioIndicator, decorators: [{
|
|
1292
1572
|
type: Component,
|
|
@@ -1298,18 +1578,127 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1298
1578
|
'[class.cngx-radio-indicator--sm]': "size() === 'sm'",
|
|
1299
1579
|
'[class.cngx-radio-indicator--md]': "size() === 'md'",
|
|
1300
1580
|
'[class.cngx-radio-indicator--lg]': "size() === 'lg'",
|
|
1581
|
+
'[attr.data-skin]': 'resolvedSkin()',
|
|
1301
1582
|
}, template: `
|
|
1302
|
-
<
|
|
1303
|
-
<
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1583
|
+
<svg class="cngx-radio-indicator__svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
|
1584
|
+
<circle class="cngx-radio-indicator__circle" cx="12" cy="12" r="11.25" />
|
|
1585
|
+
@if (!dotGlyph()) {
|
|
1586
|
+
@if (resolvedSkin() === 'check') {
|
|
1587
|
+
<path class="cngx-radio-indicator__mark" [attr.d]="checkIcon.d" />
|
|
1588
|
+
} @else {
|
|
1589
|
+
<circle class="cngx-radio-indicator__dot" cx="12" cy="12" r="12" />
|
|
1590
|
+
}
|
|
1309
1591
|
}
|
|
1310
|
-
</
|
|
1311
|
-
|
|
1312
|
-
|
|
1592
|
+
</svg>
|
|
1593
|
+
@if (checked()) {
|
|
1594
|
+
@if (dotGlyph(); as glyph) {
|
|
1595
|
+
<span class="cngx-radio-indicator__glyph">
|
|
1596
|
+
<ng-container *ngTemplateOutlet="glyph" />
|
|
1597
|
+
</span>
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
`, styles: ["@layer cngx.tokens{@property --cngx-radio-indicator-size{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-radio-indicator-color{syntax: \"*\"; inherits: true; initial-value: color-mix(in oklab,currentColor 55%,transparent);}@property --cngx-radio-indicator-bg{syntax: \"*\"; inherits: true; initial-value: transparent;}@property --cngx-radio-indicator-border-width{syntax: \"<number>\"; inherits: true; initial-value: 1.5;}@property --cngx-radio-indicator-checked-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-radio-indicator-transition{syntax: \"*\"; inherits: false; initial-value: fill .12s ease,stroke .12s ease,transform .12s ease,opacity .12s ease;}:where(.cngx-radio-indicator,.cngx-radio-indicator *){--cngx-radio-indicator-transition: fill var(--cngx-duration-fast, .12s) ease, stroke var(--cngx-duration-fast, .12s) ease, transform var(--cngx-duration-fast, .12s) ease, opacity var(--cngx-duration-fast, .12s) ease}:root{--cngx-radio-indicator-dot-scale: .54;--cngx-radio-indicator-mark-color: var(--cngx-color-surface, oklch(1 0 0));--cngx-radio-indicator-mark-scale: .75;--cngx-radio-indicator-mark-stroke-width: 3;--cngx-radio-indicator-tinted-dot-scale: .42}@property --cngx-radio-indicator-size-sm{syntax: \"*\"; inherits: true; initial-value: .875em;}@property --cngx-radio-indicator-size-md{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-radio-indicator-size-lg{syntax: \"*\"; inherits: true; initial-value: 1.25em;}:root{--cngx-radio-indicator-checked-color: var(--cngx-color-primary)}}@layer cngx.components{@scope(.cngx-radio-indicator){:scope{display:inline-grid;vertical-align:middle;line-height:1;flex:0 0 auto;inline-size:var(--cngx-radio-indicator-size, 1em);block-size:var(--cngx-radio-indicator-size, 1em);color:var(--cngx-radio-indicator-color)}:scope.cngx-radio-indicator--sm{--cngx-radio-indicator-size: var(--cngx-radio-indicator-size-sm, .875em)}:scope.cngx-radio-indicator--md{--cngx-radio-indicator-size: var(--cngx-radio-indicator-size-md, 1em)}:scope.cngx-radio-indicator--lg{--cngx-radio-indicator-size: var(--cngx-radio-indicator-size-lg, 1.25em)}.cngx-radio-indicator__svg{grid-area:1 / 1;display:block;inline-size:100%;block-size:100%;overflow:visible}.cngx-radio-indicator__circle{fill:var(--cngx-radio-indicator-bg, transparent);stroke:currentColor;stroke-width:var(--cngx-radio-indicator-border-width, 1.5);transition:var(--cngx-radio-indicator-transition)}:scope.cngx-radio-indicator--checked .cngx-radio-indicator__circle{stroke:var(--cngx-radio-indicator-checked-color)}.cngx-radio-indicator__dot{fill:var(--cngx-radio-indicator-checked-color);transform-box:fill-box;transform-origin:center;transform:scale(0);transition:var(--cngx-radio-indicator-transition)}:scope.cngx-radio-indicator--checked .cngx-radio-indicator__dot{transform:scale(var(--cngx-radio-indicator-dot-scale, .54))}.cngx-radio-indicator__mark{fill:none;stroke:var(--cngx-radio-indicator-mark-color, var(--cngx-color-surface, oklch(1 0 0)));stroke-width:var(--cngx-radio-indicator-mark-stroke-width, 3);stroke-linecap:round;stroke-linejoin:round;transform-box:view-box;transform-origin:center;transform:scale(var(--cngx-radio-indicator-mark-scale, .75));opacity:0;transition:var(--cngx-radio-indicator-transition)}.cngx-radio-indicator__glyph{grid-area:1 / 1;display:inline-flex;align-items:center;justify-content:center;color:var(--cngx-radio-indicator-checked-color)}:scope.cngx-radio-indicator--disabled{--cngx-radio-indicator-checked-color: currentColor;color:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 38%,transparent)}@media(prefers-reduced-motion:reduce){.cngx-radio-indicator__circle,.cngx-radio-indicator__dot,.cngx-radio-indicator__mark{transition:none}}}}@scope(.cngx-radio-indicator[data-skin=check]){:scope.cngx-radio-indicator--checked .cngx-radio-indicator__circle{fill:var(--cngx-radio-indicator-checked-color)}:scope.cngx-radio-indicator--checked .cngx-radio-indicator__mark{opacity:1}.cngx-radio-indicator__glyph{color:var(--cngx-radio-indicator-mark-color, var(--cngx-color-surface, oklch(1 0 0)))}}@scope(.cngx-radio-indicator[data-skin=tinted]){:scope.cngx-radio-indicator--checked .cngx-radio-indicator__circle{fill:color-mix(in oklab,var(--cngx-radio-indicator-checked-color) 16%,transparent)}:scope.cngx-radio-indicator--checked .cngx-radio-indicator__dot{transform:scale(var(--cngx-radio-indicator-tinted-dot-scale, .42))}}@media(forced-colors:active){.cngx-radio-indicator .cngx-radio-indicator__circle{stroke:var(--_cngx-forced-ink, CanvasText)}.cngx-radio-indicator .cngx-radio-indicator__dot{fill:var(--_cngx-forced-ink, CanvasText)}.cngx-radio-indicator .cngx-radio-indicator__glyph{color:var(--_cngx-forced-ink, CanvasText)}.cngx-radio-indicator[data-skin].cngx-radio-indicator--checked .cngx-radio-indicator__circle{fill:none}.cngx-radio-indicator[data-skin=check] .cngx-radio-indicator__mark{stroke:var(--_cngx-forced-ink, CanvasText)}.cngx-radio-indicator[data-skin=check] .cngx-radio-indicator__glyph{color:var(--_cngx-forced-ink, CanvasText)}.cngx-radio-indicator.cngx-radio-indicator--disabled{color:GrayText}.cngx-radio-indicator.cngx-radio-indicator--disabled .cngx-radio-indicator__circle{stroke:GrayText}.cngx-radio-indicator.cngx-radio-indicator--disabled .cngx-radio-indicator__dot{fill:GrayText}.cngx-radio-indicator.cngx-radio-indicator--disabled .cngx-radio-indicator__mark,.cngx-radio-indicator.cngx-radio-indicator--disabled .cngx-radio-indicator__glyph{stroke:GrayText;color:GrayText}}\n"] }]
|
|
1601
|
+
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], skin: [{ type: i0.Input, args: [{ isSignal: true, alias: "skin", required: false }] }], dotGlyph: [{ type: i0.Input, args: [{ isSignal: true, alias: "dotGlyph", required: false }] }] } });
|
|
1602
|
+
|
|
1603
|
+
/**
|
|
1604
|
+
* Reduces a list of feature objects into a partial config - last write
|
|
1605
|
+
* wins per key.
|
|
1606
|
+
*
|
|
1607
|
+
* @internal
|
|
1608
|
+
*/
|
|
1609
|
+
function reduceFeatures$1(features) {
|
|
1610
|
+
const out = {};
|
|
1611
|
+
for (const f of features) {
|
|
1612
|
+
switch (f.kind) {
|
|
1613
|
+
case 'skin':
|
|
1614
|
+
out.skin = f.payload;
|
|
1615
|
+
break;
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
return out;
|
|
1619
|
+
}
|
|
1620
|
+
/** @internal */
|
|
1621
|
+
function mergeConfig$1(base, partial) {
|
|
1622
|
+
return { ...base, ...partial };
|
|
1623
|
+
}
|
|
1624
|
+
/**
|
|
1625
|
+
* Application-root configuration cascade for the radio indicator. Pass
|
|
1626
|
+
* `withRadioSkin(...)` in `bootstrapApplication`'s providers array.
|
|
1627
|
+
*
|
|
1628
|
+
* Resolution priority (high → low):
|
|
1629
|
+
* 1. Per-instance `[skin]` binding (indicator, radio or group).
|
|
1630
|
+
* 2. `provideRadioConfigAt(...)` in a parent component's
|
|
1631
|
+
* `viewProviders`.
|
|
1632
|
+
* 3. `provideRadioConfig(...)` at the application root.
|
|
1633
|
+
* 4. Library defaults (`CNGX_RADIO_DEFAULTS`).
|
|
1634
|
+
*
|
|
1635
|
+
* ```ts
|
|
1636
|
+
* bootstrapApplication(AppComponent, {
|
|
1637
|
+
* providers: [provideRadioConfig(withRadioSkin('tinted'))],
|
|
1638
|
+
* });
|
|
1639
|
+
* ```
|
|
1640
|
+
*/
|
|
1641
|
+
function provideRadioConfig(...features) {
|
|
1642
|
+
// Empty-features: the root factory's CNGX_RADIO_DEFAULTS reference flows
|
|
1643
|
+
// through untouched instead of an identical copy under a new reference.
|
|
1644
|
+
if (features.length === 0) {
|
|
1645
|
+
return makeEnvironmentProviders([]);
|
|
1646
|
+
}
|
|
1647
|
+
const partial = reduceFeatures$1(features);
|
|
1648
|
+
return makeEnvironmentProviders([
|
|
1649
|
+
{
|
|
1650
|
+
provide: CNGX_RADIO_CONFIG,
|
|
1651
|
+
useValue: mergeConfig$1(CNGX_RADIO_DEFAULTS, partial),
|
|
1652
|
+
},
|
|
1653
|
+
]);
|
|
1654
|
+
}
|
|
1655
|
+
/**
|
|
1656
|
+
* Component-scoped configuration cascade for the radio indicator. Pass
|
|
1657
|
+
* `withRadioSkin(...)` in a parent component's `viewProviders` array.
|
|
1658
|
+
*
|
|
1659
|
+
* Injects the parent injector's `CNGX_RADIO_CONFIG` value (root
|
|
1660
|
+
* provider, library defaults, or another `provideRadioConfigAt` further
|
|
1661
|
+
* up) and merges the supplied features on top, so descendant indicators
|
|
1662
|
+
* see the merged config and sibling sub-trees keep the inherited value.
|
|
1663
|
+
*
|
|
1664
|
+
* ```ts
|
|
1665
|
+
* @Component({
|
|
1666
|
+
* selector: 'plan-picker',
|
|
1667
|
+
* viewProviders: [provideRadioConfigAt(withRadioSkin('check'))],
|
|
1668
|
+
* template: '<cngx-radio-group [(value)]="plan">...</cngx-radio-group>',
|
|
1669
|
+
* })
|
|
1670
|
+
* class PlanPicker {}
|
|
1671
|
+
* ```
|
|
1672
|
+
*/
|
|
1673
|
+
function provideRadioConfigAt(...features) {
|
|
1674
|
+
// Empty-features call: parent value flows through untouched, preserving
|
|
1675
|
+
// reference identity through the sub-tree.
|
|
1676
|
+
if (features.length === 0) {
|
|
1677
|
+
return [];
|
|
1678
|
+
}
|
|
1679
|
+
const partial = reduceFeatures$1(features);
|
|
1680
|
+
return [
|
|
1681
|
+
{
|
|
1682
|
+
provide: CNGX_RADIO_CONFIG,
|
|
1683
|
+
useFactory: () => {
|
|
1684
|
+
const parent = inject(CNGX_RADIO_CONFIG, { skipSelf: true });
|
|
1685
|
+
return mergeConfig$1(parent, partial);
|
|
1686
|
+
},
|
|
1687
|
+
},
|
|
1688
|
+
];
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
/**
|
|
1692
|
+
* Set the skin every `cngx-radio-indicator` in scope falls back to.
|
|
1693
|
+
* An instance or group `[skin]` binding still wins.
|
|
1694
|
+
*
|
|
1695
|
+
* ```ts
|
|
1696
|
+
* provideRadioConfig(withRadioSkin('check'));
|
|
1697
|
+
* ```
|
|
1698
|
+
*/
|
|
1699
|
+
function withRadioSkin(skin) {
|
|
1700
|
+
return { kind: 'skin', payload: skin };
|
|
1701
|
+
}
|
|
1313
1702
|
|
|
1314
1703
|
/**
|
|
1315
1704
|
* Unit ladder for the relative formatter, smallest first. Each `amount` is the
|
|
@@ -1349,12 +1738,11 @@ const RELATIVE_DIVISIONS = [
|
|
|
1349
1738
|
* <cngx-time [date]="invoice.due" [format]="{ dateStyle: 'long' }" />
|
|
1350
1739
|
* ```
|
|
1351
1740
|
*
|
|
1352
|
-
* @category common/display
|
|
1353
|
-
* @docsKind primary
|
|
1354
1741
|
* @wcag AA
|
|
1355
1742
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/time/time.component.ts
|
|
1356
|
-
* @since 0.
|
|
1743
|
+
* @since 0.3.0
|
|
1357
1744
|
* @relatedTo CngxCardTimestamp
|
|
1745
|
+
* @axis level atom
|
|
1358
1746
|
*/
|
|
1359
1747
|
class CngxTime {
|
|
1360
1748
|
locale = injectLocale();
|
|
@@ -1409,10 +1797,10 @@ class CngxTime {
|
|
|
1409
1797
|
return dateTimeFormatterFor(locale, format).format(instant);
|
|
1410
1798
|
}, ...(ngDevMode ? [{ debugName: "formatted" }] : /* istanbul ignore next */ []));
|
|
1411
1799
|
constructor() {
|
|
1412
|
-
if (
|
|
1800
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
1413
1801
|
effect(() => {
|
|
1414
1802
|
if (!this.isValidDate()) {
|
|
1415
|
-
|
|
1803
|
+
cngxDevWarn('CNGX1006', '[cngx-time] [date] resolved to an Invalid Date - rendering empty. ' +
|
|
1416
1804
|
'Check the bound value (bad ISO string?).');
|
|
1417
1805
|
}
|
|
1418
1806
|
});
|
|
@@ -1459,13 +1847,12 @@ const filledEqual = (a, b) => a.length === b.length && a.every((v, i) => v === b
|
|
|
1459
1847
|
* <cngx-password-strength-meter [score]="pw.score()" />
|
|
1460
1848
|
* ```
|
|
1461
1849
|
*
|
|
1462
|
-
* @category common/display
|
|
1463
|
-
* @docsKind primary
|
|
1464
1850
|
* @wcag AA
|
|
1465
1851
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/password-strength-meter/password-strength-meter.component.ts
|
|
1466
|
-
* @since 0.
|
|
1852
|
+
* @since 0.3.0
|
|
1467
1853
|
* @relatedTo CngxSegmentedProgress, CngxBadge
|
|
1468
|
-
* <example-url
|
|
1854
|
+
* <example-url>/#/common/display/password-strength-meter/strength-levels</example-url>
|
|
1855
|
+
* @axis level atom
|
|
1469
1856
|
*/
|
|
1470
1857
|
class CngxPasswordStrengthMeter {
|
|
1471
1858
|
/** Strength score, 0 (empty/trivial) to 4 (strong). */
|
|
@@ -1517,10 +1904,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1517
1904
|
* Defaults to no provider - the token resolves to `null` for any
|
|
1518
1905
|
* `CngxTag` that lives outside a `CngxTagGroup`.
|
|
1519
1906
|
*
|
|
1520
|
-
* @category common/display
|
|
1521
1907
|
* @wcag AA
|
|
1522
1908
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/tag-group/tag-group.token.ts
|
|
1523
|
-
* @since 0.
|
|
1909
|
+
* @since 0.3.0
|
|
1524
1910
|
*/
|
|
1525
1911
|
const CNGX_TAG_GROUP = new InjectionToken('CNGX_TAG_GROUP');
|
|
1526
1912
|
|
|
@@ -1569,9 +1955,8 @@ const CNGX_TAG_DEFAULTS = {
|
|
|
1569
1955
|
* (root cascade) or `provideTagConfigAt(...features)` in a component's
|
|
1570
1956
|
* `viewProviders` (sub-tree cascade).
|
|
1571
1957
|
*
|
|
1572
|
-
* @category common/display
|
|
1573
1958
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/tag/config/tag.config.defaults.ts
|
|
1574
|
-
* @since 0.
|
|
1959
|
+
* @since 0.3.0
|
|
1575
1960
|
*/
|
|
1576
1961
|
const CNGX_TAG_CONFIG = new InjectionToken('CNGX_TAG_CONFIG', {
|
|
1577
1962
|
providedIn: 'root',
|
|
@@ -1596,8 +1981,6 @@ const CNGX_TAG_CONFIG = new InjectionToken('CNGX_TAG_CONFIG', {
|
|
|
1596
1981
|
* );
|
|
1597
1982
|
* }
|
|
1598
1983
|
* ```
|
|
1599
|
-
*
|
|
1600
|
-
* @category common/display
|
|
1601
1984
|
*/
|
|
1602
1985
|
function injectTagConfig() {
|
|
1603
1986
|
return inject(CNGX_TAG_CONFIG);
|
|
@@ -1664,23 +2047,22 @@ function injectResolvedTagTemplate(directive, configKey) {
|
|
|
1664
2047
|
* </span>
|
|
1665
2048
|
* ```
|
|
1666
2049
|
*
|
|
1667
|
-
* @category common/display
|
|
1668
2050
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/tag/slots/tag-label.directive.ts
|
|
1669
|
-
* @since 0.
|
|
2051
|
+
* @since 0.3.0
|
|
1670
2052
|
* @relatedTo CngxTag, CngxTagPrefix, CngxTagSuffix
|
|
1671
|
-
* <example-url
|
|
1672
|
-
* <example-url
|
|
1673
|
-
* <example-url
|
|
1674
|
-
* <example-url
|
|
1675
|
-
* <example-url
|
|
1676
|
-
* <example-url
|
|
1677
|
-
* <example-url
|
|
1678
|
-
* <example-url
|
|
1679
|
-
* <example-url
|
|
1680
|
-
* <example-url
|
|
1681
|
-
* <example-url
|
|
1682
|
-
* <example-url
|
|
1683
|
-
* <example-url
|
|
2053
|
+
* <example-url>/#/common/display/tag/app-wide-defaults-via-providetagconfig</example-url>
|
|
2054
|
+
* <example-url>/#/common/display/tag/color-palette</example-url>
|
|
2055
|
+
* <example-url>/#/common/display/tag/composition-with-cngxicon</example-url>
|
|
2056
|
+
* <example-url>/#/common/display/tag/density</example-url>
|
|
2057
|
+
* <example-url>/#/common/display/tag/group-semantic-list</example-url>
|
|
2058
|
+
* <example-url>/#/common/display/tag/group-with-header-accessory</example-url>
|
|
2059
|
+
* <example-url>/#/common/display/tag/layout-only-alignment</example-url>
|
|
2060
|
+
* <example-url>/#/common/display/tag/layout-only-gap-variants</example-url>
|
|
2061
|
+
* <example-url>/#/common/display/tag/link-mode</example-url>
|
|
2062
|
+
* <example-url>/#/common/display/tag/slot-overrides-custom-label</example-url>
|
|
2063
|
+
* <example-url>/#/common/display/tag/slot-overrides-prefix-label-suffix</example-url>
|
|
2064
|
+
* <example-url>/#/common/display/tag/truncate-maxwidth</example-url>
|
|
2065
|
+
* <example-url>/#/common/display/tag/variant-matrix</example-url>
|
|
1684
2066
|
*/
|
|
1685
2067
|
class CngxTagLabel {
|
|
1686
2068
|
templateRef = inject(TemplateRef);
|
|
@@ -1713,23 +2095,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1713
2095
|
* </span>
|
|
1714
2096
|
* ```
|
|
1715
2097
|
*
|
|
1716
|
-
* @category common/display
|
|
1717
2098
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/tag/slots/tag-prefix.directive.ts
|
|
1718
|
-
* @since 0.
|
|
2099
|
+
* @since 0.3.0
|
|
1719
2100
|
* @relatedTo CngxTag, CngxTagLabel, CngxTagSuffix
|
|
1720
|
-
* <example-url
|
|
1721
|
-
* <example-url
|
|
1722
|
-
* <example-url
|
|
1723
|
-
* <example-url
|
|
1724
|
-
* <example-url
|
|
1725
|
-
* <example-url
|
|
1726
|
-
* <example-url
|
|
1727
|
-
* <example-url
|
|
1728
|
-
* <example-url
|
|
1729
|
-
* <example-url
|
|
1730
|
-
* <example-url
|
|
1731
|
-
* <example-url
|
|
1732
|
-
* <example-url
|
|
2101
|
+
* <example-url>/#/common/display/tag/app-wide-defaults-via-providetagconfig</example-url>
|
|
2102
|
+
* <example-url>/#/common/display/tag/color-palette</example-url>
|
|
2103
|
+
* <example-url>/#/common/display/tag/composition-with-cngxicon</example-url>
|
|
2104
|
+
* <example-url>/#/common/display/tag/density</example-url>
|
|
2105
|
+
* <example-url>/#/common/display/tag/group-semantic-list</example-url>
|
|
2106
|
+
* <example-url>/#/common/display/tag/group-with-header-accessory</example-url>
|
|
2107
|
+
* <example-url>/#/common/display/tag/layout-only-alignment</example-url>
|
|
2108
|
+
* <example-url>/#/common/display/tag/layout-only-gap-variants</example-url>
|
|
2109
|
+
* <example-url>/#/common/display/tag/link-mode</example-url>
|
|
2110
|
+
* <example-url>/#/common/display/tag/slot-overrides-custom-label</example-url>
|
|
2111
|
+
* <example-url>/#/common/display/tag/slot-overrides-prefix-label-suffix</example-url>
|
|
2112
|
+
* <example-url>/#/common/display/tag/truncate-maxwidth</example-url>
|
|
2113
|
+
* <example-url>/#/common/display/tag/variant-matrix</example-url>
|
|
1733
2114
|
*/
|
|
1734
2115
|
class CngxTagPrefix {
|
|
1735
2116
|
templateRef = inject(TemplateRef);
|
|
@@ -1764,23 +2145,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1764
2145
|
* </span>
|
|
1765
2146
|
* ```
|
|
1766
2147
|
*
|
|
1767
|
-
* @category common/display
|
|
1768
2148
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/tag/slots/tag-suffix.directive.ts
|
|
1769
|
-
* @since 0.
|
|
2149
|
+
* @since 0.3.0
|
|
1770
2150
|
* @relatedTo CngxTag, CngxTagLabel, CngxTagPrefix
|
|
1771
|
-
* <example-url
|
|
1772
|
-
* <example-url
|
|
1773
|
-
* <example-url
|
|
1774
|
-
* <example-url
|
|
1775
|
-
* <example-url
|
|
1776
|
-
* <example-url
|
|
1777
|
-
* <example-url
|
|
1778
|
-
* <example-url
|
|
1779
|
-
* <example-url
|
|
1780
|
-
* <example-url
|
|
1781
|
-
* <example-url
|
|
1782
|
-
* <example-url
|
|
1783
|
-
* <example-url
|
|
2151
|
+
* <example-url>/#/common/display/tag/app-wide-defaults-via-providetagconfig</example-url>
|
|
2152
|
+
* <example-url>/#/common/display/tag/color-palette</example-url>
|
|
2153
|
+
* <example-url>/#/common/display/tag/composition-with-cngxicon</example-url>
|
|
2154
|
+
* <example-url>/#/common/display/tag/density</example-url>
|
|
2155
|
+
* <example-url>/#/common/display/tag/group-semantic-list</example-url>
|
|
2156
|
+
* <example-url>/#/common/display/tag/group-with-header-accessory</example-url>
|
|
2157
|
+
* <example-url>/#/common/display/tag/layout-only-alignment</example-url>
|
|
2158
|
+
* <example-url>/#/common/display/tag/layout-only-gap-variants</example-url>
|
|
2159
|
+
* <example-url>/#/common/display/tag/link-mode</example-url>
|
|
2160
|
+
* <example-url>/#/common/display/tag/slot-overrides-custom-label</example-url>
|
|
2161
|
+
* <example-url>/#/common/display/tag/slot-overrides-prefix-label-suffix</example-url>
|
|
2162
|
+
* <example-url>/#/common/display/tag/truncate-maxwidth</example-url>
|
|
2163
|
+
* <example-url>/#/common/display/tag/variant-matrix</example-url>
|
|
1784
2164
|
*/
|
|
1785
2165
|
class CngxTagSuffix {
|
|
1786
2166
|
templateRef = inject(TemplateRef);
|
|
@@ -1839,29 +2219,28 @@ const PREDEFINED_TAG_COLORS = new Set([
|
|
|
1839
2219
|
* - Configuration cascade - deferred (see
|
|
1840
2220
|
* `display-accepted-debt.md §1`).
|
|
1841
2221
|
*
|
|
1842
|
-
* @category common/display
|
|
1843
|
-
* @docsKind primary
|
|
1844
2222
|
* @wcag AA
|
|
1845
2223
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/tag/tag.directive.ts
|
|
1846
2224
|
* @selector cngx-tag
|
|
1847
|
-
* @since 0.
|
|
2225
|
+
* @since 0.3.0
|
|
1848
2226
|
* @relatedTo CngxTagGroup, CngxChip, CngxBadge, CngxTagLabel
|
|
1849
2227
|
* @slot cngxTagLabel Replaces the tag's text body.
|
|
1850
2228
|
* @slot cngxTagPrefix Content before the label, typically an icon or swatch.
|
|
1851
2229
|
* @slot cngxTagSuffix Content after the label, typically a remove affordance.
|
|
1852
|
-
* <example-url
|
|
1853
|
-
* <example-url
|
|
1854
|
-
* <example-url
|
|
1855
|
-
* <example-url
|
|
1856
|
-
* <example-url
|
|
1857
|
-
* <example-url
|
|
1858
|
-
* <example-url
|
|
1859
|
-
* <example-url
|
|
1860
|
-
* <example-url
|
|
1861
|
-
* <example-url
|
|
1862
|
-
* <example-url
|
|
1863
|
-
* <example-url
|
|
1864
|
-
* <example-url
|
|
2230
|
+
* <example-url>/#/common/display/tag/app-wide-defaults-via-providetagconfig</example-url>
|
|
2231
|
+
* <example-url>/#/common/display/tag/color-palette</example-url>
|
|
2232
|
+
* <example-url>/#/common/display/tag/composition-with-cngxicon</example-url>
|
|
2233
|
+
* <example-url>/#/common/display/tag/density</example-url>
|
|
2234
|
+
* <example-url>/#/common/display/tag-group/semantic-list</example-url>
|
|
2235
|
+
* <example-url>/#/common/display/tag-group/with-header-accessory</example-url>
|
|
2236
|
+
* <example-url>/#/common/display/tag-group/alignment</example-url>
|
|
2237
|
+
* <example-url>/#/common/display/tag-group/gap-variants</example-url>
|
|
2238
|
+
* <example-url>/#/common/display/tag/link-mode</example-url>
|
|
2239
|
+
* <example-url>/#/common/display/tag/slot-overrides-custom-label</example-url>
|
|
2240
|
+
* <example-url>/#/common/display/tag/slot-overrides-prefix-label-suffix</example-url>
|
|
2241
|
+
* <example-url>/#/common/display/tag/truncate-maxwidth</example-url>
|
|
2242
|
+
* <example-url>/#/common/display/tag/variant-matrix</example-url>
|
|
2243
|
+
* @axis level molecule
|
|
1865
2244
|
*/
|
|
1866
2245
|
class CngxTag {
|
|
1867
2246
|
/**
|
|
@@ -2008,7 +2387,7 @@ class CngxTag {
|
|
|
2008
2387
|
@if (suffixTpl(); as t) {
|
|
2009
2388
|
<ng-container *ngTemplateOutlet="t; context: slotContext()" />
|
|
2010
2389
|
}
|
|
2011
|
-
`, isInline: true, styles: ["@layer cngx.components{@scope(.cngx-tag){:scope{--cngx-tag-gap: var(--cngx-space-xs);--cngx-tag-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-tag-sm-padding: 0 var(--cngx-space-xs);--cngx-tag-lg-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-tag-xl-padding: var(--cngx-space-xs) var(--cngx-space-sm);display:inline-flex;align-items:center;line-height:1.25;max-width:100%;gap:var(--cngx-tag-gap, var(--cngx-space-xs, 4px));padding:var(--cngx-tag-padding, 2px 8px);font-size:var(--cngx-tag-font-size, var(--cngx-font-size-sm, .75rem))}:scope.cngx-tag--sm{padding:var(--cngx-tag-sm-padding, 0 6px);font-size:var(--cngx-tag-sm-font-size, .6875rem)}:scope.cngx-tag--lg{padding:var(--cngx-tag-lg-padding, 4px 10px);font-size:var(--cngx-tag-lg-font-size, .875rem)}:scope.cngx-tag--xl{padding:var(--cngx-tag-xl-padding, 6px 12px);font-size:var(--cngx-tag-xl-font-size, 1rem)}.cngx-tag__label{min-width:0;overflow:hidden}:scope.cngx-tag--truncate .cngx-tag__label{text-overflow:ellipsis;white-space:nowrap}}@scope(.cngx-tag-group){:scope{--cngx-tag-group-stack-gap: var(--cngx-space-sm);display:flex;flex-direction:column;gap:var(--cngx-tag-group-stack-gap, var(--cngx-space-sm, 8px))}.cngx-tag-group__row{--cngx-tag-group-gap: var(--cngx-space-sm);display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:var(--cngx-tag-group-gap, var(--cngx-space-sm, 8px))}:scope.cngx-tag-group--gap-xs>.cngx-tag-group__row{--cngx-tag-group-gap-xs: var(--cngx-space-xs);gap:var(--cngx-tag-group-gap-xs, var(--cngx-space-xs, 4px))}:scope.cngx-tag-group--gap-md>.cngx-tag-group__row{--cngx-tag-group-gap-md: var(--cngx-space-sm);gap:var(--cngx-tag-group-gap-md, 12px)}:scope.cngx-tag-group--align-start>.cngx-tag-group__row{justify-content:flex-start}:scope.cngx-tag-group--align-center>.cngx-tag-group__row{justify-content:center}:scope.cngx-tag-group--align-end>.cngx-tag-group__row{justify-content:flex-end}:scope.cngx-tag-group--align-between>.cngx-tag-group__row{justify-content:space-between}}}\n", "@layer cngx.tokens{@property --cngx-tag-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-tag-font-weight{syntax: \"*\"; inherits: false; initial-value: 500;}@property --cngx-tag-bg{syntax: \"*\"; inherits: false; initial-value: transparent;}@property --cngx-tag-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-tag-border{syntax: \"*\"; inherits: false; initial-value: 1px solid transparent;}@property --cngx-tag-gap{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-tag-padding{syntax: \"*\"; inherits: false; initial-value: 2px 8px;}@property --cngx-tag-font-size{syntax: \"*\"; inherits: false; initial-value: .75rem;}@property --cngx-tag-sm-padding{syntax: \"*\"; inherits: false; initial-value: 0 6px;}@property --cngx-tag-sm-font-size{syntax: \"*\"; inherits: false; initial-value: .6875rem;}@property --cngx-tag-lg-padding{syntax: \"*\"; inherits: false; initial-value: 4px 10px;}@property --cngx-tag-lg-font-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}@property --cngx-tag-xl-padding{syntax: \"*\"; inherits: false; initial-value: 6px 12px;}@property --cngx-tag-xl-font-size{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-tag-neutral-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.92 .005 250);}@property --cngx-tag-neutral-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.34 .015 250);}@property --cngx-tag-neutral-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 250);}@property --cngx-tag-neutral-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.96 .005 250);}@property --cngx-tag-success-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.95 .05 145);}@property --cngx-tag-success-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.4 .1 160);}@property --cngx-tag-success-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .15 155);}@property --cngx-tag-success-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.97 .025 145);}@property --cngx-tag-warning-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.95 .05 90);}@property --cngx-tag-warning-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 .12 60);}@property --cngx-tag-warning-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .18 70);}@property --cngx-tag-warning-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.98 .02 90);}@property --cngx-tag-error-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.94 .04 25);}@property --cngx-tag-error-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.4 .15 25);}@property --cngx-tag-error-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .22 25);}@property --cngx-tag-error-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.98 .015 25);}@property --cngx-tag-info-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.93 .04 240);}@property --cngx-tag-info-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.4 .15 250);}@property --cngx-tag-info-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.62 .2 250);}@property --cngx-tag-info-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.97 .025 240);}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-tag-neutral-bg: oklch(.32 .005 250);--cngx-tag-neutral-color: oklch(.85 .005 250);--cngx-tag-neutral-subtle-bg: oklch(.28 .005 250);--cngx-tag-success-bg: oklch(.32 .06 145);--cngx-tag-success-color: oklch(.85 .13 145);--cngx-tag-success-subtle-bg: oklch(.28 .04 145);--cngx-tag-warning-bg: oklch(.32 .06 75);--cngx-tag-warning-color: oklch(.88 .14 75);--cngx-tag-warning-subtle-bg: oklch(.28 .04 75);--cngx-tag-error-bg: oklch(.32 .05 25);--cngx-tag-error-color: oklch(.82 .15 25);--cngx-tag-error-subtle-bg: oklch(.28 .04 25);--cngx-tag-info-bg: oklch(.32 .05 250);--cngx-tag-info-color: oklch(.85 .13 250);--cngx-tag-info-subtle-bg: oklch(.28 .04 250)}}[data-color-scheme=dark],.dark{--cngx-tag-neutral-bg: oklch(.32 .005 250);--cngx-tag-neutral-color: oklch(.85 .005 250);--cngx-tag-neutral-subtle-bg: oklch(.28 .005 250);--cngx-tag-success-bg: oklch(.32 .06 145);--cngx-tag-success-color: oklch(.85 .13 145);--cngx-tag-success-subtle-bg: oklch(.28 .04 145);--cngx-tag-warning-bg: oklch(.32 .06 75);--cngx-tag-warning-color: oklch(.88 .14 75);--cngx-tag-warning-subtle-bg: oklch(.28 .04 75);--cngx-tag-error-bg: oklch(.32 .05 25);--cngx-tag-error-color: oklch(.82 .15 25);--cngx-tag-error-subtle-bg: oklch(.28 .04 25);--cngx-tag-info-bg: oklch(.32 .05 250);--cngx-tag-info-color: oklch(.85 .13 250);--cngx-tag-info-subtle-bg: oklch(.28 .04 250)}[data-color-scheme=light],.light{--cngx-tag-neutral-bg: oklch(.92 .005 250);--cngx-tag-neutral-color: oklch(.34 .015 250);--cngx-tag-neutral-subtle-bg: oklch(.96 .005 250);--cngx-tag-success-bg: oklch(.95 .05 145);--cngx-tag-success-color: oklch(.4 .1 160);--cngx-tag-success-subtle-bg: oklch(.97 .025 145);--cngx-tag-warning-bg: oklch(.95 .05 90);--cngx-tag-warning-color: oklch(.45 .12 60);--cngx-tag-warning-subtle-bg: oklch(.98 .02 90);--cngx-tag-error-bg: oklch(.94 .04 25);--cngx-tag-error-color: oklch(.4 .15 25);--cngx-tag-error-subtle-bg: oklch(.98 .015 25);--cngx-tag-info-bg: oklch(.93 .04 240);--cngx-tag-info-color: oklch(.4 .15 250);--cngx-tag-info-subtle-bg: oklch(.97 .025 240)}}@layer cngx.components{@scope(.cngx-tag){:scope{border-radius:var(--cngx-tag-radius, var(--cngx-radius-sm, 4px));font-weight:var(--cngx-tag-font-weight, 500);background:var(--cngx-tag-bg, transparent);color:var(--cngx-tag-color, inherit);border:var(--cngx-tag-border, 1px solid transparent)}:scope.cngx-tag--filled[data-color=neutral]{--cngx-tag-bg: var(--cngx-tag-neutral-bg);--cngx-tag-color: var(--cngx-tag-neutral-color);--cngx-tag-border: 1px solid var(--cngx-tag-neutral-border, transparent)}:scope.cngx-tag--filled[data-color=success]{--cngx-tag-bg: var(--cngx-tag-success-bg);--cngx-tag-color: var(--cngx-tag-success-color, var(--cngx-color-success));--cngx-tag-border: 1px solid var(--cngx-tag-success-border, transparent)}:scope.cngx-tag--filled[data-color=warning]{--cngx-tag-bg: var(--cngx-tag-warning-bg);--cngx-tag-color: var(--cngx-tag-warning-color, var(--cngx-color-warning));--cngx-tag-border: 1px solid var(--cngx-tag-warning-border, transparent)}:scope.cngx-tag--filled[data-color=error]{--cngx-tag-bg: var(--cngx-tag-error-bg);--cngx-tag-color: var(--cngx-tag-error-color, var(--cngx-color-danger));--cngx-tag-border: 1px solid var(--cngx-tag-error-border, transparent)}:scope.cngx-tag--filled[data-color=info]{--cngx-tag-bg: var(--cngx-tag-info-bg);--cngx-tag-color: var(--cngx-tag-info-color, var(--cngx-color-info));--cngx-tag-border: 1px solid var(--cngx-tag-info-border, transparent)}:scope.cngx-tag--outline[data-color=neutral]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-neutral-color);--cngx-tag-border: 1px solid var(--cngx-tag-neutral-color)}:scope.cngx-tag--outline[data-color=success]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-success-color, var(--cngx-color-success));--cngx-tag-border: 1px solid var(--cngx-tag-success-color, var(--cngx-color-success))}:scope.cngx-tag--outline[data-color=warning]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-warning-color, var(--cngx-color-warning));--cngx-tag-border: 1px solid var(--cngx-tag-warning-color, var(--cngx-color-warning))}:scope.cngx-tag--outline[data-color=error]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-error-color, var(--cngx-color-danger));--cngx-tag-border: 1px solid var(--cngx-tag-error-color, var(--cngx-color-danger))}:scope.cngx-tag--outline[data-color=info]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-info-color, var(--cngx-color-info));--cngx-tag-border: 1px solid var(--cngx-tag-info-color, var(--cngx-color-info))}:scope.cngx-tag--subtle[data-color=neutral]{--cngx-tag-bg: var(--cngx-tag-neutral-subtle-bg);--cngx-tag-color: var(--cngx-tag-neutral-color);--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=success]{--cngx-tag-bg: var(--cngx-tag-success-subtle-bg);--cngx-tag-color: var(--cngx-tag-success-color, var(--cngx-color-success));--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=warning]{--cngx-tag-bg: var(--cngx-tag-warning-subtle-bg);--cngx-tag-color: var(--cngx-tag-warning-color, var(--cngx-color-warning));--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=error]{--cngx-tag-bg: var(--cngx-tag-error-subtle-bg);--cngx-tag-color: var(--cngx-tag-error-color, var(--cngx-color-danger));--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=info]{--cngx-tag-bg: var(--cngx-tag-info-subtle-bg);--cngx-tag-color: var(--cngx-tag-info-color, var(--cngx-color-info));--cngx-tag-border: 1px solid transparent}}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2390
|
+
`, isInline: true, styles: ["@layer cngx.components{@scope(.cngx-tag){:scope{--cngx-tag-gap: var(--cngx-space-xs);--cngx-tag-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-tag-sm-padding: 0 var(--cngx-space-xs);--cngx-tag-lg-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-tag-xl-padding: var(--cngx-space-xs) var(--cngx-space-sm);display:inline-flex;align-items:center;line-height:1.25;max-width:100%;gap:var(--cngx-tag-gap, var(--cngx-space-xs, 4px));padding:var(--cngx-tag-padding, 2px 8px);font-size:var(--cngx-tag-font-size, var(--cngx-font-size-sm, .75rem))}:scope.cngx-tag--sm{padding:var(--cngx-tag-sm-padding, 0 6px);font-size:var(--cngx-tag-sm-font-size, .6875rem)}:scope.cngx-tag--lg{padding:var(--cngx-tag-lg-padding, 4px 10px);font-size:var(--cngx-tag-lg-font-size, .875rem)}:scope.cngx-tag--xl{padding:var(--cngx-tag-xl-padding, 6px 12px);font-size:var(--cngx-tag-xl-font-size, 1rem)}.cngx-tag__label{min-width:0;overflow:hidden}:scope.cngx-tag--truncate .cngx-tag__label{text-overflow:ellipsis;white-space:nowrap}}@scope(.cngx-tag-group){:scope{--cngx-tag-group-stack-gap: var(--cngx-space-sm);display:flex;flex-direction:column;gap:var(--cngx-tag-group-stack-gap, var(--cngx-space-sm, 8px))}.cngx-tag-group__row{--cngx-tag-group-gap: var(--cngx-space-sm);display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:var(--cngx-tag-group-gap, var(--cngx-space-sm, 8px))}:scope.cngx-tag-group--gap-xs>.cngx-tag-group__row{--cngx-tag-group-gap-xs: var(--cngx-space-xs);gap:var(--cngx-tag-group-gap-xs, var(--cngx-space-xs, 4px))}:scope.cngx-tag-group--gap-md>.cngx-tag-group__row{--cngx-tag-group-gap-md: var(--cngx-space-sm);gap:var(--cngx-tag-group-gap-md, 12px)}:scope.cngx-tag-group--align-start>.cngx-tag-group__row{justify-content:flex-start}:scope.cngx-tag-group--align-center>.cngx-tag-group__row{justify-content:center}:scope.cngx-tag-group--align-end>.cngx-tag-group__row{justify-content:flex-end}:scope.cngx-tag-group--align-between>.cngx-tag-group__row{justify-content:space-between}}}\n", "@layer cngx.tokens{@property --cngx-tag-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-tag-font-weight{syntax: \"*\"; inherits: false; initial-value: 500;}@property --cngx-tag-bg{syntax: \"*\"; inherits: false; initial-value: transparent;}@property --cngx-tag-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-tag-border{syntax: \"*\"; inherits: false; initial-value: 1px solid transparent;}@property --cngx-tag-gap{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-tag-padding{syntax: \"*\"; inherits: false; initial-value: 2px 8px;}@property --cngx-tag-font-size{syntax: \"*\"; inherits: false; initial-value: .75rem;}@property --cngx-tag-sm-padding{syntax: \"*\"; inherits: false; initial-value: 0 6px;}@property --cngx-tag-sm-font-size{syntax: \"*\"; inherits: false; initial-value: .6875rem;}@property --cngx-tag-lg-padding{syntax: \"*\"; inherits: false; initial-value: 4px 10px;}@property --cngx-tag-lg-font-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}@property --cngx-tag-xl-padding{syntax: \"*\"; inherits: false; initial-value: 6px 12px;}@property --cngx-tag-xl-font-size{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-tag-neutral-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.92 .005 250);}@property --cngx-tag-neutral-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.34 .015 250);}@property --cngx-tag-neutral-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 250);}@property --cngx-tag-neutral-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.96 .005 250);}@property --cngx-tag-success-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.95 .05 145);}@property --cngx-tag-success-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.4 .1 160);}@property --cngx-tag-success-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .15 155);}@property --cngx-tag-success-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.97 .025 145);}@property --cngx-tag-warning-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.95 .05 90);}@property --cngx-tag-warning-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 .12 60);}@property --cngx-tag-warning-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .18 70);}@property --cngx-tag-warning-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.98 .02 90);}@property --cngx-tag-error-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.94 .04 25);}@property --cngx-tag-error-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.4 .15 25);}@property --cngx-tag-error-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .22 25);}@property --cngx-tag-error-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.98 .015 25);}@property --cngx-tag-info-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.93 .04 240);}@property --cngx-tag-info-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.4 .15 250);}@property --cngx-tag-info-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.62 .2 250);}@property --cngx-tag-info-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.97 .025 240);}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-tag-neutral-bg: oklch(.32 .005 250);--cngx-tag-neutral-color: oklch(.85 .005 250);--cngx-tag-neutral-subtle-bg: oklch(.28 .005 250);--cngx-tag-success-bg: oklch(.32 .06 145);--cngx-tag-success-color: oklch(.85 .13 145);--cngx-tag-success-subtle-bg: oklch(.28 .04 145);--cngx-tag-warning-bg: oklch(.32 .06 75);--cngx-tag-warning-color: oklch(.88 .14 75);--cngx-tag-warning-subtle-bg: oklch(.28 .04 75);--cngx-tag-error-bg: oklch(.32 .05 25);--cngx-tag-error-color: oklch(.82 .15 25);--cngx-tag-error-subtle-bg: oklch(.28 .04 25);--cngx-tag-info-bg: oklch(.32 .05 250);--cngx-tag-info-color: oklch(.85 .13 250);--cngx-tag-info-subtle-bg: oklch(.28 .04 250)}}[data-color-scheme=dark],.dark{--cngx-tag-neutral-bg: oklch(.32 .005 250);--cngx-tag-neutral-color: oklch(.85 .005 250);--cngx-tag-neutral-subtle-bg: oklch(.28 .005 250);--cngx-tag-success-bg: oklch(.32 .06 145);--cngx-tag-success-color: oklch(.85 .13 145);--cngx-tag-success-subtle-bg: oklch(.28 .04 145);--cngx-tag-warning-bg: oklch(.32 .06 75);--cngx-tag-warning-color: oklch(.88 .14 75);--cngx-tag-warning-subtle-bg: oklch(.28 .04 75);--cngx-tag-error-bg: oklch(.32 .05 25);--cngx-tag-error-color: oklch(.82 .15 25);--cngx-tag-error-subtle-bg: oklch(.28 .04 25);--cngx-tag-info-bg: oklch(.32 .05 250);--cngx-tag-info-color: oklch(.85 .13 250);--cngx-tag-info-subtle-bg: oklch(.28 .04 250)}[data-color-scheme=light],.light{--cngx-tag-neutral-bg: oklch(.92 .005 250);--cngx-tag-neutral-color: oklch(.34 .015 250);--cngx-tag-neutral-subtle-bg: oklch(.96 .005 250);--cngx-tag-success-bg: oklch(.95 .05 145);--cngx-tag-success-color: oklch(.4 .1 160);--cngx-tag-success-subtle-bg: oklch(.97 .025 145);--cngx-tag-warning-bg: oklch(.95 .05 90);--cngx-tag-warning-color: oklch(.45 .12 60);--cngx-tag-warning-subtle-bg: oklch(.98 .02 90);--cngx-tag-error-bg: oklch(.94 .04 25);--cngx-tag-error-color: oklch(.4 .15 25);--cngx-tag-error-subtle-bg: oklch(.98 .015 25);--cngx-tag-info-bg: oklch(.93 .04 240);--cngx-tag-info-color: oklch(.4 .15 250);--cngx-tag-info-subtle-bg: oklch(.97 .025 240)}.cngx-tag{--cngx-tag-radius: var(--cngx-radius-sm)}}@layer cngx.components{@scope(.cngx-tag){:scope{border-radius:var(--cngx-tag-radius);font-weight:var(--cngx-tag-font-weight, 500);background:var(--cngx-tag-bg, transparent);color:var(--cngx-tag-color, inherit);border:var(--cngx-tag-border, 1px solid transparent)}:scope.cngx-tag--filled[data-color=neutral]{--cngx-tag-bg: var(--cngx-tag-neutral-bg);--cngx-tag-color: var(--cngx-tag-neutral-color);--cngx-tag-border: 1px solid var(--cngx-tag-neutral-border)}:scope.cngx-tag--filled[data-color=success]{--cngx-tag-bg: var(--cngx-tag-success-bg);--cngx-tag-color: var(--cngx-tag-success-color);--cngx-tag-border: 1px solid var(--cngx-tag-success-border)}:scope.cngx-tag--filled[data-color=warning]{--cngx-tag-bg: var(--cngx-tag-warning-bg);--cngx-tag-color: var(--cngx-tag-warning-color);--cngx-tag-border: 1px solid var(--cngx-tag-warning-border)}:scope.cngx-tag--filled[data-color=error]{--cngx-tag-bg: var(--cngx-tag-error-bg);--cngx-tag-color: var(--cngx-tag-error-color);--cngx-tag-border: 1px solid var(--cngx-tag-error-border)}:scope.cngx-tag--filled[data-color=info]{--cngx-tag-bg: var(--cngx-tag-info-bg);--cngx-tag-color: var(--cngx-tag-info-color);--cngx-tag-border: 1px solid var(--cngx-tag-info-border)}:scope.cngx-tag--outline[data-color=neutral]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-neutral-color);--cngx-tag-border: 1px solid var(--cngx-tag-neutral-color)}:scope.cngx-tag--outline[data-color=success]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-success-color);--cngx-tag-border: 1px solid var(--cngx-tag-success-color)}:scope.cngx-tag--outline[data-color=warning]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-warning-color);--cngx-tag-border: 1px solid var(--cngx-tag-warning-color)}:scope.cngx-tag--outline[data-color=error]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-error-color);--cngx-tag-border: 1px solid var(--cngx-tag-error-color)}:scope.cngx-tag--outline[data-color=info]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-info-color);--cngx-tag-border: 1px solid var(--cngx-tag-info-color)}:scope.cngx-tag--subtle[data-color=neutral]{--cngx-tag-bg: var(--cngx-tag-neutral-subtle-bg);--cngx-tag-color: var(--cngx-tag-neutral-color);--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=success]{--cngx-tag-bg: var(--cngx-tag-success-subtle-bg);--cngx-tag-color: var(--cngx-tag-success-color);--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=warning]{--cngx-tag-bg: var(--cngx-tag-warning-subtle-bg);--cngx-tag-color: var(--cngx-tag-warning-color);--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=error]{--cngx-tag-bg: var(--cngx-tag-error-subtle-bg);--cngx-tag-color: var(--cngx-tag-error-color);--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=info]{--cngx-tag-bg: var(--cngx-tag-info-subtle-bg);--cngx-tag-color: var(--cngx-tag-info-color);--cngx-tag-border: 1px solid transparent}}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2012
2391
|
}
|
|
2013
2392
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTag, decorators: [{
|
|
2014
2393
|
type: Component,
|
|
@@ -2040,7 +2419,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
2040
2419
|
'[style.--cngx-tag-border]': 'configBorder()',
|
|
2041
2420
|
'[style.max-width]': 'maxWidth()',
|
|
2042
2421
|
'[attr.role]': 'roleAttr()',
|
|
2043
|
-
}, styles: ["@layer cngx.components{@scope(.cngx-tag){:scope{--cngx-tag-gap: var(--cngx-space-xs);--cngx-tag-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-tag-sm-padding: 0 var(--cngx-space-xs);--cngx-tag-lg-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-tag-xl-padding: var(--cngx-space-xs) var(--cngx-space-sm);display:inline-flex;align-items:center;line-height:1.25;max-width:100%;gap:var(--cngx-tag-gap, var(--cngx-space-xs, 4px));padding:var(--cngx-tag-padding, 2px 8px);font-size:var(--cngx-tag-font-size, var(--cngx-font-size-sm, .75rem))}:scope.cngx-tag--sm{padding:var(--cngx-tag-sm-padding, 0 6px);font-size:var(--cngx-tag-sm-font-size, .6875rem)}:scope.cngx-tag--lg{padding:var(--cngx-tag-lg-padding, 4px 10px);font-size:var(--cngx-tag-lg-font-size, .875rem)}:scope.cngx-tag--xl{padding:var(--cngx-tag-xl-padding, 6px 12px);font-size:var(--cngx-tag-xl-font-size, 1rem)}.cngx-tag__label{min-width:0;overflow:hidden}:scope.cngx-tag--truncate .cngx-tag__label{text-overflow:ellipsis;white-space:nowrap}}@scope(.cngx-tag-group){:scope{--cngx-tag-group-stack-gap: var(--cngx-space-sm);display:flex;flex-direction:column;gap:var(--cngx-tag-group-stack-gap, var(--cngx-space-sm, 8px))}.cngx-tag-group__row{--cngx-tag-group-gap: var(--cngx-space-sm);display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:var(--cngx-tag-group-gap, var(--cngx-space-sm, 8px))}:scope.cngx-tag-group--gap-xs>.cngx-tag-group__row{--cngx-tag-group-gap-xs: var(--cngx-space-xs);gap:var(--cngx-tag-group-gap-xs, var(--cngx-space-xs, 4px))}:scope.cngx-tag-group--gap-md>.cngx-tag-group__row{--cngx-tag-group-gap-md: var(--cngx-space-sm);gap:var(--cngx-tag-group-gap-md, 12px)}:scope.cngx-tag-group--align-start>.cngx-tag-group__row{justify-content:flex-start}:scope.cngx-tag-group--align-center>.cngx-tag-group__row{justify-content:center}:scope.cngx-tag-group--align-end>.cngx-tag-group__row{justify-content:flex-end}:scope.cngx-tag-group--align-between>.cngx-tag-group__row{justify-content:space-between}}}\n", "@layer cngx.tokens{@property --cngx-tag-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-tag-font-weight{syntax: \"*\"; inherits: false; initial-value: 500;}@property --cngx-tag-bg{syntax: \"*\"; inherits: false; initial-value: transparent;}@property --cngx-tag-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-tag-border{syntax: \"*\"; inherits: false; initial-value: 1px solid transparent;}@property --cngx-tag-gap{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-tag-padding{syntax: \"*\"; inherits: false; initial-value: 2px 8px;}@property --cngx-tag-font-size{syntax: \"*\"; inherits: false; initial-value: .75rem;}@property --cngx-tag-sm-padding{syntax: \"*\"; inherits: false; initial-value: 0 6px;}@property --cngx-tag-sm-font-size{syntax: \"*\"; inherits: false; initial-value: .6875rem;}@property --cngx-tag-lg-padding{syntax: \"*\"; inherits: false; initial-value: 4px 10px;}@property --cngx-tag-lg-font-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}@property --cngx-tag-xl-padding{syntax: \"*\"; inherits: false; initial-value: 6px 12px;}@property --cngx-tag-xl-font-size{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-tag-neutral-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.92 .005 250);}@property --cngx-tag-neutral-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.34 .015 250);}@property --cngx-tag-neutral-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 250);}@property --cngx-tag-neutral-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.96 .005 250);}@property --cngx-tag-success-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.95 .05 145);}@property --cngx-tag-success-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.4 .1 160);}@property --cngx-tag-success-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .15 155);}@property --cngx-tag-success-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.97 .025 145);}@property --cngx-tag-warning-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.95 .05 90);}@property --cngx-tag-warning-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 .12 60);}@property --cngx-tag-warning-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .18 70);}@property --cngx-tag-warning-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.98 .02 90);}@property --cngx-tag-error-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.94 .04 25);}@property --cngx-tag-error-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.4 .15 25);}@property --cngx-tag-error-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .22 25);}@property --cngx-tag-error-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.98 .015 25);}@property --cngx-tag-info-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.93 .04 240);}@property --cngx-tag-info-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.4 .15 250);}@property --cngx-tag-info-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.62 .2 250);}@property --cngx-tag-info-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.97 .025 240);}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-tag-neutral-bg: oklch(.32 .005 250);--cngx-tag-neutral-color: oklch(.85 .005 250);--cngx-tag-neutral-subtle-bg: oklch(.28 .005 250);--cngx-tag-success-bg: oklch(.32 .06 145);--cngx-tag-success-color: oklch(.85 .13 145);--cngx-tag-success-subtle-bg: oklch(.28 .04 145);--cngx-tag-warning-bg: oklch(.32 .06 75);--cngx-tag-warning-color: oklch(.88 .14 75);--cngx-tag-warning-subtle-bg: oklch(.28 .04 75);--cngx-tag-error-bg: oklch(.32 .05 25);--cngx-tag-error-color: oklch(.82 .15 25);--cngx-tag-error-subtle-bg: oklch(.28 .04 25);--cngx-tag-info-bg: oklch(.32 .05 250);--cngx-tag-info-color: oklch(.85 .13 250);--cngx-tag-info-subtle-bg: oklch(.28 .04 250)}}[data-color-scheme=dark],.dark{--cngx-tag-neutral-bg: oklch(.32 .005 250);--cngx-tag-neutral-color: oklch(.85 .005 250);--cngx-tag-neutral-subtle-bg: oklch(.28 .005 250);--cngx-tag-success-bg: oklch(.32 .06 145);--cngx-tag-success-color: oklch(.85 .13 145);--cngx-tag-success-subtle-bg: oklch(.28 .04 145);--cngx-tag-warning-bg: oklch(.32 .06 75);--cngx-tag-warning-color: oklch(.88 .14 75);--cngx-tag-warning-subtle-bg: oklch(.28 .04 75);--cngx-tag-error-bg: oklch(.32 .05 25);--cngx-tag-error-color: oklch(.82 .15 25);--cngx-tag-error-subtle-bg: oklch(.28 .04 25);--cngx-tag-info-bg: oklch(.32 .05 250);--cngx-tag-info-color: oklch(.85 .13 250);--cngx-tag-info-subtle-bg: oklch(.28 .04 250)}[data-color-scheme=light],.light{--cngx-tag-neutral-bg: oklch(.92 .005 250);--cngx-tag-neutral-color: oklch(.34 .015 250);--cngx-tag-neutral-subtle-bg: oklch(.96 .005 250);--cngx-tag-success-bg: oklch(.95 .05 145);--cngx-tag-success-color: oklch(.4 .1 160);--cngx-tag-success-subtle-bg: oklch(.97 .025 145);--cngx-tag-warning-bg: oklch(.95 .05 90);--cngx-tag-warning-color: oklch(.45 .12 60);--cngx-tag-warning-subtle-bg: oklch(.98 .02 90);--cngx-tag-error-bg: oklch(.94 .04 25);--cngx-tag-error-color: oklch(.4 .15 25);--cngx-tag-error-subtle-bg: oklch(.98 .015 25);--cngx-tag-info-bg: oklch(.93 .04 240);--cngx-tag-info-color: oklch(.4 .15 250);--cngx-tag-info-subtle-bg: oklch(.97 .025 240)}}@layer cngx.components{@scope(.cngx-tag){:scope{border-radius:var(--cngx-tag-radius, var(--cngx-radius-sm, 4px));font-weight:var(--cngx-tag-font-weight, 500);background:var(--cngx-tag-bg, transparent);color:var(--cngx-tag-color, inherit);border:var(--cngx-tag-border, 1px solid transparent)}:scope.cngx-tag--filled[data-color=neutral]{--cngx-tag-bg: var(--cngx-tag-neutral-bg);--cngx-tag-color: var(--cngx-tag-neutral-color);--cngx-tag-border: 1px solid var(--cngx-tag-neutral-border, transparent)}:scope.cngx-tag--filled[data-color=success]{--cngx-tag-bg: var(--cngx-tag-success-bg);--cngx-tag-color: var(--cngx-tag-success-color, var(--cngx-color-success));--cngx-tag-border: 1px solid var(--cngx-tag-success-border, transparent)}:scope.cngx-tag--filled[data-color=warning]{--cngx-tag-bg: var(--cngx-tag-warning-bg);--cngx-tag-color: var(--cngx-tag-warning-color, var(--cngx-color-warning));--cngx-tag-border: 1px solid var(--cngx-tag-warning-border, transparent)}:scope.cngx-tag--filled[data-color=error]{--cngx-tag-bg: var(--cngx-tag-error-bg);--cngx-tag-color: var(--cngx-tag-error-color, var(--cngx-color-danger));--cngx-tag-border: 1px solid var(--cngx-tag-error-border, transparent)}:scope.cngx-tag--filled[data-color=info]{--cngx-tag-bg: var(--cngx-tag-info-bg);--cngx-tag-color: var(--cngx-tag-info-color, var(--cngx-color-info));--cngx-tag-border: 1px solid var(--cngx-tag-info-border, transparent)}:scope.cngx-tag--outline[data-color=neutral]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-neutral-color);--cngx-tag-border: 1px solid var(--cngx-tag-neutral-color)}:scope.cngx-tag--outline[data-color=success]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-success-color, var(--cngx-color-success));--cngx-tag-border: 1px solid var(--cngx-tag-success-color, var(--cngx-color-success))}:scope.cngx-tag--outline[data-color=warning]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-warning-color, var(--cngx-color-warning));--cngx-tag-border: 1px solid var(--cngx-tag-warning-color, var(--cngx-color-warning))}:scope.cngx-tag--outline[data-color=error]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-error-color, var(--cngx-color-danger));--cngx-tag-border: 1px solid var(--cngx-tag-error-color, var(--cngx-color-danger))}:scope.cngx-tag--outline[data-color=info]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-info-color, var(--cngx-color-info));--cngx-tag-border: 1px solid var(--cngx-tag-info-color, var(--cngx-color-info))}:scope.cngx-tag--subtle[data-color=neutral]{--cngx-tag-bg: var(--cngx-tag-neutral-subtle-bg);--cngx-tag-color: var(--cngx-tag-neutral-color);--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=success]{--cngx-tag-bg: var(--cngx-tag-success-subtle-bg);--cngx-tag-color: var(--cngx-tag-success-color, var(--cngx-color-success));--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=warning]{--cngx-tag-bg: var(--cngx-tag-warning-subtle-bg);--cngx-tag-color: var(--cngx-tag-warning-color, var(--cngx-color-warning));--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=error]{--cngx-tag-bg: var(--cngx-tag-error-subtle-bg);--cngx-tag-color: var(--cngx-tag-error-color, var(--cngx-color-danger));--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=info]{--cngx-tag-bg: var(--cngx-tag-info-subtle-bg);--cngx-tag-color: var(--cngx-tag-info-color, var(--cngx-color-info));--cngx-tag-border: 1px solid transparent}}}\n"] }]
|
|
2422
|
+
}, styles: ["@layer cngx.components{@scope(.cngx-tag){:scope{--cngx-tag-gap: var(--cngx-space-xs);--cngx-tag-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-tag-sm-padding: 0 var(--cngx-space-xs);--cngx-tag-lg-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-tag-xl-padding: var(--cngx-space-xs) var(--cngx-space-sm);display:inline-flex;align-items:center;line-height:1.25;max-width:100%;gap:var(--cngx-tag-gap, var(--cngx-space-xs, 4px));padding:var(--cngx-tag-padding, 2px 8px);font-size:var(--cngx-tag-font-size, var(--cngx-font-size-sm, .75rem))}:scope.cngx-tag--sm{padding:var(--cngx-tag-sm-padding, 0 6px);font-size:var(--cngx-tag-sm-font-size, .6875rem)}:scope.cngx-tag--lg{padding:var(--cngx-tag-lg-padding, 4px 10px);font-size:var(--cngx-tag-lg-font-size, .875rem)}:scope.cngx-tag--xl{padding:var(--cngx-tag-xl-padding, 6px 12px);font-size:var(--cngx-tag-xl-font-size, 1rem)}.cngx-tag__label{min-width:0;overflow:hidden}:scope.cngx-tag--truncate .cngx-tag__label{text-overflow:ellipsis;white-space:nowrap}}@scope(.cngx-tag-group){:scope{--cngx-tag-group-stack-gap: var(--cngx-space-sm);display:flex;flex-direction:column;gap:var(--cngx-tag-group-stack-gap, var(--cngx-space-sm, 8px))}.cngx-tag-group__row{--cngx-tag-group-gap: var(--cngx-space-sm);display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:var(--cngx-tag-group-gap, var(--cngx-space-sm, 8px))}:scope.cngx-tag-group--gap-xs>.cngx-tag-group__row{--cngx-tag-group-gap-xs: var(--cngx-space-xs);gap:var(--cngx-tag-group-gap-xs, var(--cngx-space-xs, 4px))}:scope.cngx-tag-group--gap-md>.cngx-tag-group__row{--cngx-tag-group-gap-md: var(--cngx-space-sm);gap:var(--cngx-tag-group-gap-md, 12px)}:scope.cngx-tag-group--align-start>.cngx-tag-group__row{justify-content:flex-start}:scope.cngx-tag-group--align-center>.cngx-tag-group__row{justify-content:center}:scope.cngx-tag-group--align-end>.cngx-tag-group__row{justify-content:flex-end}:scope.cngx-tag-group--align-between>.cngx-tag-group__row{justify-content:space-between}}}\n", "@layer cngx.tokens{@property --cngx-tag-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-tag-font-weight{syntax: \"*\"; inherits: false; initial-value: 500;}@property --cngx-tag-bg{syntax: \"*\"; inherits: false; initial-value: transparent;}@property --cngx-tag-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-tag-border{syntax: \"*\"; inherits: false; initial-value: 1px solid transparent;}@property --cngx-tag-gap{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-tag-padding{syntax: \"*\"; inherits: false; initial-value: 2px 8px;}@property --cngx-tag-font-size{syntax: \"*\"; inherits: false; initial-value: .75rem;}@property --cngx-tag-sm-padding{syntax: \"*\"; inherits: false; initial-value: 0 6px;}@property --cngx-tag-sm-font-size{syntax: \"*\"; inherits: false; initial-value: .6875rem;}@property --cngx-tag-lg-padding{syntax: \"*\"; inherits: false; initial-value: 4px 10px;}@property --cngx-tag-lg-font-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}@property --cngx-tag-xl-padding{syntax: \"*\"; inherits: false; initial-value: 6px 12px;}@property --cngx-tag-xl-font-size{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-tag-neutral-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.92 .005 250);}@property --cngx-tag-neutral-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.34 .015 250);}@property --cngx-tag-neutral-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 250);}@property --cngx-tag-neutral-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.96 .005 250);}@property --cngx-tag-success-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.95 .05 145);}@property --cngx-tag-success-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.4 .1 160);}@property --cngx-tag-success-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .15 155);}@property --cngx-tag-success-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.97 .025 145);}@property --cngx-tag-warning-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.95 .05 90);}@property --cngx-tag-warning-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 .12 60);}@property --cngx-tag-warning-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .18 70);}@property --cngx-tag-warning-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.98 .02 90);}@property --cngx-tag-error-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.94 .04 25);}@property --cngx-tag-error-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.4 .15 25);}@property --cngx-tag-error-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .22 25);}@property --cngx-tag-error-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.98 .015 25);}@property --cngx-tag-info-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.93 .04 240);}@property --cngx-tag-info-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.4 .15 250);}@property --cngx-tag-info-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.62 .2 250);}@property --cngx-tag-info-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.97 .025 240);}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-tag-neutral-bg: oklch(.32 .005 250);--cngx-tag-neutral-color: oklch(.85 .005 250);--cngx-tag-neutral-subtle-bg: oklch(.28 .005 250);--cngx-tag-success-bg: oklch(.32 .06 145);--cngx-tag-success-color: oklch(.85 .13 145);--cngx-tag-success-subtle-bg: oklch(.28 .04 145);--cngx-tag-warning-bg: oklch(.32 .06 75);--cngx-tag-warning-color: oklch(.88 .14 75);--cngx-tag-warning-subtle-bg: oklch(.28 .04 75);--cngx-tag-error-bg: oklch(.32 .05 25);--cngx-tag-error-color: oklch(.82 .15 25);--cngx-tag-error-subtle-bg: oklch(.28 .04 25);--cngx-tag-info-bg: oklch(.32 .05 250);--cngx-tag-info-color: oklch(.85 .13 250);--cngx-tag-info-subtle-bg: oklch(.28 .04 250)}}[data-color-scheme=dark],.dark{--cngx-tag-neutral-bg: oklch(.32 .005 250);--cngx-tag-neutral-color: oklch(.85 .005 250);--cngx-tag-neutral-subtle-bg: oklch(.28 .005 250);--cngx-tag-success-bg: oklch(.32 .06 145);--cngx-tag-success-color: oklch(.85 .13 145);--cngx-tag-success-subtle-bg: oklch(.28 .04 145);--cngx-tag-warning-bg: oklch(.32 .06 75);--cngx-tag-warning-color: oklch(.88 .14 75);--cngx-tag-warning-subtle-bg: oklch(.28 .04 75);--cngx-tag-error-bg: oklch(.32 .05 25);--cngx-tag-error-color: oklch(.82 .15 25);--cngx-tag-error-subtle-bg: oklch(.28 .04 25);--cngx-tag-info-bg: oklch(.32 .05 250);--cngx-tag-info-color: oklch(.85 .13 250);--cngx-tag-info-subtle-bg: oklch(.28 .04 250)}[data-color-scheme=light],.light{--cngx-tag-neutral-bg: oklch(.92 .005 250);--cngx-tag-neutral-color: oklch(.34 .015 250);--cngx-tag-neutral-subtle-bg: oklch(.96 .005 250);--cngx-tag-success-bg: oklch(.95 .05 145);--cngx-tag-success-color: oklch(.4 .1 160);--cngx-tag-success-subtle-bg: oklch(.97 .025 145);--cngx-tag-warning-bg: oklch(.95 .05 90);--cngx-tag-warning-color: oklch(.45 .12 60);--cngx-tag-warning-subtle-bg: oklch(.98 .02 90);--cngx-tag-error-bg: oklch(.94 .04 25);--cngx-tag-error-color: oklch(.4 .15 25);--cngx-tag-error-subtle-bg: oklch(.98 .015 25);--cngx-tag-info-bg: oklch(.93 .04 240);--cngx-tag-info-color: oklch(.4 .15 250);--cngx-tag-info-subtle-bg: oklch(.97 .025 240)}.cngx-tag{--cngx-tag-radius: var(--cngx-radius-sm)}}@layer cngx.components{@scope(.cngx-tag){:scope{border-radius:var(--cngx-tag-radius);font-weight:var(--cngx-tag-font-weight, 500);background:var(--cngx-tag-bg, transparent);color:var(--cngx-tag-color, inherit);border:var(--cngx-tag-border, 1px solid transparent)}:scope.cngx-tag--filled[data-color=neutral]{--cngx-tag-bg: var(--cngx-tag-neutral-bg);--cngx-tag-color: var(--cngx-tag-neutral-color);--cngx-tag-border: 1px solid var(--cngx-tag-neutral-border)}:scope.cngx-tag--filled[data-color=success]{--cngx-tag-bg: var(--cngx-tag-success-bg);--cngx-tag-color: var(--cngx-tag-success-color);--cngx-tag-border: 1px solid var(--cngx-tag-success-border)}:scope.cngx-tag--filled[data-color=warning]{--cngx-tag-bg: var(--cngx-tag-warning-bg);--cngx-tag-color: var(--cngx-tag-warning-color);--cngx-tag-border: 1px solid var(--cngx-tag-warning-border)}:scope.cngx-tag--filled[data-color=error]{--cngx-tag-bg: var(--cngx-tag-error-bg);--cngx-tag-color: var(--cngx-tag-error-color);--cngx-tag-border: 1px solid var(--cngx-tag-error-border)}:scope.cngx-tag--filled[data-color=info]{--cngx-tag-bg: var(--cngx-tag-info-bg);--cngx-tag-color: var(--cngx-tag-info-color);--cngx-tag-border: 1px solid var(--cngx-tag-info-border)}:scope.cngx-tag--outline[data-color=neutral]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-neutral-color);--cngx-tag-border: 1px solid var(--cngx-tag-neutral-color)}:scope.cngx-tag--outline[data-color=success]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-success-color);--cngx-tag-border: 1px solid var(--cngx-tag-success-color)}:scope.cngx-tag--outline[data-color=warning]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-warning-color);--cngx-tag-border: 1px solid var(--cngx-tag-warning-color)}:scope.cngx-tag--outline[data-color=error]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-error-color);--cngx-tag-border: 1px solid var(--cngx-tag-error-color)}:scope.cngx-tag--outline[data-color=info]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-info-color);--cngx-tag-border: 1px solid var(--cngx-tag-info-color)}:scope.cngx-tag--subtle[data-color=neutral]{--cngx-tag-bg: var(--cngx-tag-neutral-subtle-bg);--cngx-tag-color: var(--cngx-tag-neutral-color);--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=success]{--cngx-tag-bg: var(--cngx-tag-success-subtle-bg);--cngx-tag-color: var(--cngx-tag-success-color);--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=warning]{--cngx-tag-bg: var(--cngx-tag-warning-subtle-bg);--cngx-tag-color: var(--cngx-tag-warning-color);--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=error]{--cngx-tag-bg: var(--cngx-tag-error-subtle-bg);--cngx-tag-color: var(--cngx-tag-error-color);--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=info]{--cngx-tag-bg: var(--cngx-tag-info-subtle-bg);--cngx-tag-color: var(--cngx-tag-info-color);--cngx-tag-border: 1px solid transparent}}}\n"] }]
|
|
2044
2423
|
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], truncate: [{ type: i0.Input, args: [{ isSignal: true, alias: "truncate", required: false }] }], maxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxWidth", required: false }] }], labelSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxTagLabel), { isSignal: true }] }], prefixSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxTagPrefix), { isSignal: true }] }], suffixSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxTagSuffix), { isSignal: true }] }] } });
|
|
2045
2424
|
|
|
2046
2425
|
/**
|
|
@@ -2120,8 +2499,6 @@ function mergeConfig(base, partial) {
|
|
|
2120
2499
|
* ],
|
|
2121
2500
|
* });
|
|
2122
2501
|
* ```
|
|
2123
|
-
*
|
|
2124
|
-
* @category common/display
|
|
2125
2502
|
*/
|
|
2126
2503
|
function provideTagConfig(...features) {
|
|
2127
2504
|
// Empty-features: skip the override so the root factory's
|
|
@@ -2164,8 +2541,6 @@ function provideTagConfig(...features) {
|
|
|
2164
2541
|
* })
|
|
2165
2542
|
* class AdminSection {}
|
|
2166
2543
|
* ```
|
|
2167
|
-
*
|
|
2168
|
-
* @category common/display
|
|
2169
2544
|
*/
|
|
2170
2545
|
function provideTagConfigAt(...features) {
|
|
2171
2546
|
// Empty-features call: parent value flows through untouched.
|
|
@@ -2196,8 +2571,6 @@ function provideTagConfigAt(...features) {
|
|
|
2196
2571
|
* withTagDefaults({ variant: 'subtle', size: 'sm' }),
|
|
2197
2572
|
* );
|
|
2198
2573
|
* ```
|
|
2199
|
-
*
|
|
2200
|
-
* @category common/display
|
|
2201
2574
|
*/
|
|
2202
2575
|
function withTagDefaults(payload) {
|
|
2203
2576
|
return { kind: 'defaults', payload };
|
|
@@ -2211,8 +2584,6 @@ function withTagDefaults(payload) {
|
|
|
2211
2584
|
* withTagGroupDefaults({ gap: 'md', semanticList: true }),
|
|
2212
2585
|
* );
|
|
2213
2586
|
* ```
|
|
2214
|
-
*
|
|
2215
|
-
* @category common/display
|
|
2216
2587
|
*/
|
|
2217
2588
|
function withTagGroupDefaults(payload) {
|
|
2218
2589
|
return { kind: 'groupDefaults', payload };
|
|
@@ -2243,8 +2614,6 @@ function withTagGroupDefaults(payload) {
|
|
|
2243
2614
|
* }),
|
|
2244
2615
|
* );
|
|
2245
2616
|
* ```
|
|
2246
|
-
*
|
|
2247
|
-
* @category common/display
|
|
2248
2617
|
*/
|
|
2249
2618
|
function withTagColors(payload) {
|
|
2250
2619
|
return { kind: 'colors', payload };
|
|
@@ -2280,8 +2649,6 @@ function withTagColors(payload) {
|
|
|
2280
2649
|
* // Then in providers:
|
|
2281
2650
|
* provideTagConfig(withTagSlots({ label: shell.brandLabel() }));
|
|
2282
2651
|
* ```
|
|
2283
|
-
*
|
|
2284
|
-
* @category common/display
|
|
2285
2652
|
*/
|
|
2286
2653
|
function withTagSlots(payload) {
|
|
2287
2654
|
return { kind: 'templates', payload };
|
|
@@ -2309,23 +2676,22 @@ function withTagSlots(payload) {
|
|
|
2309
2676
|
* </cngx-tag-group>
|
|
2310
2677
|
* ```
|
|
2311
2678
|
*
|
|
2312
|
-
* @category common/display
|
|
2313
2679
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/tag-group/slots/tag-group-accessory.directive.ts
|
|
2314
|
-
* @since 0.
|
|
2680
|
+
* @since 0.3.0
|
|
2315
2681
|
* @relatedTo CngxTagGroup, CngxTagGroupHeader
|
|
2316
|
-
* <example-url
|
|
2317
|
-
* <example-url
|
|
2318
|
-
* <example-url
|
|
2319
|
-
* <example-url
|
|
2320
|
-
* <example-url
|
|
2321
|
-
* <example-url
|
|
2322
|
-
* <example-url
|
|
2323
|
-
* <example-url
|
|
2324
|
-
* <example-url
|
|
2325
|
-
* <example-url
|
|
2326
|
-
* <example-url
|
|
2327
|
-
* <example-url
|
|
2328
|
-
* <example-url
|
|
2682
|
+
* <example-url>/#/common/display/tag/app-wide-defaults-via-providetagconfig</example-url>
|
|
2683
|
+
* <example-url>/#/common/display/tag/color-palette</example-url>
|
|
2684
|
+
* <example-url>/#/common/display/tag/composition-with-cngxicon</example-url>
|
|
2685
|
+
* <example-url>/#/common/display/tag/density</example-url>
|
|
2686
|
+
* <example-url>/#/common/display/tag/group-semantic-list</example-url>
|
|
2687
|
+
* <example-url>/#/common/display/tag/group-with-header-accessory</example-url>
|
|
2688
|
+
* <example-url>/#/common/display/tag/layout-only-alignment</example-url>
|
|
2689
|
+
* <example-url>/#/common/display/tag/layout-only-gap-variants</example-url>
|
|
2690
|
+
* <example-url>/#/common/display/tag/link-mode</example-url>
|
|
2691
|
+
* <example-url>/#/common/display/tag/slot-overrides-custom-label</example-url>
|
|
2692
|
+
* <example-url>/#/common/display/tag/slot-overrides-prefix-label-suffix</example-url>
|
|
2693
|
+
* <example-url>/#/common/display/tag/truncate-maxwidth</example-url>
|
|
2694
|
+
* <example-url>/#/common/display/tag/variant-matrix</example-url>
|
|
2329
2695
|
*/
|
|
2330
2696
|
class CngxTagGroupAccessory {
|
|
2331
2697
|
templateRef = inject(TemplateRef);
|
|
@@ -2363,23 +2729,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
2363
2729
|
* </cngx-tag-group>
|
|
2364
2730
|
* ```
|
|
2365
2731
|
*
|
|
2366
|
-
* @category common/display
|
|
2367
2732
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/tag-group/slots/tag-group-header.directive.ts
|
|
2368
|
-
* @since 0.
|
|
2733
|
+
* @since 0.3.0
|
|
2369
2734
|
* @relatedTo CngxTagGroup, CngxTagGroupAccessory
|
|
2370
|
-
* <example-url
|
|
2371
|
-
* <example-url
|
|
2372
|
-
* <example-url
|
|
2373
|
-
* <example-url
|
|
2374
|
-
* <example-url
|
|
2375
|
-
* <example-url
|
|
2376
|
-
* <example-url
|
|
2377
|
-
* <example-url
|
|
2378
|
-
* <example-url
|
|
2379
|
-
* <example-url
|
|
2380
|
-
* <example-url
|
|
2381
|
-
* <example-url
|
|
2382
|
-
* <example-url
|
|
2735
|
+
* <example-url>/#/common/display/tag/app-wide-defaults-via-providetagconfig</example-url>
|
|
2736
|
+
* <example-url>/#/common/display/tag/color-palette</example-url>
|
|
2737
|
+
* <example-url>/#/common/display/tag/composition-with-cngxicon</example-url>
|
|
2738
|
+
* <example-url>/#/common/display/tag/density</example-url>
|
|
2739
|
+
* <example-url>/#/common/display/tag/group-semantic-list</example-url>
|
|
2740
|
+
* <example-url>/#/common/display/tag/group-with-header-accessory</example-url>
|
|
2741
|
+
* <example-url>/#/common/display/tag/layout-only-alignment</example-url>
|
|
2742
|
+
* <example-url>/#/common/display/tag/layout-only-gap-variants</example-url>
|
|
2743
|
+
* <example-url>/#/common/display/tag/link-mode</example-url>
|
|
2744
|
+
* <example-url>/#/common/display/tag/slot-overrides-custom-label</example-url>
|
|
2745
|
+
* <example-url>/#/common/display/tag/slot-overrides-prefix-label-suffix</example-url>
|
|
2746
|
+
* <example-url>/#/common/display/tag/truncate-maxwidth</example-url>
|
|
2747
|
+
* <example-url>/#/common/display/tag/variant-matrix</example-url>
|
|
2383
2748
|
*/
|
|
2384
2749
|
class CngxTagGroupHeader {
|
|
2385
2750
|
templateRef = inject(TemplateRef);
|
|
@@ -2434,27 +2799,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
2434
2799
|
* - Configuration cascade (`provideTagConfig`) - deferred (see
|
|
2435
2800
|
* `display-accepted-debt.md §1`).
|
|
2436
2801
|
*
|
|
2437
|
-
* @category common/display
|
|
2438
|
-
* @docsKind primary
|
|
2439
2802
|
* @wcag AA
|
|
2440
2803
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/tag-group/tag-group.component.ts
|
|
2441
|
-
* @since 0.
|
|
2804
|
+
* @since 0.3.0
|
|
2442
2805
|
* @relatedTo CngxTag, CngxTagGroupHeader, CngxTagGroupAccessory, CNGX_TAG_GROUP
|
|
2443
2806
|
* @slot cngxTagGroupHeader Replaces the group's heading row.
|
|
2444
2807
|
* @slot cngxTagGroupAccessory Trailing control beside the header, e.g. a clear-all button.
|
|
2445
|
-
* <example-url
|
|
2446
|
-
* <example-url
|
|
2447
|
-
* <example-url
|
|
2448
|
-
* <example-url
|
|
2449
|
-
* <example-url
|
|
2450
|
-
* <example-url
|
|
2451
|
-
* <example-url
|
|
2452
|
-
* <example-url
|
|
2453
|
-
* <example-url
|
|
2454
|
-
* <example-url
|
|
2455
|
-
* <example-url
|
|
2456
|
-
* <example-url
|
|
2457
|
-
* <example-url
|
|
2808
|
+
* <example-url>/#/common/display/tag/app-wide-defaults-via-providetagconfig</example-url>
|
|
2809
|
+
* <example-url>/#/common/display/tag/color-palette</example-url>
|
|
2810
|
+
* <example-url>/#/common/display/tag/composition-with-cngxicon</example-url>
|
|
2811
|
+
* <example-url>/#/common/display/tag/density</example-url>
|
|
2812
|
+
* <example-url>/#/common/display/tag-group/semantic-list</example-url>
|
|
2813
|
+
* <example-url>/#/common/display/tag-group/with-header-accessory</example-url>
|
|
2814
|
+
* <example-url>/#/common/display/tag-group/alignment</example-url>
|
|
2815
|
+
* <example-url>/#/common/display/tag-group/gap-variants</example-url>
|
|
2816
|
+
* <example-url>/#/common/display/tag/link-mode</example-url>
|
|
2817
|
+
* <example-url>/#/common/display/tag/slot-overrides-custom-label</example-url>
|
|
2818
|
+
* <example-url>/#/common/display/tag/slot-overrides-prefix-label-suffix</example-url>
|
|
2819
|
+
* <example-url>/#/common/display/tag/truncate-maxwidth</example-url>
|
|
2820
|
+
* <example-url>/#/common/display/tag/variant-matrix</example-url>
|
|
2821
|
+
* @axis level molecule
|
|
2458
2822
|
*/
|
|
2459
2823
|
class CngxTagGroup {
|
|
2460
2824
|
/**
|
|
@@ -2479,17 +2843,14 @@ class CngxTagGroup {
|
|
|
2479
2843
|
*/
|
|
2480
2844
|
label = input(undefined, ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
2481
2845
|
/**
|
|
2482
|
-
*
|
|
2483
|
-
*
|
|
2484
|
-
*
|
|
2485
|
-
* `private` per NG1053; `protected` blocks external template
|
|
2486
|
-
* bindings). The hook is intentionally **not** the contract
|
|
2487
|
-
* surface - that role belongs to `semanticList` below, typed
|
|
2488
|
-
* `Signal<boolean>` so test doubles and programmatic
|
|
2489
|
-
* implementers of `CngxTagGroupHost` can satisfy the interface
|
|
2490
|
-
* without owning an Angular `input()`.
|
|
2846
|
+
* Whether the group exposes itself as a list (`role="list"`, with `role="listitem"` on each
|
|
2847
|
+
* projected tag), bound as `[semanticList]`. The default is the tag config's
|
|
2848
|
+
* `groupDefaults.semanticList`, or `false`, read once when the group is constructed.
|
|
2491
2849
|
*
|
|
2492
|
-
*
|
|
2850
|
+
* The field is class-public because Angular rejects `private` on an input (NG1053) and `protected`
|
|
2851
|
+
* blocks external template bindings. The host contract is the `semanticList` field below, typed
|
|
2852
|
+
* `Signal<boolean>` so test doubles and programmatic implementers of `CngxTagGroupHost` can satisfy
|
|
2853
|
+
* the interface without owning an Angular `input()`.
|
|
2493
2854
|
*/
|
|
2494
2855
|
semanticListInput = input(this.cfg.groupDefaults?.semanticList ?? false, { ...(ngDevMode ? { debugName: "semanticListInput" } : /* istanbul ignore next */ {}), alias: 'semanticList' });
|
|
2495
2856
|
/**
|
|
@@ -2561,20 +2922,23 @@ class CngxTagGroup {
|
|
|
2561
2922
|
a.count === b.count });
|
|
2562
2923
|
constructor() {
|
|
2563
2924
|
// Dev-mode advisory: `[label]` without `[semanticList]="true"` lands
|
|
2564
|
-
// `aria-label` on a
|
|
2565
|
-
//
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
semanticList
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
'[
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2925
|
+
// `aria-label` on a role-less host, where ARIA prohibits naming, so most
|
|
2926
|
+
// AT drops the label and no "list, N items" is announced. One-shot,
|
|
2927
|
+
// tree-shaken in prod.
|
|
2928
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
2929
|
+
afterNextRender(() => {
|
|
2930
|
+
const { label, semanticList } = untracked(() => ({
|
|
2931
|
+
label: this.label(),
|
|
2932
|
+
semanticList: this.semanticList(),
|
|
2933
|
+
}));
|
|
2934
|
+
if (label && !semanticList) {
|
|
2935
|
+
cngxDevWarn('CNGX1018', '[cngx-tag-group] [label] is bound without [semanticList]="true"; ' +
|
|
2936
|
+
'the aria-label lands on a generic <div>. Add ' +
|
|
2937
|
+
'[semanticList]="true" to expose role="list" + aria-label, ' +
|
|
2938
|
+
'or remove [label].');
|
|
2939
|
+
}
|
|
2940
|
+
});
|
|
2941
|
+
}
|
|
2578
2942
|
}
|
|
2579
2943
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTagGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2580
2944
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxTagGroup, isStandalone: true, selector: "cngx-tag-group", inputs: { gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, semanticListInput: { classPropertyName: "semanticListInput", publicName: "semanticList", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.cngx-tag-group--gap-xs": "gap() === 'xs'", "class.cngx-tag-group--gap-md": "gap() === 'md'", "class.cngx-tag-group--align-start": "align() === 'start'", "class.cngx-tag-group--align-center": "align() === 'center'", "class.cngx-tag-group--align-end": "align() === 'end'", "class.cngx-tag-group--align-between": "align() === 'between'", "attr.role": "semanticList() ? 'list' : null", "attr.aria-label": "label() ?? null" }, classAttribute: "cngx-tag-group" }, providers: [{ provide: CNGX_TAG_GROUP, useExisting: CngxTagGroup }], queries: [{ propertyName: "headerSlot", first: true, predicate: CngxTagGroupHeader, descendants: true, isSignal: true }, { propertyName: "accessorySlot", first: true, predicate: CngxTagGroupAccessory, descendants: true, isSignal: true }, { propertyName: "projectedTags", predicate: CngxTag, isSignal: true }], exportAs: ["cngxTagGroup"], ngImport: i0, template: `
|
|
@@ -2615,7 +2979,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
2615
2979
|
}], ctorParameters: () => [], propDecorators: { gap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gap", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], semanticListInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "semanticList", required: false }] }], headerSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxTagGroupHeader), { isSignal: true }] }], accessorySlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxTagGroupAccessory), { isSignal: true }] }], projectedTags: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CngxTag), { isSignal: true }] }] } });
|
|
2616
2980
|
|
|
2617
2981
|
/**
|
|
2618
|
-
* @module
|
|
2982
|
+
* @module `@cngx/common/display`
|
|
2619
2983
|
*
|
|
2620
2984
|
* Display-only atoms: no behavior, no state beyond presentational flags.
|
|
2621
2985
|
* Icons, avatars, badges, dividers - building blocks that render content
|
|
@@ -2627,5 +2991,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
2627
2991
|
* Generated bundle index. Do not edit.
|
|
2628
2992
|
*/
|
|
2629
2993
|
|
|
2630
|
-
export { CNGX_DISPLAY_I18N, CNGX_DISPLAY_LANGUAGE_EN, CNGX_TAG_CONFIG, CNGX_TAG_GROUP, CngxAvatar, CngxAvatarGroup, CngxBadge, CngxCheckboxIndicator, CngxChip, CngxDivider, CngxIcon, CngxMeta, CngxMetaList, CngxPasswordStrengthMeter, CngxRadioIndicator, CngxSegmentedProgress, CngxStatus, CngxTag, CngxTagGroup, CngxTagGroupAccessory, CngxTagGroupHeader, CngxTagLabel, CngxTagPrefix, CngxTagSuffix, CngxTime, injectDisplayI18n, injectTagConfig, provideDisplayI18n, provideTagConfig, provideTagConfigAt, withDisplayI18nLabels, withTagColors, withTagDefaults, withTagGroupDefaults, withTagSlots };
|
|
2994
|
+
export { CNGX_DISPLAY_I18N, CNGX_DISPLAY_LANGUAGE_EN, CNGX_RADIO_CONFIG, CNGX_TAG_CONFIG, CNGX_TAG_GROUP, CngxAvatar, CngxAvatarGroup, CngxBadge, CngxCheckboxIndicator, CngxChip, CngxDivider, CngxIcon, CngxIconSvg, CngxMeta, CngxMetaList, CngxPasswordStrengthMeter, CngxRadioIndicator, CngxSegmentedProgress, CngxStatus, CngxTag, CngxTagGroup, CngxTagGroupAccessory, CngxTagGroupHeader, CngxTagLabel, CngxTagPrefix, CngxTagSuffix, CngxTime, createIconSvgElement, injectDisplayI18n, injectRadioConfig, injectTagConfig, provideDisplayI18n, provideRadioConfig, provideRadioConfigAt, provideTagConfig, provideTagConfigAt, withDisplayI18nLabels, withRadioSkin, withTagColors, withTagDefaults, withTagGroupDefaults, withTagSlots };
|
|
2631
2995
|
//# sourceMappingURL=cngx-common-display.mjs.map
|