ngx-com 0.0.19 → 0.0.21

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.
Files changed (56) hide show
  1. package/fesm2022/ngx-com-components-alert.mjs +346 -0
  2. package/fesm2022/ngx-com-components-alert.mjs.map +1 -0
  3. package/fesm2022/ngx-com-components-button.mjs +1 -1
  4. package/fesm2022/ngx-com-components-button.mjs.map +1 -1
  5. package/fesm2022/ngx-com-components-calendar.mjs +29 -36
  6. package/fesm2022/ngx-com-components-calendar.mjs.map +1 -1
  7. package/fesm2022/ngx-com-components-card.mjs +1 -1
  8. package/fesm2022/ngx-com-components-card.mjs.map +1 -1
  9. package/fesm2022/ngx-com-components-carousel.mjs +708 -0
  10. package/fesm2022/ngx-com-components-carousel.mjs.map +1 -0
  11. package/fesm2022/ngx-com-components-checkbox.mjs +17 -8
  12. package/fesm2022/ngx-com-components-checkbox.mjs.map +1 -1
  13. package/fesm2022/ngx-com-components-code-block.mjs +158 -0
  14. package/fesm2022/ngx-com-components-code-block.mjs.map +1 -0
  15. package/fesm2022/ngx-com-components-collapsible.mjs +1 -1
  16. package/fesm2022/ngx-com-components-collapsible.mjs.map +1 -1
  17. package/fesm2022/ngx-com-components-confirm.mjs +3 -3
  18. package/fesm2022/ngx-com-components-confirm.mjs.map +1 -1
  19. package/fesm2022/ngx-com-components-dialog.mjs +703 -0
  20. package/fesm2022/ngx-com-components-dialog.mjs.map +1 -0
  21. package/fesm2022/ngx-com-components-dropdown.mjs +36 -31
  22. package/fesm2022/ngx-com-components-dropdown.mjs.map +1 -1
  23. package/fesm2022/ngx-com-components-form-field.mjs +48 -8
  24. package/fesm2022/ngx-com-components-form-field.mjs.map +1 -1
  25. package/fesm2022/ngx-com-components-item.mjs +1 -1
  26. package/fesm2022/ngx-com-components-item.mjs.map +1 -1
  27. package/fesm2022/ngx-com-components-paginator.mjs +3 -3
  28. package/fesm2022/ngx-com-components-paginator.mjs.map +1 -1
  29. package/fesm2022/ngx-com-components-radio.mjs +16 -9
  30. package/fesm2022/ngx-com-components-radio.mjs.map +1 -1
  31. package/fesm2022/ngx-com-components-segmented-control.mjs +1 -1
  32. package/fesm2022/ngx-com-components-segmented-control.mjs.map +1 -1
  33. package/fesm2022/ngx-com-components-separator.mjs +102 -0
  34. package/fesm2022/ngx-com-components-separator.mjs.map +1 -0
  35. package/fesm2022/ngx-com-components-switch.mjs +258 -0
  36. package/fesm2022/ngx-com-components-switch.mjs.map +1 -0
  37. package/fesm2022/ngx-com-components-table.mjs +631 -0
  38. package/fesm2022/ngx-com-components-table.mjs.map +1 -0
  39. package/fesm2022/ngx-com-components-tabs.mjs +2 -2
  40. package/fesm2022/ngx-com-components-tabs.mjs.map +1 -1
  41. package/fesm2022/ngx-com-components-toast.mjs +783 -0
  42. package/fesm2022/ngx-com-components-toast.mjs.map +1 -0
  43. package/package.json +33 -1
  44. package/types/ngx-com-components-alert.d.ts +166 -0
  45. package/types/ngx-com-components-carousel.d.ts +281 -0
  46. package/types/ngx-com-components-checkbox.d.ts +7 -2
  47. package/types/ngx-com-components-code-block.d.ts +66 -0
  48. package/types/ngx-com-components-confirm.d.ts +2 -2
  49. package/types/ngx-com-components-dialog.d.ts +264 -0
  50. package/types/ngx-com-components-dropdown.d.ts +8 -5
  51. package/types/ngx-com-components-form-field.d.ts +19 -3
  52. package/types/ngx-com-components-radio.d.ts +5 -3
  53. package/types/ngx-com-components-separator.d.ts +75 -0
  54. package/types/ngx-com-components-switch.d.ts +110 -0
  55. package/types/ngx-com-components-table.d.ts +377 -0
  56. package/types/ngx-com-components-toast.d.ts +217 -0
@@ -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-2 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,kGAAkG;IAClG,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,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,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;;;;"}
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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AAA,EAAA,IAAA,EAAA,QAAA,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;;;;"}
@@ -83,7 +83,7 @@ const segmentedControlSegmentVariants = cva([
83
83
  'transition-colors duration-150',
84
84
  'cursor-pointer',
85
85
  'gap-1.5',
86
- 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring',
86
+ 'focus-visible:outline-[1px] focus-visible:outline-offset-2 focus-visible:outline-ring',
87
87
  ], {
88
88
  variants: {
89
89
  size: {
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-com-components-segmented-control.mjs","sources":["../../../projects/com/components/segmented-control/segment-def.directive.ts","../../../projects/com/components/segmented-control/segmented-control.variants.ts","../../../projects/com/components/segmented-control/segmented-control.component.ts","../../../projects/com/components/segmented-control/index.ts","../../../projects/com/components/segmented-control/ngx-com-components-segmented-control.ts"],"sourcesContent":["import { Directive, TemplateRef, inject } from '@angular/core';\nimport type { SegmentOption } from './segmented-control.component';\n\n/**\n * Template context provided to custom segment templates.\n *\n * @example\n * ```html\n * <ng-template comSegmentDef let-option let-active=\"active\">\n * <com-icon [name]=\"option.value\" />\n * <span>{{ option.label }}</span>\n * </ng-template>\n * ```\n */\nexport interface SegmentTemplateContext<T = unknown> {\n /** The option object (default for `let-option`). */\n $implicit: SegmentOption<T>;\n /** Whether this segment is currently selected. */\n active: boolean;\n /** Whether this segment is disabled. */\n disabled: boolean;\n /** Position in the options list (0-indexed). */\n index: number;\n}\n\n/**\n * Directive to mark a custom template for segment content.\n *\n * The template receives a `SegmentTemplateContext` with the option data,\n * active state, disabled state, and index. Use this to customize the\n * inner content of each segment while the component manages the button,\n * styling, and ARIA attributes.\n *\n * @example Icon + text\n * ```html\n * <com-segmented-control [options]=\"viewOptions\" [(value)]=\"currentView\">\n * <ng-template comSegmentDef let-option let-active=\"active\">\n * <com-icon [name]=\"option.value\" size=\"sm\" />\n * <span>{{ option.label }}</span>\n * </ng-template>\n * </com-segmented-control>\n * ```\n *\n * @example Icon only (label used for accessibility)\n * ```html\n * <com-segmented-control [options]=\"alignmentOptions\" [(value)]=\"alignment\">\n * <ng-template comSegmentDef let-option>\n * <com-icon [name]=\"'align-' + option.value\" size=\"sm\" />\n * </ng-template>\n * </com-segmented-control>\n * ```\n */\n@Directive({\n selector: 'ng-template[comSegmentDef]',\n})\nexport class ComSegmentDef<T = unknown> {\n readonly templateRef: TemplateRef<SegmentTemplateContext<T>> = inject(TemplateRef);\n}\n","import { cva, type VariantProps } from 'class-variance-authority';\n\n// ─── Types ───\n\nexport type SegmentedControlSize = 'sm' | 'md' | 'lg';\nexport type SegmentedControlColor = 'primary' | 'accent' | 'muted';\nexport type SegmentedControlVariant = 'filled' | 'outline';\n\n// ─── Container Variants ───\n\n/**\n * CVA variants for the segmented control container (track).\n * Controls overall sizing, padding, and track background.\n */\nexport const segmentedControlContainerVariants: (props?: {\n size?: SegmentedControlSize;\n fullWidth?: boolean;\n}) => string = cva(\n [\n 'inline-flex items-center',\n 'rounded-pill',\n 'bg-muted',\n 'p-1',\n 'transition-colors duration-150',\n ],\n {\n variants: {\n size: {\n sm: 'gap-0.5',\n md: 'gap-1',\n lg: 'gap-1',\n },\n fullWidth: {\n true: 'w-full',\n false: '',\n },\n },\n defaultVariants: {\n size: 'md',\n fullWidth: false,\n },\n }\n);\n\n// ─── Segment Variants ───\n\n/**\n * CVA variants for individual segment buttons.\n * Controls per-segment sizing, typography, and active/inactive color states.\n */\nexport const segmentedControlSegmentVariants: (props?: {\n size?: SegmentedControlSize;\n color?: SegmentedControlColor;\n variant?: SegmentedControlVariant;\n active?: boolean;\n fullWidth?: boolean;\n}) => string = cva(\n [\n 'inline-flex items-center justify-center',\n 'rounded-pill',\n 'font-medium whitespace-nowrap select-none',\n 'transition-colors duration-150',\n 'cursor-pointer',\n 'gap-1.5',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring',\n ],\n {\n variants: {\n size: {\n sm: 'h-7 px-3 text-sm',\n md: 'h-8 px-4 text-sm',\n lg: 'h-10 px-5 text-base',\n },\n color: {\n primary: '',\n accent: '',\n muted: '',\n },\n variant: {\n filled: '',\n outline: 'bg-transparent',\n },\n active: {\n true: '',\n false: 'text-foreground',\n },\n fullWidth: {\n true: 'flex-1',\n false: '',\n },\n },\n compoundVariants: [\n // ─── Filled + Active ───\n {\n variant: 'filled',\n color: 'primary',\n active: true,\n class: 'bg-primary text-primary-foreground shadow-sm',\n },\n {\n variant: 'filled',\n color: 'accent',\n active: true,\n class: 'bg-accent text-accent-foreground shadow-sm',\n },\n {\n variant: 'filled',\n color: 'muted',\n active: true,\n class: 'bg-background text-foreground shadow-sm',\n },\n\n // ─── Filled + Inactive (hover) ───\n {\n variant: 'filled',\n active: false,\n class: 'hover:bg-muted-hover',\n },\n\n // ─── Outline + Active ───\n {\n variant: 'outline',\n color: 'primary',\n active: true,\n class: 'ring-2 ring-primary text-primary',\n },\n {\n variant: 'outline',\n color: 'accent',\n active: true,\n class: 'ring-2 ring-accent text-accent',\n },\n {\n variant: 'outline',\n color: 'muted',\n active: true,\n class: 'ring-2 ring-border text-foreground',\n },\n\n // ─── Outline + Inactive (hover) ───\n {\n variant: 'outline',\n active: false,\n class: 'hover:bg-muted-hover',\n },\n ],\n defaultVariants: {\n size: 'md',\n color: 'primary',\n variant: 'filled',\n active: false,\n fullWidth: false,\n },\n }\n);\n\n// ─── Disabled Segment Classes ───\n\n/**\n * Classes to apply when a segment is disabled.\n * Separate from CVA to avoid complex variant combinations.\n */\nexport const SEGMENT_DISABLED_CLASSES =\n 'bg-disabled text-disabled-foreground cursor-not-allowed hover:bg-disabled';\n\n// ─── Variant Types ───\n\nexport type SegmentedControlContainerVariants = VariantProps<typeof segmentedControlContainerVariants>;\nexport type SegmentedControlSegmentVariants = VariantProps<typeof segmentedControlSegmentVariants>;\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n ElementRef,\n input,\n model,\n viewChildren,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { InputSignal, InputSignalWithTransform, ModelSignal, Signal } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { mergeClasses } from 'ngx-com/utils';\nimport { ComSegmentDef, type SegmentTemplateContext } from './segment-def.directive';\nimport {\n segmentedControlContainerVariants,\n segmentedControlSegmentVariants,\n SEGMENT_DISABLED_CLASSES,\n} from './segmented-control.variants';\nimport type {\n SegmentedControlSize,\n SegmentedControlColor,\n SegmentedControlVariant,\n} from './segmented-control.variants';\n\n/**\n * Represents a single option in the segmented control.\n */\nexport interface SegmentOption<T = unknown> {\n /** The value associated with this option. */\n value: T;\n /** Display label (also used as aria-label fallback for custom templates). */\n label: string;\n /** Whether this option is disabled. */\n disabled?: boolean | undefined;\n}\n\n/**\n * Segmented control component — a horizontal group of mutually exclusive options\n * where one is always selected. Think of it as a styled radio group in pill form.\n *\n * Supports two rendering modes:\n * - **Simple mode**: Plain text labels from the `label` property\n * - **Custom template mode**: Full control via `ng-template[comSegmentDef]`\n *\n * @tokens `--color-primary`, `--color-primary-foreground`,\n * `--color-accent`, `--color-accent-foreground`,\n * `--color-muted`, `--color-muted-foreground`, `--color-muted-hover`,\n * `--color-background`, `--color-foreground`,\n * `--color-disabled`, `--color-disabled-foreground`,\n * `--color-border`, `--color-ring`\n *\n * @example Basic two-option toggle\n * ```html\n * <com-segmented-control\n * [options]=\"[\n * { value: 'admin', label: 'Admin' },\n * { value: 'user', label: 'User' }\n * ]\"\n * [(value)]=\"selectedRole\"\n * />\n * ```\n *\n * @example Multiple options with variants\n * ```html\n * <com-segmented-control\n * [options]=\"viewOptions\"\n * [(value)]=\"currentView\"\n * color=\"primary\"\n * size=\"sm\"\n * />\n * ```\n *\n * @example Custom template with icons\n * ```html\n * <com-segmented-control [options]=\"viewOptions\" [(value)]=\"currentView\" color=\"primary\">\n * <ng-template comSegmentDef let-option let-active=\"active\">\n * <com-icon [name]=\"option.value === 'grid' ? 'grid' : 'list'\" size=\"sm\" />\n * <span>{{ option.label }}</span>\n * </ng-template>\n * </com-segmented-control>\n * ```\n *\n * @example Custom template with badges\n * ```html\n * <com-segmented-control [options]=\"statusOptions\" [(value)]=\"statusFilter\" color=\"accent\">\n * <ng-template comSegmentDef let-option let-active=\"active\">\n * <span>{{ option.label }}</span>\n * <span\n * class=\"ml-1.5 rounded-pill px-1.5 text-xs\"\n * [class]=\"active ? 'bg-accent-foreground/20 text-accent-foreground' : 'bg-muted text-muted-foreground'\"\n * >\n * {{ option.value === 'open' ? openCount : closedCount }}\n * </span>\n * </ng-template>\n * </com-segmented-control>\n * ```\n *\n * @example Icon only (label used for accessibility)\n * ```html\n * <com-segmented-control\n * [options]=\"[\n * { value: 'left', label: 'Align left' },\n * { value: 'center', label: 'Align center' },\n * { value: 'right', label: 'Align right' }\n * ]\"\n * [(value)]=\"alignment\"\n * size=\"sm\"\n * >\n * <ng-template comSegmentDef let-option>\n * <com-icon [name]=\"'align-' + option.value\" size=\"sm\" />\n * </ng-template>\n * </com-segmented-control>\n * ```\n *\n * @example Full width + outline variant\n * ```html\n * <com-segmented-control\n * [options]=\"plans\"\n * [(value)]=\"selectedPlan\"\n * variant=\"outline\"\n * color=\"primary\"\n * [fullWidth]=\"true\"\n * />\n * ```\n *\n * @example Disabled options\n * ```html\n * <com-segmented-control\n * [options]=\"[\n * { value: 'free', label: 'Free' },\n * { value: 'pro', label: 'Pro' },\n * { value: 'enterprise', label: 'Enterprise', disabled: true }\n * ]\"\n * [(value)]=\"plan\"\n * color=\"primary\"\n * size=\"lg\"\n * />\n * ```\n */\n@Component({\n selector: 'com-segmented-control',\n exportAs: 'comSegmentedControl',\n template: `\n <div\n role=\"radiogroup\"\n [attr.aria-label]=\"ariaLabel()\"\n [class]=\"containerClasses()\"\n >\n @for (option of options(); track option.value; let i = $index) {\n <button\n #segmentButton\n type=\"button\"\n role=\"radio\"\n [attr.aria-checked]=\"isActive(option)\"\n [attr.aria-label]=\"customTemplate() ? option.label : null\"\n [attr.aria-disabled]=\"option.disabled || null\"\n [disabled]=\"option.disabled\"\n [tabindex]=\"tabIndexFor(i)\"\n [class]=\"segmentClasses(option)\"\n (click)=\"select(option)\"\n (keydown)=\"onKeydown($event, i)\"\n >\n @if (customTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl.templateRef\"\n [ngTemplateOutletContext]=\"getTemplateContext(option, i)\"\n />\n } @else {\n {{ option.label }}\n }\n </button>\n }\n </div>\n `,\n styles: `\n com-segmented-control {\n display: inline-block;\n }\n com-segmented-control[fullWidth] {\n display: block;\n }\n `,\n imports: [NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'com-segmented-control',\n '[attr.fullWidth]': 'fullWidth() || null',\n },\n})\nexport class ComSegmentedControl<T = unknown> {\n // ─── View Children ───\n\n /** References to all segment buttons for focus management. */\n private readonly segmentButtons: Signal<readonly ElementRef<HTMLButtonElement>[]> =\n viewChildren<ElementRef<HTMLButtonElement>>('segmentButton');\n\n // ─── Inputs ───\n\n /** The list of options to display. */\n readonly options: InputSignal<SegmentOption<T>[]> = input.required<SegmentOption<T>[]>();\n\n /** Currently selected value. Two-way bindable with `[(value)]`. */\n readonly value: ModelSignal<T | undefined> = model<T | undefined>(undefined);\n\n /** Controls segment height, padding, and font size. */\n readonly size: InputSignal<SegmentedControlSize> = input<SegmentedControlSize>('md');\n\n /** Color scheme for the active segment. */\n readonly color: InputSignal<SegmentedControlColor> = input<SegmentedControlColor>('primary');\n\n /** Visual variant: filled (solid background) or outline (ring border). */\n readonly variant: InputSignal<SegmentedControlVariant> = input<SegmentedControlVariant>('filled');\n\n /** When true, segments stretch equally to fill available width. */\n readonly fullWidth: InputSignalWithTransform<boolean, unknown> = input(false, {\n transform: booleanAttribute,\n });\n\n /** Accessible label for the radiogroup container. */\n readonly ariaLabel: InputSignal<string | null> = input<string | null>(null, {\n alias: 'aria-label',\n });\n\n /** Custom CSS classes to merge with container classes. */\n readonly userClass: InputSignal<string> = input('', { alias: 'class' });\n\n // ─── Content Child ───\n\n /** Optional custom template for segment content. */\n readonly customTemplate: Signal<ComSegmentDef<T> | undefined> = contentChild<ComSegmentDef<T>>(ComSegmentDef);\n\n // ─── Computed ───\n\n /** Classes for the container/track element. */\n protected readonly containerClasses: Signal<string> = computed(() =>\n mergeClasses(\n segmentedControlContainerVariants({\n size: this.size(),\n fullWidth: this.fullWidth(),\n }),\n this.userClass()\n )\n );\n\n // ─── Public Methods ───\n\n /**\n * Checks if the given option is currently selected.\n */\n isActive(option: SegmentOption<T>): boolean {\n return this.value() === option.value;\n }\n\n /**\n * Selects the given option (if not disabled).\n */\n select(option: SegmentOption<T>): void {\n if (option.disabled) {\n return;\n }\n this.value.set(option.value);\n }\n\n /**\n * Returns the tabindex for a segment at the given index.\n * Implements roving tabindex: only the selected (or first focusable) segment has tabindex=\"0\".\n */\n tabIndexFor(index: number): number {\n const opts = this.options();\n const currentValue = this.value();\n\n // If current value matches this option, it gets tabindex=\"0\"\n if (opts[index]?.value === currentValue) {\n return 0;\n }\n\n // If no value is selected, first non-disabled option gets tabindex=\"0\"\n if (currentValue === undefined) {\n const firstFocusableIndex = opts.findIndex((o) => !o.disabled);\n return index === firstFocusableIndex ? 0 : -1;\n }\n\n return -1;\n }\n\n /**\n * Returns computed classes for a segment button.\n */\n segmentClasses(option: SegmentOption<T>): string {\n const active = this.isActive(option);\n const baseClasses = segmentedControlSegmentVariants({\n size: this.size(),\n color: this.color(),\n variant: this.variant(),\n active,\n fullWidth: this.fullWidth(),\n });\n\n if (option.disabled) {\n return mergeClasses(baseClasses, SEGMENT_DISABLED_CLASSES);\n }\n\n return baseClasses;\n }\n\n /**\n * Builds the template context for custom templates.\n */\n getTemplateContext(option: SegmentOption<T>, index: number): SegmentTemplateContext<T> {\n return {\n $implicit: option,\n active: this.isActive(option),\n disabled: !!option.disabled,\n index,\n };\n }\n\n /**\n * Handles keyboard navigation for the segmented control.\n * Implements ARIA radiogroup keyboard patterns.\n */\n onKeydown(event: KeyboardEvent, currentIndex: number): void {\n const opts = this.options();\n let targetIndex: number | null = null;\n\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n targetIndex = this.findNextFocusableIndex(currentIndex, 1);\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n targetIndex = this.findNextFocusableIndex(currentIndex, -1);\n break;\n case 'Home':\n targetIndex = this.findFirstFocusableIndex();\n break;\n case 'End':\n targetIndex = this.findLastFocusableIndex();\n break;\n default:\n return;\n }\n\n if (targetIndex !== null && targetIndex !== currentIndex) {\n event.preventDefault();\n const targetOption = opts[targetIndex];\n if (targetOption) {\n this.select(targetOption);\n this.focusSegmentAt(targetIndex);\n }\n }\n }\n\n // ─── Private Methods ───\n\n /**\n * Finds the next focusable (non-disabled) option index in the given direction.\n * Wraps around to the beginning/end of the list.\n */\n private findNextFocusableIndex(currentIndex: number, direction: 1 | -1): number | null {\n const opts = this.options();\n const length = opts.length;\n\n if (length === 0) {\n return null;\n }\n\n let index = currentIndex;\n for (let i = 0; i < length; i++) {\n index = (index + direction + length) % length;\n if (!opts[index]?.disabled) {\n return index;\n }\n }\n\n return null;\n }\n\n /**\n * Finds the first focusable (non-disabled) option index.\n */\n private findFirstFocusableIndex(): number | null {\n const opts = this.options();\n const index = opts.findIndex((o) => !o.disabled);\n return index >= 0 ? index : null;\n }\n\n /**\n * Finds the last focusable (non-disabled) option index.\n */\n private findLastFocusableIndex(): number | null {\n const opts = this.options();\n for (let i = opts.length - 1; i >= 0; i--) {\n if (!opts[i]?.disabled) {\n return i;\n }\n }\n return null;\n }\n\n /**\n * Focuses the segment button at the given index.\n */\n private focusSegmentAt(index: number): void {\n const button = this.segmentButtons()[index];\n if (button) {\n button.nativeElement.focus();\n }\n }\n}\n","// Public API for the segmented-control component\n\n// Main component\nexport { ComSegmentedControl } from './segmented-control.component';\nexport type { SegmentOption } from './segmented-control.component';\n\n// Directive\nexport { ComSegmentDef } from './segment-def.directive';\nexport type { SegmentTemplateContext } from './segment-def.directive';\n\n// Variants\nexport {\n segmentedControlContainerVariants,\n segmentedControlSegmentVariants,\n SEGMENT_DISABLED_CLASSES,\n} from './segmented-control.variants';\n\nexport type {\n SegmentedControlSize,\n SegmentedControlColor,\n SegmentedControlVariant,\n SegmentedControlContainerVariants,\n SegmentedControlSegmentVariants,\n} from './segmented-control.variants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAyBA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;MAIU,aAAa,CAAA;AACf,IAAA,WAAW,GAA2C,MAAM,CAAC,WAAW,CAAC;uGADvE,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAA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A,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAQf,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAnD/B,SAAS;+BACE,uBAAuB,EAAA,QAAA,EACvB,qBAAqB,EAAA,QAAA,EACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BT,EAAA,OAAA,EASQ,CAAC,gBAAgB,CAAC,EAAA,eAAA,EACV,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B;AACJ,wBAAA,KAAK,EAAE,uBAAuB;AAC9B,wBAAA,kBAAkB,EAAE,qBAAqB;AAC1C,qBAAA,EAAA,MAAA,EAAA,CAAA,8FAAA,CAAA,EAAA;AAO6C,SAAA,CAAA,EAAA,cAAA,EAAA,EAAA,cAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,eAAe,q3BAmCkC,aAAa,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACzO9G;AAEA;;ACFA;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-com-components-segmented-control.mjs","sources":["../../../projects/com/components/segmented-control/segment-def.directive.ts","../../../projects/com/components/segmented-control/segmented-control.variants.ts","../../../projects/com/components/segmented-control/segmented-control.component.ts","../../../projects/com/components/segmented-control/index.ts","../../../projects/com/components/segmented-control/ngx-com-components-segmented-control.ts"],"sourcesContent":["import { Directive, TemplateRef, inject } from '@angular/core';\nimport type { SegmentOption } from './segmented-control.component';\n\n/**\n * Template context provided to custom segment templates.\n *\n * @example\n * ```html\n * <ng-template comSegmentDef let-option let-active=\"active\">\n * <com-icon [name]=\"option.value\" />\n * <span>{{ option.label }}</span>\n * </ng-template>\n * ```\n */\nexport interface SegmentTemplateContext<T = unknown> {\n /** The option object (default for `let-option`). */\n $implicit: SegmentOption<T>;\n /** Whether this segment is currently selected. */\n active: boolean;\n /** Whether this segment is disabled. */\n disabled: boolean;\n /** Position in the options list (0-indexed). */\n index: number;\n}\n\n/**\n * Directive to mark a custom template for segment content.\n *\n * The template receives a `SegmentTemplateContext` with the option data,\n * active state, disabled state, and index. Use this to customize the\n * inner content of each segment while the component manages the button,\n * styling, and ARIA attributes.\n *\n * @example Icon + text\n * ```html\n * <com-segmented-control [options]=\"viewOptions\" [(value)]=\"currentView\">\n * <ng-template comSegmentDef let-option let-active=\"active\">\n * <com-icon [name]=\"option.value\" size=\"sm\" />\n * <span>{{ option.label }}</span>\n * </ng-template>\n * </com-segmented-control>\n * ```\n *\n * @example Icon only (label used for accessibility)\n * ```html\n * <com-segmented-control [options]=\"alignmentOptions\" [(value)]=\"alignment\">\n * <ng-template comSegmentDef let-option>\n * <com-icon [name]=\"'align-' + option.value\" size=\"sm\" />\n * </ng-template>\n * </com-segmented-control>\n * ```\n */\n@Directive({\n selector: 'ng-template[comSegmentDef]',\n})\nexport class ComSegmentDef<T = unknown> {\n readonly templateRef: TemplateRef<SegmentTemplateContext<T>> = inject(TemplateRef);\n}\n","import { cva, type VariantProps } from 'class-variance-authority';\n\n// ─── Types ───\n\nexport type SegmentedControlSize = 'sm' | 'md' | 'lg';\nexport type SegmentedControlColor = 'primary' | 'accent' | 'muted';\nexport type SegmentedControlVariant = 'filled' | 'outline';\n\n// ─── Container Variants ───\n\n/**\n * CVA variants for the segmented control container (track).\n * Controls overall sizing, padding, and track background.\n */\nexport const segmentedControlContainerVariants: (props?: {\n size?: SegmentedControlSize;\n fullWidth?: boolean;\n}) => string = cva(\n [\n 'inline-flex items-center',\n 'rounded-pill',\n 'bg-muted',\n 'p-1',\n 'transition-colors duration-150',\n ],\n {\n variants: {\n size: {\n sm: 'gap-0.5',\n md: 'gap-1',\n lg: 'gap-1',\n },\n fullWidth: {\n true: 'w-full',\n false: '',\n },\n },\n defaultVariants: {\n size: 'md',\n fullWidth: false,\n },\n }\n);\n\n// ─── Segment Variants ───\n\n/**\n * CVA variants for individual segment buttons.\n * Controls per-segment sizing, typography, and active/inactive color states.\n */\nexport const segmentedControlSegmentVariants: (props?: {\n size?: SegmentedControlSize;\n color?: SegmentedControlColor;\n variant?: SegmentedControlVariant;\n active?: boolean;\n fullWidth?: boolean;\n}) => string = cva(\n [\n 'inline-flex items-center justify-center',\n 'rounded-pill',\n 'font-medium whitespace-nowrap select-none',\n 'transition-colors duration-150',\n 'cursor-pointer',\n 'gap-1.5',\n 'focus-visible:outline-[1px] focus-visible:outline-offset-2 focus-visible:outline-ring',\n ],\n {\n variants: {\n size: {\n sm: 'h-7 px-3 text-sm',\n md: 'h-8 px-4 text-sm',\n lg: 'h-10 px-5 text-base',\n },\n color: {\n primary: '',\n accent: '',\n muted: '',\n },\n variant: {\n filled: '',\n outline: 'bg-transparent',\n },\n active: {\n true: '',\n false: 'text-foreground',\n },\n fullWidth: {\n true: 'flex-1',\n false: '',\n },\n },\n compoundVariants: [\n // ─── Filled + Active ───\n {\n variant: 'filled',\n color: 'primary',\n active: true,\n class: 'bg-primary text-primary-foreground shadow-sm',\n },\n {\n variant: 'filled',\n color: 'accent',\n active: true,\n class: 'bg-accent text-accent-foreground shadow-sm',\n },\n {\n variant: 'filled',\n color: 'muted',\n active: true,\n class: 'bg-background text-foreground shadow-sm',\n },\n\n // ─── Filled + Inactive (hover) ───\n {\n variant: 'filled',\n active: false,\n class: 'hover:bg-muted-hover',\n },\n\n // ─── Outline + Active ───\n {\n variant: 'outline',\n color: 'primary',\n active: true,\n class: 'ring-2 ring-primary text-primary',\n },\n {\n variant: 'outline',\n color: 'accent',\n active: true,\n class: 'ring-2 ring-accent text-accent',\n },\n {\n variant: 'outline',\n color: 'muted',\n active: true,\n class: 'ring-2 ring-border text-foreground',\n },\n\n // ─── Outline + Inactive (hover) ───\n {\n variant: 'outline',\n active: false,\n class: 'hover:bg-muted-hover',\n },\n ],\n defaultVariants: {\n size: 'md',\n color: 'primary',\n variant: 'filled',\n active: false,\n fullWidth: false,\n },\n }\n);\n\n// ─── Disabled Segment Classes ───\n\n/**\n * Classes to apply when a segment is disabled.\n * Separate from CVA to avoid complex variant combinations.\n */\nexport const SEGMENT_DISABLED_CLASSES =\n 'bg-disabled text-disabled-foreground cursor-not-allowed hover:bg-disabled';\n\n// ─── Variant Types ───\n\nexport type SegmentedControlContainerVariants = VariantProps<typeof segmentedControlContainerVariants>;\nexport type SegmentedControlSegmentVariants = VariantProps<typeof segmentedControlSegmentVariants>;\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n ElementRef,\n input,\n model,\n viewChildren,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { InputSignal, InputSignalWithTransform, ModelSignal, Signal } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { mergeClasses } from 'ngx-com/utils';\nimport { ComSegmentDef, type SegmentTemplateContext } from './segment-def.directive';\nimport {\n segmentedControlContainerVariants,\n segmentedControlSegmentVariants,\n SEGMENT_DISABLED_CLASSES,\n} from './segmented-control.variants';\nimport type {\n SegmentedControlSize,\n SegmentedControlColor,\n SegmentedControlVariant,\n} from './segmented-control.variants';\n\n/**\n * Represents a single option in the segmented control.\n */\nexport interface SegmentOption<T = unknown> {\n /** The value associated with this option. */\n value: T;\n /** Display label (also used as aria-label fallback for custom templates). */\n label: string;\n /** Whether this option is disabled. */\n disabled?: boolean | undefined;\n}\n\n/**\n * Segmented control component — a horizontal group of mutually exclusive options\n * where one is always selected. Think of it as a styled radio group in pill form.\n *\n * Supports two rendering modes:\n * - **Simple mode**: Plain text labels from the `label` property\n * - **Custom template mode**: Full control via `ng-template[comSegmentDef]`\n *\n * @tokens `--color-primary`, `--color-primary-foreground`,\n * `--color-accent`, `--color-accent-foreground`,\n * `--color-muted`, `--color-muted-foreground`, `--color-muted-hover`,\n * `--color-background`, `--color-foreground`,\n * `--color-disabled`, `--color-disabled-foreground`,\n * `--color-border`, `--color-ring`\n *\n * @example Basic two-option toggle\n * ```html\n * <com-segmented-control\n * [options]=\"[\n * { value: 'admin', label: 'Admin' },\n * { value: 'user', label: 'User' }\n * ]\"\n * [(value)]=\"selectedRole\"\n * />\n * ```\n *\n * @example Multiple options with variants\n * ```html\n * <com-segmented-control\n * [options]=\"viewOptions\"\n * [(value)]=\"currentView\"\n * color=\"primary\"\n * size=\"sm\"\n * />\n * ```\n *\n * @example Custom template with icons\n * ```html\n * <com-segmented-control [options]=\"viewOptions\" [(value)]=\"currentView\" color=\"primary\">\n * <ng-template comSegmentDef let-option let-active=\"active\">\n * <com-icon [name]=\"option.value === 'grid' ? 'grid' : 'list'\" size=\"sm\" />\n * <span>{{ option.label }}</span>\n * </ng-template>\n * </com-segmented-control>\n * ```\n *\n * @example Custom template with badges\n * ```html\n * <com-segmented-control [options]=\"statusOptions\" [(value)]=\"statusFilter\" color=\"accent\">\n * <ng-template comSegmentDef let-option let-active=\"active\">\n * <span>{{ option.label }}</span>\n * <span\n * class=\"ml-1.5 rounded-pill px-1.5 text-xs\"\n * [class]=\"active ? 'bg-accent-foreground/20 text-accent-foreground' : 'bg-muted text-muted-foreground'\"\n * >\n * {{ option.value === 'open' ? openCount : closedCount }}\n * </span>\n * </ng-template>\n * </com-segmented-control>\n * ```\n *\n * @example Icon only (label used for accessibility)\n * ```html\n * <com-segmented-control\n * [options]=\"[\n * { value: 'left', label: 'Align left' },\n * { value: 'center', label: 'Align center' },\n * { value: 'right', label: 'Align right' }\n * ]\"\n * [(value)]=\"alignment\"\n * size=\"sm\"\n * >\n * <ng-template comSegmentDef let-option>\n * <com-icon [name]=\"'align-' + option.value\" size=\"sm\" />\n * </ng-template>\n * </com-segmented-control>\n * ```\n *\n * @example Full width + outline variant\n * ```html\n * <com-segmented-control\n * [options]=\"plans\"\n * [(value)]=\"selectedPlan\"\n * variant=\"outline\"\n * color=\"primary\"\n * [fullWidth]=\"true\"\n * />\n * ```\n *\n * @example Disabled options\n * ```html\n * <com-segmented-control\n * [options]=\"[\n * { value: 'free', label: 'Free' },\n * { value: 'pro', label: 'Pro' },\n * { value: 'enterprise', label: 'Enterprise', disabled: true }\n * ]\"\n * [(value)]=\"plan\"\n * color=\"primary\"\n * size=\"lg\"\n * />\n * ```\n */\n@Component({\n selector: 'com-segmented-control',\n exportAs: 'comSegmentedControl',\n template: `\n <div\n role=\"radiogroup\"\n [attr.aria-label]=\"ariaLabel()\"\n [class]=\"containerClasses()\"\n >\n @for (option of options(); track option.value; let i = $index) {\n <button\n #segmentButton\n type=\"button\"\n role=\"radio\"\n [attr.aria-checked]=\"isActive(option)\"\n [attr.aria-label]=\"customTemplate() ? option.label : null\"\n [attr.aria-disabled]=\"option.disabled || null\"\n [disabled]=\"option.disabled\"\n [tabindex]=\"tabIndexFor(i)\"\n [class]=\"segmentClasses(option)\"\n (click)=\"select(option)\"\n (keydown)=\"onKeydown($event, i)\"\n >\n @if (customTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl.templateRef\"\n [ngTemplateOutletContext]=\"getTemplateContext(option, i)\"\n />\n } @else {\n {{ option.label }}\n }\n </button>\n }\n </div>\n `,\n styles: `\n com-segmented-control {\n display: inline-block;\n }\n com-segmented-control[fullWidth] {\n display: block;\n }\n `,\n imports: [NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'com-segmented-control',\n '[attr.fullWidth]': 'fullWidth() || null',\n },\n})\nexport class ComSegmentedControl<T = unknown> {\n // ─── View Children ───\n\n /** References to all segment buttons for focus management. */\n private readonly segmentButtons: Signal<readonly ElementRef<HTMLButtonElement>[]> =\n viewChildren<ElementRef<HTMLButtonElement>>('segmentButton');\n\n // ─── Inputs ───\n\n /** The list of options to display. */\n readonly options: InputSignal<SegmentOption<T>[]> = input.required<SegmentOption<T>[]>();\n\n /** Currently selected value. Two-way bindable with `[(value)]`. */\n readonly value: ModelSignal<T | undefined> = model<T | undefined>(undefined);\n\n /** Controls segment height, padding, and font size. */\n readonly size: InputSignal<SegmentedControlSize> = input<SegmentedControlSize>('md');\n\n /** Color scheme for the active segment. */\n readonly color: InputSignal<SegmentedControlColor> = input<SegmentedControlColor>('primary');\n\n /** Visual variant: filled (solid background) or outline (ring border). */\n readonly variant: InputSignal<SegmentedControlVariant> = input<SegmentedControlVariant>('filled');\n\n /** When true, segments stretch equally to fill available width. */\n readonly fullWidth: InputSignalWithTransform<boolean, unknown> = input(false, {\n transform: booleanAttribute,\n });\n\n /** Accessible label for the radiogroup container. */\n readonly ariaLabel: InputSignal<string | null> = input<string | null>(null, {\n alias: 'aria-label',\n });\n\n /** Custom CSS classes to merge with container classes. */\n readonly userClass: InputSignal<string> = input('', { alias: 'class' });\n\n // ─── Content Child ───\n\n /** Optional custom template for segment content. */\n readonly customTemplate: Signal<ComSegmentDef<T> | undefined> = contentChild<ComSegmentDef<T>>(ComSegmentDef);\n\n // ─── Computed ───\n\n /** Classes for the container/track element. */\n protected readonly containerClasses: Signal<string> = computed(() =>\n mergeClasses(\n segmentedControlContainerVariants({\n size: this.size(),\n fullWidth: this.fullWidth(),\n }),\n this.userClass()\n )\n );\n\n // ─── Public Methods ───\n\n /**\n * Checks if the given option is currently selected.\n */\n isActive(option: SegmentOption<T>): boolean {\n return this.value() === option.value;\n }\n\n /**\n * Selects the given option (if not disabled).\n */\n select(option: SegmentOption<T>): void {\n if (option.disabled) {\n return;\n }\n this.value.set(option.value);\n }\n\n /**\n * Returns the tabindex for a segment at the given index.\n * Implements roving tabindex: only the selected (or first focusable) segment has tabindex=\"0\".\n */\n tabIndexFor(index: number): number {\n const opts = this.options();\n const currentValue = this.value();\n\n // If current value matches this option, it gets tabindex=\"0\"\n if (opts[index]?.value === currentValue) {\n return 0;\n }\n\n // If no value is selected, first non-disabled option gets tabindex=\"0\"\n if (currentValue === undefined) {\n const firstFocusableIndex = opts.findIndex((o) => !o.disabled);\n return index === firstFocusableIndex ? 0 : -1;\n }\n\n return -1;\n }\n\n /**\n * Returns computed classes for a segment button.\n */\n segmentClasses(option: SegmentOption<T>): string {\n const active = this.isActive(option);\n const baseClasses = segmentedControlSegmentVariants({\n size: this.size(),\n color: this.color(),\n variant: this.variant(),\n active,\n fullWidth: this.fullWidth(),\n });\n\n if (option.disabled) {\n return mergeClasses(baseClasses, SEGMENT_DISABLED_CLASSES);\n }\n\n return baseClasses;\n }\n\n /**\n * Builds the template context for custom templates.\n */\n getTemplateContext(option: SegmentOption<T>, index: number): SegmentTemplateContext<T> {\n return {\n $implicit: option,\n active: this.isActive(option),\n disabled: !!option.disabled,\n index,\n };\n }\n\n /**\n * Handles keyboard navigation for the segmented control.\n * Implements ARIA radiogroup keyboard patterns.\n */\n onKeydown(event: KeyboardEvent, currentIndex: number): void {\n const opts = this.options();\n let targetIndex: number | null = null;\n\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n targetIndex = this.findNextFocusableIndex(currentIndex, 1);\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n targetIndex = this.findNextFocusableIndex(currentIndex, -1);\n break;\n case 'Home':\n targetIndex = this.findFirstFocusableIndex();\n break;\n case 'End':\n targetIndex = this.findLastFocusableIndex();\n break;\n default:\n return;\n }\n\n if (targetIndex !== null && targetIndex !== currentIndex) {\n event.preventDefault();\n const targetOption = opts[targetIndex];\n if (targetOption) {\n this.select(targetOption);\n this.focusSegmentAt(targetIndex);\n }\n }\n }\n\n // ─── Private Methods ───\n\n /**\n * Finds the next focusable (non-disabled) option index in the given direction.\n * Wraps around to the beginning/end of the list.\n */\n private findNextFocusableIndex(currentIndex: number, direction: 1 | -1): number | null {\n const opts = this.options();\n const length = opts.length;\n\n if (length === 0) {\n return null;\n }\n\n let index = currentIndex;\n for (let i = 0; i < length; i++) {\n index = (index + direction + length) % length;\n if (!opts[index]?.disabled) {\n return index;\n }\n }\n\n return null;\n }\n\n /**\n * Finds the first focusable (non-disabled) option index.\n */\n private findFirstFocusableIndex(): number | null {\n const opts = this.options();\n const index = opts.findIndex((o) => !o.disabled);\n return index >= 0 ? index : null;\n }\n\n /**\n * Finds the last focusable (non-disabled) option index.\n */\n private findLastFocusableIndex(): number | null {\n const opts = this.options();\n for (let i = opts.length - 1; i >= 0; i--) {\n if (!opts[i]?.disabled) {\n return i;\n }\n }\n return null;\n }\n\n /**\n * Focuses the segment button at the given index.\n */\n private focusSegmentAt(index: number): void {\n const button = this.segmentButtons()[index];\n if (button) {\n button.nativeElement.focus();\n }\n }\n}\n","// Public API for the segmented-control component\n\n// Main component\nexport { ComSegmentedControl } from './segmented-control.component';\nexport type { SegmentOption } from './segmented-control.component';\n\n// Directive\nexport { ComSegmentDef } from './segment-def.directive';\nexport type { SegmentTemplateContext } from './segment-def.directive';\n\n// Variants\nexport {\n segmentedControlContainerVariants,\n segmentedControlSegmentVariants,\n SEGMENT_DISABLED_CLASSES,\n} from './segmented-control.variants';\n\nexport type {\n SegmentedControlSize,\n SegmentedControlColor,\n SegmentedControlVariant,\n SegmentedControlContainerVariants,\n SegmentedControlSegmentVariants,\n} from './segmented-control.variants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAyBA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;MAIU,aAAa,CAAA;AACf,IAAA,WAAW,GAA2C,MAAM,CAAC,WAAW,CAAC;uGADvE,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,4BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAHzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,4BAA4B;AACvC,iBAAA;;;AC9CD;AAEA;;;AAGG;AACI,MAAM,iCAAiC,GAG/B,GAAG,CAChB;IACE,0BAA0B;IAC1B,cAAc;IACd,UAAU;IACV,KAAK;IACL,gCAAgC;C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EAAA,IAAA,EAC/B;AACJ,wBAAA,KAAK,EAAE,uBAAuB;AAC9B,wBAAA,kBAAkB,EAAE,qBAAqB;AAC1C,qBAAA,EAAA,MAAA,EAAA,CAAA,8FAAA,CAAA,EAAA;AAO6C,SAAA,CAAA,EAAA,cAAA,EAAA,EAAA,cAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,eAAe,q3BAmCkC,aAAa,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACzO9G;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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-com-components-separator.mjs","sources":["../../../projects/com/components/separator/separator.variants.ts","../../../projects/com/components/separator/separator.directive.ts","../../../projects/com/components/separator/index.ts","../../../projects/com/components/separator/ngx-com-components-separator.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\n/**\n * Orientation type for separator direction.\n */\nexport type SeparatorOrientation = 'horizontal' | 'vertical';\n\n/**\n * Variant type for separator appearance.\n */\nexport type SeparatorVariant = 'default' | 'subtle';\n\n/**\n * CVA variants for the separator directive.\n *\n * @tokens `--color-border`, `--color-border-subtle`\n */\nexport const separatorVariants: (props?: {\n orientation?: SeparatorOrientation;\n variant?: SeparatorVariant;\n}) => string = cva(\n ['com-separator', 'shrink-0'],\n {\n variants: {\n orientation: {\n horizontal: 'border-t border-l-0 w-full h-0',\n vertical: 'border-l border-t-0 h-full w-0',\n },\n variant: {\n default: 'border-border',\n subtle: 'border-border-subtle',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n variant: 'default',\n },\n }\n);\n\nexport type SeparatorVariants = VariantProps<typeof separatorVariants>;\n","import {\n booleanAttribute,\n computed,\n Directive,\n input,\n} from '@angular/core';\nimport type { InputSignal, InputSignalWithTransform, Signal } from '@angular/core';\nimport { mergeClasses } from './separator.utils';\nimport { separatorVariants } from './separator.variants';\nimport type { SeparatorOrientation, SeparatorVariant } from './separator.variants';\n\n/**\n * Separator directive — applies a visual divider to any host element.\n *\n * Works on `<hr>`, `<div>`, or any other element. Supports horizontal and\n * vertical orientations, a subtle color variant, and a decorative mode that\n * hides the separator from assistive technology.\n *\n * @tokens `--color-border`, `--color-border-subtle`\n *\n * @example Horizontal divider\n * ```html\n * <hr comSeparator />\n * ```\n *\n * @example Vertical divider\n * ```html\n * <div comSeparator orientation=\"vertical\" class=\"h-6\"></div>\n * ```\n *\n * @example Subtle variant\n * ```html\n * <hr comSeparator variant=\"subtle\" />\n * ```\n *\n * @example Decorative (hidden from screen readers)\n * ```html\n * <hr comSeparator decorative />\n * ```\n */\n@Directive({\n selector: '[comSeparator]',\n exportAs: 'comSeparator',\n host: {\n '[class]': 'computedClass()',\n '[attr.role]': 'computedRole()',\n '[attr.aria-orientation]': 'computedAriaOrientation()',\n '[attr.aria-hidden]': 'computedAriaHidden()',\n },\n})\nexport class ComSeparator {\n /** Direction of the separator line */\n readonly orientation: InputSignal<SeparatorOrientation> = input<SeparatorOrientation>('horizontal');\n\n /** Color intensity — `default` uses border-border, `subtle` uses border-border-subtle */\n readonly variant: InputSignal<SeparatorVariant> = input<SeparatorVariant>('default');\n\n /** When true, hides the separator from assistive technology */\n readonly decorative: InputSignalWithTransform<boolean, unknown> = input(false, { transform: booleanAttribute });\n\n /** Consumer CSS classes — merged with variant classes via mergeClasses() */\n readonly userClass: InputSignal<string> = input<string>('', { alias: 'class' });\n\n /** @internal Computed host class from CVA + consumer overrides */\n protected readonly computedClass: Signal<string> = computed(() =>\n mergeClasses(\n separatorVariants({\n orientation: this.orientation(),\n variant: this.variant(),\n }),\n this.userClass()\n )\n );\n\n /** @internal Role attribute — separator when semantic, none when decorative */\n protected readonly computedRole: Signal<string> = computed(() =>\n this.decorative() ? 'none' : 'separator'\n );\n\n /** @internal Aria-orientation — set only when not decorative */\n protected readonly computedAriaOrientation: Signal<string | null> = computed(() =>\n this.decorative() ? null : this.orientation()\n );\n\n /** @internal Aria-hidden — true only when decorative */\n protected readonly computedAriaHidden: Signal<'true' | null> = computed(() =>\n this.decorative() ? 'true' : null\n );\n}\n","// Public API for the separator directive\n\n// Main directive\nexport { ComSeparator } from './separator.directive';\n\n// Variants (for advanced customization)\nexport { separatorVariants } from './separator.variants';\n\nexport type {\n SeparatorOrientation,\n SeparatorVariant,\n SeparatorVariants,\n} from './separator.variants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAYA;;;;AAIG;AACI,MAAM,iBAAiB,GAGf,GAAG,CAChB,CAAC,eAAe,EAAE,UAAU,CAAC,EAC7B;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,WAAW,EAAE;AACX,YAAA,UAAU,EAAE,gCAAgC;AAC5C,YAAA,QAAQ,EAAE,gCAAgC;AAC3C,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE,eAAe;AACxB,YAAA,MAAM,EAAE,sBAAsB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