@cimpress-ui/react 0.0.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 (286) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +17 -0
  3. package/dist/commonjs/components/button/button.d.ts +6 -0
  4. package/dist/commonjs/components/button/button.d.ts.map +1 -0
  5. package/dist/commonjs/components/button/button.js +18 -0
  6. package/dist/commonjs/components/button/button.js.map +1 -0
  7. package/dist/commonjs/components/button/icon-button.d.ts +6 -0
  8. package/dist/commonjs/components/button/icon-button.d.ts.map +1 -0
  9. package/dist/commonjs/components/button/icon-button.js +18 -0
  10. package/dist/commonjs/components/button/icon-button.js.map +1 -0
  11. package/dist/commonjs/components/button/icon-link-button.d.ts +7 -0
  12. package/dist/commonjs/components/button/icon-link-button.d.ts.map +1 -0
  13. package/dist/commonjs/components/button/icon-link-button.js +17 -0
  14. package/dist/commonjs/components/button/icon-link-button.js.map +1 -0
  15. package/dist/commonjs/components/button/link-button.d.ts +7 -0
  16. package/dist/commonjs/components/button/link-button.d.ts.map +1 -0
  17. package/dist/commonjs/components/button/link-button.js +17 -0
  18. package/dist/commonjs/components/button/link-button.js.map +1 -0
  19. package/dist/commonjs/components/button/types.d.ts +62 -0
  20. package/dist/commonjs/components/button/types.d.ts.map +1 -0
  21. package/dist/commonjs/components/button/types.js +3 -0
  22. package/dist/commonjs/components/button/types.js.map +1 -0
  23. package/dist/commonjs/components/checkbox/checkbox-group.d.ts +11 -0
  24. package/dist/commonjs/components/checkbox/checkbox-group.d.ts.map +1 -0
  25. package/dist/commonjs/components/checkbox/checkbox-group.js +31 -0
  26. package/dist/commonjs/components/checkbox/checkbox-group.js.map +1 -0
  27. package/dist/commonjs/components/checkbox/checkbox.d.ts +9 -0
  28. package/dist/commonjs/components/checkbox/checkbox.d.ts.map +1 -0
  29. package/dist/commonjs/components/checkbox/checkbox.js +26 -0
  30. package/dist/commonjs/components/checkbox/checkbox.js.map +1 -0
  31. package/dist/commonjs/components/combo-box/combo-box.d.ts +33 -0
  32. package/dist/commonjs/components/combo-box/combo-box.d.ts.map +1 -0
  33. package/dist/commonjs/components/combo-box/combo-box.js +45 -0
  34. package/dist/commonjs/components/combo-box/combo-box.js.map +1 -0
  35. package/dist/commonjs/components/form/form.d.ts +7 -0
  36. package/dist/commonjs/components/form/form.d.ts.map +1 -0
  37. package/dist/commonjs/components/form/form.js +17 -0
  38. package/dist/commonjs/components/form/form.js.map +1 -0
  39. package/dist/commonjs/components/form-field/form-field.d.ts +13 -0
  40. package/dist/commonjs/components/form-field/form-field.d.ts.map +1 -0
  41. package/dist/commonjs/components/form-field/form-field.js +36 -0
  42. package/dist/commonjs/components/form-field/form-field.js.map +1 -0
  43. package/dist/commonjs/components/menu/menu.d.ts +38 -0
  44. package/dist/commonjs/components/menu/menu.d.ts.map +1 -0
  45. package/dist/commonjs/components/menu/menu.js +43 -0
  46. package/dist/commonjs/components/menu/menu.js.map +1 -0
  47. package/dist/commonjs/components/radio/radio-group.d.ts +11 -0
  48. package/dist/commonjs/components/radio/radio-group.d.ts.map +1 -0
  49. package/dist/commonjs/components/radio/radio-group.js +31 -0
  50. package/dist/commonjs/components/radio/radio-group.js.map +1 -0
  51. package/dist/commonjs/components/radio/radio.d.ts +9 -0
  52. package/dist/commonjs/components/radio/radio.d.ts.map +1 -0
  53. package/dist/commonjs/components/radio/radio.js +25 -0
  54. package/dist/commonjs/components/radio/radio.js.map +1 -0
  55. package/dist/commonjs/components/select/select.d.ts +28 -0
  56. package/dist/commonjs/components/select/select.d.ts.map +1 -0
  57. package/dist/commonjs/components/select/select.js +34 -0
  58. package/dist/commonjs/components/select/select.js.map +1 -0
  59. package/dist/commonjs/components/spacing/box/box.d.ts +8 -0
  60. package/dist/commonjs/components/spacing/box/box.d.ts.map +1 -0
  61. package/dist/commonjs/components/spacing/box/box.js +12 -0
  62. package/dist/commonjs/components/spacing/box/box.js.map +1 -0
  63. package/dist/commonjs/components/spacing/stack/stack.d.ts +11 -0
  64. package/dist/commonjs/components/spacing/stack/stack.d.ts.map +1 -0
  65. package/dist/commonjs/components/spacing/stack/stack.js +23 -0
  66. package/dist/commonjs/components/spacing/stack/stack.js.map +1 -0
  67. package/dist/commonjs/components/spacing/types.d.ts +23 -0
  68. package/dist/commonjs/components/spacing/types.d.ts.map +1 -0
  69. package/dist/commonjs/components/spacing/types.js +40 -0
  70. package/dist/commonjs/components/spacing/types.js.map +1 -0
  71. package/dist/commonjs/components/spinner/spinner.d.ts +9 -0
  72. package/dist/commonjs/components/spinner/spinner.d.ts.map +1 -0
  73. package/dist/commonjs/components/spinner/spinner.js +26 -0
  74. package/dist/commonjs/components/spinner/spinner.js.map +1 -0
  75. package/dist/commonjs/components/sr-only/sr-only.d.ts +8 -0
  76. package/dist/commonjs/components/sr-only/sr-only.d.ts.map +1 -0
  77. package/dist/commonjs/components/sr-only/sr-only.js +10 -0
  78. package/dist/commonjs/components/sr-only/sr-only.js.map +1 -0
  79. package/dist/commonjs/components/text-inputs/text-area.d.ts +7 -0
  80. package/dist/commonjs/components/text-inputs/text-area.d.ts.map +1 -0
  81. package/dist/commonjs/components/text-inputs/text-area.js +19 -0
  82. package/dist/commonjs/components/text-inputs/text-area.js.map +1 -0
  83. package/dist/commonjs/components/text-inputs/text-field.d.ts +7 -0
  84. package/dist/commonjs/components/text-inputs/text-field.d.ts.map +1 -0
  85. package/dist/commonjs/components/text-inputs/text-field.js +19 -0
  86. package/dist/commonjs/components/text-inputs/text-field.js.map +1 -0
  87. package/dist/commonjs/components/types.d.ts +79 -0
  88. package/dist/commonjs/components/types.d.ts.map +1 -0
  89. package/dist/commonjs/components/types.js +3 -0
  90. package/dist/commonjs/components/types.js.map +1 -0
  91. package/dist/commonjs/components/typography/link.d.ts +13 -0
  92. package/dist/commonjs/components/typography/link.d.ts.map +1 -0
  93. package/dist/commonjs/components/typography/link.js +17 -0
  94. package/dist/commonjs/components/typography/link.js.map +1 -0
  95. package/dist/commonjs/components/typography/text.d.ts +10 -0
  96. package/dist/commonjs/components/typography/text.d.ts.map +1 -0
  97. package/dist/commonjs/components/typography/text.js +22 -0
  98. package/dist/commonjs/components/typography/text.js.map +1 -0
  99. package/dist/commonjs/components/typography/types.d.ts +21 -0
  100. package/dist/commonjs/components/typography/types.d.ts.map +1 -0
  101. package/dist/commonjs/components/typography/types.js +3 -0
  102. package/dist/commonjs/components/typography/types.js.map +1 -0
  103. package/dist/commonjs/components/typography/utils.d.ts +3 -0
  104. package/dist/commonjs/components/typography/utils.d.ts.map +1 -0
  105. package/dist/commonjs/components/typography/utils.js +17 -0
  106. package/dist/commonjs/components/typography/utils.js.map +1 -0
  107. package/dist/commonjs/forward-ref.d.ts +3 -0
  108. package/dist/commonjs/forward-ref.d.ts.map +1 -0
  109. package/dist/commonjs/forward-ref.js +20 -0
  110. package/dist/commonjs/forward-ref.js.map +1 -0
  111. package/dist/commonjs/icons/add.d.ts +7 -0
  112. package/dist/commonjs/icons/add.d.ts.map +1 -0
  113. package/dist/commonjs/icons/add.js +7 -0
  114. package/dist/commonjs/icons/add.js.map +1 -0
  115. package/dist/commonjs/icons/alert-triangle.d.ts +7 -0
  116. package/dist/commonjs/icons/alert-triangle.d.ts.map +1 -0
  117. package/dist/commonjs/icons/alert-triangle.js +7 -0
  118. package/dist/commonjs/icons/alert-triangle.js.map +1 -0
  119. package/dist/commonjs/icons/checkmark-small.d.ts +7 -0
  120. package/dist/commonjs/icons/checkmark-small.d.ts.map +1 -0
  121. package/dist/commonjs/icons/checkmark-small.js +7 -0
  122. package/dist/commonjs/icons/checkmark-small.js.map +1 -0
  123. package/dist/commonjs/icons/index.d.ts +5 -0
  124. package/dist/commonjs/icons/index.d.ts.map +1 -0
  125. package/dist/commonjs/icons/index.js +15 -0
  126. package/dist/commonjs/icons/index.js.map +1 -0
  127. package/dist/commonjs/icons/minus-small.d.ts +7 -0
  128. package/dist/commonjs/icons/minus-small.d.ts.map +1 -0
  129. package/dist/commonjs/icons/minus-small.js +7 -0
  130. package/dist/commonjs/icons/minus-small.js.map +1 -0
  131. package/dist/commonjs/index.d.ts +23 -0
  132. package/dist/commonjs/index.d.ts.map +1 -0
  133. package/dist/commonjs/index.js +38 -0
  134. package/dist/commonjs/index.js.map +1 -0
  135. package/dist/commonjs/package.json +3 -0
  136. package/dist/commonjs/providers/ssr/ssr-provider.d.ts +13 -0
  137. package/dist/commonjs/providers/ssr/ssr-provider.d.ts.map +1 -0
  138. package/dist/commonjs/providers/ssr/ssr-provider.js +18 -0
  139. package/dist/commonjs/providers/ssr/ssr-provider.js.map +1 -0
  140. package/dist/commonjs/with-style-props.d.ts +15 -0
  141. package/dist/commonjs/with-style-props.d.ts.map +1 -0
  142. package/dist/commonjs/with-style-props.js +29 -0
  143. package/dist/commonjs/with-style-props.js.map +1 -0
  144. package/dist/esm/components/button/button.d.ts +6 -0
  145. package/dist/esm/components/button/button.d.ts.map +1 -0
  146. package/dist/esm/components/button/button.js +12 -0
  147. package/dist/esm/components/button/button.js.map +1 -0
  148. package/dist/esm/components/button/icon-button.d.ts +6 -0
  149. package/dist/esm/components/button/icon-button.d.ts.map +1 -0
  150. package/dist/esm/components/button/icon-button.js +12 -0
  151. package/dist/esm/components/button/icon-button.js.map +1 -0
  152. package/dist/esm/components/button/icon-link-button.d.ts +7 -0
  153. package/dist/esm/components/button/icon-link-button.d.ts.map +1 -0
  154. package/dist/esm/components/button/icon-link-button.js +11 -0
  155. package/dist/esm/components/button/icon-link-button.js.map +1 -0
  156. package/dist/esm/components/button/link-button.d.ts +7 -0
  157. package/dist/esm/components/button/link-button.d.ts.map +1 -0
  158. package/dist/esm/components/button/link-button.js +11 -0
  159. package/dist/esm/components/button/link-button.js.map +1 -0
  160. package/dist/esm/components/button/types.d.ts +62 -0
  161. package/dist/esm/components/button/types.d.ts.map +1 -0
  162. package/dist/esm/components/button/types.js +2 -0
  163. package/dist/esm/components/button/types.js.map +1 -0
  164. package/dist/esm/components/checkbox/checkbox-group.d.ts +11 -0
  165. package/dist/esm/components/checkbox/checkbox-group.d.ts.map +1 -0
  166. package/dist/esm/components/checkbox/checkbox-group.js +25 -0
  167. package/dist/esm/components/checkbox/checkbox-group.js.map +1 -0
  168. package/dist/esm/components/checkbox/checkbox.d.ts +9 -0
  169. package/dist/esm/components/checkbox/checkbox.d.ts.map +1 -0
  170. package/dist/esm/components/checkbox/checkbox.js +20 -0
  171. package/dist/esm/components/checkbox/checkbox.js.map +1 -0
  172. package/dist/esm/components/combo-box/combo-box.d.ts +33 -0
  173. package/dist/esm/components/combo-box/combo-box.d.ts.map +1 -0
  174. package/dist/esm/components/combo-box/combo-box.js +39 -0
  175. package/dist/esm/components/combo-box/combo-box.js.map +1 -0
  176. package/dist/esm/components/form/form.d.ts +7 -0
  177. package/dist/esm/components/form/form.d.ts.map +1 -0
  178. package/dist/esm/components/form/form.js +11 -0
  179. package/dist/esm/components/form/form.js.map +1 -0
  180. package/dist/esm/components/form-field/form-field.d.ts +13 -0
  181. package/dist/esm/components/form-field/form-field.d.ts.map +1 -0
  182. package/dist/esm/components/form-field/form-field.js +28 -0
  183. package/dist/esm/components/form-field/form-field.js.map +1 -0
  184. package/dist/esm/components/menu/menu.d.ts +38 -0
  185. package/dist/esm/components/menu/menu.d.ts.map +1 -0
  186. package/dist/esm/components/menu/menu.js +34 -0
  187. package/dist/esm/components/menu/menu.js.map +1 -0
  188. package/dist/esm/components/radio/radio-group.d.ts +11 -0
  189. package/dist/esm/components/radio/radio-group.d.ts.map +1 -0
  190. package/dist/esm/components/radio/radio-group.js +25 -0
  191. package/dist/esm/components/radio/radio-group.js.map +1 -0
  192. package/dist/esm/components/radio/radio.d.ts +9 -0
  193. package/dist/esm/components/radio/radio.d.ts.map +1 -0
  194. package/dist/esm/components/radio/radio.js +19 -0
  195. package/dist/esm/components/radio/radio.js.map +1 -0
  196. package/dist/esm/components/select/select.d.ts +28 -0
  197. package/dist/esm/components/select/select.d.ts.map +1 -0
  198. package/dist/esm/components/select/select.js +28 -0
  199. package/dist/esm/components/select/select.js.map +1 -0
  200. package/dist/esm/components/spacing/box/box.d.ts +8 -0
  201. package/dist/esm/components/spacing/box/box.d.ts.map +1 -0
  202. package/dist/esm/components/spacing/box/box.js +9 -0
  203. package/dist/esm/components/spacing/box/box.js.map +1 -0
  204. package/dist/esm/components/spacing/stack/stack.d.ts +11 -0
  205. package/dist/esm/components/spacing/stack/stack.d.ts.map +1 -0
  206. package/dist/esm/components/spacing/stack/stack.js +17 -0
  207. package/dist/esm/components/spacing/stack/stack.js.map +1 -0
  208. package/dist/esm/components/spacing/types.d.ts +23 -0
  209. package/dist/esm/components/spacing/types.d.ts.map +1 -0
  210. package/dist/esm/components/spacing/types.js +37 -0
  211. package/dist/esm/components/spacing/types.js.map +1 -0
  212. package/dist/esm/components/spinner/spinner.d.ts +9 -0
  213. package/dist/esm/components/spinner/spinner.d.ts.map +1 -0
  214. package/dist/esm/components/spinner/spinner.js +20 -0
  215. package/dist/esm/components/spinner/spinner.js.map +1 -0
  216. package/dist/esm/components/sr-only/sr-only.d.ts +8 -0
  217. package/dist/esm/components/sr-only/sr-only.d.ts.map +1 -0
  218. package/dist/esm/components/sr-only/sr-only.js +7 -0
  219. package/dist/esm/components/sr-only/sr-only.js.map +1 -0
  220. package/dist/esm/components/text-inputs/text-area.d.ts +7 -0
  221. package/dist/esm/components/text-inputs/text-area.d.ts.map +1 -0
  222. package/dist/esm/components/text-inputs/text-area.js +13 -0
  223. package/dist/esm/components/text-inputs/text-area.js.map +1 -0
  224. package/dist/esm/components/text-inputs/text-field.d.ts +7 -0
  225. package/dist/esm/components/text-inputs/text-field.d.ts.map +1 -0
  226. package/dist/esm/components/text-inputs/text-field.js +13 -0
  227. package/dist/esm/components/text-inputs/text-field.js.map +1 -0
  228. package/dist/esm/components/types.d.ts +79 -0
  229. package/dist/esm/components/types.d.ts.map +1 -0
  230. package/dist/esm/components/types.js +2 -0
  231. package/dist/esm/components/types.js.map +1 -0
  232. package/dist/esm/components/typography/link.d.ts +13 -0
  233. package/dist/esm/components/typography/link.d.ts.map +1 -0
  234. package/dist/esm/components/typography/link.js +11 -0
  235. package/dist/esm/components/typography/link.js.map +1 -0
  236. package/dist/esm/components/typography/text.d.ts +10 -0
  237. package/dist/esm/components/typography/text.d.ts.map +1 -0
  238. package/dist/esm/components/typography/text.js +16 -0
  239. package/dist/esm/components/typography/text.js.map +1 -0
  240. package/dist/esm/components/typography/types.d.ts +21 -0
  241. package/dist/esm/components/typography/types.d.ts.map +1 -0
  242. package/dist/esm/components/typography/types.js +2 -0
  243. package/dist/esm/components/typography/types.js.map +1 -0
  244. package/dist/esm/components/typography/utils.d.ts +3 -0
  245. package/dist/esm/components/typography/utils.d.ts.map +1 -0
  246. package/dist/esm/components/typography/utils.js +11 -0
  247. package/dist/esm/components/typography/utils.js.map +1 -0
  248. package/dist/esm/forward-ref.d.ts +3 -0
  249. package/dist/esm/forward-ref.d.ts.map +1 -0
  250. package/dist/esm/forward-ref.js +19 -0
  251. package/dist/esm/forward-ref.js.map +1 -0
  252. package/dist/esm/icons/add.d.ts +7 -0
  253. package/dist/esm/icons/add.d.ts.map +1 -0
  254. package/dist/esm/icons/add.js +5 -0
  255. package/dist/esm/icons/add.js.map +1 -0
  256. package/dist/esm/icons/alert-triangle.d.ts +7 -0
  257. package/dist/esm/icons/alert-triangle.d.ts.map +1 -0
  258. package/dist/esm/icons/alert-triangle.js +5 -0
  259. package/dist/esm/icons/alert-triangle.js.map +1 -0
  260. package/dist/esm/icons/checkmark-small.d.ts +7 -0
  261. package/dist/esm/icons/checkmark-small.d.ts.map +1 -0
  262. package/dist/esm/icons/checkmark-small.js +5 -0
  263. package/dist/esm/icons/checkmark-small.js.map +1 -0
  264. package/dist/esm/icons/index.d.ts +5 -0
  265. package/dist/esm/icons/index.d.ts.map +1 -0
  266. package/dist/esm/icons/index.js +5 -0
  267. package/dist/esm/icons/index.js.map +1 -0
  268. package/dist/esm/icons/minus-small.d.ts +7 -0
  269. package/dist/esm/icons/minus-small.d.ts.map +1 -0
  270. package/dist/esm/icons/minus-small.js +5 -0
  271. package/dist/esm/icons/minus-small.js.map +1 -0
  272. package/dist/esm/index.d.ts +23 -0
  273. package/dist/esm/index.d.ts.map +1 -0
  274. package/dist/esm/index.js +22 -0
  275. package/dist/esm/index.js.map +1 -0
  276. package/dist/esm/package.json +3 -0
  277. package/dist/esm/providers/ssr/ssr-provider.d.ts +13 -0
  278. package/dist/esm/providers/ssr/ssr-provider.d.ts.map +1 -0
  279. package/dist/esm/providers/ssr/ssr-provider.js +15 -0
  280. package/dist/esm/providers/ssr/ssr-provider.js.map +1 -0
  281. package/dist/esm/with-style-props.d.ts +15 -0
  282. package/dist/esm/with-style-props.d.ts.map +1 -0
  283. package/dist/esm/with-style-props.js +23 -0
  284. package/dist/esm/with-style-props.js.map +1 -0
  285. package/dist-styles/styles.css +2 -0
  286. package/package.json +104 -0
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ComboBox = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const clsx_1 = __importDefault(require("clsx"));
9
+ const react_1 = require("react");
10
+ const react_aria_components_1 = require("react-aria-components");
11
+ const forward_ref_js_1 = require("../../forward-ref.js");
12
+ const with_style_props_js_1 = require("../../with-style-props.js");
13
+ const form_field_js_1 = require("../form-field/form-field.js");
14
+ const utils_js_1 = require("../typography/utils.js");
15
+ function ComboBox({ label, description, error, options, placeholder, UNSAFE_className, UNSAFE_style, ...props }, ref) {
16
+ const triggerPositioningRef = (0, react_1.useRef)(null);
17
+ return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.ComboBox, { ...props, ref: ref, className: (0, clsx_1.default)('cim-combo-box', UNSAFE_className), style: UNSAFE_style, menuTrigger: "focus", children: [(0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldLabel, { isRequired: props.isRequired, children: label }), (0, jsx_runtime_1.jsxs)("div", { className: "cim-combo-box-input-wrapper", ref: triggerPositioningRef, children: [(0, jsx_runtime_1.jsx)(ComboBoxInput, { isReadOnly: props.isReadOnly, placeholder: placeholder }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Button, { className: "cim-combo-box-button", children: (0, jsx_runtime_1.jsx)(ChevronDownIcon, { height: 12, width: 12, "aria-hidden": "true" }) })] }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldError, { children: error }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldDescription, { children: description }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Popover, { offset: 2, maxHeight: 315, className: "cim-combo-box-popover",
18
+ // Position popover relative to wrapper div instead of input to account for border
19
+ triggerRef: triggerPositioningRef, "data-experimental-cim-style-root": true, children: (0, jsx_runtime_1.jsx)(react_aria_components_1.ListBox, { className: "cim-combo-box-listbox", items: options, children: renderOptions }) })] }));
20
+ }
21
+ const _ComboBox = (0, with_style_props_js_1.withStyleProps)((0, forward_ref_js_1.forwardRef)(ComboBox), 'ComboBox');
22
+ exports.ComboBox = _ComboBox;
23
+ function ComboBoxInput({ isReadOnly, placeholder, }) {
24
+ const comboBoxState = (0, react_1.useContext)(react_aria_components_1.ComboBoxStateContext);
25
+ return ((0, jsx_runtime_1.jsx)(react_aria_components_1.Input, { className: (0, clsx_1.default)('cim-combo-box-input', (0, utils_js_1.textStyle)({ variant: 'medium' })),
26
+ // Ensure the popover opens when the input is clicked.
27
+ // By default, React Aria only opens the popover when the input is focused.
28
+ onClick: () => !isReadOnly && comboBoxState.open(), placeholder: placeholder }));
29
+ }
30
+ function renderOptions(item) {
31
+ if ('options' in item) {
32
+ return ((0, jsx_runtime_1.jsx)(ComboBoxSection, { id: item.id, title: item.label, items: item.options, children: (child) => ((0, jsx_runtime_1.jsx)(ComboBoxItem, { id: child.id, isDisabled: child.isDisabled, children: child.label })) }));
33
+ }
34
+ return ((0, jsx_runtime_1.jsx)(ComboBoxItem, { id: item.id, isDisabled: item.isDisabled, children: item.label }));
35
+ }
36
+ function ComboBoxItem({ children, ...props }) {
37
+ return ((0, jsx_runtime_1.jsx)(react_aria_components_1.ListBoxItem, { ...props, className: (0, clsx_1.default)('cim-combo-box-item', (0, utils_js_1.textStyle)({ variant: 'medium' })), children: children }));
38
+ }
39
+ function ComboBoxSection({ title, children, items, ...props }) {
40
+ return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.Section, { ...props, className: "cim-combo-box-section", children: [(0, jsx_runtime_1.jsx)(react_aria_components_1.Header, { className: (0, clsx_1.default)('cim-combo-box-header', (0, utils_js_1.textStyle)({ variant: 'small', tone: 'subtle' })), children: title }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Collection, { items: items, children: children })] }));
41
+ }
42
+ function ChevronDownIcon(props) {
43
+ return ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 12 12", fill: "currentColor", "data-icon": true, ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M.124 3.603 5.617 9.84a.533.533 0 0 0 .769 0l5.49-6.236a.493.493 0 0 0-.054-.707l-.925-.778a.514.514 0 0 0-.719.055L6.095 6.9a.125.125 0 0 1-.189 0L1.822 2.173A.51.51 0 0 0 1.474 2a.5.5 0 0 0-.37.119l-.926.777a.494.494 0 0 0-.054.707Z" }) }));
44
+ }
45
+ //# sourceMappingURL=combo-box.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combo-box.js","sourceRoot":"","sources":["../../../../src/components/combo-box/combo-box.tsx"],"names":[],"mappings":";;;;;;;AAAA,gDAAwB;AACxB,iCAAkG;AAClG,iEAa+B;AAC/B,yDAAkD;AAClD,mEAA2D;AAC3D,+DAAmG;AAEnG,qDAAmD;AAkDnD,SAAS,QAAQ,CACf,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAoB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AC,uBAAuB,aACtD,uBAAC,8BAAS,IAAC,SAAS,EAAE,IAAA,cAAI,EAAC,sBAAsB,EAAE,IAAA,oBAAS,EAAC,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,YAChG,KAAK,GACI,EACZ,uBAAC,kCAAa,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAiB,IAC5C,CACd,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,KAAmC;IAC1D,OAAO,CACL,gCAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,wBAAe,KAAK,YACjG,iCAAM,CAAC,EAAC,4OAA4O,GAAG,GACnP,CACP,CAAC;AACJ,CAAC","sourcesContent":["import clsx from 'clsx';\nimport { useContext, useRef, type ForwardedRef, type ReactNode, type SVGAttributes } from 'react';\nimport {\n ComboBoxStateContext,\n Button as RACButton,\n Collection as RACCollection,\n ComboBox as RACComboBox,\n Header as RACHeader,\n Input as RACInput,\n ListBox as RACListBox,\n ListBoxItem as RACListBoxItem,\n Popover as RACPopover,\n Section as RACSection,\n type ComboBoxProps as RACComboBoxProps,\n type ListBoxItemProps as RACListBoxItemProps,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../form-field/form-field.js';\nimport type { DOMProps, FieldWithPlaceholderProps, Key } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface ComboBoxOption {\n /** The unique id of the item. When integrated with a form, this will be the value of the option. */\n id: string;\n /** The content to display as the label of the option. */\n label: string;\n /** Whether the option is disabled. */\n isDisabled?: boolean;\n}\n\nexport interface ComboBoxOptionGroup {\n /** The unique id of the group. */\n id: string;\n /** The content to display as the title of the group. */\n label: string;\n /** The options available for selection within the group. */\n options: ComboBoxOption[];\n isDisabled?: never;\n}\n\nexport interface ComboBoxValidationValue {\n /** The selected key in the ComboBox. */\n selectedKey: Key | null;\n /** The value of the ComboBox input. */\n inputValue: string;\n}\n\nexport interface ComboBoxProps<T extends object>\n extends Pick<\n RACComboBoxProps<T>,\n | 'name'\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'isReadOnly'\n | 'selectedKey'\n | 'defaultSelectedKey'\n | 'inputValue'\n | 'defaultInputValue'\n | 'autoFocus'\n | 'onSelectionChange'\n | 'onInputChange'\n >,\n DOMProps,\n FieldWithPlaceholderProps<ComboBoxValidationValue> {\n /** The options available for selection. Supports groups with a single level of nesting. */\n options: Array<ComboBoxOption | ComboBoxOptionGroup>;\n}\n\nfunction ComboBox<T extends object>(\n { label, description, error, options, placeholder, UNSAFE_className, UNSAFE_style, ...props }: ComboBoxProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const triggerPositioningRef = useRef<HTMLDivElement>(null);\n\n return (\n <RACComboBox\n {...props}\n ref={ref}\n className={clsx('cim-combo-box', UNSAFE_className)}\n style={UNSAFE_style}\n menuTrigger=\"focus\"\n >\n <FormFieldLabel isRequired={props.isRequired}>{label}</FormFieldLabel>\n <div className=\"cim-combo-box-input-wrapper\" ref={triggerPositioningRef}>\n <ComboBoxInput isReadOnly={props.isReadOnly} placeholder={placeholder} />\n <RACButton className=\"cim-combo-box-button\">\n <ChevronDownIcon height={12} width={12} aria-hidden=\"true\" />\n </RACButton>\n </div>\n <FormFieldError>{error}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n <RACPopover\n offset={2}\n maxHeight={315}\n className=\"cim-combo-box-popover\"\n // Position popover relative to wrapper div instead of input to account for border\n triggerRef={triggerPositioningRef}\n data-experimental-cim-style-root\n >\n <RACListBox className=\"cim-combo-box-listbox\" items={options}>\n {renderOptions}\n </RACListBox>\n </RACPopover>\n </RACComboBox>\n );\n}\n\nconst _ComboBox = withStyleProps(forwardRef(ComboBox), 'ComboBox');\n\nexport { _ComboBox as ComboBox };\n\nfunction ComboBoxInput({\n isReadOnly,\n placeholder,\n}: {\n isReadOnly: boolean | undefined;\n placeholder: string | undefined;\n}) {\n const comboBoxState = useContext(ComboBoxStateContext);\n\n return (\n <RACInput\n className={clsx('cim-combo-box-input', textStyle({ variant: 'medium' }))}\n // Ensure the popover opens when the input is clicked.\n // By default, React Aria only opens the popover when the input is focused.\n onClick={() => !isReadOnly && comboBoxState.open()}\n placeholder={placeholder}\n />\n );\n}\n\nfunction renderOptions(item: ComboBoxOption | ComboBoxOptionGroup) {\n if ('options' in item) {\n return (\n <ComboBoxSection id={item.id} title={item.label} items={item.options}>\n {(child) => (\n <ComboBoxItem id={child.id} isDisabled={child.isDisabled}>\n {child.label}\n </ComboBoxItem>\n )}\n </ComboBoxSection>\n );\n }\n\n return (\n <ComboBoxItem id={item.id} isDisabled={item.isDisabled}>\n {item.label}\n </ComboBoxItem>\n );\n}\n\ninterface ComboBoxItemProps<T extends object> extends Pick<RACListBoxItemProps<T>, 'id' | 'value' | 'isDisabled'> {\n children: string;\n}\n\nfunction ComboBoxItem<T extends object>({ children, ...props }: ComboBoxItemProps<T>) {\n return (\n <RACListBoxItem {...props} className={clsx('cim-combo-box-item', textStyle({ variant: 'medium' }))}>\n {children}\n </RACListBoxItem>\n );\n}\n\ninterface ComboBoxSectionProps<T extends object> {\n id: string;\n title: string;\n children: ReactNode | ((item: T) => ReactNode);\n items?: Iterable<T>;\n}\n\nfunction ComboBoxSection<T extends object>({ title, children, items, ...props }: ComboBoxSectionProps<T>) {\n return (\n <RACSection {...props} className=\"cim-combo-box-section\">\n <RACHeader className={clsx('cim-combo-box-header', textStyle({ variant: 'small', tone: 'subtle' }))}>\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACSection>\n );\n}\n\nfunction ChevronDownIcon(props: SVGAttributes<SVGSVGElement>) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 12\" fill=\"currentColor\" data-icon {...props}>\n <path d=\"M.124 3.603 5.617 9.84a.533.533 0 0 0 .769 0l5.49-6.236a.493.493 0 0 0-.054-.707l-.925-.778a.514.514 0 0 0-.719.055L6.095 6.9a.125.125 0 0 1-.189 0L1.822 2.173A.51.51 0 0 0 1.474 2a.5.5 0 0 0-.37.119l-.926.777a.494.494 0 0 0-.054.707Z\" />\n </svg>\n );\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import { type FormProps as RACFormProps } from 'react-aria-components';
2
+ import type { DOMProps, LabellableProps } from '../types.js';
3
+ export interface FormProps extends DOMProps, Omit<LabellableProps, 'label'>, Pick<RACFormProps, 'action' | 'validationErrors' | 'encType' | 'method' | 'target' | 'autoComplete' | 'autoCapitalize' | 'children' | 'onSubmit' | 'onReset' | 'onInvalid'> {
4
+ }
5
+ declare const _Form: (props: FormProps & import("react").RefAttributes<HTMLFormElement> & import("../../with-style-props.js").StyleProps) => import("react").ReactNode;
6
+ export { _Form as Form };
7
+ //# sourceMappingURL=form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../src/components/form/form.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAmB,KAAK,SAAS,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGxF,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE7D,MAAM,WAAW,SACf,SAAQ,QAAQ,EACd,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,EAC9B,IAAI,CACF,YAAY,EACV,QAAQ,GACR,kBAAkB,GAClB,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,cAAc,GACd,gBAAgB,GAChB,UAAU,GACV,UAAU,GACV,SAAS,GACT,WAAW,CACd;CAAG;AAUR,QAAA,MAAM,KAAK,mJAA2C,CAAC;AAEvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Form = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const clsx_1 = __importDefault(require("clsx"));
9
+ const react_aria_components_1 = require("react-aria-components");
10
+ const forward_ref_js_1 = require("../../forward-ref.js");
11
+ const with_style_props_js_1 = require("../../with-style-props.js");
12
+ function Form({ children, UNSAFE_className, UNSAFE_style, ...props }, ref) {
13
+ return ((0, jsx_runtime_1.jsx)(react_aria_components_1.Form, { ...props, className: (0, clsx_1.default)('cim-form', UNSAFE_className), style: UNSAFE_style, ref: ref, children: children }));
14
+ }
15
+ const _Form = (0, with_style_props_js_1.withStyleProps)((0, forward_ref_js_1.forwardRef)(Form), 'Form');
16
+ exports.Form = _Form;
17
+ //# sourceMappingURL=form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.js","sourceRoot":"","sources":["../../../../src/components/form/form.tsx"],"names":[],"mappings":";;;;;;;AAAA,gDAAwB;AAExB,iEAAwF;AACxF,yDAAkD;AAClD,mEAA2D;AAqB3D,SAAS,IAAI,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAa,EAAE,GAAkC;IACjH,OAAO,CACL,uBAAC,4BAAO,OAAK,KAAK,EAAE,SAAS,EAAE,IAAA,cAAI,EAAC,UAAU,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,YAC7F,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAED,MAAM,KAAK,GAAG,IAAA,oCAAc,EAAC,IAAA,2BAAU,EAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AAErC,qBAAI","sourcesContent":["import clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\nimport { Form as RACForm, type FormProps as RACFormProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { DOMProps, LabellableProps } from '../types.js';\n\nexport interface FormProps\n extends DOMProps,\n Omit<LabellableProps, 'label'>,\n Pick<\n RACFormProps,\n | 'action'\n | 'validationErrors'\n | 'encType'\n | 'method'\n | 'target'\n | 'autoComplete'\n | 'autoCapitalize'\n | 'children'\n | 'onSubmit'\n | 'onReset'\n | 'onInvalid'\n > {}\n\nfunction Form({ children, UNSAFE_className, UNSAFE_style, ...props }: FormProps, ref: ForwardedRef<HTMLFormElement>) {\n return (\n <RACForm {...props} className={clsx('cim-form', UNSAFE_className)} style={UNSAFE_style} ref={ref}>\n {children}\n </RACForm>\n );\n}\n\nconst _Form = withStyleProps(forwardRef(Form), 'Form');\n\nexport { _Form as Form };\n"]}
@@ -0,0 +1,13 @@
1
+ import type { FieldError } from '../types.js';
2
+ export declare function FormFieldLabel({ children, isRequired, isDisabled, }: {
3
+ children: string | undefined;
4
+ isRequired: boolean | undefined;
5
+ isDisabled?: boolean | undefined;
6
+ }): "" | import("react/jsx-runtime").JSX.Element | undefined;
7
+ export declare function FormFieldDescription({ children }: {
8
+ children: string | undefined;
9
+ }): "" | import("react/jsx-runtime").JSX.Element | undefined;
10
+ export declare function FormFieldError({ children }: {
11
+ children: FieldError;
12
+ }): import("react/jsx-runtime").JSX.Element;
13
+ //# sourceMappingURL=form-field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-field.d.ts","sourceRoot":"","sources":["../../../../src/components/form-field/form-field.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9C,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,UAAU,EACV,UAAU,GACX,EAAE;IACD,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,UAAU,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAClC,4DAeA;AAED,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,4DAWlF;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,UAAU,CAAA;CAAE,2CAOpE"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FormFieldLabel = FormFieldLabel;
7
+ exports.FormFieldDescription = FormFieldDescription;
8
+ exports.FormFieldError = FormFieldError;
9
+ const jsx_runtime_1 = require("react/jsx-runtime");
10
+ const clsx_1 = __importDefault(require("clsx"));
11
+ const react_aria_components_1 = require("react-aria-components");
12
+ const index_js_1 = require("../../icons/index.js");
13
+ const text_js_1 = require("../typography/text.js");
14
+ const utils_js_1 = require("../typography/utils.js");
15
+ function FormFieldLabel({ children, isRequired, isDisabled, }) {
16
+ return (children && ((0, jsx_runtime_1.jsxs)(react_aria_components_1.Label, { className: (0, clsx_1.default)('cim-form-field-label', (0, utils_js_1.textStyle)({ variant: 'medium', tone: isDisabled ? 'subtle' : 'base' })), children: [children, isRequired && ((0, jsx_runtime_1.jsx)(text_js_1.Text, { tone: "critical", as: "span", "aria-hidden": true, children: "*" }))] })));
17
+ }
18
+ function FormFieldDescription({ children }) {
19
+ return (children && ((0, jsx_runtime_1.jsx)(react_aria_components_1.Text, { slot: "description", className: (0, clsx_1.default)('cim-form-field-description', (0, utils_js_1.textStyle)({ variant: 'small', tone: 'subtle' })), children: children })));
20
+ }
21
+ function FormFieldError({ children }) {
22
+ return (
23
+ // RACFieldError must be rendered unconditionally - React Aria can populate it with validation errors even if an explicit error message isn't provided
24
+ (0, jsx_runtime_1.jsx)(react_aria_components_1.FieldError, { className: (0, clsx_1.default)('cim-form-field-error', (0, utils_js_1.textStyle)({ variant: 'small', tone: 'critical' })), children: (validation) => renderFieldError(children, validation) }));
25
+ }
26
+ function renderFieldError(fieldError, validation) {
27
+ const errors = typeof fieldError === 'function' ? fieldError(validation) : (fieldError ?? validation.validationErrors);
28
+ if (!errors || !errors.length) {
29
+ return null;
30
+ }
31
+ return typeof errors === 'object' ? (errors.map((error) => (0, jsx_runtime_1.jsx)(ErrorMessage, { message: error }, error))) : ((0, jsx_runtime_1.jsx)(ErrorMessage, { message: errors }));
32
+ }
33
+ function ErrorMessage({ message }) {
34
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "cim-form-field-error-message", children: [(0, jsx_runtime_1.jsx)("div", { className: "cim-form-field-error-icon-wrapper", "aria-hidden": true, children: (0, jsx_runtime_1.jsx)(index_js_1.IconAlertTriangle, {}) }), message] }));
35
+ }
36
+ //# sourceMappingURL=form-field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-field.js","sourceRoot":"","sources":["../../../../src/components/form-field/form-field.tsx"],"names":[],"mappings":";;;;;AAaA,wCAuBC;AAED,oDAWC;AAED,wCAOC;;AA1DD,gDAAwB;AAExB,iEAK+B;AAC/B,mDAAyD;AAEzD,mDAA6C;AAC7C,qDAAmD;AAEnD,SAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,UAAU,EACV,UAAU,GAKX;IACC,OAAO,CACL,QAAQ,IAAI,CACV,wBAAC,6BAAQ,IACP,SAAS,EAAE,IAAA,cAAI,EAAC,sBAAsB,EAAE,IAAA,oBAAS,EAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,aAE9G,QAAQ,EACR,UAAU,IAAI,CACb,uBAAC,cAAI,IAAC,IAAI,EAAC,UAAU,EAAC,EAAE,EAAC,MAAM,uCAExB,CACR,IACQ,CACZ,CACF,CAAC;AACJ,CAAC;AAED,SAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAA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L,iCAAK,SAAS,EAAC,8BAA8B,aAC3C,gCAAK,SAAS,EAAC,mCAAmC,iCAChD,uBAAC,4BAAiB,KAAG,GACjB,EACL,OAAO,IACJ,CACP,CAAC;AACJ,CAAC","sourcesContent":["import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport {\n Label as RACLabel,\n Text as RACText,\n FieldError as RACFieldError,\n type ValidationResult as RACValidationResult,\n} from 'react-aria-components';\nimport { IconAlertTriangle } from '../../icons/index.js';\nimport type { FieldError } from '../types.js';\nimport { Text } from '../typography/text.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport function FormFieldLabel({\n children,\n isRequired,\n isDisabled,\n}: {\n children: string | undefined;\n isRequired: boolean | undefined;\n isDisabled?: boolean | undefined;\n}) {\n return (\n children && (\n <RACLabel\n className={clsx('cim-form-field-label', textStyle({ variant: 'medium', tone: isDisabled ? 'subtle' : 'base' }))}\n >\n {children}\n {isRequired && (\n <Text tone=\"critical\" as=\"span\" aria-hidden>\n *\n </Text>\n )}\n </RACLabel>\n )\n );\n}\n\nexport function FormFieldDescription({ children }: { children: string | undefined }) {\n return (\n children && (\n <RACText\n slot=\"description\"\n className={clsx('cim-form-field-description', textStyle({ variant: 'small', tone: 'subtle' }))}\n >\n {children}\n </RACText>\n )\n );\n}\n\nexport function FormFieldError({ children }: { children: FieldError }) {\n return (\n // RACFieldError must be rendered unconditionally - React Aria can populate it with validation errors even if an explicit error message isn't provided\n <RACFieldError className={clsx('cim-form-field-error', textStyle({ variant: 'small', tone: 'critical' }))}>\n {(validation) => renderFieldError(children, validation)}\n </RACFieldError>\n );\n}\n\nfunction renderFieldError(fieldError: FieldError, validation: RACValidationResult): string | ReactNode | undefined {\n const errors =\n typeof fieldError === 'function' ? fieldError(validation) : (fieldError ?? validation.validationErrors);\n\n if (!errors || !errors.length) {\n return null;\n }\n\n return typeof errors === 'object' ? (\n errors.map((error) => <ErrorMessage key={error} message={error} />)\n ) : (\n <ErrorMessage message={errors} />\n );\n}\n\nfunction ErrorMessage({ message }: { message: string }) {\n return (\n <div className=\"cim-form-field-error-message\">\n <div className=\"cim-form-field-error-icon-wrapper\" aria-hidden>\n <IconAlertTriangle />\n </div>\n {message}\n </div>\n );\n}\n"]}
@@ -0,0 +1,38 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type MenuItemProps as RACMenuItemProps } from 'react-aria-components';
3
+ import type { DOMProps, Key, LabellableProps } from '../types.js';
4
+ export interface MenuProps extends DOMProps, LabellableProps {
5
+ /** The contents of the menu. */
6
+ children?: ReactNode;
7
+ /** Handler that is called when an item is selected. When using `onAction`, all items must have an `id` prop defined. */
8
+ onAction?: (key: Key) => void;
9
+ }
10
+ declare const _Menu: (props: MenuProps & import("react").RefAttributes<HTMLButtonElement> & import("../../with-style-props.js").StyleProps) => ReactNode;
11
+ export { _Menu as Menu };
12
+ export interface MenuSectionProps {
13
+ /** The ID of the section. Has to be unique across all sections and items. */
14
+ id?: Key;
15
+ /** The content to display as the section title. */
16
+ title: string;
17
+ /** The contents of the section. */
18
+ children: ReactNode;
19
+ }
20
+ export declare function MenuSection({ title, children, ...props }: MenuSectionProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare namespace MenuSection {
22
+ var displayName: string;
23
+ }
24
+ export interface MenuItemProps extends Pick<RACMenuItemProps, 'isDisabled' | 'href' | 'hrefLang' | 'target' | 'rel' | 'download' | 'ping' | 'referrerPolicy' | 'routerOptions' | 'onAction'> {
25
+ /** The ID of the item. Has to be unique across all sections and items. */
26
+ id?: Key;
27
+ /** The content to display as the label. */
28
+ label: string;
29
+ }
30
+ export declare function MenuItem({ label, ...props }: MenuItemProps): import("react/jsx-runtime").JSX.Element;
31
+ export declare namespace MenuItem {
32
+ var displayName: string;
33
+ }
34
+ export declare function MenuSeparator(): import("react/jsx-runtime").JSX.Element;
35
+ export declare namespace MenuSeparator {
36
+ var displayName: string;
37
+ }
38
+ //# sourceMappingURL=menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu.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;yBAFe,aAAa"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Menu = void 0;
7
+ exports.MenuSection = MenuSection;
8
+ exports.MenuItem = MenuItem;
9
+ exports.MenuSeparator = MenuSeparator;
10
+ const jsx_runtime_1 = require("react/jsx-runtime");
11
+ const clsx_1 = __importDefault(require("clsx"));
12
+ const react_1 = require("react");
13
+ const react_aria_components_1 = require("react-aria-components");
14
+ const forward_ref_js_1 = require("../../forward-ref.js");
15
+ const with_style_props_js_1 = require("../../with-style-props.js");
16
+ const utils_js_1 = require("../typography/utils.js");
17
+ function Menu({ label, children, onAction, UNSAFE_className, UNSAFE_style, ...props }, ref) {
18
+ const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
19
+ (0, react_1.useEffect)(() => {
20
+ if (!label && !ariaLabel && !ariaLabelledBy) {
21
+ console.warn('Menu requires one of label / aria-label / aria-labelledby for accessibility');
22
+ }
23
+ }, [label, ariaLabel, ariaLabelledBy]);
24
+ return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.MenuTrigger, { children: [(0, jsx_runtime_1.jsxs)(react_aria_components_1.Button, { ...props, ref: ref, className: (0, clsx_1.default)('cim-menu-button', UNSAFE_className), style: UNSAFE_style, children: [label, (0, jsx_runtime_1.jsx)(ChevronDownIcon, { height: 12, width: 12, "aria-hidden": true })] }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Popover, { className: "cim-menu-popover", offset: 2, maxHeight: 315, "data-experimental-cim-style-root": true, children: (0, jsx_runtime_1.jsx)(react_aria_components_1.Menu, { className: "cim-menu", onAction: onAction, children: children }) })] }));
25
+ }
26
+ const _Menu = (0, with_style_props_js_1.withStyleProps)((0, forward_ref_js_1.forwardRef)(Menu), 'Menu');
27
+ exports.Menu = _Menu;
28
+ function MenuSection({ title, children, ...props }) {
29
+ return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.Section, { ...props, className: "cim-menu-section", children: [(0, jsx_runtime_1.jsx)(react_aria_components_1.Header, { className: (0, clsx_1.default)('cim-menu-section-header', (0, utils_js_1.textStyle)({ variant: 'small-semibold', tone: 'subtle' })), children: title }), children] }));
30
+ }
31
+ MenuSection.displayName = 'MenuSection';
32
+ function MenuItem({ label, ...props }) {
33
+ return ((0, jsx_runtime_1.jsx)(react_aria_components_1.MenuItem, { ...props, className: "cim-menu-item", textValue: label, children: (0, jsx_runtime_1.jsx)(react_aria_components_1.Text, { slot: "label", className: (0, clsx_1.default)('cim-menu-item-label', (0, utils_js_1.textStyle)({ variant: 'body' })), children: label }) }));
34
+ }
35
+ MenuItem.displayName = 'MenuItem';
36
+ function MenuSeparator() {
37
+ return (0, jsx_runtime_1.jsx)(react_aria_components_1.Separator, { className: "cim-menu-separator" });
38
+ }
39
+ MenuSeparator.displayName = 'MenuSeparator';
40
+ function ChevronDownIcon(props) {
41
+ return ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 12 12", fill: "currentColor", "data-icon": true, ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M.124 3.603 5.617 9.84a.533.533 0 0 0 .769 0l5.49-6.236a.493.493 0 0 0-.054-.707l-.925-.778a.514.514 0 0 0-.719.055L6.095 6.9a.125.125 0 0 1-.189 0L1.822 2.173A.51.51 0 0 0 1.474 2a.5.5 0 0 0-.37.119l-.926.777a.494.494 0 0 0-.054.707Z" }) }));
42
+ }
43
+ //# sourceMappingURL=menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu.js","sourceRoot":"","sources":["../../../../src/components/menu/menu.tsx"],"names":[],"mappings":";;;;;;AAoEA,kCASC;AAwBD,4BAQC;AAID,sCAEC;;AAnHD,gDAAwB;AACxB,iCAAyF;AACzF,iEAW+B;AAC/B,yDAAkD;AAClD,mEAA2D;AAE3D,qDAA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IAAC,SAAS,EAAE,IAAA,cAAI,EAAC,yBAAyB,EAAE,IAAA,oBAAS,EAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,YAC5G,KAAK,GACI,EACX,QAAQ,IACE,CACd,CAAC;AACJ,CAAC;AAED,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC;AAsBxC,SAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAiB;IACzD,OAAO,CACL,uBAAC,gCAAW,OAAK,KAAK,EAAE,SAAS,EAAC,eAAe,EAAC,SAAS,EAAE,KAAK,YAChE,uBAAC,4BAAO,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,IAAA,cAAI,EAAC,qBAAqB,EAAE,IAAA,oBAAS,EAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,YACzF,KAAK,GACE,GACE,CACf,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,SAAgB,aAAa;IAC3B,OAAO,uBAAC,iCAAY,IAAC,SAAS,EAAC,oBAAoB,GAAG,CAAC;AACzD,CAAC;AAED,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC;AAE5C,SAAS,eAAe,CAAC,KAAmC;IAC1D,OAAO,CACL,gCAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,wBAAe,KAAK,YACjG,iCAAM,CAAC,EAAC,4OAA4O,GAAG,GACnP,CACP,CAAC;AACJ,CAAC","sourcesContent":["import clsx from 'clsx';\nimport { type ReactNode, type SVGAttributes, type ForwardedRef, useEffect } from 'react';\nimport {\n Button as RACButton,\n Header as RACHeader,\n Menu as RACMenu,\n MenuItem as RACMenuItem,\n type MenuItemProps as RACMenuItemProps,\n MenuTrigger as RACMenuTrigger,\n Section as RACSection,\n Popover as RACPopover,\n Separator as RACSeparator,\n Text as RACText,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { DOMProps, Key, LabellableProps } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\n// TODO: document that when creating the items dynamically, all items must have `key` and `id` defined\n\nexport interface MenuProps extends DOMProps, LabellableProps {\n /** The contents of the menu. */\n children?: ReactNode;\n /** Handler that is called when an item is selected. When using `onAction`, all items must have an `id` prop defined. */\n onAction?: (key: Key) => void;\n}\n\nfunction Menu(\n { label, children, onAction, UNSAFE_className, UNSAFE_style, ...props }: MenuProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('Menu requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACMenuTrigger>\n <RACButton {...props} ref={ref} className={clsx('cim-menu-button', UNSAFE_className)} style={UNSAFE_style}>\n {label}\n <ChevronDownIcon height={12} width={12} aria-hidden />\n </RACButton>\n <RACPopover className=\"cim-menu-popover\" offset={2} maxHeight={315} data-experimental-cim-style-root>\n <RACMenu className=\"cim-menu\" onAction={onAction}>\n {children}\n </RACMenu>\n </RACPopover>\n </RACMenuTrigger>\n );\n}\n\nconst _Menu = withStyleProps(forwardRef(Menu), 'Menu');\n\nexport { _Menu as Menu };\n\nexport interface MenuSectionProps {\n /** The ID of the section. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the section title. */\n title: string;\n /** The contents of the section. */\n children: ReactNode;\n}\n\nexport function MenuSection({ title, children, ...props }: MenuSectionProps) {\n return (\n <RACSection {...props} className=\"cim-menu-section\">\n <RACHeader className={clsx('cim-menu-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}>\n {title}\n </RACHeader>\n {children}\n </RACSection>\n );\n}\n\nMenuSection.displayName = 'MenuSection';\n\nexport interface MenuItemProps\n extends Pick<\n RACMenuItemProps,\n | 'isDisabled'\n | 'href'\n | 'hrefLang'\n | 'target'\n | 'rel'\n | 'download'\n | 'ping'\n | 'referrerPolicy'\n | 'routerOptions'\n | 'onAction'\n > {\n /** The ID of the item. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the label. */\n label: string;\n}\n\nexport function MenuItem({ label, ...props }: MenuItemProps) {\n return (\n <RACMenuItem {...props} className=\"cim-menu-item\" textValue={label}>\n <RACText slot=\"label\" className={clsx('cim-menu-item-label', textStyle({ variant: 'body' }))}>\n {label}\n </RACText>\n </RACMenuItem>\n );\n}\n\nMenuItem.displayName = 'MenuItem';\n\nexport function MenuSeparator() {\n return <RACSeparator className=\"cim-menu-separator\" />;\n}\n\nMenuSeparator.displayName = 'MenuSeparator';\n\nfunction ChevronDownIcon(props: SVGAttributes<SVGSVGElement>) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 12\" fill=\"currentColor\" data-icon {...props}>\n <path d=\"M.124 3.603 5.617 9.84a.533.533 0 0 0 .769 0l5.49-6.236a.493.493 0 0 0-.054-.707l-.925-.778a.514.514 0 0 0-.719.055L6.095 6.9a.125.125 0 0 1-.189 0L1.822 2.173A.51.51 0 0 0 1.474 2a.5.5 0 0 0-.37.119l-.926.777a.494.494 0 0 0-.054.707Z\" />\n </svg>\n );\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type RadioGroupProps as RACRadioGroupProps } from 'react-aria-components';
3
+ import { type StackProps } from '../spacing/stack/stack.js';
4
+ import type { DOMProps, FieldProps, WithRequired } from '../types.js';
5
+ export interface RadioGroupProps extends DOMProps, WithRequired<FieldProps<string | null>, 'label'>, Pick<RACRadioGroupProps, 'isDisabled' | 'isReadOnly' | 'isRequired' | 'isInvalid' | 'value' | 'onChange' | 'defaultValue' | 'name'>, Pick<StackProps, 'inline'> {
6
+ /** Radio buttons belonging to the group. */
7
+ children: ReactNode;
8
+ }
9
+ declare const _RadioGroup: (props: RadioGroupProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => ReactNode;
10
+ export { _RadioGroup as RadioGroup };
11
+ //# sourceMappingURL=radio-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../../../src/components/radio/radio-group.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAA+B,KAAK,eAAe,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAIhH,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEtE,MAAM,WAAW,eACf,SAAQ,QAAQ,EACd,YAAY,CAAC,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,OAAO,CAAC,EAChD,IAAI,CACF,kBAAkB,EAClB,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,cAAc,GAAG,MAAM,CAC1G,EACD,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC5B,4CAA4C;IAC5C,QAAQ,EAAE,SAAS,CAAC;CACrB;AA2BD,QAAA,MAAM,WAAW,wIAAuD,CAAC;AAEzE,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,CAAC"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.RadioGroup = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const clsx_1 = __importDefault(require("clsx"));
9
+ const react_aria_components_1 = require("react-aria-components");
10
+ const forward_ref_js_1 = require("../../forward-ref.js");
11
+ const with_style_props_js_1 = require("../../with-style-props.js");
12
+ const form_field_js_1 = require("../form-field/form-field.js");
13
+ const stack_js_1 = require("../spacing/stack/stack.js");
14
+ function RadioGroup({ label, description, error: errorMessage, inline = false, children, UNSAFE_className, UNSAFE_style, ...props }, ref) {
15
+ return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.RadioGroup, { ...props, ref: ref, className: (0, clsx_1.default)('cim-radio-group', UNSAFE_className), style: UNSAFE_style, children: [(0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldLabel, { isRequired: props.isRequired, children: label }), (0, jsx_runtime_1.jsx)(stack_js_1.Stack, { gap: getGapFromInline(inline), inline: inline, children: children }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldError, { children: errorMessage }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldDescription, { children: description })] }));
16
+ }
17
+ const _RadioGroup = (0, with_style_props_js_1.withStyleProps)((0, forward_ref_js_1.forwardRef)(RadioGroup), 'RadioGroup');
18
+ exports.RadioGroup = _RadioGroup;
19
+ // Make sure that radio buttons are spaced by 16px when stacked inline, and 4px otherwise.
20
+ function getGapFromInline(inline) {
21
+ if (typeof inline === 'object') {
22
+ const gap = { xs: inline.xs ? 16 : 4 };
23
+ Object.entries(inline).reduce((acc, curr) => {
24
+ gap[curr[0]] = curr[1] ? 16 : 4;
25
+ return acc;
26
+ }, gap);
27
+ return gap;
28
+ }
29
+ return inline ? 16 : 4;
30
+ }
31
+ //# sourceMappingURL=radio-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../../src/components/radio/radio-group.tsx"],"names":[],"mappings":";;;;;;;AAAA,gDAAwB;AAExB,iEAAgH;AAChH,yDAAkD;AAClD,mEAA2D;AAC3D,+DAAmG;AACnG,wDAAmE;AAgBnE,SAAS,UAAU,CACjB,EACE,KAAK,EACL,WAAW,EACX,KAAK,EAAE,YAAY,EACnB,MAAM,GAAG,KAAK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,CAAC,CAAC,CAAC,CAAC;AACzB,CAAC","sourcesContent":["import clsx from 'clsx';\nimport type { ForwardedRef, ReactNode } from 'react';\nimport { RadioGroup as RACRadioGroup, type RadioGroupProps as RACRadioGroupProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../form-field/form-field.js';\nimport { Stack, type StackProps } from '../spacing/stack/stack.js';\nimport type { Breakpoint, Responsive, Spacing } from '../spacing/types.js';\nimport type { DOMProps, FieldProps, WithRequired } from '../types.js';\n\nexport interface RadioGroupProps\n extends DOMProps,\n WithRequired<FieldProps<string | null>, 'label'>,\n Pick<\n RACRadioGroupProps,\n 'isDisabled' | 'isReadOnly' | 'isRequired' | 'isInvalid' | 'value' | 'onChange' | 'defaultValue' | 'name'\n >,\n Pick<StackProps, 'inline'> {\n /** Radio buttons belonging to the group. */\n children: ReactNode;\n}\n\nfunction RadioGroup(\n {\n label,\n description,\n error: errorMessage,\n inline = false,\n children,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: RadioGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n return (\n <RACRadioGroup {...props} ref={ref} className={clsx('cim-radio-group', UNSAFE_className)} style={UNSAFE_style}>\n <FormFieldLabel isRequired={props.isRequired}>{label}</FormFieldLabel>\n <Stack gap={getGapFromInline(inline)} inline={inline}>\n {children}\n </Stack>\n <FormFieldError>{errorMessage}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n </RACRadioGroup>\n );\n}\n\nconst _RadioGroup = withStyleProps(forwardRef(RadioGroup), 'RadioGroup');\n\nexport { _RadioGroup as RadioGroup };\n\n// Make sure that radio buttons are spaced by 16px when stacked inline, and 4px otherwise.\nfunction getGapFromInline(inline: Responsive<boolean>): Responsive<Spacing> {\n if (typeof inline === 'object') {\n const gap: Responsive<Spacing> = { xs: inline.xs ? 16 : 4 };\n\n (Object.entries(inline) as [Breakpoint, boolean][]).reduce((acc, curr) => {\n gap[curr[0]] = curr[1] ? 16 : 4;\n return acc;\n }, gap);\n\n return gap;\n }\n\n return inline ? 16 : 4;\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import { type RadioProps as RACRadioProps } from 'react-aria-components';
2
+ import type { DOMProps, LabellableProps } from '../types.js';
3
+ export interface RadioProps extends DOMProps, Omit<LabellableProps, 'label'>, Pick<RACRadioProps, 'value' | 'isDisabled'> {
4
+ /** The label rendered next to the radio. */
5
+ children?: string;
6
+ }
7
+ declare const _Radio: (props: RadioProps & import("react").RefAttributes<HTMLLabelElement> & import("../../with-style-props.js").StyleProps) => import("react").ReactNode;
8
+ export { _Radio as Radio };
9
+ //# sourceMappingURL=radio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../../../src/components/radio/radio.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,UAAU,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG5F,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG7D,MAAM,WAAW,UACf,SAAQ,QAAQ,EACd,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,EAC9B,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,YAAY,CAAC;IAC7C,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA8BD,QAAA,MAAM,MAAM,qJAA6C,CAAC;AAE1D,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Radio = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const clsx_1 = __importDefault(require("clsx"));
9
+ const react_1 = require("react");
10
+ const react_aria_components_1 = require("react-aria-components");
11
+ const forward_ref_js_1 = require("../../forward-ref.js");
12
+ const with_style_props_js_1 = require("../../with-style-props.js");
13
+ const text_js_1 = require("../typography/text.js");
14
+ function Radio({ children, UNSAFE_className, UNSAFE_style, ...props }, ref) {
15
+ const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
16
+ (0, react_1.useEffect)(() => {
17
+ if (!children && !ariaLabel && !ariaLabelledBy) {
18
+ console.warn('Radio requires one of children / aria-label / aria-labelledby for accessibility');
19
+ }
20
+ }, [children, ariaLabel, ariaLabelledBy]);
21
+ return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.Radio, { ...props, className: (0, clsx_1.default)('cim-radio', UNSAFE_className), style: UNSAFE_style, ref: ref, children: [(0, jsx_runtime_1.jsx)("div", { className: "cim-radio-toggle-wrapper", children: (0, jsx_runtime_1.jsx)("div", { className: "cim-radio-toggle", children: (0, jsx_runtime_1.jsx)("div", { className: "cim-radio-toggle-inner" }) }) }), children && ((0, jsx_runtime_1.jsx)(text_js_1.Text, { as: "span", variant: "body", children: children }))] }));
22
+ }
23
+ const _Radio = (0, with_style_props_js_1.withStyleProps)((0, forward_ref_js_1.forwardRef)(Radio), 'Radio');
24
+ exports.Radio = _Radio;
25
+ //# sourceMappingURL=radio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio.js","sourceRoot":"","sources":["../../../../src/components/radio/radio.tsx"],"names":[],"mappings":";;;;;;;AAAA,gDAAwB;AACxB,iCAAqD;AACrD,iEAA4F;AAC5F,yDAAkD;AAClD,mEAA2D;AAE3D,mDAA6C;AAU7C,SAAS,KAAK,CACZ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAc,EAClE,GAAmC;IAEnC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE7E,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,QAAQ,IAAI,CAAC,SAAS,IAAI,CAAC,cAAc,EAAE,CAAC;YAC/C,OAAO,CAAC,IAAI,CAAC,iFAAiF,CAAC,CAAC;QAClG,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,wBAAC,6BAAQ,OAAK,KAAK,EAAE,SAAS,EAAE,IAAA,cAAI,EAAC,WAAW,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,aAChG,gCAAK,SAAS,EAAC,0BAA0B,YACvC,gCAAK,SAAS,EAAC,kBAAkB,YAC/B,gCAAK,SAAS,EAAC,wBAAwB,GAAG,GACtC,GACF,EACL,QAAQ,IAAI,CACX,uBAAC,cAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAC,MAAM,YAC3B,QAAQ,GACJ,CACR,IACQ,CACZ,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,IAAA,oCAAc,EAAC,IAAA,2BAAU,EAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AAEvC,uBAAK","sourcesContent":["import clsx from 'clsx';\nimport { useEffect, type ForwardedRef } from 'react';\nimport { Radio as RACRadio, type RadioProps as RACRadioProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { DOMProps, LabellableProps } from '../types.js';\nimport { Text } from '../typography/text.js';\n\nexport interface RadioProps\n extends DOMProps,\n Omit<LabellableProps, 'label'>,\n Pick<RACRadioProps, 'value' | 'isDisabled'> {\n /** The label rendered next to the radio. */\n children?: string;\n}\n\nfunction Radio(\n { children, UNSAFE_className, UNSAFE_style, ...props }: RadioProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!children && !ariaLabel && !ariaLabelledBy) {\n console.warn('Radio requires one of children / aria-label / aria-labelledby for accessibility');\n }\n }, [children, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACRadio {...props} className={clsx('cim-radio', UNSAFE_className)} style={UNSAFE_style} ref={ref}>\n <div className=\"cim-radio-toggle-wrapper\">\n <div className=\"cim-radio-toggle\">\n <div className=\"cim-radio-toggle-inner\" />\n </div>\n </div>\n {children && (\n <Text as=\"span\" variant=\"body\">\n {children}\n </Text>\n )}\n </RACRadio>\n );\n}\n\nconst _Radio = withStyleProps(forwardRef(Radio), 'Radio');\n\nexport { _Radio as Radio };\n"]}
@@ -0,0 +1,28 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type SelectProps as RACSelectProps } from 'react-aria-components';
3
+ import type { DOMProps, FieldWithPlaceholderProps, Key } from '../types.js';
4
+ export interface SelectOption {
5
+ /** The unique id of the item. When integrated with a form, this will be the value of the option. */
6
+ id: string;
7
+ /** The content to display as the label of the option. */
8
+ label: string;
9
+ /** Whether the option is disabled. */
10
+ isDisabled?: boolean;
11
+ }
12
+ export interface SelectOptionGroup {
13
+ /** The unique id of the group. */
14
+ id: string;
15
+ /** The content to display as the title of the group. */
16
+ label: string;
17
+ /** The options available for selection within the group. */
18
+ options: SelectOption[];
19
+ isDisabled?: never;
20
+ }
21
+ export type SelectOptionType = SelectOption | SelectOptionGroup;
22
+ export interface SelectProps extends Pick<RACSelectProps<SelectOptionType>, 'name' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'selectedKey' | 'defaultSelectedKey' | 'placeholder' | 'autoComplete' | 'autoFocus' | 'onSelectionChange'>, DOMProps, FieldWithPlaceholderProps<Key> {
23
+ /** The options available for selection. Supports groups with a single level of nesting. */
24
+ options: SelectOptionType[];
25
+ }
26
+ declare const _Select: (props: SelectProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => ReactNode;
27
+ export { _Select as Select };
28
+ //# sourceMappingURL=select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AACpE,OAAO,EAWL,KAAK,WAAW,IAAI,cAAc,EACnC,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAyB,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAG5E,MAAM,WAAW,YAAY;IAC3B,oGAAoG;IACpG,EAAE,EAAE,MAAM,CAAC;IACX,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,KAAK,CAAC;CACpB;AAED,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,iBAAiB,CAAC;AAEhE,MAAM,WAAW,WACf,SAAQ,IAAI,CACR,cAAc,CAAC,gBAAgB,CAAC,EAC9B,MAAM,GACN,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,aAAa,GACb,oBAAoB,GACpB,aAAa,GACb,cAAc,GACd,WAAW,GACX,mBAAmB,CACtB,EACD,QAAQ,EACR,yBAAyB,CAAC,GAAG,CAAC;IAChC,2FAA2F;IAC3F,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AA+BD,QAAA,MAAM,OAAO,oIAA+C,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,CAAC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Select = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const clsx_1 = __importDefault(require("clsx"));
9
+ const react_aria_components_1 = require("react-aria-components");
10
+ const forward_ref_js_1 = require("../../forward-ref.js");
11
+ const with_style_props_js_1 = require("../../with-style-props.js");
12
+ const form_field_js_1 = require("../form-field/form-field.js");
13
+ const utils_js_1 = require("../typography/utils.js");
14
+ function Select({ label, description, error, options, UNSAFE_className, UNSAFE_style, ...props }, ref) {
15
+ return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.Select, { ...props, ref: ref, className: (0, clsx_1.default)('cim-select', UNSAFE_className), style: UNSAFE_style, children: [(0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldLabel, { isRequired: props.isRequired, children: label }), (0, jsx_runtime_1.jsxs)(react_aria_components_1.Button, { className: "cim-select-button", children: [(0, jsx_runtime_1.jsx)(react_aria_components_1.SelectValue, { className: (values) => (0, clsx_1.default)(values.defaultClassName, (0, utils_js_1.textStyle)({ variant: 'medium', tone: values.isPlaceholder ? 'muted' : 'base' })) }), (0, jsx_runtime_1.jsx)(ChevronDownIcon, { height: 12, width: 12, "aria-hidden": "true" })] }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldError, { children: error }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldDescription, { children: description }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Popover, { offset: 2, maxHeight: 315, className: "cim-select-popover", "data-experimental-cim-style-root": true, children: (0, jsx_runtime_1.jsx)(react_aria_components_1.ListBox, { className: "cim-select-listbox", items: options, children: renderOptions }) })] }));
16
+ }
17
+ const _Select = (0, with_style_props_js_1.withStyleProps)((0, forward_ref_js_1.forwardRef)(Select), 'Select');
18
+ exports.Select = _Select;
19
+ function renderOptions(item) {
20
+ if ('options' in item) {
21
+ return ((0, jsx_runtime_1.jsx)(SelectSection, { id: item.id, title: item.label, items: item.options, children: (child) => ((0, jsx_runtime_1.jsx)(SelectItem, { id: child.id, isDisabled: child.isDisabled, children: child.label })) }));
22
+ }
23
+ return ((0, jsx_runtime_1.jsx)(SelectItem, { id: item.id, isDisabled: item.isDisabled, children: item.label }));
24
+ }
25
+ function SelectItem({ children, ...props }) {
26
+ return ((0, jsx_runtime_1.jsx)(react_aria_components_1.ListBoxItem, { ...props, className: (0, clsx_1.default)('cim-select-item', (0, utils_js_1.textStyle)({ variant: 'medium' })), children: children }));
27
+ }
28
+ function SelectSection({ title, children, items, ...props }) {
29
+ return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.Section, { ...props, className: "cim-select-section", children: [(0, jsx_runtime_1.jsx)(react_aria_components_1.Header, { className: (0, clsx_1.default)('cim-select-header', (0, utils_js_1.textStyle)({ variant: 'small', tone: 'subtle' })), children: title }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Collection, { items: items, children: children })] }));
30
+ }
31
+ function ChevronDownIcon(props) {
32
+ return ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 12 12", fill: "currentColor", "data-icon": true, ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M.124 3.603 5.617 9.84a.533.533 0 0 0 .769 0l5.49-6.236a.493.493 0 0 0-.054-.707l-.925-.778a.514.514 0 0 0-.719.055L6.095 6.9a.125.125 0 0 1-.189 0L1.822 2.173A.51.51 0 0 0 1.474 2a.5.5 0 0 0-.37.119l-.926.777a.494.494 0 0 0-.054.707Z" }) }));
33
+ }
34
+ //# sourceMappingURL=select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":";;;;;;;AAAA,gDAAwB;AAExB,iEAY+B;AAC/B,yDAAkD;AAClD,mEAA2D;AAC3D,+DAAmG;AAEnG,qDAAmD;AA2CnD,SAAS,MAAM,CACb,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,Y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,KAAK,YACjG,iCAAM,CAAC,EAAC,4OAA4O,GAAG,GACnP,CACP,CAAC;AACJ,CAAC","sourcesContent":["import clsx from 'clsx';\nimport type { ReactNode, SVGAttributes, ForwardedRef } from 'react';\nimport {\n Button as RACButton,\n Collection as RACCollection,\n Header as RACHeader,\n ListBox as RACListBox,\n ListBoxItem as RACListBoxItem,\n Popover as RACPopover,\n Section as RACSection,\n Select as RACSelect,\n SelectValue as RACSelectValue,\n type ListBoxItemProps as RACListBoxItemProps,\n type SelectProps as RACSelectProps,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../form-field/form-field.js';\nimport type { DOMProps, FieldWithPlaceholderProps, Key } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface SelectOption {\n /** The unique id of the item. When integrated with a form, this will be the value of the option. */\n id: string;\n /** The content to display as the label of the option. */\n label: string;\n /** Whether the option is disabled. */\n isDisabled?: boolean;\n}\n\nexport interface SelectOptionGroup {\n /** The unique id of the group. */\n id: string;\n /** The content to display as the title of the group. */\n label: string;\n /** The options available for selection within the group. */\n options: SelectOption[];\n isDisabled?: never;\n}\n\nexport type SelectOptionType = SelectOption | SelectOptionGroup;\n\nexport interface SelectProps\n extends Pick<\n RACSelectProps<SelectOptionType>,\n | 'name'\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'selectedKey'\n | 'defaultSelectedKey'\n | 'placeholder'\n | 'autoComplete'\n | 'autoFocus'\n | 'onSelectionChange'\n >,\n DOMProps,\n FieldWithPlaceholderProps<Key> {\n /** The options available for selection. Supports groups with a single level of nesting. */\n options: SelectOptionType[];\n}\n\nfunction Select(\n { label, description, error, options, UNSAFE_className, UNSAFE_style, ...props }: SelectProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n return (\n <RACSelect {...props} ref={ref} className={clsx('cim-select', UNSAFE_className)} style={UNSAFE_style}>\n <FormFieldLabel isRequired={props.isRequired}>{label}</FormFieldLabel>\n <RACButton className=\"cim-select-button\">\n <RACSelectValue\n className={(values) =>\n clsx(\n values.defaultClassName,\n textStyle({ variant: 'medium', tone: values.isPlaceholder ? 'muted' : 'base' }),\n )\n }\n />\n <ChevronDownIcon height={12} width={12} aria-hidden=\"true\" />\n </RACButton>\n <FormFieldError>{error}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n <RACPopover offset={2} maxHeight={315} className=\"cim-select-popover\" data-experimental-cim-style-root>\n <RACListBox className=\"cim-select-listbox\" items={options}>\n {renderOptions}\n </RACListBox>\n </RACPopover>\n </RACSelect>\n );\n}\n\nconst _Select = withStyleProps(forwardRef(Select), 'Select');\n\nexport { _Select as Select };\n\nfunction renderOptions(item: SelectOptionType) {\n if ('options' in item) {\n return (\n <SelectSection id={item.id} title={item.label} items={item.options}>\n {(child) => (\n <SelectItem id={child.id} isDisabled={child.isDisabled}>\n {child.label}\n </SelectItem>\n )}\n </SelectSection>\n );\n }\n\n return (\n <SelectItem id={item.id} isDisabled={item.isDisabled}>\n {item.label}\n </SelectItem>\n );\n}\n\ninterface SelectItemProps extends Pick<RACListBoxItemProps<SelectOption>, 'id' | 'value' | 'isDisabled'> {\n children: string;\n}\n\nfunction SelectItem({ children, ...props }: SelectItemProps) {\n return (\n <RACListBoxItem {...props} className={clsx('cim-select-item', textStyle({ variant: 'medium' }))}>\n {children}\n </RACListBoxItem>\n );\n}\n\ninterface SelectSectionProps {\n id: string;\n title: string;\n children: ReactNode | ((item: SelectOption) => ReactNode);\n items?: Iterable<SelectOption>;\n}\n\nfunction SelectSection({ title, children, items, ...props }: SelectSectionProps) {\n return (\n <RACSection {...props} className=\"cim-select-section\">\n <RACHeader className={clsx('cim-select-header', textStyle({ variant: 'small', tone: 'subtle' }))}>\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACSection>\n );\n}\n\nfunction ChevronDownIcon(props: SVGAttributes<SVGSVGElement>) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 12\" fill=\"currentColor\" data-icon {...props}>\n <path d=\"M.124 3.603 5.617 9.84a.533.533 0 0 0 .769 0l5.49-6.236a.493.493 0 0 0-.054-.707l-.925-.778a.514.514 0 0 0-.719.055L6.095 6.9a.125.125 0 0 1-.189 0L1.822 2.173A.51.51 0 0 0 1.474 2a.5.5 0 0 0-.37.119l-.926.777a.494.494 0 0 0-.054.707Z\" />\n </svg>\n );\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { DOMProps } from '../../types.js';
3
+ export interface BoxProps extends DOMProps {
4
+ children: ReactNode;
5
+ }
6
+ declare const _Box: (props: BoxProps & import("react").RefAttributes<HTMLDivElement> & import("../../../with-style-props.js").StyleProps) => ReactNode;
7
+ export { _Box as Box };
8
+ //# sourceMappingURL=box.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../../../../src/components/spacing/box/box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,WAAW,QAAS,SAAQ,QAAQ;IACxC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAUD,QAAA,MAAM,IAAI,oIAAyC,CAAC;AAEpD,OAAO,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Box = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const forward_ref_js_1 = require("../../../forward-ref.js");
6
+ const with_style_props_js_1 = require("../../../with-style-props.js");
7
+ function Box({ children, UNSAFE_className, UNSAFE_style, ...props }, ref) {
8
+ return ((0, jsx_runtime_1.jsx)("div", { ...props, ref: ref, className: UNSAFE_className, style: UNSAFE_style, role: "presentation", children: children }));
9
+ }
10
+ const _Box = (0, with_style_props_js_1.withStyleProps)((0, forward_ref_js_1.forwardRef)(Box), 'Box');
11
+ exports.Box = _Box;
12
+ //# sourceMappingURL=box.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"box.js","sourceRoot":"","sources":["../../../../../src/components/spacing/box/box.tsx"],"names":[],"mappings":";;;;AACA,4DAAqD;AACrD,sEAA8D;AAO9D,SAAS,GAAG,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAY,EAAE,GAAiC;IAC9G,OAAO,CACL,mCAAS,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAC,cAAc,YAC5F,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,MAAM,IAAI,GAAG,IAAA,oCAAc,EAAC,IAAA,2BAAU,EAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;AAEnC,mBAAG","sourcesContent":["import type { ForwardedRef, ReactNode } from 'react';\nimport { forwardRef } from '../../../forward-ref.js';\nimport { withStyleProps } from '../../../with-style-props.js';\nimport type { DOMProps } from '../../types.js';\n\nexport interface BoxProps extends DOMProps {\n children: ReactNode;\n}\n\nfunction Box({ children, UNSAFE_className, UNSAFE_style, ...props }: BoxProps, ref: ForwardedRef<HTMLDivElement>) {\n return (\n <div {...props} ref={ref} className={UNSAFE_className} style={UNSAFE_style} role=\"presentation\">\n {children}\n </div>\n );\n}\n\nconst _Box = withStyleProps(forwardRef(Box), 'Box');\n\nexport { _Box as Box };\n"]}
@@ -0,0 +1,11 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { DOMProps } from '../../types.js';
3
+ import { type Responsive, type Spacing } from '../types.js';
4
+ export interface StackProps extends DOMProps {
5
+ children: ReactNode;
6
+ inline?: Responsive<boolean>;
7
+ gap: Responsive<Spacing>;
8
+ }
9
+ declare const _Stack: (props: StackProps & import("react").RefAttributes<HTMLDivElement> & import("../../../with-style-props.js").StyleProps) => ReactNode;
10
+ export { _Stack as Stack };
11
+ //# sourceMappingURL=stack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../../../../src/components/spacing/stack/stack.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAA0B,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpF,MAAM,WAAW,UAAW,SAAQ,QAAQ;IAC1C,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC7B,GAAG,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;CAC1B;AA0BD,QAAA,MAAM,MAAM,sIAA6C,CAAC;AAE1D,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Stack = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const clsx_1 = __importDefault(require("clsx"));
9
+ const forward_ref_js_1 = require("../../../forward-ref.js");
10
+ const with_style_props_js_1 = require("../../../with-style-props.js");
11
+ const types_js_1 = require("../types.js");
12
+ function Stack({ children, inline: responsiveInline, gap: responsiveGap, UNSAFE_className, UNSAFE_style, ...props }, ref) {
13
+ const gap = (0, types_js_1.getResponsiveVariables)('stack-gap', 'space', responsiveGap, 0);
14
+ const inline = (0, types_js_1.getResponsiveVariables)('stack-fd', 'stack-fd-inline', responsiveInline, false);
15
+ return ((0, jsx_runtime_1.jsx)("div", { ...props, ref: ref, className: (0, clsx_1.default)('cim-stack', UNSAFE_className), style: {
16
+ ...UNSAFE_style,
17
+ ...gap,
18
+ ...inline,
19
+ }, role: "presentation", children: children }));
20
+ }
21
+ const _Stack = (0, with_style_props_js_1.withStyleProps)((0, forward_ref_js_1.forwardRef)(Stack), 'Stack');
22
+ exports.Stack = _Stack;
23
+ //# sourceMappingURL=stack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack.js","sourceRoot":"","sources":["../../../../../src/components/spacing/stack/stack.tsx"],"names":[],"mappings":";;;;;;;AAAA,gDAAwB;AAExB,4DAAqD;AACrD,sEAA8D;AAE9D,0CAAoF;AAQpF,SAAS,KAAK,CACZ,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAc,EAChH,GAAiC;IAEjC,MAAM,GAAG,GAAG,IAAA,iCAAsB,EAAC,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;IAC3E,MAAM,MAAM,GAAG,IAAA,iCAAsB,EAAC,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;IAE9F,OAAO,CACL,mCACM,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,cAAI,EAAC,WAAW,EAAE,gBAAgB,CAAC,EAC9C,KAAK,EAAE;YACL,GAAG,YAAY;YACf,GAAG,GAAG;YACN,GAAG,MAAM;SACV,EACD,IAAI,EAAC,cAAc,YAElB,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,IAAA,oCAAc,EAAC,IAAA,2BAAU,EAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AAEvC,uBAAK","sourcesContent":["import clsx from 'clsx';\nimport type { ReactNode, ForwardedRef } from 'react';\nimport { forwardRef } from '../../../forward-ref.js';\nimport { withStyleProps } from '../../../with-style-props.js';\nimport type { DOMProps } from '../../types.js';\nimport { getResponsiveVariables, type Responsive, type Spacing } from '../types.js';\n\nexport interface StackProps extends DOMProps {\n children: ReactNode;\n inline?: Responsive<boolean>;\n gap: Responsive<Spacing>;\n}\n\nfunction Stack(\n { children, inline: responsiveInline, gap: responsiveGap, UNSAFE_className, UNSAFE_style, ...props }: StackProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const gap = getResponsiveVariables('stack-gap', 'space', responsiveGap, 0);\n const inline = getResponsiveVariables('stack-fd', 'stack-fd-inline', responsiveInline, false);\n\n return (\n <div\n {...props}\n ref={ref}\n className={clsx('cim-stack', UNSAFE_className)}\n style={{\n ...UNSAFE_style,\n ...gap,\n ...inline,\n }}\n role=\"presentation\"\n >\n {children}\n </div>\n );\n}\n\nconst _Stack = withStyleProps(forwardRef(Stack), 'Stack');\n\nexport { _Stack as Stack };\n"]}