@hyddenlabs/hydn-ui 0.3.0-alpha.164 → 0.3.0-alpha.166

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/index.d.cts CHANGED
@@ -53,6 +53,14 @@ declare namespace ColorModeToggle {
53
53
  }
54
54
 
55
55
  type StatusColorProp = 'default' | 'primary' | 'success' | 'warning' | 'error';
56
+ declare const alignments: readonly ["left", "center", "right"];
57
+ type Alignment = (typeof alignments)[number];
58
+ /**
59
+ * HTML autocomplete attribute values for form inputs
60
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
61
+ */
62
+ declare const autocompleteOptions: readonly ["on", "off", "address-line1", "address-line2", "address-line3", "address-level1", "address-level2", "address-level3", "address-level4", "street-address", "country", "country-name", "postal-code", "name", "additional-name", "family-name", "given-name", "honoric-prefix", "honoric-suffix", "nickname", "organization-title", "username", "new-password", "current-password", "bday", "bday-day", "bday-month", "bday-year", "sex", "one-time-code", "organization", "cc-name", "cc-given-name", "cc-additional-name", "cc-family-name", "cc-number", "cc-exp", "cc-exp-month", "cc-exp-year", "cc-csc", "cc-type", "transaction-currency", "transaction-amount", "language", "url", "email", "photo", "tel", "tel-country-code", "tel-national", "tel-area-code", "tel-local", "tel-local-prefix", "tel-local-suffix", "tel-extension", "impp"];
63
+ type AutocompleteOption = (typeof autocompleteOptions)[number];
56
64
 
57
65
  /**
58
66
  * Unified Size System for hydn-ui
@@ -257,6 +265,7 @@ declare const inputWidthSizes: {
257
265
  readonly '1/2': "w-1/2";
258
266
  readonly '3/4': "w-3/4";
259
267
  readonly full: "w-full";
268
+ readonly auto: "w-auto";
260
269
  };
261
270
  type InputWidth = keyof typeof inputWidthSizes;
262
271
  declare const badgeSizes: {
@@ -1811,10 +1820,10 @@ type ButtonProps = {
1811
1820
  rounded?: 'default' | 'pill' | 'square' | 'circle';
1812
1821
  /** Shows loading spinner and disables interaction */
1813
1822
  loading?: boolean;
1814
- /** Expands button to fill container width */
1815
- fullWidth?: boolean;
1816
- /** Adds extra horizontal padding for emphasis */
1817
- wide?: boolean;
1823
+ /** Width of the button */
1824
+ width?: InputWidth;
1825
+ /** Aligns the button within its container: left, center, or right */
1826
+ align?: Alignment;
1818
1827
  /** Applies active/pressed state styling */
1819
1828
  active?: boolean;
1820
1829
  };
@@ -3350,16 +3359,8 @@ type FormProps = {
3350
3359
  id?: string;
3351
3360
  /** Accessible label for screen readers */
3352
3361
  ariaLabel?: string;
3353
- /** Layout direction for form fields */
3354
- direction?: 'horizontal' | 'vertical';
3355
- /** Gap spacing between form elements */
3356
- spacing?: FormSpacing | GapSize;
3357
- /** Cross-axis alignment */
3358
- align?: 'start' | 'center' | 'end' | 'stretch';
3359
- /** Main-axis alignment */
3360
- justify?: 'start' | 'center' | 'end' | 'between' | 'around';
3361
- /** Makes the form take full width */
3362
- fullWidth?: boolean;
3362
+ /** Spacing between form elements */
3363
+ spacing?: FormSpacing;
3363
3364
  };
3364
3365
  /**
3365
3366
  * Form - Semantic form wrapper with layout support
@@ -3377,7 +3378,7 @@ type FormProps = {
3377
3378
  * </Form>
3378
3379
  * ```
3379
3380
  */
3380
- declare function Form({ children, onSubmit, method, action, noValidate, id, ariaLabel, direction, spacing, align, justify, fullWidth }: Readonly<FormProps>): react_jsx_runtime.JSX.Element;
3381
+ declare function Form({ children, onSubmit, method, action, noValidate, id, ariaLabel, spacing }: Readonly<FormProps>): react_jsx_runtime.JSX.Element;
3381
3382
  declare namespace Form {
3382
3383
  var displayName: string;
3383
3384
  }
@@ -3399,6 +3400,12 @@ type FormFieldProps = {
3399
3400
  disabled?: boolean;
3400
3401
  /** HTML id for the input - auto-generated if not provided */
3401
3402
  id?: string;
3403
+ /** Width of the form field - uses semantic sizing */
3404
+ width?: InputWidth;
3405
+ /** Aligns the form field - left, center, or right */
3406
+ align?: Alignment;
3407
+ /** Reserve space for helper/error text to prevent layout shift */
3408
+ reserveMessageSpace?: boolean;
3402
3409
  };
3403
3410
  /**
3404
3411
  * FormField - Simple wrapper for form inputs with label and error display
@@ -3417,7 +3424,7 @@ type FormFieldProps = {
3417
3424
  * </FormField>
3418
3425
  * ```
3419
3426
  */
3420
- declare function FormField({ children, label, error, helperText, required, spacing, disabled, id: providedId }: Readonly<FormFieldProps>): react_jsx_runtime.JSX.Element;
3427
+ declare function FormField({ children, label, error, helperText, required, spacing, disabled, id: providedId, width, align, reserveMessageSpace }: Readonly<FormFieldProps>): react_jsx_runtime.JSX.Element;
3421
3428
  declare namespace FormField {
3422
3429
  var displayName: string;
3423
3430
  }
@@ -3456,7 +3463,7 @@ type InputProps = {
3456
3463
  /** Visual validation state affecting border color and styling */
3457
3464
  validationState?: ValidationState$2;
3458
3465
  /** HTML autocomplete attribute */
3459
- autoComplete?: string;
3466
+ autoComplete?: AutocompleteOption;
3460
3467
  /** Maximum length of input value */
3461
3468
  maxLength?: number;
3462
3469
  /** Minimum length of input value */
@@ -3497,6 +3504,10 @@ type FormInputProps = Omit<InputProps, 'validationState'> & {
3497
3504
  pattern?: string;
3498
3505
  /** Custom validation message */
3499
3506
  title?: string;
3507
+ /** Input alignment */
3508
+ align?: 'left' | 'center' | 'right';
3509
+ /** Reserve space for error message to prevent layout shift */
3510
+ reserveMessageSpace?: boolean;
3500
3511
  };
3501
3512
  /**
3502
3513
  * FormInput - Input wrapped with FormField for label and error display
@@ -3531,7 +3542,7 @@ type FormInputProps = Omit<InputProps, 'validationState'> & {
3531
3542
  * <FormInput label="Age" type="number" min={18} max={120} required />
3532
3543
  * ```
3533
3544
  */
3534
- declare function FormInput({ label, helperText, spacing, error, required, disabled, id, pattern, title, ...inputProps }: Readonly<FormInputProps>): react_jsx_runtime.JSX.Element;
3545
+ declare function FormInput({ label, helperText, spacing, error, required, disabled, id, pattern, title, width, align, reserveMessageSpace, ...inputProps }: Readonly<FormInputProps>): react_jsx_runtime.JSX.Element;
3535
3546
  declare namespace FormInput {
3536
3547
  var displayName: string;
3537
3548
  }
package/dist/index.d.ts CHANGED
@@ -53,6 +53,14 @@ declare namespace ColorModeToggle {
53
53
  }
54
54
 
55
55
  type StatusColorProp = 'default' | 'primary' | 'success' | 'warning' | 'error';
56
+ declare const alignments: readonly ["left", "center", "right"];
57
+ type Alignment = (typeof alignments)[number];
58
+ /**
59
+ * HTML autocomplete attribute values for form inputs
60
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
61
+ */
62
+ declare const autocompleteOptions: readonly ["on", "off", "address-line1", "address-line2", "address-line3", "address-level1", "address-level2", "address-level3", "address-level4", "street-address", "country", "country-name", "postal-code", "name", "additional-name", "family-name", "given-name", "honoric-prefix", "honoric-suffix", "nickname", "organization-title", "username", "new-password", "current-password", "bday", "bday-day", "bday-month", "bday-year", "sex", "one-time-code", "organization", "cc-name", "cc-given-name", "cc-additional-name", "cc-family-name", "cc-number", "cc-exp", "cc-exp-month", "cc-exp-year", "cc-csc", "cc-type", "transaction-currency", "transaction-amount", "language", "url", "email", "photo", "tel", "tel-country-code", "tel-national", "tel-area-code", "tel-local", "tel-local-prefix", "tel-local-suffix", "tel-extension", "impp"];
63
+ type AutocompleteOption = (typeof autocompleteOptions)[number];
56
64
 
57
65
  /**
58
66
  * Unified Size System for hydn-ui
@@ -257,6 +265,7 @@ declare const inputWidthSizes: {
257
265
  readonly '1/2': "w-1/2";
258
266
  readonly '3/4': "w-3/4";
259
267
  readonly full: "w-full";
268
+ readonly auto: "w-auto";
260
269
  };
261
270
  type InputWidth = keyof typeof inputWidthSizes;
262
271
  declare const badgeSizes: {
@@ -1811,10 +1820,10 @@ type ButtonProps = {
1811
1820
  rounded?: 'default' | 'pill' | 'square' | 'circle';
1812
1821
  /** Shows loading spinner and disables interaction */
1813
1822
  loading?: boolean;
1814
- /** Expands button to fill container width */
1815
- fullWidth?: boolean;
1816
- /** Adds extra horizontal padding for emphasis */
1817
- wide?: boolean;
1823
+ /** Width of the button */
1824
+ width?: InputWidth;
1825
+ /** Aligns the button within its container: left, center, or right */
1826
+ align?: Alignment;
1818
1827
  /** Applies active/pressed state styling */
1819
1828
  active?: boolean;
1820
1829
  };
@@ -3350,16 +3359,8 @@ type FormProps = {
3350
3359
  id?: string;
3351
3360
  /** Accessible label for screen readers */
3352
3361
  ariaLabel?: string;
3353
- /** Layout direction for form fields */
3354
- direction?: 'horizontal' | 'vertical';
3355
- /** Gap spacing between form elements */
3356
- spacing?: FormSpacing | GapSize;
3357
- /** Cross-axis alignment */
3358
- align?: 'start' | 'center' | 'end' | 'stretch';
3359
- /** Main-axis alignment */
3360
- justify?: 'start' | 'center' | 'end' | 'between' | 'around';
3361
- /** Makes the form take full width */
3362
- fullWidth?: boolean;
3362
+ /** Spacing between form elements */
3363
+ spacing?: FormSpacing;
3363
3364
  };
3364
3365
  /**
3365
3366
  * Form - Semantic form wrapper with layout support
@@ -3377,7 +3378,7 @@ type FormProps = {
3377
3378
  * </Form>
3378
3379
  * ```
3379
3380
  */
3380
- declare function Form({ children, onSubmit, method, action, noValidate, id, ariaLabel, direction, spacing, align, justify, fullWidth }: Readonly<FormProps>): react_jsx_runtime.JSX.Element;
3381
+ declare function Form({ children, onSubmit, method, action, noValidate, id, ariaLabel, spacing }: Readonly<FormProps>): react_jsx_runtime.JSX.Element;
3381
3382
  declare namespace Form {
3382
3383
  var displayName: string;
3383
3384
  }
@@ -3399,6 +3400,12 @@ type FormFieldProps = {
3399
3400
  disabled?: boolean;
3400
3401
  /** HTML id for the input - auto-generated if not provided */
3401
3402
  id?: string;
3403
+ /** Width of the form field - uses semantic sizing */
3404
+ width?: InputWidth;
3405
+ /** Aligns the form field - left, center, or right */
3406
+ align?: Alignment;
3407
+ /** Reserve space for helper/error text to prevent layout shift */
3408
+ reserveMessageSpace?: boolean;
3402
3409
  };
3403
3410
  /**
3404
3411
  * FormField - Simple wrapper for form inputs with label and error display
@@ -3417,7 +3424,7 @@ type FormFieldProps = {
3417
3424
  * </FormField>
3418
3425
  * ```
3419
3426
  */
3420
- declare function FormField({ children, label, error, helperText, required, spacing, disabled, id: providedId }: Readonly<FormFieldProps>): react_jsx_runtime.JSX.Element;
3427
+ declare function FormField({ children, label, error, helperText, required, spacing, disabled, id: providedId, width, align, reserveMessageSpace }: Readonly<FormFieldProps>): react_jsx_runtime.JSX.Element;
3421
3428
  declare namespace FormField {
3422
3429
  var displayName: string;
3423
3430
  }
@@ -3456,7 +3463,7 @@ type InputProps = {
3456
3463
  /** Visual validation state affecting border color and styling */
3457
3464
  validationState?: ValidationState$2;
3458
3465
  /** HTML autocomplete attribute */
3459
- autoComplete?: string;
3466
+ autoComplete?: AutocompleteOption;
3460
3467
  /** Maximum length of input value */
3461
3468
  maxLength?: number;
3462
3469
  /** Minimum length of input value */
@@ -3497,6 +3504,10 @@ type FormInputProps = Omit<InputProps, 'validationState'> & {
3497
3504
  pattern?: string;
3498
3505
  /** Custom validation message */
3499
3506
  title?: string;
3507
+ /** Input alignment */
3508
+ align?: 'left' | 'center' | 'right';
3509
+ /** Reserve space for error message to prevent layout shift */
3510
+ reserveMessageSpace?: boolean;
3500
3511
  };
3501
3512
  /**
3502
3513
  * FormInput - Input wrapped with FormField for label and error display
@@ -3531,7 +3542,7 @@ type FormInputProps = Omit<InputProps, 'validationState'> & {
3531
3542
  * <FormInput label="Age" type="number" min={18} max={120} required />
3532
3543
  * ```
3533
3544
  */
3534
- declare function FormInput({ label, helperText, spacing, error, required, disabled, id, pattern, title, ...inputProps }: Readonly<FormInputProps>): react_jsx_runtime.JSX.Element;
3545
+ declare function FormInput({ label, helperText, spacing, error, required, disabled, id, pattern, title, width, align, reserveMessageSpace, ...inputProps }: Readonly<FormInputProps>): react_jsx_runtime.JSX.Element;
3535
3546
  declare namespace FormInput {
3536
3547
  var displayName: string;
3537
3548
  }
package/dist/index.js CHANGED
@@ -237,6 +237,11 @@ var colorVariants = {
237
237
  error: "bg-destructive/20 text-foreground border-destructive/50 backdrop-blur-sm"
238
238
  }
239
239
  };
240
+ var inputAlignClasses = {
241
+ left: "mr-auto",
242
+ center: "mx-auto",
243
+ right: "ml-auto"
244
+ };
240
245
 
241
246
  // src/theme/size-tokens.ts
242
247
  var visualSizes = {
@@ -385,8 +390,10 @@ var inputWidthSizes = {
385
390
  // 50% of container
386
391
  "3/4": "w-3/4",
387
392
  // 75% of container
388
- full: "w-full"
393
+ full: "w-full",
389
394
  // 100% of container
395
+ auto: "w-auto"
396
+ // width based on content
390
397
  };
391
398
  var badgeSizes = {
392
399
  sm: {
@@ -980,7 +987,7 @@ function Container({
980
987
  minHeight = "none",
981
988
  maxHeight = "none"
982
989
  }) {
983
- const alignClasses3 = {
990
+ const alignClasses2 = {
984
991
  start: "mr-auto",
985
992
  center: "mx-auto",
986
993
  end: "ml-auto"
@@ -1000,7 +1007,7 @@ function Container({
1000
1007
  const minHeightClass = minHeight !== "none" ? containerMinHeights[minHeight] : "";
1001
1008
  const maxHeightClass = maxHeight !== "none" ? containerMaxHeights[maxHeight] : "";
1002
1009
  const dimensionClasses = [widthClass, heightClass, minWidthClass, minHeightClass, maxWidthClass, maxHeightClass].join(" ").trim();
1003
- const alignClass = mX === "none" || mX === "auto" ? alignClasses3[align] : "";
1010
+ const alignClass = mX === "none" || mX === "auto" ? alignClasses2[align] : "";
1004
1011
  const alignItemsClass = alignItems ? alignItemsClasses[alignItems] : "";
1005
1012
  const inlineStyles = {};
1006
1013
  if (minWidth && !containerMinWidths[minWidth]) {
@@ -1154,7 +1161,7 @@ function Text({
1154
1161
  bold: "font-bold",
1155
1162
  extrabold: "font-extrabold"
1156
1163
  };
1157
- const alignClasses3 = {
1164
+ const alignClasses2 = {
1158
1165
  left: "text-left",
1159
1166
  center: "text-center",
1160
1167
  right: "text-right",
@@ -1232,7 +1239,7 @@ function Text({
1232
1239
  sizeClasses[finalSize],
1233
1240
  weightClasses[weight],
1234
1241
  margin,
1235
- align && alignClasses3[align],
1242
+ align && alignClasses2[align],
1236
1243
  leading && leadingClasses[leading],
1237
1244
  tracking && trackingClasses[tracking],
1238
1245
  transform && transformClasses[transform],
@@ -1308,13 +1315,13 @@ function Stack({
1308
1315
  margin = "none"
1309
1316
  }) {
1310
1317
  const spacingClasses = gapSizes[spacing];
1311
- const alignClasses3 = {
1318
+ const alignClasses2 = {
1312
1319
  start: "items-start",
1313
1320
  center: "items-center",
1314
1321
  end: "items-end",
1315
1322
  stretch: "items-stretch"
1316
1323
  };
1317
- const justifyClasses3 = {
1324
+ const justifyClasses2 = {
1318
1325
  start: "justify-start",
1319
1326
  center: "justify-center",
1320
1327
  end: "justify-end",
@@ -1322,7 +1329,7 @@ function Stack({
1322
1329
  around: "justify-around"
1323
1330
  };
1324
1331
  const directionClass = direction === "horizontal" ? "flex-row" : "flex-col";
1325
- const justifyClass = justify ? justifyClasses3[justify] : "";
1332
+ const justifyClass = justify ? justifyClasses2[justify] : "";
1326
1333
  const paddingClass = padding ? cardPadding[padding] : "";
1327
1334
  const marginClass = margin ? cardMargin[margin] : "";
1328
1335
  const minWidthClass = minWidth !== "none" ? containerMinWidths[minWidth] : "";
@@ -1333,7 +1340,7 @@ function Stack({
1333
1340
  "div",
1334
1341
  {
1335
1342
  "data-component": "Stack",
1336
- className: `flex flex-wrap ${directionClass} ${spacingClasses} ${alignClasses3[align]} ${justifyClass} ${paddingClass} ${minWidthClass} ${maxWidthClass} ${widthClass} ${heightClass} ${marginClass} ${className}`,
1343
+ className: `flex flex-wrap ${directionClass} ${spacingClasses} ${alignClasses2[align]} ${justifyClass} ${paddingClass} ${minWidthClass} ${maxWidthClass} ${widthClass} ${heightClass} ${marginClass} ${className}`,
1337
1344
  children
1338
1345
  }
1339
1346
  );
@@ -1735,7 +1742,7 @@ function CardFooter({
1735
1742
  md: "p-6",
1736
1743
  lg: "p-8"
1737
1744
  };
1738
- const alignClasses3 = {
1745
+ const alignClasses2 = {
1739
1746
  start: "justify-start",
1740
1747
  center: "justify-center",
1741
1748
  end: "justify-end"
@@ -1748,7 +1755,7 @@ function CardFooter({
1748
1755
  flex items-center gap-1
1749
1756
  ${paddingClasses[padding]}
1750
1757
  ${bordered ? "border-t border-border" : ""}
1751
- ${alignClasses3[align]}
1758
+ ${alignClasses2[align]}
1752
1759
  ${className}
1753
1760
  `.trim().replace(/\s+/g, " "),
1754
1761
  children
@@ -1758,7 +1765,7 @@ function CardFooter({
1758
1765
  CardFooter.displayName = "CardFooter";
1759
1766
  var card_footer_default = CardFooter;
1760
1767
  function CardActions({ children, className = "", align = "end", direction = "row" }) {
1761
- const alignClasses3 = {
1768
+ const alignClasses2 = {
1762
1769
  start: "justify-start",
1763
1770
  center: "justify-center",
1764
1771
  end: "justify-end",
@@ -1774,7 +1781,7 @@ function CardActions({ children, className = "", align = "end", direction = "row
1774
1781
  className: `
1775
1782
  flex gap-2 px-6 pb-6 pt-2
1776
1783
  ${directionClasses[direction]}
1777
- ${alignClasses3[align]}
1784
+ ${alignClasses2[align]}
1778
1785
  ${className}
1779
1786
  `.trim().replace(/\s+/g, " "),
1780
1787
  children
@@ -2240,8 +2247,8 @@ var Button = React4.forwardRef(
2240
2247
  size = "md",
2241
2248
  rounded = "default",
2242
2249
  loading = false,
2243
- fullWidth = false,
2244
- wide = false,
2250
+ width = "auto",
2251
+ align,
2245
2252
  active = false
2246
2253
  }, ref) => {
2247
2254
  const isIconOnly = icon && !children;
@@ -2284,7 +2291,8 @@ var Button = React4.forwardRef(
2284
2291
  )
2285
2292
  ] }) : icon;
2286
2293
  const styleClasses = getStyleClasses();
2287
- const widthClasses = fullWidth ? "w-full" : wide ? "px-8" : "";
2294
+ const widthClasses = inputWidthSizes[width];
2295
+ const alignmentClass = align ? inputAlignClasses[align] : "";
2288
2296
  const activeClasses = active ? "active:scale-95" : "";
2289
2297
  return /* @__PURE__ */ jsxs(
2290
2298
  "button",
@@ -2294,7 +2302,7 @@ var Button = React4.forwardRef(
2294
2302
  onClick,
2295
2303
  "aria-label": ariaLabel,
2296
2304
  disabled: disabled || loading,
2297
- className: `inline-flex items-center justify-center ${roundedClasses[rounded]} font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 ${styleClasses} ${sizeClasses} ${isIconOnly ? "p-0" : ""} ${widthClasses} ${activeClasses} ${className}`,
2305
+ className: `inline-flex items-center justify-center ${alignmentClass} ${roundedClasses[rounded]} font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 ${styleClasses} ${sizeClasses} ${isIconOnly ? "p-0" : ""} ${widthClasses} ${activeClasses} ${className}`,
2298
2306
  children: [
2299
2307
  displayIcon && iconPosition === "left" && /* @__PURE__ */ jsx("span", { className: `inline-flex ${children ? "mr-2" : ""}`, children: displayIcon }),
2300
2308
  children,
@@ -2777,7 +2785,7 @@ function Nav({
2777
2785
  lg: "gap-7 sm:gap-6",
2778
2786
  xl: "gap-10 sm:gap-8"
2779
2787
  };
2780
- const alignClasses3 = {
2788
+ const alignClasses2 = {
2781
2789
  start: "items-start",
2782
2790
  center: "items-center",
2783
2791
  end: "items-end",
@@ -2785,7 +2793,7 @@ function Nav({
2785
2793
  };
2786
2794
  const directionClass = direction === "horizontal" ? "flex-row" : "flex-col";
2787
2795
  const spacingClass = spacingClasses[spacing];
2788
- const alignClass = alignClasses3[align];
2796
+ const alignClass = alignClasses2[align];
2789
2797
  return /* @__PURE__ */ jsx("nav", { "aria-label": ariaLabel, className: `flex ${directionClass} ${spacingClass} ${alignClass} ${className}`, children });
2790
2798
  }
2791
2799
  Nav.displayName = "Nav";
@@ -3474,20 +3482,20 @@ function TableHeadCell({
3474
3482
  scope = "col",
3475
3483
  ...props
3476
3484
  }) {
3477
- const alignClasses3 = {
3485
+ const alignClasses2 = {
3478
3486
  left: "text-left",
3479
3487
  center: "text-center",
3480
3488
  right: "text-right"
3481
3489
  };
3482
- return /* @__PURE__ */ jsx("th", { scope, className: `px-6 py-3 font-medium ${alignClasses3[align]} ${className}`, ...props, children });
3490
+ return /* @__PURE__ */ jsx("th", { scope, className: `px-6 py-3 font-medium ${alignClasses2[align]} ${className}`, ...props, children });
3483
3491
  }
3484
3492
  function TableCell({ children, className = "", align = "left", ...props }) {
3485
- const alignClasses3 = {
3493
+ const alignClasses2 = {
3486
3494
  left: "text-left",
3487
3495
  center: "text-center",
3488
3496
  right: "text-right"
3489
3497
  };
3490
- return /* @__PURE__ */ jsx("td", { className: `px-6 py-4 whitespace-nowrap ${alignClasses3[align]} ${className}`, ...props, children });
3498
+ return /* @__PURE__ */ jsx("td", { className: `px-6 py-4 whitespace-nowrap ${alignClasses2[align]} ${className}`, ...props, children });
3491
3499
  }
3492
3500
  var table_default = Table;
3493
3501
  function Checkbox({
@@ -4817,19 +4825,6 @@ function Fieldset({
4817
4825
  }
4818
4826
  Fieldset.displayName = "Fieldset";
4819
4827
  var fieldset_default = Fieldset;
4820
- var alignClasses2 = {
4821
- start: "items-start",
4822
- center: "items-center",
4823
- end: "items-end",
4824
- stretch: "items-stretch"
4825
- };
4826
- var justifyClasses2 = {
4827
- start: "justify-start",
4828
- center: "justify-center",
4829
- end: "justify-end",
4830
- between: "justify-between",
4831
- around: "justify-around"
4832
- };
4833
4828
  function Form({
4834
4829
  children,
4835
4830
  onSubmit,
@@ -4838,11 +4833,7 @@ function Form({
4838
4833
  noValidate = false,
4839
4834
  id,
4840
4835
  ariaLabel,
4841
- direction = "vertical",
4842
- spacing = "md",
4843
- align = "stretch",
4844
- justify,
4845
- fullWidth = true
4836
+ spacing = "md"
4846
4837
  }) {
4847
4838
  const handleSubmit = (e) => {
4848
4839
  if (onSubmit) {
@@ -4850,17 +4841,6 @@ function Form({
4850
4841
  onSubmit(e);
4851
4842
  }
4852
4843
  };
4853
- let spacingClass;
4854
- if (spacing in formSpacing) {
4855
- spacingClass = formSpacing[spacing];
4856
- } else if (spacing in gapSizes) {
4857
- spacingClass = gapSizes[spacing];
4858
- } else {
4859
- spacingClass = formSpacing["md"];
4860
- }
4861
- const directionClass = direction === "horizontal" ? "flex-row flex-wrap" : "flex-col";
4862
- const justifyClass = justify ? justifyClasses2[justify] : "";
4863
- const widthClass = fullWidth ? "w-full" : "";
4864
4844
  return /* @__PURE__ */ jsx(
4865
4845
  "form",
4866
4846
  {
@@ -4870,7 +4850,7 @@ function Form({
4870
4850
  noValidate,
4871
4851
  id,
4872
4852
  "aria-label": ariaLabel,
4873
- className: `flex ${directionClass} ${spacingClass} ${alignClasses2[align]} ${justifyClass} ${widthClass}`.trim(),
4853
+ className: `flex flex-col ${formSpacing[spacing]}`,
4874
4854
  children
4875
4855
  }
4876
4856
  );
@@ -4885,7 +4865,10 @@ function FormField({
4885
4865
  required = false,
4886
4866
  spacing = "sm",
4887
4867
  disabled = false,
4888
- id: providedId
4868
+ id: providedId,
4869
+ width = "full",
4870
+ align = "center",
4871
+ reserveMessageSpace = false
4889
4872
  }) {
4890
4873
  const autoId = useId();
4891
4874
  const inputId = providedId ?? autoId;
@@ -4900,18 +4883,22 @@ function FormField({
4900
4883
  ...hasMessage ? { "aria-describedby": `${inputId}-message` } : {}
4901
4884
  }
4902
4885
  ) : children;
4903
- return /* @__PURE__ */ jsxs("div", { className: `flex flex-col ${formSpacing[spacing]}`, children: [
4886
+ const widthClass = inputWidthSizes[width];
4887
+ const alignmentClass = inputAlignClasses[align];
4888
+ const shouldReserveSpace = reserveMessageSpace && !helperText;
4889
+ return /* @__PURE__ */ jsxs("div", { className: `flex flex-col ${widthClass} ${alignmentClass} ${formSpacing[spacing]}`, children: [
4904
4890
  label && /* @__PURE__ */ jsxs("label", { htmlFor: inputId, className: "text-sm font-semibold text-foreground", children: [
4905
4891
  label,
4906
4892
  required && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
4907
4893
  ] }),
4908
4894
  enhancedChild,
4909
- (error || helperText) && /* @__PURE__ */ jsx(
4895
+ (helperText || error || shouldReserveSpace) && /* @__PURE__ */ jsx(
4910
4896
  "p",
4911
4897
  {
4912
4898
  id: `${inputId}-message`,
4913
4899
  className: `text-sm ${error ? validationTextClasses.error : validationTextClasses.default}`,
4914
- children: error || helperText
4900
+ "aria-live": "polite",
4901
+ children: error || helperText || "\xA0"
4915
4902
  }
4916
4903
  )
4917
4904
  ] });
@@ -4984,7 +4971,9 @@ function FormInput({
4984
4971
  id,
4985
4972
  pattern,
4986
4973
  title,
4987
- // Input props
4974
+ width,
4975
+ align = "center",
4976
+ reserveMessageSpace = false,
4988
4977
  ...inputProps
4989
4978
  }) {
4990
4979
  return /* @__PURE__ */ jsx(
@@ -4997,6 +4986,9 @@ function FormInput({
4997
4986
  required,
4998
4987
  disabled,
4999
4988
  id,
4989
+ width,
4990
+ align,
4991
+ reserveMessageSpace,
5000
4992
  children: /* @__PURE__ */ jsx(input_default, { ...inputProps, required, disabled, id, pattern, title })
5001
4993
  }
5002
4994
  );