@page-speed/forms 0.4.2 → 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,18 +368,15 @@ interface RadioProps extends Omit<InputProps<string>, "onChange" | "placeholder"
366
368
  * Layout direction
367
369
  * @default "stacked"
368
370
  */
369
- layout?: "inline" | "stacked";
370
- /**
371
- * Visual variant for radio options
372
- * - "boxed": bordered card with ring on hover/selected, radio circle on right
373
- * - "inline": minimal style, radio circle on left
374
- * @default "inline"
375
- */
376
- radioVariant?: "boxed" | "inline";
371
+ layout?: "stacked" | "grid" | "inline";
377
372
  /**
378
373
  * Group-level label
379
374
  */
380
375
  label?: React.ReactNode;
376
+ /**
377
+ * Group-level description
378
+ */
379
+ description?: React.ReactNode;
381
380
  /**
382
381
  * Additional native input attributes
383
382
  */
@@ -394,7 +393,7 @@ interface RadioProps extends Omit<InputProps<string>, "onChange" | "placeholder"
394
393
  * - Error state styling
395
394
  * - Controlled input behavior
396
395
  * - Keyboard navigation (arrow keys)
397
- * - Inline or stacked layout
396
+ * - Grid or stacked layout
398
397
  * - Optional descriptions for each option (with nil guard)
399
398
  * - Individual option disabled state
400
399
  * - Card-based styling with proper visual hierarchy
@@ -419,12 +418,12 @@ interface RadioProps extends Omit<InputProps<string>, "onChange" | "placeholder"
419
418
  *
420
419
  * @example
421
420
  * ```tsx
422
- * // Inline layout
421
+ * // Grid layout
423
422
  * <Radio
424
423
  * name="size"
425
424
  * value={size}
426
425
  * onChange={handleSizeChange}
427
- * layout="inline"
426
+ * layout="grid"
428
427
  * options={[
429
428
  * { value: 'sm', label: 'Small' },
430
429
  * { value: 'md', label: 'Medium' },
@@ -435,7 +434,7 @@ interface RadioProps extends Omit<InputProps<string>, "onChange" | "placeholder"
435
434
  *
436
435
  * @see https://opensite.ai/developers/page-speed/forms/radio
437
436
  */
438
- declare function Radio({ name, value, onChange, onBlur, disabled, required, error, className, layout, radioVariant, 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;
439
438
  declare namespace Radio {
440
439
  var displayName: string;
441
440
  }
@@ -850,7 +849,7 @@ declare namespace DatePicker {
850
849
  }
851
850
 
852
851
  /**
853
- * Time value format
852
+ * Legacy time value shape retained for backward-compatible type exports.
854
853
  */
855
854
  interface TimeValue {
856
855
  hour: number;
@@ -862,7 +861,8 @@ interface TimeValue {
862
861
  */
863
862
  interface TimePickerProps extends Omit<InputProps<string>, "onChange"> {
864
863
  /**
865
- * 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)
866
866
  */
867
867
  onChange: (time: string) => void;
868
868
  /**
@@ -896,50 +896,10 @@ interface TimePickerProps extends Omit<InputProps<string>, "onChange"> {
896
896
  [key: string]: any;
897
897
  }
898
898
  /**
899
- * TimePicker - Accessible time selection component with AM/PM support
900
- *
901
- * A lightweight time picker with dropdown selection for hours, minutes, and AM/PM period.
902
- * Designed to work seamlessly with useForm and Field components.
903
- *
904
- * Features:
905
- * - Dropdown selection with hour/minute spinners
906
- * - 12-hour or 24-hour format support
907
- * - AM/PM period selector
908
- * - Configurable minute step intervals
909
- * - Full accessibility support (ARIA attributes, keyboard navigation)
910
- * - Error state styling
911
- * - Controlled input behavior
912
- * - Clearable selection
913
- * - Icon display toggle
914
- * - Click outside to close
915
- *
916
- * @example
917
- * ```tsx
918
- * const form = useForm({ initialValues: { appointment: '' } });
919
- *
920
- * <TimePicker
921
- * {...form.getFieldProps('appointment')}
922
- * placeholder="Select time"
923
- * minuteStep={15}
924
- * clearable
925
- * showIcon
926
- * error={!!form.errors.appointment}
927
- * />
928
- * ```
929
- *
930
- * @example
931
- * ```tsx
932
- * // With 24-hour format
933
- * <TimePicker
934
- * name="startTime"
935
- * value={startTime}
936
- * onChange={setStartTime}
937
- * use24Hour
938
- * minuteStep={30}
939
- * />
940
- * ```
899
+ * TimePicker - Accessible time input component using native time picker UX.
941
900
  *
942
- * @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.
943
903
  */
944
904
  declare function TimePicker({ name, value, onChange, onBlur, disabled, required, error, className, placeholder, use24Hour, minuteStep, clearable, showIcon, ...props }: TimePickerProps): React.JSX.Element;
945
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,18 +368,15 @@ interface RadioProps extends Omit<InputProps<string>, "onChange" | "placeholder"
366
368
  * Layout direction
367
369
  * @default "stacked"
368
370
  */
369
- layout?: "inline" | "stacked";
370
- /**
371
- * Visual variant for radio options
372
- * - "boxed": bordered card with ring on hover/selected, radio circle on right
373
- * - "inline": minimal style, radio circle on left
374
- * @default "inline"
375
- */
376
- radioVariant?: "boxed" | "inline";
371
+ layout?: "stacked" | "grid" | "inline";
377
372
  /**
378
373
  * Group-level label
379
374
  */
380
375
  label?: React.ReactNode;
376
+ /**
377
+ * Group-level description
378
+ */
379
+ description?: React.ReactNode;
381
380
  /**
382
381
  * Additional native input attributes
383
382
  */
@@ -394,7 +393,7 @@ interface RadioProps extends Omit<InputProps<string>, "onChange" | "placeholder"
394
393
  * - Error state styling
395
394
  * - Controlled input behavior
396
395
  * - Keyboard navigation (arrow keys)
397
- * - Inline or stacked layout
396
+ * - Grid or stacked layout
398
397
  * - Optional descriptions for each option (with nil guard)
399
398
  * - Individual option disabled state
400
399
  * - Card-based styling with proper visual hierarchy
@@ -419,12 +418,12 @@ interface RadioProps extends Omit<InputProps<string>, "onChange" | "placeholder"
419
418
  *
420
419
  * @example
421
420
  * ```tsx
422
- * // Inline layout
421
+ * // Grid layout
423
422
  * <Radio
424
423
  * name="size"
425
424
  * value={size}
426
425
  * onChange={handleSizeChange}
427
- * layout="inline"
426
+ * layout="grid"
428
427
  * options={[
429
428
  * { value: 'sm', label: 'Small' },
430
429
  * { value: 'md', label: 'Medium' },
@@ -435,7 +434,7 @@ interface RadioProps extends Omit<InputProps<string>, "onChange" | "placeholder"
435
434
  *
436
435
  * @see https://opensite.ai/developers/page-speed/forms/radio
437
436
  */
438
- declare function Radio({ name, value, onChange, onBlur, disabled, required, error, className, layout, radioVariant, 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;
439
438
  declare namespace Radio {
440
439
  var displayName: string;
441
440
  }
@@ -850,7 +849,7 @@ declare namespace DatePicker {
850
849
  }
851
850
 
852
851
  /**
853
- * Time value format
852
+ * Legacy time value shape retained for backward-compatible type exports.
854
853
  */
855
854
  interface TimeValue {
856
855
  hour: number;
@@ -862,7 +861,8 @@ interface TimeValue {
862
861
  */
863
862
  interface TimePickerProps extends Omit<InputProps<string>, "onChange"> {
864
863
  /**
865
- * 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)
866
866
  */
867
867
  onChange: (time: string) => void;
868
868
  /**
@@ -896,50 +896,10 @@ interface TimePickerProps extends Omit<InputProps<string>, "onChange"> {
896
896
  [key: string]: any;
897
897
  }
898
898
  /**
899
- * TimePicker - Accessible time selection component with AM/PM support
900
- *
901
- * A lightweight time picker with dropdown selection for hours, minutes, and AM/PM period.
902
- * Designed to work seamlessly with useForm and Field components.
903
- *
904
- * Features:
905
- * - Dropdown selection with hour/minute spinners
906
- * - 12-hour or 24-hour format support
907
- * - AM/PM period selector
908
- * - Configurable minute step intervals
909
- * - Full accessibility support (ARIA attributes, keyboard navigation)
910
- * - Error state styling
911
- * - Controlled input behavior
912
- * - Clearable selection
913
- * - Icon display toggle
914
- * - Click outside to close
915
- *
916
- * @example
917
- * ```tsx
918
- * const form = useForm({ initialValues: { appointment: '' } });
919
- *
920
- * <TimePicker
921
- * {...form.getFieldProps('appointment')}
922
- * placeholder="Select time"
923
- * minuteStep={15}
924
- * clearable
925
- * showIcon
926
- * error={!!form.errors.appointment}
927
- * />
928
- * ```
929
- *
930
- * @example
931
- * ```tsx
932
- * // With 24-hour format
933
- * <TimePicker
934
- * name="startTime"
935
- * value={startTime}
936
- * onChange={setStartTime}
937
- * use24Hour
938
- * minuteStep={30}
939
- * />
940
- * ```
899
+ * TimePicker - Accessible time input component using native time picker UX.
941
900
  *
942
- * @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.
943
903
  */
944
904
  declare function TimePicker({ name, value, onChange, onBlur, disabled, required, error, className, placeholder, use24Hour, minuteStep, clearable, showIcon, ...props }: TimePickerProps): React.JSX.Element;
945
905
  declare namespace TimePicker {