@capitaltg/vero 1.7.4 → 1.8.1

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,39 @@ 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';
559
+ /**
560
+ * If false, labels will not be shown below the segments or counter list.
561
+ * Defaults to true.
562
+ */
563
+ showLabels?: boolean;
539
564
  }
540
565
 
541
566
  export declare const Switch: React_2.ForwardRefExoticComponent<SwitchProps & React_2.RefAttributes<HTMLButtonElement>>;
@@ -655,24 +680,27 @@ declare type UseAriaDisabledOptions = {
655
680
  declare type UseAriaDisabledReturn = Omit<UseAriaDisabledActive, 'isDisabled'> | Omit<UseAriaDisabledInactive, 'isDisabled'>;
656
681
 
657
682
  /**
658
- * Hook for managing ARIA attributes for radio buttons with external labels.
683
+ * Hook for managing ARIA attributes for form controls with external labels.
659
684
  *
660
685
  * When no explicit aria-label is provided, this hook generates IDs for the label
661
686
  * and description elements and creates appropriate aria-labelledby and aria-describedby
662
- * attributes to ensure screen readers can properly announce the radio button.
687
+ * attributes to ensure screen readers can properly announce the form control.
688
+ *
689
+ * This hook can be used with checkboxes, radio buttons, and other form controls
690
+ * that have labels positioned outside the control element.
663
691
  *
664
692
  * @param options - Configuration options
665
693
  * @returns ARIA props and generated IDs for label and description elements
666
694
  */
667
- export declare function useRadioAria({ label, description, 'aria-label': ariaLabel, }?: UseRadioAriaOptions): UseRadioAriaReturn;
695
+ export declare function useAriaLabelled({ label, description, 'aria-label': ariaLabel, }?: UseAriaLabelledOptions): UseAriaLabelledReturn;
668
696
 
669
- export declare type UseRadioAriaOptions = {
697
+ export declare type UseAriaLabelledOptions = {
670
698
  label?: React.ReactNode;
671
699
  description?: string;
672
700
  'aria-label'?: string;
673
701
  };
674
702
 
675
- export declare type UseRadioAriaReturn = {
703
+ export declare type UseAriaLabelledReturn = {
676
704
  ariaProps: {
677
705
  'aria-label'?: string;
678
706
  'aria-labelledby'?: string;
@@ -682,4 +710,21 @@ export declare type UseRadioAriaReturn = {
682
710
  descriptionId: string;
683
711
  };
684
712
 
713
+ /**
714
+ * Hook for generating className strings for form group layouts.
715
+ *
716
+ * Handles the layout logic for form control groups (RadioGroup, CheckboxGroup)
717
+ * with support for different variants, orientations, and column layouts.
718
+ *
719
+ * @param options - Layout configuration options
720
+ * @returns className string for the form group container
721
+ */
722
+ export declare function useFormGroupLayout({ variant, orientation, columns, }?: UseFormGroupLayoutOptions): string;
723
+
724
+ export declare type UseFormGroupLayoutOptions = {
725
+ variant?: 'default' | 'tile' | 'button';
726
+ orientation?: 'horizontal' | 'vertical';
727
+ columns?: 1 | 2 | 3 | 4;
728
+ };
729
+
685
730
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capitaltg/vero",
3
- "version": "1.7.4",
3
+ "version": "1.8.1",
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",