@trellixio/roaster-react 2.1.1 → 2.2.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 (204) hide show
  1. package/CHANGELOG.md +383 -0
  2. package/LICENSE.md +38 -2
  3. package/README.md +10 -10
  4. package/cjs/components/ActionList/components/ActionListDropdown.js +6 -5
  5. package/cjs/components/ActionList/components/ActionListDropdown.js.map +1 -1
  6. package/cjs/components/ActionList/components/ActionListItem.js +9 -7
  7. package/cjs/components/ActionList/components/ActionListItem.js.map +1 -1
  8. package/cjs/components/ActionList/components/ActionListSearch.js +24 -6
  9. package/cjs/components/ActionList/components/ActionListSearch.js.map +1 -1
  10. package/cjs/components/ActionList/components/ActionListSubmenu.js +7 -5
  11. package/cjs/components/ActionList/components/ActionListSubmenu.js.map +1 -1
  12. package/cjs/components/ActionList/components/ActionListSwitchItem.js +6 -5
  13. package/cjs/components/ActionList/components/ActionListSwitchItem.js.map +1 -1
  14. package/cjs/components/Alert/Alert.js +3 -2
  15. package/cjs/components/Alert/Alert.js.map +1 -1
  16. package/cjs/components/AppFrame/AppFrame.js.map +1 -1
  17. package/cjs/components/Avatar/Avatar.js +1 -1
  18. package/cjs/components/Avatar/Avatar.js.map +1 -1
  19. package/cjs/components/Button/Button.js +3 -2
  20. package/cjs/components/Button/Button.js.map +1 -1
  21. package/cjs/components/ButtonIcon/ButtonIcon.js.map +1 -1
  22. package/cjs/components/Checkbox/Checkbox.js +4 -4
  23. package/cjs/components/Checkbox/Checkbox.js.map +1 -1
  24. package/cjs/components/ColorField/ColorField.js +42 -29
  25. package/cjs/components/ColorField/ColorField.js.map +1 -1
  26. package/cjs/components/DatePicker/DatePicker.js +2 -2
  27. package/cjs/components/DatePicker/DatePicker.js.map +1 -1
  28. package/cjs/components/DatePicker/components/Calendar/Calendar.js +4 -3
  29. package/cjs/components/DatePicker/components/Calendar/Calendar.js.map +1 -1
  30. package/cjs/components/DropdownCard/components/DropdownCardDropdown.js +6 -5
  31. package/cjs/components/DropdownCard/components/DropdownCardDropdown.js.map +1 -1
  32. package/cjs/components/DropdownCard/components/DropdownCardTabs.js +3 -2
  33. package/cjs/components/DropdownCard/components/DropdownCardTabs.js.map +1 -1
  34. package/cjs/components/Field/Field.js +26 -6
  35. package/cjs/components/Field/Field.js.map +1 -1
  36. package/cjs/components/FileField/FileField.js +47 -33
  37. package/cjs/components/FileField/FileField.js.map +1 -1
  38. package/cjs/components/Icon/Icon.js.map +1 -1
  39. package/cjs/components/Icon/RoasterIcon.js +12 -0
  40. package/cjs/components/Icon/RoasterIcon.js.map +1 -0
  41. package/cjs/components/IconBadge/IconBadge.js.map +1 -1
  42. package/cjs/components/Modal/Modal.js +3 -2
  43. package/cjs/components/Modal/Modal.js.map +1 -1
  44. package/cjs/components/Pagination/Pagination.js +4 -3
  45. package/cjs/components/Pagination/Pagination.js.map +1 -1
  46. package/cjs/components/RangeField/RangeField.js +34 -21
  47. package/cjs/components/RangeField/RangeField.js.map +1 -1
  48. package/cjs/components/Select/Select.js +8 -6
  49. package/cjs/components/Select/Select.js.map +1 -1
  50. package/cjs/components/Sidebar/Sidebar.js +4 -3
  51. package/cjs/components/Sidebar/Sidebar.js.map +1 -1
  52. package/cjs/components/Sidebar/components/Back.js +7 -3
  53. package/cjs/components/Sidebar/components/Back.js.map +1 -1
  54. package/cjs/components/StatCard/StatCard.js +3 -2
  55. package/cjs/components/StatCard/StatCard.js.map +1 -1
  56. package/cjs/components/Switch/Switch.js +7 -1
  57. package/cjs/components/Switch/Switch.js.map +1 -1
  58. package/cjs/components/Table/components/TableHeadCell.js +4 -3
  59. package/cjs/components/Table/components/TableHeadCell.js.map +1 -1
  60. package/cjs/components/Tag/Tag.js +3 -2
  61. package/cjs/components/Tag/Tag.js.map +1 -1
  62. package/cjs/components/TextField/TextField.js +3 -1
  63. package/cjs/components/TextField/TextField.js.map +1 -1
  64. package/cjs/components/Textarea/Textarea.js +36 -4
  65. package/cjs/components/Textarea/Textarea.js.map +1 -1
  66. package/cjs/components/Thumbnail/Thumbnail.js +3 -2
  67. package/cjs/components/Thumbnail/Thumbnail.js.map +1 -1
  68. package/cjs/components/Toast/Toast.js +3 -2
  69. package/cjs/components/Toast/Toast.js.map +1 -1
  70. package/cjs/components/Tooltip/Tooltip.js +6 -5
  71. package/cjs/components/Tooltip/Tooltip.js.map +1 -1
  72. package/cjs/components/Tooltip/TooltipCallout.js +3 -2
  73. package/cjs/components/Tooltip/TooltipCallout.js.map +1 -1
  74. package/cjs/components/Visualizer/Visualizer.js +4 -3
  75. package/cjs/components/Visualizer/Visualizer.js.map +1 -1
  76. package/cjs/utils/Slot/index.js +5 -5
  77. package/cjs/utils/Slot/index.js.map +1 -1
  78. package/cjs/utils/useDropdown/DropdownTrigger.js +4 -4
  79. package/cjs/utils/useDropdown/DropdownTrigger.js.map +1 -1
  80. package/cjs/utils/useMergeRefs/index.js +51 -0
  81. package/cjs/utils/useMergeRefs/index.js.map +1 -0
  82. package/esm/components/ActionList/components/ActionListDropdown.js +2 -1
  83. package/esm/components/ActionList/components/ActionListDropdown.js.map +1 -1
  84. package/esm/components/ActionList/components/ActionListItem.js +5 -3
  85. package/esm/components/ActionList/components/ActionListItem.js.map +1 -1
  86. package/esm/components/ActionList/components/ActionListSearch.js +21 -3
  87. package/esm/components/ActionList/components/ActionListSearch.js.map +1 -1
  88. package/esm/components/ActionList/components/ActionListSubmenu.js +5 -3
  89. package/esm/components/ActionList/components/ActionListSubmenu.js.map +1 -1
  90. package/esm/components/ActionList/components/ActionListSwitchItem.js +2 -1
  91. package/esm/components/ActionList/components/ActionListSwitchItem.js.map +1 -1
  92. package/esm/components/Alert/Alert.js +3 -2
  93. package/esm/components/Alert/Alert.js.map +1 -1
  94. package/esm/components/AppFrame/AppFrame.js.map +1 -1
  95. package/esm/components/Avatar/Avatar.js +1 -1
  96. package/esm/components/Avatar/Avatar.js.map +1 -1
  97. package/esm/components/Button/Button.js +3 -2
  98. package/esm/components/Button/Button.js.map +1 -1
  99. package/esm/components/ButtonIcon/ButtonIcon.js.map +1 -1
  100. package/esm/components/Checkbox/Checkbox.js +1 -1
  101. package/esm/components/Checkbox/Checkbox.js.map +1 -1
  102. package/esm/components/ColorField/ColorField.js +42 -29
  103. package/esm/components/ColorField/ColorField.js.map +1 -1
  104. package/esm/components/DatePicker/DatePicker.js +1 -1
  105. package/esm/components/DatePicker/DatePicker.js.map +1 -1
  106. package/esm/components/DatePicker/components/Calendar/Calendar.js +4 -3
  107. package/esm/components/DatePicker/components/Calendar/Calendar.js.map +1 -1
  108. package/esm/components/DropdownCard/components/DropdownCardDropdown.js +2 -1
  109. package/esm/components/DropdownCard/components/DropdownCardDropdown.js.map +1 -1
  110. package/esm/components/DropdownCard/components/DropdownCardTabs.js +3 -2
  111. package/esm/components/DropdownCard/components/DropdownCardTabs.js.map +1 -1
  112. package/esm/components/Field/Field.js +26 -6
  113. package/esm/components/Field/Field.js.map +1 -1
  114. package/esm/components/FileField/FileField.js +47 -33
  115. package/esm/components/FileField/FileField.js.map +1 -1
  116. package/esm/components/Icon/Icon.js.map +1 -1
  117. package/esm/components/Icon/RoasterIcon.js +10 -0
  118. package/esm/components/Icon/RoasterIcon.js.map +1 -0
  119. package/esm/components/IconBadge/IconBadge.js.map +1 -1
  120. package/esm/components/Modal/Modal.js +3 -2
  121. package/esm/components/Modal/Modal.js.map +1 -1
  122. package/esm/components/Pagination/Pagination.js +4 -3
  123. package/esm/components/Pagination/Pagination.js.map +1 -1
  124. package/esm/components/RangeField/RangeField.js +34 -21
  125. package/esm/components/RangeField/RangeField.js.map +1 -1
  126. package/esm/components/Select/Select.js +4 -2
  127. package/esm/components/Select/Select.js.map +1 -1
  128. package/esm/components/Sidebar/Sidebar.js +4 -3
  129. package/esm/components/Sidebar/Sidebar.js.map +1 -1
  130. package/esm/components/Sidebar/components/Back.js +7 -3
  131. package/esm/components/Sidebar/components/Back.js.map +1 -1
  132. package/esm/components/StatCard/StatCard.js +3 -2
  133. package/esm/components/StatCard/StatCard.js.map +1 -1
  134. package/esm/components/Switch/Switch.js +7 -1
  135. package/esm/components/Switch/Switch.js.map +1 -1
  136. package/esm/components/Table/components/TableHeadCell.js +4 -3
  137. package/esm/components/Table/components/TableHeadCell.js.map +1 -1
  138. package/esm/components/Tag/Tag.js +3 -2
  139. package/esm/components/Tag/Tag.js.map +1 -1
  140. package/esm/components/TextField/TextField.js +3 -1
  141. package/esm/components/TextField/TextField.js.map +1 -1
  142. package/esm/components/Textarea/Textarea.js +38 -6
  143. package/esm/components/Textarea/Textarea.js.map +1 -1
  144. package/esm/components/Thumbnail/Thumbnail.js +3 -2
  145. package/esm/components/Thumbnail/Thumbnail.js.map +1 -1
  146. package/esm/components/Toast/Toast.js +3 -2
  147. package/esm/components/Toast/Toast.js.map +1 -1
  148. package/esm/components/Tooltip/Tooltip.js +2 -1
  149. package/esm/components/Tooltip/Tooltip.js.map +1 -1
  150. package/esm/components/Tooltip/TooltipCallout.js +3 -2
  151. package/esm/components/Tooltip/TooltipCallout.js.map +1 -1
  152. package/esm/components/Visualizer/Visualizer.js +4 -3
  153. package/esm/components/Visualizer/Visualizer.js.map +1 -1
  154. package/esm/package.json +4 -1
  155. package/esm/utils/Slot/index.js +1 -1
  156. package/esm/utils/Slot/index.js.map +1 -1
  157. package/esm/utils/useDropdown/DropdownTrigger.js +1 -1
  158. package/esm/utils/useDropdown/DropdownTrigger.js.map +1 -1
  159. package/esm/utils/useMergeRefs/index.js +36 -0
  160. package/esm/utils/useMergeRefs/index.js.map +1 -0
  161. package/lib/components/ActionList/components/ActionListItem.d.ts +4 -1
  162. package/lib/components/ActionList/components/ActionListItem.d.ts.map +1 -1
  163. package/lib/components/ActionList/components/ActionListSearch.d.ts.map +1 -1
  164. package/lib/components/ActionList/components/ActionListSubmenu.d.ts.map +1 -1
  165. package/lib/components/AppFrame/AppFrame.d.ts +5 -1
  166. package/lib/components/AppFrame/AppFrame.d.ts.map +1 -1
  167. package/lib/components/Avatar/Avatar.d.ts +4 -1
  168. package/lib/components/Avatar/Avatar.d.ts.map +1 -1
  169. package/lib/components/ButtonIcon/ButtonIcon.d.ts +1 -1
  170. package/lib/components/ButtonIcon/ButtonIcon.d.ts.map +1 -1
  171. package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  172. package/lib/components/ColorField/ColorField.d.ts.map +1 -1
  173. package/lib/components/DatePicker/DatePicker.d.ts.map +1 -1
  174. package/lib/components/DatePicker/utils/index.d.ts +2 -1
  175. package/lib/components/DatePicker/utils/index.d.ts.map +1 -1
  176. package/lib/components/Field/Field.d.ts +13 -7
  177. package/lib/components/Field/Field.d.ts.map +1 -1
  178. package/lib/components/FileField/FileField.d.ts.map +1 -1
  179. package/lib/components/Icon/Icon.d.ts +13 -2
  180. package/lib/components/Icon/Icon.d.ts.map +1 -1
  181. package/lib/components/Icon/RoasterIcon.d.ts +13 -0
  182. package/lib/components/Icon/RoasterIcon.d.ts.map +1 -0
  183. package/lib/components/Icon/index.d.ts +2 -0
  184. package/lib/components/Icon/index.d.ts.map +1 -1
  185. package/lib/components/IconBadge/IconBadge.d.ts +2 -2
  186. package/lib/components/RangeField/RangeField.d.ts.map +1 -1
  187. package/lib/components/Select/Select.d.ts.map +1 -1
  188. package/lib/components/Sidebar/components/Back.d.ts.map +1 -1
  189. package/lib/components/Switch/Switch.d.ts.map +1 -1
  190. package/lib/components/TextField/TextField.d.ts.map +1 -1
  191. package/lib/components/Textarea/Textarea.d.ts +6 -1
  192. package/lib/components/Textarea/Textarea.d.ts.map +1 -1
  193. package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
  194. package/lib/utils/Slot/index.d.ts.map +1 -1
  195. package/lib/utils/index.d.ts +1 -0
  196. package/lib/utils/index.d.ts.map +1 -1
  197. package/lib/utils/useDropdown/DropdownTrigger.d.ts.map +1 -1
  198. package/lib/utils/useMergeRefs/index.d.ts +11 -0
  199. package/lib/utils/useMergeRefs/index.d.ts.map +1 -0
  200. package/package.json +2 -2
  201. package/roaster.css +2 -1
  202. package/themes/azoth.css +1 -1
  203. package/themes/coffee.css +1 -1
  204. package/themes/scalar.css +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Thumbnail.js","sources":["../../../../src/components/Thumbnail/Thumbnail.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useImageFallback } from '@/utils';\nimport { Icon } from '@/components/Icon';\n\n/** Every native `<span>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to it. */\nexport interface ThumbnailProps extends React.ComponentPropsWithoutRef<'span'> {\n /** The URL of the picture. Without it, or when it fails to load, the thumbnail shows an image icon. */\n src?: string | null;\n /**\n * What the thumbnail says to screen readers. `''` when the name is already written next to it.\n * @defaultValue `name`\n */\n alt?: string;\n /** The name of the product or item. */\n name: string;\n /** The width and height, in pixels. */\n size?: number;\n}\n\n/** A small square picture of a product or an item, with an image icon when the picture is missing. */\nexport const Thumbnail = React.forwardRef<HTMLSpanElement, ThumbnailProps>(\n ({ src, alt, name, size, className, style, ...others }, ref) => {\n const { showFallback, onError } = useImageFallback(src);\n const label = alt ?? name;\n const fallbackProps = label ? { role: 'img', 'aria-label': label } : { 'aria-hidden': true };\n\n return (\n <span\n {...(showFallback ? fallbackProps : {})}\n {...others}\n ref={ref}\n className={classNames('roaster-thumbnail', className)}\n style={{ ...(size && { width: size, height: size }), ...style }}\n >\n {showFallback ? <Icon name=\"image\" /> : <img src={src ?? undefined} alt={label} onError={onError} />}\n </span>\n );\n }\n);\n\nThumbnail.displayName = 'Thumbnail';\n"],"names":[],"mappings":";;;;;;;AAKY,MAAC,SAAS,GAAG,KAAK,CAAC,UAAU;AACzC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,KAAK;AAClE,IAAI,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,gBAAgB,CAAC,GAAG,CAAC;AAC3D,IAAI,MAAM,KAAK,GAAG,GAAG,IAAI,IAAI;AAC7B,IAAI,MAAM,aAAa,GAAG,KAAK,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE;AAChG,IAAI,uBAAuB,GAAG;AAC9B,MAAM,MAAM;AACZ,MAAM;AACN,QAAQ,GAAG,YAAY,GAAG,aAAa,GAAG,EAAE;AAC5C,QAAQ,GAAG,MAAM;AACjB,QAAQ,GAAG;AACX,QAAQ,SAAS,EAAE,UAAU,CAAC,mBAAmB,EAAE,SAAS,CAAC;AAC7D,QAAQ,KAAK,EAAE,EAAE,GAAG,IAAI,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,GAAG,KAAK,EAAE;AACrE,QAAQ,QAAQ,EAAE,YAAY,mBAAmB,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,mBAAmB,GAAG,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE;AACtJ;AACA,KAAK;AACL,EAAE;AACF;AACA,SAAS,CAAC,WAAW,GAAG,WAAW;;"}
1
+ {"version":3,"file":"Thumbnail.js","sources":["../../../../src/components/Thumbnail/Thumbnail.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useImageFallback } from '@/utils';\nimport { RoasterIcon } from '@/components/Icon';\n\n/** Every native `<span>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to it. */\nexport interface ThumbnailProps extends React.ComponentPropsWithoutRef<'span'> {\n /** The URL of the picture. Without it, or when it fails to load, the thumbnail shows an image icon. */\n src?: string | null;\n /**\n * What the thumbnail says to screen readers. `''` when the name is already written next to it.\n * @defaultValue `name`\n */\n alt?: string;\n /** The name of the product or item. */\n name: string;\n /** The width and height, in pixels. */\n size?: number;\n}\n\n/** A small square picture of a product or an item, with an image icon when the picture is missing. */\nexport const Thumbnail = React.forwardRef<HTMLSpanElement, ThumbnailProps>(\n ({ src, alt, name, size, className, style, ...others }, ref) => {\n const { showFallback, onError } = useImageFallback(src);\n const label = alt ?? name;\n const fallbackProps = label ? { role: 'img', 'aria-label': label } : { 'aria-hidden': true };\n\n return (\n <span\n {...(showFallback ? fallbackProps : {})}\n {...others}\n ref={ref}\n className={classNames('roaster-thumbnail', className)}\n style={{ ...(size && { width: size, height: size }), ...style }}\n >\n {showFallback ? <RoasterIcon name=\"image\" /> : <img src={src ?? undefined} alt={label} onError={onError} />}\n </span>\n );\n }\n);\n\nThumbnail.displayName = 'Thumbnail';\n"],"names":[],"mappings":";;;;;;;;AAKY,MAAC,SAAS,GAAG,KAAK,CAAC,UAAU;AACzC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,KAAK;AAClE,IAAI,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,gBAAgB,CAAC,GAAG,CAAC;AAC3D,IAAI,MAAM,KAAK,GAAG,GAAG,IAAI,IAAI;AAC7B,IAAI,MAAM,aAAa,GAAG,KAAK,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE;AAChG,IAAI,uBAAuB,GAAG;AAC9B,MAAM,MAAM;AACZ,MAAM;AACN,QAAQ,GAAG,YAAY,GAAG,aAAa,GAAG,EAAE;AAC5C,QAAQ,GAAG,MAAM;AACjB,QAAQ,GAAG;AACX,QAAQ,SAAS,EAAE,UAAU,CAAC,mBAAmB,EAAE,SAAS,CAAC;AAC7D,QAAQ,KAAK,EAAE,EAAE,GAAG,IAAI,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,GAAG,KAAK,EAAE;AACrE,QAAQ,QAAQ,EAAE,YAAY,mBAAmB,GAAG,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,mBAAmB,GAAG,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE;AAC7J;AACA,KAAK;AACL,EAAE;AACF;AACA,SAAS,CAAC,WAAW,GAAG,WAAW;;"}
@@ -2,7 +2,8 @@
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
4
  import { ButtonIcon } from '../ButtonIcon/ButtonIcon.js';
5
- import { Icon } from '../Icon/Icon.js';
5
+ import '../Icon/Icon.js';
6
+ import { RoasterIcon } from '../Icon/RoasterIcon.js';
6
7
  import { classNames } from '../../utils/classNames/index.js';
7
8
 
8
9
  const defaultToastLabels = { close: "Close" };
@@ -18,7 +19,7 @@ const Toast = React.forwardRef((props, ref) => {
18
19
  className: classNames("roaster-toast", `roaster-toast--${tone}`, className),
19
20
  children: [
20
21
  /* @__PURE__ */ jsx("div", { className: "roaster-toast__content", children }),
21
- closable && /* @__PURE__ */ jsx(ButtonIcon, { className: "roaster-toast__close", "aria-label": text.close, onClick: onClose, children: /* @__PURE__ */ jsx(Icon, { name: "xmark" }) })
22
+ closable && /* @__PURE__ */ jsx(ButtonIcon, { className: "roaster-toast__close", "aria-label": text.close, onClick: onClose, children: /* @__PURE__ */ jsx(RoasterIcon, { name: "x" }) })
22
23
  ]
23
24
  }
24
25
  );
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.js","sources":["../../../../src/components/Toast/Toast.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Icon } from '@/components/Icon';\n\n/** The possible levels for a Toast component. */\n/** The tones of a toast, as Alert's: its color, and how urgently screen readers announce it. */\nexport type ToastTone = 'info' | 'success' | 'warning' | 'danger';\n\n/** The text of the toast, for other languages. */\nexport interface ToastLabels {\n /** The name of the close button, read by screen readers. */\n close: string;\n}\n\nconst defaultToastLabels: ToastLabels = { close: 'Close' };\n\n/** Every native `<div>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to it. */\nexport interface ToastProps extends React.ComponentPropsWithoutRef<'div'> {\n /** The message. */\n children: React.ReactNode;\n /**\n * The tone. `danger` and `warning` are announced at once (`role=\"alert\"`), the others politely (`role=\"status\"`).\n * @defaultValue 'info'\n */\n tone?: ToastTone;\n /** Called when the close button is clicked. */\n onClose?(): void;\n /**\n * Whether the user can close the toast with its close button.\n * @defaultValue true\n */\n closable?: boolean;\n /** The text of the toast, in English by default. */\n labels?: Partial<ToastLabels>;\n}\n\n/**\n * A temporary message shown in a corner of the screen. Show one with useToast() inside a ToastsProvider.\n */\nexport const Toast = React.forwardRef<HTMLDivElement, ToastProps>((props, ref) => {\n const { className, tone = 'info', closable = true, children, onClose, labels, ...others } = props;\n const text = { ...defaultToastLabels, ...labels };\n\n return (\n <div\n role={tone === 'danger' || tone === 'warning' ? 'alert' : 'status'}\n {...others}\n ref={ref}\n className={classNames('roaster-toast', `roaster-toast--${tone}`, className)}\n >\n <div className=\"roaster-toast__content\">{children}</div>\n {closable && (\n <ButtonIcon className=\"roaster-toast__close\" aria-label={text.close} onClick={onClose}>\n <Icon name=\"xmark\" />\n </ButtonIcon>\n )}\n </div>\n );\n});\n\nToast.displayName = 'Toast';\n"],"names":[],"mappings":";;;;;;;AAMA,MAAM,kBAAkB,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE;AACjC,MAAC,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACtD,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,GAAG,MAAM,EAAE,QAAQ,GAAG,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK;AACnG,EAAE,MAAM,IAAI,GAAG,EAAE,GAAG,kBAAkB,EAAE,GAAG,MAAM,EAAE;AACnD,EAAE,uBAAuB,IAAI;AAC7B,IAAI,KAAK;AACT,IAAI;AACJ,MAAM,IAAI,EAAE,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS,GAAG,OAAO,GAAG,QAAQ;AACxE,MAAM,GAAG,MAAM;AACf,MAAM,GAAG;AACT,MAAM,SAAS,EAAE,UAAU,CAAC,eAAe,EAAE,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC;AACjF,MAAM,QAAQ,EAAE;AAChB,wBAAwB,GAAG,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,wBAAwB,EAAE,QAAQ,EAAE,CAAC;AACrF,QAAQ,QAAQ,oBAAoB,GAAG,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,sBAAsB,EAAE,YAAY,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,kBAAkB,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE;AAC7L;AACA;AACA,GAAG;AACH,CAAC;AACD,KAAK,CAAC,WAAW,GAAG,OAAO;;"}
1
+ {"version":3,"file":"Toast.js","sources":["../../../../src/components/Toast/Toast.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { RoasterIcon } from '@/components/Icon';\n\n/** The possible levels for a Toast component. */\n/** The tones of a toast, as Alert's: its color, and how urgently screen readers announce it. */\nexport type ToastTone = 'info' | 'success' | 'warning' | 'danger';\n\n/** The text of the toast, for other languages. */\nexport interface ToastLabels {\n /** The name of the close button, read by screen readers. */\n close: string;\n}\n\nconst defaultToastLabels: ToastLabels = { close: 'Close' };\n\n/** Every native `<div>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to it. */\nexport interface ToastProps extends React.ComponentPropsWithoutRef<'div'> {\n /** The message. */\n children: React.ReactNode;\n /**\n * The tone. `danger` and `warning` are announced at once (`role=\"alert\"`), the others politely (`role=\"status\"`).\n * @defaultValue 'info'\n */\n tone?: ToastTone;\n /** Called when the close button is clicked. */\n onClose?(): void;\n /**\n * Whether the user can close the toast with its close button.\n * @defaultValue true\n */\n closable?: boolean;\n /** The text of the toast, in English by default. */\n labels?: Partial<ToastLabels>;\n}\n\n/**\n * A temporary message shown in a corner of the screen. Show one with useToast() inside a ToastsProvider.\n */\nexport const Toast = React.forwardRef<HTMLDivElement, ToastProps>((props, ref) => {\n const { className, tone = 'info', closable = true, children, onClose, labels, ...others } = props;\n const text = { ...defaultToastLabels, ...labels };\n\n return (\n <div\n role={tone === 'danger' || tone === 'warning' ? 'alert' : 'status'}\n {...others}\n ref={ref}\n className={classNames('roaster-toast', `roaster-toast--${tone}`, className)}\n >\n <div className=\"roaster-toast__content\">{children}</div>\n {closable && (\n <ButtonIcon className=\"roaster-toast__close\" aria-label={text.close} onClick={onClose}>\n <RoasterIcon name=\"x\" />\n </ButtonIcon>\n )}\n </div>\n );\n});\n\nToast.displayName = 'Toast';\n"],"names":[],"mappings":";;;;;;;;AAMA,MAAM,kBAAkB,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE;AACjC,MAAC,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACtD,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,GAAG,MAAM,EAAE,QAAQ,GAAG,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK;AACnG,EAAE,MAAM,IAAI,GAAG,EAAE,GAAG,kBAAkB,EAAE,GAAG,MAAM,EAAE;AACnD,EAAE,uBAAuB,IAAI;AAC7B,IAAI,KAAK;AACT,IAAI;AACJ,MAAM,IAAI,EAAE,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS,GAAG,OAAO,GAAG,QAAQ;AACxE,MAAM,GAAG,MAAM;AACf,MAAM,GAAG;AACT,MAAM,SAAS,EAAE,UAAU,CAAC,eAAe,EAAE,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC;AACjF,MAAM,QAAQ,EAAE;AAChB,wBAAwB,GAAG,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,wBAAwB,EAAE,QAAQ,EAAE,CAAC;AACrF,QAAQ,QAAQ,oBAAoB,GAAG,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,sBAAsB,EAAE,YAAY,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,kBAAkB,GAAG,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE;AAChM;AACA;AACA,GAAG;AACH,CAAC;AACD,KAAK,CAAC,WAAW,GAAG,OAAO;;"}
@@ -1,11 +1,12 @@
1
1
  'use client';
2
2
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
- import { useMergeRefs, FloatingPortal } from '@floating-ui/react';
4
+ import { FloatingPortal } from '@floating-ui/react';
5
5
  import { Slot } from '../../utils/Slot/index.js';
6
6
  import { useTooltip } from './useTooltip.js';
7
7
  import { TooltipCallout } from './TooltipCallout.js';
8
8
  import { useControllableState } from '../../utils/useControllableState/index.js';
9
+ import { useMergeRefs } from '../../utils/useMergeRefs/index.js';
9
10
  import { classNames } from '../../utils/classNames/index.js';
10
11
 
11
12
  const TooltipBase = React.forwardRef((props, ref) => {
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.js","sources":["../../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMergeRefs, FloatingPortal, Placement } from '@floating-ui/react';\nimport { Slot } from '@/utils/Slot';\nimport { classNames, useControllableState } from '@/utils';\nimport { useTooltip } from './useTooltip';\nimport { TooltipCallout } from './TooltipCallout';\n\nexport type FloatingSide = Placement;\n\n/** Every native `<div>` prop (`id`, `className`, `style`, ...) is accepted and forwarded to the tooltip. */\nexport interface TooltipProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {\n /** The target: one element that takes the focus (a button, a link, or an element with `tabIndex={0}`). */\n children: React.ReactNode;\n /** The text of the tooltip. */\n label: React.ReactNode;\n /**\n * Where the tooltip goes relative to its target. It moves to the other side when there is no room.\n * @defaultValue 'top'\n */\n placement?: FloatingSide;\n /** Whether the tooltip is open, when the parent controls it. Leave it out to let hover and focus open it. */\n open?: boolean;\n /**\n * Whether the tooltip starts open, when it is not controlled.\n * @defaultValue false\n */\n defaultOpen?: boolean;\n /** Called when hover, focus or Escape opens or closes the tooltip, controlled or not. */\n onOpenChange?(open: boolean): void;\n /**\n * The distance in pixels between the tooltip and its target.\n * @defaultValue 4\n */\n offset?: number;\n /** Set it when the target is text that may wrap over several lines, so the tooltip follows the hovered line. */\n inline?: boolean;\n}\n\nconst TooltipBase = React.forwardRef<HTMLElement, TooltipProps>((props, ref) => {\n const {\n children,\n label,\n placement = 'top',\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n offset = 4,\n inline = false,\n className,\n style,\n ...others\n } = props;\n\n const [open, setOpen] = useControllableState({ value: openProp, defaultValue: defaultOpen, onChange: onOpenChange });\n const tooltip = useTooltip({ placement, open, onOpenChange: setOpen, offset, inline });\n const targetRef = useMergeRefs([tooltip.refs.setReference, ref]);\n\n return (\n <>\n <Slot {...tooltip.getReferenceProps()} ref={targetRef}>\n {children}\n </Slot>\n {open && (\n <FloatingPortal>\n <div\n {...tooltip.getFloatingProps(others)}\n ref={tooltip.refs.setFloating}\n className={classNames('roaster-tooltip', 'roaster-tooltip--floating', className)}\n style={{ ...tooltip.floatingStyles, ...style }}\n data-placement={tooltip.placement}\n >\n {label}\n </div>\n </FloatingPortal>\n )}\n </>\n );\n});\n\nTooltipBase.displayName = 'Tooltip';\n\n/**\n * A short description of its target, shown while the target is hovered or has the focus, and hidden with Escape. The\n * target is described by it (`aria-describedby`). The ref goes to the target. Tooltip.Callout stays open beside its\n * host until it is closed.\n */\nexport const Tooltip = Object.assign(TooltipBase, { Callout: TooltipCallout });\n"],"names":[],"mappings":";;;;;;;;;;AAQA,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACrD,EAAE,MAAM;AACR,IAAI,QAAQ;AACZ,IAAI,KAAK;AACT,IAAI,SAAS,GAAG,KAAK;AACrB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,WAAW,GAAG,KAAK;AACvB,IAAI,YAAY;AAChB,IAAI,MAAM,GAAG,CAAC;AACd,IAAI,MAAM,GAAG,KAAK;AAClB,IAAI,SAAS;AACb,IAAI,KAAK;AACT,IAAI,GAAG;AACP,GAAG,GAAG,KAAK;AACX,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,oBAAoB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;AACtH,EAAE,MAAM,OAAO,GAAG,UAAU,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AACxF,EAAE,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;AAClE,EAAE,uBAAuB,IAAI,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE;AACpD,oBAAoB,GAAG,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,iBAAiB,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;AAC3F,IAAI,IAAI,oBAAoB,GAAG,CAAC,cAAc,EAAE,EAAE,QAAQ,kBAAkB,GAAG;AAC/E,MAAM,KAAK;AACX,MAAM;AACN,QAAQ,GAAG,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC;AAC3C,QAAQ,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;AACrC,QAAQ,SAAS,EAAE,UAAU,CAAC,iBAAiB,EAAE,2BAA2B,EAAE,SAAS,CAAC;AACxF,QAAQ,KAAK,EAAE,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,GAAG,KAAK,EAAE;AACtD,QAAQ,gBAAgB,EAAE,OAAO,CAAC,SAAS;AAC3C,QAAQ,QAAQ,EAAE;AAClB;AACA,KAAK,EAAE;AACP,GAAG,EAAE,CAAC;AACN,CAAC,CAAC;AACF,WAAW,CAAC,WAAW,GAAG,SAAS;AACvB,MAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;;"}
1
+ {"version":3,"file":"Tooltip.js","sources":["../../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import * as React from 'react';\nimport { FloatingPortal, Placement } from '@floating-ui/react';\nimport { Slot } from '@/utils/Slot';\nimport { classNames, useControllableState, useMergeRefs } from '@/utils';\nimport { useTooltip } from './useTooltip';\nimport { TooltipCallout } from './TooltipCallout';\n\nexport type FloatingSide = Placement;\n\n/** Every native `<div>` prop (`id`, `className`, `style`, ...) is accepted and forwarded to the tooltip. */\nexport interface TooltipProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {\n /** The target: one element that takes the focus (a button, a link, or an element with `tabIndex={0}`). */\n children: React.ReactNode;\n /** The text of the tooltip. */\n label: React.ReactNode;\n /**\n * Where the tooltip goes relative to its target. It moves to the other side when there is no room.\n * @defaultValue 'top'\n */\n placement?: FloatingSide;\n /** Whether the tooltip is open, when the parent controls it. Leave it out to let hover and focus open it. */\n open?: boolean;\n /**\n * Whether the tooltip starts open, when it is not controlled.\n * @defaultValue false\n */\n defaultOpen?: boolean;\n /** Called when hover, focus or Escape opens or closes the tooltip, controlled or not. */\n onOpenChange?(open: boolean): void;\n /**\n * The distance in pixels between the tooltip and its target.\n * @defaultValue 4\n */\n offset?: number;\n /** Set it when the target is text that may wrap over several lines, so the tooltip follows the hovered line. */\n inline?: boolean;\n}\n\nconst TooltipBase = React.forwardRef<HTMLElement, TooltipProps>((props, ref) => {\n const {\n children,\n label,\n placement = 'top',\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n offset = 4,\n inline = false,\n className,\n style,\n ...others\n } = props;\n\n const [open, setOpen] = useControllableState({ value: openProp, defaultValue: defaultOpen, onChange: onOpenChange });\n const tooltip = useTooltip({ placement, open, onOpenChange: setOpen, offset, inline });\n const targetRef = useMergeRefs([tooltip.refs.setReference, ref]);\n\n return (\n <>\n <Slot {...tooltip.getReferenceProps()} ref={targetRef}>\n {children}\n </Slot>\n {open && (\n <FloatingPortal>\n <div\n {...tooltip.getFloatingProps(others)}\n ref={tooltip.refs.setFloating}\n className={classNames('roaster-tooltip', 'roaster-tooltip--floating', className)}\n style={{ ...tooltip.floatingStyles, ...style }}\n data-placement={tooltip.placement}\n >\n {label}\n </div>\n </FloatingPortal>\n )}\n </>\n );\n});\n\nTooltipBase.displayName = 'Tooltip';\n\n/**\n * A short description of its target, shown while the target is hovered or has the focus, and hidden with Escape. The\n * target is described by it (`aria-describedby`). The ref goes to the target. Tooltip.Callout stays open beside its\n * host until it is closed.\n */\nexport const Tooltip = Object.assign(TooltipBase, { Callout: TooltipCallout });\n"],"names":[],"mappings":";;;;;;;;;;;AAQA,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACrD,EAAE,MAAM;AACR,IAAI,QAAQ;AACZ,IAAI,KAAK;AACT,IAAI,SAAS,GAAG,KAAK;AACrB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,WAAW,GAAG,KAAK;AACvB,IAAI,YAAY;AAChB,IAAI,MAAM,GAAG,CAAC;AACd,IAAI,MAAM,GAAG,KAAK;AAClB,IAAI,SAAS;AACb,IAAI,KAAK;AACT,IAAI,GAAG;AACP,GAAG,GAAG,KA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 +1,8 @@
1
1
  'use client';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
- import { Icon } from '../Icon/Icon.js';
4
+ import '../Icon/Icon.js';
5
+ import { RoasterIcon } from '../Icon/RoasterIcon.js';
5
6
  import { useControllableState } from '../../utils/useControllableState/index.js';
6
7
  import { useUid } from '../../utils/useUid/index.js';
7
8
  import { classNames } from '../../utils/classNames/index.js';
@@ -29,7 +30,7 @@ const TooltipCallout = React.forwardRef(
29
30
  type: "button",
30
31
  "aria-label": text.close,
31
32
  onClick: () => setShown(false),
32
- children: /* @__PURE__ */ jsx(Icon, { name: "xmark" })
33
+ children: /* @__PURE__ */ jsx(RoasterIcon, { name: "x" })
33
34
  }
34
35
  ),
35
36
  /* @__PURE__ */ jsx("p", { className: "roaster-tooltip__title", id: titleId, children: title }),
@@ -1 +1 @@
1
- {"version":3,"file":"TooltipCallout.js","sources":["../../../../src/components/Tooltip/TooltipCallout.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useControllableState, useUid } from '@/utils';\nimport { Icon } from '../Icon';\n\n/** The text of the callout, for other languages. */\nexport interface TooltipCalloutLabels {\n /** The name of the close button, read by screen readers. */\n close: string;\n}\n\nconst defaultLabels: TooltipCalloutLabels = { close: 'Dismiss' };\n\n/** Every native `<div>` prop is accepted and forwarded to the callout. */\nexport interface TooltipCalloutProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'title'> {\n /** The callout's title, which names it. */\n title: React.ReactNode;\n /** What it says under the title, and a link if any. */\n children: React.ReactNode;\n /** Whether the callout is shown, when the parent controls it. */\n open?: boolean;\n /**\n * Whether the callout starts shown, when it is not controlled.\n * @defaultValue true\n */\n defaultOpen?: boolean;\n /** Called with `false` when its close button hides it. */\n onOpenChange?(open: boolean): void;\n /** The text of the callout, in English by default. */\n labels?: Partial<TooltipCalloutLabels>;\n}\n\n/**\n * A tooltip that stays open beside its host until it is closed, such as one that introduces a feature: a title, a\n * text, a link and a close button, with a line and a dot pointing at the host. Put it inside its host. It holds\n * controls, so it is a dialog named by its title.\n */\nexport const TooltipCallout = React.forwardRef<HTMLDivElement, TooltipCalloutProps>(\n ({ title, children, open, defaultOpen = true, onOpenChange, labels, className, ...others }, ref) => {\n const [shown, setShown] = useControllableState({ value: open, defaultValue: defaultOpen, onChange: onOpenChange });\n const titleId = useUid();\n const text = { ...defaultLabels, ...labels };\n if (!shown) return null;\n return (\n <div\n role=\"dialog\"\n aria-labelledby={titleId}\n {...others}\n ref={ref}\n className={classNames('roaster-tooltip', 'roaster-tooltip--callout', className)}\n >\n <button\n className=\"roaster-tooltip__close\"\n type=\"button\"\n aria-label={text.close}\n onClick={() => setShown(false)}\n >\n <Icon name=\"xmark\" />\n </button>\n <p className=\"roaster-tooltip__title\" id={titleId}>\n {title}\n </p>\n {children}\n </div>\n );\n }\n);\nTooltipCallout.displayName = 'TooltipCallout';\n"],"names":[],"mappings":";;;;;;;;AAKA,MAAM,aAAa,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE;AAC9B,MAAC,cAAc,GAAG,KAAK,CAAC,UAAU;AAC9C,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,KAAK;AACtG,IAAI,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,oBAAoB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;AACtH,IAAI,MAAM,OAAO,GAAG,MAAM,EAAE;AAC5B,IAAI,MAAM,IAAI,GAAG,EAAE,GAAG,aAAa,EAAE,GAAG,MAAM,EAAE;AAChD,IAAI,IAAI,CAAC,KAAK,EAAE,OAAO,IAAI;AAC3B,IAAI,uBAAuB,IAAI;AAC/B,MAAM,KAAK;AACX,MAAM;AACN,QAAQ,IAAI,EAAE,QAAQ;AACtB,QAAQ,iBAAiB,EAAE,OAAO;AAClC,QAAQ,GAAG,MAAM;AACjB,QAAQ,GAAG;AACX,QAAQ,SAAS,EAAE,UAAU,CAAC,iBAAiB,EAAE,0BAA0B,EAAE,SAAS,CAAC;AACvF,QAAQ,QAAQ,EAAE;AAClB,0BAA0B,GAAG;AAC7B,YAAY,QAAQ;AACpB,YAAY;AACZ,cAAc,SAAS,EAAE,wBAAwB;AACjD,cAAc,IAAI,EAAE,QAAQ;AAC5B,cAAc,YAAY,EAAE,IAAI,CAAC,KAAK;AACtC,cAAc,OAAO,EAAE,MAAM,QAAQ,CAAC,KAAK,CAAC;AAC5C,cAAc,QAAQ,kBAAkB,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;AACnE;AACA,WAAW;AACX,0BAA0B,GAAG,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,wBAAwB,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACzG,UAAU;AACV;AACA;AACA,KAAK;AACL,EAAE;AACF;AACA,cAAc,CAAC,WAAW,GAAG,gBAAgB;;"}
1
+ {"version":3,"file":"TooltipCallout.js","sources":["../../../../src/components/Tooltip/TooltipCallout.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useControllableState, useUid } from '@/utils';\nimport { RoasterIcon } from '../Icon';\n\n/** The text of the callout, for other languages. */\nexport interface TooltipCalloutLabels {\n /** The name of the close button, read by screen readers. */\n close: string;\n}\n\nconst defaultLabels: TooltipCalloutLabels = { close: 'Dismiss' };\n\n/** Every native `<div>` prop is accepted and forwarded to the callout. */\nexport interface TooltipCalloutProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'title'> {\n /** The callout's title, which names it. */\n title: React.ReactNode;\n /** What it says under the title, and a link if any. */\n children: React.ReactNode;\n /** Whether the callout is shown, when the parent controls it. */\n open?: boolean;\n /**\n * Whether the callout starts shown, when it is not controlled.\n * @defaultValue true\n */\n defaultOpen?: boolean;\n /** Called with `false` when its close button hides it. */\n onOpenChange?(open: boolean): void;\n /** The text of the callout, in English by default. */\n labels?: Partial<TooltipCalloutLabels>;\n}\n\n/**\n * A tooltip that stays open beside its host until it is closed, such as one that introduces a feature: a title, a\n * text, a link and a close button, with a line and a dot pointing at the host. Put it inside its host. It holds\n * controls, so it is a dialog named by its title.\n */\nexport const TooltipCallout = React.forwardRef<HTMLDivElement, TooltipCalloutProps>(\n ({ title, children, open, defaultOpen = true, onOpenChange, labels, className, ...others }, ref) => {\n const [shown, setShown] = useControllableState({ value: open, defaultValue: defaultOpen, onChange: onOpenChange });\n const titleId = useUid();\n const text = { ...defaultLabels, ...labels };\n if (!shown) return null;\n return (\n <div\n role=\"dialog\"\n aria-labelledby={titleId}\n {...others}\n ref={ref}\n className={classNames('roaster-tooltip', 'roaster-tooltip--callout', className)}\n >\n <button\n className=\"roaster-tooltip__close\"\n type=\"button\"\n aria-label={text.close}\n onClick={() => setShown(false)}\n >\n <RoasterIcon name=\"x\" />\n </button>\n <p className=\"roaster-tooltip__title\" id={titleId}>\n {title}\n </p>\n {children}\n </div>\n );\n }\n);\nTooltipCallout.displayName = 'TooltipCallout';\n"],"names":[],"mappings":";;;;;;;;;AAKA,MAAM,aAAa,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE;AAC9B,MAAC,cAAc,GAAG,KAAK,CAAC,UAAU;AAC9C,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,KAAK;AACtG,IAAI,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,oBAAoB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;AACtH,IAAI,MAAM,OAAO,GAAG,MAAM,EAAE;AAC5B,IAAI,MAAM,IAAI,GAAG,EAAE,GAAG,aAAa,EAAE,GAAG,MAAM,EAAE;AAChD,IAAI,IAAI,CAAC,KAAK,EAAE,OAAO,IAAI;AAC3B,IAAI,uBAAuB,IAAI;AAC/B,MAAM,KAAK;AACX,MAAM;AACN,QAAQ,IAAI,EAAE,QAAQ;AACtB,QAAQ,iBAAiB,EAAE,OAAO;AAClC,QAAQ,GAAG,MAAM;AACjB,QAAQ,GAAG;AACX,QAAQ,SAAS,EAAE,UAAU,CAAC,iBAAiB,EAAE,0BAA0B,EAAE,SAAS,CAAC;AACvF,QAAQ,QAAQ,EAAE;AAClB,0BAA0B,GAAG;AAC7B,YAAY,QAAQ;AACpB,YAAY;AACZ,cAAc,SAAS,EAAE,wBAAwB;AACjD,cAAc,IAAI,EAAE,QAAQ;AAC5B,cAAc,YAAY,EAAE,IAAI,CAAC,KAAK;AACtC,cAAc,OAAO,EAAE,MAAM,QAAQ,CAAC,KAAK,CAAC;AAC5C,cAAc,QAAQ,kBAAkB,GAAG,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE;AACtE;AACA,WAAW;AACX,0BAA0B,GAAG,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,wBAAwB,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACzG,UAAU;AACV;AACA;AACA,KAAK;AACL,EAAE;AACF;AACA,cAAc,CAAC,WAAW,GAAG,gBAAgB;;"}
@@ -2,7 +2,8 @@
2
2
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
4
  import { Button } from '../Button/Button.js';
5
- import { Icon } from '../Icon/Icon.js';
5
+ import '../Icon/Icon.js';
6
+ import { RoasterIcon } from '../Icon/RoasterIcon.js';
6
7
  import { useUid } from '../../utils/useUid/index.js';
7
8
  import { classNames } from '../../utils/classNames/index.js';
8
9
 
@@ -50,7 +51,7 @@ const Visualizer = React.forwardRef((props, ref) => {
50
51
  className: "roaster-visualizer__close",
51
52
  "aria-label": text.close,
52
53
  onClick: () => panelRef.current?.hidePopover?.(),
53
- children: /* @__PURE__ */ jsx(Icon, { name: "xmark" })
54
+ children: /* @__PURE__ */ jsx(RoasterIcon, { name: "x" })
54
55
  }
55
56
  )
56
57
  ] }),
@@ -69,7 +70,7 @@ const Visualizer = React.forwardRef((props, ref) => {
69
70
  "aria-controls": panelId,
70
71
  "aria-expanded": open,
71
72
  onClick: () => panelRef.current?.showPopover?.(),
72
- children: /* @__PURE__ */ jsx(Icon, { name: "chevron-up" })
73
+ children: /* @__PURE__ */ jsx(RoasterIcon, { name: "chevron-up" })
73
74
  }
74
75
  )
75
76
  ] })
@@ -1 +1 @@
1
- {"version":3,"file":"Visualizer.js","sources":["../../../../src/components/Visualizer/Visualizer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useUid } from '@/utils';\nimport { Button } from '../Button';\nimport { Icon } from '@/components/Icon';\n\n/** The text of the visualizer's buttons, for other languages. */\nexport interface VisualizerLabels {\n /** The name of the button that opens the preview on phones, read by screen readers. */\n open: string;\n /** The name of the button that closes it. */\n close: string;\n}\n\nconst defaultVisualizerLabels: VisualizerLabels = { open: 'Open the preview', close: 'Close the preview' };\n\n/** Every native `<aside>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to the panel. */\nexport interface VisualizerProps extends Omit<React.ComponentPropsWithoutRef<'aside'>, 'title'> {\n /** The title of the preview. It also names the panel. */\n title: React.ReactNode;\n /** The preview. */\n children?: React.ReactNode;\n /** The text of the buttons, in English by default. */\n labels?: Partial<VisualizerLabels>;\n}\n\n/**\n * A preview panel beside a form, to see the result of the changes being made. On phones, it is a sheet (a popover)\n * that a bar at the bottom of the screen opens; its close button, Escape and a click outside close it.\n */\nexport const Visualizer = React.forwardRef<HTMLElement, VisualizerProps>((props, ref) => {\n const { className, children, title, labels, id, ...others } = props;\n const text = { ...defaultVisualizerLabels, ...labels };\n const panelId = useUid(id);\n const titleId = useUid();\n const panelRef = React.useRef<HTMLElement | null>(null);\n const setRefs = React.useCallback(\n (panel: HTMLElement | null) => {\n panelRef.current = panel;\n if (typeof ref === 'function') ref(panel);\n else if (ref) ref.current = panel;\n },\n [ref]\n );\n // Whether the sheet is open, for the opener's aria-expanded. The browser opens and closes it (popover).\n const [open, setOpen] = React.useState(false);\n React.useEffect(() => {\n const panel = panelRef.current;\n const onToggle = (event: Event) => setOpen((event as ToggleEvent).newState === 'open');\n panel?.addEventListener('toggle', onToggle);\n return () => panel?.removeEventListener('toggle', onToggle);\n }, []);\n // `popover` isn't in React 18's types.\n const popover = { popover: 'auto' } as React.HTMLAttributes<HTMLElement>;\n\n return (\n <>\n <aside\n aria-labelledby={titleId}\n {...others}\n {...popover}\n id={panelId}\n ref={setRefs}\n className={classNames('roaster-visualizer', 'roaster-preview-background', className)}\n >\n <div className=\"roaster-visualizer__header\">\n <h2 className=\"roaster-visualizer__title\" id={titleId}>\n {title}\n </h2>\n <Button\n iconOnly\n variant=\"secondary\"\n className=\"roaster-visualizer__close\"\n aria-label={text.close}\n onClick={() => panelRef.current?.hidePopover?.()}\n >\n <Icon name=\"xmark\" />\n </Button>\n </div>\n <div className=\"roaster-visualizer__content\">{children}</div>\n </aside>\n <div className=\"roaster-visualizer-opener\">\n <p className=\"roaster-visualizer-opener__title\">{title}</p>\n <Button\n iconOnly\n variant=\"secondary\"\n aria-label={text.open}\n aria-controls={panelId}\n aria-expanded={open}\n onClick={() => panelRef.current?.showPopover?.()}\n >\n <Icon name=\"chevron-up\" />\n </Button>\n </div>\n </>\n );\n});\n\nVisualizer.displayName = 'Visualizer';\n"],"names":[],"mappings":";;;;;;;;AAMA,MAAM,uBAAuB,GAAG,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,mBAAmB,EAAE;AAC5E,MAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AAC3D,EAAE,MAAM,EAAE,SAAS,E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UAAU,QAAQ,EAAE,IAAI;AACxB,UAAU,OAAO,EAAE,WAAW;AAC9B,UAAU,YAAY,EAAE,IAAI,CAAC,IAAI;AACjC,UAAU,eAAe,EAAE,OAAO;AAClC,UAAU,eAAe,EAAE,IAAI;AAC/B,UAAU,OAAO,EAAE,MAAM,QAAQ,CAAC,OAAO,EAAE,WAAW,IAAI;AAC1D,UAAU,QAAQ,kBAAkB,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;AACpE;AACA;AACA,KAAK,EAAE;AACP,GAAG,EAAE,CAAC;AACN,CAAC;AACD,UAAU,CAAC,WAAW,GAAG,YAAY;;"}
1
+ {"version":3,"file":"Visualizer.js","sources":["../../../../src/components/Visualizer/Visualizer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useUid } from '@/utils';\nimport { Button } from '../Button';\nimport { RoasterIcon } from '@/components/Icon';\n\n/** The text of the visualizer's buttons, for other languages. */\nexport interface VisualizerLabels {\n /** The name of the button that opens the preview on phones, read by screen readers. */\n open: string;\n /** The name of the button that closes it. */\n close: string;\n}\n\nconst defaultVisualizerLabels: VisualizerLabels = { open: 'Open the preview', close: 'Close the preview' };\n\n/** Every native `<aside>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to the panel. */\nexport interface VisualizerProps extends Omit<React.ComponentPropsWithoutRef<'aside'>, 'title'> {\n /** The title of the preview. It also names the panel. */\n title: React.ReactNode;\n /** The preview. */\n children?: React.ReactNode;\n /** The text of the buttons, in English by default. */\n labels?: Partial<VisualizerLabels>;\n}\n\n/**\n * A preview panel beside a form, to see the result of the changes being made. On phones, it is a sheet (a popover)\n * that a bar at the bottom of the screen opens; its close button, Escape and a click outside close it.\n */\nexport const Visualizer = React.forwardRef<HTMLElement, VisualizerProps>((props, ref) => {\n const { className, children, title, labels, id, ...others } = props;\n const text = { ...defaultVisualizerLabels, ...labels };\n const panelId = useUid(id);\n const titleId = useUid();\n const panelRef = React.useRef<HTMLElement | null>(null);\n const setRefs = React.useCallback(\n (panel: HTMLElement | null) => {\n panelRef.current = panel;\n if (typeof ref === 'function') ref(panel);\n else if (ref) ref.current = panel;\n },\n [ref]\n );\n // Whether the sheet is open, for the opener's aria-expanded. The browser opens and closes it (popover).\n const [open, setOpen] = React.useState(false);\n React.useEffect(() => {\n const panel = panelRef.current;\n const onToggle = (event: Event) => setOpen((event as ToggleEvent).newState === 'open');\n panel?.addEventListener('toggle', onToggle);\n return () => panel?.removeEventListener('toggle', onToggle);\n }, []);\n // `popover` isn't in React 18's types.\n const popover = { popover: 'auto' } as React.HTMLAttributes<HTMLElement>;\n\n return (\n <>\n <aside\n aria-labelledby={titleId}\n {...others}\n {...popover}\n id={panelId}\n ref={setRefs}\n className={classNames('roaster-visualizer', 'roaster-preview-background', className)}\n >\n <div className=\"roaster-visualizer__header\">\n <h2 className=\"roaster-visualizer__title\" id={titleId}>\n {title}\n </h2>\n <Button\n iconOnly\n variant=\"secondary\"\n className=\"roaster-visualizer__close\"\n aria-label={text.close}\n onClick={() => panelRef.current?.hidePopover?.()}\n >\n <RoasterIcon name=\"x\" />\n </Button>\n </div>\n <div className=\"roaster-visualizer__content\">{children}</div>\n </aside>\n <div className=\"roaster-visualizer-opener\">\n <p className=\"roaster-visualizer-opener__title\">{title}</p>\n <Button\n iconOnly\n variant=\"secondary\"\n aria-label={text.open}\n aria-controls={panelId}\n aria-expanded={open}\n onClick={() => panelRef.current?.showPopover?.()}\n >\n <RoasterIcon name=\"chevron-up\" />\n </Button>\n </div>\n </>\n );\n});\n\nVisualizer.displayName = 'Visualizer';\n"],"names":[],"mappings":";;;;;;;;;AAMA,MAAM,uBAAuB,GAAG,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,mBAAmB,EAAE;AAC5E,MAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AAC3D,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,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;AACxB,UAAU,OAAO,EAAE,WAAW;AAC9B,UAAU,YAAY,EAAE,IAAI,CAAC,IAAI;AACjC,UAAU,eAAe,EAAE,OAAO;AAClC,UAAU,eAAe,EAAE,IAAI;AAC/B,UAAU,OAAO,EAAE,MAAM,QAAQ,CAAC,OAAO,EAAE,WAAW,IAAI;AAC1D,UAAU,QAAQ,kBAAkB,GAAG,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;AAC3E;AACA;AACA,KAAK,EAAE;AACP,GAAG,EAAE,CAAC;AACN,CAAC;AACD,UAAU,CAAC,WAAW,GAAG,YAAY;;"}
package/esm/package.json CHANGED
@@ -1,3 +1,6 @@
1
1
  {
2
- "type": "module"
2
+ "type": "module",
3
+ "sideEffects": [
4
+ "*.css"
5
+ ]
3
6
  }
@@ -1,8 +1,8 @@
1
1
  'use client';
2
- import { useMergeRefs } from '@floating-ui/react';
3
2
  import * as React from 'react';
4
3
  import { classNames } from '../classNames/index.js';
5
4
  import { getElementRef } from '../getElementRef/index.js';
5
+ import { useMergeRefs } from '../useMergeRefs/index.js';
6
6
 
7
7
  function mergeProps(slotProps, childProps) {
8
8
  const merged = { ...slotProps, ...childProps };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/utils/Slot/index.tsx"],"sourcesContent":["import { useMergeRefs } from '@floating-ui/react';\nimport * as React from 'react';\nimport { classNames } from '../classNames';\nimport { getElementRef } from '../getElementRef';\n\nexport interface SlotProps extends React.HTMLAttributes<HTMLElement> {\n /** One element, which receives the slot's props and ref. */\n children?: React.ReactNode;\n}\n\ntype AnyProps = Record<string, unknown>;\n\n/**\n * Merges the slot's props into the child's: event handlers both run (the child's first), classes add up, styles merge\n * with the child's winning, and anything else is the child's.\n */\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps): AnyProps {\n const merged: AnyProps = { ...slotProps, ...childProps };\n Object.keys(slotProps).forEach((key) => {\n const slotValue = slotProps[key];\n const childValue = childProps[key];\n if (/^on[A-Z]/.test(key) && typeof slotValue === 'function' && typeof childValue === 'function') {\n merged[key] = (...args: unknown[]) => {\n childValue(...args);\n slotValue(...args);\n };\n } else if (key === 'className') {\n merged.className = classNames(slotValue as string, childValue as string);\n } else if (key === 'style') {\n merged.style = { ...(slotValue as React.CSSProperties), ...(childValue as React.CSSProperties) };\n }\n });\n return merged;\n}\n\n/**\n * Renders its only child with the slot's props and ref merged in, instead of an element of its own. It is what\n * `asChild` and the triggers use: `<Tooltip label=\"Help\"><Button>?</Button></Tooltip>`.\n */\nexport const Slot = React.forwardRef<HTMLElement, SlotProps>(({ children, ...slotProps }, forwardedRef) => {\n const child = React.isValidElement<AnyProps>(children) ? children : null;\n const ref = useMergeRefs([forwardedRef, child ? getElementRef(child) : undefined]);\n\n if (!child) {\n if (React.Children.count(children) > 1) throw new Error('Slot needs a single element as its child.');\n return null;\n }\n // The ref last: on React 19 the child's own ref is in its props, and it's merged into this one.\n return React.cloneElement(child, { ...mergeProps(slotProps, child.props), ref });\n});\n\nSlot.displayName = 'Slot';\n"],"names":[],"mappings":";;;;;;AAKA,SAAS,UAAU,CAAC,SAAS,EAAE,UAAU,EAAE;AAC3C,EAAE,MAAM,MAAM,GAAG,EAAE,GAAG,SAAS,EAAE,GAAG,UAAU,EAAE;AAChD,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,KAAK;AAC1C,IAAI,MAAM,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC;AACpC,IAAI,MAAM,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC;AACtC,IAAI,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,OAAO,SAAS,KAAK,UAAU,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;AACrG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,KAAK;AACjC,QAAQ,UAAU,CAAC,GAAG,IAAI,CAAC;AAC3B,QAAQ,SAAS,CAAC,GAAG,IAAI,CAAC;AAC1B,MAAM,CAAC;AACP,IAAI,CAAC,MAAM,IAAI,GAAG,KAAK,WAAW,EAAE;AACpC,MAAM,MAAM,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC;AAC1D,IAAI,CAAC,MAAM,IAAI,GAAG,KAAK,OAAO,EAAE;AAChC,MAAM,MAAM,CAAC,KAAK,GAAG,EAAE,GAAG,SAAS,EAAE,GAAG,UAAU,EAAE;AACpD,IAAI;AACJ,EAAE,CAAC,CAAC;AACJ,EAAE,OAAO,MAAM;AACf;AACY,MAAC,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,EAAE,YAAY,KAAK;AACnF,EAAE,MAAM,KAAK,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,QAAQ,GAAG,IAAI;AAChE,EAAE,MAAM,GAAG,GAAG,YAAY,CAAC,CAAC,YAAY,EAAE,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;AACjF,EAAE,IAAI,CAAC,KAAK,EAAE;AACd,IAAI,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC;AACxG,IAAI,OAAO,IAAI;AACf,EAAE;AACF,EAAE,OAAO,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,GAAG,UAAU,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;AAClF,CAAC;AACD,IAAI,CAAC,WAAW,GAAG,MAAM;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/utils/Slot/index.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '../classNames';\nimport { getElementRef } from '../getElementRef';\nimport { useMergeRefs } from '../useMergeRefs';\n\nexport interface SlotProps extends React.HTMLAttributes<HTMLElement> {\n /** One element, which receives the slot's props and ref. */\n children?: React.ReactNode;\n}\n\ntype AnyProps = Record<string, unknown>;\n\n/**\n * Merges the slot's props into the child's: event handlers both run (the child's first), classes add up, styles merge\n * with the child's winning, and anything else is the child's.\n */\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps): AnyProps {\n const merged: AnyProps = { ...slotProps, ...childProps };\n Object.keys(slotProps).forEach((key) => {\n const slotValue = slotProps[key];\n const childValue = childProps[key];\n if (/^on[A-Z]/.test(key) && typeof slotValue === 'function' && typeof childValue === 'function') {\n merged[key] = (...args: unknown[]) => {\n childValue(...args);\n slotValue(...args);\n };\n } else if (key === 'className') {\n merged.className = classNames(slotValue as string, childValue as string);\n } else if (key === 'style') {\n merged.style = { ...(slotValue as React.CSSProperties), ...(childValue as React.CSSProperties) };\n }\n });\n return merged;\n}\n\n/**\n * Renders its only child with the slot's props and ref merged in, instead of an element of its own. It is what\n * `asChild` and the triggers use: `<Tooltip label=\"Help\"><Button>?</Button></Tooltip>`.\n */\nexport const Slot = React.forwardRef<HTMLElement, SlotProps>(({ children, ...slotProps }, forwardedRef) => {\n const child = React.isValidElement<AnyProps>(children) ? children : null;\n const ref = useMergeRefs([forwardedRef, child ? getElementRef(child) : undefined]);\n\n if (!child) {\n if (React.Children.count(children) > 1) throw new Error('Slot needs a single element as its child.');\n return null;\n }\n // The ref last: on React 19 the child's own ref is in its props, and it's merged into this one.\n return React.cloneElement(child, { ...mergeProps(slotProps, child.props), ref });\n});\n\nSlot.displayName = 'Slot';\n"],"names":[],"mappings":";;;;;;AAKA,SAAS,UAAU,CAAC,SAAS,EAAE,UAAU,EAAE;AAC3C,EAAE,MAAM,MAAM,GAAG,EAAE,GAAG,SAAS,EAAE,GAAG,UAAU,EAAE;AAChD,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,KAAK;AAC1C,IAAI,MAAM,SAAS,GAAG,SA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CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,GAAG,UAAU,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;AAClF,CAAC;AACD,IAAI,CAAC,WAAW,GAAG,MAAM;;"}
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
  import { jsx } from 'react/jsx-runtime';
3
- import { useMergeRefs } from '@floating-ui/react';
4
3
  import * as React from 'react';
5
4
  import { Slot } from '../Slot/index.js';
5
+ import { useMergeRefs } from '../useMergeRefs/index.js';
6
6
 
7
7
  function createDropdownTrigger(name, useDropdownContext) {
8
8
  const Trigger = React.forwardRef(({ children, ...props }, ref) => {
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownTrigger.js","sources":["../../../../src/utils/useDropdown/DropdownTrigger.tsx"],"sourcesContent":["import { useMergeRefs } from '@floating-ui/react';\nimport * as React from 'react';\nimport { Slot } from '../Slot';\nimport type { useDropdown } from './index';\n\nexport interface DropdownTriggerProps extends React.HTMLAttributes<HTMLElement> {\n /** The element that opens the dropdown, such as a Button. It must accept a ref: not a fragment, text or number. */\n children: React.ReactElement;\n}\n\n/**\n * Makes the trigger component of a dropdown (ActionList.Trigger, DropdownCard.Trigger): it gives its child element\n * the dropdown's ref and props, keeping the child's own.\n */\nexport function createDropdownTrigger(name: string, useDropdownContext: () => ReturnType<typeof useDropdown>) {\n const Trigger = React.forwardRef<HTMLElement, DropdownTriggerProps>(({ children, ...props }, ref) => {\n const context = useDropdownContext();\n const mergedRef = useMergeRefs([context.refs.setReference, ref]);\n\n return (\n <Slot {...context.getReferenceProps(props)} ref={mergedRef}>\n {children}\n </Slot>\n );\n });\n Trigger.displayName = `${name}Trigger`;\n return Trigger;\n}\n"],"names":[],"mappings":";;;;;;AAKO,SAAS,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,EAAE;AAChE,EAAE,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAK;AACpE,IAAI,MAAM,OAAO,GAAG,kBAAkB,EAAE;AACxC,IAAI,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;AACpE,IAAI,uBAAuB,GAAG,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;AACvG,EAAE,CAAC,CAAC;AACJ,EAAE,OAAO,CAAC,WAAW,GAAG,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC;AACxC,EAAE,OAAO,OAAO;AAChB;;"}
1
+ {"version":3,"file":"DropdownTrigger.js","sources":["../../../../src/utils/useDropdown/DropdownTrigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Slot } from '../Slot';\nimport { useMergeRefs } from '../useMergeRefs';\nimport type { useDropdown } from './index';\n\nexport interface DropdownTriggerProps extends React.HTMLAttributes<HTMLElement> {\n /** The element that opens the dropdown, such as a Button. It must accept a ref: not a fragment, text or number. */\n children: React.ReactElement;\n}\n\n/**\n * Makes the trigger component of a dropdown (ActionList.Trigger, DropdownCard.Trigger): it gives its child element\n * the dropdown's ref and props, keeping the child's own.\n */\nexport function createDropdownTrigger(name: string, useDropdownContext: () => ReturnType<typeof useDropdown>) {\n const Trigger = React.forwardRef<HTMLElement, DropdownTriggerProps>(({ children, ...props }, ref) => {\n const context = useDropdownContext();\n const mergedRef = useMergeRefs([context.refs.setReference, ref]);\n\n return (\n <Slot {...context.getReferenceProps(props)} ref={mergedRef}>\n {children}\n </Slot>\n );\n });\n Trigger.displayName = `${name}Trigger`;\n return Trigger;\n}\n"],"names":[],"mappings":";;;;;;AAKO,SAAS,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,EAAE;AAChE,EAAE,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAK;AACpE,IAAI,MAAM,OAAO,GAAG,kBAAkB,EAAE;AACxC,IAAI,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;AACpE,IAAI,uBAAuB,GAAG,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;AACvG,EAAE,CAAC,CAAC;AACJ,EAAE,OAAO,CAAC,WAAW,GAAG,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC;AACxC,EAAE,OAAO,OAAO;AAChB;;"}
@@ -0,0 +1,36 @@
1
+ 'use client';
2
+ import * as React from 'react';
3
+
4
+ function useMergeRefs(refs) {
5
+ const cleanup = React.useRef(void 0);
6
+ return React.useMemo(
7
+ () => {
8
+ if (refs.every((ref) => ref == null)) return null;
9
+ return (instance) => {
10
+ cleanup.current?.();
11
+ cleanup.current = void 0;
12
+ if (instance == null) return;
13
+ const cleanups = refs.map((ref) => setRef(ref, instance));
14
+ cleanup.current = () => cleanups.forEach((refCleanup) => refCleanup?.());
15
+ };
16
+ },
17
+ // The refs are the dependencies, and each caller passes the same number of them on every render.
18
+ // eslint-disable-next-line react-hooks/exhaustive-deps
19
+ refs
20
+ );
21
+ }
22
+ function setRef(ref, instance) {
23
+ if (ref == null) return void 0;
24
+ if (typeof ref === "function") {
25
+ const refCleanup = ref(instance);
26
+ return typeof refCleanup === "function" ? refCleanup : () => ref(null);
27
+ }
28
+ const objectRef = ref;
29
+ objectRef.current = instance;
30
+ return () => {
31
+ objectRef.current = null;
32
+ };
33
+ }
34
+
35
+ export { useMergeRefs };
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../src/utils/useMergeRefs/index.ts"],"sourcesContent":["import * as React from 'react';\n\ntype Cleanup = () => void;\n\n/**\n * One callback ref that sets every ref given, or `null` when none is set: `ref={useMergeRefs([inputRef, ref])}`. It\n * keeps its identity while the refs do. A callback ref that returns a cleanup (React 19) gets it run when the element\n * goes; any other one is called with `null`.\n *\n * Roaster's own, not Floating UI's: Floating UI ships as one file, so importing this hook from it put the whole\n * library in the first load of every app with a Button, beside any component that needs the rest, such as ActionList.\n */\nexport function useMergeRefs<T>(refs: Array<React.Ref<T> | undefined>): React.RefCallback<T> | null {\n const cleanup = React.useRef<Cleanup | undefined>(undefined);\n\n return React.useMemo(\n () => {\n if (refs.every((ref) => ref == null)) return null;\n return (instance: T | null) => {\n cleanup.current?.();\n cleanup.current = undefined;\n if (instance == null) return;\n const cleanups = refs.map((ref) => setRef(ref, instance));\n cleanup.current = () => cleanups.forEach((refCleanup) => refCleanup?.());\n };\n },\n // The refs are the dependencies, and each caller passes the same number of them on every render.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n refs\n );\n}\n\nfunction setRef<T>(ref: React.Ref<T> | undefined, instance: T): Cleanup | undefined {\n if (ref == null) return undefined;\n if (typeof ref === 'function') {\n const refCleanup: unknown = ref(instance);\n return typeof refCleanup === 'function' ? (refCleanup as Cleanup) : () => ref(null);\n }\n const objectRef = ref as React.MutableRefObject<T | null>;\n objectRef.current = instance;\n return () => {\n objectRef.current = null;\n };\n}\n"],"names":[],"mappings":";;;AAEO,SAAS,YAAY,CAAC,IAAI,EAAE;AACnC,EAAE,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;AACtC,EAAE,OAAO,KAAK,CAAC,OAAO;AACtB,IAAI,MAAM;AACV,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,IAAI,CAAC,EAAE,OAAO,IAAI;AACvD,MAAM,OAAO,CAAC,QAAQ,KAAK;AAC3B,QAAQ,OAAO,CAAC,OAAO,IAAI;AAC3B,QAAQ,OAAO,CAAC,OAAO,GAAG,MAAM;AAChC,QAAQ,IAAI,QAAQ,IAAI,IAAI,EAAE;AAC9B,QAAQ,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AACjE,QAAQ,OAAO,CAAC,OAAO,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,KAAK,UAAU,IAAI,CAAC;AAChF,MAAM,CAAC;AACP,IAAI,CAAC;AACL;AACA;AACA,IAAI;AACJ,GAAG;AACH;AACA,SAAS,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE;AAC/B,EAAE,IAAI,GAAG,IAAI,IAAI,EAAE,OAAO,MAAM;AAChC,EAAE,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;AACjC,IAAI,MAAM,UAAU,GAAG,GAAG,CAAC,QAAQ,CAAC;AACpC,IAAI,OAAO,OAAO,UAAU,KAAK,UAAU,GAAG,UAAU,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC;AAC1E,EAAE;AACF,EAAE,MAAM,SAAS,GAAG,GAAG;AACvB,EAAE,SAAS,CAAC,OAAO,GAAG,QAAQ;AAC9B,EAAE,OAAO,MAAM;AACf,IAAI,SAAS,CAAC,OAAO,GAAG,IAAI;AAC5B,EAAE,CAAC;AACH;;"}
@@ -1,7 +1,10 @@
1
1
  import * as React from 'react';
2
2
  /** Every native `<button>` prop (`onClick`, `disabled`, ...) is accepted and forwarded to the item. */
3
3
  export interface ActionListItemProps extends React.ComponentPropsWithoutRef<'button'> {
4
- /** The text of the item, with an optional icon. */
4
+ /**
5
+ * The text of the item, with an optional icon. An icon after the text goes to the item's end, with the text in a
6
+ * `<span>`: `<span>Privacy</span><i className="fa-regular fa-arrow-up-right-from-square" aria-hidden="true" />`.
7
+ */
5
8
  children: React.ReactNode;
6
9
  /** `danger` for a destructive action, such as deleting or logging out. */
7
10
  tone?: 'danger';
@@ -1 +1 @@
1
- {"version":3,"file":"ActionListItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/ActionList/components/ActionListItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,uGAAuG;AACvG,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC;IACnF,mDAAmD;IACnD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,0EAA0E;IAC1E,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,sHAAsH;IACtH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,+FAsD1B,CAAC"}
1
+ {"version":3,"file":"ActionListItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/ActionList/components/ActionListItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,uGAAuG;AACvG,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC;IACnF;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,0EAA0E;IAC1E,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,sHAAsH;IACtH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,+FAwD1B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionListSearch.d.ts","sourceRoot":"","sources":["../../../../../src/components/ActionList/components/ActionListSearch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;;GAGG;AACH,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5G,gFAAgF;IAChF,YAAY,EAAE,MAAM,CAAC;IACrB,kFAAkF;IAClF,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,+BAA+B;IAC/B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,gGA0C5B,CAAC"}
1
+ {"version":3,"file":"ActionListSearch.d.ts","sourceRoot":"","sources":["../../../../../src/components/ActionList/components/ActionListSearch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;GAGG;AACH,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5G,gFAAgF;IAChF,YAAY,EAAE,MAAM,CAAC;IACrB,kFAAkF;IAClF,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,+BAA+B;IAC/B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,gGA8D5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionListSubmenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/ActionList/components/ActionListSubmenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EAWf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,iGAAiG;AACjG,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;IACxG,wEAAwE;IACxE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,2EAA2E;IAC3E,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,kGA6G7B,CAAC"}
1
+ {"version":3,"file":"ActionListSubmenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/ActionList/components/ActionListSubmenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EAUf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,iGAAiG;AACjG,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;IACxG,wEAAwE;IACxE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,2EAA2E;IAC3E,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,kGA6G7B,CAAC"}
@@ -19,7 +19,11 @@ export interface MainframeProps extends React.ComponentPropsWithoutRef<'div'> {
19
19
  export declare const Mainframe: React.ForwardRefExoticComponent<MainframeProps & React.RefAttributes<HTMLDivElement>>;
20
20
  /** Every native `<header>` prop is accepted and forwarded to it. */
21
21
  export interface HeaderMenuProps extends React.ComponentPropsWithoutRef<'header'> {
22
- /** The bar's content: a way back (breadcrumbs), the logo, the account menu. */
22
+ /**
23
+ * The bar's content: a way back (breadcrumbs), the logo, the account menu. The account opens from a `Button` with a
24
+ * small `Avatar`, the name and a chevron, or from the picture alone, as in the TopBar:
25
+ * `<button className="roaster-top-bar__account">` with an `Avatar`.
26
+ */
23
27
  children?: React.ReactNode;
24
28
  }
25
29
  /** The sticky bar at the top of pages without a sidebar. */
@@ -1 +1 @@
1
- {"version":3,"file":"AppFrame.d.ts","sourceRoot":"","sources":["../../../../src/components/AppFrame/AppFrame.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,iEAAiE;AACjE,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;AAEhE,2FAA2F;AAC3F,eAAO,MAAM,MAAM,mKAEjB,CAAC;AAGH,iEAAiE;AACjE,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IAC3E,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,+EAA+E;IAC/E,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,oGAAoG;AACpG,eAAO,MAAM,SAAS,uFAWrB,CAAC;AAGF,oEAAoE;AACpE,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC;IAC/E,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,K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MAAM,SAAS,uFAWrB,CAAC;AAGF,oEAAoE;AACpE,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC;IAC/E;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,4DAA4D;AAC5D,eAAO,MAAM,UAAU,qFAErB,CAAC;AAGH,oEAAoE;AACpE,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC1F,sHAAsH;IACtH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,wHAAwH;IACxH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wGAAwG;AACxG,eAAO,MAAM,MAAM,iFAQlB,CAAC;AAGF,oEAAoE;AACpE,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC;IAC3E,iGAAiG;IACjG,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,+CAA+C;AAC/C,eAAO,MAAM,MAAM,iFAEjB,CAAC"}
@@ -12,7 +12,10 @@ export interface AvatarProps extends React.ComponentPropsWithoutRef<'span'> {
12
12
  name: string;
13
13
  /** The width and height, in pixels, or `small` (28px, such as in a list's rows). */
14
14
  size?: number | 'small';
15
- /** The letters shown without a picture, such as two initials. The first letter of `name` by default. */
15
+ /**
16
+ * The letters shown without a picture, such as two initials, as written: a brand's lower-case "k" stays one. The first
17
+ * letter of `name`, in capitals, by default.
18
+ */
16
19
  initials?: string;
17
20
  /** Fills the initials in one of seven colors, so that neighbors differ, or in gray (`neutral`), for no one. */
18
21
  tint?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 'neutral';
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/Avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,kGAAkG;AAClG,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC;IACzE,4GAA4G;IAC5G,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,wGAAwG;IACxG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+GAA+G;IAC/G,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAC7C,kGAAkG;IAClG,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,mFAAmF;IACnF,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB;AAED,wGAAwG;AACxG,eAAO,MAAM,MAAM,qFAiClB,CAAC"}
1
+ {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/Avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,kGAAkG;AAClG,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC;IACzE,4GAA4G;IAC5G,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+GAA+G;IAC/G,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAC7C,kGAAkG;IAClG,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,mFAAmF;IACnF,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB;AAED,wGAAwG;AACxG,eAAO,MAAM,MAAM,qFAiClB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  interface ButtonIconBaseProps extends Omit<React.ComponentPropsWithoutRef<'button'>, 'aria-label' | 'aria-labelledby'> {
3
- /** The icon, such as `<Icon name="xmark" />`. */
3
+ /** The icon, such as Roaster's cross: `<i className="roaster-icon roaster-icon--x" aria-hidden="true" />`. */
4
4
  children: React.ReactNode;
5
5
  /**
6
6
  * The size of the icon: `small` (alerts, toasts, tags) or `medium` (modals).
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/ButtonIcon/ButtonIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,UAAU,mBAAoB,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,YAAY,GAAG,iBAAiB,CAAC;IACpH,iDAAiD;IACjD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAC/C,CAAC;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEhH,mHAAmH;AACnH,eAAO,MAAM,UAAU,2FAarB,CAAC"}
1
+ {"version":3,"file":"ButtonIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/ButtonIcon/ButtonIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,UAAU,mBAAoB,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,YAAY,GAAG,iBAAiB,CAAC;IACpH,8GAA8G;IAC9G,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAC/C,CAAC;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEhH,mHAAmH;AACnH,eAAO,MAAM,UAAU,2FAarB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACpG,8FAA8F;IAC9F,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,6DAA6D;IAC7D,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,oFAAoF;IACpF,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,+EAA+E;IAC/E,OAAO,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC7B,wFAAwF;IACxF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,4EAA4E;IAC5E,eAAe,CAAC,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1C;AAmFD;;;GAGG;AACH,eAAO,MAAM,QAAQ;;CAAwD,CAAC"}
1
+ {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACpG,8FAA8F;IAC9F,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,6DAA6D;IAC7D,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,oFAAoF;IACpF,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,+EAA+E;IAC/E,OAAO,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC7B,wFAAwF;IACxF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,4EAA4E;IAC5E,eAAe,CAAC,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1C;AAmFD;;;GAGG;AACH,eAAO,MAAM,QAAQ;;CAAwD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ColorField.d.ts","sourceRoot":"","sources":["../../../../src/components/ColorField/ColorField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAQzE,wDAAwD;AACxD,MAAM,WAAW,gBAAgB;IAC/B,kFAAkF;IAClF,GAAG,EAAE,MAAM,CAAC;CACb;AAID;;;GAGG;AACH,MAAM,WAAW,eACf,SAAQ,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,OAAO,CAAC;IACrG,uFAAuF;IACvF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wGAAwG;IACxG,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,oDAAoD;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACpC;AAED,2EAA2E;AAC3E,eAAO,MAAM,UAAU,0FAyErB,CAAC"}
1
+ {"version":3,"file":"ColorField.d.ts","sourceRoot":"","sources":["../../../../src/components/ColorField/ColorField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAQzE,wDAAwD;AACxD,MAAM,WAAW,gBAAgB;IAC/B,kFAAkF;IAClF,GAAG,EAAE,MAAM,CAAC;CACb;AAID;;;GAGG;AACH,MAAM,WAAW,eACf,SAAQ,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG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AAoB,GAAG,MAAM,CAAC;IAClD,qEAAqE;IACrE,aAAa,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,2CAA2C;IAC3C,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B,oDAAoD;IACpD,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACpB,sFAAsF;IACtF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CAClC;AAgLD;;;GAGG;AACH,eAAO,MAAM,UAAU;;CAA+C,CAAC"}
@@ -350,10 +350,11 @@ export declare function pickCalendarProps(props: DatePickerProps): {
350
350
  readOnly?: boolean | undefined | undefined;
351
351
  required?: boolean | undefined | undefined;
352
352
  src?: string | undefined | undefined;
353
+ error?: import("react").ReactNode;
353
354
  variant?: "plain" | undefined;
354
355
  suffix?: import("react").ReactNode;
355
- error?: import("react").ReactNode;
356
356
  description?: import("react").ReactNode;
357
+ keepDescription?: boolean | undefined;
357
358
  rightSection?: import("react").ReactNode;
358
359
  };
359
360
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/DatePicker/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAGvE,eAAO,MAAM,QAAQ,EAAE,MAAM,EAA0B,CAAC;AAExD,uEAAuE;AACvE,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAErD,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,YA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AAyH;AACzH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAGnD;AAED,8CAA8C;AAC9C,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,GAAE,YAAgB,QAErE;AAED,6CAA6C;AAC7C,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,GAAE,YAAgB,QAEnE;AAED,qEAAqE;AACrE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,SAAU,UAIpD"}
@@ -6,10 +6,16 @@ export interface FieldBaseProps {
6
6
  /** Help text shown under the control. */
7
7
  description?: React.ReactNode;
8
8
  /**
9
- * An error shown under the control, in place of the help text. It also marks the control as invalid; `true` marks it
10
- * invalid without a message.
9
+ * An error shown under the control, in place of the help text unless `keepDescription`. It also marks the control as
10
+ * invalid; `true` marks it invalid without a message.
11
11
  */
12
12
  error?: React.ReactNode;
13
+ /**
14
+ * Keeps the help text when there is an error, which then shows under it: for help that stays useful while the value
15
+ * is wrong, such as the format it needs. A count of the characters goes in a Textarea's `footer`.
16
+ * @defaultValue false
17
+ */
18
+ keepDescription?: boolean;
13
19
  /** Classes added to the field's wrapper (the label, the control and the text under it). */
14
20
  className?: string;
15
21
  /** Styles added to the field's wrapper. */
@@ -32,16 +38,16 @@ export interface ControlAriaProps {
32
38
  }
33
39
  /**
34
40
  * The props that tie a control to its field: its id, `aria-invalid` when there is an error, and `aria-describedby`
35
- * pointing at the help text or error (after any the control already has). The label names it through `for`.
41
+ * pointing at the help text, the error, or both (after any the control already has). The label names it through `for`.
36
42
  */
37
- export declare function fieldControlProps(controlId: string, { description, error }: Pick<FieldBaseProps, 'label' | 'description' | 'error'>, ariaProps?: ControlAriaProps): {
43
+ export declare function fieldControlProps(controlId: string, messages: Pick<FieldBaseProps, 'label' | 'description' | 'error' | 'keepDescription'>, ariaProps?: ControlAriaProps): {
38
44
  id: string;
39
45
  'aria-invalid': boolean | undefined;
40
46
  'aria-describedby': string | undefined;
41
47
  };
42
48
  /**
43
- * The frame of a form field: the label, the control, and the help text or error under it. Each field renders one,
44
- * and passes `fieldControlProps` to its control.
49
+ * The frame of a form field: the label, the control, and the help text or error under it, or both. Each field renders
50
+ * one, and passes `fieldControlProps` to its control.
45
51
  */
46
- export declare function Field({ controlId, label, description, error, inline, className, style, children }: FieldProps): React.JSX.Element;
52
+ export declare function Field({ controlId, label, description, error, keepDescription, inline, className, style, children, }: FieldProps): React.JSX.Element;
47
53
  //# sourceMappingURL=Field.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../../src/components/Field/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,yEAAyE;AACzE,MAAM,WAAW,cAAc;IAC7B,yCAAyC;IACzC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,yCAAyC;IACzC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,2FAA2F;IAC3F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,8EAA8E;AAC9E,MAAM,WAAW,gBAAgB;IAC/B,iHAAiH;IACjH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,UAAW,SAAQ,cAAc,EAAE,gBAAgB;IAClE,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,wGAAwG;IACxG,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAMD,wEAAwE;AACxE,MAAM,WAAW,gBAAgB;IAC/B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EA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S,EAAE,MAAM,EACjB,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,aAAa,GAAG,OAAO,GAAG,iBAAiB,CAAC,EACrF,SAAS,GAAE,gBAAqB;;;;EAQjC;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,EACpB,SAAS,EACT,KAAK,EACL,WAAW,EACX,KAAK,EACL,eAAe,EACf,MAAM,EACN,SAAS,EACT,KAAK,EACL,QAAQ,GACT,EAAE,UAAU,qBAsBZ"}
@@ -1 +1 @@
1
- {"version":3,"file":"FileField.d.ts","sourceRoot":"","sources":["../../../../src/components/FileField/FileField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAGzE;;;GAGG;AACH,MAAM,WAAW,cACf,SACE,cAAc,EACd,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,cAAc,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,CAAC;IACnH,6FAA6F;IAC7F,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,0FAA0F;IAC1F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6GAA6G;IAC7G,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;OAGG;IACH,aAAa,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IACpC;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,oDAAoD;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;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AK,CAAC,SAAS,CAAC;CACxB;AAED,uDAAuD;AACvD,MAAM,WAAW,eAAe;IAC9B,yBAAyB;IACzB,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,+DAA+D;IAC/D,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB;AAwDD,uFAAuF;AACvF,eAAO,MAAM,SAAS,yFA2EpB,CAAC"}
@@ -1,5 +1,9 @@
1
1
  import * as React from 'react';
2
- /** Every native `<i>` prop (`id`, `data-*`, ...) is accepted and forwarded to it. */
2
+ /**
3
+ * Every native `<i>` prop (`id`, `data-*`, ...) is accepted and forwarded to it.
4
+ *
5
+ * @deprecated `Icon` is deprecated: pass your icon set's own element.
6
+ */
3
7
  export interface IconProps extends Omit<React.ComponentPropsWithoutRef<'i'>, 'children'> {
4
8
  /** The Font Awesome icon's name, without its `fa-` prefix: `xmark`, `circle-info`. */
5
9
  name: string;
@@ -10,8 +14,15 @@ export interface IconProps extends Omit<React.ComponentPropsWithoutRef<'i'>, 'ch
10
14
  label?: string;
11
15
  }
12
16
  /**
13
- * A Font Awesome icon, in the regular style: `<Icon name="xmark" />`. It needs `fontawesome.css` from the CDN. Use
17
+ * Deprecated: pass your icon set's own element instead, such as Font Awesome's
18
+ * `<i className="fa-regular fa-house" aria-hidden="true" />`. Roaster's components draw their own icons, and an app's
19
+ * icons are the app's, from the icon set it loads.
20
+ *
21
+ * A Font Awesome icon, in the regular style: `<Icon name="house" />`. It needs Font Awesome, which the app loads. Use
14
22
  * `IconBadge` for an icon on a colored, rounded background.
23
+ *
24
+ * @deprecated Pass your icon set's own element instead, such as Font Awesome's
25
+ * `<i className="fa-regular fa-house" aria-hidden="true" />`.
15
26
  */
16
27
  export declare const Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<HTMLElement>>;
17
28
  //# sourceMappingURL=Icon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,qFAAqF;AACrF,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC;IACtF,sFAAsF;IACtF,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,+EAOf,CAAC"}
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;;;GAIG;AACH,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC;IACtF,sFAAsF;IACtF,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,IAAI,+EAOf,CAAC"}
@@ -0,0 +1,13 @@
1
+ /** The icons Roaster draws, each a `roaster-icon--<name>` class of roaster.css: Lucide's, by their Lucide names. */
2
+ export type RoasterIconName = 'x' | 'check' | 'chevron-up' | 'chevron-down' | 'chevron-left' | 'chevron-right' | 'arrow-up' | 'arrow-down' | 'arrow-left' | 'arrow-right' | 'info' | 'menu' | 'image' | 'file-spreadsheet' | 'upload' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'link' | 'list' | 'list-ordered' | 'heading-1' | 'heading-2' | 'heading-3' | 'square-pen' | 'save' | 'trash';
3
+ export interface RoasterIconProps {
4
+ name: RoasterIconName;
5
+ className?: string;
6
+ }
7
+ /**
8
+ * One of the icons Roaster's components draw, such as a close button's cross: `<RoasterIcon name="x" />`. It needs no
9
+ * icon font, and is hidden from screen readers, as the control around it is named. Internal: an app's own icons go
10
+ * through `Icon`.
11
+ */
12
+ export declare function RoasterIcon({ name, className }: RoasterIconProps): import("react").JSX.Element;
13
+ //# sourceMappingURL=RoasterIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RoasterIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/Icon/RoasterIcon.tsx"],"names":[],"mappings":"AAEA,oHAAoH;AACpH,MAAM,MAAM,eAAe,GACvB,GAAG,GACH,OAAO,GACP,YAAY,GACZ,cAAc,GACd,cAAc,GACd,eAAe,GACf,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,aAAa,GACb,MAAM,GACN,MAAM,GACN,OAAO,GACP,kBAAkB,GAClB,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,WAAW,GACX,eAAe,GACf,MAAM,GACN,MAAM,GACN,cAAc,GACd,WAAW,GACX,WAAW,GACX,WAAW,GACX,YAAY,GACZ,MAAM,GACN,OAAO,CAAC;AAEZ,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,eAAe,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,gBAAgB,+BAEhE"}