@trellixio/roaster-react 2.1.2 → 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 (102) 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/ActionListItem.js +3 -2
  5. package/cjs/components/ActionList/components/ActionListItem.js.map +1 -1
  6. package/cjs/components/ActionList/components/ActionListSubmenu.js +3 -2
  7. package/cjs/components/ActionList/components/ActionListSubmenu.js.map +1 -1
  8. package/cjs/components/Alert/Alert.js +3 -2
  9. package/cjs/components/Alert/Alert.js.map +1 -1
  10. package/cjs/components/Button/Button.js +3 -2
  11. package/cjs/components/Button/Button.js.map +1 -1
  12. package/cjs/components/ButtonIcon/ButtonIcon.js.map +1 -1
  13. package/cjs/components/DatePicker/components/Calendar/Calendar.js +4 -3
  14. package/cjs/components/DatePicker/components/Calendar/Calendar.js.map +1 -1
  15. package/cjs/components/DropdownCard/components/DropdownCardTabs.js +3 -2
  16. package/cjs/components/DropdownCard/components/DropdownCardTabs.js.map +1 -1
  17. package/cjs/components/FileField/FileField.js +6 -5
  18. package/cjs/components/FileField/FileField.js.map +1 -1
  19. package/cjs/components/Icon/Icon.js.map +1 -1
  20. package/cjs/components/Icon/RoasterIcon.js +12 -0
  21. package/cjs/components/Icon/RoasterIcon.js.map +1 -0
  22. package/cjs/components/IconBadge/IconBadge.js.map +1 -1
  23. package/cjs/components/Modal/Modal.js +3 -2
  24. package/cjs/components/Modal/Modal.js.map +1 -1
  25. package/cjs/components/Pagination/Pagination.js +4 -3
  26. package/cjs/components/Pagination/Pagination.js.map +1 -1
  27. package/cjs/components/Sidebar/Sidebar.js +4 -3
  28. package/cjs/components/Sidebar/Sidebar.js.map +1 -1
  29. package/cjs/components/Sidebar/components/Back.js +7 -3
  30. package/cjs/components/Sidebar/components/Back.js.map +1 -1
  31. package/cjs/components/StatCard/StatCard.js +3 -2
  32. package/cjs/components/StatCard/StatCard.js.map +1 -1
  33. package/cjs/components/Table/components/TableHeadCell.js +4 -3
  34. package/cjs/components/Table/components/TableHeadCell.js.map +1 -1
  35. package/cjs/components/Tag/Tag.js +3 -2
  36. package/cjs/components/Tag/Tag.js.map +1 -1
  37. package/cjs/components/Thumbnail/Thumbnail.js +3 -2
  38. package/cjs/components/Thumbnail/Thumbnail.js.map +1 -1
  39. package/cjs/components/Toast/Toast.js +3 -2
  40. package/cjs/components/Toast/Toast.js.map +1 -1
  41. package/cjs/components/Tooltip/TooltipCallout.js +3 -2
  42. package/cjs/components/Tooltip/TooltipCallout.js.map +1 -1
  43. package/cjs/components/Visualizer/Visualizer.js +4 -3
  44. package/cjs/components/Visualizer/Visualizer.js.map +1 -1
  45. package/esm/components/ActionList/components/ActionListItem.js +3 -2
  46. package/esm/components/ActionList/components/ActionListItem.js.map +1 -1
  47. package/esm/components/ActionList/components/ActionListSubmenu.js +3 -2
  48. package/esm/components/ActionList/components/ActionListSubmenu.js.map +1 -1
  49. package/esm/components/Alert/Alert.js +3 -2
  50. package/esm/components/Alert/Alert.js.map +1 -1
  51. package/esm/components/Button/Button.js +3 -2
  52. package/esm/components/Button/Button.js.map +1 -1
  53. package/esm/components/ButtonIcon/ButtonIcon.js.map +1 -1
  54. package/esm/components/DatePicker/components/Calendar/Calendar.js +4 -3
  55. package/esm/components/DatePicker/components/Calendar/Calendar.js.map +1 -1
  56. package/esm/components/DropdownCard/components/DropdownCardTabs.js +3 -2
  57. package/esm/components/DropdownCard/components/DropdownCardTabs.js.map +1 -1
  58. package/esm/components/FileField/FileField.js +6 -5
  59. package/esm/components/FileField/FileField.js.map +1 -1
  60. package/esm/components/Icon/Icon.js.map +1 -1
  61. package/esm/components/Icon/RoasterIcon.js +10 -0
  62. package/esm/components/Icon/RoasterIcon.js.map +1 -0
  63. package/esm/components/IconBadge/IconBadge.js.map +1 -1
  64. package/esm/components/Modal/Modal.js +3 -2
  65. package/esm/components/Modal/Modal.js.map +1 -1
  66. package/esm/components/Pagination/Pagination.js +4 -3
  67. package/esm/components/Pagination/Pagination.js.map +1 -1
  68. package/esm/components/Sidebar/Sidebar.js +4 -3
  69. package/esm/components/Sidebar/Sidebar.js.map +1 -1
  70. package/esm/components/Sidebar/components/Back.js +7 -3
  71. package/esm/components/Sidebar/components/Back.js.map +1 -1
  72. package/esm/components/StatCard/StatCard.js +3 -2
  73. package/esm/components/StatCard/StatCard.js.map +1 -1
  74. package/esm/components/Table/components/TableHeadCell.js +4 -3
  75. package/esm/components/Table/components/TableHeadCell.js.map +1 -1
  76. package/esm/components/Tag/Tag.js +3 -2
  77. package/esm/components/Tag/Tag.js.map +1 -1
  78. package/esm/components/Thumbnail/Thumbnail.js +3 -2
  79. package/esm/components/Thumbnail/Thumbnail.js.map +1 -1
  80. package/esm/components/Toast/Toast.js +3 -2
  81. package/esm/components/Toast/Toast.js.map +1 -1
  82. package/esm/components/Tooltip/TooltipCallout.js +3 -2
  83. package/esm/components/Tooltip/TooltipCallout.js.map +1 -1
  84. package/esm/components/Visualizer/Visualizer.js +4 -3
  85. package/esm/components/Visualizer/Visualizer.js.map +1 -1
  86. package/lib/components/ActionList/components/ActionListItem.d.ts +1 -1
  87. package/lib/components/ActionList/components/ActionListItem.d.ts.map +1 -1
  88. package/lib/components/ButtonIcon/ButtonIcon.d.ts +1 -1
  89. package/lib/components/ButtonIcon/ButtonIcon.d.ts.map +1 -1
  90. package/lib/components/Icon/Icon.d.ts +13 -2
  91. package/lib/components/Icon/Icon.d.ts.map +1 -1
  92. package/lib/components/Icon/RoasterIcon.d.ts +13 -0
  93. package/lib/components/Icon/RoasterIcon.d.ts.map +1 -0
  94. package/lib/components/Icon/index.d.ts +2 -0
  95. package/lib/components/Icon/index.d.ts.map +1 -1
  96. package/lib/components/IconBadge/IconBadge.d.ts +2 -2
  97. package/lib/components/Sidebar/components/Back.d.ts.map +1 -1
  98. package/package.json +2 -2
  99. package/roaster.css +2 -1
  100. package/themes/azoth.css +1 -1
  101. package/themes/coffee.css +1 -1
  102. package/themes/scalar.css +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Sidebar.js","sources":["../../../../src/components/Sidebar/Sidebar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useUid } from '@/utils';\nimport { Button } from '../Button';\nimport { Icon } from '@/components/Icon';\nimport { Section } from './components/Section';\nimport { Menu } from './components/Menu';\nimport type { MenuItemProps } from './components/MenuItem';\nimport { Back } from './components/Back';\n\n/** An item of the sidebar. Its other props (`href`, `onClick`...) go to its link. */\nexport interface SidebarItemProps extends Omit<MenuItemProps, 'children' | 'current'> {\n /** The text of the item. */\n label: React.ReactNode;\n /** The item's path: it is the current page when it matches `activePath`, and is passed to `onMenuItemClick`. */\n pathname?: string;\n /** The items under it, in a sub-menu that opens and closes. */\n subMenu?: SidebarItemProps[];\n}\n\n/** A labeled section of the sidebar, such as \"Company\" or \"Team\": a label over its items. */\nexport interface SidebarSection {\n /** The label, over the items. */\n title: React.ReactNode;\n /** A small button at the label's end, such as one that adds an item. */\n action?: React.ReactNode;\n /** The items of the section. */\n items: SidebarItemProps[];\n}\n\nconst isSection = (entry: SidebarItemProps | SidebarItemProps[] | SidebarSection): entry is SidebarSection =>\n !Array.isArray(entry) && 'items' in entry && 'title' in entry;\n\n/** The text of the sidebar, for other languages. */\nexport interface SidebarLabels {\n /** The name of the navigation, read by screen readers. */\n navigation: string;\n /** The name of the button that opens the sidebar where it is a drawer (up to 1024px). */\n open: string;\n /** The name of the button that closes it there. */\n close: string;\n}\n\nconst defaultSidebarLabels: SidebarLabels = { navigation: 'Main', open: 'Open the menu', close: 'Close the menu' };\n\n/** Every native `<aside>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to it. */\nexport interface SidebarProps extends React.ComponentPropsWithoutRef<'aside'> {\n /** The top of the sidebar: the logo, buttons. */\n header?: React.ReactNode;\n /** The bottom of the sidebar: settings, the account. */\n footer?: React.ReactNode;\n /** The path of the current page: its item gets `aria-current=\"page\"`, and its sub-menu starts open. */\n activePath?: string;\n /** Next to the button that opens the sidebar where it is a drawer, such as the logo. */\n mobileHeader?: React.ReactNode;\n /**\n * The items. An array of items is a group, set apart from the next by a line or room; a section (`{ title, items }`)\n * is a group with a label over it.\n */\n items: (SidebarItemProps | SidebarItemProps[] | SidebarSection)[];\n /** Called when an item is clicked, with its pathname. */\n onMenuItemClick?: ({ itemId }: { itemId: string }) => void;\n /** The text of the sidebar, in English by default. */\n labels?: Partial<SidebarLabels>;\n}\n\nconst keyOf = (item: SidebarItemProps, index: number) => item.pathname ?? `item-${index}`;\n\nconst SidebarBase = React.forwardRef<HTMLElement, SidebarProps>((props, ref) => {\n const { mobileHeader, header, footer, activePath, onMenuItemClick, items, labels, className, id, ...others } = props;\n const text = { ...defaultSidebarLabels, ...labels };\n const sidebarId = useUid(id);\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\n // Whether the drawer is open, for the opener's aria-expanded. The browser opens and closes it (popover).\n const [drawerOpen, setDrawerOpen] = React.useState(false);\n React.useEffect(() => {\n const panel = panelRef.current;\n const onToggle = (event: Event) => setDrawerOpen((event as ToggleEvent).newState === 'open');\n panel?.addEventListener('toggle', onToggle);\n return () => panel?.removeEventListener('toggle', onToggle);\n }, []);\n\n // The open sub-menus, by pathname: the current page's opens with it.\n const groupOf = React.useCallback(\n (path: string | undefined) =>\n items\n .flatMap((entry) => (isSection(entry) ? entry.items : entry))\n .find((item) => item.subMenu?.some((sub) => sub.pathname === path) || (item.subMenu && item.pathname === path))\n ?.pathname,\n [items]\n );\n const [openGroups, setOpenGroups] = React.useState(() => new Set([groupOf(activePath)].filter(Boolean)));\n React.useEffect(() => {\n const group = groupOf(activePath);\n if (group) setOpenGroups((open) => (open.has(group) ? open : new Set([...open, group])));\n }, [activePath, groupOf]);\n\n function onItemClick(item: SidebarItemProps) {\n if (item.pathname !== undefined) onMenuItemClick?.({ itemId: item.pathname });\n // Where the sidebar is a drawer, choosing a page closes it.\n if (!item.subMenu?.length && drawerOpen) panelRef.current?.hidePopover?.();\n }\n\n function renderItem(item: SidebarItemProps, index: number) {\n const { pathname, subMenu, icon, label, onClick, action, suffix, detail, ...linkProps } = item;\n if (subMenu && subMenu.length > 0) {\n const groupKey = keyOf(item, index);\n return (\n <li key={groupKey}>\n <details\n className=\"roaster-sidebar__group\"\n open={openGroups.has(groupKey)}\n onToggle={(event) => {\n const isOpen = event.currentTarget.open;\n setOpenGroups((open) => {\n if (open.has(groupKey) === isOpen) return open;\n const next = new Set(open);\n if (isOpen) next.add(groupKey);\n else next.delete(groupKey);\n return next;\n });\n }}\n >\n <summary className=\"roaster-sidebar__item\" onClick={() => onItemClick(item)}>\n {icon && <span className=\"roaster-sidebar__icon\">{icon}</span>}\n {label}\n {suffix != null && <span className=\"roaster-sidebar__end\">{suffix}</span>}\n {action && <span className=\"roaster-sidebar__end\">{action}</span>}\n </summary>\n <Menu.SubMenu>{subMenu.map((sub, subIndex) => renderItem(sub, subIndex))}</Menu.SubMenu>\n </details>\n </li>\n );\n }\n return (\n <Menu.Item\n key={keyOf(item, index)}\n {...linkProps}\n icon={icon}\n action={action}\n suffix={suffix}\n detail={detail}\n current={pathname !== undefined && pathname === activePath}\n onClick={(event) => {\n onClick?.(event);\n onItemClick(item);\n }}\n >\n {label}\n </Menu.Item>\n );\n }\n\n // `popover` isn't in React 18's types.\n const popover = { popover: 'auto' } as React.HTMLAttributes<HTMLElement>;\n\n return (\n <>\n <div className=\"roaster-sidebar-opener\">\n <Button\n variant=\"ghost\"\n iconOnly\n aria-label={text.open}\n aria-controls={sidebarId}\n aria-expanded={drawerOpen}\n onClick={() => panelRef.current?.showPopover?.()}\n >\n <Icon name=\"bars\" />\n </Button>\n {mobileHeader}\n </div>\n\n <aside {...others} {...popover} id={sidebarId} ref={setRefs} className={classNames('roaster-sidebar', className)}>\n <Button\n variant=\"secondary\"\n iconOnly\n className=\"roaster-sidebar__close\"\n aria-label={text.close}\n onClick={() => panelRef.current?.hidePopover?.()}\n >\n <Icon name=\"xmark\" />\n </Button>\n <nav className=\"roaster-sidebar__nav\" aria-label={text.navigation}>\n <Section className=\"roaster-sidebar__header\">{header}</Section>\n <Section className=\"roaster-sidebar__body\">\n {items.map((item, index) =>\n isSection(item) ? (\n <section\n key={`section-${index}`}\n className=\"roaster-sidebar__section\"\n aria-labelledby={`${sidebarId}-section-${index}`}\n >\n <h2 className=\"roaster-sidebar__label\" id={`${sidebarId}-section-${index}`}>\n {item.title}\n {item.action}\n </h2>\n <Menu>{item.items.map(renderItem)}</Menu>\n </section>\n ) : Array.isArray(item) ? (\n <Menu key={`group-${keyOf(item[0] ?? { label: '' }, index)}`}>{item.map(renderItem)}</Menu>\n ) : (\n <Menu key={`group-${keyOf(item, index)}`}>{renderItem(item, index)}</Menu>\n )\n )}\n </Section>\n <Section className=\"roaster-sidebar__footer\">{footer}</Section>\n </nav>\n </aside>\n </>\n );\n});\n\nSidebarBase.displayName = 'Sidebar';\n\n/**\n * The navigation of an application: a header (the logo, or the account button with a Sidebar.Back under it), groups\n * of items with sub-menus (`<details>`), labeled sections, and a footer. The current\n * page's item has `aria-current=\"page\"`. Up to a tablet's width (1024px), it is a drawer (a popover) that a bar at the\n * top opens, with a close button beside it.\n */\nexport const Sidebar = Object.assign(SidebarBase, { Section: Section, Menu: Menu, Back: Back });\n"],"names":[],"mappings":";;;;;;;;;;;AASA,MAAM,SAAS,GAAG,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,OAAO,IAAI,KAAK,IAAI,OAAO,IAAI,KAAK;AAC1F,MAAM,oBAAoB,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,gBAAgB,EAAE;AACnG,MAAM,KAAK,GAAG,CAAC,IAAI,EAA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;AACrP,SAAS,EAAE,CAAC;AACZ,wBAAwB,GAAG,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,EAAE;AAC/F,OAAO,EAAE;AACT,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,IAAI,EAAE,IAAI,EAAE;;"}
1
+ {"version":3,"file":"Sidebar.js","sources":["../../../../src/components/Sidebar/Sidebar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useUid } from '@/utils';\nimport { Button } from '../Button';\nimport { RoasterIcon } from '@/components/Icon';\nimport { Section } from './components/Section';\nimport { Menu } from './components/Menu';\nimport type { MenuItemProps } from './components/MenuItem';\nimport { Back } from './components/Back';\n\n/** An item of the sidebar. Its other props (`href`, `onClick`...) go to its link. */\nexport interface SidebarItemProps extends Omit<MenuItemProps, 'children' | 'current'> {\n /** The text of the item. */\n label: React.ReactNode;\n /** The item's path: it is the current page when it matches `activePath`, and is passed to `onMenuItemClick`. */\n pathname?: string;\n /** The items under it, in a sub-menu that opens and closes. */\n subMenu?: SidebarItemProps[];\n}\n\n/** A labeled section of the sidebar, such as \"Company\" or \"Team\": a label over its items. */\nexport interface SidebarSection {\n /** The label, over the items. */\n title: React.ReactNode;\n /** A small button at the label's end, such as one that adds an item. */\n action?: React.ReactNode;\n /** The items of the section. */\n items: SidebarItemProps[];\n}\n\nconst isSection = (entry: SidebarItemProps | SidebarItemProps[] | SidebarSection): entry is SidebarSection =>\n !Array.isArray(entry) && 'items' in entry && 'title' in entry;\n\n/** The text of the sidebar, for other languages. */\nexport interface SidebarLabels {\n /** The name of the navigation, read by screen readers. */\n navigation: string;\n /** The name of the button that opens the sidebar where it is a drawer (up to 1024px). */\n open: string;\n /** The name of the button that closes it there. */\n close: string;\n}\n\nconst defaultSidebarLabels: SidebarLabels = { navigation: 'Main', open: 'Open the menu', close: 'Close the menu' };\n\n/** Every native `<aside>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to it. */\nexport interface SidebarProps extends React.ComponentPropsWithoutRef<'aside'> {\n /** The top of the sidebar: the logo, buttons. */\n header?: React.ReactNode;\n /** The bottom of the sidebar: settings, the account. */\n footer?: React.ReactNode;\n /** The path of the current page: its item gets `aria-current=\"page\"`, and its sub-menu starts open. */\n activePath?: string;\n /** Next to the button that opens the sidebar where it is a drawer, such as the logo. */\n mobileHeader?: React.ReactNode;\n /**\n * The items. An array of items is a group, set apart from the next by a line or room; a section (`{ title, items }`)\n * is a group with a label over it.\n */\n items: (SidebarItemProps | SidebarItemProps[] | SidebarSection)[];\n /** Called when an item is clicked, with its pathname. */\n onMenuItemClick?: ({ itemId }: { itemId: string }) => void;\n /** The text of the sidebar, in English by default. */\n labels?: Partial<SidebarLabels>;\n}\n\nconst keyOf = (item: SidebarItemProps, index: number) => item.pathname ?? `item-${index}`;\n\nconst SidebarBase = React.forwardRef<HTMLElement, SidebarProps>((props, ref) => {\n const { mobileHeader, header, footer, activePath, onMenuItemClick, items, labels, className, id, ...others } = props;\n const text = { ...defaultSidebarLabels, ...labels };\n const sidebarId = useUid(id);\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\n // Whether the drawer is open, for the opener's aria-expanded. The browser opens and closes it (popover).\n const [drawerOpen, setDrawerOpen] = React.useState(false);\n React.useEffect(() => {\n const panel = panelRef.current;\n const onToggle = (event: Event) => setDrawerOpen((event as ToggleEvent).newState === 'open');\n panel?.addEventListener('toggle', onToggle);\n return () => panel?.removeEventListener('toggle', onToggle);\n }, []);\n\n // The open sub-menus, by pathname: the current page's opens with it.\n const groupOf = React.useCallback(\n (path: string | undefined) =>\n items\n .flatMap((entry) => (isSection(entry) ? entry.items : entry))\n .find((item) => item.subMenu?.some((sub) => sub.pathname === path) || (item.subMenu && item.pathname === path))\n ?.pathname,\n [items]\n );\n const [openGroups, setOpenGroups] = React.useState(() => new Set([groupOf(activePath)].filter(Boolean)));\n React.useEffect(() => {\n const group = groupOf(activePath);\n if (group) setOpenGroups((open) => (open.has(group) ? open : new Set([...open, group])));\n }, [activePath, groupOf]);\n\n function onItemClick(item: SidebarItemProps) {\n if (item.pathname !== undefined) onMenuItemClick?.({ itemId: item.pathname });\n // Where the sidebar is a drawer, choosing a page closes it.\n if (!item.subMenu?.length && drawerOpen) panelRef.current?.hidePopover?.();\n }\n\n function renderItem(item: SidebarItemProps, index: number) {\n const { pathname, subMenu, icon, label, onClick, action, suffix, detail, ...linkProps } = item;\n if (subMenu && subMenu.length > 0) {\n const groupKey = keyOf(item, index);\n return (\n <li key={groupKey}>\n <details\n className=\"roaster-sidebar__group\"\n open={openGroups.has(groupKey)}\n onToggle={(event) => {\n const isOpen = event.currentTarget.open;\n setOpenGroups((open) => {\n if (open.has(groupKey) === isOpen) return open;\n const next = new Set(open);\n if (isOpen) next.add(groupKey);\n else next.delete(groupKey);\n return next;\n });\n }}\n >\n <summary className=\"roaster-sidebar__item\" onClick={() => onItemClick(item)}>\n {icon && <span className=\"roaster-sidebar__icon\">{icon}</span>}\n {label}\n {suffix != null && <span className=\"roaster-sidebar__end\">{suffix}</span>}\n {action && <span className=\"roaster-sidebar__end\">{action}</span>}\n </summary>\n <Menu.SubMenu>{subMenu.map((sub, subIndex) => renderItem(sub, subIndex))}</Menu.SubMenu>\n </details>\n </li>\n );\n }\n return (\n <Menu.Item\n key={keyOf(item, index)}\n {...linkProps}\n icon={icon}\n action={action}\n suffix={suffix}\n detail={detail}\n current={pathname !== undefined && pathname === activePath}\n onClick={(event) => {\n onClick?.(event);\n onItemClick(item);\n }}\n >\n {label}\n </Menu.Item>\n );\n }\n\n // `popover` isn't in React 18's types.\n const popover = { popover: 'auto' } as React.HTMLAttributes<HTMLElement>;\n\n return (\n <>\n <div className=\"roaster-sidebar-opener\">\n <Button\n variant=\"ghost\"\n iconOnly\n aria-label={text.open}\n aria-controls={sidebarId}\n aria-expanded={drawerOpen}\n onClick={() => panelRef.current?.showPopover?.()}\n >\n <RoasterIcon name=\"menu\" />\n </Button>\n {mobileHeader}\n </div>\n\n <aside {...others} {...popover} id={sidebarId} ref={setRefs} className={classNames('roaster-sidebar', className)}>\n <Button\n variant=\"secondary\"\n iconOnly\n className=\"roaster-sidebar__close\"\n aria-label={text.close}\n onClick={() => panelRef.current?.hidePopover?.()}\n >\n <RoasterIcon name=\"x\" />\n </Button>\n <nav className=\"roaster-sidebar__nav\" aria-label={text.navigation}>\n <Section className=\"roaster-sidebar__header\">{header}</Section>\n <Section className=\"roaster-sidebar__body\">\n {items.map((item, index) =>\n isSection(item) ? (\n <section\n key={`section-${index}`}\n className=\"roaster-sidebar__section\"\n aria-labelledby={`${sidebarId}-section-${index}`}\n >\n <h2 className=\"roaster-sidebar__label\" id={`${sidebarId}-section-${index}`}>\n {item.title}\n {item.action}\n </h2>\n <Menu>{item.items.map(renderItem)}</Menu>\n </section>\n ) : Array.isArray(item) ? (\n <Menu key={`group-${keyOf(item[0] ?? { label: '' }, index)}`}>{item.map(renderItem)}</Menu>\n ) : (\n <Menu key={`group-${keyOf(item, index)}`}>{renderItem(item, index)}</Menu>\n )\n )}\n </Section>\n <Section className=\"roaster-sidebar__footer\">{footer}</Section>\n </nav>\n </aside>\n </>\n );\n});\n\nSidebarBase.displayName = 'Sidebar';\n\n/**\n * The navigation of an application: a header (the logo, or the account button with a Sidebar.Back under it), groups\n * of items with sub-menus (`<details>`), labeled sections, and a footer. The current\n * page's item has `aria-current=\"page\"`. Up to a tablet's width (1024px), it is a drawer (a popover) that a bar at the\n * top opens, with a close button beside it.\n */\nexport const Sidebar = Object.assign(SidebarBase, { Section: Section, Menu: Menu, Back: Back });\n"],"names":[],"mappings":";;;;;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EAAE,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAY,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,mBAAmB,GAAG,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;AACrP,SAAS,EAAE,CAAC;AACZ,wBAAwB,GAAG,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,EAAE;AAC/F,OAAO,EAAE;AACT,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,IAAI,EAAE,IAAI,EAAE;;"}
@@ -1,7 +1,8 @@
1
1
  'use client';
2
2
  import { jsx, jsxs } 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 { classNames } from '../../../utils/classNames/index.js';
6
7
  import { Slot } from '../../../utils/Slot/index.js';
7
8
 
@@ -9,10 +10,13 @@ const Back = React.forwardRef(
9
10
  ({ children, asChild = false, className, ...others }, ref) => {
10
11
  const classes = classNames("roaster-sidebar__back", className);
11
12
  if (asChild && React.isValidElement(children)) {
12
- return /* @__PURE__ */ jsx(Slot, { ...others, ref, className: classes, children: React.cloneElement(children, void 0, [/* @__PURE__ */ jsx(Icon, { name: "chevron-left" }, "arrow"), children.props.children]) });
13
+ return /* @__PURE__ */ jsx(Slot, { ...others, ref, className: classes, children: React.cloneElement(children, void 0, [
14
+ /* @__PURE__ */ jsx(RoasterIcon, { name: "chevron-left" }, "arrow"),
15
+ children.props.children
16
+ ]) });
13
17
  }
14
18
  return /* @__PURE__ */ jsxs("a", { ...others, ref, className: classes, children: [
15
- /* @__PURE__ */ jsx(Icon, { name: "chevron-left" }),
19
+ /* @__PURE__ */ jsx(RoasterIcon, { name: "chevron-left" }),
16
20
  children
17
21
  ] });
18
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Back.js","sources":["../../../../../src/components/Sidebar/components/Back.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, Slot } from '@/utils';\nimport { Icon } from '@/components/Icon';\n\n/** Every native `<a>` prop (`href`, `onClick`, ...) is accepted and forwarded to the link. */\nexport interface BackProps extends React.ComponentPropsWithoutRef<'a'> {\n /** Where it leads back to, such as \"Settings\" for the settings' navigation. */\n children: React.ReactNode;\n /**\n * Renders the only child (a router's Link) as the link, with the arrow before its text.\n * @defaultValue false\n */\n asChild?: boolean;\n}\n\n/** The way back out of a nested navigation, such as from the settings to the app: in the header, under the account. */\nexport const Back = React.forwardRef<HTMLAnchorElement, BackProps>(\n ({ children, asChild = false, className, ...others }, ref) => {\n const classes = classNames('roaster-sidebar__back', className);\n if (asChild && React.isValidElement<{ children?: React.ReactNode }>(children)) {\n return (\n <Slot {...others} ref={ref as React.Ref<HTMLElement>} className={classes}>\n {React.cloneElement(children, undefined, [<Icon key=\"arrow\" name=\"chevron-left\" />, children.props.children])}\n </Slot>\n );\n }\n return (\n <a {...others} ref={ref} className={classes}>\n <Icon name=\"chevron-left\" />\n {children}\n </a>\n );\n }\n);\nBack.displayName = 'SidebarBack';\n"],"names":[],"mappings":";;;;;;;AAKY,MAAC,IAAI,GAAG,KAAK,CAAC,UAAU;AACpC,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,KAAK,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,KAAK;AAChE,IAAI,MAAM,OAAO,GAAG,UAAU,CAAC,uBAAuB,EAAE,SAAS,CAAC;AAClE,IAAI,IAAI,OAAO,IAAI,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;AACnD,MAAM,uBAAuB,GAAG,CAAC,IAAI,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,iBAAiB,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;AACvN,IAAI;AACJ,IAAI,uBAAuB,IAAI,CAAC,GAAG,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE;AACrF,sBAAsB,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;AACzD,MAAM;AACN,KAAK,EAAE,CAAC;AACR,EAAE;AACF;AACA,IAAI,CAAC,WAAW,GAAG,aAAa;;"}
1
+ {"version":3,"file":"Back.js","sources":["../../../../../src/components/Sidebar/components/Back.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, Slot } from '@/utils';\nimport { RoasterIcon } from '@/components/Icon';\n\n/** Every native `<a>` prop (`href`, `onClick`, ...) is accepted and forwarded to the link. */\nexport interface BackProps extends React.ComponentPropsWithoutRef<'a'> {\n /** Where it leads back to, such as \"Settings\" for the settings' navigation. */\n children: React.ReactNode;\n /**\n * Renders the only child (a router's Link) as the link, with the arrow before its text.\n * @defaultValue false\n */\n asChild?: boolean;\n}\n\n/** The way back out of a nested navigation, such as from the settings to the app: in the header, under the account. */\nexport const Back = React.forwardRef<HTMLAnchorElement, BackProps>(\n ({ children, asChild = false, className, ...others }, ref) => {\n const classes = classNames('roaster-sidebar__back', className);\n if (asChild && React.isValidElement<{ children?: React.ReactNode }>(children)) {\n return (\n <Slot {...others} ref={ref as React.Ref<HTMLElement>} className={classes}>\n {React.cloneElement(children, undefined, [\n <RoasterIcon key=\"arrow\" name=\"chevron-left\" />,\n children.props.children,\n ])}\n </Slot>\n );\n }\n return (\n <a {...others} ref={ref} className={classes}>\n <RoasterIcon name=\"chevron-left\" />\n {children}\n </a>\n );\n }\n);\nBack.displayName = 'SidebarBack';\n"],"names":[],"mappings":";;;;;;;;AAKY,MAAC,IAAI,GAAG,KAAK,CAAC,UAAU;AACpC,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,KAAK,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,KAAK;AAChE,IAAI,MAAM,OAAO,GAAG,UAAU,CAAC,uBAAuB,EAAE,SAAS,CAAC;AAClE,IAAI,IAAI,OAAO,IAAI,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;AACnD,MAAM,uBAAuB,GAAG,CAAC,IAAI,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE;AAC5H,wBAAwB,GAAG,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,OAAO,CAAC;AAC3E,QAAQ,QAAQ,CAAC,KAAK,CAAC;AACvB,OAAO,CAAC,EAAE,CAAC;AACX,IAAI;AACJ,IAAI,uBAAuB,IAAI,CAAC,GAAG,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE;AACrF,sBAAsB,GAAG,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;AAChE,MAAM;AACN,KAAK,EAAE,CAAC;AACR,EAAE;AACF;AACA,IAAI,CAAC,WAAW,GAAG,aAAa;;"}
@@ -2,7 +2,8 @@
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
4
  import { Tooltip } from '../Tooltip/Tooltip.js';
5
- import { Icon } from '../Icon/Icon.js';
5
+ import '../Icon/Icon.js';
6
+ import { RoasterIcon } from '../Icon/RoasterIcon.js';
6
7
  import { Progress } from '../Progress/Progress.js';
7
8
  import { useUid } from '../../utils/useUid/index.js';
8
9
  import { classNames } from '../../utils/classNames/index.js';
@@ -21,7 +22,7 @@ const StatCardBase = React.forwardRef((props, ref) => {
21
22
  children: [
22
23
  /* @__PURE__ */ jsx("div", { className: "roaster-stat-card__header", children: /* @__PURE__ */ jsxs("p", { className: "roaster-stat-card__title", children: [
23
24
  /* @__PURE__ */ jsx("span", { id: titleId, children: title }),
24
- description && /* @__PURE__ */ jsx(Tooltip, { label: description, children: /* @__PURE__ */ jsx("button", { className: "roaster-stat-card__info", type: "button", "aria-label": text.info, children: /* @__PURE__ */ jsx(Icon, { name: "circle-info" }) }) })
25
+ description && /* @__PURE__ */ jsx(Tooltip, { label: description, children: /* @__PURE__ */ jsx("button", { className: "roaster-stat-card__info", type: "button", "aria-label": text.info, children: /* @__PURE__ */ jsx(RoasterIcon, { name: "info" }) }) })
25
26
  ] }) }),
26
27
  /* @__PURE__ */ jsxs("div", { className: "roaster-stat-card__body", children: [
27
28
  /* @__PURE__ */ jsxs("div", { className: "roaster-stat-card__text", children: [
@@ -1 +1 @@
1
- {"version":3,"file":"StatCard.js","sources":["../../../../src/components/StatCard/StatCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useUid } from '@/utils';\nimport { Tooltip } from '../Tooltip';\nimport { Icon } from '@/components/Icon';\nimport { Progress } from '../Progress';\n\n/** The text of the stat card, for other languages. */\nexport interface StatCardLabels {\n /** The name of the button that shows the description, read by screen readers. */\n info: string;\n}\n\nconst defaultStatCardLabels: StatCardLabels = { info: 'More information' };\n\n/** Every native `<article>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to it. */\nexport interface StatCardProps extends Omit<React.ComponentPropsWithoutRef<'article'>, 'title'> {\n /** The title of the statistic. It also names the ring. */\n title: React.ReactNode;\n /** The value of the statistic. */\n value: React.ReactNode;\n /** What the statistic means, in a tooltip on an info button next to the title. */\n description?: React.ReactNode;\n /** A ring showing the value as a percentage, from 0 to 100. */\n progressValue?: number;\n /** The line under the value, such as \"20 emails clicked\". */\n progressLabel?: string;\n /** The text of the card, in English by default. */\n labels?: Partial<StatCardLabels>;\n /** The shadow of a clickable card, on a card the page sets apart (the theme may give other cards none). */\n raised?: boolean;\n}\n\nconst StatCardBase = React.forwardRef<HTMLElement, StatCardProps>((props, ref) => {\n const { title, value, description, progressValue, progressLabel, labels, raised, className, ...others } = props;\n const text = { ...defaultStatCardLabels, ...labels };\n const titleId = useUid();\n return (\n <article\n {...others}\n ref={ref}\n className={classNames('roaster-stat-card', { 'roaster-stat-card--raised': raised }, className)}\n >\n <div className=\"roaster-stat-card__header\">\n <p className=\"roaster-stat-card__title\">\n <span id={titleId}>{title}</span>\n {description && (\n <Tooltip label={description}>\n <button className=\"roaster-stat-card__info\" type=\"button\" aria-label={text.info}>\n <Icon name=\"circle-info\" />\n </button>\n </Tooltip>\n )}\n </p>\n </div>\n\n <div className=\"roaster-stat-card__body\">\n <div className=\"roaster-stat-card__text\">\n <span className=\"roaster-stat-card__value\">{value}</span>\n <small className=\"roaster-stat-card__description\">{progressLabel}</small>\n </div>\n\n {progressValue !== undefined && progressValue >= 0 && (\n <Progress variant=\"circular\" value={progressValue} aria-labelledby={titleId} />\n )}\n </div>\n </article>\n );\n});\n\nStatCardBase.displayName = 'StatCard';\n\n/** Every native `<div>` prop is accepted and forwarded to it. */\nexport interface StatCardGroupProps extends React.ComponentPropsWithoutRef<'div'> {\n /** The stat cards. */\n children: React.ReactNode;\n /**\n * `compact`: figures in a row without frames, such as a table's totals. `headline`: a report's head figures, each\n * name underlined in dots where it has a `title` that explains it; a group holding one card shows its figure larger.\n */\n variant?: 'default' | 'compact' | 'headline';\n}\n\n/** A row of stat cards. */\nexport const StatCardGroup = React.forwardRef<HTMLDivElement, StatCardGroupProps>(\n ({ children, variant = 'default', className, ...others }, ref) => (\n <div\n {...others}\n ref={ref}\n className={classNames(\n 'roaster-stat-card-group',\n { [`roaster-stat-card-group--${variant}`]: variant !== 'default' },\n className\n )}\n >\n {children}\n </div>\n )\n);\nStatCardGroup.displayName = 'StatCardGroup';\n\n/** A card showing one statistic: a title, a value, a line under it and an optional ring. StatCard.Group sets them in a row. */\nexport const StatCard = Object.assign(StatCardBase, { Group: StatCardGroup });\n"],"names":[],"mappings":";;;;;;;;;AAOA,MAAM,qBAAqB,GAAG,EAAE,IAAI,EAAE,kBAAkB,EAAE;AAC1D,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACtD,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK;AACjH,EAAE,MAAM,IAAI,GAAG,EAAE,GAAG,qBAAqB,EAAE,GAAG,MAAM,EAAE;AACtD,EAAE,MAAM,OAAO,GAAG,MAAM,EAAE;AAC1B,EAAE,uBAAuB,IAAI;AAC7B,IAAI,SAAS;AACb,IAAI;AACJ,MAAM,GAAG,MAAM;AACf,MAAM,GAAG;AACT,MAAM,SAAS,EAAE,UAAU,CAAC,mBAAmB,EAAE,EAAE,2BAA2B,EAAE,MAAM,EAAE,EAAE,SAAS,CAAC;AACpG,MAAM,QAAQ,EAAE;AAChB,wBAAwB,GAAG,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,2BAA2B,EAAE,QAAQ,kBAAkB,IAAI,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,0BAA0B,EAAE,QAAQ,EAAE;AACpK,0BAA0B,GAAG,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACvE,UAAU,WAAW,oBAAoB,GAAG,C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,yBAAyB;AACjC,QAAQ,EAAE,CAAC,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC,GAAG,OAAO,KAAK,SAAS,EAAE;AAC1E,QAAQ;AACR,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA,aAAa,CAAC,WAAW,GAAG,eAAe;AAC/B,MAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE;;"}
1
+ {"version":3,"file":"StatCard.js","sources":["../../../../src/components/StatCard/StatCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useUid } from '@/utils';\nimport { Tooltip } from '../Tooltip';\nimport { RoasterIcon } from '@/components/Icon';\nimport { Progress } from '../Progress';\n\n/** The text of the stat card, for other languages. */\nexport interface StatCardLabels {\n /** The name of the button that shows the description, read by screen readers. */\n info: string;\n}\n\nconst defaultStatCardLabels: StatCardLabels = { info: 'More information' };\n\n/** Every native `<article>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to it. */\nexport interface StatCardProps extends Omit<React.ComponentPropsWithoutRef<'article'>, 'title'> {\n /** The title of the statistic. It also names the ring. */\n title: React.ReactNode;\n /** The value of the statistic. */\n value: React.ReactNode;\n /** What the statistic means, in a tooltip on an info button next to the title. */\n description?: React.ReactNode;\n /** A ring showing the value as a percentage, from 0 to 100. */\n progressValue?: number;\n /** The line under the value, such as \"20 emails clicked\". */\n progressLabel?: string;\n /** The text of the card, in English by default. */\n labels?: Partial<StatCardLabels>;\n /** The shadow of a clickable card, on a card the page sets apart (the theme may give other cards none). */\n raised?: boolean;\n}\n\nconst StatCardBase = React.forwardRef<HTMLElement, StatCardProps>((props, ref) => {\n const { title, value, description, progressValue, progressLabel, labels, raised, className, ...others } = props;\n const text = { ...defaultStatCardLabels, ...labels };\n const titleId = useUid();\n return (\n <article\n {...others}\n ref={ref}\n className={classNames('roaster-stat-card', { 'roaster-stat-card--raised': raised }, className)}\n >\n <div className=\"roaster-stat-card__header\">\n <p className=\"roaster-stat-card__title\">\n <span id={titleId}>{title}</span>\n {description && (\n <Tooltip label={description}>\n <button className=\"roaster-stat-card__info\" type=\"button\" aria-label={text.info}>\n <RoasterIcon name=\"info\" />\n </button>\n </Tooltip>\n )}\n </p>\n </div>\n\n <div className=\"roaster-stat-card__body\">\n <div className=\"roaster-stat-card__text\">\n <span className=\"roaster-stat-card__value\">{value}</span>\n <small className=\"roaster-stat-card__description\">{progressLabel}</small>\n </div>\n\n {progressValue !== undefined && progressValue >= 0 && (\n <Progress variant=\"circular\" value={progressValue} aria-labelledby={titleId} />\n )}\n </div>\n </article>\n );\n});\n\nStatCardBase.displayName = 'StatCard';\n\n/** Every native `<div>` prop is accepted and forwarded to it. */\nexport interface StatCardGroupProps extends React.ComponentPropsWithoutRef<'div'> {\n /** The stat cards. */\n children: React.ReactNode;\n /**\n * `compact`: figures in a row without frames, such as a table's totals. `headline`: a report's head figures, each\n * name underlined in dots where it has a `title` that explains it; a group holding one card shows its figure larger.\n */\n variant?: 'default' | 'compact' | 'headline';\n}\n\n/** A row of stat cards. */\nexport const StatCardGroup = React.forwardRef<HTMLDivElement, StatCardGroupProps>(\n ({ children, variant = 'default', className, ...others }, ref) => (\n <div\n {...others}\n ref={ref}\n className={classNames(\n 'roaster-stat-card-group',\n { [`roaster-stat-card-group--${variant}`]: variant !== 'default' },\n className\n )}\n >\n {children}\n </div>\n )\n);\nStatCardGroup.displayName = 'StatCardGroup';\n\n/** A card showing one statistic: a title, a value, a line under it and an optional ring. StatCard.Group sets them in a row. */\nexport const StatCard = Object.assign(StatCardBase, { Group: StatCardGroup });\n"],"names":[],"mappings":";;;;;;;;;;AAOA,MAAM,qBAAqB,GAAG,EAAE,IAAI,EAAE,kBAAkB,EAAE;AAC1D,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACtD,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,aA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AAE,EAAE,SAAS,EAAE,0BAA0B,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACnG,4BAA4B,GAAG,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,gCAAgC,EAAE,QAAQ,EAAE,aAAa,EAAE;AACjH,WAAW,EAAE,CAAC;AACd,UAAU,aAAa,KAAK,MAAM,IAAI,aAAa,IAAI,CAAC,oBAAoB,GAAG,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,OAAO,EAAE;AACnK,SAAS,EAAE;AACX;AACA;AACA,GAAG;AACH,CAAC,CAAC;AACF,YAAY,CAAC,WAAW,GAAG,UAAU;AACzB,MAAC,aAAa,GAAG,KAAK,CAAC,UAAU;AAC7C,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,qBAAqB,GAAG;AACvF,IAAI,KAAK;AACT,IAAI;AACJ,MAAM,GAAG,MAAM;AACf,MAAM,GAAG;AACT,MAAM,SAAS,EAAE,UAAU;AAC3B,QAAQ,yBAAyB;AACjC,QAAQ,EAAE,CAAC,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC,GAAG,OAAO,KAAK,SAAS,EAAE;AAC1E,QAAQ;AACR,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA,aAAa,CAAC,WAAW,GAAG,eAAe;AAC/B,MAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE;;"}
@@ -2,7 +2,8 @@
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
4
  import { Tooltip } from '../../Tooltip/Tooltip.js';
5
- import { Icon } from '../../Icon/Icon.js';
5
+ import '../../Icon/Icon.js';
6
+ import { RoasterIcon } from '../../Icon/RoasterIcon.js';
6
7
  import { TableLabelsContext } from '../labels.js';
7
8
  import { classNames } from '../../../utils/classNames/index.js';
8
9
 
@@ -13,7 +14,7 @@ const TableHeadCell = React.forwardRef(
13
14
  title,
14
15
  children,
15
16
  description && " ",
16
- description && /* @__PURE__ */ jsx(Tooltip, { placement: "bottom", ...tooltipProps, label: description, children: /* @__PURE__ */ jsx("button", { className: "roaster-table__info", type: "button", "aria-label": text.columnInfo, children: /* @__PURE__ */ jsx(Icon, { name: "circle-info" }) }) })
17
+ description && /* @__PURE__ */ jsx(Tooltip, { placement: "bottom", ...tooltipProps, label: description, children: /* @__PURE__ */ jsx("button", { className: "roaster-table__info", type: "button", "aria-label": text.columnInfo, children: /* @__PURE__ */ jsx(RoasterIcon, { name: "info" }) }) })
17
18
  ] }) });
18
19
  }
19
20
  );
@@ -24,7 +25,7 @@ const TableSortButton = React.forwardRef(
24
25
  const sort = React.useContext(SortContext);
25
26
  return /* @__PURE__ */ jsxs("button", { ...props, ref, type, className: classNames("roaster-table__sort", className), children: [
26
27
  children,
27
- sort && /* @__PURE__ */ jsx(Icon, { name: sort === "ascending" ? "arrow-up" : "arrow-down" })
28
+ sort && /* @__PURE__ */ jsx(RoasterIcon, { name: sort === "ascending" ? "arrow-up" : "arrow-down" })
28
29
  ] });
29
30
  }
30
31
  );
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeadCell.js","sources":["../../../../../src/components/Table/components/TableHeadCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Tooltip, TooltipProps } from '@/components/Tooltip';\nimport { Icon } from '@/components/Icon';\nimport type { TableColumnPriority, TableDataType } from '../Table.types';\nimport { TableLabelsContext } from '../labels';\nimport { classNames } from '@/utils';\n\n/** Every native `<th>` prop is accepted and forwarded to it. */\nexport interface TableHeadCellBaseProps extends Omit<React.ComponentPropsWithoutRef<'th'>, 'title'> {\n /** The column's kind of data, which aligns its cells (`data-type`). */\n type: TableDataType;\n /** What the column means, in a tooltip on an info button after the title. */\n description?: React.ReactNode;\n /** The tooltip's other props, such as `placement`. */\n tooltipProps?: Omit<TooltipProps, 'children' | 'label'>;\n /** How the column sorts the rows (`aria-sort`), with an arrow after its Table.SortButton's title. */\n sort?: 'ascending' | 'descending';\n /** `secondary`: hidden on a phone, with its column (give the column the same priority in `Table`'s `columns`). */\n priority?: TableColumnPriority;\n}\n\nexport interface TableHeadCellPropsWithChildren extends TableHeadCellBaseProps {\n /** The title of the column. */\n children?: React.ReactNode;\n title?: never;\n}\n\nexport interface TableHeadCellPropsWithTitle extends TableHeadCellBaseProps {\n children?: never;\n /** The title of the column. */\n title?: React.ReactNode;\n}\n\nexport type TableHeadCellProps = TableHeadCellPropsWithChildren | TableHeadCellPropsWithTitle;\n\n/** A column title, with an optional info button that shows the column's description. */\nexport const TableHeadCell = React.forwardRef<HTMLTableCellElement, TableHeadCellProps>(\n ({ title, type, description, tooltipProps, sort, priority, children, ...props }, ref) => {\n const text = React.useContext(TableLabelsContext);\n return (\n <th {...props} ref={ref} data-type={type} data-priority={priority} aria-sort={sort}>\n <SortContext.Provider value={sort}>\n {title}\n {children}\n {description && ' '}\n {description && (\n <Tooltip placement=\"bottom\" {...tooltipProps} label={description}>\n <button className=\"roaster-table__info\" type=\"button\" aria-label={text.columnInfo}>\n <Icon name=\"circle-info\" />\n </button>\n </Tooltip>\n )}\n </SortContext.Provider>\n </th>\n );\n }\n);\n\nTableHeadCell.displayName = 'TableHeadCell';\n\nconst SortContext = React.createContext<TableHeadCellBaseProps['sort']>(undefined);\n\n/** Every native `<button>` prop is accepted and forwarded to it. */\nexport interface TableSortButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n /** The column's title. */\n children: React.ReactNode;\n}\n\n/**\n * A sortable column's title, as a button: it sorts the rows, or opens a menu of sort orders (in ActionList.Trigger).\n * The column's `sort` adds its arrow.\n */\nexport const TableSortButton = React.forwardRef<HTMLButtonElement, TableSortButtonProps>(\n ({ children, className, type = 'button', ...props }, ref) => {\n const sort = React.useContext(SortContext);\n return (\n <button {...props} ref={ref} type={type} className={classNames('roaster-table__sort', className)}>\n {children}\n {sort && <Icon name={sort === 'ascending' ? 'arrow-up' : 'arrow-down'} />}\n </button>\n );\n }\n);\nTableSortButton.displayName = 'TableSortButton';\n"],"names":[],"mappings":";;;;;;;;AAOY,MAAC,aAAa,GAAG,KAAK,CAAC,UAAU;AAC7C,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAK;AAC3F,IAAI,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,kBAAkB,CAAC;AACrD,IAAI,uBAAuB,GAAG,CAAC,IAAI,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,kBAAkB,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE;AACrM,MAAM,KAAK;AACX,MAAM,QAAQ;AACd,MAAM,WAAW,IAAI,GAAG;AACxB,MAAM,WAAW,oBAAoB,GAAG,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,kBAAkB,GAAG,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,CAAC,UAAU,EAAE,QAAQ,kBAAkB,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,EAAE;AAC1S,KAAK,EAAE,CAAC,EAAE,CAAC;AACX,EAAE;AACF;AACA,aAAa,CAAC,WAAW,GAAG,eAAe;AAC3C,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC;AACnC,MAAC,eAAe,GAAG,KAAK,CAAC,UAAU;AAC/C,EAAE,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,GAAG,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAK;AAC/D,IAAI,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC;AAC9C,IAAI,uBAAuB,IAAI,CAAC,QAAQ,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,qBAAqB,EAAE,SAAS,CAAC,EAAE,QAAQ,EAAE;AACpI,MAAM,QAAQ;AACd,MAAM,IAAI,oBAAoB,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,KAAK,WAAW,GAAG,UAAU,GAAG,YAAY,EAAE;AAClG,KAAK,EAAE,CAAC;AACR,EAAE;AACF;AACA,eAAe,CAAC,WAAW,GAAG,iBAAiB;;"}
1
+ {"version":3,"file":"TableHeadCell.js","sources":["../../../../../src/components/Table/components/TableHeadCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Tooltip, TooltipProps } from '@/components/Tooltip';\nimport { RoasterIcon } from '@/components/Icon';\nimport type { TableColumnPriority, TableDataType } from '../Table.types';\nimport { TableLabelsContext } from '../labels';\nimport { classNames } from '@/utils';\n\n/** Every native `<th>` prop is accepted and forwarded to it. */\nexport interface TableHeadCellBaseProps extends Omit<React.ComponentPropsWithoutRef<'th'>, 'title'> {\n /** The column's kind of data, which aligns its cells (`data-type`). */\n type: TableDataType;\n /** What the column means, in a tooltip on an info button after the title. */\n description?: React.ReactNode;\n /** The tooltip's other props, such as `placement`. */\n tooltipProps?: Omit<TooltipProps, 'children' | 'label'>;\n /** How the column sorts the rows (`aria-sort`), with an arrow after its Table.SortButton's title. */\n sort?: 'ascending' | 'descending';\n /** `secondary`: hidden on a phone, with its column (give the column the same priority in `Table`'s `columns`). */\n priority?: TableColumnPriority;\n}\n\nexport interface TableHeadCellPropsWithChildren extends TableHeadCellBaseProps {\n /** The title of the column. */\n children?: React.ReactNode;\n title?: never;\n}\n\nexport interface TableHeadCellPropsWithTitle extends TableHeadCellBaseProps {\n children?: never;\n /** The title of the column. */\n title?: React.ReactNode;\n}\n\nexport type TableHeadCellProps = TableHeadCellPropsWithChildren | TableHeadCellPropsWithTitle;\n\n/** A column title, with an optional info button that shows the column's description. */\nexport const TableHeadCell = React.forwardRef<HTMLTableCellElement, TableHeadCellProps>(\n ({ title, type, description, tooltipProps, sort, priority, children, ...props }, ref) => {\n const text = React.useContext(TableLabelsContext);\n return (\n <th {...props} ref={ref} data-type={type} data-priority={priority} aria-sort={sort}>\n <SortContext.Provider value={sort}>\n {title}\n {children}\n {description && ' '}\n {description && (\n <Tooltip placement=\"bottom\" {...tooltipProps} label={description}>\n <button className=\"roaster-table__info\" type=\"button\" aria-label={text.columnInfo}>\n <RoasterIcon name=\"info\" />\n </button>\n </Tooltip>\n )}\n </SortContext.Provider>\n </th>\n );\n }\n);\n\nTableHeadCell.displayName = 'TableHeadCell';\n\nconst SortContext = React.createContext<TableHeadCellBaseProps['sort']>(undefined);\n\n/** Every native `<button>` prop is accepted and forwarded to it. */\nexport interface TableSortButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n /** The column's title. */\n children: React.ReactNode;\n}\n\n/**\n * A sortable column's title, as a button: it sorts the rows, or opens a menu of sort orders (in ActionList.Trigger).\n * The column's `sort` adds its arrow.\n */\nexport const TableSortButton = React.forwardRef<HTMLButtonElement, TableSortButtonProps>(\n ({ children, className, type = 'button', ...props }, ref) => {\n const sort = React.useContext(SortContext);\n return (\n <button {...props} ref={ref} type={type} className={classNames('roaster-table__sort', className)}>\n {children}\n {sort && <RoasterIcon name={sort === 'ascending' ? 'arrow-up' : 'arrow-down'} />}\n </button>\n );\n }\n);\nTableSortButton.displayName = 'TableSortButton';\n"],"names":[],"mappings":";;;;;;;;;AAOY,MAAC,aAAa,GAAG,KAAK,CAAC,UAAU;AAC7C,EAAE,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AAW,CAAC;AAC9C,IAAI,uBAAuB,IAAI,CAAC,QAAQ,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,qBAAqB,EAAE,SAAS,CAAC,EAAE,QAAQ,EAAE;AACpI,MAAM,QAAQ;AACd,MAAM,IAAI,oBAAoB,GAAG,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,IAAI,KAAK,WAAW,GAAG,UAAU,GAAG,YAAY,EAAE;AACzG,KAAK,EAAE,CAAC;AACR,EAAE;AACF;AACA,eAAe,CAAC,WAAW,GAAG,iBAAiB;;"}
@@ -3,7 +3,8 @@ import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
4
  import { TagGroup } from './TagGroup.js';
5
5
  import { ButtonIcon } from '../ButtonIcon/ButtonIcon.js';
6
- import { Icon } from '../Icon/Icon.js';
6
+ import '../Icon/Icon.js';
7
+ import { RoasterIcon } from '../Icon/RoasterIcon.js';
7
8
  import { classNames } from '../../utils/classNames/index.js';
8
9
 
9
10
  const TagBase = React.forwardRef(
@@ -24,7 +25,7 @@ const TagBase = React.forwardRef(
24
25
  ),
25
26
  children: [
26
27
  children,
27
- onRemove && /* @__PURE__ */ jsx(ButtonIcon, { className: "roaster-tag__remove", "aria-label": removeLabel, onClick: onRemove, children: /* @__PURE__ */ jsx(Icon, { name: "xmark" }) })
28
+ onRemove && /* @__PURE__ */ jsx(ButtonIcon, { className: "roaster-tag__remove", "aria-label": removeLabel, onClick: onRemove, children: /* @__PURE__ */ jsx(RoasterIcon, { name: "x" }) })
28
29
  ]
29
30
  }
30
31
  );
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.js","sources":["../../../../src/components/Tag/Tag.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\nimport { TagGroup } from './TagGroup';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Icon } from '@/components/Icon';\n\n/** The tones of a tag. */\nexport type TagTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';\n\n/** The text of the tag, for other languages. */\nexport interface TagLabels {\n /** The name of the remove button, read by screen readers. By default \"Remove\" and the tag's text, when it is text. */\n remove: string;\n}\n\n/**\n * Every native `<span>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to it, except the obsolete\n * `color`, left out so that v1's `color` prop is an error rather than ignored: use `tone`.\n */\nexport interface TagProps extends Omit<React.ComponentPropsWithoutRef<'span'>, 'color'> {\n /** The content of the tag: text, with an optional icon. */\n children: React.ReactNode;\n /** Shows a remove button, which calls it. */\n onRemove?(): void;\n /**\n * The tone of the tag.\n * @defaultValue 'neutral'\n */\n tone?: TagTone;\n /**\n * `outline` draws an edge instead of a fill, such as for a role (\"Admin\") or a state that asks for nothing; `solid`\n * fills it with the inverted color, such as for a plan name (\"Pro\"); `inline` is a soft pill in a sentence, at the\n * text's own size, such as what the sentence counts.\n */\n variant?: 'outline' | 'solid' | 'inline';\n /** `small` is a lower tag, such as beside a name in a comment's header. */\n size?: 'small';\n /** The text of the tag, in English by default. */\n labels?: Partial<TagLabels>;\n}\n\nconst TagBase = React.forwardRef<HTMLSpanElement, TagProps>(\n ({ children, onRemove, tone = 'neutral', variant, size, labels, className, ...others }, ref) => {\n const text = typeof children === 'string' || typeof children === 'number' ? ` ${children}` : '';\n const removeLabel = labels?.remove ?? `Remove${text}`;\n return (\n <span\n {...others}\n ref={ref}\n className={classNames(\n 'roaster-tag',\n `roaster-tag--${tone}`,\n variant && `roaster-tag--${variant}`,\n size && `roaster-tag--${size}`,\n className\n )}\n >\n {children}\n {onRemove && (\n <ButtonIcon className=\"roaster-tag__remove\" aria-label={removeLabel} onClick={onRemove}>\n <Icon name=\"xmark\" />\n </ButtonIcon>\n )}\n </span>\n );\n }\n);\n\nTagBase.displayName = 'Tag';\n\n/** Every native `<span>` prop is accepted and forwarded to it. */\nexport interface TagDotProps extends React.ComponentPropsWithoutRef<'span'> {\n /**\n * The dot's color, such as a label's: a tone, or `primary`. By default the text's color.\n */\n tone?: TagTone | 'primary';\n}\n\n/** A colored dot before a tag's text, such as a label's color. Hidden from screen readers: the text says it. */\nconst TagDot = React.forwardRef<HTMLSpanElement, TagDotProps>(({ tone, className, ...others }, ref) => (\n <span\n aria-hidden=\"true\"\n {...others}\n ref={ref}\n className={classNames('roaster-tag__dot', tone && `roaster-icon-${tone === 'neutral' ? 'muted' : tone}`, className)}\n />\n));\n\nTagDot.displayName = 'Tag.Dot';\n\n/**\n * A small label in a tone (neutral, info, success, warning or danger), optionally removable with a labelled button.\n * Group tags with Tag.Group; Tag.Dot is a colored dot before the text.\n */\nexport const Tag = Object.assign(TagBase, { Group: TagGroup, Dot: TagDot });\n"],"names":[],"mappings":";;;;;;;;AAOA,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU;AAChC,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,GAAG,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,KAAK;AAClG,IAAI,MAAM,IAAI,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,EAAE;AACnG,IAAI,MAAM,WAAW,GAAG,MAAM,EAAE,MAAM,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACzD,IAAI,uBAAuB,IAAI;AAC/B,MAAM,MAAM;AACZ,MAAM;AACN,QAAQ,GAAG,MAAM;AACjB,QAAQ,GAAG;AACX,QAAQ,SAAS,EAAE,UAAU;AAC7B,UAAU,aAAa;AACvB,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;AAChC,UAAU,OAAO,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;AAC9C,UAAU,IAAI,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;AACxC,UAAU;AACV,SAAS;AACT,QAAQ,QAAQ,EAAE;AAClB,UAAU,QAAQ;AAClB,UAAU,QAAQ,oBAAoB,GAAG,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,kBAAkB,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE;AAChM;AACA;AACA,KAAK;AACL,EAAE;AACF,CAAC;AACD,OAAO,CAAC,WAAW,GAAG,KAAK;AAC3B,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,qBAAqB,GAAG;AAC5F,EAAE,MAAM;AACR,EAAE;AACF,IAAI,aAAa,EAAE,MAAM;AACzB,IAAI,GAAG,MAAM;AACb,IAAI,GAAG;AACP,IAAI,SAAS,EAAE,UAAU,CAAC,kBAAkB,EAAE,IAAI,IAAI,CAAC,aAAa,EAAE,IAAI,KAAK,SAAS,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC,EAAE,SAAS;AACtH;AACA,CAAC,CAAC;AACF,MAAM,CAAC,WAAW,GAAG,SAAS;AAClB,MAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE;;"}
1
+ {"version":3,"file":"Tag.js","sources":["../../../../src/components/Tag/Tag.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\nimport { TagGroup } from './TagGroup';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { RoasterIcon } from '@/components/Icon';\n\n/** The tones of a tag. */\nexport type TagTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';\n\n/** The text of the tag, for other languages. */\nexport interface TagLabels {\n /** The name of the remove button, read by screen readers. By default \"Remove\" and the tag's text, when it is text. */\n remove: string;\n}\n\n/**\n * Every native `<span>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to it, except the obsolete\n * `color`, left out so that v1's `color` prop is an error rather than ignored: use `tone`.\n */\nexport interface TagProps extends Omit<React.ComponentPropsWithoutRef<'span'>, 'color'> {\n /** The content of the tag: text, with an optional icon. */\n children: React.ReactNode;\n /** Shows a remove button, which calls it. */\n onRemove?(): void;\n /**\n * The tone of the tag.\n * @defaultValue 'neutral'\n */\n tone?: TagTone;\n /**\n * `outline` draws an edge instead of a fill, such as for a role (\"Admin\") or a state that asks for nothing; `solid`\n * fills it with the inverted color, such as for a plan name (\"Pro\"); `inline` is a soft pill in a sentence, at the\n * text's own size, such as what the sentence counts.\n */\n variant?: 'outline' | 'solid' | 'inline';\n /** `small` is a lower tag, such as beside a name in a comment's header. */\n size?: 'small';\n /** The text of the tag, in English by default. */\n labels?: Partial<TagLabels>;\n}\n\nconst TagBase = React.forwardRef<HTMLSpanElement, TagProps>(\n ({ children, onRemove, tone = 'neutral', variant, size, labels, className, ...others }, ref) => {\n const text = typeof children === 'string' || typeof children === 'number' ? ` ${children}` : '';\n const removeLabel = labels?.remove ?? `Remove${text}`;\n return (\n <span\n {...others}\n ref={ref}\n className={classNames(\n 'roaster-tag',\n `roaster-tag--${tone}`,\n variant && `roaster-tag--${variant}`,\n size && `roaster-tag--${size}`,\n className\n )}\n >\n {children}\n {onRemove && (\n <ButtonIcon className=\"roaster-tag__remove\" aria-label={removeLabel} onClick={onRemove}>\n <RoasterIcon name=\"x\" />\n </ButtonIcon>\n )}\n </span>\n );\n }\n);\n\nTagBase.displayName = 'Tag';\n\n/** Every native `<span>` prop is accepted and forwarded to it. */\nexport interface TagDotProps extends React.ComponentPropsWithoutRef<'span'> {\n /**\n * The dot's color, such as a label's: a tone, or `primary`. By default the text's color.\n */\n tone?: TagTone | 'primary';\n}\n\n/** A colored dot before a tag's text, such as a label's color. Hidden from screen readers: the text says it. */\nconst TagDot = React.forwardRef<HTMLSpanElement, TagDotProps>(({ tone, className, ...others }, ref) => (\n <span\n aria-hidden=\"true\"\n {...others}\n ref={ref}\n className={classNames('roaster-tag__dot', tone && `roaster-icon-${tone === 'neutral' ? 'muted' : tone}`, className)}\n />\n));\n\nTagDot.displayName = 'Tag.Dot';\n\n/**\n * A small label in a tone (neutral, info, success, warning or danger), optionally removable with a labelled button.\n * Group tags with Tag.Group; Tag.Dot is a colored dot before the text.\n */\nexport const Tag = Object.assign(TagBase, { Group: TagGroup, Dot: TagDot });\n"],"names":[],"mappings":";;;;;;;;;AAOA,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU;AAChC,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,GAAG,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,KAAK;AAClG,IAAI,MAAM,IAAI,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,EAAE;AACnG,IAAI,MAAM,WAAW,GAAG,MAAM,EAAE,MAAM,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACzD,IAAI,uBAAuB,IAAI;AAC/B,MAAM,MAAM;AACZ,MAAM;AACN,QAAQ,GAAG,MAAM;AACjB,QAAQ,GAAG;AACX,QAAQ,SAAS,EAAE,UAAU;AAC7B,UAAU,aAAa;AACvB,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;AAChC,UAAU,OAAO,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;AAC9C,UAAU,IAAI,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;AACxC,UAAU;AACV,SAAS;AACT,QAAQ,QAAQ,EAAE;AAClB,UAAU,QAAQ;AAClB,UAAU,QAAQ,oBAAoB,GAAG,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,kBAAkB,GAAG,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE;AACnM;AACA;AACA,KAAK;AACL,EAAE;AACF,CAAC;AACD,OAAO,CAAC,WAAW,GAAG,KAAK;AAC3B,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,qBAAqB,GAAG;AAC5F,EAAE,MAAM;AACR,EAAE;AACF,IAAI,aAAa,EAAE,MAAM;AACzB,IAAI,GAAG,MAAM;AACb,IAAI,GAAG;AACP,IAAI,SAAS,EAAE,UAAU,CAAC,kBAAkB,EAAE,IAAI,IAAI,CAAC,aAAa,EAAE,IAAI,KAAK,SAAS,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC,EAAE,SAAS;AACtH;AACA,CAAC,CAAC;AACF,MAAM,CAAC,WAAW,GAAG,SAAS;AAClB,MAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE;;"}
@@ -1,7 +1,8 @@
1
1
  'use client';
2
2
  import { 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 { useImageFallback } from '../../utils/useImageFallback/index.js';
6
7
  import { classNames } from '../../utils/classNames/index.js';
7
8
 
@@ -18,7 +19,7 @@ const Thumbnail = React.forwardRef(
18
19
  ref,
19
20
  className: classNames("roaster-thumbnail", className),
20
21
  style: { ...size && { width: size, height: size }, ...style },
21
- children: showFallback ? /* @__PURE__ */ jsx(Icon, { name: "image" }) : /* @__PURE__ */ jsx("img", { src: src ?? void 0, alt: label, onError })
22
+ children: showFallback ? /* @__PURE__ */ jsx(RoasterIcon, { name: "image" }) : /* @__PURE__ */ jsx("img", { src: src ?? void 0, alt: label, onError })
22
23
  }
23
24
  );
24
25
  }
@@ -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,7 +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;A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ACzG,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,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK;AACrE,EAAE,MAAM,IAAI,GAAG,EAAE,GAAG,uBAAuB,EAAE,GAAG,MAAM,EAAE;AACxD,EAAE,MAAM,OAAO,GAAG,MAAM,CAAC,EAAE,CAAC;AAC5B,EAAE,MAAM,OAAO,GAAG,MAAM,EAAE;AAC1B,EAAE,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;AACrC,EAAE,MAAM,OAAO,GAAG,KAAK,CAAC,WAAW;AACnC,IAAI,CAAC,KAAK,KAAK;AACf,MAAM,QAAQ,CAAC,OAAO,GAAG,KAAK;AAC9B,MAAM,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,GAAG,CAAC,KAAK,CAAC;AAC/C,WAAW,IAAI,GAAG,EAAE,GAAG,CAAC,OAAO,GAAG,KAAK;AACvC,IAAI,CAAC;AACL,IAAI,CAAC,GAAG;AACR,GAAG;AACH,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,EAAE,2BAA2B;AACtD,gBAAgB,YAAY,EAAE,IAAI,CAAC,KAAK;AACxC,gBAAgB,OAAO,EAAE,MAAM,QAAQ,CAAC,OAAO,EAAE,WAAW,IAAI;AAChE,gBAAgB,QAAQ,kBAAkB,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;AACrE;AACA;AACA,WAAW,EAAE,CAAC;AACd,0BAA0B,GAAG,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,6BAA6B,EAAE,QAAQ,EAAE;AAC3F;AACA;AACA,KAAK;AACL,oBAAoB,IAAI,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,2BAA2B,EAAE,QAAQ,EAAE;AACpF,sBAAsB,GAAG,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,kCAAkC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAClG,sBAAsB,GAAG;AACzB,QAAQ,MAAM;AACd,QAAQ;AACR,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,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK;AACrE,EAAE,MAAM,IAAI,GAAG,EAAE,GAAG,uBAAuB,EAAE,GAAG,MAAM,EAAE;AACxD,EAAE,MAAM,OAAO,GAAG,MAAM,CAAC,EAAE,CAAC;AAC5B,EAAE,MAAM,OAAO,GAAG,MAAM,EAAE;AAC1B,EAAE,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;AACrC,EAAE,MAAM,OAAO,GAAG,KAAK,CAAC,WAAW;AACnC,IAAI,CAAC,KAAK,KAAK;AACf,MAAM,QAAQ,CAAC,OAAO,GAAG,KAAK;AAC9B,MAAM,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,GAAG,CAAC,KAAK,CAAC;AAC/C,WAAW,IAAI,GAAG,EAAE,GAAG,CAAC,OAAO,GAAG,KAAK;AACvC,IAAI,CAAC;AACL,IAAI,CAAC,GAAG;AACR,GAAG;AACH,EAAE,MAAM,CAAC,IAAI,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AAgB,YAAY,EAAE,IAAI,CAAC,KAAK;AACxC,gBAAgB,OAAO,EAAE,MAAM,QAAQ,CAAC,OAAO,EAAE,WAAW,IAAI;AAChE,gBAAgB,QAAQ,kBAAkB,GAAG,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE;AACxE;AACA;AACA,WAAW,EAAE,CAAC;AACd,0BAA0B,GAAG,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,6BAA6B,EAAE,QAAQ,EAAE;AAC3F;AACA;AACA,KAAK;AACL,oBAAoB,IAAI,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,2BAA2B,EAAE,QAAQ,EAAE;AACpF,sBAAsB,GAAG,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,kCAAkC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAClG,sBAAsB,GAAG;AACzB,QAAQ,MAAM;AACd,QAAQ;AACR,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,WAAW,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;AAC3E;AACA;AACA,KAAK,EAAE;AACP,GAAG,EAAE,CAAC;AACN,CAAC;AACD,UAAU,CAAC,WAAW,GAAG,YAAY;;"}
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  export interface ActionListItemProps extends React.ComponentPropsWithoutRef<'button'> {
4
4
  /**
5
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><Icon name="arrow-up-right-from-square" />`.
6
+ * `<span>`: `<span>Privacy</span><i className="fa-regular fa-arrow-up-right-from-square" aria-hidden="true" />`.
7
7
  */
8
8
  children: React.ReactNode;
9
9
  /** `danger` for a destructive action, such as deleting or logging out. */
@@ -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;;;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,+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,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,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"}
@@ -1,3 +1,5 @@
1
1
  export { Icon } from './Icon';
2
2
  export type { IconProps } from './Icon';
3
+ export { RoasterIcon } from './RoasterIcon';
4
+ export type { RoasterIconName, RoasterIconProps } from './RoasterIcon';
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}