@capitaltg/vero 1.7.3 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -132,17 +132,22 @@ export declare interface CheckboxGroupProps extends Omit<HTMLAttributes<HTMLDivE
132
132
  onChange: (value: string[]) => void;
133
133
  className?: string;
134
134
  columns?: 1 | 2 | 3 | 4;
135
+ orientation?: 'horizontal' | 'vertical';
136
+ variant?: 'default' | 'tile' | 'button';
135
137
  }
136
138
 
137
139
  export declare interface CheckboxOption {
138
140
  id: string;
139
141
  label: string;
142
+ description?: string;
140
143
  }
141
144
 
142
145
  export declare interface CheckboxProps extends Omit<ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, 'checked' | 'disabled'> {
143
146
  label?: ReactNode;
144
147
  isChecked?: boolean;
145
148
  isDisabled?: boolean;
149
+ variant?: 'default' | 'tile' | 'button';
150
+ description?: string;
146
151
  }
147
152
 
148
153
  export declare function cn(...inputs: ClassValue[]): string;
@@ -408,6 +413,7 @@ export declare interface RadioGroupProps extends Omit<ComponentPropsWithoutRef<t
408
413
  value: string;
409
414
  onChange: (value: string) => void;
410
415
  className?: string;
416
+ columns?: 1 | 2 | 3 | 4;
411
417
  orientation?: 'horizontal' | 'vertical';
412
418
  variant?: 'default' | 'tile' | 'button';
413
419
  }
@@ -522,20 +528,34 @@ declare type StepId<T extends readonly Step[] | Step[]> = T[number]['id'];
522
528
  export declare type StepIdFromSteps<T extends readonly Step[] | Step[]> = StepId<T>;
523
529
 
524
530
  export declare const StepIndicator: <T extends readonly Step[] | Step[] = readonly Step[]>(props: StepIndicatorProps<T> & {
525
- ref?: React_2.ForwardedRef<HTMLDivElement>;
531
+ ref?: React_2.ForwardedRef<HTMLElement>;
526
532
  }) => React_2.ReactElement;
527
533
 
528
534
  export declare interface StepIndicatorProps<T extends readonly Step[] | Step[] = readonly Step[]> extends HTMLAttributes<HTMLDivElement> {
529
535
  steps: T;
530
536
  currentStep: StepId<T>;
531
537
  className?: string;
532
- orientation?: 'horizontal' | 'vertical';
533
- size?: 'default' | 'sm' | 'lg';
538
+ /**
539
+ * Layout orientation of the step indicator.
540
+ * Only available for the 'counter' variant.
541
+ * The 'default' variant is always horizontal.
542
+ */
543
+ /**
544
+ * Variant style of the step indicator.
545
+ * - 'default': USWDS-style with header showing "Step X of Y" and segments
546
+ * - 'counter': Counter style with numbered circles and connectors
547
+ */
548
+ variant?: 'default' | 'counter';
534
549
  /**
535
550
  * If true, the current step will be shown as completed instead of current.
536
551
  * Useful for showing the final step as completed when the process is finished.
537
552
  */
538
553
  showCurrentAsCompleted?: boolean;
554
+ /**
555
+ * The heading level for the step indicator header.
556
+ * Defaults to 'h4'.
557
+ */
558
+ headingLevel?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
539
559
  }
540
560
 
541
561
  export declare const Switch: React_2.ForwardRefExoticComponent<SwitchProps & React_2.RefAttributes<HTMLButtonElement>>;
@@ -654,4 +674,52 @@ declare type UseAriaDisabledOptions = {
654
674
 
655
675
  declare type UseAriaDisabledReturn = Omit<UseAriaDisabledActive, 'isDisabled'> | Omit<UseAriaDisabledInactive, 'isDisabled'>;
656
676
 
677
+ /**
678
+ * Hook for managing ARIA attributes for form controls with external labels.
679
+ *
680
+ * When no explicit aria-label is provided, this hook generates IDs for the label
681
+ * and description elements and creates appropriate aria-labelledby and aria-describedby
682
+ * attributes to ensure screen readers can properly announce the form control.
683
+ *
684
+ * This hook can be used with checkboxes, radio buttons, and other form controls
685
+ * that have labels positioned outside the control element.
686
+ *
687
+ * @param options - Configuration options
688
+ * @returns ARIA props and generated IDs for label and description elements
689
+ */
690
+ export declare function useAriaLabelled({ label, description, 'aria-label': ariaLabel, }?: UseAriaLabelledOptions): UseAriaLabelledReturn;
691
+
692
+ export declare type UseAriaLabelledOptions = {
693
+ label?: React.ReactNode;
694
+ description?: string;
695
+ 'aria-label'?: string;
696
+ };
697
+
698
+ export declare type UseAriaLabelledReturn = {
699
+ ariaProps: {
700
+ 'aria-label'?: string;
701
+ 'aria-labelledby'?: string;
702
+ 'aria-describedby'?: string;
703
+ };
704
+ labelId: string;
705
+ descriptionId: string;
706
+ };
707
+
708
+ /**
709
+ * Hook for generating className strings for form group layouts.
710
+ *
711
+ * Handles the layout logic for form control groups (RadioGroup, CheckboxGroup)
712
+ * with support for different variants, orientations, and column layouts.
713
+ *
714
+ * @param options - Layout configuration options
715
+ * @returns className string for the form group container
716
+ */
717
+ export declare function useFormGroupLayout({ variant, orientation, columns, }?: UseFormGroupLayoutOptions): string;
718
+
719
+ export declare type UseFormGroupLayoutOptions = {
720
+ variant?: 'default' | 'tile' | 'button';
721
+ orientation?: 'horizontal' | 'vertical';
722
+ columns?: 1 | 2 | 3 | 4;
723
+ };
724
+
657
725
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capitaltg/vero",
3
- "version": "1.7.3",
3
+ "version": "1.8.0",
4
4
  "description": "Accessible, modern, open source React component library inspired by USWDS built with Radix UI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -85,7 +85,6 @@
85
85
  "@storybook/addon-essentials": "^8.0.0",
86
86
  "@storybook/addon-interactions": "^8.0.0",
87
87
  "@storybook/addon-links": "^8.0.0",
88
- "@storybook/addon-onboarding": "^8.0.0",
89
88
  "@storybook/blocks": "^8.0.0",
90
89
  "@storybook/react": "^8.0.0",
91
90
  "@storybook/react-vite": "^8.0.0",