@veeqo/ui 14.6.0 → 14.7.1-beta-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/dist/components/AnimatedDropdown/AnimatedDropdown.cjs +22 -5
  2. package/dist/components/AnimatedDropdown/AnimatedDropdown.cjs.map +1 -1
  3. package/dist/components/AnimatedDropdown/AnimatedDropdown.js +22 -5
  4. package/dist/components/AnimatedDropdown/AnimatedDropdown.js.map +1 -1
  5. package/dist/components/AnimatedDropdown/AnimatedDropdown.module.scss.cjs +9 -0
  6. package/dist/components/AnimatedDropdown/AnimatedDropdown.module.scss.cjs.map +1 -0
  7. package/dist/components/AnimatedDropdown/AnimatedDropdown.module.scss.js +7 -0
  8. package/dist/components/AnimatedDropdown/AnimatedDropdown.module.scss.js.map +1 -0
  9. package/dist/components/AnimatedDropdown/components/BasicDropdown.cjs +5 -3
  10. package/dist/components/AnimatedDropdown/components/BasicDropdown.cjs.map +1 -1
  11. package/dist/components/AnimatedDropdown/components/BasicDropdown.js +5 -3
  12. package/dist/components/AnimatedDropdown/components/BasicDropdown.js.map +1 -1
  13. package/dist/components/AnimatedDropdown/components/BasicDropdown.module.scss.cjs +9 -0
  14. package/dist/components/AnimatedDropdown/components/BasicDropdown.module.scss.cjs.map +1 -0
  15. package/dist/components/AnimatedDropdown/components/BasicDropdown.module.scss.js +7 -0
  16. package/dist/components/AnimatedDropdown/components/BasicDropdown.module.scss.js.map +1 -0
  17. package/dist/components/Button/Button.cjs +30 -16
  18. package/dist/components/Button/Button.cjs.map +1 -1
  19. package/dist/components/Button/Button.d.ts +8 -0
  20. package/dist/components/Button/Button.js +30 -16
  21. package/dist/components/Button/Button.js.map +1 -1
  22. package/dist/components/Button/Button.module.scss.cjs +9 -0
  23. package/dist/components/Button/Button.module.scss.cjs.map +1 -0
  24. package/dist/components/Button/Button.module.scss.js +7 -0
  25. package/dist/components/Button/Button.module.scss.js.map +1 -0
  26. package/dist/components/Button/types.d.ts +9 -1
  27. package/dist/components/Choice/Choice.cjs +2 -1
  28. package/dist/components/Choice/Choice.cjs.map +1 -1
  29. package/dist/components/Choice/Choice.js +2 -1
  30. package/dist/components/Choice/Choice.js.map +1 -1
  31. package/dist/components/Choice/components/BlockTooltip.cjs +16 -0
  32. package/dist/components/Choice/components/BlockTooltip.cjs.map +1 -0
  33. package/dist/components/Choice/components/BlockTooltip.d.ts +3 -0
  34. package/dist/components/Choice/components/BlockTooltip.js +10 -0
  35. package/dist/components/Choice/components/BlockTooltip.js.map +1 -0
  36. package/dist/components/Choice/components/BlockTooltip.module.scss.cjs +9 -0
  37. package/dist/components/Choice/components/BlockTooltip.module.scss.cjs.map +1 -0
  38. package/dist/components/Choice/components/BlockTooltip.module.scss.js +7 -0
  39. package/dist/components/Choice/components/BlockTooltip.module.scss.js.map +1 -0
  40. package/dist/components/Choice/components/styled.cjs +0 -3
  41. package/dist/components/Choice/components/styled.cjs.map +1 -1
  42. package/dist/components/Choice/components/styled.d.ts +0 -1
  43. package/dist/components/Choice/components/styled.js +1 -3
  44. package/dist/components/Choice/components/styled.js.map +1 -1
  45. package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.cjs +3 -0
  46. package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.cjs.map +1 -1
  47. package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.js +3 -0
  48. package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.js.map +1 -1
  49. package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.cjs +3 -0
  50. package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.cjs.map +1 -1
  51. package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.js +3 -0
  52. package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.js.map +1 -1
  53. package/dist/components/DataGrid/components/GridContainer/GridContainer.cjs +3 -0
  54. package/dist/components/DataGrid/components/GridContainer/GridContainer.cjs.map +1 -1
  55. package/dist/components/DataGrid/components/GridContainer/GridContainer.js +3 -0
  56. package/dist/components/DataGrid/components/GridContainer/GridContainer.js.map +1 -1
  57. package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.cjs +3 -0
  58. package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.cjs.map +1 -1
  59. package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.js +3 -0
  60. package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.js.map +1 -1
  61. package/dist/components/DimensionsInput/DimensionsInput.d.ts +1 -0
  62. package/dist/components/Dropdown/Dropdown.module.scss.cjs +9 -0
  63. package/dist/components/Dropdown/Dropdown.module.scss.cjs.map +1 -0
  64. package/dist/components/Dropdown/Dropdown.module.scss.js +7 -0
  65. package/dist/components/Dropdown/Dropdown.module.scss.js.map +1 -0
  66. package/dist/components/Dropdown/DropdownPopover.cjs +4 -2
  67. package/dist/components/Dropdown/DropdownPopover.cjs.map +1 -1
  68. package/dist/components/Dropdown/DropdownPopover.js +5 -3
  69. package/dist/components/Dropdown/DropdownPopover.js.map +1 -1
  70. package/dist/components/FilterTag/styled.cjs +2 -1
  71. package/dist/components/FilterTag/styled.cjs.map +1 -1
  72. package/dist/components/FilterTag/styled.js +2 -1
  73. package/dist/components/FilterTag/styled.js.map +1 -1
  74. package/dist/components/Image/Image.cjs +16 -5
  75. package/dist/components/Image/Image.cjs.map +1 -1
  76. package/dist/components/Image/Image.js +16 -5
  77. package/dist/components/Image/Image.js.map +1 -1
  78. package/dist/components/Image/Image.module.scss.cjs +9 -0
  79. package/dist/components/Image/Image.module.scss.cjs.map +1 -0
  80. package/dist/components/Image/Image.module.scss.js +7 -0
  81. package/dist/components/Image/Image.module.scss.js.map +1 -0
  82. package/dist/components/Modal/Modal.cjs +28 -3
  83. package/dist/components/Modal/Modal.cjs.map +1 -1
  84. package/dist/components/Modal/Modal.js +28 -3
  85. package/dist/components/Modal/Modal.js.map +1 -1
  86. package/dist/components/Modal/Modal.module.scss.cjs +9 -0
  87. package/dist/components/Modal/Modal.module.scss.cjs.map +1 -0
  88. package/dist/components/Modal/Modal.module.scss.js +7 -0
  89. package/dist/components/Modal/Modal.module.scss.js.map +1 -0
  90. package/dist/components/Modal/components/Dialog/Dialog.cjs +35 -2
  91. package/dist/components/Modal/components/Dialog/Dialog.cjs.map +1 -1
  92. package/dist/components/Modal/components/Dialog/Dialog.d.ts +13 -5
  93. package/dist/components/Modal/components/Dialog/Dialog.js +35 -2
  94. package/dist/components/Modal/components/Dialog/Dialog.js.map +1 -1
  95. package/dist/components/Pagination/styled.d.ts +5 -0
  96. package/dist/components/PhoneInput/index.d.ts +1 -0
  97. package/dist/components/Popover/Popover.cjs +7 -4
  98. package/dist/components/Popover/Popover.cjs.map +1 -1
  99. package/dist/components/Popover/Popover.d.ts +1 -1
  100. package/dist/components/Popover/Popover.js +7 -4
  101. package/dist/components/Popover/Popover.js.map +1 -1
  102. package/dist/components/Popover/Popover.module.scss.cjs +9 -0
  103. package/dist/components/Popover/Popover.module.scss.cjs.map +1 -0
  104. package/dist/components/Popover/Popover.module.scss.js +7 -0
  105. package/dist/components/Popover/Popover.module.scss.js.map +1 -0
  106. package/dist/components/Search/Search.d.ts +1 -0
  107. package/dist/components/Search/styled.d.ts +1 -0
  108. package/dist/components/Select/Select.cjs +20 -3
  109. package/dist/components/Select/Select.cjs.map +1 -1
  110. package/dist/components/Select/Select.d.ts +11 -0
  111. package/dist/components/Select/Select.js +20 -3
  112. package/dist/components/Select/Select.js.map +1 -1
  113. package/dist/components/Select/Select.module.scss.cjs +9 -0
  114. package/dist/components/Select/Select.module.scss.cjs.map +1 -0
  115. package/dist/components/Select/Select.module.scss.js +7 -0
  116. package/dist/components/Select/Select.module.scss.js.map +1 -0
  117. package/dist/components/TextField/TextField.cjs +23 -6
  118. package/dist/components/TextField/TextField.cjs.map +1 -1
  119. package/dist/components/TextField/TextField.d.ts +1 -0
  120. package/dist/components/TextField/TextField.js +23 -6
  121. package/dist/components/TextField/TextField.js.map +1 -1
  122. package/dist/components/TextField/TextField.module.scss.cjs +9 -0
  123. package/dist/components/TextField/TextField.module.scss.cjs.map +1 -0
  124. package/dist/components/TextField/TextField.module.scss.js +7 -0
  125. package/dist/components/TextField/TextField.module.scss.js.map +1 -0
  126. package/dist/components/TextField/index.d.ts +1 -0
  127. package/dist/components/TextField/types.d.ts +12 -1
  128. package/dist/components/Tooltip/Tooltip.cjs +16 -12
  129. package/dist/components/Tooltip/Tooltip.cjs.map +1 -1
  130. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  131. package/dist/components/Tooltip/Tooltip.js +16 -12
  132. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  133. package/dist/components/Tooltip/Tooltip.module.scss.cjs +9 -0
  134. package/dist/components/Tooltip/Tooltip.module.scss.cjs.map +1 -0
  135. package/dist/components/Tooltip/Tooltip.module.scss.js +7 -0
  136. package/dist/components/Tooltip/Tooltip.module.scss.js.map +1 -0
  137. package/dist/components/Tooltip/components/TooltipPopover.cjs +13 -10
  138. package/dist/components/Tooltip/components/TooltipPopover.cjs.map +1 -1
  139. package/dist/components/Tooltip/components/TooltipPopover.d.ts +1 -1
  140. package/dist/components/Tooltip/components/TooltipPopover.js +13 -10
  141. package/dist/components/Tooltip/components/TooltipPopover.js.map +1 -1
  142. package/dist/components/Tooltip/components/types.d.ts +7 -12
  143. package/dist/components/Tooltip/types.cjs.map +1 -1
  144. package/dist/components/Tooltip/types.d.ts +3 -1
  145. package/dist/components/Tooltip/types.js.map +1 -1
  146. package/dist/components/VideoModal/styled.d.ts +4 -0
  147. package/dist/hoc/withLabels/BlockTooltip.cjs +16 -0
  148. package/dist/hoc/withLabels/BlockTooltip.cjs.map +1 -0
  149. package/dist/hoc/withLabels/BlockTooltip.d.ts +3 -0
  150. package/dist/hoc/withLabels/BlockTooltip.js +10 -0
  151. package/dist/hoc/withLabels/BlockTooltip.js.map +1 -0
  152. package/dist/hoc/withLabels/BlockTooltip.module.scss.cjs +9 -0
  153. package/dist/hoc/withLabels/BlockTooltip.module.scss.cjs.map +1 -0
  154. package/dist/hoc/withLabels/BlockTooltip.module.scss.js +7 -0
  155. package/dist/hoc/withLabels/BlockTooltip.module.scss.js.map +1 -0
  156. package/dist/hoc/withLabels/withLabels.cjs +5 -5
  157. package/dist/hoc/withLabels/withLabels.cjs.map +1 -1
  158. package/dist/hoc/withLabels/withLabels.js +4 -4
  159. package/dist/hoc/withLabels/withLabels.js.map +1 -1
  160. package/dist/theme/index.js +1 -1
  161. package/package.json +1 -1
  162. package/dist/components/AnimatedDropdown/components/styled.cjs +0 -13
  163. package/dist/components/AnimatedDropdown/components/styled.cjs.map +0 -1
  164. package/dist/components/AnimatedDropdown/components/styled.d.ts +0 -2
  165. package/dist/components/AnimatedDropdown/components/styled.js +0 -7
  166. package/dist/components/AnimatedDropdown/components/styled.js.map +0 -1
  167. package/dist/components/AnimatedDropdown/styled.cjs +0 -19
  168. package/dist/components/AnimatedDropdown/styled.cjs.map +0 -1
  169. package/dist/components/AnimatedDropdown/styled.d.ts +0 -11
  170. package/dist/components/AnimatedDropdown/styled.js +0 -11
  171. package/dist/components/AnimatedDropdown/styled.js.map +0 -1
  172. package/dist/components/Button/components/styled.cjs +0 -72
  173. package/dist/components/Button/components/styled.cjs.map +0 -1
  174. package/dist/components/Button/components/styled.d.ts +0 -20
  175. package/dist/components/Button/components/styled.js +0 -58
  176. package/dist/components/Button/components/styled.js.map +0 -1
  177. package/dist/components/Dropdown/styled.cjs +0 -15
  178. package/dist/components/Dropdown/styled.cjs.map +0 -1
  179. package/dist/components/Dropdown/styled.d.ts +0 -11
  180. package/dist/components/Dropdown/styled.js +0 -9
  181. package/dist/components/Dropdown/styled.js.map +0 -1
  182. package/dist/components/Image/components/styled.cjs +0 -18
  183. package/dist/components/Image/components/styled.cjs.map +0 -1
  184. package/dist/components/Image/components/styled.d.ts +0 -6
  185. package/dist/components/Image/components/styled.js +0 -9
  186. package/dist/components/Image/components/styled.js.map +0 -1
  187. package/dist/components/Modal/components/Dialog/constants.cjs +0 -53
  188. package/dist/components/Modal/components/Dialog/constants.cjs.map +0 -1
  189. package/dist/components/Modal/components/Dialog/constants.d.ts +0 -44
  190. package/dist/components/Modal/components/Dialog/constants.js +0 -49
  191. package/dist/components/Modal/components/Dialog/constants.js.map +0 -1
  192. package/dist/components/Modal/components/Dialog/styled.cjs +0 -47
  193. package/dist/components/Modal/components/Dialog/styled.cjs.map +0 -1
  194. package/dist/components/Modal/components/Dialog/styled.d.ts +0 -6
  195. package/dist/components/Modal/components/Dialog/styled.js +0 -41
  196. package/dist/components/Modal/components/Dialog/styled.js.map +0 -1
  197. package/dist/components/Modal/components/Dialog/styles/baseStyles.cjs +0 -13
  198. package/dist/components/Modal/components/Dialog/styles/baseStyles.cjs.map +0 -1
  199. package/dist/components/Modal/components/Dialog/styles/baseStyles.d.ts +0 -4
  200. package/dist/components/Modal/components/Dialog/styles/baseStyles.js +0 -11
  201. package/dist/components/Modal/components/Dialog/styles/baseStyles.js.map +0 -1
  202. package/dist/components/Modal/components/Dialog/styles/modalTypeStyles.cjs +0 -17
  203. package/dist/components/Modal/components/Dialog/styles/modalTypeStyles.cjs.map +0 -1
  204. package/dist/components/Modal/components/Dialog/styles/modalTypeStyles.d.ts +0 -6
  205. package/dist/components/Modal/components/Dialog/styles/modalTypeStyles.js +0 -13
  206. package/dist/components/Modal/components/Dialog/styles/modalTypeStyles.js.map +0 -1
  207. package/dist/components/Modal/components/styled.cjs +0 -21
  208. package/dist/components/Modal/components/styled.cjs.map +0 -1
  209. package/dist/components/Modal/components/styled.d.ts +0 -5
  210. package/dist/components/Modal/components/styled.js +0 -14
  211. package/dist/components/Modal/components/styled.js.map +0 -1
  212. package/dist/components/Popover/styled.cjs +0 -14
  213. package/dist/components/Popover/styled.cjs.map +0 -1
  214. package/dist/components/Popover/styled.d.ts +0 -5
  215. package/dist/components/Popover/styled.js +0 -7
  216. package/dist/components/Popover/styled.js.map +0 -1
  217. package/dist/components/Select/styled.cjs +0 -16
  218. package/dist/components/Select/styled.cjs.map +0 -1
  219. package/dist/components/Select/styled.d.ts +0 -2
  220. package/dist/components/Select/styled.js +0 -9
  221. package/dist/components/Select/styled.js.map +0 -1
  222. package/dist/components/TextField/styled.cjs +0 -16
  223. package/dist/components/TextField/styled.cjs.map +0 -1
  224. package/dist/components/TextField/styled.d.ts +0 -2
  225. package/dist/components/TextField/styled.js +0 -9
  226. package/dist/components/TextField/styled.js.map +0 -1
  227. package/dist/components/Tooltip/components/styled.cjs +0 -25
  228. package/dist/components/Tooltip/components/styled.cjs.map +0 -1
  229. package/dist/components/Tooltip/components/styled.d.ts +0 -19
  230. package/dist/components/Tooltip/components/styled.js +0 -16
  231. package/dist/components/Tooltip/components/styled.js.map +0 -1
  232. package/dist/hoc/withLabels/styled.cjs +0 -17
  233. package/dist/hoc/withLabels/styled.cjs.map +0 -1
  234. package/dist/hoc/withLabels/styled.d.ts +0 -1
  235. package/dist/hoc/withLabels/styled.js +0 -11
  236. package/dist/hoc/withLabels/styled.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Select.cjs","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import React, { ChangeEvent, forwardRef, useCallback } from 'react';\n\nimport { SelectInput } from './styled';\nimport { withLabels } from '../../hoc';\n\nexport type SelectOption = {\n label: string;\n value: string;\n disabled?: boolean;\n hidden?: boolean;\n};\n\nexport interface SelectProps\n extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size' | 'onChange'> {\n id?: string;\n className?: string;\n options: Array<SelectOption>;\n value?: string;\n size?: 'sm' | 'base';\n disabled?: boolean;\n hasError?: boolean;\n onChange?: (value: string) => void;\n}\n\nexport const Select = withLabels(\n forwardRef<HTMLSelectElement, SelectProps>(\n (\n { className, options, value, onChange, size, disabled, hasError, ...otherProps }: SelectProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLSelectElement>) => {\n if (!onChange) return;\n onChange(e.currentTarget.value);\n },\n [onChange],\n );\n\n return (\n <SelectInput\n className={className}\n compact={size === 'sm'}\n value={value ?? undefined}\n onChange={handleChange}\n disabled={disabled}\n hasError={hasError}\n ref={ref}\n {...otherProps}\n >\n {!!options &&\n options.map((option) => (\n <option\n key={option.label}\n value={option.value}\n disabled={option.disabled}\n hidden={option.hidden}\n >\n {option.label}\n </option>\n ))}\n </SelectInput>\n );\n },\n ),\n);\n\nSelect.displayName = 'Select';\n"],"names":["withLabels","forwardRef","useCallback","React","SelectInput"],"mappings":";;;;;;;;;;AAwBO,MAAM,MAAM,GAAGA,qBAAU,CAC9BC,gBAAU,CACR,CACE,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAe,EAC7F,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAGC,iBAAW,CAC9B,CAAC,CAAiC,KAAI;AACpC,QAAA,IAAI,CAAC,QAAQ;YAAE;AACf,QAAA,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;AACjC,IAAA,CAAC,EACD,CAAC,QAAQ,CAAC,CACX;IAED,QACEC,qCAACC,kBAAW,EAAA,EACV,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,IAAI,KAAK,IAAI,EACtB,KAAK,EAAE,KAAK,KAAA,IAAA,IAAL,KAAK,cAAL,KAAK,GAAI,SAAS,EACzB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,GAAG,EAAA,GACJ,UAAU,EAAA,EAEb,CAAC,CAAC,OAAO;AACR,QAAA,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,MACjBD,iDACE,GAAG,EAAE,MAAM,CAAC,KAAK,EACjB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAA,EAEpB,MAAM,CAAC,KAAK,CACN,CACV,CAAC,CACQ;AAElB,CAAC,CACF;AAGH,MAAM,CAAC,WAAW,GAAG,QAAQ;;;;"}
1
+ {"version":3,"file":"Select.cjs","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import React, { ChangeEvent, forwardRef, useCallback } from 'react';\n\nimport { withLabels } from '../../hoc';\nimport { buildClassnames } from '../../utils';\n\nimport formStyles from '../../utils/forms/form.module.scss';\nimport styles from './Select.module.scss';\n\nexport type SelectOption = {\n label: string;\n value: string;\n disabled?: boolean;\n hidden?: boolean;\n};\n\nexport interface SelectProps\n extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size' | 'onChange'> {\n id?: string;\n className?: string;\n /** Array of options to render in the select dropdown. */\n options: Array<SelectOption>;\n /** Currently selected value. */\n value?: string;\n /** Component size variant. Defaults to `'base'`. */\n size?: 'sm' | 'base';\n /** Disables the select element. */\n disabled?: boolean;\n /**\n * When provided, links the select to the disabled message element via `aria-describedby`.\n * Passed through from `withLabels` — the HOC renders the visible message and sets `disabled`.\n */\n disabledMessage?: React.ReactNode;\n /** When true, applies error styling. Used with `withLabels` to display an error message. */\n hasError?: boolean;\n /** Callback fired with the new value on change. */\n onChange?: (value: string) => void;\n}\n\nexport const Select = withLabels(\n forwardRef<HTMLSelectElement, SelectProps>(\n (\n {\n className,\n options,\n value,\n onChange,\n size,\n disabled,\n disabledMessage,\n hasError,\n id,\n ...otherProps\n }: SelectProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLSelectElement>) => {\n if (!onChange) return;\n onChange(e.currentTarget.value);\n },\n [onChange],\n );\n\n const getAriaDescribedBy = () => {\n if (hasError && id) return `${id}-error`;\n if (disabledMessage && id) return `${id}-disabled`;\n return undefined;\n };\n\n return (\n <select\n className={buildClassnames([\n formStyles.base,\n formStyles.fullStyles,\n styles.select,\n size === 'sm' && formStyles.compact,\n hasError && formStyles.error,\n className,\n ])}\n id={id}\n value={value ?? undefined}\n onChange={handleChange}\n disabled={disabled}\n aria-describedby={getAriaDescribedBy()}\n ref={ref}\n {...otherProps}\n >\n {!!options &&\n options.map((option) => (\n <option\n key={option.label}\n value={option.value}\n disabled={option.disabled}\n hidden={option.hidden}\n >\n {option.label}\n </option>\n ))}\n </select>\n );\n },\n ),\n);\n\nSelect.displayName = 'Select';\n"],"names":["withLabels","forwardRef","useCallback","React","buildClassnames","formStyles","styles"],"mappings":";;;;;;;;;;;;;AAsCO,MAAM,MAAM,GAAGA,qBAAU,CAC9BC,gBAAU,CACR,CACE,EACE,SAAS,EACT,OAAO,EACP,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,EAAE,EACF,GAAG,UAAU,EACD,EACd,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAGC,iBAAW,CAC9B,CAAC,CAAiC,KAAI;AACpC,QAAA,IAAI,CAAC,QAAQ;YAAE;AACf,QAAA,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;AACjC,IAAA,CAAC,EACD,CAAC,QAAQ,CAAC,CACX;IAED,MAAM,kBAAkB,GAAG,MAAK;QAC9B,IAAI,QAAQ,IAAI,EAAE;YAAE,OAAO,CAAA,EAAG,EAAE,CAAA,MAAA,CAAQ;QACxC,IAAI,eAAe,IAAI,EAAE;YAAE,OAAO,CAAA,EAAG,EAAE,CAAA,SAAA,CAAW;AAClD,QAAA,OAAO,SAAS;AAClB,IAAA,CAAC;AAED,IAAA,QACEC,sBAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EACE,SAAS,EAAEC,+BAAe,CAAC;AACzB,YAAAC,WAAU,CAAC,IAAI;AACf,YAAAA,WAAU,CAAC,UAAU;AACrB,YAAAC,aAAM,CAAC,MAAM;AACb,YAAA,IAAI,KAAK,IAAI,IAAID,WAAU,CAAC,OAAO;YACnC,QAAQ,IAAIA,WAAU,CAAC,KAAK;YAC5B,SAAS;AACV,SAAA,CAAC,EACF,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,KAAA,IAAA,IAAL,KAAK,KAAA,MAAA,GAAL,KAAK,GAAI,SAAS,EACzB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,EAAA,kBAAA,EACA,kBAAkB,EAAE,EACtC,GAAG,EAAE,GAAG,EAAA,GACJ,UAAU,EAAA,EAEb,CAAC,CAAC,OAAO;AACR,QAAA,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,MACjBF,iDACE,GAAG,EAAE,MAAM,CAAC,KAAK,EACjB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAA,EAEpB,MAAM,CAAC,KAAK,CACN,CACV,CAAC,CACG;AAEb,CAAC,CACF;AAGH,MAAM,CAAC,WAAW,GAAG,QAAQ;;;;"}
@@ -8,11 +8,22 @@ export type SelectOption = {
8
8
  export interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size' | 'onChange'> {
9
9
  id?: string;
10
10
  className?: string;
11
+ /** Array of options to render in the select dropdown. */
11
12
  options: Array<SelectOption>;
13
+ /** Currently selected value. */
12
14
  value?: string;
15
+ /** Component size variant. Defaults to `'base'`. */
13
16
  size?: 'sm' | 'base';
17
+ /** Disables the select element. */
14
18
  disabled?: boolean;
19
+ /**
20
+ * When provided, links the select to the disabled message element via `aria-describedby`.
21
+ * Passed through from `withLabels` — the HOC renders the visible message and sets `disabled`.
22
+ */
23
+ disabledMessage?: React.ReactNode;
24
+ /** When true, applies error styling. Used with `withLabels` to display an error message. */
15
25
  hasError?: boolean;
26
+ /** Callback fired with the new value on change. */
16
27
  onChange?: (value: string) => void;
17
28
  }
18
29
  export declare const Select: React.ForwardRefExoticComponent<Omit<SelectProps & React.RefAttributes<HTMLSelectElement> & import("../../hoc/withLabels/withLabels").WithLabelsProps, "ref"> & React.RefAttributes<unknown>>;
@@ -1,14 +1,31 @@
1
1
  import React__default, { forwardRef, useCallback } from 'react';
2
- import { SelectInput } from './styled.js';
3
2
  import { withLabels } from '../../hoc/withLabels/withLabels.js';
3
+ import { buildClassnames } from '../../utils/buildClassnames.js';
4
+ import 'uid/secure';
5
+ import formStyles from '../../utils/forms/form.module.scss.js';
6
+ import styles from './Select.module.scss.js';
4
7
 
5
- const Select = withLabels(forwardRef(({ className, options, value, onChange, size, disabled, hasError, ...otherProps }, ref) => {
8
+ const Select = withLabels(forwardRef(({ className, options, value, onChange, size, disabled, disabledMessage, hasError, id, ...otherProps }, ref) => {
6
9
  const handleChange = useCallback((e) => {
7
10
  if (!onChange)
8
11
  return;
9
12
  onChange(e.currentTarget.value);
10
13
  }, [onChange]);
11
- return (React__default.createElement(SelectInput, { className: className, compact: size === 'sm', value: value !== null && value !== void 0 ? value : undefined, onChange: handleChange, disabled: disabled, hasError: hasError, ref: ref, ...otherProps }, !!options &&
14
+ const getAriaDescribedBy = () => {
15
+ if (hasError && id)
16
+ return `${id}-error`;
17
+ if (disabledMessage && id)
18
+ return `${id}-disabled`;
19
+ return undefined;
20
+ };
21
+ return (React__default.createElement("select", { className: buildClassnames([
22
+ formStyles.base,
23
+ formStyles.fullStyles,
24
+ styles.select,
25
+ size === 'sm' && formStyles.compact,
26
+ hasError && formStyles.error,
27
+ className,
28
+ ]), id: id, value: value !== null && value !== void 0 ? value : undefined, onChange: handleChange, disabled: disabled, "aria-describedby": getAriaDescribedBy(), ref: ref, ...otherProps }, !!options &&
12
29
  options.map((option) => (React__default.createElement("option", { key: option.label, value: option.value, disabled: option.disabled, hidden: option.hidden }, option.label)))));
13
30
  }));
14
31
  Select.displayName = 'Select';
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import React, { ChangeEvent, forwardRef, useCallback } from 'react';\n\nimport { SelectInput } from './styled';\nimport { withLabels } from '../../hoc';\n\nexport type SelectOption = {\n label: string;\n value: string;\n disabled?: boolean;\n hidden?: boolean;\n};\n\nexport interface SelectProps\n extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size' | 'onChange'> {\n id?: string;\n className?: string;\n options: Array<SelectOption>;\n value?: string;\n size?: 'sm' | 'base';\n disabled?: boolean;\n hasError?: boolean;\n onChange?: (value: string) => void;\n}\n\nexport const Select = withLabels(\n forwardRef<HTMLSelectElement, SelectProps>(\n (\n { className, options, value, onChange, size, disabled, hasError, ...otherProps }: SelectProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLSelectElement>) => {\n if (!onChange) return;\n onChange(e.currentTarget.value);\n },\n [onChange],\n );\n\n return (\n <SelectInput\n className={className}\n compact={size === 'sm'}\n value={value ?? undefined}\n onChange={handleChange}\n disabled={disabled}\n hasError={hasError}\n ref={ref}\n {...otherProps}\n >\n {!!options &&\n options.map((option) => (\n <option\n key={option.label}\n value={option.value}\n disabled={option.disabled}\n hidden={option.hidden}\n >\n {option.label}\n </option>\n ))}\n </SelectInput>\n );\n },\n ),\n);\n\nSelect.displayName = 'Select';\n"],"names":["React"],"mappings":";;;;AAwBO,MAAM,MAAM,GAAG,UAAU,CAC9B,UAAU,CACR,CACE,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAe,EAC7F,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,CAAiC,KAAI;AACpC,QAAA,IAAI,CAAC,QAAQ;YAAE;AACf,QAAA,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;AACjC,IAAA,CAAC,EACD,CAAC,QAAQ,CAAC,CACX;IAED,QACEA,6BAAC,WAAW,EAAA,EACV,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,IAAI,KAAK,IAAI,EACtB,KAAK,EAAE,KAAK,KAAA,IAAA,IAAL,KAAK,cAAL,KAAK,GAAI,SAAS,EACzB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,GAAG,EAAA,GACJ,UAAU,EAAA,EAEb,CAAC,CAAC,OAAO;AACR,QAAA,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,MACjBA,yCACE,GAAG,EAAE,MAAM,CAAC,KAAK,EACjB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAA,EAEpB,MAAM,CAAC,KAAK,CACN,CACV,CAAC,CACQ;AAElB,CAAC,CACF;AAGH,MAAM,CAAC,WAAW,GAAG,QAAQ;;;;"}
1
+ {"version":3,"file":"Select.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import React, { ChangeEvent, forwardRef, useCallback } from 'react';\n\nimport { withLabels } from '../../hoc';\nimport { buildClassnames } from '../../utils';\n\nimport formStyles from '../../utils/forms/form.module.scss';\nimport styles from './Select.module.scss';\n\nexport type SelectOption = {\n label: string;\n value: string;\n disabled?: boolean;\n hidden?: boolean;\n};\n\nexport interface SelectProps\n extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size' | 'onChange'> {\n id?: string;\n className?: string;\n /** Array of options to render in the select dropdown. */\n options: Array<SelectOption>;\n /** Currently selected value. */\n value?: string;\n /** Component size variant. Defaults to `'base'`. */\n size?: 'sm' | 'base';\n /** Disables the select element. */\n disabled?: boolean;\n /**\n * When provided, links the select to the disabled message element via `aria-describedby`.\n * Passed through from `withLabels` — the HOC renders the visible message and sets `disabled`.\n */\n disabledMessage?: React.ReactNode;\n /** When true, applies error styling. Used with `withLabels` to display an error message. */\n hasError?: boolean;\n /** Callback fired with the new value on change. */\n onChange?: (value: string) => void;\n}\n\nexport const Select = withLabels(\n forwardRef<HTMLSelectElement, SelectProps>(\n (\n {\n className,\n options,\n value,\n onChange,\n size,\n disabled,\n disabledMessage,\n hasError,\n id,\n ...otherProps\n }: SelectProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLSelectElement>) => {\n if (!onChange) return;\n onChange(e.currentTarget.value);\n },\n [onChange],\n );\n\n const getAriaDescribedBy = () => {\n if (hasError && id) return `${id}-error`;\n if (disabledMessage && id) return `${id}-disabled`;\n return undefined;\n };\n\n return (\n <select\n className={buildClassnames([\n formStyles.base,\n formStyles.fullStyles,\n styles.select,\n size === 'sm' && formStyles.compact,\n hasError && formStyles.error,\n className,\n ])}\n id={id}\n value={value ?? undefined}\n onChange={handleChange}\n disabled={disabled}\n aria-describedby={getAriaDescribedBy()}\n ref={ref}\n {...otherProps}\n >\n {!!options &&\n options.map((option) => (\n <option\n key={option.label}\n value={option.value}\n disabled={option.disabled}\n hidden={option.hidden}\n >\n {option.label}\n </option>\n ))}\n </select>\n );\n },\n ),\n);\n\nSelect.displayName = 'Select';\n"],"names":["React"],"mappings":";;;;;;;AAsCO,MAAM,MAAM,GAAG,UAAU,CAC9B,UAAU,CACR,CACE,EACE,SAAS,EACT,OAAO,EACP,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,EAAE,EACF,GAAG,UAAU,EACD,EACd,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,CAAiC,KAAI;AACpC,QAAA,IAAI,CAAC,QAAQ;YAAE;AACf,QAAA,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;AACjC,IAAA,CAAC,EACD,CAAC,QAAQ,CAAC,CACX;IAED,MAAM,kBAAkB,GAAG,MAAK;QAC9B,IAAI,QAAQ,IAAI,EAAE;YAAE,OAAO,CAAA,EAAG,EAAE,CAAA,MAAA,CAAQ;QACxC,IAAI,eAAe,IAAI,EAAE;YAAE,OAAO,CAAA,EAAG,EAAE,CAAA,SAAA,CAAW;AAClD,QAAA,OAAO,SAAS;AAClB,IAAA,CAAC;AAED,IAAA,QACEA,cAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EACE,SAAS,EAAE,eAAe,CAAC;AACzB,YAAA,UAAU,CAAC,IAAI;AACf,YAAA,UAAU,CAAC,UAAU;AACrB,YAAA,MAAM,CAAC,MAAM;AACb,YAAA,IAAI,KAAK,IAAI,IAAI,UAAU,CAAC,OAAO;YACnC,QAAQ,IAAI,UAAU,CAAC,KAAK;YAC5B,SAAS;AACV,SAAA,CAAC,EACF,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,KAAA,IAAA,IAAL,KAAK,KAAA,MAAA,GAAL,KAAK,GAAI,SAAS,EACzB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,EAAA,kBAAA,EACA,kBAAkB,EAAE,EACtC,GAAG,EAAE,GAAG,EAAA,GACJ,UAAU,EAAA,EAEb,CAAC,CAAC,OAAO;AACR,QAAA,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,MACjBA,yCACE,GAAG,EAAE,MAAM,CAAC,KAAK,EACjB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAA,EAEpB,MAAM,CAAC,KAAK,CACN,CACV,CAAC,CACG;AAEb,CAAC,CACF;AAGH,MAAM,CAAC,WAAW,GAAG,QAAQ;;;;"}
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var ___$insertStyle = require('../../_virtual/____insertStyle.cjs');
4
+
5
+ ___$insertStyle("._select_1kp7e_1 {\n --padding-right: var(--sizes-9);\n padding-right: var(--padding-right);\n background-image: url(\"data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M4 6L8 10L12 6H4Z' fill='currentColor' /%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position: right var(--sizes-3) top 50%, 0 0;\n}\n._select_1kp7e_1:has(option:disabled:checked) {\n color: var(--colors-neutral-ink-light);\n}");
6
+ var styles = {"select":"_select_1kp7e_1"};
7
+
8
+ module.exports = styles;
9
+ //# sourceMappingURL=Select.module.scss.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select.module.scss.cjs","sources":["../../../src/components/Select/Select.module.scss"],"sourcesContent":[".select {\n --padding-right: var(--sizes-9);\n\n padding-right: var(--padding-right);\n background-image: url(\"data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M4 6L8 10L12 6H4Z' fill='currentColor' /%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position:\n right var(--sizes-3) top 50%,\n 0 0;\n\n &:has(option:disabled:checked) {\n color: var(--colors-neutral-ink-light);\n }\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,0hBAAA;AAEA,aAAA,CAAA,QAAA,CAAA,iBAAA;;;;"}
@@ -0,0 +1,7 @@
1
+ import insertStyle from '../../_virtual/____insertStyle.js';
2
+
3
+ insertStyle("._select_1kp7e_1 {\n --padding-right: var(--sizes-9);\n padding-right: var(--padding-right);\n background-image: url(\"data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M4 6L8 10L12 6H4Z' fill='currentColor' /%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position: right var(--sizes-3) top 50%, 0 0;\n}\n._select_1kp7e_1:has(option:disabled:checked) {\n color: var(--colors-neutral-ink-light);\n}");
4
+ var styles = {"select":"_select_1kp7e_1"};
5
+
6
+ export { styles as default };
7
+ //# sourceMappingURL=Select.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select.module.scss.js","sources":["../../../src/components/Select/Select.module.scss"],"sourcesContent":[".select {\n --padding-right: var(--sizes-9);\n\n padding-right: var(--padding-right);\n background-image: url(\"data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M4 6L8 10L12 6H4Z' fill='currentColor' /%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position:\n right var(--sizes-3) top 50%,\n 0 0;\n\n &:has(option:disabled:checked) {\n color: var(--colors-neutral-ink-light);\n }\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,0hBAAA;AAEA,aAAA,CAAA,QAAA,CAAA,iBAAA;;;;"}
@@ -2,14 +2,16 @@
2
2
 
3
3
  var React = require('react');
4
4
  var generateId = require('../../utils/generateId.cjs');
5
- var styled = require('./styled.cjs');
5
+ var buildClassnames = require('../../utils/buildClassnames.cjs');
6
+ var form_module = require('../../utils/forms/form.module.scss.cjs');
7
+ var TextField_module = require('./TextField.module.scss.cjs');
6
8
 
7
9
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
8
10
 
9
11
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
10
12
 
11
13
  const NUMBER_REGEX = /^-?[0-9]*\.?[0-9]+$/;
12
- const TextField = React.forwardRef(({ id, className, disabled = false, hasError, multiline = false, spellCheck = false, name, onChange, placeholder, size = 'base', type = 'text', value, ...otherProps }, ref) => {
14
+ const TextField = React.forwardRef(({ id, className, disabled = false, disabledMessage, hasError, multiline = false, spellCheck = false, name, onChange, placeholder, size = 'base', type = 'text', value, ...otherProps }, ref) => {
13
15
  const handleChange = React.useCallback((event) => {
14
16
  if (!onChange)
15
17
  return;
@@ -32,14 +34,29 @@ const TextField = React.forwardRef(({ id, className, disabled = false, hasError,
32
34
  const ariaDescribedBy = React.useMemo(() => {
33
35
  if (hasError)
34
36
  return `${componentId}-error`;
35
- if (disabled)
37
+ if (disabledMessage)
36
38
  return `${componentId}-disabled`;
37
39
  return undefined;
38
- }, [hasError, componentId, disabled]);
40
+ }, [hasError, disabledMessage, componentId]);
41
+ const isCompact = size === 'sm';
39
42
  if (type === 'text' && multiline) {
40
- return (React__default.default.createElement(styled.Textarea, { className: className, disabled: disabled, hasError: hasError, id: componentId, name: name, onChange: handleChange, placeholder: placeholder, value: value, ref: ref, spellCheck: spellCheck, "aria-describedby": ariaDescribedBy, ...otherProps }));
43
+ return (React__default.default.createElement("textarea", { className: buildClassnames.buildClassnames([
44
+ form_module.base,
45
+ form_module.fullStyles,
46
+ TextField_module.textarea,
47
+ isCompact && form_module.compact,
48
+ hasError && form_module.error,
49
+ className,
50
+ ]), disabled: disabled, id: componentId, name: name, onChange: handleChange, placeholder: placeholder, value: value, ref: ref, spellCheck: spellCheck, "aria-describedby": ariaDescribedBy, ...otherProps }));
41
51
  }
42
- return (React__default.default.createElement(styled.Input, { className: className, disabled: disabled, hasError: hasError, id: componentId, compact: size === 'sm', name: name, "aria-label": name, onChange: handleChange, placeholder: placeholder, type: type, value: value, ref: ref, spellCheck: spellCheck, "aria-describedby": ariaDescribedBy, ...otherProps }));
52
+ return (React__default.default.createElement("input", { className: buildClassnames.buildClassnames([
53
+ form_module.base,
54
+ form_module.fullStyles,
55
+ TextField_module.input,
56
+ isCompact && form_module.compact,
57
+ hasError && form_module.error,
58
+ className,
59
+ ]), disabled: disabled, id: componentId, name: name, "aria-label": name, onChange: handleChange, placeholder: placeholder, type: type, value: value, ref: ref, spellCheck: spellCheck, "aria-describedby": ariaDescribedBy, ...otherProps }));
43
60
  });
44
61
 
45
62
  exports.TextField = TextField;
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.cjs","sources":["../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import React, { useCallback, ChangeEvent, forwardRef, useMemo } from 'react';\nimport { TextFieldProps } from './types';\nimport { generateId } from '../../utils/generateId';\n\nimport { Input, Textarea } from './styled';\n\nconst NUMBER_REGEX = /^-?[0-9]*\\.?[0-9]+$/;\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n id,\n className,\n disabled = false,\n hasError,\n multiline = false,\n spellCheck = false,\n name,\n onChange,\n placeholder,\n size = 'base',\n type = 'text',\n value,\n ...otherProps\n }: TextFieldProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (!onChange) return;\n const newValue = event.currentTarget.value;\n\n if (newValue === '') {\n onChange(newValue);\n return;\n }\n\n if (type !== 'number') {\n onChange(newValue);\n return;\n }\n\n const reg = new RegExp(NUMBER_REGEX);\n if (!reg.test(newValue)) {\n return;\n }\n\n onChange(newValue);\n },\n [onChange, type],\n );\n\n const componentId = useMemo(() => id ?? generateId('textfield'), [id]);\n const ariaDescribedBy = useMemo(() => {\n if (hasError) return `${componentId}-error`;\n if (disabled) return `${componentId}-disabled`;\n return undefined;\n }, [hasError, componentId, disabled]);\n\n if (type === 'text' && multiline) {\n return (\n <Textarea\n className={className}\n disabled={disabled}\n hasError={hasError}\n id={componentId}\n name={name}\n onChange={handleChange}\n placeholder={placeholder}\n value={value}\n ref={ref}\n spellCheck={spellCheck}\n aria-describedby={ariaDescribedBy}\n {...otherProps}\n />\n );\n }\n\n return (\n <Input\n className={className}\n disabled={disabled}\n hasError={hasError}\n id={componentId}\n compact={size === 'sm'}\n name={name}\n aria-label={name}\n onChange={handleChange}\n placeholder={placeholder}\n type={type}\n value={value}\n ref={ref}\n spellCheck={spellCheck}\n aria-describedby={ariaDescribedBy}\n {...otherProps}\n />\n );\n },\n);\n"],"names":["forwardRef","useCallback","useMemo","generateId","React","Textarea","Input"],"mappings":";;;;;;;;;;AAMA,MAAM,YAAY,GAAG,qBAAqB;MAE7B,SAAS,GAAGA,gBAAU,CACjC,CACE,EACE,EAAE,EACF,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,SAAS,GAAG,KAAK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QAChC,QACEE,qCAACC,eAAQ,EAAA,EACP,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,WAAW,EACf,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EAAA,kBAAA,EACJ,eAAe,EAAA,GAC7B,UAAU,EAAA,CACd;AAEL,IAAA;AAED,IAAA,QACED,sBAAA,CAAA,aAAA,CAACE,YAAK,EAAA,EACJ,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,WAAW,EACf,OAAO,EAAE,IAAI,KAAK,IAAI,EACtB,IAAI,EAAE,IAAI,EAAA,YAAA,EACE,IAAI,EAChB,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EAAA,kBAAA,EACJ,eAAe,EAAA,GAC7B,UAAU,EAAA,CACd;AAEN,CAAC;;;;"}
1
+ {"version":3,"file":"TextField.cjs","sources":["../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import React, { useCallback, ChangeEvent, forwardRef, useMemo } from 'react';\nimport { TextFieldProps } from './types';\nimport { generateId } from '../../utils/generateId';\nimport { buildClassnames } from '../../utils';\n\nimport formStyles from '../../utils/forms/form.module.scss';\nimport styles from './TextField.module.scss';\n\nconst NUMBER_REGEX = /^-?[0-9]*\\.?[0-9]+$/;\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n id,\n className,\n disabled = false,\n disabledMessage,\n hasError,\n multiline = false,\n spellCheck = false,\n name,\n onChange,\n placeholder,\n size = 'base',\n type = 'text',\n value,\n ...otherProps\n }: TextFieldProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (!onChange) return;\n const newValue = event.currentTarget.value;\n\n if (newValue === '') {\n onChange(newValue);\n return;\n }\n\n if (type !== 'number') {\n onChange(newValue);\n return;\n }\n\n const reg = new RegExp(NUMBER_REGEX);\n if (!reg.test(newValue)) {\n return;\n }\n\n onChange(newValue);\n },\n [onChange, type],\n );\n\n const componentId = useMemo(() => id ?? generateId('textfield'), [id]);\n const ariaDescribedBy = useMemo(() => {\n if (hasError) return `${componentId}-error`;\n if (disabledMessage) return `${componentId}-disabled`;\n return undefined;\n }, [hasError, disabledMessage, componentId]);\n\n const isCompact = size === 'sm';\n\n if (type === 'text' && multiline) {\n return (\n <textarea\n className={buildClassnames([\n formStyles.base,\n formStyles.fullStyles,\n styles.textarea,\n isCompact && formStyles.compact,\n hasError && formStyles.error,\n className,\n ])}\n disabled={disabled}\n id={componentId}\n name={name}\n onChange={handleChange}\n placeholder={placeholder}\n value={value}\n ref={ref as React.Ref<HTMLTextAreaElement>}\n spellCheck={spellCheck}\n aria-describedby={ariaDescribedBy}\n {...otherProps}\n />\n );\n }\n\n return (\n <input\n className={buildClassnames([\n formStyles.base,\n formStyles.fullStyles,\n styles.input,\n isCompact && formStyles.compact,\n hasError && formStyles.error,\n className,\n ])}\n disabled={disabled}\n id={componentId}\n name={name}\n aria-label={name}\n onChange={handleChange}\n placeholder={placeholder}\n type={type}\n value={value}\n ref={ref}\n spellCheck={spellCheck}\n aria-describedby={ariaDescribedBy}\n {...otherProps}\n />\n );\n },\n);\n"],"names":["forwardRef","useCallback","useMemo","generateId","React","buildClassnames","formStyles","styles"],"mappings":";;;;;;;;;;;;AAQA,MAAM,YAAY,GAAG,qBAAqB;MAE7B,SAAS,GAAGA,gBAAU,CACjC,CACE,EACE,EAAE,EACF,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,eAAe,EACf,QAAQ,EACR,SAAS,G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oticComponent<{
296
296
  type?: import("./types").TextFieldType | undefined;
297
297
  onChange?: ((value: string) => void) | undefined;
298
298
  hasError?: boolean | undefined;
299
+ disabledMessage?: React.ReactNode;
299
300
  size?: "base" | "sm" | undefined;
300
301
  multiline?: boolean | undefined;
301
302
  } & React.RefAttributes<HTMLInputElement>>;
@@ -1,9 +1,11 @@
1
1
  import React__default, { forwardRef, useCallback, useMemo } from 'react';
2
2
  import { generateId } from '../../utils/generateId.js';
3
- import { Textarea, Input } from './styled.js';
3
+ import { buildClassnames } from '../../utils/buildClassnames.js';
4
+ import formStyles from '../../utils/forms/form.module.scss.js';
5
+ import styles from './TextField.module.scss.js';
4
6
 
5
7
  const NUMBER_REGEX = /^-?[0-9]*\.?[0-9]+$/;
6
- const TextField = forwardRef(({ id, className, disabled = false, hasError, multiline = false, spellCheck = false, name, onChange, placeholder, size = 'base', type = 'text', value, ...otherProps }, ref) => {
8
+ const TextField = forwardRef(({ id, className, disabled = false, disabledMessage, hasError, multiline = false, spellCheck = false, name, onChange, placeholder, size = 'base', type = 'text', value, ...otherProps }, ref) => {
7
9
  const handleChange = useCallback((event) => {
8
10
  if (!onChange)
9
11
  return;
@@ -26,14 +28,29 @@ const TextField = forwardRef(({ id, className, disabled = false, hasError, multi
26
28
  const ariaDescribedBy = useMemo(() => {
27
29
  if (hasError)
28
30
  return `${componentId}-error`;
29
- if (disabled)
31
+ if (disabledMessage)
30
32
  return `${componentId}-disabled`;
31
33
  return undefined;
32
- }, [hasError, componentId, disabled]);
34
+ }, [hasError, disabledMessage, componentId]);
35
+ const isCompact = size === 'sm';
33
36
  if (type === 'text' && multiline) {
34
- return (React__default.createElement(Textarea, { className: className, disabled: disabled, hasError: hasError, id: componentId, name: name, onChange: handleChange, placeholder: placeholder, value: value, ref: ref, spellCheck: spellCheck, "aria-describedby": ariaDescribedBy, ...otherProps }));
37
+ return (React__default.createElement("textarea", { className: buildClassnames([
38
+ formStyles.base,
39
+ formStyles.fullStyles,
40
+ styles.textarea,
41
+ isCompact && formStyles.compact,
42
+ hasError && formStyles.error,
43
+ className,
44
+ ]), disabled: disabled, id: componentId, name: name, onChange: handleChange, placeholder: placeholder, value: value, ref: ref, spellCheck: spellCheck, "aria-describedby": ariaDescribedBy, ...otherProps }));
35
45
  }
36
- return (React__default.createElement(Input, { className: className, disabled: disabled, hasError: hasError, id: componentId, compact: size === 'sm', name: name, "aria-label": name, onChange: handleChange, placeholder: placeholder, type: type, value: value, ref: ref, spellCheck: spellCheck, "aria-describedby": ariaDescribedBy, ...otherProps }));
46
+ return (React__default.createElement("input", { className: buildClassnames([
47
+ formStyles.base,
48
+ formStyles.fullStyles,
49
+ styles.input,
50
+ isCompact && formStyles.compact,
51
+ hasError && formStyles.error,
52
+ className,
53
+ ]), disabled: disabled, id: componentId, name: name, "aria-label": name, onChange: handleChange, placeholder: placeholder, type: type, value: value, ref: ref, spellCheck: spellCheck, "aria-describedby": ariaDescribedBy, ...otherProps }));
37
54
  });
38
55
 
39
56
  export { TextField };
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.js","sources":["../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import React, { useCallback, ChangeEvent, forwardRef, useMemo } from 'react';\nimport { TextFieldProps } from './types';\nimport { generateId } from '../../utils/generateId';\n\nimport { Input, Textarea } from './styled';\n\nconst NUMBER_REGEX = /^-?[0-9]*\\.?[0-9]+$/;\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n id,\n className,\n disabled = false,\n hasError,\n multiline = false,\n spellCheck = false,\n name,\n onChange,\n placeholder,\n size = 'base',\n type = 'text',\n value,\n ...otherProps\n }: TextFieldProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (!onChange) return;\n const newValue = event.currentTarget.value;\n\n if (newValue === '') {\n onChange(newValue);\n return;\n }\n\n if (type !== 'number') {\n onChange(newValue);\n return;\n }\n\n const reg = new RegExp(NUMBER_REGEX);\n if (!reg.test(newValue)) {\n return;\n }\n\n onChange(newValue);\n },\n [onChange, type],\n );\n\n const componentId = useMemo(() => id ?? generateId('textfield'), [id]);\n const ariaDescribedBy = useMemo(() => {\n if (hasError) return `${componentId}-error`;\n if (disabled) return `${componentId}-disabled`;\n return undefined;\n }, [hasError, componentId, disabled]);\n\n if (type === 'text' && multiline) {\n return (\n <Textarea\n className={className}\n disabled={disabled}\n hasError={hasError}\n id={componentId}\n name={name}\n onChange={handleChange}\n placeholder={placeholder}\n value={value}\n ref={ref}\n spellCheck={spellCheck}\n aria-describedby={ariaDescribedBy}\n {...otherProps}\n />\n );\n }\n\n return (\n <Input\n className={className}\n disabled={disabled}\n hasError={hasError}\n id={componentId}\n compact={size === 'sm'}\n name={name}\n aria-label={name}\n onChange={handleChange}\n placeholder={placeholder}\n type={type}\n value={value}\n ref={ref}\n spellCheck={spellCheck}\n aria-describedby={ariaDescribedBy}\n {...otherProps}\n />\n );\n },\n);\n"],"names":["React"],"mappings":";;;;AAMA,MAAM,YAAY,GAAG,qBAAqB;MAE7B,SAAS,GAAG,UAAU,CACjC,CACE,EACE,EAAE,EACF,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,UAAU,GAAG,KAAK,EAClB,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,IAAI,GAAG,MAAM,EACb,IAAI,GAAG,MAAM,EACb,KAAK,EACL,GAAG,UAAU,EACE,EACjB,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,KAA0D,KAAI;AAC7D,QAAA,IAAI,CAAC,QAAQ;YAAE;AACf,QAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK;QAE1C,IAAI,QAAQ,KAAK,EAAE,EAAE;YACnB,QAAQ,CAAC,QAAQ,CAAC;YAClB;AACD,QAAA;QAED,IAAI,IAAI,KAAK,QAAQ,EAAE;YACrB,QAAQ,CAAC,QAA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,EAClB,EAAE,EAAE,WAAW,EACf,OAAO,EAAE,IAAI,KAAK,IAAI,EACtB,IAAI,EAAE,IAAI,EAAA,YAAA,EACE,IAAI,EAChB,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EAAA,kBAAA,EACJ,eAAe,EAAA,GAC7B,UAAU,EAAA,CACd;AAEN,CAAC;;;;"}
1
+ {"version":3,"file":"TextField.js","sources":["../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import React, { useCallback, ChangeEvent, forwardRef, useMemo } from 'react';\nimport { TextFieldProps } from './types';\nimport { generateId } from '../../utils/generateId';\nimport { buildClassnames } from '../../utils';\n\nimport formStyles from '../../utils/forms/form.module.scss';\nimport styles from './TextField.module.scss';\n\nconst NUMBER_REGEX = /^-?[0-9]*\\.?[0-9]+$/;\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n id,\n className,\n disabled = false,\n disabledMessage,\n hasError,\n multiline = false,\n spellCheck = false,\n name,\n onChange,\n placeholder,\n size = 'base',\n type = 'text',\n value,\n ...otherProps\n }: TextFieldProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (!onChange) return;\n const newValue = event.currentTarget.value;\n\n if (newValue === '') {\n onChange(newValue);\n return;\n }\n\n if (type !== 'number') {\n onChange(newValue);\n return;\n }\n\n const reg = new RegExp(NUMBER_REGEX);\n if (!reg.test(newValue)) {\n return;\n }\n\n onChange(newValue);\n },\n [onChange, type],\n );\n\n const componentId = useMemo(() => id ?? generateId('textfield'), [id]);\n const ariaDescribedBy = useMemo(() => {\n if (hasError) return `${componentId}-error`;\n if (disabledMessage) return `${componentId}-disabled`;\n return undefined;\n }, [hasError, disabledMessage, componentId]);\n\n const isCompact = size === 'sm';\n\n if (type === 'text' && multiline) {\n return (\n <textarea\n className={buildClassnames([\n formStyles.base,\n formStyles.fullStyles,\n styles.textarea,\n isCompact && formStyles.compact,\n hasError && formStyles.error,\n className,\n ])}\n disabled={disabled}\n id={componentId}\n name={name}\n onChange={handleChange}\n placeholder={placeholder}\n value={value}\n ref={ref as React.Ref<HTMLTextAreaElement>}\n spellCheck={spellCheck}\n aria-describedby={ariaDescribedBy}\n {...otherProps}\n />\n );\n }\n\n return (\n <input\n className={buildClassnames([\n formStyles.base,\n formStyles.fullStyles,\n styles.input,\n isCompact && formStyles.compact,\n hasError && formStyles.error,\n className,\n ])}\n disabled={disabled}\n id={componentId}\n name={name}\n aria-label={name}\n onChange={handleChange}\n placeholder={placeholder}\n type={type}\n value={value}\n ref={ref}\n spellCheck={spellCheck}\n aria-describedby={ariaDescribedBy}\n {...otherProps}\n />\n );\n },\n);\n"],"names":["React"],"mappings":";;;;;;AAQA,MAAM,YAAY,GAAG,qBAAqB;MAE7B,SAAS,GAAG,UAAU,CACjC,CACE,EACE,EAAE,EACF,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,eAAe,EACf,QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,UAAU,GAAG,KAAK,EAClB,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,IAAI,GAAG,MAAM,EACb,IAAI,GAAG,MAAM,EACb,KAAK,EACL,GAAG,UAAU,EACE,EACjB,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,KAA0D,KAAI;AAC7D,QAAA,IAAI,CAAC,QAAQ;YAAE;AACf,QAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK;QAE1C,IAAI,QAAQ,KAAK,EAAE,EAAE;YACnB,QAAQ,CAAC,QAAQ,CAAC;YAClB;AACD,QAAA;QAED,IAAI,IAAI,KAAK,QAAQ,EAAE;YACrB,QAAQ,CAAC,QAAQ,CAAC;YAClB;AACD,QAAA;AAED,QAAA,MAAM,GAAG,GA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AU,EAAA,kBAAA,EACJ,eAAe,KAC7B,UAAU,EAAA,CACd;AAEL,IAAA;AAED,IAAA,QACEA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EACE,SAAS,EAAE,eAAe,CAAC;AACzB,YAAA,UAAU,CAAC,IAAI;AACf,YAAA,UAAU,CAAC,UAAU;AACrB,YAAA,MAAM,CAAC,KAAK;YACZ,SAAS,IAAI,UAAU,CAAC,OAAO;YAC/B,QAAQ,IAAI,UAAU,CAAC,KAAK;YAC5B,SAAS;SACV,CAAC,EACF,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,WAAW,EACf,IAAI,EAAE,IAAI,EAAA,YAAA,EACE,IAAI,EAChB,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EAAA,kBAAA,EACJ,eAAe,KAC7B,UAAU,EAAA,CACd;AAEN,CAAC;;;;"}
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var ___$insertStyle = require('../../_virtual/____insertStyle.cjs');
4
+
5
+ ___$insertStyle("._input_qtip3_1 {\n /* Overrides browser default width - note: this breaks the native [size] attribute */\n width: 100%;\n /* Hide number arrows/spinners */\n}\n._input_qtip3_1::-webkit-outer-spin-button, ._input_qtip3_1::-webkit-inner-spin-button {\n appearance: none;\n margin: 0;\n}\n._input_qtip3_1[type=number] {\n appearance: textfield;\n min-width: 8ch;\n text-align: right;\n}\n\n._textarea_qtip3_16 {\n padding-block: var(--sizes-2);\n}");
6
+ var styles = {"input":"_input_qtip3_1","textarea":"_textarea_qtip3_16"};
7
+
8
+ module.exports = styles;
9
+ //# sourceMappingURL=TextField.module.scss.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextField.module.scss.cjs","sources":["../../../src/components/TextField/TextField.module.scss"],"sourcesContent":[".input {\n /* Overrides browser default width - note: this breaks the native [size] attribute */\n width: 100%;\n\n /* Hide number arrows/spinners */\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n appearance: none;\n margin: 0;\n }\n\n &[type='number'] {\n appearance: textfield;\n min-width: 8ch;\n text-align: right;\n }\n}\n\n.textarea {\n padding-block: var(--sizes-2);\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,ycAAA;AACA,aAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,UAAA,CAAA,oBAAA;;;;"}
@@ -0,0 +1,7 @@
1
+ import insertStyle from '../../_virtual/____insertStyle.js';
2
+
3
+ insertStyle("._input_qtip3_1 {\n /* Overrides browser default width - note: this breaks the native [size] attribute */\n width: 100%;\n /* Hide number arrows/spinners */\n}\n._input_qtip3_1::-webkit-outer-spin-button, ._input_qtip3_1::-webkit-inner-spin-button {\n appearance: none;\n margin: 0;\n}\n._input_qtip3_1[type=number] {\n appearance: textfield;\n min-width: 8ch;\n text-align: right;\n}\n\n._textarea_qtip3_16 {\n padding-block: var(--sizes-2);\n}");
4
+ var styles = {"input":"_input_qtip3_1","textarea":"_textarea_qtip3_16"};
5
+
6
+ export { styles as default };
7
+ //# sourceMappingURL=TextField.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextField.module.scss.js","sources":["../../../src/components/TextField/TextField.module.scss"],"sourcesContent":[".input {\n /* Overrides browser default width - note: this breaks the native [size] attribute */\n width: 100%;\n\n /* Hide number arrows/spinners */\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n appearance: none;\n margin: 0;\n }\n\n &[type='number'] {\n appearance: textfield;\n min-width: 8ch;\n text-align: right;\n }\n}\n\n.textarea {\n padding-block: var(--sizes-2);\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,ycAAA;AACA,aAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,UAAA,CAAA,oBAAA;;;;"}
@@ -297,6 +297,7 @@ export declare const TextField: import("react").ForwardRefExoticComponent<Omit<{
297
297
  type?: import("./types").TextFieldType | undefined;
298
298
  onChange?: ((value: string) => void) | undefined;
299
299
  hasError?: boolean | undefined;
300
+ disabledMessage?: import("react").ReactNode;
300
301
  size?: "base" | "sm" | undefined;
301
302
  multiline?: boolean | undefined;
302
303
  } & import("react").RefAttributes<HTMLInputElement> & import("../../hoc/withLabels/withLabels").WithLabelsProps, "ref"> & import("react").RefAttributes<unknown>>;
@@ -1,14 +1,25 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { ComponentSizeType } from '../types';
3
3
  export type TextFieldType = 'text' | 'email' | 'number' | 'password' | 'search' | 'tel' | 'url' | 'date' | 'datetime-local' | 'month' | 'time' | 'week' | 'currency';
4
4
  export declare const textFieldTypes: readonly ["text", "email", "number", "password", "search", "tel", "url", "date", "datetime-local", "month", "time", "week", "currency"];
5
5
  type CommonAttributes = Omit<React.InputHTMLAttributes<HTMLInputElement> & React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange' | 'size' | 'type' | 'value'>;
6
6
  export type TextFieldProps = CommonAttributes & {
7
+ /** Current input value. */
7
8
  value?: string;
9
+ /** HTML input type. Defaults to `'text'`. */
8
10
  type?: TextFieldType;
11
+ /** Callback fired with the new value on change. */
9
12
  onChange?: (value: string) => void;
13
+ /** When true, applies error styling. Used with `withLabels` to display an error message. */
10
14
  hasError?: boolean;
15
+ /**
16
+ * When provided, links the input to the disabled message element via `aria-describedby`.
17
+ * Passed through from `withLabels` — the HOC renders the visible message and sets `disabled`.
18
+ */
19
+ disabledMessage?: React.ReactNode;
20
+ /** Component size variant. Defaults to `'base'`. */
11
21
  size?: ComponentSizeType;
22
+ /** Renders a `<textarea>` instead of `<input>` when `type` is `'text'`. */
12
23
  multiline?: boolean;
13
24
  };
14
25
  export {};
@@ -2,9 +2,11 @@
2
2
 
3
3
  var React = require('react');
4
4
  var framerMotion = require('framer-motion');
5
- var styled = require('./components/styled.cjs');
6
5
  var TooltipPopover = require('./components/TooltipPopover.cjs');
7
6
  var Portal = require('../Portal/Portal.cjs');
7
+ var buildClassnames = require('../../utils/buildClassnames.cjs');
8
+ require('uid/secure');
9
+ var Tooltip_module = require('./Tooltip.module.scss.cjs');
8
10
 
9
11
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
10
12
 
@@ -13,26 +15,28 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
13
15
  const WithOptionalPortal = ({ usePortal = false, children,
14
16
  // eslint-disable-next-line react/jsx-no-useless-fragment
15
17
  }) => (usePortal ? React__default.default.createElement(Portal.Portal, null, children) : React__default.default.createElement(React__default.default.Fragment, null, children));
16
- const Tooltip = ({ children, text, content, config, reversed = false, className, withTriangle, initialShouldShow = false, useReactPortal = true, }) => {
18
+ const Tooltip = ({ children, text, content, config, reversed = false, className, hoverableClassName, withTriangle, initialShouldShow = false, useReactPortal = true, }) => {
17
19
  const [shouldShow, setShouldShow] = React.useState(initialShouldShow);
18
20
  const [hoverableElement, setHoverableElement] = React.useState(null);
19
- const classNames = {
20
- container: className && `${className} ${className}-container`,
21
- tip: className && `${className}-tip`,
22
- wrap: className && `${className}-wrap`,
23
- triangle: className && `${className}-triangle`,
24
- hoverable: className && `${className}-hoverable`,
25
- };
26
21
  const hasText = text ? text.trim().length > 0 : false;
27
22
  const hasContent = !!(content || hasText);
23
+ // Backward-compatible suffix classes for monolith consumers that
24
+ // target sub-elements via the className prefix convention.
25
+ const legacyClassNames = className
26
+ ? {
27
+ tip: `${className}-tip`,
28
+ wrap: `${className}-wrap`,
29
+ triangle: `${className}-triangle`,
30
+ }
31
+ : undefined;
28
32
  if (!hasContent)
29
33
  return children;
30
34
  const show = () => setShouldShow(true);
31
35
  const hide = () => setShouldShow(false);
32
- return (React__default.default.createElement(styled.Container, { className: classNames.container },
36
+ return (React__default.default.createElement("div", { className: buildClassnames.buildClassnames([Tooltip_module.container, className, className && `${className}-container`]) },
33
37
  React__default.default.createElement(framerMotion.AnimatePresence, null, shouldShow && (React__default.default.createElement(WithOptionalPortal, { usePortal: useReactPortal },
34
- React__default.default.createElement(TooltipPopover.TooltipPopover, { key: "tooltip-popover", classNames: classNames, hoverableElement: hoverableElement, config: config, reversed: reversed, withTriangle: withTriangle, text: text, content: content })))),
35
- React__default.default.createElement(styled.Container, { ref: setHoverableElement, className: classNames.hoverable, onMouseEnter: show, onMouseLeave: hide }, children)));
38
+ React__default.default.createElement(TooltipPopover.TooltipPopover, { key: "tooltip-popover", hoverableElement: hoverableElement, config: config, reversed: reversed, withTriangle: withTriangle, text: text, content: content, legacyClassNames: legacyClassNames })))),
39
+ React__default.default.createElement("div", { ref: setHoverableElement, className: buildClassnames.buildClassnames([Tooltip_module.hoverable, hoverableClassName, className && `${className}-hoverable`]), onMouseEnter: show, onMouseLeave: hide }, children)));
36
40
  };
37
41
 
38
42
  exports.Tooltip = Tooltip;
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.cjs","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import React, { ReactNode, useState } from 'react';\nimport { AnimatePresence } from 'framer-motion';\nimport { TooltipProps } from './types';\nimport { Container } from './components/styled';\nimport { TooltipPopover } from './components/TooltipPopover';\nimport { Portal } from '../Portal';\n\nconst WithOptionalPortal: React.FC<{ usePortal: boolean; children: ReactNode }> = ({\n usePortal = false,\n children,\n // eslint-disable-next-line react/jsx-no-useless-fragment\n}) => (usePortal ? <Portal>{children}</Portal> : <>{children}</>);\n\nexport const Tooltip = ({\n children,\n text,\n content,\n config,\n reversed = false,\n className,\n withTriangle,\n initialShouldShow = false,\n useReactPortal = true,\n}: TooltipProps): JSX.Element | null => {\n const [shouldShow, setShouldShow] = useState(initialShouldShow);\n const [hoverableElement, setHoverableElement] = useState<HTMLDivElement | null>(null);\n\n const classNames = {\n container: className && `${className} ${className}-container`,\n tip: className && `${className}-tip`,\n wrap: className && `${className}-wrap`,\n triangle: className && `${className}-triangle`,\n hoverable: className && `${className}-hoverable`,\n };\n\n const hasText = text ? text.trim().length > 0 : false;\n const hasContent = !!(content || hasText);\n\n if (!hasContent) return children;\n\n const show = () => setShouldShow(true);\n const hide = () => setShouldShow(false);\n\n return (\n <Container className={classNames.container}>\n <AnimatePresence>\n {shouldShow && (\n <WithOptionalPortal usePortal={useReactPortal}>\n <TooltipPopover\n key=\"tooltip-popover\"\n classNames={classNames}\n hoverableElement={hoverableElement}\n config={config}\n reversed={reversed}\n withTriangle={withTriangle}\n text={text}\n content={content}\n />\n </WithOptionalPortal>\n )}\n </AnimatePresence>\n\n <Container\n ref={setHoverableElement}\n className={classNames.hoverable}\n onMouseEnter={show}\n onMouseLeave={hide}\n >\n {children}\n </Container>\n </Container>\n );\n};\n"],"names":["React","Portal","useState","Container","AnimatePresence","TooltipPopover"],"mappings":";;;;;;;;;;;;AAOA,MAAM,kBAAkB,GAA0D,CAAC,EACjF,SAAS,GAAG,KAAK,EACjB,QAAQ;AACR;AACD,EAAA,MAAM,SAAS,GAAGA,sBAAA,CAAA,aAAA,CAACC,aAAM,QAAE,QAAQ,CAAU,GAAGD,4EAAG,QAAQ,CAAI,CAAC;AAE1D,MAAM,OAAO,GAAG,CAAC,EACtB,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,MAAM,EACN,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,YAAY,EACZ,iBAAiB,GAAG,KAAK,EACzB,cAAc,GAAG,IAAI,GACR,KAAwB;IACrC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAGE,cAAQ,CAAC,iBAAiB,CAAC;IAC/D,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAGA,cAAQ,CAAwB,IAAI,CAAC;AAErF,IAAA,MAAM,UAAU,GAAG;AACjB,QAAA,SAAS,EAAE,SAAS,IAAI,GAAG,SAAS,CAAA,CAAA,EAAI,SAAS,CAAA,UAAA,CAAY;AAC7D,QAAA,GAAG,EAAE,SAAS,IAAI,CAAA,EAAG,SAAS,CAAA,IAAA,CAAM;AACpC,QAA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"Tooltip.cjs","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import React, { ReactNode, useState } from 'react';\nimport { AnimatePresence } from 'framer-motion';\nimport { TooltipProps } from './types';\nimport { TooltipPopover } from './components/TooltipPopover';\nimport { LegacyClassNames } from './components/types';\nimport { Portal } from '../Portal';\nimport { buildClassnames } from '../../utils';\nimport tooltipStyles from './Tooltip.module.scss';\n\nconst WithOptionalPortal: React.FC<{ usePortal: boolean; children: ReactNode }> = ({\n usePortal = false,\n children,\n // eslint-disable-next-line react/jsx-no-useless-fragment\n}) => (usePortal ? <Portal>{children}</Portal> : <>{children}</>);\n\nexport const Tooltip = ({\n children,\n text,\n content,\n config,\n reversed = false,\n className,\n hoverableClassName,\n withTriangle,\n initialShouldShow = false,\n useReactPortal = true,\n}: TooltipProps): JSX.Element | null => {\n const [shouldShow, setShouldShow] = useState(initialShouldShow);\n const [hoverableElement, setHoverableElement] = useState<HTMLDivElement | null>(null);\n\n const hasText = text ? text.trim().length > 0 : false;\n const hasContent = !!(content || hasText);\n\n // Backward-compatible suffix classes for monolith consumers that\n // target sub-elements via the className prefix convention.\n const legacyClassNames: LegacyClassNames | undefined = className\n ? {\n tip: `${className}-tip`,\n wrap: `${className}-wrap`,\n triangle: `${className}-triangle`,\n }\n : undefined;\n\n if (!hasContent) return children;\n\n const show = () => setShouldShow(true);\n const hide = () => setShouldShow(false);\n\n return (\n <div className={buildClassnames([tooltipStyles.container, className, className && `${className}-container`])}>\n <AnimatePresence>\n {shouldShow && (\n <WithOptionalPortal usePortal={useReactPortal}>\n <TooltipPopover\n key=\"tooltip-popover\"\n hoverableElement={hoverableElement}\n config={config}\n reversed={reversed}\n withTriangle={withTriangle}\n text={text}\n content={content}\n legacyClassNames={legacyClassNames}\n />\n </WithOptionalPortal>\n )}\n </AnimatePresence>\n\n <div\n ref={setHoverableElement}\n className={buildClassnames([tooltipStyles.hoverable, hoverableClassName, className && `${className}-hoverable`])}\n onMouseEnter={show}\n onMouseLeave={hide}\n >\n {children}\n </div>\n </div>\n );\n};\n"],"names":["React","Portal","useState","buildClassnames","tooltipStyles","AnimatePresence","TooltipPopover"],"mappings":";;;;;;;;;;;;;;AASA,MAAM,kBAAkB,GAA0D,CAAC,EACjF,SAAS,GAAG,KAAK,EACjB,QAAQ;AACR;AACD,EAAA,MAAM,SAAS,GAAGA,sBAAA,CAAA,aAAA,CAACC,aAAM,QAAE,QAAQ,CAAU,GAAGD,4EAAG,QAAQ,CAAI,CAAC;AAE1D,MAAM,OAAO,GAAG,CAAC,EACtB,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,MAAM,EACN,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,GAAG,KAAK,EACzB,cAAc,GAAG,IAAI,GACR,KAAwB;IACrC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAGE,cAAQ,CAAC,iBAAiB,CAAC;IAC/D,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAGA,cAAQ,CAAwB,IAAI,CAAC;AAErF,IAAA,MAAM,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK;IACrD,MAAM,UAAU,GAAG,CAAC,EAAE,OAAO,IAAI,OAAO,CAAC;;;IAIzC,MAAM,gBAAgB,GAAiC;AACrD,UAAE;YACE,GAAG,EAAE,CAAA,EAAG,SAAS,CAAA,IAAA,CAAM;YACvB,IAAI,EAAE,CAAA,EAAG,SAAS,CAAA,KAAA,CAAO;YACzB,QAAQ,EAAE,CAAA,EAAG,SAAS,CAAA,SAAA,CAAW;AAClC;UACD,SAAS;AAEb,IAAA,IAAI,CAAC,UAAU;AAAE,QAAA,OAAO,QAAQ;IAEhC,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC;IACtC,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,KAAK,CAAC;AAEvC,IAAA,QACEF,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEG,+BAAe,CAAC,CAACC,cAAa,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,IAAI,GAAG,SAAS,CAAA,UAAA,CAAY,CAAC,CAAC,EAAA;QAC1GJ,sBAAA,CAAA,aAAA,CAACK,4BAAe,EAAA,IAAA,EACb,UAAU,KACTL,qCAAC,kBAAkB,EAAA,EAAC,SAAS,EAAE,cAAc,EAAA;AAC3C,YAAAA,sBAAA,CAAA,aAAA,CAACM,6BAAc,EAAA,EACb,GAAG,EAAC,iBAAiB,EACrB,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,gBAAgB,EAAA,CAClC,CACiB,CACtB,CACe;AAElB,QAAAN,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,GAAG,EAAE,mBAAmB,EACxB,SAAS,EAAEG,+BAAe,CAAC,CAACC,cAAa,CAAC,SAAS,EAAE,kBAAkB,EAAE,SAAS,IAAI,CAAA,EAAG,SAAS,YAAY,CAAC,CAAC,EAChH,YAAY,EAAE,IAAI,EAClB,YAAY,EAAE,IAAI,EAAA,EAEjB,QAAQ,CACL,CACF;AAEV;;;;"}
@@ -1,2 +1,2 @@
1
1
  import { TooltipProps } from './types';
2
- export declare const Tooltip: ({ children, text, content, config, reversed, className, withTriangle, initialShouldShow, useReactPortal, }: TooltipProps) => JSX.Element | null;
2
+ export declare const Tooltip: ({ children, text, content, config, reversed, className, hoverableClassName, withTriangle, initialShouldShow, useReactPortal, }: TooltipProps) => JSX.Element | null;
@@ -1,32 +1,36 @@
1
1
  import React__default, { useState } from 'react';
2
2
  import { AnimatePresence } from 'framer-motion';
3
- import { Container } from './components/styled.js';
4
3
  import { TooltipPopover } from './components/TooltipPopover.js';
5
4
  import { Portal } from '../Portal/Portal.js';
5
+ import { buildClassnames } from '../../utils/buildClassnames.js';
6
+ import 'uid/secure';
7
+ import tooltipStyles from './Tooltip.module.scss.js';
6
8
 
7
9
  const WithOptionalPortal = ({ usePortal = false, children,
8
10
  // eslint-disable-next-line react/jsx-no-useless-fragment
9
11
  }) => (usePortal ? React__default.createElement(Portal, null, children) : React__default.createElement(React__default.Fragment, null, children));
10
- const Tooltip = ({ children, text, content, config, reversed = false, className, withTriangle, initialShouldShow = false, useReactPortal = true, }) => {
12
+ const Tooltip = ({ children, text, content, config, reversed = false, className, hoverableClassName, withTriangle, initialShouldShow = false, useReactPortal = true, }) => {
11
13
  const [shouldShow, setShouldShow] = useState(initialShouldShow);
12
14
  const [hoverableElement, setHoverableElement] = useState(null);
13
- const classNames = {
14
- container: className && `${className} ${className}-container`,
15
- tip: className && `${className}-tip`,
16
- wrap: className && `${className}-wrap`,
17
- triangle: className && `${className}-triangle`,
18
- hoverable: className && `${className}-hoverable`,
19
- };
20
15
  const hasText = text ? text.trim().length > 0 : false;
21
16
  const hasContent = !!(content || hasText);
17
+ // Backward-compatible suffix classes for monolith consumers that
18
+ // target sub-elements via the className prefix convention.
19
+ const legacyClassNames = className
20
+ ? {
21
+ tip: `${className}-tip`,
22
+ wrap: `${className}-wrap`,
23
+ triangle: `${className}-triangle`,
24
+ }
25
+ : undefined;
22
26
  if (!hasContent)
23
27
  return children;
24
28
  const show = () => setShouldShow(true);
25
29
  const hide = () => setShouldShow(false);
26
- return (React__default.createElement(Container, { className: classNames.container },
30
+ return (React__default.createElement("div", { className: buildClassnames([tooltipStyles.container, className, className && `${className}-container`]) },
27
31
  React__default.createElement(AnimatePresence, null, shouldShow && (React__default.createElement(WithOptionalPortal, { usePortal: useReactPortal },
28
- React__default.createElement(TooltipPopover, { key: "tooltip-popover", classNames: classNames, hoverableElement: hoverableElement, config: config, reversed: reversed, withTriangle: withTriangle, text: text, content: content })))),
29
- React__default.createElement(Container, { ref: setHoverableElement, className: classNames.hoverable, onMouseEnter: show, onMouseLeave: hide }, children)));
32
+ React__default.createElement(TooltipPopover, { key: "tooltip-popover", hoverableElement: hoverableElement, config: config, reversed: reversed, withTriangle: withTriangle, text: text, content: content, legacyClassNames: legacyClassNames })))),
33
+ React__default.createElement("div", { ref: setHoverableElement, className: buildClassnames([tooltipStyles.hoverable, hoverableClassName, className && `${className}-hoverable`]), onMouseEnter: show, onMouseLeave: hide }, children)));
30
34
  };
31
35
 
32
36
  export { Tooltip };
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.js","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import React, { ReactNode, useState } from 'react';\nimport { AnimatePresence } from 'framer-motion';\nimport { TooltipProps } from './types';\nimport { Container } from './components/styled';\nimport { TooltipPopover } from './components/TooltipPopover';\nimport { Portal } from '../Portal';\n\nconst WithOptionalPortal: React.FC<{ usePortal: boolean; children: ReactNode }> = ({\n usePortal = false,\n children,\n // eslint-disable-next-line react/jsx-no-useless-fragment\n}) => (usePortal ? <Portal>{children}</Portal> : <>{children}</>);\n\nexport const Tooltip = ({\n children,\n text,\n content,\n config,\n reversed = false,\n className,\n withTriangle,\n initialShouldShow = false,\n useReactPortal = true,\n}: TooltipProps): JSX.Element | null => {\n const [shouldShow, setShouldShow] = useState(initialShouldShow);\n const [hoverableElement, setHoverableElement] = useState<HTMLDivElement | null>(null);\n\n const classNames = {\n container: className && `${className} ${className}-container`,\n tip: className && `${className}-tip`,\n wrap: className && `${className}-wrap`,\n triangle: className && `${className}-triangle`,\n hoverable: className && `${className}-hoverable`,\n };\n\n const hasText = text ? text.trim().length > 0 : false;\n const hasContent = !!(content || hasText);\n\n if (!hasContent) return children;\n\n const show = () => setShouldShow(true);\n const hide = () => setShouldShow(false);\n\n return (\n <Container className={classNames.container}>\n <AnimatePresence>\n {shouldShow && (\n <WithOptionalPortal usePortal={useReactPortal}>\n <TooltipPopover\n key=\"tooltip-popover\"\n classNames={classNames}\n hoverableElement={hoverableElement}\n config={config}\n reversed={reversed}\n withTriangle={withTriangle}\n text={text}\n content={content}\n />\n </WithOptionalPortal>\n )}\n </AnimatePresence>\n\n <Container\n ref={setHoverableElement}\n className={classNames.hoverable}\n onMouseEnter={show}\n onMouseLeave={hide}\n >\n {children}\n </Container>\n </Container>\n );\n};\n"],"names":["React"],"mappings":";;;;;;AAOA,MAAM,kBAAkB,GAA0D,CAAC,EACjF,SAAS,GAAG,KAAK,EACjB,QAAQ;AACR;AACD,EAAA,MAAM,SAAS,GAAGA,cAAA,CAAA,aAAA,CAAC,MAAM,QAAE,QAAQ,CAAU,GAAGA,4DAAG,QAAQ,CAAI,CAAC;AAE1D,MAAM,OAAO,GAAG,CAAC,EACtB,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,MAAM,EACN,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,YAAY,EACZ,iBAAiB,GAAG,KAAK,EACzB,cAAc,GAAG,IAAI,GACR,KAAwB;IACrC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,iBAAiB,CAAC;IAC/D,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAwB,IAAI,CAAC;AAErF,IAAA,MAAM,UAAU,GAAG;AACjB,QAAA,SAAS,EAAE,SAAS,IAAI,GAAG,SAAS,CAAA,CAAA,EAAI,SAAS,CAAA,UAAA,CAAY;AAC7D,QAAA,GAAG,EAAE,SAAS,IAAI,CAAA,EAAG,SAAS,CAAA,IAAA,CAAM;AACpC,QAAA,IAAI,EAAE,SAAS,IAAI,CAAA,EAAG,SAAS,CAAA,KAAA,CAAO;AACtC,QAAA,QAAQ,EAAE,SAAS,IAAI,CAAA,EAAG,SAAS,CAAA,SAAA,CAAW;AAC9C,QAAA,SAAS,EAAE,SAAS,IAAI,CAAA,EAAG,SAAS,CAAA,UAAA,CAAY;KACjD;AAED,IAAA,MAAM,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK;IACrD,MAAM,UAAU,GAAG,CAAC,EAAE,OAAO,IAAI,OAAO,CAAC;AAEzC,IAAA,IAAI,CAAC,UAAU;AAAE,QAAA,OAAO,QAAQ;IAEhC,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC;IACtC,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,KAAK,CAAC;IAEvC,QACEA,6BAAC,SAAS,EAAA,EAAC,SAAS,EAAE,UAAU,CAAC,SAAS,EAAA;QACxCA,cAAA,CAAA,aAAA,CAAC,eAAe,EAAA,IAAA,EACb,UAAU,KACTA,6BAAC,kBAAkB,EAAA,EAAC,SAAS,EAAE,cAAc,EAAA;AAC3C,YAAAA,cAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EACb,GAAG,EAAC,iBAAiB,EACrB,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAAA,CAChB,CACiB,CACtB,CACe;QAElBA,cAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EACR,GAAG,EAAE,mBAAmB,EACxB,SAAS,EAAE,UAAU,CAAC,SAAS,EAC/B,YAAY,EAAE,IAAI,EAClB,YAAY,EAAE,IAAI,IAEjB,QAAQ,CACC,CACF;AAEhB;;;;"}
1
+ {"version":3,"file":"Tooltip.js","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import React, { ReactNode, useState } from 'react';\nimport { AnimatePresence } from 'framer-motion';\nimport { TooltipProps } from './types';\nimport { TooltipPopover } from './components/TooltipPopover';\nimport { LegacyClassNames } from './components/types';\nimport { Portal } from '../Portal';\nimport { buildClassnames } from '../../utils';\nimport tooltipStyles from './Tooltip.module.scss';\n\nconst WithOptionalPortal: React.FC<{ usePortal: boolean; children: ReactNode }> = ({\n usePortal = false,\n children,\n // eslint-disable-next-line react/jsx-no-useless-fragment\n}) => (usePortal ? <Portal>{children}</Portal> : <>{children}</>);\n\nexport const Tooltip = ({\n children,\n text,\n content,\n config,\n reversed = false,\n className,\n hoverableClassName,\n withTriangle,\n initialShouldShow = false,\n useReactPortal = true,\n}: TooltipProps): JSX.Element | null => {\n const [shouldShow, setShouldShow] = useState(initialShouldShow);\n const [hoverableElement, setHoverableElement] = useState<HTMLDivElement | null>(null);\n\n const hasText = text ? text.trim().length > 0 : false;\n const hasContent = !!(content || hasText);\n\n // Backward-compatible suffix classes for monolith consumers that\n // target sub-elements via the className prefix convention.\n const legacyClassNames: LegacyClassNames | undefined = className\n ? {\n tip: `${className}-tip`,\n wrap: `${className}-wrap`,\n triangle: `${className}-triangle`,\n }\n : undefined;\n\n if (!hasContent) return children;\n\n const show = () => setShouldShow(true);\n const hide = () => setShouldShow(false);\n\n return (\n <div className={buildClassnames([tooltipStyles.container, className, className && `${className}-container`])}>\n <AnimatePresence>\n {shouldShow && (\n <WithOptionalPortal usePortal={useReactPortal}>\n <TooltipPopover\n key=\"tooltip-popover\"\n hoverableElement={hoverableElement}\n config={config}\n reversed={reversed}\n withTriangle={withTriangle}\n text={text}\n content={content}\n legacyClassNames={legacyClassNames}\n />\n </WithOptionalPortal>\n )}\n </AnimatePresence>\n\n <div\n ref={setHoverableElement}\n className={buildClassnames([tooltipStyles.hoverable, hoverableClassName, className && `${className}-hoverable`])}\n onMouseEnter={show}\n onMouseLeave={hide}\n >\n {children}\n </div>\n </div>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;AASA,MAAM,kBAAkB,GAA0D,CAAC,EACjF,SAAS,GAAG,KAAK,EACjB,QAAQ;AACR;AACD,EAAA,MAAM,SAAS,GAAGA,cAAA,CAAA,aAAA,CAAC,MAAM,QAAE,QAAQ,CAAU,GAAGA,4DAAG,QAAQ,CAAI,CAAC;AAE1D,MAAM,OAAO,GAAG,CAAC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AA,EACb,GAAG,EAAC,iBAAiB,EACrB,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,gBAAgB,EAAA,CAClC,CACiB,CACtB,CACe;AAElB,QAAAA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,GAAG,EAAE,mBAAmB,EACxB,SAAS,EAAE,eAAe,CAAC,CAAC,aAAa,CAAC,SAAS,EAAE,kBAAkB,EAAE,SAAS,IAAI,CAAA,EAAG,SAAS,YAAY,CAAC,CAAC,EAChH,YAAY,EAAE,IAAI,EAClB,YAAY,EAAE,IAAI,EAAA,EAEjB,QAAQ,CACL,CACF;AAEV;;;;"}
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var ___$insertStyle = require('../../_virtual/____insertStyle.cjs');
4
+
5
+ ___$insertStyle("._container_soh5t_1 {\n display: inline-block;\n}\n\n._hoverable_soh5t_5 {\n display: inline-block;\n}\n\n._tip_soh5t_9 {\n width: max-content;\n pointer-events: none;\n will-change: opacity, transform;\n}\n._tip_soh5t_9[data-popper-placement^=top-start] > ._triangle_soh5t_14 {\n left: 8px;\n bottom: 0;\n}\n._tip_soh5t_9[data-popper-placement^=top-end] > ._triangle_soh5t_14 {\n right: 8px;\n bottom: 0;\n}\n._tip_soh5t_9[data-popper-placement^=bottom-start] > ._triangle_soh5t_14 {\n left: 8px;\n top: -4px;\n}\n._tip_soh5t_9[data-popper-placement^=bottom-end] > ._triangle_soh5t_14 {\n right: 8px;\n top: -4px;\n}\n\n._wrap_soh5t_31 {\n display: inline-block;\n padding: var(--sizes-base) var(--sizes-5);\n overflow: hidden;\n z-index: 10;\n min-width: var(--tip-min-width);\n max-width: var(--tip-max-width);\n color: #fff;\n border-radius: var(--sizes-sm);\n box-shadow: var(--shadows-base);\n background: var(--colors-neutral-ink-dark);\n}\n\n._triangle_soh5t_14 {\n background-color: var(--colors-neutral-ink-dark);\n height: 16px;\n width: 16px;\n position: absolute;\n transform: rotate(45deg);\n z-index: var(--layers-tooltip);\n}");
6
+ var tooltipStyles = {"container":"_container_soh5t_1","hoverable":"_hoverable_soh5t_5","tip":"_tip_soh5t_9","triangle":"_triangle_soh5t_14","wrap":"_wrap_soh5t_31"};
7
+
8
+ module.exports = tooltipStyles;
9
+ //# sourceMappingURL=Tooltip.module.scss.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tooltip.module.scss.cjs","sources":["../../../src/components/Tooltip/Tooltip.module.scss"],"sourcesContent":[".container {\n display: inline-block;\n}\n\n.hoverable {\n display: inline-block;\n}\n\n.tip {\n width: max-content;\n pointer-events: none;\n will-change: opacity, transform;\n\n &[data-popper-placement^='top-start'] > .triangle {\n left: 8px;\n bottom: 0;\n }\n\n &[data-popper-placement^='top-end'] > .triangle {\n right: 8px;\n bottom: 0;\n }\n\n &[data-popper-placement^='bottom-start'] > .triangle {\n left: 8px;\n top: -4px;\n }\n\n &[data-popper-placement^='bottom-end'] > .triangle {\n right: 8px;\n top: -4px;\n }\n}\n\n.wrap {\n display: inline-block;\n padding: var(--sizes-base) var(--sizes-5);\n overflow: hidden;\n z-index: 10;\n min-width: var(--tip-min-width);\n max-width: var(--tip-max-width);\n color: #fff;\n border-radius: var(--sizes-sm);\n box-shadow: var(--shadows-base);\n background: var(--colors-neutral-ink-dark);\n}\n\n.triangle {\n background-color: var(--colors-neutral-ink-dark);\n height: 16px;\n width: 16px;\n position: absolute;\n transform: rotate(45deg);\n z-index: var(--layers-tooltip);\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,opCAAA;;;;;"}
@@ -0,0 +1,7 @@
1
+ import insertStyle from '../../_virtual/____insertStyle.js';
2
+
3
+ insertStyle("._container_soh5t_1 {\n display: inline-block;\n}\n\n._hoverable_soh5t_5 {\n display: inline-block;\n}\n\n._tip_soh5t_9 {\n width: max-content;\n pointer-events: none;\n will-change: opacity, transform;\n}\n._tip_soh5t_9[data-popper-placement^=top-start] > ._triangle_soh5t_14 {\n left: 8px;\n bottom: 0;\n}\n._tip_soh5t_9[data-popper-placement^=top-end] > ._triangle_soh5t_14 {\n right: 8px;\n bottom: 0;\n}\n._tip_soh5t_9[data-popper-placement^=bottom-start] > ._triangle_soh5t_14 {\n left: 8px;\n top: -4px;\n}\n._tip_soh5t_9[data-popper-placement^=bottom-end] > ._triangle_soh5t_14 {\n right: 8px;\n top: -4px;\n}\n\n._wrap_soh5t_31 {\n display: inline-block;\n padding: var(--sizes-base) var(--sizes-5);\n overflow: hidden;\n z-index: 10;\n min-width: var(--tip-min-width);\n max-width: var(--tip-max-width);\n color: #fff;\n border-radius: var(--sizes-sm);\n box-shadow: var(--shadows-base);\n background: var(--colors-neutral-ink-dark);\n}\n\n._triangle_soh5t_14 {\n background-color: var(--colors-neutral-ink-dark);\n height: 16px;\n width: 16px;\n position: absolute;\n transform: rotate(45deg);\n z-index: var(--layers-tooltip);\n}");
4
+ var tooltipStyles = {"container":"_container_soh5t_1","hoverable":"_hoverable_soh5t_5","tip":"_tip_soh5t_9","triangle":"_triangle_soh5t_14","wrap":"_wrap_soh5t_31"};
5
+
6
+ export { tooltipStyles as default };
7
+ //# sourceMappingURL=Tooltip.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tooltip.module.scss.js","sources":["../../../src/components/Tooltip/Tooltip.module.scss"],"sourcesContent":[".container {\n display: inline-block;\n}\n\n.hoverable {\n display: inline-block;\n}\n\n.tip {\n width: max-content;\n pointer-events: none;\n will-change: opacity, transform;\n\n &[data-popper-placement^='top-start'] > .triangle {\n left: 8px;\n bottom: 0;\n }\n\n &[data-popper-placement^='top-end'] > .triangle {\n right: 8px;\n bottom: 0;\n }\n\n &[data-popper-placement^='bottom-start'] > .triangle {\n left: 8px;\n top: -4px;\n }\n\n &[data-popper-placement^='bottom-end'] > .triangle {\n right: 8px;\n top: -4px;\n }\n}\n\n.wrap {\n display: inline-block;\n padding: var(--sizes-base) var(--sizes-5);\n overflow: hidden;\n z-index: 10;\n min-width: var(--tip-min-width);\n max-width: var(--tip-max-width);\n color: #fff;\n border-radius: var(--sizes-sm);\n box-shadow: var(--shadows-base);\n background: var(--colors-neutral-ink-dark);\n}\n\n.triangle {\n background-color: var(--colors-neutral-ink-dark);\n height: 16px;\n width: 16px;\n position: absolute;\n transform: rotate(45deg);\n z-index: var(--layers-tooltip);\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,opCAAA;;;;;"}