@page-speed/forms 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/inputs.d.cts CHANGED
@@ -133,8 +133,10 @@ interface CheckboxProps extends Omit<InputProps<boolean>, "onChange" | "placehol
133
133
  description?: React.ReactNode;
134
134
  /**
135
135
  * Layout variant
136
+ * Utilized if any checkboxes have a description
137
+ * @default false
136
138
  */
137
- checkboxVariant?: "boxed" | "inline";
139
+ useChoiceCard?: boolean;
138
140
  /**
139
141
  * Additional native input attributes
140
142
  */
@@ -182,7 +184,7 @@ interface CheckboxProps extends Omit<InputProps<boolean>, "onChange" | "placehol
182
184
  *
183
185
  * @see https://opensite.ai/developers/page-speed/forms/checkbox
184
186
  */
185
- declare function Checkbox({ name, value, onChange, onBlur, disabled, required, error, className, indeterminate, label, description, checkboxVariant, ...props }: CheckboxProps): React.JSX.Element;
187
+ declare function Checkbox({ name, value, onChange, onBlur, disabled, required, error, className, indeterminate, label, description, useChoiceCard, ...props }: CheckboxProps): React.JSX.Element;
186
188
  declare namespace Checkbox {
187
189
  var displayName: string;
188
190
  }
@@ -224,7 +226,7 @@ interface CheckboxGroupProps extends Omit<InputProps<string[]>, "onChange" | "pl
224
226
  * Layout direction
225
227
  * @default "stacked"
226
228
  */
227
- layout?: "inline" | "stacked" | "grid";
229
+ layout?: "stacked" | "grid" | "inline";
228
230
  /**
229
231
  * Group-level label
230
232
  */
@@ -275,7 +277,7 @@ interface CheckboxGroupProps extends Omit<InputProps<string[]>, "onChange" | "pl
275
277
  * - Full accessibility support (ARIA attributes, role="group")
276
278
  * - Error state styling
277
279
  * - Controlled input behavior
278
- * - Multiple layout options (inline, stacked, grid)
280
+ * - Multiple layout options (stacked, grid)
279
281
  * - Optional "select all" checkbox
280
282
  * - Individual option disabled state
281
283
  * - Minimum/maximum selection validation
@@ -366,11 +368,15 @@ interface RadioProps extends Omit<InputProps<string>, "onChange" | "placeholder"
366
368
  * Layout direction
367
369
  * @default "stacked"
368
370
  */
369
- layout?: "inline" | "stacked";
371
+ layout?: "stacked" | "grid" | "inline";
370
372
  /**
371
373
  * Group-level label
372
374
  */
373
375
  label?: React.ReactNode;
376
+ /**
377
+ * Group-level description
378
+ */
379
+ description?: React.ReactNode;
374
380
  /**
375
381
  * Additional native input attributes
376
382
  */
@@ -387,7 +393,7 @@ interface RadioProps extends Omit<InputProps<string>, "onChange" | "placeholder"
387
393
  * - Error state styling
388
394
  * - Controlled input behavior
389
395
  * - Keyboard navigation (arrow keys)
390
- * - Inline or stacked layout
396
+ * - Grid or stacked layout
391
397
  * - Optional descriptions for each option (with nil guard)
392
398
  * - Individual option disabled state
393
399
  * - Card-based styling with proper visual hierarchy
@@ -412,12 +418,12 @@ interface RadioProps extends Omit<InputProps<string>, "onChange" | "placeholder"
412
418
  *
413
419
  * @example
414
420
  * ```tsx
415
- * // Inline layout
421
+ * // Grid layout
416
422
  * <Radio
417
423
  * name="size"
418
424
  * value={size}
419
425
  * onChange={handleSizeChange}
420
- * layout="inline"
426
+ * layout="grid"
421
427
  * options={[
422
428
  * { value: 'sm', label: 'Small' },
423
429
  * { value: 'md', label: 'Medium' },
@@ -428,7 +434,7 @@ interface RadioProps extends Omit<InputProps<string>, "onChange" | "placeholder"
428
434
  *
429
435
  * @see https://opensite.ai/developers/page-speed/forms/radio
430
436
  */
431
- declare function Radio({ name, value, onChange, onBlur, disabled, required, error, className, layout, label, options, ...props }: RadioProps): React.JSX.Element;
437
+ declare function Radio({ name, value, onChange, onBlur, disabled, required, error, className, layout, label, description, options, ...props }: RadioProps): React.JSX.Element;
432
438
  declare namespace Radio {
433
439
  var displayName: string;
434
440
  }
@@ -843,7 +849,7 @@ declare namespace DatePicker {
843
849
  }
844
850
 
845
851
  /**
846
- * Time value format
852
+ * Legacy time value shape retained for backward-compatible type exports.
847
853
  */
848
854
  interface TimeValue {
849
855
  hour: number;
@@ -855,7 +861,8 @@ interface TimeValue {
855
861
  */
856
862
  interface TimePickerProps extends Omit<InputProps<string>, "onChange"> {
857
863
  /**
858
- * Change handler - receives time string in format "HH:mm AM/PM"
864
+ * Change handler - receives time string in format "HH:mm" (24-hour)
865
+ * or "h:mm AM/PM" (12-hour)
859
866
  */
860
867
  onChange: (time: string) => void;
861
868
  /**
@@ -889,50 +896,10 @@ interface TimePickerProps extends Omit<InputProps<string>, "onChange"> {
889
896
  [key: string]: any;
890
897
  }
891
898
  /**
892
- * TimePicker - Accessible time selection component with AM/PM support
893
- *
894
- * A lightweight time picker with dropdown selection for hours, minutes, and AM/PM period.
895
- * Designed to work seamlessly with useForm and Field components.
896
- *
897
- * Features:
898
- * - Dropdown selection with hour/minute spinners
899
- * - 12-hour or 24-hour format support
900
- * - AM/PM period selector
901
- * - Configurable minute step intervals
902
- * - Full accessibility support (ARIA attributes, keyboard navigation)
903
- * - Error state styling
904
- * - Controlled input behavior
905
- * - Clearable selection
906
- * - Icon display toggle
907
- * - Click outside to close
908
- *
909
- * @example
910
- * ```tsx
911
- * const form = useForm({ initialValues: { appointment: '' } });
912
- *
913
- * <TimePicker
914
- * {...form.getFieldProps('appointment')}
915
- * placeholder="Select time"
916
- * minuteStep={15}
917
- * clearable
918
- * showIcon
919
- * error={!!form.errors.appointment}
920
- * />
921
- * ```
922
- *
923
- * @example
924
- * ```tsx
925
- * // With 24-hour format
926
- * <TimePicker
927
- * name="startTime"
928
- * value={startTime}
929
- * onChange={setStartTime}
930
- * use24Hour
931
- * minuteStep={30}
932
- * />
933
- * ```
899
+ * TimePicker - Accessible time input component using native time picker UX.
934
900
  *
935
- * @see https://opensite.ai/developers/page-speed/forms/time-picker
901
+ * Uses a native `type="time"` input for a streamlined UX while preserving
902
+ * formatting compatibility for 12-hour and 24-hour output formats.
936
903
  */
937
904
  declare function TimePicker({ name, value, onChange, onBlur, disabled, required, error, className, placeholder, use24Hour, minuteStep, clearable, showIcon, ...props }: TimePickerProps): React.JSX.Element;
938
905
  declare namespace TimePicker {
package/dist/inputs.d.ts CHANGED
@@ -133,8 +133,10 @@ interface CheckboxProps extends Omit<InputProps<boolean>, "onChange" | "placehol
133
133
  description?: React.ReactNode;
134
134
  /**
135
135
  * Layout variant
136
+ * Utilized if any checkboxes have a description
137
+ * @default false
136
138
  */
137
- checkboxVariant?: "boxed" | "inline";
139
+ useChoiceCard?: boolean;
138
140
  /**
139
141
  * Additional native input attributes
140
142
  */
@@ -182,7 +184,7 @@ interface CheckboxProps extends Omit<InputProps<boolean>, "onChange" | "placehol
182
184
  *
183
185
  * @see https://opensite.ai/developers/page-speed/forms/checkbox
184
186
  */
185
- declare function Checkbox({ name, value, onChange, onBlur, disabled, required, error, className, indeterminate, label, description, checkboxVariant, ...props }: CheckboxProps): React.JSX.Element;
187
+ declare function Checkbox({ name, value, onChange, onBlur, disabled, required, error, className, indeterminate, label, description, useChoiceCard, ...props }: CheckboxProps): React.JSX.Element;
186
188
  declare namespace Checkbox {
187
189
  var displayName: string;
188
190
  }
@@ -224,7 +226,7 @@ interface CheckboxGroupProps extends Omit<InputProps<string[]>, "onChange" | "pl
224
226
  * Layout direction
225
227
  * @default "stacked"
226
228
  */
227
- layout?: "inline" | "stacked" | "grid";
229
+ layout?: "stacked" | "grid" | "inline";
228
230
  /**
229
231
  * Group-level label
230
232
  */
@@ -275,7 +277,7 @@ interface CheckboxGroupProps extends Omit<InputProps<string[]>, "onChange" | "pl
275
277
  * - Full accessibility support (ARIA attributes, role="group")
276
278
  * - Error state styling
277
279
  * - Controlled input behavior
278
- * - Multiple layout options (inline, stacked, grid)
280
+ * - Multiple layout options (stacked, grid)
279
281
  * - Optional "select all" checkbox
280
282
  * - Individual option disabled state
281
283
  * - Minimum/maximum selection validation
@@ -366,11 +368,15 @@ interface RadioProps extends Omit<InputProps<string>, "onChange" | "placeholder"
366
368
  * Layout direction
367
369
  * @default "stacked"
368
370
  */
369
- layout?: "inline" | "stacked";
371
+ layout?: "stacked" | "grid" | "inline";
370
372
  /**
371
373
  * Group-level label
372
374
  */
373
375
  label?: React.ReactNode;
376
+ /**
377
+ * Group-level description
378
+ */
379
+ description?: React.ReactNode;
374
380
  /**
375
381
  * Additional native input attributes
376
382
  */
@@ -387,7 +393,7 @@ interface RadioProps extends Omit<InputProps<string>, "onChange" | "placeholder"
387
393
  * - Error state styling
388
394
  * - Controlled input behavior
389
395
  * - Keyboard navigation (arrow keys)
390
- * - Inline or stacked layout
396
+ * - Grid or stacked layout
391
397
  * - Optional descriptions for each option (with nil guard)
392
398
  * - Individual option disabled state
393
399
  * - Card-based styling with proper visual hierarchy
@@ -412,12 +418,12 @@ interface RadioProps extends Omit<InputProps<string>, "onChange" | "placeholder"
412
418
  *
413
419
  * @example
414
420
  * ```tsx
415
- * // Inline layout
421
+ * // Grid layout
416
422
  * <Radio
417
423
  * name="size"
418
424
  * value={size}
419
425
  * onChange={handleSizeChange}
420
- * layout="inline"
426
+ * layout="grid"
421
427
  * options={[
422
428
  * { value: 'sm', label: 'Small' },
423
429
  * { value: 'md', label: 'Medium' },
@@ -428,7 +434,7 @@ interface RadioProps extends Omit<InputProps<string>, "onChange" | "placeholder"
428
434
  *
429
435
  * @see https://opensite.ai/developers/page-speed/forms/radio
430
436
  */
431
- declare function Radio({ name, value, onChange, onBlur, disabled, required, error, className, layout, label, options, ...props }: RadioProps): React.JSX.Element;
437
+ declare function Radio({ name, value, onChange, onBlur, disabled, required, error, className, layout, label, description, options, ...props }: RadioProps): React.JSX.Element;
432
438
  declare namespace Radio {
433
439
  var displayName: string;
434
440
  }
@@ -843,7 +849,7 @@ declare namespace DatePicker {
843
849
  }
844
850
 
845
851
  /**
846
- * Time value format
852
+ * Legacy time value shape retained for backward-compatible type exports.
847
853
  */
848
854
  interface TimeValue {
849
855
  hour: number;
@@ -855,7 +861,8 @@ interface TimeValue {
855
861
  */
856
862
  interface TimePickerProps extends Omit<InputProps<string>, "onChange"> {
857
863
  /**
858
- * Change handler - receives time string in format "HH:mm AM/PM"
864
+ * Change handler - receives time string in format "HH:mm" (24-hour)
865
+ * or "h:mm AM/PM" (12-hour)
859
866
  */
860
867
  onChange: (time: string) => void;
861
868
  /**
@@ -889,50 +896,10 @@ interface TimePickerProps extends Omit<InputProps<string>, "onChange"> {
889
896
  [key: string]: any;
890
897
  }
891
898
  /**
892
- * TimePicker - Accessible time selection component with AM/PM support
893
- *
894
- * A lightweight time picker with dropdown selection for hours, minutes, and AM/PM period.
895
- * Designed to work seamlessly with useForm and Field components.
896
- *
897
- * Features:
898
- * - Dropdown selection with hour/minute spinners
899
- * - 12-hour or 24-hour format support
900
- * - AM/PM period selector
901
- * - Configurable minute step intervals
902
- * - Full accessibility support (ARIA attributes, keyboard navigation)
903
- * - Error state styling
904
- * - Controlled input behavior
905
- * - Clearable selection
906
- * - Icon display toggle
907
- * - Click outside to close
908
- *
909
- * @example
910
- * ```tsx
911
- * const form = useForm({ initialValues: { appointment: '' } });
912
- *
913
- * <TimePicker
914
- * {...form.getFieldProps('appointment')}
915
- * placeholder="Select time"
916
- * minuteStep={15}
917
- * clearable
918
- * showIcon
919
- * error={!!form.errors.appointment}
920
- * />
921
- * ```
922
- *
923
- * @example
924
- * ```tsx
925
- * // With 24-hour format
926
- * <TimePicker
927
- * name="startTime"
928
- * value={startTime}
929
- * onChange={setStartTime}
930
- * use24Hour
931
- * minuteStep={30}
932
- * />
933
- * ```
899
+ * TimePicker - Accessible time input component using native time picker UX.
934
900
  *
935
- * @see https://opensite.ai/developers/page-speed/forms/time-picker
901
+ * Uses a native `type="time"` input for a streamlined UX while preserving
902
+ * formatting compatibility for 12-hour and 24-hour output formats.
936
903
  */
937
904
  declare function TimePicker({ name, value, onChange, onBlur, disabled, required, error, className, placeholder, use24Hour, minuteStep, clearable, showIcon, ...props }: TimePickerProps): React.JSX.Element;
938
905
  declare namespace TimePicker {