@cngx/common 0.1.0-rc.9 → 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 +19 -8
- package/data/README.md +10 -10
- package/fesm2022/cngx-common-a11y.mjs +701 -263
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +83 -64
- 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 +135 -76
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +749 -296
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +51 -29
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +695 -405
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +112 -112
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +668 -308
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +7066 -2739
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +2121 -492
- 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 +1207 -569
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +256 -261
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +202 -262
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +28 -61
- 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 +1 -1
- package/menu-button/README.md +234 -0
- package/package.json +14 -4
- package/popover/README.md +42 -5
- package/popover/tooltip-indicator.scss +52 -0
- package/schematics/ng-add/index.js +7 -7
- package/schematics/ng-add/schema.json +5 -0
- package/stepper/README.md +0 -1
- 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 +43 -11
- package/theming/components/cngx-popover.css +37 -13
- 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 +343 -120
- 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 +671 -384
- package/types/cngx-common-command.d.ts +44 -47
- package/types/cngx-common-data.d.ts +350 -342
- package/types/cngx-common-dialog.d.ts +91 -120
- package/types/cngx-common-display.d.ts +475 -300
- package/types/cngx-common-interactive.d.ts +4350 -1723
- package/types/cngx-common-layout.d.ts +1365 -286
- package/types/cngx-common-menu-button.d.ts +382 -0
- package/types/cngx-common-popover.d.ts +671 -289
- package/types/cngx-common-stepper.d.ts +217 -347
- package/types/cngx-common-tabs.d.ts +173 -386
- package/types/cngx-common-timeline.d.ts +25 -104
|
@@ -1,8 +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, afterNextRender, TemplateRef, contentChild,
|
|
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 { cngxDevWarn } from '@cngx/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';
|
|
6
6
|
import { NgTemplateOutlet } from '@angular/common';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -12,28 +12,27 @@ import { NgTemplateOutlet } from '@angular/common';
|
|
|
12
12
|
* Decorative by default (`aria-hidden="true"`); set `label` to make it
|
|
13
13
|
* informative (`role="img"`, `aria-label`).
|
|
14
14
|
*
|
|
15
|
-
* @category common/display
|
|
16
|
-
* @docsKind primary
|
|
17
15
|
* @wcag AA
|
|
18
16
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/icon/icon.component.ts
|
|
19
17
|
* @selector cngx-icon
|
|
20
|
-
* @since 0.
|
|
18
|
+
* @since 0.3.0
|
|
21
19
|
* @relatedTo CngxAvatar, CngxBadge, CngxChip
|
|
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
|
|
36
|
-
* <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
|
|
37
36
|
*/
|
|
38
37
|
class CngxIcon {
|
|
39
38
|
/** Accessible label. When set, the icon is treated as informative content. */
|
|
@@ -41,7 +40,7 @@ class CngxIcon {
|
|
|
41
40
|
/** Size preset. Maps to CSS custom properties on the host. */
|
|
42
41
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
43
42
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxIcon, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
44
|
-
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 });
|
|
45
44
|
}
|
|
46
45
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxIcon, decorators: [{
|
|
47
46
|
type: Component,
|
|
@@ -55,15 +54,215 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
55
54
|
'[class.cngx-icon--md]': 'size() === "md"',
|
|
56
55
|
'[class.cngx-icon--lg]': 'size() === "lg"',
|
|
57
56
|
'[class.cngx-icon--xl]': 'size() === "xl"',
|
|
58
|
-
}, 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"] }]
|
|
59
58
|
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
60
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
|
+
|
|
61
261
|
/**
|
|
62
262
|
* The English display section: the single source of the display atoms'
|
|
63
263
|
* English copy. `CNGX_DISPLAY_I18N` defaults to it.
|
|
64
264
|
*
|
|
65
|
-
* @
|
|
66
|
-
* @since 0.1.0
|
|
265
|
+
* @since 0.3.0
|
|
67
266
|
* @relatedTo CNGX_DISPLAY_I18N
|
|
68
267
|
*/
|
|
69
268
|
const CNGX_DISPLAY_LANGUAGE_EN = {
|
|
@@ -120,30 +319,24 @@ const displayBundle = createSectionBundle({
|
|
|
120
319
|
* for the app locale; the value is a `Signal`, shared by every reader under
|
|
121
320
|
* one injector.
|
|
122
321
|
*
|
|
123
|
-
* @category common/display/i18n
|
|
124
322
|
* @wcag AA
|
|
125
323
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/i18n/display-i18n.ts
|
|
126
|
-
* @since 0.
|
|
324
|
+
* @since 0.3.0
|
|
127
325
|
* @relatedTo CngxAvatar, CngxAvatarGroup, CngxSegmentedProgress, CngxChip
|
|
128
326
|
*/
|
|
129
327
|
const CNGX_DISPLAY_I18N = new InjectionToken('CngxDisplayI18n', {
|
|
130
328
|
providedIn: 'root',
|
|
131
329
|
factory: () => displayBundle.build(),
|
|
132
330
|
});
|
|
133
|
-
/** @internal */
|
|
134
|
-
function defineDisplayI18nFeature(fn) {
|
|
135
|
-
return Object.assign(fn, { _target: 'i18n' });
|
|
136
|
-
}
|
|
137
331
|
/**
|
|
138
332
|
* Override display labels via a partial bundle - unset keys keep the
|
|
139
333
|
* language pack's copy, or the English default. Pass a `Signal` of a partial
|
|
140
334
|
* bundle to switch languages at runtime.
|
|
141
335
|
*
|
|
142
|
-
* @
|
|
143
|
-
* @since 0.1.0
|
|
336
|
+
* @since 0.3.0
|
|
144
337
|
*/
|
|
145
338
|
function withDisplayI18nLabels(overrides) {
|
|
146
|
-
return
|
|
339
|
+
return (bundle) => createOverrideMerge(bundle, overrides);
|
|
147
340
|
}
|
|
148
341
|
/**
|
|
149
342
|
* Provider for the display i18n bundle. Returns a plain `Provider`, so it also
|
|
@@ -163,8 +356,7 @@ function withDisplayI18nLabels(overrides) {
|
|
|
163
356
|
* });
|
|
164
357
|
* ```
|
|
165
358
|
*
|
|
166
|
-
* @
|
|
167
|
-
* @since 0.1.0
|
|
359
|
+
* @since 0.3.0
|
|
168
360
|
*/
|
|
169
361
|
function provideDisplayI18n(...features) {
|
|
170
362
|
return {
|
|
@@ -176,8 +368,7 @@ function provideDisplayI18n(...features) {
|
|
|
176
368
|
* Inject the resolved display i18n bundle signal. Read it inside a
|
|
177
369
|
* `computed()` or template so a runtime override flip re-derives.
|
|
178
370
|
*
|
|
179
|
-
* @
|
|
180
|
-
* @since 0.1.0
|
|
371
|
+
* @since 0.3.0
|
|
181
372
|
*/
|
|
182
373
|
function injectDisplayI18n() {
|
|
183
374
|
return displayBundle.resolve(inject(CNGX_DISPLAY_I18N));
|
|
@@ -201,15 +392,14 @@ const segmentsEqual = (a, b) => a.length === b.length && a.every((s, i) => s ===
|
|
|
201
392
|
* <cngx-segmented-progress [segments]="['done', 'error', 'active', 'todo']" />
|
|
202
393
|
* ```
|
|
203
394
|
*
|
|
204
|
-
* @category common/display
|
|
205
|
-
* @docsKind primary
|
|
206
395
|
* @wcag AA
|
|
207
396
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/segmented-progress/segmented-progress.component.ts
|
|
208
|
-
* @since 0.
|
|
397
|
+
* @since 0.3.0
|
|
209
398
|
* @relatedTo CngxStepper, CngxBadge
|
|
210
|
-
* <example-url
|
|
211
|
-
* <example-url
|
|
212
|
-
* <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
|
|
213
403
|
*/
|
|
214
404
|
class CngxSegmentedProgress {
|
|
215
405
|
i18n = injectDisplayI18n();
|
|
@@ -296,14 +486,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
296
486
|
* `--cngx-divider-inset`). Consumers apply their own styles through
|
|
297
487
|
* `.cngx-divider` or override the variables.
|
|
298
488
|
*
|
|
299
|
-
* @category common/display
|
|
300
|
-
* @docsKind primary
|
|
301
489
|
* @wcag AA
|
|
302
490
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/divider/divider.directive.ts
|
|
303
491
|
* @selector cngx-divider
|
|
304
|
-
* @since 0.
|
|
305
|
-
* <example-url
|
|
306
|
-
* <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
|
|
307
496
|
*/
|
|
308
497
|
class CngxDivider {
|
|
309
498
|
/** Layout axis. Horizontal dividers sit between rows; vertical between columns. */
|
|
@@ -340,15 +529,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
340
529
|
* Optional status indicator dot via `status`. Size and shape driven by
|
|
341
530
|
* CSS custom properties.
|
|
342
531
|
*
|
|
343
|
-
* @category common/display
|
|
344
|
-
* @docsKind primary
|
|
345
532
|
* @wcag AA
|
|
346
533
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/avatar/avatar.component.ts
|
|
347
|
-
* @since 0.
|
|
534
|
+
* @since 0.3.0
|
|
348
535
|
* @relatedTo CngxIcon, CngxBadge, CngxChip
|
|
349
|
-
* <example-url
|
|
350
|
-
* <example-url
|
|
351
|
-
* <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
|
|
352
540
|
*/
|
|
353
541
|
class CngxAvatar {
|
|
354
542
|
i18n = injectDisplayI18n();
|
|
@@ -425,7 +613,7 @@ class CngxAvatar {
|
|
|
425
613
|
[attr.aria-label]="statusAriaLabel()"
|
|
426
614
|
></span>
|
|
427
615
|
}
|
|
428
|
-
`, 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 });
|
|
429
617
|
}
|
|
430
618
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxAvatar, decorators: [{
|
|
431
619
|
type: Component,
|
|
@@ -463,7 +651,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
463
651
|
[attr.aria-label]="statusAriaLabel()"
|
|
464
652
|
></span>
|
|
465
653
|
}
|
|
466
|
-
`, 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"] }]
|
|
467
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 }] }] } });
|
|
468
656
|
|
|
469
657
|
/**
|
|
@@ -484,12 +672,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
484
672
|
* </cngx-avatar-group>
|
|
485
673
|
* ```
|
|
486
674
|
*
|
|
487
|
-
* @category common/display
|
|
488
|
-
* @docsKind primary
|
|
489
675
|
* @wcag AA
|
|
490
676
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/avatar-group/avatar-group.component.ts
|
|
491
|
-
* @since 0.
|
|
677
|
+
* @since 0.3.0
|
|
492
678
|
* @relatedTo CngxAvatar
|
|
679
|
+
* @axis level molecule
|
|
493
680
|
*/
|
|
494
681
|
class CngxAvatarGroup {
|
|
495
682
|
i18n = injectDisplayI18n();
|
|
@@ -598,15 +785,14 @@ const NUMBER_FORMAT = {};
|
|
|
598
785
|
* - String values (rendered verbatim)
|
|
599
786
|
* - Boolean `true` (dot mode, no text)
|
|
600
787
|
*
|
|
601
|
-
* @category common/display
|
|
602
|
-
* @docsKind primary
|
|
603
788
|
* @wcag AA
|
|
604
789
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/badge/badge.directive.ts
|
|
605
|
-
* @since 0.
|
|
790
|
+
* @since 0.3.0
|
|
606
791
|
* @relatedTo CngxAvatar, CngxIcon, CngxChip
|
|
607
|
-
* <example-url
|
|
608
|
-
* <example-url
|
|
609
|
-
* <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
|
|
610
796
|
*/
|
|
611
797
|
class CngxBadge {
|
|
612
798
|
/**
|
|
@@ -772,21 +958,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
772
958
|
* decides whether to write state directly or route through a commit
|
|
773
959
|
* flow. This keeps the chip usable from any level of the stack.
|
|
774
960
|
*
|
|
775
|
-
* @category common/display
|
|
776
|
-
* @docsKind primary
|
|
777
961
|
* @wcag AA
|
|
778
962
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/chip/chip.component.ts
|
|
779
|
-
* @since 0.
|
|
963
|
+
* @since 0.3.0
|
|
780
964
|
* @relatedTo CngxTag, CngxTagGroup, CngxBadge
|
|
781
|
-
* <example-url
|
|
782
|
-
* <example-url
|
|
783
|
-
* <example-url
|
|
784
|
-
* <example-url
|
|
785
|
-
* <example-url
|
|
786
|
-
* <example-url
|
|
787
|
-
* <example-url
|
|
788
|
-
* <example-url
|
|
789
|
-
* <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
|
|
790
975
|
*/
|
|
791
976
|
class CngxChip {
|
|
792
977
|
i18n = injectDisplayI18n();
|
|
@@ -811,6 +996,8 @@ class CngxChip {
|
|
|
811
996
|
*/
|
|
812
997
|
removeAriaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "removeAriaLabel" }] : /* istanbul ignore next */ []));
|
|
813
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;
|
|
814
1001
|
/** Fires when the user clicks the close button. */
|
|
815
1002
|
remove = output();
|
|
816
1003
|
autoId = nextUid('cngx-chip');
|
|
@@ -834,7 +1021,7 @@ class CngxChip {
|
|
|
834
1021
|
>
|
|
835
1022
|
<!--
|
|
836
1023
|
Named content slot for the close glyph. Default renders the
|
|
837
|
-
|
|
1024
|
+
shared X icon - consumers project any icon component by tagging
|
|
838
1025
|
it with the attribute:
|
|
839
1026
|
|
|
840
1027
|
<cngx-chip [removable]="true">
|
|
@@ -847,15 +1034,15 @@ class CngxChip {
|
|
|
847
1034
|
the TemplateRef/outlet dance.
|
|
848
1035
|
-->
|
|
849
1036
|
<ng-content select="[cngxChipClose]">
|
|
850
|
-
<
|
|
1037
|
+
<svg class="cngx-chip__remove-icon" [cngxIconSvg]="removeIcon"></svg>
|
|
851
1038
|
</ng-content>
|
|
852
1039
|
</button>
|
|
853
1040
|
}
|
|
854
|
-
`, 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 });
|
|
855
1042
|
}
|
|
856
1043
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxChip, decorators: [{
|
|
857
1044
|
type: Component,
|
|
858
|
-
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: {
|
|
859
1046
|
class: 'cngx-chip',
|
|
860
1047
|
'[attr.id]': 'resolvedId()',
|
|
861
1048
|
}, template: `
|
|
@@ -871,7 +1058,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
871
1058
|
>
|
|
872
1059
|
<!--
|
|
873
1060
|
Named content slot for the close glyph. Default renders the
|
|
874
|
-
|
|
1061
|
+
shared X icon - consumers project any icon component by tagging
|
|
875
1062
|
it with the attribute:
|
|
876
1063
|
|
|
877
1064
|
<cngx-chip [removable]="true">
|
|
@@ -884,20 +1071,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
884
1071
|
the TemplateRef/outlet dance.
|
|
885
1072
|
-->
|
|
886
1073
|
<ng-content select="[cngxChipClose]">
|
|
887
|
-
<
|
|
1074
|
+
<svg class="cngx-chip__remove-icon" [cngxIconSvg]="removeIcon"></svg>
|
|
888
1075
|
</ng-content>
|
|
889
1076
|
</button>
|
|
890
1077
|
}
|
|
891
|
-
`, 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"] }]
|
|
892
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"] }] } });
|
|
893
1080
|
|
|
894
1081
|
/** Tone glyph rendered inside the decorative dot - the non-colour signal. */
|
|
895
|
-
const
|
|
896
|
-
success:
|
|
897
|
-
warning:
|
|
898
|
-
danger:
|
|
899
|
-
info:
|
|
900
|
-
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,
|
|
901
1088
|
};
|
|
902
1089
|
/**
|
|
903
1090
|
* Semantic health indicator - a decorative tone dot paired with a visible
|
|
@@ -928,15 +1115,14 @@ const TONE_GLYPH = {
|
|
|
928
1115
|
* visible `label`: without the glyph, colour is the dot's only signal, which a
|
|
929
1116
|
* sighted colour-blind reader cannot resolve (a dev-mode warning enforces this).
|
|
930
1117
|
*
|
|
931
|
-
* @category common/display
|
|
932
|
-
* @docsKind primary
|
|
933
1118
|
* @wcag AA
|
|
934
1119
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/status/status.component.ts
|
|
935
|
-
* @since 0.
|
|
1120
|
+
* @since 0.3.0
|
|
936
1121
|
* @relatedTo CngxBadge, CngxTag, CngxChip
|
|
937
1122
|
*
|
|
938
|
-
* <example-url
|
|
939
|
-
* <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
|
|
940
1126
|
*/
|
|
941
1127
|
class CngxStatus {
|
|
942
1128
|
elRef = inject((ElementRef));
|
|
@@ -955,8 +1141,8 @@ class CngxStatus {
|
|
|
955
1141
|
* since colour alone fails a sighted colour-blind reader (Pillar 2).
|
|
956
1142
|
*/
|
|
957
1143
|
glyph = input(true, { ...(ngDevMode ? { debugName: "glyph" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
958
|
-
/** @internal Tone glyph
|
|
959
|
-
|
|
1144
|
+
/** @internal Tone glyph drawn into the decorative dot. */
|
|
1145
|
+
toneIcon = computed(() => TONE_ICON[this.tone()], ...(ngDevMode ? [{ debugName: "toneIcon" }] : /* istanbul ignore next */ []));
|
|
960
1146
|
constructor() {
|
|
961
1147
|
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
962
1148
|
afterNextRender(() => {
|
|
@@ -976,15 +1162,15 @@ class CngxStatus {
|
|
|
976
1162
|
}
|
|
977
1163
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxStatus, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
978
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: `
|
|
979
|
-
<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>
|
|
980
1166
|
@if (label()) {
|
|
981
1167
|
<span class="cngx-status__label">{{ label() }}</span>
|
|
982
1168
|
}
|
|
983
|
-
`, 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 });
|
|
984
1170
|
}
|
|
985
1171
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxStatus, decorators: [{
|
|
986
1172
|
type: Component,
|
|
987
|
-
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: {
|
|
988
1174
|
class: 'cngx-status',
|
|
989
1175
|
'[class.cngx-status--success]': "tone() === 'success'",
|
|
990
1176
|
'[class.cngx-status--warning]': "tone() === 'warning'",
|
|
@@ -993,11 +1179,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
993
1179
|
'[class.cngx-status--neutral]': "tone() === 'neutral'",
|
|
994
1180
|
'[attr.aria-live]': 'live()',
|
|
995
1181
|
}, template: `
|
|
996
|
-
<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>
|
|
997
1183
|
@if (label()) {
|
|
998
1184
|
<span class="cngx-status__label">{{ label() }}</span>
|
|
999
1185
|
}
|
|
1000
|
-
`, 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"] }]
|
|
1001
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 }] }] } });
|
|
1002
1188
|
|
|
1003
1189
|
/**
|
|
@@ -1009,12 +1195,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1009
1195
|
* Presentational by design (see {@link CngxMeta}): it is not a semantic list.
|
|
1010
1196
|
* Tune the spacing / colour through the `--cngx-meta-list-*` custom properties.
|
|
1011
1197
|
*
|
|
1012
|
-
* @category common/display
|
|
1013
1198
|
* @wcag AA
|
|
1014
1199
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/meta/meta-list.component.ts
|
|
1015
|
-
* @since 0.
|
|
1200
|
+
* @since 0.3.0
|
|
1016
1201
|
* @relatedTo CngxMeta
|
|
1017
|
-
* <example-url
|
|
1202
|
+
* <example-url>/#/common/display/meta/metadata-line</example-url>
|
|
1203
|
+
* @axis level atom
|
|
1018
1204
|
*/
|
|
1019
1205
|
class CngxMetaList {
|
|
1020
1206
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxMetaList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -1037,12 +1223,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1037
1223
|
* need real term/description semantics for a longer or more structured block,
|
|
1038
1224
|
* reach for a definition list instead - `CngxMeta` deliberately stays flat.
|
|
1039
1225
|
*
|
|
1040
|
-
* @category common/display
|
|
1041
1226
|
* @wcag AA
|
|
1042
1227
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/meta/meta.component.ts
|
|
1043
|
-
* @since 0.
|
|
1228
|
+
* @since 0.3.0
|
|
1044
1229
|
* @relatedTo CngxMetaList
|
|
1045
|
-
* <example-url
|
|
1230
|
+
* <example-url>/#/common/display/meta/metadata-line</example-url>
|
|
1046
1231
|
*/
|
|
1047
1232
|
class CngxMeta {
|
|
1048
1233
|
/** The metadata key. Rendered bold before the value; omit for a value-only item. */
|
|
@@ -1065,9 +1250,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1065
1250
|
* Presentational checkbox / checkmark indicator.
|
|
1066
1251
|
*
|
|
1067
1252
|
* **Why this exists.**
|
|
1068
|
-
* Across the library, "is this row selected?" shows up as a
|
|
1069
|
-
*
|
|
1070
|
-
* 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
|
|
1071
1255
|
* `ng decompose cngx-*` schematics should emit a consistent indicator shape
|
|
1072
1256
|
* regardless of which list-like component they originated from. This atom
|
|
1073
1257
|
* unifies all three surfaces behind a single presentational molecule -
|
|
@@ -1089,16 +1273,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1089
1273
|
* truth about "selected" is communicated by the row's own `aria-selected`
|
|
1090
1274
|
* / `role="option"` ARIA, not by this decoration.
|
|
1091
1275
|
*
|
|
1092
|
-
* @category common/display
|
|
1093
|
-
* @docsKind primary
|
|
1094
1276
|
* @wcag AA
|
|
1095
1277
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/checkbox-indicator/checkbox-indicator.component.ts
|
|
1096
|
-
* @since 0.
|
|
1278
|
+
* @since 0.3.0
|
|
1097
1279
|
* @relatedTo CngxRadioIndicator, CngxIcon
|
|
1098
|
-
* <example-url
|
|
1099
|
-
* <example-url
|
|
1100
|
-
* <example-url
|
|
1101
|
-
* <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
|
|
1102
1285
|
*/
|
|
1103
1286
|
class CngxCheckboxIndicator {
|
|
1104
1287
|
/**
|
|
@@ -1125,8 +1308,8 @@ class CngxCheckboxIndicator {
|
|
|
1125
1308
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1126
1309
|
/**
|
|
1127
1310
|
* Consumer-supplied template for the check glyph. When `null` (default),
|
|
1128
|
-
* the built-in `<span class="cngx-checkbox-indicator__check"
|
|
1129
|
-
* 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
|
|
1130
1313
|
* entirely - the `__check` class is NOT applied to the custom content
|
|
1131
1314
|
* (consumers own the styling of their replacement).
|
|
1132
1315
|
*
|
|
@@ -1139,16 +1322,22 @@ class CngxCheckboxIndicator {
|
|
|
1139
1322
|
/**
|
|
1140
1323
|
* Consumer-supplied template for the indeterminate dash glyph. Mirrors
|
|
1141
1324
|
* {@link checkGlyph} - defaults to the built-in
|
|
1142
|
-
* `<span class="cngx-checkbox-indicator__dash"
|
|
1325
|
+
* `<span class="cngx-checkbox-indicator__dash">` with the default minus svg.
|
|
1143
1326
|
*/
|
|
1144
1327
|
dashGlyph = input(null, ...(ngDevMode ? [{ debugName: "dashGlyph" }] : /* istanbul ignore next */ []));
|
|
1328
|
+
checkIcon = CNGX_ICON_CHECK;
|
|
1329
|
+
dashIcon = CNGX_ICON_MINUS;
|
|
1145
1330
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCheckboxIndicator, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1146
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: `
|
|
1147
1332
|
<ng-template #defaultDashGlyph>
|
|
1148
|
-
<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>
|
|
1149
1336
|
</ng-template>
|
|
1150
1337
|
<ng-template #defaultCheckGlyph>
|
|
1151
|
-
<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>
|
|
1152
1341
|
</ng-template>
|
|
1153
1342
|
|
|
1154
1343
|
@if (variant() === 'checkbox') {
|
|
@@ -1166,11 +1355,11 @@ class CngxCheckboxIndicator {
|
|
|
1166
1355
|
<ng-container *ngTemplateOutlet="checkGlyph() ?? defaultCheckGlyph" />
|
|
1167
1356
|
}
|
|
1168
1357
|
}
|
|
1169
|
-
`, 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 });
|
|
1170
1359
|
}
|
|
1171
1360
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCheckboxIndicator, decorators: [{
|
|
1172
1361
|
type: Component,
|
|
1173
|
-
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: {
|
|
1174
1363
|
class: 'cngx-checkbox-indicator',
|
|
1175
1364
|
'aria-hidden': 'true',
|
|
1176
1365
|
'[class.cngx-checkbox-indicator--checkbox]': "variant() === 'checkbox'",
|
|
@@ -1183,10 +1372,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1183
1372
|
'[class.cngx-checkbox-indicator--lg]': "size() === 'lg'",
|
|
1184
1373
|
}, template: `
|
|
1185
1374
|
<ng-template #defaultDashGlyph>
|
|
1186
|
-
<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>
|
|
1187
1378
|
</ng-template>
|
|
1188
1379
|
<ng-template #defaultCheckGlyph>
|
|
1189
|
-
<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>
|
|
1190
1383
|
</ng-template>
|
|
1191
1384
|
|
|
1192
1385
|
@if (variant() === 'checkbox') {
|
|
@@ -1204,11 +1397,71 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1204
1397
|
<ng-container *ngTemplateOutlet="checkGlyph() ?? defaultCheckGlyph" />
|
|
1205
1398
|
}
|
|
1206
1399
|
}
|
|
1207
|
-
`, 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"] }]
|
|
1208
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 }] }] } });
|
|
1209
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
|
+
|
|
1210
1460
|
/**
|
|
1211
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.
|
|
1212
1465
|
*
|
|
1213
1466
|
* **Why this exists.**
|
|
1214
1467
|
* The library's `@cngx/forms/select` panel currently composes
|
|
@@ -1224,7 +1477,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1224
1477
|
* land in their own phase.
|
|
1225
1478
|
*
|
|
1226
1479
|
* **Responsibilities (intentionally narrow).**
|
|
1227
|
-
* - 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).
|
|
1228
1482
|
* - Express checked / disabled visual state via host classes the
|
|
1229
1483
|
* consumer (or upstream CSS) can theme.
|
|
1230
1484
|
* - Apply size presets (`sm` / `md` / `lg`) as CSS-custom-property
|
|
@@ -1241,34 +1495,51 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1241
1495
|
* Selection is announced via the row's `role="radio"` /
|
|
1242
1496
|
* `aria-checked` ARIA, never by this decoration.
|
|
1243
1497
|
*
|
|
1244
|
-
* @category common/display
|
|
1245
|
-
* @docsKind primary
|
|
1246
1498
|
* @wcag AA
|
|
1247
1499
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/radio-indicator/radio-indicator.component.ts
|
|
1248
|
-
* @since 0.
|
|
1500
|
+
* @since 0.3.0
|
|
1249
1501
|
* @relatedTo CngxCheckboxIndicator, CngxIcon
|
|
1250
|
-
* <example-url
|
|
1251
|
-
* <example-url
|
|
1252
|
-
* <example-url
|
|
1253
|
-
* <example-url
|
|
1254
|
-
* <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
|
|
1255
1511
|
*/
|
|
1256
1512
|
class CngxRadioIndicator {
|
|
1257
1513
|
/** Whether the current value is selected. */
|
|
1258
1514
|
checked = input(false, ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
1259
1515
|
/**
|
|
1260
|
-
* Disabled visual state. Purely cosmetic (
|
|
1516
|
+
* Disabled visual state. Purely cosmetic (disabled text colour) - the indicator
|
|
1261
1517
|
* never intercepts events, so this is a hint, not a block.
|
|
1262
1518
|
*/
|
|
1263
1519
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1264
1520
|
/** Size preset. Maps to a `--cngx-radio-indicator-size` custom property. */
|
|
1265
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;
|
|
1266
1532
|
/**
|
|
1267
1533
|
* Consumer-supplied template for the centred dot. When `null` (default),
|
|
1268
|
-
* the built-in `<
|
|
1269
|
-
* rendered
|
|
1270
|
-
*
|
|
1271
|
-
*
|
|
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.
|
|
1272
1543
|
*
|
|
1273
1544
|
* Convention-compatible with `CngxCheckboxIndicator.checkGlyph`: pass a
|
|
1274
1545
|
* `TemplateRef<void>` obtained via `#myDotTpl`. Useful for
|
|
@@ -1277,17 +1548,25 @@ class CngxRadioIndicator {
|
|
|
1277
1548
|
*/
|
|
1278
1549
|
dotGlyph = input(null, ...(ngDevMode ? [{ debugName: "dotGlyph" }] : /* istanbul ignore next */ []));
|
|
1279
1550
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxRadioIndicator, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1280
|
-
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: `
|
|
1281
|
-
<
|
|
1282
|
-
<
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
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
|
+
}
|
|
1288
1560
|
}
|
|
1289
|
-
</
|
|
1290
|
-
|
|
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 });
|
|
1291
1570
|
}
|
|
1292
1571
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxRadioIndicator, decorators: [{
|
|
1293
1572
|
type: Component,
|
|
@@ -1299,18 +1578,127 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1299
1578
|
'[class.cngx-radio-indicator--sm]': "size() === 'sm'",
|
|
1300
1579
|
'[class.cngx-radio-indicator--md]': "size() === 'md'",
|
|
1301
1580
|
'[class.cngx-radio-indicator--lg]': "size() === 'lg'",
|
|
1581
|
+
'[attr.data-skin]': 'resolvedSkin()',
|
|
1302
1582
|
}, template: `
|
|
1303
|
-
<
|
|
1304
|
-
<
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
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
|
+
}
|
|
1310
1591
|
}
|
|
1311
|
-
</
|
|
1312
|
-
|
|
1313
|
-
|
|
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
|
+
}
|
|
1314
1702
|
|
|
1315
1703
|
/**
|
|
1316
1704
|
* Unit ladder for the relative formatter, smallest first. Each `amount` is the
|
|
@@ -1350,12 +1738,11 @@ const RELATIVE_DIVISIONS = [
|
|
|
1350
1738
|
* <cngx-time [date]="invoice.due" [format]="{ dateStyle: 'long' }" />
|
|
1351
1739
|
* ```
|
|
1352
1740
|
*
|
|
1353
|
-
* @category common/display
|
|
1354
|
-
* @docsKind primary
|
|
1355
1741
|
* @wcag AA
|
|
1356
1742
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/time/time.component.ts
|
|
1357
|
-
* @since 0.
|
|
1743
|
+
* @since 0.3.0
|
|
1358
1744
|
* @relatedTo CngxCardTimestamp
|
|
1745
|
+
* @axis level atom
|
|
1359
1746
|
*/
|
|
1360
1747
|
class CngxTime {
|
|
1361
1748
|
locale = injectLocale();
|
|
@@ -1460,13 +1847,12 @@ const filledEqual = (a, b) => a.length === b.length && a.every((v, i) => v === b
|
|
|
1460
1847
|
* <cngx-password-strength-meter [score]="pw.score()" />
|
|
1461
1848
|
* ```
|
|
1462
1849
|
*
|
|
1463
|
-
* @category common/display
|
|
1464
|
-
* @docsKind primary
|
|
1465
1850
|
* @wcag AA
|
|
1466
1851
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/password-strength-meter/password-strength-meter.component.ts
|
|
1467
|
-
* @since 0.
|
|
1852
|
+
* @since 0.3.0
|
|
1468
1853
|
* @relatedTo CngxSegmentedProgress, CngxBadge
|
|
1469
|
-
* <example-url
|
|
1854
|
+
* <example-url>/#/common/display/password-strength-meter/strength-levels</example-url>
|
|
1855
|
+
* @axis level atom
|
|
1470
1856
|
*/
|
|
1471
1857
|
class CngxPasswordStrengthMeter {
|
|
1472
1858
|
/** Strength score, 0 (empty/trivial) to 4 (strong). */
|
|
@@ -1518,10 +1904,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1518
1904
|
* Defaults to no provider - the token resolves to `null` for any
|
|
1519
1905
|
* `CngxTag` that lives outside a `CngxTagGroup`.
|
|
1520
1906
|
*
|
|
1521
|
-
* @category common/display
|
|
1522
1907
|
* @wcag AA
|
|
1523
1908
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/tag-group/tag-group.token.ts
|
|
1524
|
-
* @since 0.
|
|
1909
|
+
* @since 0.3.0
|
|
1525
1910
|
*/
|
|
1526
1911
|
const CNGX_TAG_GROUP = new InjectionToken('CNGX_TAG_GROUP');
|
|
1527
1912
|
|
|
@@ -1570,9 +1955,8 @@ const CNGX_TAG_DEFAULTS = {
|
|
|
1570
1955
|
* (root cascade) or `provideTagConfigAt(...features)` in a component's
|
|
1571
1956
|
* `viewProviders` (sub-tree cascade).
|
|
1572
1957
|
*
|
|
1573
|
-
* @category common/display
|
|
1574
1958
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/tag/config/tag.config.defaults.ts
|
|
1575
|
-
* @since 0.
|
|
1959
|
+
* @since 0.3.0
|
|
1576
1960
|
*/
|
|
1577
1961
|
const CNGX_TAG_CONFIG = new InjectionToken('CNGX_TAG_CONFIG', {
|
|
1578
1962
|
providedIn: 'root',
|
|
@@ -1597,8 +1981,6 @@ const CNGX_TAG_CONFIG = new InjectionToken('CNGX_TAG_CONFIG', {
|
|
|
1597
1981
|
* );
|
|
1598
1982
|
* }
|
|
1599
1983
|
* ```
|
|
1600
|
-
*
|
|
1601
|
-
* @category common/display
|
|
1602
1984
|
*/
|
|
1603
1985
|
function injectTagConfig() {
|
|
1604
1986
|
return inject(CNGX_TAG_CONFIG);
|
|
@@ -1665,23 +2047,22 @@ function injectResolvedTagTemplate(directive, configKey) {
|
|
|
1665
2047
|
* </span>
|
|
1666
2048
|
* ```
|
|
1667
2049
|
*
|
|
1668
|
-
* @category common/display
|
|
1669
2050
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/tag/slots/tag-label.directive.ts
|
|
1670
|
-
* @since 0.
|
|
2051
|
+
* @since 0.3.0
|
|
1671
2052
|
* @relatedTo CngxTag, CngxTagPrefix, CngxTagSuffix
|
|
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
|
|
1684
|
-
* <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>
|
|
1685
2066
|
*/
|
|
1686
2067
|
class CngxTagLabel {
|
|
1687
2068
|
templateRef = inject(TemplateRef);
|
|
@@ -1714,23 +2095,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1714
2095
|
* </span>
|
|
1715
2096
|
* ```
|
|
1716
2097
|
*
|
|
1717
|
-
* @category common/display
|
|
1718
2098
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/tag/slots/tag-prefix.directive.ts
|
|
1719
|
-
* @since 0.
|
|
2099
|
+
* @since 0.3.0
|
|
1720
2100
|
* @relatedTo CngxTag, CngxTagLabel, CngxTagSuffix
|
|
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
|
|
1733
|
-
* <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>
|
|
1734
2114
|
*/
|
|
1735
2115
|
class CngxTagPrefix {
|
|
1736
2116
|
templateRef = inject(TemplateRef);
|
|
@@ -1765,23 +2145,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1765
2145
|
* </span>
|
|
1766
2146
|
* ```
|
|
1767
2147
|
*
|
|
1768
|
-
* @category common/display
|
|
1769
2148
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/tag/slots/tag-suffix.directive.ts
|
|
1770
|
-
* @since 0.
|
|
2149
|
+
* @since 0.3.0
|
|
1771
2150
|
* @relatedTo CngxTag, CngxTagLabel, CngxTagPrefix
|
|
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
|
|
1784
|
-
* <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>
|
|
1785
2164
|
*/
|
|
1786
2165
|
class CngxTagSuffix {
|
|
1787
2166
|
templateRef = inject(TemplateRef);
|
|
@@ -1840,29 +2219,28 @@ const PREDEFINED_TAG_COLORS = new Set([
|
|
|
1840
2219
|
* - Configuration cascade - deferred (see
|
|
1841
2220
|
* `display-accepted-debt.md §1`).
|
|
1842
2221
|
*
|
|
1843
|
-
* @category common/display
|
|
1844
|
-
* @docsKind primary
|
|
1845
2222
|
* @wcag AA
|
|
1846
2223
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/tag/tag.directive.ts
|
|
1847
2224
|
* @selector cngx-tag
|
|
1848
|
-
* @since 0.
|
|
2225
|
+
* @since 0.3.0
|
|
1849
2226
|
* @relatedTo CngxTagGroup, CngxChip, CngxBadge, CngxTagLabel
|
|
1850
2227
|
* @slot cngxTagLabel Replaces the tag's text body.
|
|
1851
2228
|
* @slot cngxTagPrefix Content before the label, typically an icon or swatch.
|
|
1852
2229
|
* @slot cngxTagSuffix Content after the label, typically a remove affordance.
|
|
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
|
|
1865
|
-
* <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
|
|
1866
2244
|
*/
|
|
1867
2245
|
class CngxTag {
|
|
1868
2246
|
/**
|
|
@@ -2009,7 +2387,7 @@ class CngxTag {
|
|
|
2009
2387
|
@if (suffixTpl(); as t) {
|
|
2010
2388
|
<ng-container *ngTemplateOutlet="t; context: slotContext()" />
|
|
2011
2389
|
}
|
|
2012
|
-
`, 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 });
|
|
2013
2391
|
}
|
|
2014
2392
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTag, decorators: [{
|
|
2015
2393
|
type: Component,
|
|
@@ -2041,7 +2419,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
2041
2419
|
'[style.--cngx-tag-border]': 'configBorder()',
|
|
2042
2420
|
'[style.max-width]': 'maxWidth()',
|
|
2043
2421
|
'[attr.role]': 'roleAttr()',
|
|
2044
|
-
}, 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"] }]
|
|
2045
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 }] }] } });
|
|
2046
2424
|
|
|
2047
2425
|
/**
|
|
@@ -2121,8 +2499,6 @@ function mergeConfig(base, partial) {
|
|
|
2121
2499
|
* ],
|
|
2122
2500
|
* });
|
|
2123
2501
|
* ```
|
|
2124
|
-
*
|
|
2125
|
-
* @category common/display
|
|
2126
2502
|
*/
|
|
2127
2503
|
function provideTagConfig(...features) {
|
|
2128
2504
|
// Empty-features: skip the override so the root factory's
|
|
@@ -2165,8 +2541,6 @@ function provideTagConfig(...features) {
|
|
|
2165
2541
|
* })
|
|
2166
2542
|
* class AdminSection {}
|
|
2167
2543
|
* ```
|
|
2168
|
-
*
|
|
2169
|
-
* @category common/display
|
|
2170
2544
|
*/
|
|
2171
2545
|
function provideTagConfigAt(...features) {
|
|
2172
2546
|
// Empty-features call: parent value flows through untouched.
|
|
@@ -2197,8 +2571,6 @@ function provideTagConfigAt(...features) {
|
|
|
2197
2571
|
* withTagDefaults({ variant: 'subtle', size: 'sm' }),
|
|
2198
2572
|
* );
|
|
2199
2573
|
* ```
|
|
2200
|
-
*
|
|
2201
|
-
* @category common/display
|
|
2202
2574
|
*/
|
|
2203
2575
|
function withTagDefaults(payload) {
|
|
2204
2576
|
return { kind: 'defaults', payload };
|
|
@@ -2212,8 +2584,6 @@ function withTagDefaults(payload) {
|
|
|
2212
2584
|
* withTagGroupDefaults({ gap: 'md', semanticList: true }),
|
|
2213
2585
|
* );
|
|
2214
2586
|
* ```
|
|
2215
|
-
*
|
|
2216
|
-
* @category common/display
|
|
2217
2587
|
*/
|
|
2218
2588
|
function withTagGroupDefaults(payload) {
|
|
2219
2589
|
return { kind: 'groupDefaults', payload };
|
|
@@ -2244,8 +2614,6 @@ function withTagGroupDefaults(payload) {
|
|
|
2244
2614
|
* }),
|
|
2245
2615
|
* );
|
|
2246
2616
|
* ```
|
|
2247
|
-
*
|
|
2248
|
-
* @category common/display
|
|
2249
2617
|
*/
|
|
2250
2618
|
function withTagColors(payload) {
|
|
2251
2619
|
return { kind: 'colors', payload };
|
|
@@ -2281,8 +2649,6 @@ function withTagColors(payload) {
|
|
|
2281
2649
|
* // Then in providers:
|
|
2282
2650
|
* provideTagConfig(withTagSlots({ label: shell.brandLabel() }));
|
|
2283
2651
|
* ```
|
|
2284
|
-
*
|
|
2285
|
-
* @category common/display
|
|
2286
2652
|
*/
|
|
2287
2653
|
function withTagSlots(payload) {
|
|
2288
2654
|
return { kind: 'templates', payload };
|
|
@@ -2310,23 +2676,22 @@ function withTagSlots(payload) {
|
|
|
2310
2676
|
* </cngx-tag-group>
|
|
2311
2677
|
* ```
|
|
2312
2678
|
*
|
|
2313
|
-
* @category common/display
|
|
2314
2679
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/tag-group/slots/tag-group-accessory.directive.ts
|
|
2315
|
-
* @since 0.
|
|
2680
|
+
* @since 0.3.0
|
|
2316
2681
|
* @relatedTo CngxTagGroup, CngxTagGroupHeader
|
|
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
|
|
2329
|
-
* <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>
|
|
2330
2695
|
*/
|
|
2331
2696
|
class CngxTagGroupAccessory {
|
|
2332
2697
|
templateRef = inject(TemplateRef);
|
|
@@ -2364,23 +2729,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
2364
2729
|
* </cngx-tag-group>
|
|
2365
2730
|
* ```
|
|
2366
2731
|
*
|
|
2367
|
-
* @category common/display
|
|
2368
2732
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/tag-group/slots/tag-group-header.directive.ts
|
|
2369
|
-
* @since 0.
|
|
2733
|
+
* @since 0.3.0
|
|
2370
2734
|
* @relatedTo CngxTagGroup, CngxTagGroupAccessory
|
|
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
|
|
2383
|
-
* <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>
|
|
2384
2748
|
*/
|
|
2385
2749
|
class CngxTagGroupHeader {
|
|
2386
2750
|
templateRef = inject(TemplateRef);
|
|
@@ -2435,27 +2799,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
2435
2799
|
* - Configuration cascade (`provideTagConfig`) - deferred (see
|
|
2436
2800
|
* `display-accepted-debt.md §1`).
|
|
2437
2801
|
*
|
|
2438
|
-
* @category common/display
|
|
2439
|
-
* @docsKind primary
|
|
2440
2802
|
* @wcag AA
|
|
2441
2803
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/tag-group/tag-group.component.ts
|
|
2442
|
-
* @since 0.
|
|
2804
|
+
* @since 0.3.0
|
|
2443
2805
|
* @relatedTo CngxTag, CngxTagGroupHeader, CngxTagGroupAccessory, CNGX_TAG_GROUP
|
|
2444
2806
|
* @slot cngxTagGroupHeader Replaces the group's heading row.
|
|
2445
2807
|
* @slot cngxTagGroupAccessory Trailing control beside the header, e.g. a clear-all button.
|
|
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
|
|
2458
|
-
* <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
|
|
2459
2822
|
*/
|
|
2460
2823
|
class CngxTagGroup {
|
|
2461
2824
|
/**
|
|
@@ -2480,17 +2843,14 @@ class CngxTagGroup {
|
|
|
2480
2843
|
*/
|
|
2481
2844
|
label = input(undefined, ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
2482
2845
|
/**
|
|
2483
|
-
*
|
|
2484
|
-
*
|
|
2485
|
-
*
|
|
2486
|
-
* `private` per NG1053; `protected` blocks external template
|
|
2487
|
-
* bindings). The hook is intentionally **not** the contract
|
|
2488
|
-
* surface - that role belongs to `semanticList` below, typed
|
|
2489
|
-
* `Signal<boolean>` so test doubles and programmatic
|
|
2490
|
-
* implementers of `CngxTagGroupHost` can satisfy the interface
|
|
2491
|
-
* 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.
|
|
2492
2849
|
*
|
|
2493
|
-
*
|
|
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()`.
|
|
2494
2854
|
*/
|
|
2495
2855
|
semanticListInput = input(this.cfg.groupDefaults?.semanticList ?? false, { ...(ngDevMode ? { debugName: "semanticListInput" } : /* istanbul ignore next */ {}), alias: 'semanticList' });
|
|
2496
2856
|
/**
|
|
@@ -2619,7 +2979,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
2619
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 }] }] } });
|
|
2620
2980
|
|
|
2621
2981
|
/**
|
|
2622
|
-
* @module
|
|
2982
|
+
* @module `@cngx/common/display`
|
|
2623
2983
|
*
|
|
2624
2984
|
* Display-only atoms: no behavior, no state beyond presentational flags.
|
|
2625
2985
|
* Icons, avatars, badges, dividers - building blocks that render content
|
|
@@ -2631,5 +2991,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
2631
2991
|
* Generated bundle index. Do not edit.
|
|
2632
2992
|
*/
|
|
2633
2993
|
|
|
2634
|
-
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 };
|
|
2635
2995
|
//# sourceMappingURL=cngx-common-display.mjs.map
|