@brycks/core-front 0.3.5 → 0.5.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.
Files changed (168) hide show
  1. package/dist/components/data/List/List.cjs +1 -1
  2. package/dist/components/data/List/List.cjs.map +1 -1
  3. package/dist/components/data/List/List.js +1 -1
  4. package/dist/components/data/List/List.js.map +1 -1
  5. package/dist/components/data/Table/Table.cjs +1 -1
  6. package/dist/components/data/Table/Table.cjs.map +1 -1
  7. package/dist/components/data/Table/Table.js +196 -166
  8. package/dist/components/data/Table/Table.js.map +1 -1
  9. package/dist/components/data/TreeView/TreeView.cjs +1 -1
  10. package/dist/components/data/TreeView/TreeView.cjs.map +1 -1
  11. package/dist/components/data/TreeView/TreeView.js +1 -1
  12. package/dist/components/data/TreeView/TreeView.js.map +1 -1
  13. package/dist/components/data.cjs +1 -1
  14. package/dist/components/data.js +23 -21
  15. package/dist/components/feedback/Alert/Alert.cjs +1 -1
  16. package/dist/components/feedback/Alert/Alert.cjs.map +1 -1
  17. package/dist/components/feedback/Alert/Alert.js +20 -19
  18. package/dist/components/feedback/Alert/Alert.js.map +1 -1
  19. package/dist/components/feedback/Banner/Banner.cjs +2 -0
  20. package/dist/components/feedback/Banner/Banner.cjs.map +1 -0
  21. package/dist/components/feedback/Banner/Banner.js +77 -0
  22. package/dist/components/feedback/Banner/Banner.js.map +1 -0
  23. package/dist/components/feedback/ConfirmDialog/ConfirmDialog.cjs +2 -0
  24. package/dist/components/feedback/ConfirmDialog/ConfirmDialog.cjs.map +1 -0
  25. package/dist/components/feedback/ConfirmDialog/ConfirmDialog.js +68 -0
  26. package/dist/components/feedback/ConfirmDialog/ConfirmDialog.js.map +1 -0
  27. package/dist/components/feedback/Drawer/Drawer.cjs +2 -2
  28. package/dist/components/feedback/Drawer/Drawer.cjs.map +1 -1
  29. package/dist/components/feedback/Drawer/Drawer.js +58 -57
  30. package/dist/components/feedback/Drawer/Drawer.js.map +1 -1
  31. package/dist/components/feedback/Modal/Modal.cjs +1 -1
  32. package/dist/components/feedback/Modal/Modal.cjs.map +1 -1
  33. package/dist/components/feedback/Modal/Modal.js +101 -91
  34. package/dist/components/feedback/Modal/Modal.js.map +1 -1
  35. package/dist/components/feedback/Popover/Popover.cjs +2 -2
  36. package/dist/components/feedback/Popover/Popover.cjs.map +1 -1
  37. package/dist/components/feedback/Popover/Popover.js +93 -85
  38. package/dist/components/feedback/Popover/Popover.js.map +1 -1
  39. package/dist/components/feedback/Toast/Toast.cjs +2 -2
  40. package/dist/components/feedback/Toast/Toast.cjs.map +1 -1
  41. package/dist/components/feedback/Toast/Toast.js +102 -93
  42. package/dist/components/feedback/Toast/Toast.js.map +1 -1
  43. package/dist/components/feedback.cjs +1 -1
  44. package/dist/components/feedback.js +17 -13
  45. package/dist/components/feedback.js.map +1 -1
  46. package/dist/components/form/Combobox/Combobox.cjs +2 -2
  47. package/dist/components/form/Combobox/Combobox.cjs.map +1 -1
  48. package/dist/components/form/Combobox/Combobox.js +187 -167
  49. package/dist/components/form/Combobox/Combobox.js.map +1 -1
  50. package/dist/components/form/DateInput/DateInput.cjs +1 -1
  51. package/dist/components/form/DateInput/DateInput.cjs.map +1 -1
  52. package/dist/components/form/DateInput/DateInput.js +2 -2
  53. package/dist/components/form/DateInput/DateInput.js.map +1 -1
  54. package/dist/components/form/DateRangePicker/DateRangePicker.cjs +1 -1
  55. package/dist/components/form/DateRangePicker/DateRangePicker.cjs.map +1 -1
  56. package/dist/components/form/DateRangePicker/DateRangePicker.js +34 -34
  57. package/dist/components/form/DateRangePicker/DateRangePicker.js.map +1 -1
  58. package/dist/components/form/DropZone/DropZone.cjs +1 -1
  59. package/dist/components/form/DropZone/DropZone.cjs.map +1 -1
  60. package/dist/components/form/DropZone/DropZone.js +10 -10
  61. package/dist/components/form/DropZone/DropZone.js.map +1 -1
  62. package/dist/components/form/FileInput/FileInput.cjs +1 -1
  63. package/dist/components/form/FileInput/FileInput.cjs.map +1 -1
  64. package/dist/components/form/FileInput/FileInput.js +1 -1
  65. package/dist/components/form/FileInput/FileInput.js.map +1 -1
  66. package/dist/components/form/FormCard/FormCard.cjs +1 -1
  67. package/dist/components/form/FormCard/FormCard.cjs.map +1 -1
  68. package/dist/components/form/FormCard/FormCard.js +9 -9
  69. package/dist/components/form/FormCard/FormCard.js.map +1 -1
  70. package/dist/components/form/FormField/FormField.cjs +1 -1
  71. package/dist/components/form/FormField/FormField.cjs.map +1 -1
  72. package/dist/components/form/FormField/FormField.js +67 -55
  73. package/dist/components/form/FormField/FormField.js.map +1 -1
  74. package/dist/components/form/MultiSelect/MultiSelect.cjs +1 -1
  75. package/dist/components/form/MultiSelect/MultiSelect.cjs.map +1 -1
  76. package/dist/components/form/MultiSelect/MultiSelect.js +2 -3
  77. package/dist/components/form/MultiSelect/MultiSelect.js.map +1 -1
  78. package/dist/components/form/Radio/Radio.cjs +1 -1
  79. package/dist/components/form/Radio/Radio.cjs.map +1 -1
  80. package/dist/components/form/Radio/Radio.js +20 -20
  81. package/dist/components/form/Radio/Radio.js.map +1 -1
  82. package/dist/components/form/SearchInput/SearchInput.cjs +2 -0
  83. package/dist/components/form/SearchInput/SearchInput.cjs.map +1 -0
  84. package/dist/components/form/SearchInput/SearchInput.js +68 -0
  85. package/dist/components/form/SearchInput/SearchInput.js.map +1 -0
  86. package/dist/components/form/TagInput/TagInput.cjs +1 -1
  87. package/dist/components/form/TagInput/TagInput.cjs.map +1 -1
  88. package/dist/components/form/TagInput/TagInput.js +104 -102
  89. package/dist/components/form/TagInput/TagInput.js.map +1 -1
  90. package/dist/components/form/TimePicker/TimePicker.cjs +1 -1
  91. package/dist/components/form/TimePicker/TimePicker.cjs.map +1 -1
  92. package/dist/components/form/TimePicker/TimePicker.js +29 -30
  93. package/dist/components/form/TimePicker/TimePicker.js.map +1 -1
  94. package/dist/components/form.cjs +1 -1
  95. package/dist/components/form.js +15 -13
  96. package/dist/components/form.js.map +1 -1
  97. package/dist/components/layout/Card/Card.cjs +1 -1
  98. package/dist/components/layout/Card/Card.cjs.map +1 -1
  99. package/dist/components/layout/Card/Card.js +7 -5
  100. package/dist/components/layout/Card/Card.js.map +1 -1
  101. package/dist/components/layout/Collapse/Collapse.cjs.map +1 -1
  102. package/dist/components/layout/Collapse/Collapse.js.map +1 -1
  103. package/dist/components/media/Image/Image.cjs +1 -1
  104. package/dist/components/media/Image/Image.cjs.map +1 -1
  105. package/dist/components/media/Image/Image.js +9 -9
  106. package/dist/components/media/Image/Image.js.map +1 -1
  107. package/dist/components/media/ImageThumbnail/ImageThumbnail.cjs +1 -1
  108. package/dist/components/media/ImageThumbnail/ImageThumbnail.cjs.map +1 -1
  109. package/dist/components/media/ImageThumbnail/ImageThumbnail.js +6 -6
  110. package/dist/components/media/ImageThumbnail/ImageThumbnail.js.map +1 -1
  111. package/dist/components/navigation/Accordion/Accordion.cjs +1 -1
  112. package/dist/components/navigation/Accordion/Accordion.cjs.map +1 -1
  113. package/dist/components/navigation/Accordion/Accordion.js +0 -1
  114. package/dist/components/navigation/Accordion/Accordion.js.map +1 -1
  115. package/dist/components/navigation/Menu/Menu.cjs +1 -1
  116. package/dist/components/navigation/Menu/Menu.cjs.map +1 -1
  117. package/dist/components/navigation/Menu/Menu.js +87 -86
  118. package/dist/components/navigation/Menu/Menu.js.map +1 -1
  119. package/dist/components/navigation/Pagination/Pagination.cjs +1 -1
  120. package/dist/components/navigation/Pagination/Pagination.cjs.map +1 -1
  121. package/dist/components/navigation/Pagination/Pagination.js +107 -99
  122. package/dist/components/navigation/Pagination/Pagination.js.map +1 -1
  123. package/dist/components/navigation/SegmentedControl/SegmentedControl.cjs +2 -0
  124. package/dist/components/navigation/SegmentedControl/SegmentedControl.cjs.map +1 -0
  125. package/dist/components/navigation/SegmentedControl/SegmentedControl.js +90 -0
  126. package/dist/components/navigation/SegmentedControl/SegmentedControl.js.map +1 -0
  127. package/dist/components/navigation.cjs +1 -1
  128. package/dist/components/navigation.js +25 -23
  129. package/dist/components/navigation.js.map +1 -1
  130. package/dist/components/utility/Avatar/Avatar.cjs +1 -1
  131. package/dist/components/utility/Avatar/Avatar.cjs.map +1 -1
  132. package/dist/components/utility/Avatar/Avatar.js +18 -18
  133. package/dist/components/utility/Avatar/Avatar.js.map +1 -1
  134. package/dist/components/utility/Badge/Badge.cjs +1 -1
  135. package/dist/components/utility/Badge/Badge.cjs.map +1 -1
  136. package/dist/components/utility/Badge/Badge.js +31 -23
  137. package/dist/components/utility/Badge/Badge.js.map +1 -1
  138. package/dist/components/utility/Kbd/Kbd.cjs +2 -0
  139. package/dist/components/utility/Kbd/Kbd.cjs.map +1 -0
  140. package/dist/components/utility/Kbd/Kbd.js +20 -0
  141. package/dist/components/utility/Kbd/Kbd.js.map +1 -0
  142. package/dist/components/utility/Logo/Logo.cjs +1 -1
  143. package/dist/components/utility/Logo/Logo.cjs.map +1 -1
  144. package/dist/components/utility/Logo/Logo.js +21 -21
  145. package/dist/components/utility/Logo/Logo.js.map +1 -1
  146. package/dist/components/utility.cjs +1 -1
  147. package/dist/components/utility.js +9 -7
  148. package/dist/components/utility.js.map +1 -1
  149. package/dist/data.d.ts +34 -1
  150. package/dist/design-system/themes/ThemeProvider.cjs +1 -1
  151. package/dist/design-system/themes/ThemeProvider.cjs.map +1 -1
  152. package/dist/design-system/themes/ThemeProvider.js +46 -46
  153. package/dist/design-system/themes/ThemeProvider.js.map +1 -1
  154. package/dist/design-system/tokens/zIndex.cjs +1 -1
  155. package/dist/design-system/tokens/zIndex.cjs.map +1 -1
  156. package/dist/design-system/tokens/zIndex.js +2 -0
  157. package/dist/design-system/tokens/zIndex.js.map +1 -1
  158. package/dist/feedback.d.ts +75 -2
  159. package/dist/form.d.ts +41 -0
  160. package/dist/index.cjs +1 -1
  161. package/dist/index.d.ts +213 -3
  162. package/dist/index.js +177 -165
  163. package/dist/index.js.map +1 -1
  164. package/dist/navigation.d.ts +58 -0
  165. package/dist/styles.css +1 -1
  166. package/dist/tokens.d.ts +2 -0
  167. package/dist/utility.d.ts +19 -0
  168. package/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"FileInput.cjs","sources":["../../../../src/components/form/FileInput/FileInput.tsx"],"sourcesContent":["/**\n * FileInput Component\n *\n * Accessible file upload input with drag-and-drop support.\n * Supports multiple files and file type restrictions.\n */\n\nimport {\n forwardRef,\n useState,\n useRef,\n useCallback,\n type CSSProperties,\n type InputHTMLAttributes,\n type DragEvent,\n type ReactNode,\n} from 'react'\nimport { cx } from '../../../utils/styles'\n\nexport type FileInputSize = 'sm' | 'md' | 'lg'\nexport type FileInputVariant = 'default' | 'dropzone'\n\nexport interface FileInputProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'onChange' | 'value'> {\n /** Input size */\n size?: FileInputSize\n /** Input variant */\n variant?: FileInputVariant\n /** Accepted file types (e.g., \"image/*,.pdf\") */\n accept?: string\n /** Whether multiple files can be selected */\n multiple?: boolean\n /** Maximum file size in bytes */\n maxSize?: number\n /** Label text */\n label?: ReactNode\n /** Description text inside dropzone */\n description?: ReactNode\n /** Error message */\n error?: ReactNode\n /** Whether the input is invalid */\n isInvalid?: boolean\n /** Callback when files are selected */\n onChange?: (files: File[]) => void\n /** Icon to display in dropzone */\n icon?: ReactNode\n /** Custom class name */\n className?: string\n /** Test ID */\n testId?: string\n}\n\nconst sizeConfig: Record<FileInputSize, { height: number; fontSize: number; padding: number; iconSize: number }> = {\n sm: { height: 80, fontSize: 12, padding: 16, iconSize: 24 },\n md: { height: 120, fontSize: 14, padding: 24, iconSize: 32 },\n lg: { height: 160, fontSize: 16, padding: 32, iconSize: 40 },\n}\n\nfunction UploadIcon({ size }: { size: number }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12\" />\n </svg>\n )\n}\n\nexport const FileInput = forwardRef<HTMLInputElement, FileInputProps>(function FileInput(\n {\n size = 'md',\n variant = 'dropzone',\n accept,\n multiple = false,\n maxSize,\n label,\n description,\n error,\n isInvalid = false,\n onChange,\n icon,\n disabled = false,\n className,\n style,\n testId,\n ...props\n },\n ref\n) {\n const [isDragOver, setIsDragOver] = useState(false)\n const [isFocused, setIsFocused] = useState(false)\n const inputRef = useRef<HTMLInputElement>(null)\n const config = sizeConfig[size]\n const hasError = isInvalid || !!error\n\n const handleFiles = useCallback(\n (fileList: FileList | null) => {\n if (!fileList || fileList.length === 0) return\n\n let files = Array.from(fileList)\n\n // Filter by max size if specified\n if (maxSize) {\n files = files.filter((file) => file.size <= maxSize)\n }\n\n // If not multiple, only take first file\n if (!multiple && files.length > 1) {\n files = [files[0]]\n }\n\n onChange?.(files)\n },\n [maxSize, multiple, onChange]\n )\n\n const handleDragOver = useCallback((e: DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n if (!disabled) {\n setIsDragOver(true)\n }\n }, [disabled])\n\n const handleDragLeave = useCallback((e: DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n setIsDragOver(false)\n }, [])\n\n const handleDrop = useCallback(\n (e: DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n setIsDragOver(false)\n\n if (!disabled) {\n handleFiles(e.dataTransfer.files)\n }\n },\n [disabled, handleFiles]\n )\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n handleFiles(e.target.files)\n // Reset input value to allow selecting the same file again\n if (inputRef.current) {\n inputRef.current.value = ''\n }\n },\n [handleFiles]\n )\n\n const handleClick = useCallback(() => {\n if (!disabled) {\n inputRef.current?.click()\n }\n }, [disabled])\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if ((e.key === 'Enter' || e.key === ' ') && !disabled) {\n e.preventDefault()\n inputRef.current?.click()\n }\n },\n [disabled]\n )\n\n const containerStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: 6,\n ...style,\n }\n\n const labelStyle: CSSProperties = {\n fontSize: config.fontSize,\n fontWeight: 500,\n color: 'var(--brycks-foreground-default)',\n }\n\n const dropzoneStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 8,\n minHeight: config.height,\n padding: config.padding,\n border: `2px dashed ${\n hasError\n ? 'var(--brycks-error-default)'\n : isDragOver\n ? 'var(--brycks-primary-default)'\n : isFocused\n ? 'var(--brycks-primary-default)'\n : 'var(--brycks-border-default)'\n }`,\n borderRadius: 'var(--brycks-radius-lg)',\n backgroundColor: isDragOver\n ? 'var(--brycks-primary-50)'\n : 'var(--brycks-background-muted)',\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.5 : 1,\n transition: 'all 150ms ease-out',\n outline: 'none',\n }\n\n const iconContainerStyle: CSSProperties = {\n color: isDragOver\n ? 'var(--brycks-primary-default)'\n : 'var(--brycks-foreground-muted)',\n transition: 'color 150ms ease-out',\n }\n\n const textContainerStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n gap: 4,\n textAlign: 'center',\n }\n\n const primaryTextStyle: CSSProperties = {\n fontSize: config.fontSize,\n fontWeight: 500,\n color: 'var(--brycks-foreground-default)',\n }\n\n const secondaryTextStyle: CSSProperties = {\n fontSize: config.fontSize - 2,\n color: 'var(--brycks-foreground-muted)',\n }\n\n const browseStyle: CSSProperties = {\n color: 'var(--brycks-primary-default)',\n fontWeight: 500,\n }\n\n const errorStyle: CSSProperties = {\n fontSize: config.fontSize - 2,\n color: 'var(--brycks-error-default)',\n }\n\n const defaultDescription = multiple\n ? 'Drag files here or click to browse'\n : 'Drag a file here or click to browse'\n\n return (\n <div\n className={cx('brycks-file-input', `brycks-file-input--${size}`, `brycks-file-input--${variant}`, className)}\n style={containerStyle}\n >\n {label && <label style={labelStyle}>{label}</label>}\n <div\n style={dropzoneStyle}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n tabIndex={disabled ? -1 : 0}\n role=\"button\"\n aria-label={String(description) || defaultDescription}\n >\n <div style={iconContainerStyle}>\n {icon || <UploadIcon size={config.iconSize} />}\n </div>\n <div style={textContainerStyle}>\n <span style={primaryTextStyle}>\n {isDragOver ? 'Drop files here' : (\n <>\n <span style={browseStyle}>Click to browse</span> or drag files here\n </>\n )}\n </span>\n {description && <span style={secondaryTextStyle}>{description}</span>}\n </div>\n </div>\n {error && <span style={errorStyle}>{error}</span>}\n <input\n ref={(node) => {\n (inputRef as React.MutableRefObject<HTMLInputElement | null>).current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n }}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n disabled={disabled}\n onChange={handleChange}\n style={{ display: 'none' }}\n data-testid={testId}\n {...props}\n />\n </div>\n )\n})\n\nFileInput.displayName = 'FileInput'\n"],"names":["sizeConfig","UploadIcon","size","jsx","FileInput","forwardRef","variant","accept","multiple","maxSize","label","description","error","isInvalid","onChange","icon","disabled","className","style","testId","props","ref","isDragOver","setIsDragOver","useState","isFocused","setIsFocused","inputRef","useRef","config","hasError","handleFiles","useCallback","fileList","files","file","handleDragOver","handleDragLeave","handleDrop","handleChange","handleClick","handleKeyDown","containerStyle","labelStyle","dropzoneStyle","iconContainerStyle","textContainerStyle","primaryTextStyle","secondaryTextStyle","browseStyle","errorStyle","defaultDescription","jsxs","cx","Fragment","node"],"mappings":"+KAoDMA,EAA6G,CACjH,GAAI,CAAE,OAAQ,GAAI,SAAU,GAAI,QAAS,GAAI,SAAU,EAAA,EACvD,GAAI,CAAE,OAAQ,IAAK,SAAU,GAAI,QAAS,GAAI,SAAU,EAAA,EACxD,GAAI,CAAE,OAAQ,IAAK,SAAU,GAAI,QAAS,GAAI,SAA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tC,EAAM,EAC1CT,EAAAA,IAAC,QAAA,CACC,IAAMoD,GAAS,CACZ5B,EAA6D,QAAU4B,EACpE,OAAOlC,GAAQ,WAAYA,EAAIkC,CAAI,EAC9BlC,MAAS,QAAUkC,EAC9B,EACA,KAAK,OACL,OAAAhD,EACA,SAAAC,EACA,SAAAQ,EACA,SAAUuB,EACV,MAAO,CAAE,QAAS,MAAA,EAClB,cAAapB,EACZ,GAAGC,CAAA,CAAA,CACN,CAAA,CAAA,CAGN,CAAC,EAEDhB,EAAU,YAAc"}
1
+ {"version":3,"file":"FileInput.cjs","sources":["../../../../src/components/form/FileInput/FileInput.tsx"],"sourcesContent":["/**\n * FileInput Component\n *\n * Accessible file upload input with drag-and-drop support.\n * Supports multiple files and file type restrictions.\n */\n\nimport {\n forwardRef,\n useState,\n useRef,\n useCallback,\n type CSSProperties,\n type InputHTMLAttributes,\n type DragEvent,\n type ReactNode,\n} from 'react'\nimport { cx } from '../../../utils/styles'\n\nexport type FileInputSize = 'sm' | 'md' | 'lg'\nexport type FileInputVariant = 'default' | 'dropzone'\n\nexport interface FileInputProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'onChange' | 'value'> {\n /** Input size */\n size?: FileInputSize\n /** Input variant */\n variant?: FileInputVariant\n /** Accepted file types (e.g., \"image/*,.pdf\") */\n accept?: string\n /** Whether multiple files can be selected */\n multiple?: boolean\n /** Maximum file size in bytes */\n maxSize?: number\n /** Label text */\n label?: ReactNode\n /** Description text inside dropzone */\n description?: ReactNode\n /** Error message */\n error?: ReactNode\n /** Whether the input is invalid */\n isInvalid?: boolean\n /** Callback when files are selected */\n onChange?: (files: File[]) => void\n /** Icon to display in dropzone */\n icon?: ReactNode\n /** Custom class name */\n className?: string\n /** Test ID */\n testId?: string\n}\n\nconst sizeConfig: Record<FileInputSize, { height: number; fontSize: number; padding: number; iconSize: number }> = {\n sm: { height: 80, fontSize: 12, padding: 16, iconSize: 24 },\n md: { height: 120, fontSize: 14, padding: 24, iconSize: 32 },\n lg: { height: 160, fontSize: 16, padding: 32, iconSize: 40 },\n}\n\nfunction UploadIcon({ size }: { size: number }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12\" />\n </svg>\n )\n}\n\nexport const FileInput = forwardRef<HTMLInputElement, FileInputProps>(function FileInput(\n {\n size = 'md',\n variant = 'dropzone',\n accept,\n multiple = false,\n maxSize,\n label,\n description,\n error,\n isInvalid = false,\n onChange,\n icon,\n disabled = false,\n className,\n style,\n testId,\n ...props\n },\n ref\n) {\n const [isDragOver, setIsDragOver] = useState(false)\n const [isFocused, setIsFocused] = useState(false)\n const inputRef = useRef<HTMLInputElement>(null)\n const config = sizeConfig[size]\n const hasError = isInvalid || !!error\n\n const handleFiles = useCallback(\n (fileList: FileList | null) => {\n if (!fileList || fileList.length === 0) return\n\n let files = Array.from(fileList)\n\n // Filter by max size if specified\n if (maxSize) {\n files = files.filter((file) => file.size <= maxSize)\n }\n\n // If not multiple, only take first file\n if (!multiple && files.length > 1) {\n files = [files[0]]\n }\n\n onChange?.(files)\n },\n [maxSize, multiple, onChange]\n )\n\n const handleDragOver = useCallback((e: DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n if (!disabled) {\n setIsDragOver(true)\n }\n }, [disabled])\n\n const handleDragLeave = useCallback((e: DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n setIsDragOver(false)\n }, [])\n\n const handleDrop = useCallback(\n (e: DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n setIsDragOver(false)\n\n if (!disabled) {\n handleFiles(e.dataTransfer.files)\n }\n },\n [disabled, handleFiles]\n )\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n handleFiles(e.target.files)\n // Reset input value to allow selecting the same file again\n if (inputRef.current) {\n inputRef.current.value = ''\n }\n },\n [handleFiles]\n )\n\n const handleClick = useCallback(() => {\n if (!disabled) {\n inputRef.current?.click()\n }\n }, [disabled])\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if ((e.key === 'Enter' || e.key === ' ') && !disabled) {\n e.preventDefault()\n inputRef.current?.click()\n }\n },\n [disabled]\n )\n\n const containerStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: 6,\n ...style,\n }\n\n const labelStyle: CSSProperties = {\n fontSize: config.fontSize,\n fontWeight: 500,\n color: 'var(--brycks-foreground-default)',\n }\n\n const dropzoneStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 8,\n minHeight: config.height,\n padding: config.padding,\n border: `2px dashed ${\n hasError\n ? 'var(--brycks-error-default)'\n : isDragOver\n ? 'var(--brycks-primary-default)'\n : isFocused\n ? 'var(--brycks-primary-default)'\n : 'var(--brycks-border-default)'\n }`,\n borderRadius: 'var(--brycks-radius-lg)',\n backgroundColor: isDragOver\n ? 'var(--brycks-primary-muted)'\n : 'var(--brycks-background-muted)',\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.5 : 1,\n transition: 'all 150ms ease-out',\n outline: 'none',\n }\n\n const iconContainerStyle: CSSProperties = {\n color: isDragOver\n ? 'var(--brycks-primary-default)'\n : 'var(--brycks-foreground-muted)',\n transition: 'color 150ms ease-out',\n }\n\n const textContainerStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n gap: 4,\n textAlign: 'center',\n }\n\n const primaryTextStyle: CSSProperties = {\n fontSize: config.fontSize,\n fontWeight: 500,\n color: 'var(--brycks-foreground-default)',\n }\n\n const secondaryTextStyle: CSSProperties = {\n fontSize: config.fontSize - 2,\n color: 'var(--brycks-foreground-muted)',\n }\n\n const browseStyle: CSSProperties = {\n color: 'var(--brycks-primary-default)',\n fontWeight: 500,\n }\n\n const errorStyle: CSSProperties = {\n fontSize: config.fontSize - 2,\n color: 'var(--brycks-error-default)',\n }\n\n const defaultDescription = multiple\n ? 'Drag files here or click to browse'\n : 'Drag a file here or click to browse'\n\n return (\n <div\n className={cx('brycks-file-input', `brycks-file-input--${size}`, `brycks-file-input--${variant}`, className)}\n style={containerStyle}\n >\n {label && <label style={labelStyle}>{label}</label>}\n <div\n style={dropzoneStyle}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n tabIndex={disabled ? -1 : 0}\n role=\"button\"\n aria-label={String(description) || defaultDescription}\n >\n <div style={iconContainerStyle}>\n {icon || <UploadIcon size={config.iconSize} />}\n </div>\n <div style={textContainerStyle}>\n <span style={primaryTextStyle}>\n {isDragOver ? 'Drop files here' : (\n <>\n <span style={browseStyle}>Click to browse</span> or drag files here\n </>\n )}\n </span>\n {description && <span style={secondaryTextStyle}>{description}</span>}\n </div>\n </div>\n {error && <span style={errorStyle}>{error}</span>}\n <input\n ref={(node) => {\n (inputRef as React.MutableRefObject<HTMLInputElement | null>).current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n }}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n disabled={disabled}\n onChange={handleChange}\n style={{ display: 'none' }}\n data-testid={testId}\n {...props}\n />\n </div>\n )\n})\n\nFileInput.displayName = 'FileInput'\n"],"names":["sizeConfig","UploadIcon","size","jsx","FileInput","forwardRef","variant","accept","multiple","maxSize","label","description","error","isInvalid","onChange","icon","disabled","className","style","testId","props","ref","isDragOver","setIsDragOver","useState","isFocused","setIsFocused","inputRef","useRef","config","hasError","handleFiles","useCallback","fileList","files","file","handleDragOver","handleDragLeave","handleDrop","handleChange","handleClick","handleKeyDown","containerStyle","labelStyle","dropzoneStyle","iconContainerStyle","textContainerStyle","primaryTextStyle","secondaryTextStyle","browseStyle","errorStyle","defaultDescription","jsxs","cx","Fragment","node"],"mappings":"+KAoDMA,EAA6G,CACjH,GAAI,CAAE,OAAQ,GAAI,SAAU,GAAI,QAAS,GAAI,SAAU,EAAA,EACvD,GAAI,CAAE,OAAQ,IAAK,SAAU,GAAI,QAAS,GAAI,SAAU,EAAA,EACxD,GAAI,CAAE,OAAQ,IAAK,SAAU,GAAI,QAAS,GAAI,SAAU,EAAA,CAC1D,EAEA,SAASC,EAAW,CAAE,KAAAC,GAA0B,CAC9C,OACEC,MAAC,OAAI,MAAOD,EAAM,OAAQA,EAAM,QAAQ,YAAY,KAAK,OAAO,OAAO,eAAe,YAAY,MAChG,eAAC,OAAA,CAAK,cAAc,QAAQ,eAAe,QAAQ,EAAE,uFAAA,CAAwF,CAAA,CAC/I,CAEJ,CAEO,MAAME,EAAYC,EAAAA,WAA6C,SACpE,CACE,KAAAH,EAAO,KACP,QAAAI,EAAU,WACV,OAAAC,EACA,SAAAC,EAAW,GACX,QAAAC,EACA,MAAAC,EACA,YAAAC,EACA,MAAAC,EACA,UAAAC,EAAY,GACZ,SAAAC,EACA,KAAAC,EACA,SAAAC,EAAW,GACX,UAAAC,EACA,MAAAC,EACA,OAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,KAAM,CAACC,EAAYC,CAAa,EAAIC,EAAAA,SAAS,EAAK,EAC5C,CAACC,EAAWC,CAAY,EAAIF,EAAAA,SAAS,EAAK,EAC1CG,EAAWC,EAAAA,OAAyB,IAAI,EACxCC,EAAS7B,EAAWE,CAAI,EACxB4B,EAAWjB,GAAa,CAAC,CAACD,EAE1BmB,EAAcC,EAAAA,YACjBC,GAA8B,CAC7B,GAAI,CAACA,GAAYA,EAAS,SAAW,EAAG,OAExC,IAAIC,EAAQ,MAAM,KAAKD,CAAQ,EAG3BxB,IACFyB,EAAQA,EAAM,OAAQC,GAASA,EAAK,MAAQ1B,CAAO,GAIjD,CAACD,GA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AAAE,EAAAA,SAAA,CACE,SAAA,CAAAnD,EAAAA,IAAC,OAAA,CAAK,MAAO8C,EAAa,SAAA,kBAAe,EAAO,qBAAA,CAAA,CAClD,CAAA,CAEJ,EACCtC,GAAeR,EAAAA,IAAC,OAAA,CAAK,MAAO6C,EAAqB,SAAArC,CAAA,CAAY,CAAA,CAAA,CAChE,CAAA,CAAA,CAAA,EAEDC,GAAST,EAAAA,IAAC,OAAA,CAAK,MAAO+C,EAAa,SAAAtC,EAAM,EAC1CT,EAAAA,IAAC,QAAA,CACC,IAAMoD,GAAS,CACZ5B,EAA6D,QAAU4B,EACpE,OAAOlC,GAAQ,WAAYA,EAAIkC,CAAI,EAC9BlC,MAAS,QAAUkC,EAC9B,EACA,KAAK,OACL,OAAAhD,EACA,SAAAC,EACA,SAAAQ,EACA,SAAUuB,EACV,MAAO,CAAE,QAAS,MAAA,EAClB,cAAapB,EACZ,GAAGC,CAAA,CAAA,CACN,CAAA,CAAA,CAGN,CAAC,EAEDhB,EAAU,YAAc"}
@@ -74,7 +74,7 @@ const re = X(function({
74
74
  padding: n.padding,
75
75
  border: `2px dashed ${R ? "var(--brycks-error-default)" : c || O ? "var(--brycks-primary-default)" : "var(--brycks-border-default)"}`,
76
76
  borderRadius: "var(--brycks-radius-lg)",
77
- backgroundColor: c ? "var(--brycks-primary-50)" : "var(--brycks-background-muted)",
77
+ backgroundColor: c ? "var(--brycks-primary-muted)" : "var(--brycks-background-muted)",
78
78
  cursor: r ? "not-allowed" : "pointer",
79
79
  opacity: r ? 0.5 : 1,
80
80
  transition: "all 150ms ease-out",
@@ -1 +1 @@
1
- {"version":3,"file":"FileInput.js","sources":["../../../../src/components/form/FileInput/FileInput.tsx"],"sourcesContent":["/**\n * FileInput Component\n *\n * Accessible file upload input with drag-and-drop support.\n * Supports multiple files and file type restrictions.\n */\n\nimport {\n forwardRef,\n useState,\n useRef,\n useCallback,\n type CSSProperties,\n type InputHTMLAttributes,\n type DragEvent,\n type ReactNode,\n} from 'react'\nimport { cx } from '../../../utils/styles'\n\nexport type FileInputSize = 'sm' | 'md' | 'lg'\nexport type FileInputVariant = 'default' | 'dropzone'\n\nexport interface FileInputProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'onChange' | 'value'> {\n /** Input size */\n size?: FileInputSize\n /** Input variant */\n variant?: FileInputVariant\n /** Accepted file types (e.g., \"image/*,.pdf\") */\n accept?: string\n /** Whether multiple files can be selected */\n multiple?: boolean\n /** Maximum file size in bytes */\n maxSize?: number\n /** Label text */\n label?: ReactNode\n /** Description text inside dropzone */\n description?: ReactNode\n /** Error message */\n error?: ReactNode\n /** Whether the input is invalid */\n isInvalid?: boolean\n /** Callback when files are selected */\n onChange?: (files: File[]) => void\n /** Icon to display in dropzone */\n icon?: ReactNode\n /** Custom class name */\n className?: string\n /** Test ID */\n testId?: string\n}\n\nconst sizeConfig: Record<FileInputSize, { height: number; fontSize: number; padding: number; iconSize: number }> = {\n sm: { height: 80, fontSize: 12, padding: 16, iconSize: 24 },\n md: { height: 120, fontSize: 14, padding: 24, iconSize: 32 },\n lg: { height: 160, fontSize: 16, padding: 32, iconSize: 40 },\n}\n\nfunction UploadIcon({ size }: { size: number }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12\" />\n </svg>\n )\n}\n\nexport const FileInput = forwardRef<HTMLInputElement, FileInputProps>(function FileInput(\n {\n size = 'md',\n variant = 'dropzone',\n accept,\n multiple = false,\n maxSize,\n label,\n description,\n error,\n isInvalid = false,\n onChange,\n icon,\n disabled = false,\n className,\n style,\n testId,\n ...props\n },\n ref\n) {\n const [isDragOver, setIsDragOver] = useState(false)\n const [isFocused, setIsFocused] = useState(false)\n const inputRef = useRef<HTMLInputElement>(null)\n const config = sizeConfig[size]\n const hasError = isInvalid || !!error\n\n const handleFiles = useCallback(\n (fileList: FileList | null) => {\n if (!fileList || fileList.length === 0) return\n\n let files = Array.from(fileList)\n\n // Filter by max size if specified\n if (maxSize) {\n files = files.filter((file) => file.size <= maxSize)\n }\n\n // If not multiple, only take first file\n if (!multiple && files.length > 1) {\n files = [files[0]]\n }\n\n onChange?.(files)\n },\n [maxSize, multiple, onChange]\n )\n\n const handleDragOver = useCallback((e: DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n if (!disabled) {\n setIsDragOver(true)\n }\n }, [disabled])\n\n const handleDragLeave = useCallback((e: DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n setIsDragOver(false)\n }, [])\n\n const handleDrop = useCallback(\n (e: DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n setIsDragOver(false)\n\n if (!disabled) {\n handleFiles(e.dataTransfer.files)\n }\n },\n [disabled, handleFiles]\n )\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n handleFiles(e.target.files)\n // Reset input value to allow selecting the same file again\n if (inputRef.current) {\n inputRef.current.value = ''\n }\n },\n [handleFiles]\n )\n\n const handleClick = useCallback(() => {\n if (!disabled) {\n inputRef.current?.click()\n }\n }, [disabled])\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if ((e.key === 'Enter' || e.key === ' ') && !disabled) {\n e.preventDefault()\n inputRef.current?.click()\n }\n },\n [disabled]\n )\n\n const containerStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: 6,\n ...style,\n }\n\n const labelStyle: CSSProperties = {\n fontSize: config.fontSize,\n fontWeight: 500,\n color: 'var(--brycks-foreground-default)',\n }\n\n const dropzoneStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 8,\n minHeight: config.height,\n padding: config.padding,\n border: `2px dashed ${\n hasError\n ? 'var(--brycks-error-default)'\n : isDragOver\n ? 'var(--brycks-primary-default)'\n : isFocused\n ? 'var(--brycks-primary-default)'\n : 'var(--brycks-border-default)'\n }`,\n borderRadius: 'var(--brycks-radius-lg)',\n backgroundColor: isDragOver\n ? 'var(--brycks-primary-50)'\n : 'var(--brycks-background-muted)',\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.5 : 1,\n transition: 'all 150ms ease-out',\n outline: 'none',\n }\n\n const iconContainerStyle: CSSProperties = {\n color: isDragOver\n ? 'var(--brycks-primary-default)'\n : 'var(--brycks-foreground-muted)',\n transition: 'color 150ms ease-out',\n }\n\n const textContainerStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n gap: 4,\n textAlign: 'center',\n }\n\n const primaryTextStyle: CSSProperties = {\n fontSize: config.fontSize,\n fontWeight: 500,\n color: 'var(--brycks-foreground-default)',\n }\n\n const secondaryTextStyle: CSSProperties = {\n fontSize: config.fontSize - 2,\n color: 'var(--brycks-foreground-muted)',\n }\n\n const browseStyle: CSSProperties = {\n color: 'var(--brycks-primary-default)',\n fontWeight: 500,\n }\n\n const errorStyle: CSSProperties = {\n fontSize: config.fontSize - 2,\n color: 'var(--brycks-error-default)',\n }\n\n const defaultDescription = multiple\n ? 'Drag files here or click to browse'\n : 'Drag a file here or click to browse'\n\n return (\n <div\n className={cx('brycks-file-input', `brycks-file-input--${size}`, `brycks-file-input--${variant}`, className)}\n style={containerStyle}\n >\n {label && <label style={labelStyle}>{label}</label>}\n <div\n style={dropzoneStyle}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n tabIndex={disabled ? -1 : 0}\n role=\"button\"\n aria-label={String(description) || defaultDescription}\n >\n <div style={iconContainerStyle}>\n {icon || <UploadIcon size={config.iconSize} />}\n </div>\n <div style={textContainerStyle}>\n <span style={primaryTextStyle}>\n {isDragOver ? 'Drop files here' : (\n <>\n <span style={browseStyle}>Click to browse</span> or drag files here\n </>\n )}\n </span>\n {description && <span style={secondaryTextStyle}>{description}</span>}\n </div>\n </div>\n {error && <span style={errorStyle}>{error}</span>}\n <input\n ref={(node) => {\n (inputRef as React.MutableRefObject<HTMLInputElement | null>).current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n }}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n disabled={disabled}\n onChange={handleChange}\n style={{ display: 'none' }}\n data-testid={testId}\n {...props}\n />\n </div>\n )\n})\n\nFileInput.displayName = 'FileInput'\n"],"names":["sizeConfig","UploadIcon","size","jsx","FileInput","forwardRef","variant","accept","multiple","maxSize","label","description","error","isInvalid","onChange","icon","disabled","className","style","testId","props","ref","isDragOver","setIsDragOver","useState","isFocused","setIsFocused","inputRef","useRef","config","hasError","handleFiles","useCallback","fileList","files","file","handleDragOver","handleDragLeave","handleDrop","handleChange","handleClick","handleKeyDown","containerStyle","labelStyle","dropzoneStyle","iconContainerStyle","textContainerStyle","primaryTextStyle","secondaryTextStyle","browseStyle","errorStyle","defaultDescription","jsxs","cx","Fragment","node"],"mappings":";;;AAoDA,MAAMA,IAA6G;AAAA,EACjH,IAAI,EAAE,QAAQ,IAAI,UAAU,IAAI,SAAS,IAAI,UAAU,GAAA;AAAA,EACvD,IAAI,EAAE,QAAQ,KAAK,UAAU,IAAI,SAAS,IAAI,UAAU,GAAA;AAAA,EACxD,IAAI,EAAE,QAAQ,KAAK,UAAU,IAAI,SAAS,IAAI,UAAU,GAAA;AAC1D;AAEA,SAASC,GAAW,EAAE,MAAAC,KAA0B;AAC9C,SACE,gBAAAC,EAAC,SAAI,OAAOD,GAAM,QAAQA,GAAM,SAAQ,aAAY,MAAK,QAAO,QAAO,gBAAe,aAAY,OAChG,4BAAC,QAAA,EAAK,eAAc,SAAQ,gBAAe,SAAQ,GAAE,wFAAA,CAAwF,EAAA,CAC/I;AAEJ;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AA,gBAAA3C,EAAC,QAAA,EAAK,OAAO4C,GACV,UAAAzB,IAAa,oBACZ,gBAAA8B,EAAAE,GAAA,EACE,UAAA;AAAA,kBAAA,gBAAAnD,EAAC,QAAA,EAAK,OAAO8C,GAAa,UAAA,mBAAe;AAAA,kBAAO;AAAA,gBAAA,EAAA,CAClD,EAAA,CAEJ;AAAA,gBACCtC,KAAe,gBAAAR,EAAC,QAAA,EAAK,OAAO6C,GAAqB,UAAArC,EAAA,CAAY;AAAA,cAAA,EAAA,CAChE;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAEDC,KAAS,gBAAAT,EAAC,QAAA,EAAK,OAAO+C,GAAa,UAAAtC,GAAM;AAAA,QAC1C,gBAAAT;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,KAAK,CAACoD,MAAS;AACZ,cAAA5B,EAA6D,UAAU4B,GACpE,OAAOlC,KAAQ,aAAYA,EAAIkC,CAAI,IAC9BlC,QAAS,UAAUkC;AAAA,YAC9B;AAAA,YACA,MAAK;AAAA,YACL,QAAAhD;AAAA,YACA,UAAAC;AAAA,YACA,UAAAQ;AAAA,YACA,UAAUuB;AAAA,YACV,OAAO,EAAE,SAAS,OAAA;AAAA,YAClB,eAAapB;AAAA,YACZ,GAAGC;AAAA,UAAA;AAAA,QAAA;AAAA,MACN;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;AAEDhB,GAAU,cAAc;"}
1
+ {"version":3,"file":"FileInput.js","sources":["../../../../src/components/form/FileInput/FileInput.tsx"],"sourcesContent":["/**\n * FileInput Component\n *\n * Accessible file upload input with drag-and-drop support.\n * Supports multiple files and file type restrictions.\n */\n\nimport {\n forwardRef,\n useState,\n useRef,\n useCallback,\n type CSSProperties,\n type InputHTMLAttributes,\n type DragEvent,\n type ReactNode,\n} from 'react'\nimport { cx } from '../../../utils/styles'\n\nexport type FileInputSize = 'sm' | 'md' | 'lg'\nexport type FileInputVariant = 'default' | 'dropzone'\n\nexport interface FileInputProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'onChange' | 'value'> {\n /** Input size */\n size?: FileInputSize\n /** Input variant */\n variant?: FileInputVariant\n /** Accepted file types (e.g., \"image/*,.pdf\") */\n accept?: string\n /** Whether multiple files can be selected */\n multiple?: boolean\n /** Maximum file size in bytes */\n maxSize?: number\n /** Label text */\n label?: ReactNode\n /** Description text inside dropzone */\n description?: ReactNode\n /** Error message */\n error?: ReactNode\n /** Whether the input is invalid */\n isInvalid?: boolean\n /** Callback when files are selected */\n onChange?: (files: File[]) => void\n /** Icon to display in dropzone */\n icon?: ReactNode\n /** Custom class name */\n className?: string\n /** Test ID */\n testId?: string\n}\n\nconst sizeConfig: Record<FileInputSize, { height: number; fontSize: number; padding: number; iconSize: number }> = {\n sm: { height: 80, fontSize: 12, padding: 16, iconSize: 24 },\n md: { height: 120, fontSize: 14, padding: 24, iconSize: 32 },\n lg: { height: 160, fontSize: 16, padding: 32, iconSize: 40 },\n}\n\nfunction UploadIcon({ size }: { size: number }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12\" />\n </svg>\n )\n}\n\nexport const FileInput = forwardRef<HTMLInputElement, FileInputProps>(function FileInput(\n {\n size = 'md',\n variant = 'dropzone',\n accept,\n multiple = false,\n maxSize,\n label,\n description,\n error,\n isInvalid = false,\n onChange,\n icon,\n disabled = false,\n className,\n style,\n testId,\n ...props\n },\n ref\n) {\n const [isDragOver, setIsDragOver] = useState(false)\n const [isFocused, setIsFocused] = useState(false)\n const inputRef = useRef<HTMLInputElement>(null)\n const config = sizeConfig[size]\n const hasError = isInvalid || !!error\n\n const handleFiles = useCallback(\n (fileList: FileList | null) => {\n if (!fileList || fileList.length === 0) return\n\n let files = Array.from(fileList)\n\n // Filter by max size if specified\n if (maxSize) {\n files = files.filter((file) => file.size <= maxSize)\n }\n\n // If not multiple, only take first file\n if (!multiple && files.length > 1) {\n files = [files[0]]\n }\n\n onChange?.(files)\n },\n [maxSize, multiple, onChange]\n )\n\n const handleDragOver = useCallback((e: DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n if (!disabled) {\n setIsDragOver(true)\n }\n }, [disabled])\n\n const handleDragLeave = useCallback((e: DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n setIsDragOver(false)\n }, [])\n\n const handleDrop = useCallback(\n (e: DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n setIsDragOver(false)\n\n if (!disabled) {\n handleFiles(e.dataTransfer.files)\n }\n },\n [disabled, handleFiles]\n )\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n handleFiles(e.target.files)\n // Reset input value to allow selecting the same file again\n if (inputRef.current) {\n inputRef.current.value = ''\n }\n },\n [handleFiles]\n )\n\n const handleClick = useCallback(() => {\n if (!disabled) {\n inputRef.current?.click()\n }\n }, [disabled])\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if ((e.key === 'Enter' || e.key === ' ') && !disabled) {\n e.preventDefault()\n inputRef.current?.click()\n }\n },\n [disabled]\n )\n\n const containerStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: 6,\n ...style,\n }\n\n const labelStyle: CSSProperties = {\n fontSize: config.fontSize,\n fontWeight: 500,\n color: 'var(--brycks-foreground-default)',\n }\n\n const dropzoneStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 8,\n minHeight: config.height,\n padding: config.padding,\n border: `2px dashed ${\n hasError\n ? 'var(--brycks-error-default)'\n : isDragOver\n ? 'var(--brycks-primary-default)'\n : isFocused\n ? 'var(--brycks-primary-default)'\n : 'var(--brycks-border-default)'\n }`,\n borderRadius: 'var(--brycks-radius-lg)',\n backgroundColor: isDragOver\n ? 'var(--brycks-primary-muted)'\n : 'var(--brycks-background-muted)',\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.5 : 1,\n transition: 'all 150ms ease-out',\n outline: 'none',\n }\n\n const iconContainerStyle: CSSProperties = {\n color: isDragOver\n ? 'var(--brycks-primary-default)'\n : 'var(--brycks-foreground-muted)',\n transition: 'color 150ms ease-out',\n }\n\n const textContainerStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n gap: 4,\n textAlign: 'center',\n }\n\n const primaryTextStyle: CSSProperties = {\n fontSize: config.fontSize,\n fontWeight: 500,\n color: 'var(--brycks-foreground-default)',\n }\n\n const secondaryTextStyle: CSSProperties = {\n fontSize: config.fontSize - 2,\n color: 'var(--brycks-foreground-muted)',\n }\n\n const browseStyle: CSSProperties = {\n color: 'var(--brycks-primary-default)',\n fontWeight: 500,\n }\n\n const errorStyle: CSSProperties = {\n fontSize: config.fontSize - 2,\n color: 'var(--brycks-error-default)',\n }\n\n const defaultDescription = multiple\n ? 'Drag files here or click to browse'\n : 'Drag a file here or click to browse'\n\n return (\n <div\n className={cx('brycks-file-input', `brycks-file-input--${size}`, `brycks-file-input--${variant}`, className)}\n style={containerStyle}\n >\n {label && <label style={labelStyle}>{label}</label>}\n <div\n style={dropzoneStyle}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n tabIndex={disabled ? -1 : 0}\n role=\"button\"\n aria-label={String(description) || defaultDescription}\n >\n <div style={iconContainerStyle}>\n {icon || <UploadIcon size={config.iconSize} />}\n </div>\n <div style={textContainerStyle}>\n <span style={primaryTextStyle}>\n {isDragOver ? 'Drop files here' : (\n <>\n <span style={browseStyle}>Click to browse</span> or drag files here\n </>\n )}\n </span>\n {description && <span style={secondaryTextStyle}>{description}</span>}\n </div>\n </div>\n {error && <span style={errorStyle}>{error}</span>}\n <input\n ref={(node) => {\n (inputRef as React.MutableRefObject<HTMLInputElement | null>).current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n }}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n disabled={disabled}\n onChange={handleChange}\n style={{ display: 'none' }}\n data-testid={testId}\n {...props}\n />\n </div>\n )\n})\n\nFileInput.displayName = 'FileInput'\n"],"names":["sizeConfig","UploadIcon","size","jsx","FileInput","forwardRef","variant","accept","multiple","maxSize","label","description","error","isInvalid","onChange","icon","disabled","className","style","testId","props","ref","isDragOver","setIsDragOver","useState","isFocused","setIsFocused","inputRef","useRef","config","hasError","handleFiles","useCallback","fileList","files","file","handleDragOver","handleDragLeave","handleDrop","handleChange","handleClick","handleKeyDown","containerStyle","labelStyle","dropzoneStyle","iconContainerStyle","textContainerStyle","primaryTextStyle","secondaryTextStyle","browseStyle","errorStyle","defaultDescription","jsxs","cx","Fragment","node"],"mappings":";;;AAoDA,MAAMA,IAA6G;AAAA,EACjH,IAAI,EAAE,QAAQ,IAAI,UAAU,IAAI,SAAS,IAAI,UAAU,GAAA;AAAA,EACvD,IAAI,EAAE,QAAQ,KAAK,UAAU,IAAI,SAAS,IAAI,UAAU,GAAA;AAAA,EACxD,IAAI,EAAE,QAAQ,KAAK,UAAU,IAAI,SAAS,IAAI,UAAU,GAAA;AAC1D;AAEA,SAASC,GAAW,EAAE,MAAAC,KAA0B;AAC9C,SACE,gBAAAC,EAAC,SAAI,OAAOD,GAAM,QAAQA,GAAM,SAAQ,aAAY,MAAK,QAAO,QAAO,gBAAe,aAAY,OAChG,4BAAC,QAAA,EAAK,eAAc,SAAQ,gBAAe,SAAQ,GAAE,wFAAA,CAAwF,EAAA,CAC/I;AAEJ;AAEO,MAAME,KAAYC,EAA6C,SACpE;AAAA,EACE,MAAAH,IAAO;AAAA,EACP,SAAAI,IAAU;AAAA,EACV,QAAAC;AAAA,EACA,UA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,gBAAAnD,EAAC,QAAA,EAAK,OAAO8C,GAAa,UAAA,mBAAe;AAAA,kBAAO;AAAA,gBAAA,EAAA,CAClD,EAAA,CAEJ;AAAA,gBACCtC,KAAe,gBAAAR,EAAC,QAAA,EAAK,OAAO6C,GAAqB,UAAArC,EAAA,CAAY;AAAA,cAAA,EAAA,CAChE;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAEDC,KAAS,gBAAAT,EAAC,QAAA,EAAK,OAAO+C,GAAa,UAAAtC,GAAM;AAAA,QAC1C,gBAAAT;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,KAAK,CAACoD,MAAS;AACZ,cAAA5B,EAA6D,UAAU4B,GACpE,OAAOlC,KAAQ,aAAYA,EAAIkC,CAAI,IAC9BlC,QAAS,UAAUkC;AAAA,YAC9B;AAAA,YACA,MAAK;AAAA,YACL,QAAAhD;AAAA,YACA,UAAAC;AAAA,YACA,UAAAQ;AAAA,YACA,UAAUuB;AAAA,YACV,OAAO,EAAE,SAAS,OAAA;AAAA,YAClB,eAAapB;AAAA,YACZ,GAAGC;AAAA,UAAA;AAAA,QAAA;AAAA,MACN;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;AAEDhB,GAAU,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),h=require("react"),p=require("../../../utils/styles.cjs"),x={neutral:"var(--brycks-background-muted)",primary:"var(--brycks-primary-muted)",success:"var(--brycks-success-muted)",warning:"var(--brycks-warning-muted)",error:"var(--brycks-error-muted)",info:"var(--brycks-info-muted)"},t=h.forwardRef(function({title:e,icon:s,iconIntent:c="primary",headerExtra:a,children:d,className:o,style:n,testId:i,...l},y){const b={background:"var(--brycks-background-card)",borderRadius:"var(--brycks-radius-lg)",border:"1px solid var(--brycks-border-subtle)",overflow:"hidden",...n},m={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid var(--brycks-border-subtle)"},u={display:"flex",alignItems:"center",gap:12},f={width:32,height:32,borderRadius:"50%",background:x[c],display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},k={fontFamily:"var(--brycks-font-sans)",fontSize:"var(--brycks-font-size-md)",fontWeight:600,color:"var(--brycks-foreground-default)",lineHeight:1.4,margin:0},v={padding:20},g=e||s||a;return r.jsxs("div",{ref:y,className:p.cx("brycks-form-card",o),style:b,"data-testid":i,...l,children:[g&&r.jsxs("div",{className:"brycks-form-card__header",style:m,children:[r.jsxs("div",{style:u,children:[s&&r.jsx("div",{className:"brycks-form-card__icon",style:f,children:s}),e&&r.jsx("h3",{className:"brycks-form-card__title",style:k,children:e})]}),a&&r.jsx("div",{className:"brycks-form-card__header-extra",children:a})]}),r.jsx("div",{className:"brycks-form-card__body",style:v,children:d})]})});t.displayName="FormCard";exports.FormCard=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),h=require("react"),p=require("../../../utils/styles.cjs"),x={neutral:"var(--brycks-background-muted)",primary:"var(--brycks-primary-muted)",success:"var(--brycks-success-muted)",warning:"var(--brycks-warning-muted)",error:"var(--brycks-error-muted)",info:"var(--brycks-info-muted)"},a=h.forwardRef(function({title:e,icon:s,iconIntent:d="primary",headerExtra:t,children:c,className:o,style:n,testId:i,...l},y){const m={background:"var(--brycks-background-elevated)",borderRadius:"var(--brycks-radius-lg)",border:"1px solid var(--brycks-border-muted)",overflow:"hidden",...n},b={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid var(--brycks-border-muted)"},u={display:"flex",alignItems:"center",gap:12},f={width:32,height:32,borderRadius:"50%",background:x[d],display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},k={fontFamily:"var(--brycks-font-sans)",fontSize:"var(--brycks-font-size-md)",fontWeight:600,color:"var(--brycks-foreground-default)",lineHeight:1.4,margin:0},v={padding:20},g=e||s||t;return r.jsxs("div",{ref:y,className:p.cx("brycks-form-card",o),style:m,"data-testid":i,...l,children:[g&&r.jsxs("div",{className:"brycks-form-card__header",style:b,children:[r.jsxs("div",{style:u,children:[s&&r.jsx("div",{className:"brycks-form-card__icon",style:f,children:s}),e&&r.jsx("h3",{className:"brycks-form-card__title",style:k,children:e})]}),t&&r.jsx("div",{className:"brycks-form-card__header-extra",children:t})]}),r.jsx("div",{className:"brycks-form-card__body",style:v,children:c})]})});a.displayName="FormCard";exports.FormCard=a;
2
2
  //# sourceMappingURL=FormCard.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormCard.cjs","sources":["../../../../src/components/form/FormCard/FormCard.tsx"],"sourcesContent":["/**\n * FormCard Component\n *\n * Card wrapper optimized for form sections with optional icon and title.\n * Provides consistent spacing and visual hierarchy for form layouts.\n */\n\nimport {\n forwardRef,\n type CSSProperties,\n type ReactNode,\n type HTMLAttributes,\n} from 'react'\nimport { cx } from '../../../utils/styles'\n\nexport type FormCardIntent = 'neutral' | 'primary' | 'success' | 'warning' | 'error' | 'info'\n\nexport interface FormCardProps extends HTMLAttributes<HTMLDivElement> {\n /** Card title */\n title?: string\n /** Icon displayed before title */\n icon?: ReactNode\n /** Color intent for the icon circle */\n iconIntent?: FormCardIntent\n /** Additional content in the header (e.g., counter, badge) */\n headerExtra?: ReactNode\n /** Card body content */\n children?: ReactNode\n /** Custom class name */\n className?: string\n /** Test ID */\n testId?: string\n}\n\nconst intentColors: Record<FormCardIntent, string> = {\n neutral: 'var(--brycks-background-muted)',\n primary: 'var(--brycks-primary-muted)',\n success: 'var(--brycks-success-muted)',\n warning: 'var(--brycks-warning-muted)',\n error: 'var(--brycks-error-muted)',\n info: 'var(--brycks-info-muted)',\n}\n\nexport const FormCard = forwardRef<HTMLDivElement, FormCardProps>(\n function FormCard(\n {\n title,\n icon,\n iconIntent = 'primary',\n headerExtra,\n children,\n className,\n style,\n testId,\n ...props\n },\n ref\n ) {\n const cardStyle: CSSProperties = {\n background: 'var(--brycks-background-card)',\n borderRadius: 'var(--brycks-radius-lg)',\n border: '1px solid var(--brycks-border-subtle)',\n overflow: 'hidden',\n ...style,\n }\n\n const headerStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: '16px 20px',\n borderBottom: '1px solid var(--brycks-border-subtle)',\n }\n\n const headerLeftStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: 12,\n }\n\n const iconCircleStyle: CSSProperties = {\n width: 32,\n height: 32,\n borderRadius: '50%',\n background: intentColors[iconIntent],\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n }\n\n const titleStyle: CSSProperties = {\n fontFamily: 'var(--brycks-font-sans)',\n fontSize: 'var(--brycks-font-size-md)',\n fontWeight: 600,\n color: 'var(--brycks-foreground-default)',\n lineHeight: 1.4,\n margin: 0,\n }\n\n const bodyStyle: CSSProperties = {\n padding: 20,\n }\n\n const hasHeader = title || icon || headerExtra\n\n return (\n <div\n ref={ref}\n className={cx('brycks-form-card', className)}\n style={cardStyle}\n data-testid={testId}\n {...props}\n >\n {hasHeader && (\n <div className=\"brycks-form-card__header\" style={headerStyle}>\n <div style={headerLeftStyle}>\n {icon && (\n <div\n className=\"brycks-form-card__icon\"\n style={iconCircleStyle}\n >\n {icon}\n </div>\n )}\n {title && (\n <h3 className=\"brycks-form-card__title\" style={titleStyle}>\n {title}\n </h3>\n )}\n </div>\n {headerExtra && (\n <div className=\"brycks-form-card__header-extra\">\n {headerExtra}\n </div>\n )}\n </div>\n )}\n\n <div className=\"brycks-form-card__body\" style={bodyStyle}>\n {children}\n </div>\n </div>\n )\n }\n)\n\nFormCard.displayName = 'FormCard'\n"],"names":["intentColors","FormCard","forwardRef","title","icon","iconIntent","headerExtra","children","className","style","testId","props","ref","cardStyle","headerStyle","headerLeftStyle","iconCircleStyle","titleStyle","bodyStyle","hasHeader","jsxs","cx","jsx"],"mappings":"+KAkCMA,EAA+C,CACnD,QAAS,iCACT,QAA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AAAhB,CAAA,CACH,CAAA,EAEJ,QAGD,MAAA,CAAI,UAAU,yBAAyB,MAAOY,EAC5C,SAAAX,CAAA,CACH,CAAA,CAAA,CAAA,CAGN,CACF,EAEAN,EAAS,YAAc"}
1
+ {"version":3,"file":"FormCard.cjs","sources":["../../../../src/components/form/FormCard/FormCard.tsx"],"sourcesContent":["/**\n * FormCard Component\n *\n * Card wrapper optimized for form sections with optional icon and title.\n * Provides consistent spacing and visual hierarchy for form layouts.\n */\n\nimport {\n forwardRef,\n type CSSProperties,\n type ReactNode,\n type HTMLAttributes,\n} from 'react'\nimport { cx } from '../../../utils/styles'\n\nexport type FormCardIntent = 'neutral' | 'primary' | 'success' | 'warning' | 'error' | 'info'\n\nexport interface FormCardProps extends HTMLAttributes<HTMLDivElement> {\n /** Card title */\n title?: string\n /** Icon displayed before title */\n icon?: ReactNode\n /** Color intent for the icon circle */\n iconIntent?: FormCardIntent\n /** Additional content in the header (e.g., counter, badge) */\n headerExtra?: ReactNode\n /** Card body content */\n children?: ReactNode\n /** Custom class name */\n className?: string\n /** Test ID */\n testId?: string\n}\n\nconst intentColors: Record<FormCardIntent, string> = {\n neutral: 'var(--brycks-background-muted)',\n primary: 'var(--brycks-primary-muted)',\n success: 'var(--brycks-success-muted)',\n warning: 'var(--brycks-warning-muted)',\n error: 'var(--brycks-error-muted)',\n info: 'var(--brycks-info-muted)',\n}\n\nexport const FormCard = forwardRef<HTMLDivElement, FormCardProps>(\n function FormCard(\n {\n title,\n icon,\n iconIntent = 'primary',\n headerExtra,\n children,\n className,\n style,\n testId,\n ...props\n },\n ref\n ) {\n const cardStyle: CSSProperties = {\n background: 'var(--brycks-background-elevated)',\n borderRadius: 'var(--brycks-radius-lg)',\n border: '1px solid var(--brycks-border-muted)',\n overflow: 'hidden',\n ...style,\n }\n\n const headerStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: '16px 20px',\n borderBottom: '1px solid var(--brycks-border-muted)',\n }\n\n const headerLeftStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: 12,\n }\n\n const iconCircleStyle: CSSProperties = {\n width: 32,\n height: 32,\n borderRadius: '50%',\n background: intentColors[iconIntent],\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n }\n\n const titleStyle: CSSProperties = {\n fontFamily: 'var(--brycks-font-sans)',\n fontSize: 'var(--brycks-font-size-md)',\n fontWeight: 600,\n color: 'var(--brycks-foreground-default)',\n lineHeight: 1.4,\n margin: 0,\n }\n\n const bodyStyle: CSSProperties = {\n padding: 20,\n }\n\n const hasHeader = title || icon || headerExtra\n\n return (\n <div\n ref={ref}\n className={cx('brycks-form-card', className)}\n style={cardStyle}\n data-testid={testId}\n {...props}\n >\n {hasHeader && (\n <div className=\"brycks-form-card__header\" style={headerStyle}>\n <div style={headerLeftStyle}>\n {icon && (\n <div\n className=\"brycks-form-card__icon\"\n style={iconCircleStyle}\n >\n {icon}\n </div>\n )}\n {title && (\n <h3 className=\"brycks-form-card__title\" style={titleStyle}>\n {title}\n </h3>\n )}\n </div>\n {headerExtra && (\n <div className=\"brycks-form-card__header-extra\">\n {headerExtra}\n </div>\n )}\n </div>\n )}\n\n <div className=\"brycks-form-card__body\" style={bodyStyle}>\n {children}\n </div>\n </div>\n )\n }\n)\n\nFormCard.displayName = 'FormCard'\n"],"names":["intentColors","FormCard","forwardRef","title","icon","iconIntent","headerExtra","children","className","style","testId","props","ref","cardStyle","headerStyle","headerLeftStyle","iconCircleStyle","titleStyle","bodyStyle","hasHeader","jsxs","cx","jsx"],"mappings":"+KAkCMA,EAA+C,CACnD,QAAS,iCACT,QAAS,8BACT,QAAS,8BACT,QAAS,8BACT,MAAO,4BACP,KAAM,0BACR,EAEaC,EAAWC,EAAAA,WACtB,SACE,CACE,MAAAC,EACA,KAAAC,EACA,WAAAC,EAAa,UACb,YAAAC,EACA,SAAAC,EACA,UAAAC,EACA,MAAAC,EACA,OAAAC,EACA,GAAG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";
1
+ import { jsxs as d, jsx as r } from "react/jsx-runtime";
2
2
  import { forwardRef as g } from "react";
3
3
  import { cx as h } from "../../../utils/styles.js";
4
4
  const x = {
@@ -12,7 +12,7 @@ const x = {
12
12
  function({
13
13
  title: e,
14
14
  icon: s,
15
- iconIntent: d = "primary",
15
+ iconIntent: t = "primary",
16
16
  headerExtra: a,
17
17
  children: c,
18
18
  className: o,
@@ -21,9 +21,9 @@ const x = {
21
21
  ...l
22
22
  }, y) {
23
23
  const m = {
24
- background: "var(--brycks-background-card)",
24
+ background: "var(--brycks-background-elevated)",
25
25
  borderRadius: "var(--brycks-radius-lg)",
26
- border: "1px solid var(--brycks-border-subtle)",
26
+ border: "1px solid var(--brycks-border-muted)",
27
27
  overflow: "hidden",
28
28
  ...n
29
29
  }, b = {
@@ -31,7 +31,7 @@ const x = {
31
31
  alignItems: "center",
32
32
  justifyContent: "space-between",
33
33
  padding: "16px 20px",
34
- borderBottom: "1px solid var(--brycks-border-subtle)"
34
+ borderBottom: "1px solid var(--brycks-border-muted)"
35
35
  }, f = {
36
36
  display: "flex",
37
37
  alignItems: "center",
@@ -40,7 +40,7 @@ const x = {
40
40
  width: 32,
41
41
  height: 32,
42
42
  borderRadius: "50%",
43
- background: x[d],
43
+ background: x[t],
44
44
  display: "flex",
45
45
  alignItems: "center",
46
46
  justifyContent: "center",
@@ -55,7 +55,7 @@ const x = {
55
55
  }, v = {
56
56
  padding: 20
57
57
  }, p = e || s || a;
58
- return /* @__PURE__ */ t(
58
+ return /* @__PURE__ */ d(
59
59
  "div",
60
60
  {
61
61
  ref: y,
@@ -64,8 +64,8 @@ const x = {
64
64
  "data-testid": i,
65
65
  ...l,
66
66
  children: [
67
- p && /* @__PURE__ */ t("div", { className: "brycks-form-card__header", style: b, children: [
68
- /* @__PURE__ */ t("div", { style: f, children: [
67
+ p && /* @__PURE__ */ d("div", { className: "brycks-form-card__header", style: b, children: [
68
+ /* @__PURE__ */ d("div", { style: f, children: [
69
69
  s && /* @__PURE__ */ r(
70
70
  "div",
71
71
  {
@@ -1 +1 @@
1
- {"version":3,"file":"FormCard.js","sources":["../../../../src/components/form/FormCard/FormCard.tsx"],"sourcesContent":["/**\n * FormCard Component\n *\n * Card wrapper optimized for form sections with optional icon and title.\n * Provides consistent spacing and visual hierarchy for form layouts.\n */\n\nimport {\n forwardRef,\n type CSSProperties,\n type ReactNode,\n type HTMLAttributes,\n} from 'react'\nimport { cx } from '../../../utils/styles'\n\nexport type FormCardIntent = 'neutral' | 'primary' | 'success' | 'warning' | 'error' | 'info'\n\nexport interface FormCardProps extends HTMLAttributes<HTMLDivElement> {\n /** Card title */\n title?: string\n /** Icon displayed before title */\n icon?: ReactNode\n /** Color intent for the icon circle */\n iconIntent?: FormCardIntent\n /** Additional content in the header (e.g., counter, badge) */\n headerExtra?: ReactNode\n /** Card body content */\n children?: ReactNode\n /** Custom class name */\n className?: string\n /** Test ID */\n testId?: string\n}\n\nconst intentColors: Record<FormCardIntent, string> = {\n neutral: 'var(--brycks-background-muted)',\n primary: 'var(--brycks-primary-muted)',\n success: 'var(--brycks-success-muted)',\n warning: 'var(--brycks-warning-muted)',\n error: 'var(--brycks-error-muted)',\n info: 'var(--brycks-info-muted)',\n}\n\nexport const FormCard = forwardRef<HTMLDivElement, FormCardProps>(\n function FormCard(\n {\n title,\n icon,\n iconIntent = 'primary',\n headerExtra,\n children,\n className,\n style,\n testId,\n ...props\n },\n ref\n ) {\n const cardStyle: CSSProperties = {\n background: 'var(--brycks-background-card)',\n borderRadius: 'var(--brycks-radius-lg)',\n border: '1px solid var(--brycks-border-subtle)',\n overflow: 'hidden',\n ...style,\n }\n\n const headerStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: '16px 20px',\n borderBottom: '1px solid var(--brycks-border-subtle)',\n }\n\n const headerLeftStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: 12,\n }\n\n const iconCircleStyle: CSSProperties = {\n width: 32,\n height: 32,\n borderRadius: '50%',\n background: intentColors[iconIntent],\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n }\n\n const titleStyle: CSSProperties = {\n fontFamily: 'var(--brycks-font-sans)',\n fontSize: 'var(--brycks-font-size-md)',\n fontWeight: 600,\n color: 'var(--brycks-foreground-default)',\n lineHeight: 1.4,\n margin: 0,\n }\n\n const bodyStyle: CSSProperties = {\n padding: 20,\n }\n\n const hasHeader = title || icon || headerExtra\n\n return (\n <div\n ref={ref}\n className={cx('brycks-form-card', className)}\n style={cardStyle}\n data-testid={testId}\n {...props}\n >\n {hasHeader && (\n <div className=\"brycks-form-card__header\" style={headerStyle}>\n <div style={headerLeftStyle}>\n {icon && (\n <div\n className=\"brycks-form-card__icon\"\n style={iconCircleStyle}\n >\n {icon}\n </div>\n )}\n {title && (\n <h3 className=\"brycks-form-card__title\" style={titleStyle}>\n {title}\n </h3>\n )}\n </div>\n {headerExtra && (\n <div className=\"brycks-form-card__header-extra\">\n {headerExtra}\n </div>\n )}\n </div>\n )}\n\n <div className=\"brycks-form-card__body\" style={bodyStyle}>\n {children}\n </div>\n </div>\n )\n }\n)\n\nFormCard.displayName = 'FormCard'\n"],"names":["intentColors","FormCard","forwardRef","title","icon","iconIntent","headerExtra","children","className","style","testId","props","ref","cardStyle","headerStyle","headerLeftStyle","iconCircleStyle","titleStyle","bodyStyle","hasHeader","jsxs","cx","jsx"],"mappings":";;;AAkCA,MAAMA,IAA+C;AAAA,EACnD,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AACR,GAEaC,IAAWC;AAAA,EACtB,SACE;AAAA,IACE,OAAAC;AAAA,IACA,MAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GA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OAAOL,GAC5C,UAAAd,EAAA,CACH;AAAA,YAAA,GAEJ;AAAA,YACCG,KACC,gBAAAgB,EAAC,OAAA,EAAI,WAAU,kCACZ,UAAAhB,EAAA,CACH;AAAA,UAAA,GAEJ;AAAA,4BAGD,OAAA,EAAI,WAAU,0BAAyB,OAAOY,GAC5C,UAAAX,EAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEAN,EAAS,cAAc;"}
1
+ {"version":3,"file":"FormCard.js","sources":["../../../../src/components/form/FormCard/FormCard.tsx"],"sourcesContent":["/**\n * FormCard Component\n *\n * Card wrapper optimized for form sections with optional icon and title.\n * Provides consistent spacing and visual hierarchy for form layouts.\n */\n\nimport {\n forwardRef,\n type CSSProperties,\n type ReactNode,\n type HTMLAttributes,\n} from 'react'\nimport { cx } from '../../../utils/styles'\n\nexport type FormCardIntent = 'neutral' | 'primary' | 'success' | 'warning' | 'error' | 'info'\n\nexport interface FormCardProps extends HTMLAttributes<HTMLDivElement> {\n /** Card title */\n title?: string\n /** Icon displayed before title */\n icon?: ReactNode\n /** Color intent for the icon circle */\n iconIntent?: FormCardIntent\n /** Additional content in the header (e.g., counter, badge) */\n headerExtra?: ReactNode\n /** Card body content */\n children?: ReactNode\n /** Custom class name */\n className?: string\n /** Test ID */\n testId?: string\n}\n\nconst intentColors: Record<FormCardIntent, string> = {\n neutral: 'var(--brycks-background-muted)',\n primary: 'var(--brycks-primary-muted)',\n success: 'var(--brycks-success-muted)',\n warning: 'var(--brycks-warning-muted)',\n error: 'var(--brycks-error-muted)',\n info: 'var(--brycks-info-muted)',\n}\n\nexport const FormCard = forwardRef<HTMLDivElement, FormCardProps>(\n function FormCard(\n {\n title,\n icon,\n iconIntent = 'primary',\n headerExtra,\n children,\n className,\n style,\n testId,\n ...props\n },\n ref\n ) {\n const cardStyle: CSSProperties = {\n background: 'var(--brycks-background-elevated)',\n borderRadius: 'var(--brycks-radius-lg)',\n border: '1px solid var(--brycks-border-muted)',\n overflow: 'hidden',\n ...style,\n }\n\n const headerStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: '16px 20px',\n borderBottom: '1px solid var(--brycks-border-muted)',\n }\n\n const headerLeftStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: 12,\n }\n\n const iconCircleStyle: CSSProperties = {\n width: 32,\n height: 32,\n borderRadius: '50%',\n background: intentColors[iconIntent],\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n }\n\n const titleStyle: CSSProperties = {\n fontFamily: 'var(--brycks-font-sans)',\n fontSize: 'var(--brycks-font-size-md)',\n fontWeight: 600,\n color: 'var(--brycks-foreground-default)',\n lineHeight: 1.4,\n margin: 0,\n }\n\n const bodyStyle: CSSProperties = {\n padding: 20,\n }\n\n const hasHeader = title || icon || headerExtra\n\n return (\n <div\n ref={ref}\n className={cx('brycks-form-card', className)}\n style={cardStyle}\n data-testid={testId}\n {...props}\n >\n {hasHeader && (\n <div className=\"brycks-form-card__header\" style={headerStyle}>\n <div style={headerLeftStyle}>\n {icon && (\n <div\n className=\"brycks-form-card__icon\"\n style={iconCircleStyle}\n >\n {icon}\n </div>\n )}\n {title && (\n <h3 className=\"brycks-form-card__title\" style={titleStyle}>\n {title}\n </h3>\n )}\n </div>\n {headerExtra && (\n <div className=\"brycks-form-card__header-extra\">\n {headerExtra}\n </div>\n )}\n </div>\n )}\n\n <div className=\"brycks-form-card__body\" style={bodyStyle}>\n {children}\n </div>\n </div>\n )\n }\n)\n\nFormCard.displayName = 'FormCard'\n"],"names":["intentColors","FormCard","forwardRef","title","icon","iconIntent","headerExtra","children","className","style","testId","props","ref","cardStyle","headerStyle","headerLeftStyle","iconCircleStyle","titleStyle","bodyStyle","hasHeader","jsxs","cx","jsx"],"mappings":";;;AAkCA,MAAMA,IAA+C;AAAA,EACnD,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;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AAA,YAAA,gBAAAM,EAAC,OAAA,EAAI,OAAOL,GACT,UAAA;AAAA,cAAAX,KACC,gBAAAkB;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAU;AAAA,kBACV,OAAON;AAAA,kBAEN,UAAAZ;AAAA,gBAAA;AAAA,cAAA;AAAA,cAGJD,KACC,gBAAAmB,EAAC,MAAA,EAAG,WAAU,2BAA0B,OAAOL,GAC5C,UAAAd,EAAA,CACH;AAAA,YAAA,GAEJ;AAAA,YACCG,KACC,gBAAAgB,EAAC,OAAA,EAAI,WAAU,kCACZ,UAAAhB,EAAA,CACH;AAAA,UAAA,GAEJ;AAAA,4BAGD,OAAA,EAAI,WAAU,0BAAyB,OAAOY,GAC5C,UAAAX,EAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEAN,EAAS,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),C=require("react"),D=require("../../../utils/styles.cjs"),H=require("../../../hooks/useId.cjs"),N={sm:{labelSize:12,helperSize:11,gap:4},md:{labelSize:14,helperSize:12,gap:6},lg:{labelSize:16,helperSize:14,gap:8}},u=C.forwardRef(function({size:t="md",label:n,required:g=!1,helperText:o,error:e,isInvalid:p=!1,disabled:d=!1,fieldId:h,orientation:r="vertical",labelWidth:m=120,className:S,style:b,children:a,testId:v,...x},z){const k=H.useId("field"),i=h||k,c=`${i}-helper`,f=`${i}-error`,s=N[t],y=p||!!e,F={display:"flex",flexDirection:r==="horizontal"?"row":"column",gap:r==="horizontal"?16:s.gap,alignItems:r==="horizontal"?"flex-start":"stretch",opacity:d?.6:1,...b},j={display:"flex",alignItems:"baseline",gap:4,...r==="horizontal"&&{width:m,flexShrink:0,paddingTop:t==="lg"?14:t==="md"?10:8}},I={fontSize:s.labelSize,fontWeight:500,color:d?"var(--brycks-foreground-muted)":"var(--brycks-foreground-default)",lineHeight:1.4},q={color:"var(--brycks-error-default)",marginLeft:2},$={display:"flex",flexDirection:"column",gap:s.gap,flex:1},w={fontSize:s.helperSize,color:y?"var(--brycks-error-default)":"var(--brycks-foreground-muted)",lineHeight:1.4},R={id:i,"aria-describedby":o||e?e?f:c:void 0,"aria-invalid":y?!0:void 0};return l.jsxs("div",{ref:z,className:D.cx("brycks-form-field",`brycks-form-field--${t}`,`brycks-form-field--${r}`,S),style:F,"data-testid":v,...x,children:[n&&l.jsx("div",{style:j,children:l.jsxs("label",{htmlFor:i,style:I,children:[n,g&&l.jsx("span",{style:q,"aria-hidden":"true",children:"*"})]})}),l.jsxs("div",{style:$,children:[typeof a=="function"?a(R):a,(o||e)&&l.jsx("span",{id:e?f:c,style:w,role:e?"alert":void 0,children:e||o})]})]})});u.displayName="FormField";exports.FormField=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),c=require("react"),H=require("../../../utils/styles.cjs"),N=require("../../../hooks/useId.cjs"),P={sm:{labelSize:12,helperSize:11,gap:4},md:{labelSize:14,helperSize:12,gap:6},lg:{labelSize:16,helperSize:14,gap:8}},b=c.forwardRef(function({size:t="md",label:y,required:h=!1,helperText:f,error:e,isInvalid:S=!1,disabled:p=!1,fieldId:v,orientation:r="vertical",labelWidth:x=120,className:z,style:k,children:l,testId:F,...j},I){const q=N.useId("field"),s=v||q,u=`${s}-helper`,m=`${s}-error`,a=P[t],g=S||!!e,$={display:"flex",flexDirection:r==="horizontal"?"row":"column",gap:r==="horizontal"?16:a.gap,alignItems:r==="horizontal"?"flex-start":"stretch",opacity:p?.6:1,...k},w={display:"flex",alignItems:"baseline",gap:4,...r==="horizontal"&&{width:x,flexShrink:0,paddingTop:t==="lg"?14:t==="md"?10:8}},C={fontSize:a.labelSize,fontWeight:500,color:p?"var(--brycks-foreground-muted)":"var(--brycks-foreground-default)",lineHeight:1.4},E={color:"var(--brycks-error-default)",marginLeft:2},R={display:"flex",flexDirection:"column",gap:a.gap,flex:1},D={fontSize:a.helperSize,color:g?"var(--brycks-error-default)":"var(--brycks-foreground-muted)",lineHeight:1.4},o={id:s,"aria-describedby":f||e?e?m:u:void 0,"aria-invalid":g?!0:void 0};let n;if(typeof l=="function")n=l(o);else if(c.isValidElement(l)&&c.Children.count(l)===1){const d=l;n=c.cloneElement(d,{id:d.props.id??o.id,"aria-describedby":d.props["aria-describedby"]??o["aria-describedby"],"aria-invalid":d.props["aria-invalid"]??o["aria-invalid"]})}else n=l;return i.jsxs("div",{ref:I,className:H.cx("brycks-form-field",`brycks-form-field--${t}`,`brycks-form-field--${r}`,z),style:$,"data-testid":F,...j,children:[y&&i.jsx("div",{style:w,children:i.jsxs("label",{htmlFor:s,style:C,children:[y,h&&i.jsx("span",{style:E,"aria-hidden":"true",children:"*"})]})}),i.jsxs("div",{style:R,children:[n,(f||e)&&i.jsx("span",{id:e?m:u,style:D,role:e?"alert":void 0,children:e||f})]})]})});b.displayName="FormField";exports.FormField=b;
2
2
  //# sourceMappingURL=FormField.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormField.cjs","sources":["../../../../src/components/form/FormField/FormField.tsx"],"sourcesContent":["/**\n * FormField Component\n *\n * A wrapper component that provides consistent structure for form inputs.\n * Includes label, required indicator, helper text, and error message.\n */\n\nimport { forwardRef, type CSSProperties, type ReactNode, type HTMLAttributes } from 'react'\nimport { cx } from '../../../utils/styles'\nimport { useId } from '../../../hooks/useId'\n\nexport type FormFieldSize = 'sm' | 'md' | 'lg'\n\nexport interface FormFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {\n /** Field size */\n size?: FormFieldSize\n /** Field label */\n label?: ReactNode\n /** Whether the field is required */\n required?: boolean\n /** Helper text below the field */\n helperText?: ReactNode\n /** Error message (also sets invalid state) */\n error?: ReactNode\n /** Whether the field is invalid */\n isInvalid?: boolean\n /** Whether the field is disabled */\n disabled?: boolean\n /** Custom ID for the field (auto-generated if not provided) */\n fieldId?: string\n /** Field orientation */\n orientation?: 'vertical' | 'horizontal'\n /** Label width for horizontal orientation */\n labelWidth?: number | string\n /** Custom class name */\n className?: string\n /** Children (form input) */\n children: ReactNode | ((props: { id: string; 'aria-describedby'?: string; 'aria-invalid'?: boolean }) => ReactNode)\n /** Test ID */\n testId?: string\n}\n\nconst sizeConfig: Record<FormFieldSize, { labelSize: number; helperSize: number; gap: number }> = {\n sm: { labelSize: 12, helperSize: 11, gap: 4 },\n md: { labelSize: 14, helperSize: 12, gap: 6 },\n lg: { labelSize: 16, helperSize: 14, gap: 8 },\n}\n\nexport const FormField = forwardRef<HTMLDivElement, FormFieldProps>(function FormField(\n {\n size = 'md',\n label,\n required = false,\n helperText,\n error,\n isInvalid = false,\n disabled = false,\n fieldId,\n orientation = 'vertical',\n labelWidth = 120,\n className,\n style,\n children,\n testId,\n ...props\n },\n ref\n) {\n const generatedId = useId('field')\n const id = fieldId || generatedId\n const helperId = `${id}-helper`\n const errorId = `${id}-error`\n const config = sizeConfig[size]\n const hasError = isInvalid || !!error\n\n const containerStyle: CSSProperties = {\n display: 'flex',\n flexDirection: orientation === 'horizontal' ? 'row' : 'column',\n gap: orientation === 'horizontal' ? 16 : config.gap,\n alignItems: orientation === 'horizontal' ? 'flex-start' : 'stretch',\n opacity: disabled ? 0.6 : 1,\n ...style,\n }\n\n const labelContainerStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'baseline',\n gap: 4,\n ...(orientation === 'horizontal' && {\n width: labelWidth,\n flexShrink: 0,\n paddingTop: size === 'lg' ? 14 : size === 'md' ? 10 : 8,\n }),\n }\n\n const labelStyle: CSSProperties = {\n fontSize: config.labelSize,\n fontWeight: 500,\n color: disabled\n ? 'var(--brycks-foreground-muted)'\n : 'var(--brycks-foreground-default)',\n lineHeight: 1.4,\n }\n\n const requiredStyle: CSSProperties = {\n color: 'var(--brycks-error-default)',\n marginLeft: 2,\n }\n\n const contentStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: config.gap,\n flex: 1,\n }\n\n const helperStyle: CSSProperties = {\n fontSize: config.helperSize,\n color: hasError ? 'var(--brycks-error-default)' : 'var(--brycks-foreground-muted)',\n lineHeight: 1.4,\n }\n\n // Props to pass to the child input\n const childProps = {\n id,\n 'aria-describedby': helperText || error ? (error ? errorId : helperId) : undefined,\n 'aria-invalid': hasError ? true : undefined,\n }\n\n return (\n <div\n ref={ref}\n className={cx('brycks-form-field', `brycks-form-field--${size}`, `brycks-form-field--${orientation}`, className)}\n style={containerStyle}\n data-testid={testId}\n {...props}\n >\n {label && (\n <div style={labelContainerStyle}>\n <label htmlFor={id} style={labelStyle}>\n {label}\n {required && <span style={requiredStyle} aria-hidden=\"true\">*</span>}\n </label>\n </div>\n )}\n <div style={contentStyle}>\n {typeof children === 'function' ? children(childProps) : children}\n {(helperText || error) && (\n <span\n id={error ? errorId : helperId}\n style={helperStyle}\n role={error ? 'alert' : undefined}\n >\n {error || helperText}\n </span>\n )}\n </div>\n </div>\n )\n})\n\nFormField.displayName = 'FormField'\n"],"names":["sizeConfig","FormField","forwardRef","size","label","required","helperText","error","isInvalid","disabled","fieldId","orientation","labelWidth","className","style","children","testId","props","ref","generatedId","useId","id","helperId","errorId","config","hasError","containerStyle","labelContainerStyle","labelStyle","requiredStyle","contentStyle","helperStyle","childProps","jsxs","cx","jsx"],"mappings":"qNA0CMA,EAA4F,CAChG,GAAI,CAAE,UAAW,GAAI,WAAY,GAAI,IAAK,CAAA,EAC1C,GAAI,CAAE,UAAW,GAAI,WAAY,GAAI,IAAK,CAAA,EAC1C,GAAI,CAAE,UAAW,GAAI,WAAY,GAAI,IAAK,CAAA,CAC5C,EAEaC,EAAYC,EAAAA,WAA2C,SAClE,CACE,KAAAC,EAAO,KACP,MAAAC,EACA,SAAAC,EAAW,GACX,WAAAC,EACA,MAAAC,EACA,UAAAC,EAAY,GACZ,SAAAC,EAAW,GACX,QAAAC,EACA,YAAAC,EAAc,WACd,WAAAC,EAAa,IACb,UAAAC,EACA,MAAAC,EAC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OO,EACxB,SAAA,CAAAxB,EACAC,GAAY8B,EAAAA,IAAC,OAAA,CAAK,MAAON,EAAe,cAAY,OAAO,SAAA,GAAA,CAAC,CAAA,CAAA,CAC/D,CAAA,CACF,EAEFI,EAAAA,KAAC,MAAA,CAAI,MAAOH,EACT,SAAA,CAAA,OAAOf,GAAa,WAAaA,EAASiB,CAAU,EAAIjB,GACvDT,GAAcC,IACd4B,EAAAA,IAAC,OAAA,CACC,GAAI5B,EAAQgB,EAAUD,EACtB,MAAOS,EACP,KAAMxB,EAAQ,QAAU,OAEvB,SAAAA,GAASD,CAAA,CAAA,CACZ,CAAA,CAEJ,CAAA,CAAA,CAAA,CAGN,CAAC,EAEDL,EAAU,YAAc"}
1
+ {"version":3,"file":"FormField.cjs","sources":["../../../../src/components/form/FormField/FormField.tsx"],"sourcesContent":["/**\n * FormField Component\n *\n * A wrapper component that provides consistent structure for form inputs.\n * Includes label, required indicator, helper text, and error message.\n */\n\nimport {\n Children,\n cloneElement,\n forwardRef,\n isValidElement,\n type CSSProperties,\n type ReactNode,\n type HTMLAttributes,\n type ReactElement,\n} from 'react'\nimport { cx } from '../../../utils/styles'\nimport { useId } from '../../../hooks/useId'\n\nexport type FormFieldSize = 'sm' | 'md' | 'lg'\n\nexport interface FormFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {\n /** Field size */\n size?: FormFieldSize\n /** Field label */\n label?: ReactNode\n /** Whether the field is required */\n required?: boolean\n /** Helper text below the field */\n helperText?: ReactNode\n /** Error message (also sets invalid state) */\n error?: ReactNode\n /** Whether the field is invalid */\n isInvalid?: boolean\n /** Whether the field is disabled */\n disabled?: boolean\n /** Custom ID for the field (auto-generated if not provided) */\n fieldId?: string\n /** Field orientation */\n orientation?: 'vertical' | 'horizontal'\n /** Label width for horizontal orientation */\n labelWidth?: number | string\n /** Custom class name */\n className?: string\n /** Children (form input) */\n children: ReactNode | ((props: { id: string; 'aria-describedby'?: string; 'aria-invalid'?: boolean }) => ReactNode)\n /** Test ID */\n testId?: string\n}\n\nconst sizeConfig: Record<FormFieldSize, { labelSize: number; helperSize: number; gap: number }> = {\n sm: { labelSize: 12, helperSize: 11, gap: 4 },\n md: { labelSize: 14, helperSize: 12, gap: 6 },\n lg: { labelSize: 16, helperSize: 14, gap: 8 },\n}\n\nexport const FormField = forwardRef<HTMLDivElement, FormFieldProps>(function FormField(\n {\n size = 'md',\n label,\n required = false,\n helperText,\n error,\n isInvalid = false,\n disabled = false,\n fieldId,\n orientation = 'vertical',\n labelWidth = 120,\n className,\n style,\n children,\n testId,\n ...props\n },\n ref\n) {\n const generatedId = useId('field')\n const id = fieldId || generatedId\n const helperId = `${id}-helper`\n const errorId = `${id}-error`\n const config = sizeConfig[size]\n const hasError = isInvalid || !!error\n\n const containerStyle: CSSProperties = {\n display: 'flex',\n flexDirection: orientation === 'horizontal' ? 'row' : 'column',\n gap: orientation === 'horizontal' ? 16 : config.gap,\n alignItems: orientation === 'horizontal' ? 'flex-start' : 'stretch',\n opacity: disabled ? 0.6 : 1,\n ...style,\n }\n\n const labelContainerStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'baseline',\n gap: 4,\n ...(orientation === 'horizontal' && {\n width: labelWidth,\n flexShrink: 0,\n paddingTop: size === 'lg' ? 14 : size === 'md' ? 10 : 8,\n }),\n }\n\n const labelStyle: CSSProperties = {\n fontSize: config.labelSize,\n fontWeight: 500,\n color: disabled\n ? 'var(--brycks-foreground-muted)'\n : 'var(--brycks-foreground-default)',\n lineHeight: 1.4,\n }\n\n const requiredStyle: CSSProperties = {\n color: 'var(--brycks-error-default)',\n marginLeft: 2,\n }\n\n const contentStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: config.gap,\n flex: 1,\n }\n\n const helperStyle: CSSProperties = {\n fontSize: config.helperSize,\n color: hasError ? 'var(--brycks-error-default)' : 'var(--brycks-foreground-muted)',\n lineHeight: 1.4,\n }\n\n // Props to pass to the child input\n const childProps = {\n id,\n 'aria-describedby': helperText || error ? (error ? errorId : helperId) : undefined,\n 'aria-invalid': hasError ? true : undefined,\n }\n\n // Wire id/aria onto the input automatically when children is a single\n // element, so `<FormField label=\"...\"><Input /></FormField>` associates the\n // label without the render-prop form. Explicit props on the child win.\n let content: ReactNode\n if (typeof children === 'function') {\n content = children(childProps)\n } else if (isValidElement(children) && Children.count(children) === 1) {\n const element = children as ReactElement<Record<string, unknown>>\n content = cloneElement(element, {\n id: element.props.id ?? childProps.id,\n 'aria-describedby': element.props['aria-describedby'] ?? childProps['aria-describedby'],\n 'aria-invalid': element.props['aria-invalid'] ?? childProps['aria-invalid'],\n })\n } else {\n content = children\n }\n\n return (\n <div\n ref={ref}\n className={cx('brycks-form-field', `brycks-form-field--${size}`, `brycks-form-field--${orientation}`, className)}\n style={containerStyle}\n data-testid={testId}\n {...props}\n >\n {label && (\n <div style={labelContainerStyle}>\n <label htmlFor={id} style={labelStyle}>\n {label}\n {required && <span style={requiredStyle} aria-hidden=\"true\">*</span>}\n </label>\n </div>\n )}\n <div style={contentStyle}>\n {content}\n {(helperText || error) && (\n <span\n id={error ? errorId : helperId}\n style={helperStyle}\n role={error ? 'alert' : undefined}\n >\n {error || helperText}\n </span>\n )}\n </div>\n </div>\n )\n})\n\nFormField.displayName = 'FormField'\n"],"names":["sizeConfig","FormField","forwardRef","size","label","required","helperText","error","isInvalid","disabled","fieldId","orientation","labelWidth","className","style","children","testId","props","ref","generatedId","useId","id","helperId","errorId","config","hasError","containerStyle","labelContainerStyle","labelStyle","requiredStyle","contentStyle","helperStyle","childProps","content","isValidElement","Children","element","cloneElement","jsxs","cx","jsx"],"mappings":"qNAmDMA,EAA4F,CAChG,GAAI,CAAE,UAAW,GAAI,WAAY,GAAI,IAAK,CAAA,EAC1C,GAAI,CAAE,UAAW,GAAI,WAAY,GAAI,IAAK,CAAA,EAC1C,GAAI,CAAE,UAAW,GAAI,WAAY,GAAI,IAAK,CAAA,CAC5C,EAEaC,EAAYC,EAAAA,WAA2C,SAClE,CACE,K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AAenB,CAAQ,GAAKoB,EAAAA,SAAS,MAAMpB,CAAQ,IAAM,EAAG,CACrE,MAAMqB,EAAUrB,EAChBkB,EAAUI,EAAAA,aAAaD,EAAS,CAC9B,GAAIA,EAAQ,MAAM,IAAMJ,EAAW,GACnC,mBAAoBI,EAAQ,MAAM,kBAAkB,GAAKJ,EAAW,kBAAkB,EACtF,eAAgBI,EAAQ,MAAM,cAAc,GAAKJ,EAAW,cAAc,CAAA,CAC3E,CACH,MACEC,EAAUlB,EAGZ,OACEuB,EAAAA,KAAC,MAAA,CACC,IAAApB,EACA,UAAWqB,EAAAA,GAAG,oBAAqB,sBAAsBpC,CAAI,GAAI,sBAAsBQ,CAAW,GAAIE,CAAS,EAC/G,MAAOa,EACP,cAAaV,EACZ,GAAGC,EAEH,SAAA,CAAAb,GACCoC,EAAAA,IAAC,OAAI,MAAOb,EACV,gBAAC,QAAA,CAAM,QAASN,EAAI,MAAOO,EACxB,SAAA,CAAAxB,EACAC,GAAYmC,EAAAA,IAAC,OAAA,CAAK,MAAOX,EAAe,cAAY,OAAO,SAAA,GAAA,CAAC,CAAA,CAAA,CAC/D,CAAA,CACF,EAEFS,EAAAA,KAAC,MAAA,CAAI,MAAOR,EACT,SAAA,CAAAG,GACC3B,GAAcC,IACdiC,EAAAA,IAAC,OAAA,CACC,GAAIjC,EAAQgB,EAAUD,EACtB,MAAOS,EACP,KAAMxB,EAAQ,QAAU,OAEvB,SAAAA,GAASD,CAAA,CAAA,CACZ,CAAA,CAEJ,CAAA,CAAA,CAAA,CAGN,CAAC,EAEDL,EAAU,YAAc"}
@@ -1,88 +1,100 @@
1
- import { jsxs as n, jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as H } from "react";
3
- import { cx as N } from "../../../utils/styles.js";
4
- import { useId as q } from "../../../hooks/useId.js";
5
- const E = {
1
+ import { jsxs as c, jsx as f } from "react/jsx-runtime";
2
+ import { forwardRef as N, isValidElement as q, Children as L, cloneElement as P } from "react";
3
+ import { cx as R } from "../../../utils/styles.js";
4
+ import { useId as V } from "../../../hooks/useId.js";
5
+ const W = {
6
6
  sm: { labelSize: 12, helperSize: 11, gap: 4 },
7
7
  md: { labelSize: 14, helperSize: 12, gap: 6 },
8
8
  lg: { labelSize: 16, helperSize: 14, gap: 8 }
9
- }, L = H(function({
9
+ }, A = N(function({
10
10
  size: r = "md",
11
- label: d,
12
- required: y = !1,
13
- helperText: i,
11
+ label: p,
12
+ required: h = !1,
13
+ helperText: n,
14
14
  error: e,
15
- isInvalid: g = !1,
16
- disabled: c = !1,
17
- fieldId: h,
18
- orientation: l = "vertical",
19
- labelWidth: u = 120,
20
- className: S,
21
- style: b,
22
- children: a,
23
- testId: v,
24
- ...z
25
- }, x) {
26
- const k = q("field"), o = h || k, f = `${o}-helper`, p = `${o}-error`, t = E[r], m = g || !!e, F = {
15
+ isInvalid: u = !1,
16
+ disabled: m = !1,
17
+ fieldId: S,
18
+ orientation: i = "vertical",
19
+ labelWidth: v = 120,
20
+ className: z,
21
+ style: x,
22
+ children: l,
23
+ testId: k,
24
+ ...F
25
+ }, I) {
26
+ const $ = V("field"), o = S || $, y = `${o}-helper`, g = `${o}-error`, t = W[r], b = u || !!e, w = {
27
27
  display: "flex",
28
- flexDirection: l === "horizontal" ? "row" : "column",
29
- gap: l === "horizontal" ? 16 : t.gap,
30
- alignItems: l === "horizontal" ? "flex-start" : "stretch",
31
- opacity: c ? 0.6 : 1,
32
- ...b
33
- }, I = {
28
+ flexDirection: i === "horizontal" ? "row" : "column",
29
+ gap: i === "horizontal" ? 16 : t.gap,
30
+ alignItems: i === "horizontal" ? "flex-start" : "stretch",
31
+ opacity: m ? 0.6 : 1,
32
+ ...x
33
+ }, C = {
34
34
  display: "flex",
35
35
  alignItems: "baseline",
36
36
  gap: 4,
37
- ...l === "horizontal" && {
38
- width: u,
37
+ ...i === "horizontal" && {
38
+ width: v,
39
39
  flexShrink: 0,
40
40
  paddingTop: r === "lg" ? 14 : r === "md" ? 10 : 8
41
41
  }
42
- }, $ = {
42
+ }, E = {
43
43
  fontSize: t.labelSize,
44
44
  fontWeight: 500,
45
- color: c ? "var(--brycks-foreground-muted)" : "var(--brycks-foreground-default)",
45
+ color: m ? "var(--brycks-foreground-muted)" : "var(--brycks-foreground-default)",
46
46
  lineHeight: 1.4
47
- }, w = {
47
+ }, j = {
48
48
  color: "var(--brycks-error-default)",
49
49
  marginLeft: 2
50
- }, j = {
50
+ }, D = {
51
51
  display: "flex",
52
52
  flexDirection: "column",
53
53
  gap: t.gap,
54
54
  flex: 1
55
- }, C = {
55
+ }, H = {
56
56
  fontSize: t.helperSize,
57
- color: m ? "var(--brycks-error-default)" : "var(--brycks-foreground-muted)",
57
+ color: b ? "var(--brycks-error-default)" : "var(--brycks-foreground-muted)",
58
58
  lineHeight: 1.4
59
- }, D = {
59
+ }, a = {
60
60
  id: o,
61
- "aria-describedby": i || e ? e ? p : f : void 0,
62
- "aria-invalid": m ? !0 : void 0
61
+ "aria-describedby": n || e ? e ? g : y : void 0,
62
+ "aria-invalid": b ? !0 : void 0
63
63
  };
64
- return /* @__PURE__ */ n(
64
+ let d;
65
+ if (typeof l == "function")
66
+ d = l(a);
67
+ else if (q(l) && L.count(l) === 1) {
68
+ const s = l;
69
+ d = P(s, {
70
+ id: s.props.id ?? a.id,
71
+ "aria-describedby": s.props["aria-describedby"] ?? a["aria-describedby"],
72
+ "aria-invalid": s.props["aria-invalid"] ?? a["aria-invalid"]
73
+ });
74
+ } else
75
+ d = l;
76
+ return /* @__PURE__ */ c(
65
77
  "div",
66
78
  {
67
- ref: x,
68
- className: N("brycks-form-field", `brycks-form-field--${r}`, `brycks-form-field--${l}`, S),
69
- style: F,
70
- "data-testid": v,
71
- ...z,
79
+ ref: I,
80
+ className: R("brycks-form-field", `brycks-form-field--${r}`, `brycks-form-field--${i}`, z),
81
+ style: w,
82
+ "data-testid": k,
83
+ ...F,
72
84
  children: [
73
- d && /* @__PURE__ */ s("div", { style: I, children: /* @__PURE__ */ n("label", { htmlFor: o, style: $, children: [
74
- d,
75
- y && /* @__PURE__ */ s("span", { style: w, "aria-hidden": "true", children: "*" })
85
+ p && /* @__PURE__ */ f("div", { style: C, children: /* @__PURE__ */ c("label", { htmlFor: o, style: E, children: [
86
+ p,
87
+ h && /* @__PURE__ */ f("span", { style: j, "aria-hidden": "true", children: "*" })
76
88
  ] }) }),
77
- /* @__PURE__ */ n("div", { style: j, children: [
78
- typeof a == "function" ? a(D) : a,
79
- (i || e) && /* @__PURE__ */ s(
89
+ /* @__PURE__ */ c("div", { style: D, children: [
90
+ d,
91
+ (n || e) && /* @__PURE__ */ f(
80
92
  "span",
81
93
  {
82
- id: e ? p : f,
83
- style: C,
94
+ id: e ? g : y,
95
+ style: H,
84
96
  role: e ? "alert" : void 0,
85
- children: e || i
97
+ children: e || n
86
98
  }
87
99
  )
88
100
  ] })
@@ -90,8 +102,8 @@ const E = {
90
102
  }
91
103
  );
92
104
  });
93
- L.displayName = "FormField";
105
+ A.displayName = "FormField";
94
106
  export {
95
- L as FormField
107
+ A as FormField
96
108
  };
97
109
  //# sourceMappingURL=FormField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormField.js","sources":["../../../../src/components/form/FormField/FormField.tsx"],"sourcesContent":["/**\n * FormField Component\n *\n * A wrapper component that provides consistent structure for form inputs.\n * Includes label, required indicator, helper text, and error message.\n */\n\nimport { forwardRef, type CSSProperties, type ReactNode, type HTMLAttributes } from 'react'\nimport { cx } from '../../../utils/styles'\nimport { useId } from '../../../hooks/useId'\n\nexport type FormFieldSize = 'sm' | 'md' | 'lg'\n\nexport interface FormFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {\n /** Field size */\n size?: FormFieldSize\n /** Field label */\n label?: ReactNode\n /** Whether the field is required */\n required?: boolean\n /** Helper text below the field */\n helperText?: ReactNode\n /** Error message (also sets invalid state) */\n error?: ReactNode\n /** Whether the field is invalid */\n isInvalid?: boolean\n /** Whether the field is disabled */\n disabled?: boolean\n /** Custom ID for the field (auto-generated if not provided) */\n fieldId?: string\n /** Field orientation */\n orientation?: 'vertical' | 'horizontal'\n /** Label width for horizontal orientation */\n labelWidth?: number | string\n /** Custom class name */\n className?: string\n /** Children (form input) */\n children: ReactNode | ((props: { id: string; 'aria-describedby'?: string; 'aria-invalid'?: boolean }) => ReactNode)\n /** Test ID */\n testId?: string\n}\n\nconst sizeConfig: Record<FormFieldSize, { labelSize: number; helperSize: number; gap: number }> = {\n sm: { labelSize: 12, helperSize: 11, gap: 4 },\n md: { labelSize: 14, helperSize: 12, gap: 6 },\n lg: { labelSize: 16, helperSize: 14, gap: 8 },\n}\n\nexport const FormField = forwardRef<HTMLDivElement, FormFieldProps>(function FormField(\n {\n size = 'md',\n label,\n required = false,\n helperText,\n error,\n isInvalid = false,\n disabled = false,\n fieldId,\n orientation = 'vertical',\n labelWidth = 120,\n className,\n style,\n children,\n testId,\n ...props\n },\n ref\n) {\n const generatedId = useId('field')\n const id = fieldId || generatedId\n const helperId = `${id}-helper`\n const errorId = `${id}-error`\n const config = sizeConfig[size]\n const hasError = isInvalid || !!error\n\n const containerStyle: CSSProperties = {\n display: 'flex',\n flexDirection: orientation === 'horizontal' ? 'row' : 'column',\n gap: orientation === 'horizontal' ? 16 : config.gap,\n alignItems: orientation === 'horizontal' ? 'flex-start' : 'stretch',\n opacity: disabled ? 0.6 : 1,\n ...style,\n }\n\n const labelContainerStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'baseline',\n gap: 4,\n ...(orientation === 'horizontal' && {\n width: labelWidth,\n flexShrink: 0,\n paddingTop: size === 'lg' ? 14 : size === 'md' ? 10 : 8,\n }),\n }\n\n const labelStyle: CSSProperties = {\n fontSize: config.labelSize,\n fontWeight: 500,\n color: disabled\n ? 'var(--brycks-foreground-muted)'\n : 'var(--brycks-foreground-default)',\n lineHeight: 1.4,\n }\n\n const requiredStyle: CSSProperties = {\n color: 'var(--brycks-error-default)',\n marginLeft: 2,\n }\n\n const contentStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: config.gap,\n flex: 1,\n }\n\n const helperStyle: CSSProperties = {\n fontSize: config.helperSize,\n color: hasError ? 'var(--brycks-error-default)' : 'var(--brycks-foreground-muted)',\n lineHeight: 1.4,\n }\n\n // Props to pass to the child input\n const childProps = {\n id,\n 'aria-describedby': helperText || error ? (error ? errorId : helperId) : undefined,\n 'aria-invalid': hasError ? true : undefined,\n }\n\n return (\n <div\n ref={ref}\n className={cx('brycks-form-field', `brycks-form-field--${size}`, `brycks-form-field--${orientation}`, className)}\n style={containerStyle}\n data-testid={testId}\n {...props}\n >\n {label && (\n <div style={labelContainerStyle}>\n <label htmlFor={id} style={labelStyle}>\n {label}\n {required && <span style={requiredStyle} aria-hidden=\"true\">*</span>}\n </label>\n </div>\n )}\n <div style={contentStyle}>\n {typeof children === 'function' ? children(childProps) : children}\n {(helperText || error) && (\n <span\n id={error ? errorId : helperId}\n style={helperStyle}\n role={error ? 'alert' : undefined}\n >\n {error || helperText}\n </span>\n )}\n </div>\n </div>\n )\n})\n\nFormField.displayName = 'FormField'\n"],"names":["sizeConfig","FormField","forwardRef","size","label","required","helperText","error","isInvalid","disabled","fieldId","orientation","labelWidth","className","style","children","testId","props","ref","generatedId","useId","id","helperId","errorId","config","hasError","containerStyle","labelContainerStyle","labelStyle","requiredStyle","contentStyle","helperStyle","childProps","jsxs","cx","jsx"],"mappings":";;;;AA0CA,MAAMA,IAA4F;AAAA,EAChG,IAAI,EAAE,WAAW,IAAI,YAAY,IAAI,KAAK,EAAA;AAAA,EAC1C,IAAI,EAAE,WAAW,IAAI,YAAY,IAAI,KAAK,EAAA;AAAA,EAC1C,IAAI,EAAE,WAAW,IAAI,YAAY,IAAI,KAAK,EAAA;AAC5C,GAEaC,IAAYC,EAA2C,SAClE;AAAA,EACE,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EAC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AAoBf,KAAcC,IAASA,IAAQgB,IAAUD,IAAY;AAAA,IACzE,gBAAgBG,IAAW,KAAO;AAAA,EAAA;AAGpC,SACE,gBAAAQ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAf;AAAA,MACA,WAAWgB,EAAG,qBAAqB,sBAAsB/B,CAAI,IAAI,sBAAsBQ,CAAW,IAAIE,CAAS;AAAA,MAC/G,OAAOa;AAAA,MACP,eAAaV;AAAA,MACZ,GAAGC;AAAA,MAEH,UAAA;AAAA,QAAAb,KACC,gBAAA+B,EAAC,SAAI,OAAOR,GACV,4BAAC,SAAA,EAAM,SAASN,GAAI,OAAOO,GACxB,UAAA;AAAA,UAAAxB;AAAA,UACAC,KAAY,gBAAA8B,EAAC,QAAA,EAAK,OAAON,GAAe,eAAY,QAAO,UAAA,IAAA,CAAC;AAAA,QAAA,EAAA,CAC/D,EAAA,CACF;AAAA,QAEF,gBAAAI,EAAC,OAAA,EAAI,OAAOH,GACT,UAAA;AAAA,UAAA,OAAOf,KAAa,aAAaA,EAASiB,CAAU,IAAIjB;AAAA,WACvDT,KAAcC,MACd,gBAAA4B;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAI5B,IAAQgB,IAAUD;AAAA,cACtB,OAAOS;AAAA,cACP,MAAMxB,IAAQ,UAAU;AAAA,cAEvB,UAAAA,KAASD;AAAA,YAAA;AAAA,UAAA;AAAA,QACZ,EAAA,CAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;AAEDL,EAAU,cAAc;"}
1
+ {"version":3,"file":"FormField.js","sources":["../../../../src/components/form/FormField/FormField.tsx"],"sourcesContent":["/**\n * FormField Component\n *\n * A wrapper component that provides consistent structure for form inputs.\n * Includes label, required indicator, helper text, and error message.\n */\n\nimport {\n Children,\n cloneElement,\n forwardRef,\n isValidElement,\n type CSSProperties,\n type ReactNode,\n type HTMLAttributes,\n type ReactElement,\n} from 'react'\nimport { cx } from '../../../utils/styles'\nimport { useId } from '../../../hooks/useId'\n\nexport type FormFieldSize = 'sm' | 'md' | 'lg'\n\nexport interface FormFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {\n /** Field size */\n size?: FormFieldSize\n /** Field label */\n label?: ReactNode\n /** Whether the field is required */\n required?: boolean\n /** Helper text below the field */\n helperText?: ReactNode\n /** Error message (also sets invalid state) */\n error?: ReactNode\n /** Whether the field is invalid */\n isInvalid?: boolean\n /** Whether the field is disabled */\n disabled?: boolean\n /** Custom ID for the field (auto-generated if not provided) */\n fieldId?: string\n /** Field orientation */\n orientation?: 'vertical' | 'horizontal'\n /** Label width for horizontal orientation */\n labelWidth?: number | string\n /** Custom class name */\n className?: string\n /** Children (form input) */\n children: ReactNode | ((props: { id: string; 'aria-describedby'?: string; 'aria-invalid'?: boolean }) => ReactNode)\n /** Test ID */\n testId?: string\n}\n\nconst sizeConfig: Record<FormFieldSize, { labelSize: number; helperSize: number; gap: number }> = {\n sm: { labelSize: 12, helperSize: 11, gap: 4 },\n md: { labelSize: 14, helperSize: 12, gap: 6 },\n lg: { labelSize: 16, helperSize: 14, gap: 8 },\n}\n\nexport const FormField = forwardRef<HTMLDivElement, FormFieldProps>(function FormField(\n {\n size = 'md',\n label,\n required = false,\n helperText,\n error,\n isInvalid = false,\n disabled = false,\n fieldId,\n orientation = 'vertical',\n labelWidth = 120,\n className,\n style,\n children,\n testId,\n ...props\n },\n ref\n) {\n const generatedId = useId('field')\n const id = fieldId || generatedId\n const helperId = `${id}-helper`\n const errorId = `${id}-error`\n const config = sizeConfig[size]\n const hasError = isInvalid || !!error\n\n const containerStyle: CSSProperties = {\n display: 'flex',\n flexDirection: orientation === 'horizontal' ? 'row' : 'column',\n gap: orientation === 'horizontal' ? 16 : config.gap,\n alignItems: orientation === 'horizontal' ? 'flex-start' : 'stretch',\n opacity: disabled ? 0.6 : 1,\n ...style,\n }\n\n const labelContainerStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'baseline',\n gap: 4,\n ...(orientation === 'horizontal' && {\n width: labelWidth,\n flexShrink: 0,\n paddingTop: size === 'lg' ? 14 : size === 'md' ? 10 : 8,\n }),\n }\n\n const labelStyle: CSSProperties = {\n fontSize: config.labelSize,\n fontWeight: 500,\n color: disabled\n ? 'var(--brycks-foreground-muted)'\n : 'var(--brycks-foreground-default)',\n lineHeight: 1.4,\n }\n\n const requiredStyle: CSSProperties = {\n color: 'var(--brycks-error-default)',\n marginLeft: 2,\n }\n\n const contentStyle: CSSProperties = {\n display: 'flex',\n flexDirection: 'column',\n gap: config.gap,\n flex: 1,\n }\n\n const helperStyle: CSSProperties = {\n fontSize: config.helperSize,\n color: hasError ? 'var(--brycks-error-default)' : 'var(--brycks-foreground-muted)',\n lineHeight: 1.4,\n }\n\n // Props to pass to the child input\n const childProps = {\n id,\n 'aria-describedby': helperText || error ? (error ? errorId : helperId) : undefined,\n 'aria-invalid': hasError ? true : undefined,\n }\n\n // Wire id/aria onto the input automatically when children is a single\n // element, so `<FormField label=\"...\"><Input /></FormField>` associates the\n // label without the render-prop form. Explicit props on the child win.\n let content: ReactNode\n if (typeof children === 'function') {\n content = children(childProps)\n } else if (isValidElement(children) && Children.count(children) === 1) {\n const element = children as ReactElement<Record<string, unknown>>\n content = cloneElement(element, {\n id: element.props.id ?? childProps.id,\n 'aria-describedby': element.props['aria-describedby'] ?? childProps['aria-describedby'],\n 'aria-invalid': element.props['aria-invalid'] ?? childProps['aria-invalid'],\n })\n } else {\n content = children\n }\n\n return (\n <div\n ref={ref}\n className={cx('brycks-form-field', `brycks-form-field--${size}`, `brycks-form-field--${orientation}`, className)}\n style={containerStyle}\n data-testid={testId}\n {...props}\n >\n {label && (\n <div style={labelContainerStyle}>\n <label htmlFor={id} style={labelStyle}>\n {label}\n {required && <span style={requiredStyle} aria-hidden=\"true\">*</span>}\n </label>\n </div>\n )}\n <div style={contentStyle}>\n {content}\n {(helperText || error) && (\n <span\n id={error ? errorId : helperId}\n style={helperStyle}\n role={error ? 'alert' : undefined}\n >\n {error || helperText}\n </span>\n )}\n </div>\n </div>\n )\n})\n\nFormField.displayName = 'FormField'\n"],"names":["sizeConfig","FormField","forwardRef","size","label","required","helperText","error","isInvalid","disabled","fieldId","orientation","labelWidth","className","style","children","testId","props","ref","generatedId","useId","id","helperId","errorId","config","hasError","containerStyle","labelContainerStyle","labelStyle","requiredStyle","contentStyle","helperStyle","childProps","content","isValidElement","Children","element","cloneElement","jsxs","cx","jsx"],"mappings":";;;;AAmDA,MAAMA,IAA4F;AAAA,EAChG,IAAI,EAAE,WAAW,IAAI,YAAY,IAAI,KAAK,EAAA;AAAA,EAC1C,IAAI,EAAE,WAAW,IAAI,YAAY,IAAI,KAAK,EAAA;AAAA,EAC1C,IAAI,EAAE,WAAW,IAAI,YAAY,IAAI,KAAK,EAAA;AAC5C,GAEaC,IAAYC,EAA2C,SAClE;AAAA,EACE,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,SAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,YAAAC,IAAa;AAAA,EACb,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAcC,EAAM,OAAO,GAC3BC,IAAKX,KAAWS,GAChBG,IAAW,GAAGD,CAAE,WAChBE,IAAU,GAAGF,CAAE,UACfG,IAASxB,EAAWG,CAAI,GACxBsB,IAAWjB,KAAa,CAAC,CAACD,GAE1BmB,IAAgC;AAAA,IACpC,SAAS;AAAA,IACT,eAAef,MAAgB,eAAe,QAAQ;AAAA,IACtD,KAAKA,MAAgB,eAAe,KAAKa,EAAO;AAAA,IAChD,YAAYb,MAAgB,eAAe,eAAe;AAAA,IAC1D,SAASF,IAAW,MAAM;AAAA,IAC1B,GAAGK;AAAA,EAAA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