ngx-com 0.0.20 → 0.0.22

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.
@@ -0,0 +1,170 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, input, booleanAttribute, signal, computed, Directive } from '@angular/core';
3
+ import { NgForm, FormGroupDirective, NgControl } from '@angular/forms';
4
+ import { ErrorStateMatcher } from 'ngx-com/components/form-field';
5
+ import { mergeClasses } from 'ngx-com/utils';
6
+ import { cva } from 'class-variance-authority';
7
+
8
+ /**
9
+ * CVA variants for the native control directive.
10
+ *
11
+ * @tokens `--color-input-border`, `--color-input-background`, `--color-input-foreground`,
12
+ * `--color-input-placeholder`, `--color-disabled`, `--color-disabled-foreground`,
13
+ * `--color-ring`, `--color-warn`, `--color-muted`, `--color-border`,
14
+ * `--radius-input`
15
+ */
16
+ const nativeControlVariants = cva([
17
+ 'com-native-control',
18
+ 'w-full',
19
+ 'text-input-foreground',
20
+ 'placeholder:text-input-placeholder',
21
+ 'rounded-input',
22
+ 'focus-visible:outline-[1px] focus-visible:outline-offset-2 focus-visible:outline-ring',
23
+ 'disabled:bg-disabled disabled:text-disabled-foreground disabled:border-disabled disabled:cursor-not-allowed',
24
+ 'read-only:bg-muted read-only:cursor-default',
25
+ 'aria-[invalid=true]:border-warn aria-[invalid=true]:ring-1 aria-[invalid=true]:ring-warn',
26
+ 'file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-input-foreground',
27
+ 'transition-colors',
28
+ ], {
29
+ variants: {
30
+ variant: {
31
+ outline: [
32
+ 'border border-input-border bg-input-background',
33
+ 'hover:border-border',
34
+ ],
35
+ filled: [
36
+ 'border border-transparent bg-muted',
37
+ 'hover:bg-muted-hover',
38
+ 'focus-visible:border-input-border focus-visible:bg-input-background',
39
+ ],
40
+ ghost: [
41
+ 'border border-transparent bg-transparent',
42
+ 'hover:bg-muted',
43
+ 'focus-visible:border-input-border focus-visible:bg-input-background',
44
+ ],
45
+ },
46
+ size: {
47
+ sm: 'h-8 px-2.5 text-sm',
48
+ default: 'h-10 px-3 text-sm',
49
+ lg: 'h-12 px-4 text-base',
50
+ },
51
+ error: {
52
+ true: 'border-warn ring-1 ring-warn focus-visible:outline-warn',
53
+ false: '',
54
+ },
55
+ },
56
+ defaultVariants: {
57
+ variant: 'outline',
58
+ size: 'default',
59
+ error: false,
60
+ },
61
+ });
62
+
63
+ /**
64
+ * Standalone styling directive for native `<input>`, `<select>`, and `<textarea>` elements.
65
+ *
66
+ * Applies consistent borders, background, text color, focus outline, disabled state,
67
+ * error state, and size scaling via CVA. Integrates with both Reactive Forms (via NgControl)
68
+ * and Signal Forms (via `invalid`/`touched` inputs set by `[formField]`).
69
+ *
70
+ * For full form integration (label, hint, error), use `com-form-field` + `comInput`.
71
+ *
72
+ * @tokens `--color-input-border`, `--color-input-background`, `--color-input-foreground`,
73
+ * `--color-input-placeholder`, `--color-disabled`, `--color-disabled-foreground`,
74
+ * `--color-ring`, `--color-warn`, `--color-muted`, `--color-border`,
75
+ * `--radius-input`
76
+ *
77
+ * @example Basic usage
78
+ * ```html
79
+ * <input comNativeControl placeholder="Enter your name" />
80
+ * ```
81
+ *
82
+ * @example Variants
83
+ * ```html
84
+ * <input comNativeControl variant="outline" placeholder="Outline (default)" />
85
+ * <input comNativeControl variant="filled" placeholder="Filled" />
86
+ * <input comNativeControl variant="ghost" placeholder="Ghost" />
87
+ * ```
88
+ *
89
+ * @example Reactive Forms
90
+ * ```html
91
+ * <input comNativeControl [formControl]="nameCtrl" />
92
+ * ```
93
+ *
94
+ * @example Signal Forms
95
+ * ```html
96
+ * <input comNativeControl [formField]="myForm.name" />
97
+ * ```
98
+ */
99
+ class ComNativeControl {
100
+ defaultErrorStateMatcher = inject(ErrorStateMatcher);
101
+ parentForm = inject(NgForm, { optional: true });
102
+ parentFormGroup = inject(FormGroupDirective, { optional: true });
103
+ /** NgControl bound to this element (if using reactive forms). */
104
+ ngControl = inject(NgControl, { optional: true, self: true });
105
+ /** Whether the form system is Signal Forms (no NgControl present). */
106
+ isSignalForms = !this.ngControl;
107
+ // ── Inputs ──
108
+ /** Visual variant — outline (bordered), filled (bg fill), or ghost (transparent) */
109
+ variant = input('outline', ...(ngDevMode ? [{ debugName: "variant" }] : []));
110
+ /** Control size — affects height, padding, and font size */
111
+ size = input('default', ...(ngDevMode ? [{ debugName: "size" }] : []));
112
+ /** Consumer CSS classes — merged with variant classes via mergeClasses() */
113
+ userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : {}), alias: 'class' });
114
+ /** Custom error state matcher (overrides the default). */
115
+ errorStateMatcher = input(...(ngDevMode ? [undefined, { debugName: "errorStateMatcher" }] : []));
116
+ // ── Signal Forms inputs — set automatically by [formField] ──
117
+ sfInvalid = input(false, { ...(ngDevMode ? { debugName: "sfInvalid" } : {}), alias: 'invalid',
118
+ transform: booleanAttribute });
119
+ sfTouched = input(false, { ...(ngDevMode ? { debugName: "sfTouched" } : {}), alias: 'touched',
120
+ transform: booleanAttribute });
121
+ // ── Error state ──
122
+ /**
123
+ * Reactive Forms error state — imperatively updated in DoCheck because
124
+ * NgControl properties (touched, invalid) are not signals.
125
+ */
126
+ _reactiveErrorState = signal(false, ...(ngDevMode ? [{ debugName: "_reactiveErrorState" }] : []));
127
+ /** Whether the control is in an error state. */
128
+ errorState = computed(() => {
129
+ if (this.isSignalForms) {
130
+ return this.sfInvalid() && this.sfTouched();
131
+ }
132
+ return this._reactiveErrorState();
133
+ }, ...(ngDevMode ? [{ debugName: "errorState" }] : []));
134
+ /** @internal Computed host class from CVA + consumer overrides */
135
+ computedClass = computed(() => mergeClasses(nativeControlVariants({
136
+ variant: this.variant(),
137
+ size: this.size(),
138
+ error: this.errorState(),
139
+ }), this.userClass()), ...(ngDevMode ? [{ debugName: "computedClass" }] : []));
140
+ ngDoCheck() {
141
+ if (this.ngControl) {
142
+ const matcher = this.errorStateMatcher() ?? this.defaultErrorStateMatcher;
143
+ const form = this.parentFormGroup ?? this.parentForm;
144
+ this._reactiveErrorState.set(matcher.isErrorState(this.ngControl.control ?? null, form));
145
+ }
146
+ }
147
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ComNativeControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
148
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: ComNativeControl, isStandalone: true, selector: "input[comNativeControl], select[comNativeControl], textarea[comNativeControl]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, errorStateMatcher: { classPropertyName: "errorStateMatcher", publicName: "errorStateMatcher", isSignal: true, isRequired: false, transformFunction: null }, sfInvalid: { classPropertyName: "sfInvalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, sfTouched: { classPropertyName: "sfTouched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "computedClass()", "attr.aria-invalid": "errorState() || null" } }, exportAs: ["comNativeControl"], ngImport: i0 });
149
+ }
150
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ComNativeControl, decorators: [{
151
+ type: Directive,
152
+ args: [{
153
+ selector: 'input[comNativeControl], select[comNativeControl], textarea[comNativeControl]',
154
+ exportAs: 'comNativeControl',
155
+ host: {
156
+ '[class]': 'computedClass()',
157
+ '[attr.aria-invalid]': 'errorState() || null',
158
+ },
159
+ }]
160
+ }], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], errorStateMatcher: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorStateMatcher", required: false }] }], sfInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], sfTouched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }] } });
161
+
162
+ // Public API for the native-control directive
163
+ // Main directive
164
+
165
+ /**
166
+ * Generated bundle index. Do not edit.
167
+ */
168
+
169
+ export { ComNativeControl, nativeControlVariants };
170
+ //# sourceMappingURL=ngx-com-components-native-control.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-com-components-native-control.mjs","sources":["../../../projects/com/components/native-control/native-control.variants.ts","../../../projects/com/components/native-control/native-control.directive.ts","../../../projects/com/components/native-control/index.ts","../../../projects/com/components/native-control/ngx-com-components-native-control.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\n/**\n * Size type for native control.\n */\nexport type NativeControlSize = 'sm' | 'default' | 'lg';\n\n/**\n * Visual variant for native control.\n */\nexport type NativeControlVariant = 'outline' | 'filled' | 'ghost';\n\n/**\n * CVA variants for the native control directive.\n *\n * @tokens `--color-input-border`, `--color-input-background`, `--color-input-foreground`,\n * `--color-input-placeholder`, `--color-disabled`, `--color-disabled-foreground`,\n * `--color-ring`, `--color-warn`, `--color-muted`, `--color-border`,\n * `--radius-input`\n */\nexport const nativeControlVariants: (props?: {\n variant?: NativeControlVariant;\n size?: NativeControlSize;\n error?: boolean;\n}) => string = cva(\n [\n 'com-native-control',\n 'w-full',\n 'text-input-foreground',\n 'placeholder:text-input-placeholder',\n 'rounded-input',\n 'focus-visible:outline-[1px] focus-visible:outline-offset-2 focus-visible:outline-ring',\n 'disabled:bg-disabled disabled:text-disabled-foreground disabled:border-disabled disabled:cursor-not-allowed',\n 'read-only:bg-muted read-only:cursor-default',\n 'aria-[invalid=true]:border-warn aria-[invalid=true]:ring-1 aria-[invalid=true]:ring-warn',\n 'file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-input-foreground',\n 'transition-colors',\n ],\n {\n variants: {\n variant: {\n outline: [\n 'border border-input-border bg-input-background',\n 'hover:border-border',\n ],\n filled: [\n 'border border-transparent bg-muted',\n 'hover:bg-muted-hover',\n 'focus-visible:border-input-border focus-visible:bg-input-background',\n ],\n ghost: [\n 'border border-transparent bg-transparent',\n 'hover:bg-muted',\n 'focus-visible:border-input-border focus-visible:bg-input-background',\n ],\n },\n size: {\n sm: 'h-8 px-2.5 text-sm',\n default: 'h-10 px-3 text-sm',\n lg: 'h-12 px-4 text-base',\n },\n error: {\n true: 'border-warn ring-1 ring-warn focus-visible:outline-warn',\n false: '',\n },\n },\n defaultVariants: {\n variant: 'outline',\n size: 'default',\n error: false,\n },\n }\n);\n\nexport type NativeControlVariants = VariantProps<typeof nativeControlVariants>;\n","import {\n booleanAttribute,\n computed,\n Directive,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport type { DoCheck, InputSignal, InputSignalWithTransform, Signal, WritableSignal } from '@angular/core';\nimport { FormGroupDirective, NgControl, NgForm } from '@angular/forms';\nimport { ErrorStateMatcher } from 'ngx-com/components/form-field';\nimport { mergeClasses } from './native-control.utils';\nimport { nativeControlVariants } from './native-control.variants';\nimport type { NativeControlSize, NativeControlVariant } from './native-control.variants';\n\n/**\n * Standalone styling directive for native `<input>`, `<select>`, and `<textarea>` elements.\n *\n * Applies consistent borders, background, text color, focus outline, disabled state,\n * error state, and size scaling via CVA. Integrates with both Reactive Forms (via NgControl)\n * and Signal Forms (via `invalid`/`touched` inputs set by `[formField]`).\n *\n * For full form integration (label, hint, error), use `com-form-field` + `comInput`.\n *\n * @tokens `--color-input-border`, `--color-input-background`, `--color-input-foreground`,\n * `--color-input-placeholder`, `--color-disabled`, `--color-disabled-foreground`,\n * `--color-ring`, `--color-warn`, `--color-muted`, `--color-border`,\n * `--radius-input`\n *\n * @example Basic usage\n * ```html\n * <input comNativeControl placeholder=\"Enter your name\" />\n * ```\n *\n * @example Variants\n * ```html\n * <input comNativeControl variant=\"outline\" placeholder=\"Outline (default)\" />\n * <input comNativeControl variant=\"filled\" placeholder=\"Filled\" />\n * <input comNativeControl variant=\"ghost\" placeholder=\"Ghost\" />\n * ```\n *\n * @example Reactive Forms\n * ```html\n * <input comNativeControl [formControl]=\"nameCtrl\" />\n * ```\n *\n * @example Signal Forms\n * ```html\n * <input comNativeControl [formField]=\"myForm.name\" />\n * ```\n */\n@Directive({\n selector: 'input[comNativeControl], select[comNativeControl], textarea[comNativeControl]',\n exportAs: 'comNativeControl',\n host: {\n '[class]': 'computedClass()',\n '[attr.aria-invalid]': 'errorState() || null',\n },\n})\nexport class ComNativeControl implements DoCheck {\n private readonly defaultErrorStateMatcher = inject(ErrorStateMatcher);\n private readonly parentForm = inject(NgForm, { optional: true });\n private readonly parentFormGroup = inject(FormGroupDirective, { optional: true });\n\n /** NgControl bound to this element (if using reactive forms). */\n readonly ngControl: NgControl | null = inject(NgControl, { optional: true, self: true });\n\n /** Whether the form system is Signal Forms (no NgControl present). */\n private readonly isSignalForms: boolean = !this.ngControl;\n\n // ── Inputs ──\n\n /** Visual variant — outline (bordered), filled (bg fill), or ghost (transparent) */\n readonly variant: InputSignal<NativeControlVariant> = input<NativeControlVariant>('outline');\n\n /** Control size — affects height, padding, and font size */\n readonly size: InputSignal<NativeControlSize> = input<NativeControlSize>('default');\n\n /** Consumer CSS classes — merged with variant classes via mergeClasses() */\n readonly userClass: InputSignal<string> = input<string>('', { alias: 'class' });\n\n /** Custom error state matcher (overrides the default). */\n readonly errorStateMatcher: InputSignal<ErrorStateMatcher | undefined> = input<ErrorStateMatcher>();\n\n // ── Signal Forms inputs — set automatically by [formField] ──\n\n readonly sfInvalid: InputSignalWithTransform<boolean, unknown> = input(false, {\n alias: 'invalid',\n transform: booleanAttribute,\n });\n readonly sfTouched: InputSignalWithTransform<boolean, unknown> = input(false, {\n alias: 'touched',\n transform: booleanAttribute,\n });\n\n // ── Error state ──\n\n /**\n * Reactive Forms error state — imperatively updated in DoCheck because\n * NgControl properties (touched, invalid) are not signals.\n */\n private readonly _reactiveErrorState: WritableSignal<boolean> = signal(false);\n\n /** Whether the control is in an error state. */\n readonly errorState: Signal<boolean> = computed(() => {\n if (this.isSignalForms) {\n return this.sfInvalid() && this.sfTouched();\n }\n return this._reactiveErrorState();\n });\n\n /** @internal Computed host class from CVA + consumer overrides */\n protected readonly computedClass: Signal<string> = computed(() =>\n mergeClasses(\n nativeControlVariants({\n variant: this.variant(),\n size: this.size(),\n error: this.errorState(),\n }),\n this.userClass()\n )\n );\n\n ngDoCheck(): void {\n if (this.ngControl) {\n const matcher = this.errorStateMatcher() ?? this.defaultErrorStateMatcher;\n const form = this.parentFormGroup ?? this.parentForm;\n this._reactiveErrorState.set(\n matcher.isErrorState(this.ngControl.control ?? null, form)\n );\n }\n }\n}\n","// Public API for the native-control directive\n\n// Main directive\nexport { ComNativeControl } from './native-control.directive';\n\n// Variants (for advanced customization)\nexport { nativeControlVariants } from './native-control.variants';\n\nexport type {\n NativeControlVariant,\n NativeControlSize,\n NativeControlVariants,\n} from './native-control.variants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAYA;;;;;;;AAOG;AACI,MAAM,qBAAqB,GAInB,GAAG,CAChB;IACE,oBAAoB;IACpB,QAAQ;IACR,uBAAuB;IACvB,oCAAoC;IACpC,eAAe;IACf,uFAAuF;IACvF,6GAA6G;IAC7G,6CAA6C;IAC7C,0FAA0F;IAC1F,4FAA4F;IAC5F,mBAAmB;CACpB,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE;gBACP,gDAAgD;gBAChD,qBAAqB;AACtB,aAAA;AACD,YAAA,MAAM,EAAE;gBACN,oCAAoC;gBACpC,sBAAsB;gBACtB,qEAAqE;AACtE,aAAA;AACD,YAAA,KAAK,EAAE;gBACL,0CAA0C;gBAC1C,gBAAgB;gBAChB,qEAAqE;AACtE,aAAA;AACF,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,EAAE,EAAE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AS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,+EAA+E;AACzF,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,iBAAiB;AAC5B,wBAAA,qBAAqB,EAAE,sBAAsB;AAC9C,qBAAA;AACF,iBAAA;;;AC1DD;AAEA;;ACFA;;AAEG;;;;"}
@@ -159,8 +159,11 @@ class ComRadioGroup {
159
159
  variant = input('primary', ...(ngDevMode ? [{ debugName: "variant" }] : []));
160
160
  errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : []));
161
161
  errorStateMatcher = input(...(ngDevMode ? [undefined, { debugName: "errorStateMatcher" }] : []));
162
- /** Internal signal to track when control is touched, used to trigger error state re-evaluation. */
163
- _touched = signal(false, ...(ngDevMode ? [{ debugName: "_touched" }] : []));
162
+ /** Tracks touched state writable by both CVA callback and Signal Forms [formField]. */
163
+ touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : []));
164
+ // Signal Forms inputs — set automatically by [formField] via setInputOnDirectives
165
+ invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : []));
166
+ sfErrors = input([], { ...(ngDevMode ? { debugName: "sfErrors" } : {}), alias: 'errors' });
164
167
  ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : {}), alias: 'aria-label' });
165
168
  ariaLabelledby = input(null, { ...(ngDevMode ? { debugName: "ariaLabelledby" } : {}), alias: 'aria-labelledby' });
166
169
  ariaDescribedby = input(null, { ...(ngDevMode ? { debugName: "ariaDescribedby" } : {}), alias: 'aria-describedby' });
@@ -185,11 +188,15 @@ class ComRadioGroup {
185
188
  * Shows errors when control is invalid and touched/submitted.
186
189
  */
187
190
  errorState = computed(() => {
188
- // Read _touched to trigger re-evaluation when touched changes
189
- this._touched();
191
+ if (!this.ngControl) {
192
+ // Signal Forms: gate on invalid AND touched (mirrors ErrorStateMatcher default)
193
+ return this.invalid() && this.touched();
194
+ }
195
+ // Reactive Forms: use ErrorStateMatcher (existing logic)
196
+ this.touched();
190
197
  const matcher = this.errorStateMatcher() ?? this.defaultErrorStateMatcher;
191
198
  const form = this.parentFormGroup ?? this.parentForm;
192
- return matcher.isErrorState(this.ngControl?.control ?? null, form);
199
+ return matcher.isErrorState(this.ngControl.control ?? null, form);
193
200
  }, ...(ngDevMode ? [{ debugName: "errorState" }] : []));
194
201
  computedAriaDescribedby = computed(() => {
195
202
  const userDescribedby = this.ariaDescribedby();
@@ -242,7 +249,7 @@ class ComRadioGroup {
242
249
  }
243
250
  registerOnTouched(fn) {
244
251
  this.onTouchedCallback = () => {
245
- this._touched.set(true);
252
+ this.touched.set(true);
246
253
  fn();
247
254
  };
248
255
  }
@@ -293,7 +300,7 @@ class ComRadioGroup {
293
300
  }
294
301
  }
295
302
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ComRadioGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
296
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ComRadioGroup, isStandalone: true, selector: "com-radio-group", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errorStateMatcher: { classPropertyName: "errorStateMatcher", publicName: "errorStateMatcher", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange", selectionChange: "selectionChange" }, host: { properties: { "class.com-radio-group--disabled": "disabled()", "class.com-radio-group--error": "errorState()" }, classAttribute: "com-radio-group block" }, providers: [
303
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ComRadioGroup, isStandalone: true, selector: "com-radio-group", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errorStateMatcher: { classPropertyName: "errorStateMatcher", publicName: "errorStateMatcher", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, sfErrors: { classPropertyName: "sfErrors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange", touched: "touchedChange", selectionChange: "selectionChange" }, host: { properties: { "class.com-radio-group--disabled": "disabled()", "class.com-radio-group--error": "errorState()" }, classAttribute: "com-radio-group block" }, providers: [
297
304
  {
298
305
  provide: COM_RADIO_GROUP,
299
306
  useFactory: () => {
@@ -368,7 +375,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
368
375
  '[class.com-radio-group--error]': 'errorState()',
369
376
  },
370
377
  }]
371
- }], ctorParameters: () => [], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errorStateMatcher: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorStateMatcher", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }] } });
378
+ }], ctorParameters: () => [], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errorStateMatcher: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorStateMatcher", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], sfErrors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }] } });
372
379
 
373
380
  /**
374
381
  * Production-grade radio component with full accessibility support.
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-com-components-radio.mjs","sources":["../../../projects/com/components/radio/radio.variants.ts","../../../projects/com/components/radio/radio.utils.ts","../../../projects/com/components/radio/radio-group.component.ts","../../../projects/com/components/radio/radio.component.ts","../../../projects/com/components/radio/index.ts","../../../projects/com/components/radio/ngx-com-components-radio.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\n/** Radio size variants. */\nexport type RadioSize = 'sm' | 'md' | 'lg';\n\n/** Radio color variants. */\nexport type RadioVariant = 'primary' | 'accent' | 'warn';\n\n/** Radio group orientation. */\nexport type RadioOrientation = 'vertical' | 'horizontal';\n\n/**\n * CVA variants for the visual radio circle.\n *\n * Uses `peer` selectors to style based on native input state:\n * - `peer-checked:` for checked state\n * - `peer-focus-visible:` for keyboard focus\n * - `peer-disabled:` for disabled state\n *\n * @tokens `--color-border`, `--color-primary`, `--color-primary-hover`,\n * `--color-accent`, `--color-accent-hover`,\n * `--color-warn`, `--color-warn-hover`,\n * `--color-disabled`, `--color-ring`\n */\nexport const radioCircleVariants: (props?: {\n variant?: RadioVariant;\n size?: RadioSize;\n}) => string = cva(\n [\n 'com-radio__circle',\n 'inline-flex shrink-0 items-center justify-center',\n 'rounded-full border-2 border-border',\n 'transition-colors duration-150',\n 'peer-focus-visible:outline-[1px] peer-focus-visible:outline-offset-2 peer-focus-visible:outline-ring',\n 'peer-disabled:cursor-not-allowed peer-disabled:border-disabled peer-disabled:bg-disabled',\n ],\n {\n variants: {\n variant: {\n primary: [\n 'peer-checked:border-primary peer-checked:bg-primary peer-checked:text-primary-foreground',\n 'group-hover:border-primary-hover',\n 'peer-checked:group-hover:bg-primary-hover peer-checked:group-hover:border-primary-hover',\n ],\n accent: [\n 'peer-checked:border-accent peer-checked:bg-accent peer-checked:text-accent-foreground',\n 'group-hover:border-accent-hover',\n 'peer-checked:group-hover:bg-accent-hover peer-checked:group-hover:border-accent-hover',\n ],\n warn: [\n 'peer-checked:border-warn peer-checked:bg-warn peer-checked:text-warn-foreground',\n 'group-hover:border-warn-hover',\n 'peer-checked:group-hover:bg-warn-hover peer-checked:group-hover:border-warn-hover',\n ],\n },\n size: {\n sm: 'size-4',\n md: 'size-5',\n lg: 'size-6',\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n }\n);\n\n/** Size-based classes for the inner dot indicator. */\nexport const RADIO_DOT_SIZES: Record<RadioSize, string> = {\n sm: 'size-1.5',\n md: 'size-2',\n lg: 'size-2.5',\n};\n\n/** Size-based classes for the label content. */\nexport const RADIO_LABEL_SIZES: Record<RadioSize, string> = {\n sm: 'text-sm ms-2',\n md: 'text-base ms-2.5',\n lg: 'text-lg ms-3',\n};\n\n/** Base classes for the radio group container. */\nconst RADIO_GROUP_BASE = 'com-radio-group__container flex';\n\n/** Orientation-based classes for the radio group container. */\nexport const RADIO_GROUP_ORIENTATIONS: Record<RadioOrientation, string> = {\n vertical: `${RADIO_GROUP_BASE} flex-col gap-2`,\n horizontal: `${RADIO_GROUP_BASE} flex-row flex-wrap gap-4`,\n};\n","/** Auto-incrementing ID counter for unique radio IDs. */\nlet nextRadioId = 0;\n\n/** Generates a unique radio ID. */\nexport function generateRadioId(): string {\n return `com-radio-${nextRadioId++}`;\n}\n\n/** Auto-incrementing ID counter for unique radio group IDs. */\nlet nextGroupId = 0;\n\n/** Generates a unique radio group ID. */\nexport function generateRadioGroupId(): string {\n return `com-radio-group-${nextGroupId++}`;\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n InjectionToken,\n input,\n linkedSignal,\n model,\n output,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport type {\n InputSignal,\n InputSignalWithTransform,\n ModelSignal,\n OutputEmitterRef,\n Signal,\n WritableSignal,\n} from '@angular/core';\nimport { FormGroupDirective, NgControl, NgForm } from '@angular/forms';\nimport type { ControlValueAccessor } from '@angular/forms';\nimport { ErrorStateMatcher } from 'ngx-com/components/form-field';\nimport { RADIO_GROUP_ORIENTATIONS } from './radio.variants';\nimport type { RadioOrientation, RadioSize, RadioVariant } from './radio.variants';\nimport { generateRadioGroupId } from './radio.utils';\n\n/** Event emitted when radio group value changes. */\nexport interface RadioGroupChange {\n value: string | null;\n}\n\n/** Interface for radio items that register with the group. */\nexport interface RadioItem {\n value: () => string;\n isDisabled: () => boolean;\n focus: () => void;\n}\n\n/** Context provided to child radio components via DI. */\nexport interface ComRadioGroupContext {\n name: Signal<string>;\n value: Signal<string | null>;\n disabled: Signal<boolean>;\n size: Signal<RadioSize>;\n variant: Signal<RadioVariant>;\n orientation: Signal<RadioOrientation>;\n focusedValue: Signal<string | null>;\n select: (value: string) => void;\n focusNext: (currentValue: string) => void;\n focusPrevious: (currentValue: string) => void;\n register: (radio: RadioItem) => void;\n unregister: (radio: RadioItem) => void;\n onTouched?: () => void;\n}\n\n/** Injection token for radio group context. */\nexport const COM_RADIO_GROUP: InjectionToken<ComRadioGroupContext> = new InjectionToken<ComRadioGroupContext>('COM_RADIO_GROUP');\n\n/**\n * Radio group component that manages a set of radio buttons.\n *\n * Provides mutual exclusion, shared name, and roving tabindex keyboard navigation.\n * Implements `ControlValueAccessor` for Reactive Forms integration.\n *\n * @tokens `--color-border`, `--color-primary`, `--color-primary-foreground`, `--color-primary-hover`,\n * `--color-accent`, `--color-accent-foreground`, `--color-accent-hover`,\n * `--color-warn`, `--color-warn-foreground`, `--color-warn-hover`,\n * `--color-disabled`, `--color-disabled-foreground`, `--color-ring`\n *\n * @example Basic usage\n * ```html\n * <com-radio-group [(value)]=\"selectedFruit\" aria-label=\"Select a fruit\">\n * <com-radio value=\"apple\">Apple</com-radio>\n * <com-radio value=\"banana\">Banana</com-radio>\n * <com-radio value=\"cherry\">Cherry</com-radio>\n * </com-radio-group>\n * ```\n *\n * @example With reactive forms\n * ```html\n * <com-radio-group formControlName=\"size\" aria-label=\"Select size\">\n * <com-radio value=\"sm\">Small</com-radio>\n * <com-radio value=\"md\">Medium</com-radio>\n * <com-radio value=\"lg\">Large</com-radio>\n * </com-radio-group>\n * ```\n *\n * @example Horizontal orientation\n * ```html\n * <com-radio-group [(value)]=\"color\" orientation=\"horizontal\">\n * <com-radio value=\"red\">Red</com-radio>\n * <com-radio value=\"green\">Green</com-radio>\n * <com-radio value=\"blue\">Blue</com-radio>\n * </com-radio-group>\n * ```\n *\n * @example With variants\n * ```html\n * <com-radio-group [(value)]=\"priority\" variant=\"warn\" size=\"lg\">\n * <com-radio value=\"low\">Low</com-radio>\n * <com-radio value=\"medium\">Medium</com-radio>\n * <com-radio value=\"high\">High</com-radio>\n * </com-radio-group>\n * ```\n */\n@Component({\n selector: 'com-radio-group',\n exportAs: 'comRadioGroup',\n template: `\n <div\n role=\"radiogroup\"\n [class]=\"groupClasses()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"computedAriaDescribedby()\"\n [attr.aria-required]=\"required() || null\"\n [attr.aria-invalid]=\"errorState() || null\"\n >\n <ng-content />\n </div>\n @if (errorState() && errorMessage()) {\n <div\n [id]=\"errorId\"\n class=\"com-radio-group__error mt-1.5 text-sm text-warn\"\n role=\"alert\"\n >\n {{ errorMessage() }}\n </div>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: COM_RADIO_GROUP,\n useFactory: () => {\n const group = inject(ComRadioGroup);\n return group.createContext();\n },\n },\n ],\n host: {\n class: 'com-radio-group block',\n '[class.com-radio-group--disabled]': 'disabled()',\n '[class.com-radio-group--error]': 'errorState()',\n },\n})\nexport class ComRadioGroup implements ControlValueAccessor {\n /** Optional NgControl for reactive forms integration. */\n readonly ngControl: NgControl | null = inject(NgControl, { optional: true, self: true });\n\n /** Error state matcher for determining when to show validation errors. */\n private readonly defaultErrorStateMatcher: ErrorStateMatcher = inject(ErrorStateMatcher);\n private readonly parentForm: NgForm | null = inject(NgForm, { optional: true });\n private readonly parentFormGroup: FormGroupDirective | null = inject(FormGroupDirective, { optional: true });\n\n /** Unique ID for this radio group instance. */\n private readonly uniqueId: string = generateRadioGroupId();\n\n /** ID for the error message element. */\n readonly errorId: string = `${this.uniqueId}-error`;\n\n /** Registered radio items. */\n private readonly registeredRadios: WritableSignal<RadioItem[]> = signal([]);\n\n // Inputs\n readonly name: InputSignal<string> = input<string>(this.uniqueId);\n readonly value: ModelSignal<string | null> = model<string | null>(null);\n readonly disabled: ModelSignal<boolean> = model<boolean>(false);\n readonly required: InputSignalWithTransform<boolean, unknown> = input(false, {\n transform: booleanAttribute,\n });\n readonly orientation: InputSignal<RadioOrientation> = input<RadioOrientation>('vertical');\n readonly size: InputSignal<RadioSize> = input<RadioSize>('md');\n readonly variant: InputSignal<RadioVariant> = input<RadioVariant>('primary');\n readonly errorMessage: InputSignal<string> = input<string>('');\n readonly errorStateMatcher: InputSignal<ErrorStateMatcher | undefined> = input<ErrorStateMatcher>();\n\n /** Internal signal to track when control is touched, used to trigger error state re-evaluation. */\n private readonly _touched: WritableSignal<boolean> = signal(false);\n readonly ariaLabel: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-label' });\n readonly ariaLabelledby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-labelledby' });\n readonly ariaDescribedby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-describedby' });\n\n // Outputs\n /** Emits when the selection changes, with full event details. */\n readonly selectionChange: OutputEmitterRef<RadioGroupChange> = output<RadioGroupChange>();\n\n /**\n * Tracks the currently focused radio value for roving tabindex.\n * Resets to the current selection (or first focusable) when value or radios change.\n */\n private readonly focusedValueSignal: WritableSignal<string | null> = linkedSignal({\n source: () => ({ value: this.value(), radios: this.registeredRadios() }),\n computation: ({ value, radios }) => {\n if (value && radios.some((r) => r.value() === value && !r.isDisabled())) {\n return value;\n }\n const firstFocusable = radios.find((r) => !r.isDisabled());\n return firstFocusable?.value() ?? null;\n },\n });\n\n // Computed\n /**\n * Computed error state derived from form validation.\n * Shows errors when control is invalid and touched/submitted.\n */\n readonly errorState: Signal<boolean> = computed(() => {\n // Read _touched to trigger re-evaluation when touched changes\n this._touched();\n const matcher = this.errorStateMatcher() ?? this.defaultErrorStateMatcher;\n const form = this.parentFormGroup ?? this.parentForm;\n return matcher.isErrorState(this.ngControl?.control ?? null, form);\n });\n\n readonly computedAriaDescribedby: Signal<string | null> = computed(() => {\n const userDescribedby = this.ariaDescribedby();\n if (this.errorState() && this.errorMessage()) {\n return userDescribedby ? `${userDescribedby} ${this.errorId}` : this.errorId;\n }\n return userDescribedby;\n });\n\n protected readonly groupClasses: Signal<string> = computed(() =>\n RADIO_GROUP_ORIENTATIONS[this.orientation()]\n );\n\n // CVA callbacks\n private onChange: (value: string | null) => void = () => {};\n private onTouchedCallback: () => void = () => {};\n\n constructor() {\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n /** Creates the context object for child radios. */\n createContext(): ComRadioGroupContext {\n return {\n name: this.name,\n value: this.value,\n disabled: this.disabled,\n size: this.size,\n variant: this.variant,\n orientation: this.orientation,\n focusedValue: this.focusedValueSignal,\n select: this.select.bind(this),\n focusNext: this.focusNext.bind(this),\n focusPrevious: this.focusPrevious.bind(this),\n register: this.register.bind(this),\n unregister: this.unregister.bind(this),\n onTouched: () => this.onTouchedCallback(),\n };\n }\n\n /** Register a radio item with the group. */\n private register(radio: RadioItem): void {\n this.registeredRadios.update((radios) => [...radios, radio]);\n }\n\n /** Unregister a radio item from the group. */\n private unregister(radio: RadioItem): void {\n this.registeredRadios.update((radios) => radios.filter((r) => r !== radio));\n }\n\n // ControlValueAccessor implementation\n writeValue(value: string | null): void {\n this.value.set(value);\n }\n\n registerOnChange(fn: (value: string | null) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouchedCallback = () => {\n this._touched.set(true);\n fn();\n };\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled.set(isDisabled);\n }\n\n // Public API\n /** Selects a radio by value. */\n select(newValue: string): void {\n if (this.disabled()) {\n return;\n }\n this.value.set(newValue);\n this.focusedValueSignal.set(newValue);\n this.onChange(newValue);\n this.selectionChange.emit({ value: newValue });\n }\n\n /** Focuses the next non-disabled radio (with cyclic wrap). */\n focusNext(currentValue: string): void {\n const allRadios = this.registeredRadios();\n const focusableRadios = allRadios.filter((r) => !r.isDisabled());\n\n if (focusableRadios.length === 0) {\n return;\n }\n\n const currentIndex = focusableRadios.findIndex((r) => r.value() === currentValue);\n const nextIndex = (currentIndex + 1) % focusableRadios.length;\n const nextRadio = focusableRadios[nextIndex];\n\n if (nextRadio) {\n this.focusedValueSignal.set(nextRadio.value());\n this.select(nextRadio.value());\n nextRadio.focus();\n }\n }\n\n /** Focuses the previous non-disabled radio (with cyclic wrap). */\n focusPrevious(currentValue: string): void {\n const allRadios = this.registeredRadios();\n const focusableRadios = allRadios.filter((r) => !r.isDisabled());\n\n if (focusableRadios.length === 0) {\n return;\n }\n\n const currentIndex = focusableRadios.findIndex((r) => r.value() === currentValue);\n const prevIndex = (currentIndex - 1 + focusableRadios.length) % focusableRadios.length;\n const prevRadio = focusableRadios[prevIndex];\n\n if (prevRadio) {\n this.focusedValueSignal.set(prevRadio.value());\n this.select(prevRadio.value());\n prevRadio.focus();\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n inject,\n input,\n model,\n output,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport type {\n InputSignal,\n ModelSignal,\n OnInit,\n OutputEmitterRef,\n Signal,\n} from '@angular/core';\nimport {\n radioCircleVariants,\n RADIO_DOT_SIZES,\n RADIO_LABEL_SIZES,\n} from './radio.variants';\nimport type { RadioSize, RadioVariant } from './radio.variants';\nimport { generateRadioId } from './radio.utils';\nimport { COM_RADIO_GROUP, type ComRadioGroupContext, type RadioItem } from './radio-group.component';\n\n/** Event emitted when a radio is selected. */\nexport interface RadioChange {\n value: string;\n source: ComRadio;\n}\n\n/**\n * Production-grade radio component with full accessibility support.\n *\n * Uses a native `<input type=\"radio\">` for built-in keyboard handling,\n * `:checked` pseudo-class, and screen reader support.\n *\n * Must be used within a `ComRadioGroup` which manages the selected value\n * and provides the shared `name` attribute.\n *\n * @tokens `--color-border`, `--color-primary`, `--color-primary-foreground`, `--color-primary-hover`,\n * `--color-accent`, `--color-accent-foreground`, `--color-accent-hover`,\n * `--color-warn`, `--color-warn-foreground`, `--color-warn-hover`,\n * `--color-disabled`, `--color-disabled-foreground`, `--color-ring`\n *\n * @example Basic usage within a group\n * ```html\n * <com-radio-group [(value)]=\"selectedOption\">\n * <com-radio value=\"option1\">Option 1</com-radio>\n * <com-radio value=\"option2\">Option 2</com-radio>\n * <com-radio value=\"option3\">Option 3</com-radio>\n * </com-radio-group>\n * ```\n *\n * @example Disabled option\n * ```html\n * <com-radio-group [(value)]=\"selected\">\n * <com-radio value=\"enabled\">Enabled option</com-radio>\n * <com-radio value=\"disabled\" [disabled]=\"true\">Disabled option</com-radio>\n * </com-radio-group>\n * ```\n */\n@Component({\n selector: 'com-radio',\n exportAs: 'comRadio',\n template: `\n <label\n class=\"group relative inline-flex items-center\"\n [class.cursor-pointer]=\"!isDisabled()\"\n [class.cursor-not-allowed]=\"isDisabled()\"\n >\n <span><input\n #inputElement\n type=\"radio\"\n class=\"peer sr-only\"\n [id]=\"inputId()\"\n [checked]=\"isChecked()\"\n [disabled]=\"isDisabled()\"\n [attr.name]=\"groupName()\"\n [attr.value]=\"value()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.tabindex]=\"tabIndex()\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"\n /></span>\n <div [class]=\"circleClasses()\">\n <div\n class=\"com-radio__dot rounded-full bg-current transition-transform duration-150 peer-disabled:bg-disabled-foreground\"\n [class]=\"dotSizeClass()\"\n [class.scale-100]=\"isChecked()\"\n [class.scale-0]=\"!isChecked()\"\n ></div>\n </div>\n <span\n class=\"com-radio__label select-none peer-disabled:cursor-not-allowed peer-disabled:text-disabled-foreground\"\n [class]=\"labelSizeClass()\"\n >\n <ng-content />\n </span>\n </label>\n `,\n styles: `\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'com-radio inline-block align-middle',\n '[class.com-radio--disabled]': 'isDisabled()',\n '[class.com-radio--checked]': 'isChecked()',\n },\n})\nexport class ComRadio implements OnInit, RadioItem {\n /** Optional parent radio group context. */\n private readonly group: ComRadioGroupContext | null = inject(COM_RADIO_GROUP, {\n optional: true,\n });\n\n /** DestroyRef for cleanup. */\n private readonly destroyRef: DestroyRef = inject(DestroyRef);\n\n /** Reference to the native input element. */\n readonly inputRef: Signal<ElementRef<HTMLInputElement> | undefined> =\n viewChild<ElementRef<HTMLInputElement>>('inputElement');\n\n /** Unique ID for this radio instance. */\n private readonly uniqueId: string = generateRadioId();\n\n // Inputs\n readonly value: InputSignal<string> = input.required<string>();\n readonly size: InputSignal<RadioSize> = input<RadioSize>('md');\n readonly variant: InputSignal<RadioVariant> = input<RadioVariant>('primary');\n readonly disabled: ModelSignal<boolean> = model<boolean>(false);\n readonly id: InputSignal<string | undefined> = input<string>();\n readonly ariaLabel: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-label' });\n readonly ariaLabelledby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-labelledby' });\n readonly ariaDescribedby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-describedby' });\n\n // Outputs\n readonly changed: OutputEmitterRef<RadioChange> = output<RadioChange>();\n\n // Computed state\n readonly inputId: Signal<string> = computed(() => this.id() ?? this.uniqueId);\n\n /** Resolve size from group or local input. */\n readonly resolvedSize: Signal<RadioSize> = computed(\n () => this.group?.size() ?? this.size()\n );\n\n /** Resolve variant from group or local input. */\n readonly resolvedVariant: Signal<RadioVariant> = computed(\n () => this.group?.variant() ?? this.variant()\n );\n\n /** Whether this radio is checked based on group value. */\n readonly isChecked: Signal<boolean> = computed(() => {\n if (!this.group) {\n return false;\n }\n return this.group.value() === this.value();\n });\n\n /** Whether this radio is disabled (from local or group). */\n readonly isDisabled: Signal<boolean> = computed(\n () => this.disabled() || (this.group?.disabled() ?? false)\n );\n\n /** Get name from group. */\n readonly groupName: Signal<string | undefined> = computed(() => this.group?.name());\n\n /** Tab index for roving tabindex pattern. */\n readonly tabIndex: Signal<number> = computed(() => {\n if (this.isDisabled()) {\n return -1;\n }\n if (!this.group) {\n return 0;\n }\n // Roving tabindex: only the selected or first focusable item gets tabindex 0\n const isSelected = this.isChecked();\n const isFocusTarget = this.group.focusedValue() === this.value();\n\n if (isSelected || isFocusTarget) {\n return 0;\n }\n return -1;\n });\n\n protected readonly circleClasses: Signal<string> = computed(() =>\n radioCircleVariants({ variant: this.resolvedVariant(), size: this.resolvedSize() })\n );\n\n protected readonly dotSizeClass: Signal<string> = computed(() => RADIO_DOT_SIZES[this.resolvedSize()]);\n protected readonly labelSizeClass: Signal<string> = computed(() => RADIO_LABEL_SIZES[this.resolvedSize()]);\n\n ngOnInit(): void {\n // Register with the group\n this.group?.register(this);\n\n // Unregister on destroy\n this.destroyRef.onDestroy(() => {\n this.group?.unregister(this);\n });\n }\n\n // Event handlers\n protected onInputChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n if (input.checked && this.group) {\n this.group.select(this.value());\n this.changed.emit({ value: this.value(), source: this });\n }\n }\n\n protected onBlur(): void {\n this.group?.onTouched?.();\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n if (!this.group) {\n return;\n }\n\n const { key } = event;\n const isVertical = this.group.orientation() === 'vertical';\n const isHorizontal = this.group.orientation() === 'horizontal';\n\n let handled = false;\n\n if (\n (isVertical && key === 'ArrowDown') ||\n (isHorizontal && key === 'ArrowRight')\n ) {\n this.group.focusNext(this.value());\n handled = true;\n } else if (\n (isVertical && key === 'ArrowUp') ||\n (isHorizontal && key === 'ArrowLeft')\n ) {\n this.group.focusPrevious(this.value());\n handled = true;\n } else if (key === ' ') {\n // Space selects the focused radio\n if (!this.isChecked()) {\n this.group.select(this.value());\n this.changed.emit({ value: this.value(), source: this });\n }\n handled = true;\n }\n\n if (handled) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n\n // Public API\n /** Focuses this radio's input element. */\n focus(): void {\n this.inputRef()?.nativeElement.focus();\n }\n\n /** Selects this radio programmatically. */\n select(): void {\n if (this.isDisabled() || !this.group) {\n return;\n }\n this.group.select(this.value());\n this.changed.emit({ value: this.value(), source: this });\n }\n}\n","// Public API for the radio component\n\n// Main components\nexport { ComRadio } from './radio.component';\nexport { ComRadioGroup, COM_RADIO_GROUP } from './radio-group.component';\n\n// Types\nexport type { RadioChange } from './radio.component';\nexport type { RadioGroupChange, ComRadioGroupContext, RadioItem } from './radio-group.component';\n\n// Variants (for advanced customization)\nexport {\n radioCircleVariants,\n RADIO_GROUP_ORIENTATIONS,\n RADIO_DOT_SIZES,\n RADIO_LABEL_SIZES,\n} from './radio.variants';\n\nexport type { RadioSize, RadioVariant, RadioOrientation } from './radio.variants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAWA;;;;;;;;;;;;AAYG;AACI,MAAM,mBAAmB,GAGjB,GAAG,CAChB;IACE,mBAAmB;IACnB,kDAAkD;IAClD,qCAAqC;IACrC,gCAAgC;IAChC,sGAAsG;IACtG,0FAA0F;CAC3F,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE;gBACP,0FAA0F;gBAC1F,kCAAkC;gBAClC,yFAAyF;AAC1F,aAAA;AACD,YAAA,MAAM,EAAE;gBACN,uFAAuF;gBACvF,iCAAiC;gBACjC,uFAAuF;AACxF,aAAA;AACD,YAAA,IAAI,EAAE;gBACJ,iFAAiF;gBACjF,+BAA+B;gBAC/B,mFAAmF;AACpF,aAAA;AACF,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,EAAE,EAAE,QAAQ;AACZ,YAAA,EAAE,EAAE,QAAQ;AACZ,YAAA,EAAE,EAAE,QAAQ;AACb,SAAA;AACF,K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A,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC5I1D;AAEA;;ACFA;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-com-components-radio.mjs","sources":["../../../projects/com/components/radio/radio.variants.ts","../../../projects/com/components/radio/radio.utils.ts","../../../projects/com/components/radio/radio-group.component.ts","../../../projects/com/components/radio/radio.component.ts","../../../projects/com/components/radio/index.ts","../../../projects/com/components/radio/ngx-com-components-radio.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\n/** Radio size variants. */\nexport type RadioSize = 'sm' | 'md' | 'lg';\n\n/** Radio color variants. */\nexport type RadioVariant = 'primary' | 'accent' | 'warn';\n\n/** Radio group orientation. */\nexport type RadioOrientation = 'vertical' | 'horizontal';\n\n/**\n * CVA variants for the visual radio circle.\n *\n * Uses `peer` selectors to style based on native input state:\n * - `peer-checked:` for checked state\n * - `peer-focus-visible:` for keyboard focus\n * - `peer-disabled:` for disabled state\n *\n * @tokens `--color-border`, `--color-primary`, `--color-primary-hover`,\n * `--color-accent`, `--color-accent-hover`,\n * `--color-warn`, `--color-warn-hover`,\n * `--color-disabled`, `--color-ring`\n */\nexport const radioCircleVariants: (props?: {\n variant?: RadioVariant;\n size?: RadioSize;\n}) => string = cva(\n [\n 'com-radio__circle',\n 'inline-flex shrink-0 items-center justify-center',\n 'rounded-full border-2 border-border',\n 'transition-colors duration-150',\n 'peer-focus-visible:outline-[1px] peer-focus-visible:outline-offset-2 peer-focus-visible:outline-ring',\n 'peer-disabled:cursor-not-allowed peer-disabled:border-disabled peer-disabled:bg-disabled',\n ],\n {\n variants: {\n variant: {\n primary: [\n 'peer-checked:border-primary peer-checked:bg-primary peer-checked:text-primary-foreground',\n 'group-hover:border-primary-hover',\n 'peer-checked:group-hover:bg-primary-hover peer-checked:group-hover:border-primary-hover',\n ],\n accent: [\n 'peer-checked:border-accent peer-checked:bg-accent peer-checked:text-accent-foreground',\n 'group-hover:border-accent-hover',\n 'peer-checked:group-hover:bg-accent-hover peer-checked:group-hover:border-accent-hover',\n ],\n warn: [\n 'peer-checked:border-warn peer-checked:bg-warn peer-checked:text-warn-foreground',\n 'group-hover:border-warn-hover',\n 'peer-checked:group-hover:bg-warn-hover peer-checked:group-hover:border-warn-hover',\n ],\n },\n size: {\n sm: 'size-4',\n md: 'size-5',\n lg: 'size-6',\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n }\n);\n\n/** Size-based classes for the inner dot indicator. */\nexport const RADIO_DOT_SIZES: Record<RadioSize, string> = {\n sm: 'size-1.5',\n md: 'size-2',\n lg: 'size-2.5',\n};\n\n/** Size-based classes for the label content. */\nexport const RADIO_LABEL_SIZES: Record<RadioSize, string> = {\n sm: 'text-sm ms-2',\n md: 'text-base ms-2.5',\n lg: 'text-lg ms-3',\n};\n\n/** Base classes for the radio group container. */\nconst RADIO_GROUP_BASE = 'com-radio-group__container flex';\n\n/** Orientation-based classes for the radio group container. */\nexport const RADIO_GROUP_ORIENTATIONS: Record<RadioOrientation, string> = {\n vertical: `${RADIO_GROUP_BASE} flex-col gap-2`,\n horizontal: `${RADIO_GROUP_BASE} flex-row flex-wrap gap-4`,\n};\n","/** Auto-incrementing ID counter for unique radio IDs. */\nlet nextRadioId = 0;\n\n/** Generates a unique radio ID. */\nexport function generateRadioId(): string {\n return `com-radio-${nextRadioId++}`;\n}\n\n/** Auto-incrementing ID counter for unique radio group IDs. */\nlet nextGroupId = 0;\n\n/** Generates a unique radio group ID. */\nexport function generateRadioGroupId(): string {\n return `com-radio-group-${nextGroupId++}`;\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n InjectionToken,\n input,\n linkedSignal,\n model,\n output,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport type {\n InputSignal,\n InputSignalWithTransform,\n ModelSignal,\n OutputEmitterRef,\n Signal,\n WritableSignal,\n} from '@angular/core';\nimport { FormGroupDirective, NgControl, NgForm } from '@angular/forms';\nimport type { ControlValueAccessor } from '@angular/forms';\nimport { ErrorStateMatcher } from 'ngx-com/components/form-field';\nimport { RADIO_GROUP_ORIENTATIONS } from './radio.variants';\nimport type { RadioOrientation, RadioSize, RadioVariant } from './radio.variants';\nimport { generateRadioGroupId } from './radio.utils';\n\n/** Event emitted when radio group value changes. */\nexport interface RadioGroupChange {\n value: string | null;\n}\n\n/** Interface for radio items that register with the group. */\nexport interface RadioItem {\n value: () => string;\n isDisabled: () => boolean;\n focus: () => void;\n}\n\n/** Context provided to child radio components via DI. */\nexport interface ComRadioGroupContext {\n name: Signal<string>;\n value: Signal<string | null>;\n disabled: Signal<boolean>;\n size: Signal<RadioSize>;\n variant: Signal<RadioVariant>;\n orientation: Signal<RadioOrientation>;\n focusedValue: Signal<string | null>;\n select: (value: string) => void;\n focusNext: (currentValue: string) => void;\n focusPrevious: (currentValue: string) => void;\n register: (radio: RadioItem) => void;\n unregister: (radio: RadioItem) => void;\n onTouched?: () => void;\n}\n\n/** Injection token for radio group context. */\nexport const COM_RADIO_GROUP: InjectionToken<ComRadioGroupContext> = new InjectionToken<ComRadioGroupContext>('COM_RADIO_GROUP');\n\n/**\n * Radio group component that manages a set of radio buttons.\n *\n * Provides mutual exclusion, shared name, and roving tabindex keyboard navigation.\n * Implements `ControlValueAccessor` for Reactive Forms integration.\n *\n * @tokens `--color-border`, `--color-primary`, `--color-primary-foreground`, `--color-primary-hover`,\n * `--color-accent`, `--color-accent-foreground`, `--color-accent-hover`,\n * `--color-warn`, `--color-warn-foreground`, `--color-warn-hover`,\n * `--color-disabled`, `--color-disabled-foreground`, `--color-ring`\n *\n * @example Basic usage\n * ```html\n * <com-radio-group [(value)]=\"selectedFruit\" aria-label=\"Select a fruit\">\n * <com-radio value=\"apple\">Apple</com-radio>\n * <com-radio value=\"banana\">Banana</com-radio>\n * <com-radio value=\"cherry\">Cherry</com-radio>\n * </com-radio-group>\n * ```\n *\n * @example With reactive forms\n * ```html\n * <com-radio-group formControlName=\"size\" aria-label=\"Select size\">\n * <com-radio value=\"sm\">Small</com-radio>\n * <com-radio value=\"md\">Medium</com-radio>\n * <com-radio value=\"lg\">Large</com-radio>\n * </com-radio-group>\n * ```\n *\n * @example Horizontal orientation\n * ```html\n * <com-radio-group [(value)]=\"color\" orientation=\"horizontal\">\n * <com-radio value=\"red\">Red</com-radio>\n * <com-radio value=\"green\">Green</com-radio>\n * <com-radio value=\"blue\">Blue</com-radio>\n * </com-radio-group>\n * ```\n *\n * @example With variants\n * ```html\n * <com-radio-group [(value)]=\"priority\" variant=\"warn\" size=\"lg\">\n * <com-radio value=\"low\">Low</com-radio>\n * <com-radio value=\"medium\">Medium</com-radio>\n * <com-radio value=\"high\">High</com-radio>\n * </com-radio-group>\n * ```\n */\n@Component({\n selector: 'com-radio-group',\n exportAs: 'comRadioGroup',\n template: `\n <div\n role=\"radiogroup\"\n [class]=\"groupClasses()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"computedAriaDescribedby()\"\n [attr.aria-required]=\"required() || null\"\n [attr.aria-invalid]=\"errorState() || null\"\n >\n <ng-content />\n </div>\n @if (errorState() && errorMessage()) {\n <div\n [id]=\"errorId\"\n class=\"com-radio-group__error mt-1.5 text-sm text-warn\"\n role=\"alert\"\n >\n {{ errorMessage() }}\n </div>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: COM_RADIO_GROUP,\n useFactory: () => {\n const group = inject(ComRadioGroup);\n return group.createContext();\n },\n },\n ],\n host: {\n class: 'com-radio-group block',\n '[class.com-radio-group--disabled]': 'disabled()',\n '[class.com-radio-group--error]': 'errorState()',\n },\n})\nexport class ComRadioGroup implements ControlValueAccessor {\n /** Optional NgControl for reactive forms integration. */\n readonly ngControl: NgControl | null = inject(NgControl, { optional: true, self: true });\n\n /** Error state matcher for determining when to show validation errors. */\n private readonly defaultErrorStateMatcher: ErrorStateMatcher = inject(ErrorStateMatcher);\n private readonly parentForm: NgForm | null = inject(NgForm, { optional: true });\n private readonly parentFormGroup: FormGroupDirective | null = inject(FormGroupDirective, { optional: true });\n\n /** Unique ID for this radio group instance. */\n private readonly uniqueId: string = generateRadioGroupId();\n\n /** ID for the error message element. */\n readonly errorId: string = `${this.uniqueId}-error`;\n\n /** Registered radio items. */\n private readonly registeredRadios: WritableSignal<RadioItem[]> = signal([]);\n\n // Inputs\n readonly name: InputSignal<string> = input<string>(this.uniqueId);\n readonly value: ModelSignal<string | null> = model<string | null>(null);\n readonly disabled: ModelSignal<boolean> = model<boolean>(false);\n readonly required: InputSignalWithTransform<boolean, unknown> = input(false, {\n transform: booleanAttribute,\n });\n readonly orientation: InputSignal<RadioOrientation> = input<RadioOrientation>('vertical');\n readonly size: InputSignal<RadioSize> = input<RadioSize>('md');\n readonly variant: InputSignal<RadioVariant> = input<RadioVariant>('primary');\n readonly errorMessage: InputSignal<string> = input<string>('');\n readonly errorStateMatcher: InputSignal<ErrorStateMatcher | undefined> = input<ErrorStateMatcher>();\n\n /** Tracks touched state — writable by both CVA callback and Signal Forms [formField]. */\n readonly touched: ModelSignal<boolean> = model<boolean>(false);\n\n // Signal Forms inputs — set automatically by [formField] via setInputOnDirectives\n readonly invalid: InputSignal<boolean> = input<boolean>(false);\n readonly sfErrors: InputSignal<readonly unknown[]> = input<readonly unknown[]>([], { alias: 'errors' });\n\n readonly ariaLabel: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-label' });\n readonly ariaLabelledby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-labelledby' });\n readonly ariaDescribedby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-describedby' });\n\n // Outputs\n /** Emits when the selection changes, with full event details. */\n readonly selectionChange: OutputEmitterRef<RadioGroupChange> = output<RadioGroupChange>();\n\n /**\n * Tracks the currently focused radio value for roving tabindex.\n * Resets to the current selection (or first focusable) when value or radios change.\n */\n private readonly focusedValueSignal: WritableSignal<string | null> = linkedSignal({\n source: () => ({ value: this.value(), radios: this.registeredRadios() }),\n computation: ({ value, radios }) => {\n if (value && radios.some((r) => r.value() === value && !r.isDisabled())) {\n return value;\n }\n const firstFocusable = radios.find((r) => !r.isDisabled());\n return firstFocusable?.value() ?? null;\n },\n });\n\n // Computed\n /**\n * Computed error state derived from form validation.\n * Shows errors when control is invalid and touched/submitted.\n */\n readonly errorState: Signal<boolean> = computed(() => {\n if (!this.ngControl) {\n // Signal Forms: gate on invalid AND touched (mirrors ErrorStateMatcher default)\n return this.invalid() && this.touched();\n }\n // Reactive Forms: use ErrorStateMatcher (existing logic)\n this.touched();\n const matcher = this.errorStateMatcher() ?? this.defaultErrorStateMatcher;\n const form = this.parentFormGroup ?? this.parentForm;\n return matcher.isErrorState(this.ngControl.control ?? null, form);\n });\n\n readonly computedAriaDescribedby: Signal<string | null> = computed(() => {\n const userDescribedby = this.ariaDescribedby();\n if (this.errorState() && this.errorMessage()) {\n return userDescribedby ? `${userDescribedby} ${this.errorId}` : this.errorId;\n }\n return userDescribedby;\n });\n\n protected readonly groupClasses: Signal<string> = computed(() =>\n RADIO_GROUP_ORIENTATIONS[this.orientation()]\n );\n\n // CVA callbacks\n private onChange: (value: string | null) => void = () => {};\n private onTouchedCallback: () => void = () => {};\n\n constructor() {\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n /** Creates the context object for child radios. */\n createContext(): ComRadioGroupContext {\n return {\n name: this.name,\n value: this.value,\n disabled: this.disabled,\n size: this.size,\n variant: this.variant,\n orientation: this.orientation,\n focusedValue: this.focusedValueSignal,\n select: this.select.bind(this),\n focusNext: this.focusNext.bind(this),\n focusPrevious: this.focusPrevious.bind(this),\n register: this.register.bind(this),\n unregister: this.unregister.bind(this),\n onTouched: () => this.onTouchedCallback(),\n };\n }\n\n /** Register a radio item with the group. */\n private register(radio: RadioItem): void {\n this.registeredRadios.update((radios) => [...radios, radio]);\n }\n\n /** Unregister a radio item from the group. */\n private unregister(radio: RadioItem): void {\n this.registeredRadios.update((radios) => radios.filter((r) => r !== radio));\n }\n\n // ControlValueAccessor implementation\n writeValue(value: string | null): void {\n this.value.set(value);\n }\n\n registerOnChange(fn: (value: string | null) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouchedCallback = () => {\n this.touched.set(true);\n fn();\n };\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled.set(isDisabled);\n }\n\n // Public API\n /** Selects a radio by value. */\n select(newValue: string): void {\n if (this.disabled()) {\n return;\n }\n this.value.set(newValue);\n this.focusedValueSignal.set(newValue);\n this.onChange(newValue);\n this.selectionChange.emit({ value: newValue });\n }\n\n /** Focuses the next non-disabled radio (with cyclic wrap). */\n focusNext(currentValue: string): void {\n const allRadios = this.registeredRadios();\n const focusableRadios = allRadios.filter((r) => !r.isDisabled());\n\n if (focusableRadios.length === 0) {\n return;\n }\n\n const currentIndex = focusableRadios.findIndex((r) => r.value() === currentValue);\n const nextIndex = (currentIndex + 1) % focusableRadios.length;\n const nextRadio = focusableRadios[nextIndex];\n\n if (nextRadio) {\n this.focusedValueSignal.set(nextRadio.value());\n this.select(nextRadio.value());\n nextRadio.focus();\n }\n }\n\n /** Focuses the previous non-disabled radio (with cyclic wrap). */\n focusPrevious(currentValue: string): void {\n const allRadios = this.registeredRadios();\n const focusableRadios = allRadios.filter((r) => !r.isDisabled());\n\n if (focusableRadios.length === 0) {\n return;\n }\n\n const currentIndex = focusableRadios.findIndex((r) => r.value() === currentValue);\n const prevIndex = (currentIndex - 1 + focusableRadios.length) % focusableRadios.length;\n const prevRadio = focusableRadios[prevIndex];\n\n if (prevRadio) {\n this.focusedValueSignal.set(prevRadio.value());\n this.select(prevRadio.value());\n prevRadio.focus();\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n inject,\n input,\n model,\n output,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport type {\n InputSignal,\n ModelSignal,\n OnInit,\n OutputEmitterRef,\n Signal,\n} from '@angular/core';\nimport {\n radioCircleVariants,\n RADIO_DOT_SIZES,\n RADIO_LABEL_SIZES,\n} from './radio.variants';\nimport type { RadioSize, RadioVariant } from './radio.variants';\nimport { generateRadioId } from './radio.utils';\nimport { COM_RADIO_GROUP, type ComRadioGroupContext, type RadioItem } from './radio-group.component';\n\n/** Event emitted when a radio is selected. */\nexport interface RadioChange {\n value: string;\n source: ComRadio;\n}\n\n/**\n * Production-grade radio component with full accessibility support.\n *\n * Uses a native `<input type=\"radio\">` for built-in keyboard handling,\n * `:checked` pseudo-class, and screen reader support.\n *\n * Must be used within a `ComRadioGroup` which manages the selected value\n * and provides the shared `name` attribute.\n *\n * @tokens `--color-border`, `--color-primary`, `--color-primary-foreground`, `--color-primary-hover`,\n * `--color-accent`, `--color-accent-foreground`, `--color-accent-hover`,\n * `--color-warn`, `--color-warn-foreground`, `--color-warn-hover`,\n * `--color-disabled`, `--color-disabled-foreground`, `--color-ring`\n *\n * @example Basic usage within a group\n * ```html\n * <com-radio-group [(value)]=\"selectedOption\">\n * <com-radio value=\"option1\">Option 1</com-radio>\n * <com-radio value=\"option2\">Option 2</com-radio>\n * <com-radio value=\"option3\">Option 3</com-radio>\n * </com-radio-group>\n * ```\n *\n * @example Disabled option\n * ```html\n * <com-radio-group [(value)]=\"selected\">\n * <com-radio value=\"enabled\">Enabled option</com-radio>\n * <com-radio value=\"disabled\" [disabled]=\"true\">Disabled option</com-radio>\n * </com-radio-group>\n * ```\n */\n@Component({\n selector: 'com-radio',\n exportAs: 'comRadio',\n template: `\n <label\n class=\"group relative inline-flex items-center\"\n [class.cursor-pointer]=\"!isDisabled()\"\n [class.cursor-not-allowed]=\"isDisabled()\"\n >\n <span><input\n #inputElement\n type=\"radio\"\n class=\"peer sr-only\"\n [id]=\"inputId()\"\n [checked]=\"isChecked()\"\n [disabled]=\"isDisabled()\"\n [attr.name]=\"groupName()\"\n [attr.value]=\"value()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.tabindex]=\"tabIndex()\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"\n /></span>\n <div [class]=\"circleClasses()\">\n <div\n class=\"com-radio__dot rounded-full bg-current transition-transform duration-150 peer-disabled:bg-disabled-foreground\"\n [class]=\"dotSizeClass()\"\n [class.scale-100]=\"isChecked()\"\n [class.scale-0]=\"!isChecked()\"\n ></div>\n </div>\n <span\n class=\"com-radio__label select-none peer-disabled:cursor-not-allowed peer-disabled:text-disabled-foreground\"\n [class]=\"labelSizeClass()\"\n >\n <ng-content />\n </span>\n </label>\n `,\n styles: `\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'com-radio inline-block align-middle',\n '[class.com-radio--disabled]': 'isDisabled()',\n '[class.com-radio--checked]': 'isChecked()',\n },\n})\nexport class ComRadio implements OnInit, RadioItem {\n /** Optional parent radio group context. */\n private readonly group: ComRadioGroupContext | null = inject(COM_RADIO_GROUP, {\n optional: true,\n });\n\n /** DestroyRef for cleanup. */\n private readonly destroyRef: DestroyRef = inject(DestroyRef);\n\n /** Reference to the native input element. */\n readonly inputRef: Signal<ElementRef<HTMLInputElement> | undefined> =\n viewChild<ElementRef<HTMLInputElement>>('inputElement');\n\n /** Unique ID for this radio instance. */\n private readonly uniqueId: string = generateRadioId();\n\n // Inputs\n readonly value: InputSignal<string> = input.required<string>();\n readonly size: InputSignal<RadioSize> = input<RadioSize>('md');\n readonly variant: InputSignal<RadioVariant> = input<RadioVariant>('primary');\n readonly disabled: ModelSignal<boolean> = model<boolean>(false);\n readonly id: InputSignal<string | undefined> = input<string>();\n readonly ariaLabel: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-label' });\n readonly ariaLabelledby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-labelledby' });\n readonly ariaDescribedby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-describedby' });\n\n // Outputs\n readonly changed: OutputEmitterRef<RadioChange> = output<RadioChange>();\n\n // Computed state\n readonly inputId: Signal<string> = computed(() => this.id() ?? this.uniqueId);\n\n /** Resolve size from group or local input. */\n readonly resolvedSize: Signal<RadioSize> = computed(\n () => this.group?.size() ?? this.size()\n );\n\n /** Resolve variant from group or local input. */\n readonly resolvedVariant: Signal<RadioVariant> = computed(\n () => this.group?.variant() ?? this.variant()\n );\n\n /** Whether this radio is checked based on group value. */\n readonly isChecked: Signal<boolean> = computed(() => {\n if (!this.group) {\n return false;\n }\n return this.group.value() === this.value();\n });\n\n /** Whether this radio is disabled (from local or group). */\n readonly isDisabled: Signal<boolean> = computed(\n () => this.disabled() || (this.group?.disabled() ?? false)\n );\n\n /** Get name from group. */\n readonly groupName: Signal<string | undefined> = computed(() => this.group?.name());\n\n /** Tab index for roving tabindex pattern. */\n readonly tabIndex: Signal<number> = computed(() => {\n if (this.isDisabled()) {\n return -1;\n }\n if (!this.group) {\n return 0;\n }\n // Roving tabindex: only the selected or first focusable item gets tabindex 0\n const isSelected = this.isChecked();\n const isFocusTarget = this.group.focusedValue() === this.value();\n\n if (isSelected || isFocusTarget) {\n return 0;\n }\n return -1;\n });\n\n protected readonly circleClasses: Signal<string> = computed(() =>\n radioCircleVariants({ variant: this.resolvedVariant(), size: this.resolvedSize() })\n );\n\n protected readonly dotSizeClass: Signal<string> = computed(() => RADIO_DOT_SIZES[this.resolvedSize()]);\n protected readonly labelSizeClass: Signal<string> = computed(() => RADIO_LABEL_SIZES[this.resolvedSize()]);\n\n ngOnInit(): void {\n // Register with the group\n this.group?.register(this);\n\n // Unregister on destroy\n this.destroyRef.onDestroy(() => {\n this.group?.unregister(this);\n });\n }\n\n // Event handlers\n protected onInputChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n if (input.checked && this.group) {\n this.group.select(this.value());\n this.changed.emit({ value: this.value(), source: this });\n }\n }\n\n protected onBlur(): void {\n this.group?.onTouched?.();\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n if (!this.group) {\n return;\n }\n\n const { key } = event;\n const isVertical = this.group.orientation() === 'vertical';\n const isHorizontal = this.group.orientation() === 'horizontal';\n\n let handled = false;\n\n if (\n (isVertical && key === 'ArrowDown') ||\n (isHorizontal && key === 'ArrowRight')\n ) {\n this.group.focusNext(this.value());\n handled = true;\n } else if (\n (isVertical && key === 'ArrowUp') ||\n (isHorizontal && key === 'ArrowLeft')\n ) {\n this.group.focusPrevious(this.value());\n handled = true;\n } else if (key === ' ') {\n // Space selects the focused radio\n if (!this.isChecked()) {\n this.group.select(this.value());\n this.changed.emit({ value: this.value(), source: this });\n }\n handled = true;\n }\n\n if (handled) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n\n // Public API\n /** Focuses this radio's input element. */\n focus(): void {\n this.inputRef()?.nativeElement.focus();\n }\n\n /** Selects this radio programmatically. */\n select(): void {\n if (this.isDisabled() || !this.group) {\n return;\n }\n this.group.select(this.value());\n this.changed.emit({ value: this.value(), source: this });\n }\n}\n","// Public API for the radio component\n\n// Main components\nexport { ComRadio } from './radio.component';\nexport { ComRadioGroup, COM_RADIO_GROUP } from './radio-group.component';\n\n// Types\nexport type { RadioChange } from './radio.component';\nexport type { RadioGroupChange, ComRadioGroupContext, RadioItem } from './radio-group.component';\n\n// Variants (for advanced customization)\nexport {\n radioCircleVariants,\n RADIO_GROUP_ORIENTATIONS,\n RADIO_DOT_SIZES,\n RADIO_LABEL_SIZES,\n} from './radio.variants';\n\nexport type { RadioSize, RadioVariant, RadioOrientation } from './radio.variants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAWA;;;;;;;;;;;;AAYG;AACI,MAAM,mBAAmB,GAGjB,GAAG,CAChB;IACE,mBAAmB;IACnB,kDAAkD;IAClD,qCAAqC;IACrC,gCAAgC;IAChC,sGAAsG;IACtG,0FAA0F;CAC3F,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE;gBACP,0FAA0F;gBAC1F,kCAAkC;gBAClC,yFAAyF;AAC1F,aAAA;AACD,YAAA,MAAM,EAAE;gBACN,uFAAuF;gBACvF,iCAAiC;gBACjC,uFAAuF;AACxF,aAAA;AACD,YAAA,IAAI,EAAE;gBACJ,iFAAiF;gBACjF,+BAA+B;gBAC/B,mFAAmF;AACpF,aAAA;AACF,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,EAAE,EAAE,QAAQ;AACZ,YAAA,EAAE,EAAE,QAAQ;AACZ,YAAA,EAAE,EAAE,QAAQ;AACb,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,IAAI,EAAE,IAAI;AACX,KAAA;AACF,CAAA;AAGH;AACO,MAAM,eAAe,GAA8B;AACxD,IAAA,EAAE,EAAE,UAAU;AACd,IAAA,EAAE,EAAE,QAAQ;AACZ,IAAA,EAAE,EAAE,UAAU;;AAGhB;AACO,MAAM,iBAAiB,GAA8B;AAC1D,IAAA,EAAE,EAAE,cAAc;AAClB,IAAA,EAAE,EAAE,kBAAkB;AACtB,IAAA,EAAE,EAAE,cAAc;;AAG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AAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,YAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC5I1D;AAEA;;ACFA;;AAEG;;;;"}
@@ -0,0 +1,102 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, booleanAttribute, computed, Directive } from '@angular/core';
3
+ import { mergeClasses } from 'ngx-com/utils';
4
+ import { cva } from 'class-variance-authority';
5
+
6
+ /**
7
+ * CVA variants for the separator directive.
8
+ *
9
+ * @tokens `--color-border`, `--color-border-subtle`
10
+ */
11
+ const separatorVariants = cva(['com-separator', 'shrink-0'], {
12
+ variants: {
13
+ orientation: {
14
+ horizontal: 'border-t border-l-0 w-full h-0',
15
+ vertical: 'border-l border-t-0 h-full w-0',
16
+ },
17
+ variant: {
18
+ default: 'border-border',
19
+ subtle: 'border-border-subtle',
20
+ },
21
+ },
22
+ defaultVariants: {
23
+ orientation: 'horizontal',
24
+ variant: 'default',
25
+ },
26
+ });
27
+
28
+ /**
29
+ * Separator directive — applies a visual divider to any host element.
30
+ *
31
+ * Works on `<hr>`, `<div>`, or any other element. Supports horizontal and
32
+ * vertical orientations, a subtle color variant, and a decorative mode that
33
+ * hides the separator from assistive technology.
34
+ *
35
+ * @tokens `--color-border`, `--color-border-subtle`
36
+ *
37
+ * @example Horizontal divider
38
+ * ```html
39
+ * <hr comSeparator />
40
+ * ```
41
+ *
42
+ * @example Vertical divider
43
+ * ```html
44
+ * <div comSeparator orientation="vertical" class="h-6"></div>
45
+ * ```
46
+ *
47
+ * @example Subtle variant
48
+ * ```html
49
+ * <hr comSeparator variant="subtle" />
50
+ * ```
51
+ *
52
+ * @example Decorative (hidden from screen readers)
53
+ * ```html
54
+ * <hr comSeparator decorative />
55
+ * ```
56
+ */
57
+ class ComSeparator {
58
+ /** Direction of the separator line */
59
+ orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
60
+ /** Color intensity — `default` uses border-border, `subtle` uses border-border-subtle */
61
+ variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : []));
62
+ /** When true, hides the separator from assistive technology */
63
+ decorative = input(false, { ...(ngDevMode ? { debugName: "decorative" } : {}), transform: booleanAttribute });
64
+ /** Consumer CSS classes — merged with variant classes via mergeClasses() */
65
+ userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : {}), alias: 'class' });
66
+ /** @internal Computed host class from CVA + consumer overrides */
67
+ computedClass = computed(() => mergeClasses(separatorVariants({
68
+ orientation: this.orientation(),
69
+ variant: this.variant(),
70
+ }), this.userClass()), ...(ngDevMode ? [{ debugName: "computedClass" }] : []));
71
+ /** @internal Role attribute — separator when semantic, none when decorative */
72
+ computedRole = computed(() => this.decorative() ? 'none' : 'separator', ...(ngDevMode ? [{ debugName: "computedRole" }] : []));
73
+ /** @internal Aria-orientation — set only when not decorative */
74
+ computedAriaOrientation = computed(() => this.decorative() ? null : this.orientation(), ...(ngDevMode ? [{ debugName: "computedAriaOrientation" }] : []));
75
+ /** @internal Aria-hidden — true only when decorative */
76
+ computedAriaHidden = computed(() => this.decorative() ? 'true' : null, ...(ngDevMode ? [{ debugName: "computedAriaHidden" }] : []));
77
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ComSeparator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
78
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: ComSeparator, isStandalone: true, selector: "[comSeparator]", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, decorative: { classPropertyName: "decorative", publicName: "decorative", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "computedClass()", "attr.role": "computedRole()", "attr.aria-orientation": "computedAriaOrientation()", "attr.aria-hidden": "computedAriaHidden()" } }, exportAs: ["comSeparator"], ngImport: i0 });
79
+ }
80
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ComSeparator, decorators: [{
81
+ type: Directive,
82
+ args: [{
83
+ selector: '[comSeparator]',
84
+ exportAs: 'comSeparator',
85
+ host: {
86
+ '[class]': 'computedClass()',
87
+ '[attr.role]': 'computedRole()',
88
+ '[attr.aria-orientation]': 'computedAriaOrientation()',
89
+ '[attr.aria-hidden]': 'computedAriaHidden()',
90
+ },
91
+ }]
92
+ }], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], decorative: [{ type: i0.Input, args: [{ isSignal: true, alias: "decorative", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
93
+
94
+ // Public API for the separator directive
95
+ // Main directive
96
+
97
+ /**
98
+ * Generated bundle index. Do not edit.
99
+ */
100
+
101
+ export { ComSeparator, separatorVariants };
102
+ //# sourceMappingURL=ngx-com-components-separator.mjs.map