@canonical/react-ds-global 0.29.1 → 0.31.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.
- package/README.md +33 -0
- package/dist/esm/lib/_work_in_progress/IconSection/IconSection.js +1 -1
- package/dist/esm/lib/_work_in_progress/IconSection/IconSection.js.map +1 -1
- package/dist/esm/lib/_work_in_progress/index.js +13 -0
- package/dist/esm/lib/_work_in_progress/index.js.map +1 -0
- package/dist/esm/lib/component/Accordion/common/Item/styles.css +73 -56
- package/dist/esm/lib/component/Accordion/styles.css +5 -1
- package/dist/esm/lib/component/Announcement/Announcement.js +5 -3
- package/dist/esm/lib/component/Announcement/Announcement.js.map +1 -1
- package/dist/esm/lib/component/Announcement/index.js +1 -0
- package/dist/esm/lib/component/Announcement/index.js.map +1 -1
- package/dist/esm/lib/component/Announcement/styles.css +60 -36
- package/dist/esm/lib/component/Badge/styles.css +25 -24
- package/dist/esm/lib/component/Breadcrumbs/Breadcrumbs.js +2 -2
- package/dist/esm/lib/component/Breadcrumbs/common/Item/Item.js +13 -3
- package/dist/esm/lib/component/Breadcrumbs/common/Item/Item.js.map +1 -1
- package/dist/esm/lib/component/Breadcrumbs/common/Item/styles.css +17 -5
- package/dist/esm/lib/component/Breadcrumbs/styles.css +3 -0
- package/dist/esm/lib/component/Button/Button.js +13 -6
- package/dist/esm/lib/component/Button/Button.js.map +1 -1
- package/dist/esm/lib/component/Button/styles.css +200 -38
- package/dist/esm/lib/component/Card/Card.js +16 -6
- package/dist/esm/lib/component/Card/Card.js.map +1 -1
- package/dist/esm/lib/component/Card/common/Content/styles.css +8 -4
- package/dist/esm/lib/component/Card/common/Footer/Footer.js +2 -2
- package/dist/esm/lib/component/Card/common/Footer/styles.css +13 -3
- package/dist/esm/lib/component/Card/common/Header/styles.css +1 -1
- package/dist/esm/lib/component/Card/common/index.js +0 -1
- package/dist/esm/lib/component/Card/common/index.js.map +1 -1
- package/dist/esm/lib/component/Card/styles.css +60 -22
- package/dist/esm/lib/component/Chip/styles.css +3 -0
- package/dist/esm/lib/component/ContextualMenu/ContextualMenu.js +96 -0
- package/dist/esm/lib/component/ContextualMenu/ContextualMenu.js.map +1 -0
- package/dist/esm/lib/component/ContextualMenu/common/Item/Item.js +32 -0
- package/dist/esm/lib/component/ContextualMenu/common/Item/Item.js.map +1 -0
- package/dist/esm/lib/component/ContextualMenu/common/Item/index.js +2 -0
- package/dist/esm/lib/component/ContextualMenu/common/Item/index.js.map +1 -0
- package/dist/esm/lib/component/ContextualMenu/common/Item/styles.css +121 -0
- package/dist/esm/lib/component/ContextualMenu/common/Item/types.js.map +1 -0
- package/dist/esm/lib/component/ContextualMenu/common/MenuContext.js +12 -0
- package/dist/esm/lib/component/ContextualMenu/common/MenuContext.js.map +1 -0
- package/dist/esm/lib/component/ContextualMenu/common/SubMenu/SubMenu.js +128 -0
- package/dist/esm/lib/component/ContextualMenu/common/SubMenu/SubMenu.js.map +1 -0
- package/dist/esm/lib/component/ContextualMenu/common/SubMenu/index.js +2 -0
- package/dist/esm/lib/component/ContextualMenu/common/SubMenu/index.js.map +1 -0
- package/dist/esm/lib/component/ContextualMenu/index.js +2 -0
- package/dist/esm/lib/component/ContextualMenu/index.js.map +1 -0
- package/dist/esm/lib/component/ContextualMenu/styles.css +86 -0
- package/dist/esm/lib/component/ContextualMenu/types.js.map +1 -0
- package/dist/esm/lib/component/Popover/Popover.js +50 -0
- package/dist/esm/lib/component/Popover/Popover.js.map +1 -0
- package/dist/esm/lib/component/Popover/index.js +2 -0
- package/dist/esm/lib/component/Popover/index.js.map +1 -0
- package/dist/esm/lib/component/Popover/styles.css +65 -0
- package/dist/esm/lib/component/Popover/types.js +2 -0
- package/dist/esm/lib/component/Popover/types.js.map +1 -0
- package/dist/esm/lib/component/Tabs/Tabs.js +27 -0
- package/dist/esm/lib/component/Tabs/Tabs.js.map +1 -0
- package/dist/esm/lib/component/Tabs/common/Item/Item.js +20 -0
- package/dist/esm/lib/component/Tabs/common/Item/Item.js.map +1 -0
- package/dist/esm/lib/component/Tabs/common/Item/index.js +3 -0
- package/dist/esm/lib/component/Tabs/common/Item/index.js.map +1 -0
- package/dist/esm/lib/component/Tabs/common/Item/styles.css +75 -0
- package/dist/esm/lib/component/Tabs/common/Item/types.js +2 -0
- package/dist/esm/lib/component/Tabs/common/Item/types.js.map +1 -0
- package/dist/esm/lib/component/Tabs/common/index.js +2 -0
- package/dist/esm/lib/component/Tabs/common/index.js.map +1 -0
- package/dist/esm/lib/component/Tabs/index.js +3 -0
- package/dist/esm/lib/component/Tabs/index.js.map +1 -0
- package/dist/esm/lib/component/Tabs/styles.css +37 -0
- package/dist/esm/lib/component/Tabs/types.js +2 -0
- package/dist/esm/lib/component/Tabs/types.js.map +1 -0
- package/dist/esm/lib/component/Tile/Tile.js +6 -1
- package/dist/esm/lib/component/Tile/Tile.js.map +1 -1
- package/dist/esm/lib/component/Tile/common/Content/styles.css +17 -8
- package/dist/esm/lib/component/Tile/common/Header/styles.css +15 -12
- package/dist/esm/lib/component/Tile/styles.css +19 -53
- package/dist/esm/lib/component/Tooltip/Tooltip.js +6 -4
- package/dist/esm/lib/component/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/lib/component/Tooltip/common/TooltipArea/TooltipArea.js +45 -25
- package/dist/esm/lib/component/Tooltip/common/TooltipArea/TooltipArea.js.map +1 -1
- package/dist/esm/lib/component/Tooltip/styles.css +146 -81
- package/dist/esm/lib/component/Tooltip/withTooltip.js +3 -3
- package/dist/esm/lib/component/Tooltip/withTooltip.js.map +1 -1
- package/dist/esm/lib/component/index.js +17 -0
- package/dist/esm/lib/component/index.js.map +1 -0
- package/dist/esm/lib/group/Cards/Cards.js +49 -0
- package/dist/esm/lib/group/Cards/Cards.js.map +1 -0
- package/dist/esm/lib/group/Cards/index.js +3 -0
- package/dist/esm/lib/group/Cards/index.js.map +1 -0
- package/dist/esm/lib/group/Cards/styles.css +55 -0
- package/dist/esm/lib/group/Cards/types.js +2 -0
- package/dist/esm/lib/group/Cards/types.js.map +1 -0
- package/dist/esm/lib/group/index.js +4 -0
- package/dist/esm/lib/group/index.js.map +1 -0
- package/dist/esm/lib/hooks/index.js +3 -1
- package/dist/esm/lib/hooks/index.js.map +1 -1
- package/dist/esm/lib/hooks/useContextualMenu/index.js +3 -0
- package/dist/esm/lib/hooks/useContextualMenu/index.js.map +1 -0
- package/dist/esm/lib/hooks/useContextualMenu/types.js +2 -0
- package/dist/esm/lib/hooks/useContextualMenu/types.js.map +1 -0
- package/dist/esm/lib/hooks/useContextualMenu/useContextualMenu.js +181 -0
- package/dist/esm/lib/hooks/useContextualMenu/useContextualMenu.js.map +1 -0
- package/dist/esm/lib/hooks/useDisclosure/index.js +3 -0
- package/dist/esm/lib/hooks/useDisclosure/index.js.map +1 -0
- package/dist/esm/lib/hooks/useDisclosure/types.js +2 -0
- package/dist/esm/lib/hooks/useDisclosure/types.js.map +1 -0
- package/dist/esm/lib/hooks/useDisclosure/useDisclosure.js +230 -0
- package/dist/esm/lib/hooks/useDisclosure/useDisclosure.js.map +1 -0
- package/dist/esm/lib/hooks/useIsMounted/index.js +3 -0
- package/dist/esm/lib/hooks/useIsMounted/index.js.map +1 -0
- package/dist/esm/lib/hooks/useIsMounted/types.js +2 -0
- package/dist/esm/lib/hooks/useIsMounted/types.js.map +1 -0
- package/dist/esm/lib/hooks/useIsMounted/useIsMounted.js +21 -0
- package/dist/esm/lib/hooks/useIsMounted/useIsMounted.js.map +1 -0
- package/dist/esm/lib/hooks/useResizeObserver/useResizeObserver.js +37 -7
- package/dist/esm/lib/hooks/useResizeObserver/useResizeObserver.js.map +1 -1
- package/dist/esm/lib/hooks/useWindowDimensions/useWindowDimensions.js +9 -0
- package/dist/esm/lib/hooks/useWindowDimensions/useWindowDimensions.js.map +1 -1
- package/dist/esm/lib/hooks/useWindowFitment/index.js +1 -0
- package/dist/esm/lib/hooks/useWindowFitment/index.js.map +1 -1
- package/dist/esm/lib/hooks/useWindowFitment/readingDirection.js +25 -0
- package/dist/esm/lib/hooks/useWindowFitment/readingDirection.js.map +1 -0
- package/dist/esm/lib/hooks/useWindowFitment/useWindowFitment.js +211 -21
- package/dist/esm/lib/hooks/useWindowFitment/useWindowFitment.js.map +1 -1
- package/dist/esm/lib/index.js +8 -25
- package/dist/esm/lib/index.js.map +1 -1
- package/dist/esm/lib/pattern/index.js +3 -0
- package/dist/esm/lib/pattern/index.js.map +1 -0
- package/dist/esm/lib/subcomponent/Spinner/Spinner.js +35 -0
- package/dist/esm/lib/subcomponent/Spinner/Spinner.js.map +1 -0
- package/dist/esm/lib/subcomponent/Spinner/index.js +2 -0
- package/dist/esm/lib/subcomponent/Spinner/index.js.map +1 -0
- package/dist/esm/lib/subcomponent/Spinner/styles.css +50 -0
- package/dist/esm/lib/subcomponent/Spinner/types.js +2 -0
- package/dist/esm/lib/subcomponent/Spinner/types.js.map +1 -0
- package/dist/esm/lib/subcomponent/index.js +3 -0
- package/dist/esm/lib/subcomponent/index.js.map +1 -0
- package/dist/esm/lib/types/link.js +2 -0
- package/dist/esm/lib/types/link.js.map +1 -0
- package/dist/types/lib/_work_in_progress/Link/types.d.ts +1 -1
- package/dist/types/lib/_work_in_progress/Link/types.d.ts.map +1 -1
- package/dist/types/lib/_work_in_progress/index.d.ts +12 -0
- package/dist/types/lib/_work_in_progress/index.d.ts.map +1 -0
- package/dist/types/lib/component/Announcement/Announcement.d.ts +2 -2
- package/dist/types/lib/component/Announcement/Announcement.d.ts.map +1 -1
- package/dist/types/lib/component/Announcement/index.d.ts.map +1 -1
- package/dist/types/lib/component/Announcement/types.d.ts +17 -6
- package/dist/types/lib/component/Announcement/types.d.ts.map +1 -1
- package/dist/types/lib/component/Breadcrumbs/Breadcrumbs.d.ts +3 -3
- package/dist/types/lib/component/Breadcrumbs/common/Item/Item.d.ts +1 -1
- package/dist/types/lib/component/Breadcrumbs/common/Item/Item.d.ts.map +1 -1
- package/dist/types/lib/component/Breadcrumbs/common/Item/types.d.ts +13 -13
- package/dist/types/lib/component/Breadcrumbs/common/Item/types.d.ts.map +1 -1
- package/dist/types/lib/component/Breadcrumbs/types.d.ts +23 -1
- package/dist/types/lib/component/Breadcrumbs/types.d.ts.map +1 -1
- package/dist/types/lib/component/Button/Button.d.ts +3 -1
- package/dist/types/lib/component/Button/Button.d.ts.map +1 -1
- package/dist/types/lib/component/Button/types.d.ts +12 -6
- package/dist/types/lib/component/Button/types.d.ts.map +1 -1
- package/dist/types/lib/component/Card/Card.d.ts +10 -5
- package/dist/types/lib/component/Card/Card.d.ts.map +1 -1
- package/dist/types/lib/component/Card/common/Footer/Footer.d.ts +2 -2
- package/dist/types/lib/component/Card/common/Footer/types.d.ts +2 -2
- package/dist/types/lib/component/Card/common/Footer/types.d.ts.map +1 -1
- package/dist/types/lib/component/Card/common/index.d.ts +0 -1
- package/dist/types/lib/component/Card/common/index.d.ts.map +1 -1
- package/dist/types/lib/component/ContextualMenu/ContextualMenu.d.ts +15 -0
- package/dist/types/lib/component/ContextualMenu/ContextualMenu.d.ts.map +1 -0
- package/dist/types/lib/component/ContextualMenu/common/Item/Item.d.ts +14 -0
- package/dist/types/lib/component/ContextualMenu/common/Item/Item.d.ts.map +1 -0
- package/dist/types/lib/component/ContextualMenu/common/Item/index.d.ts +3 -0
- package/dist/types/lib/component/ContextualMenu/common/Item/index.d.ts.map +1 -0
- package/dist/types/lib/component/ContextualMenu/common/Item/types.d.ts +11 -0
- package/dist/types/lib/component/ContextualMenu/common/Item/types.d.ts.map +1 -0
- package/dist/types/lib/component/ContextualMenu/common/MenuContext.d.ts +19 -0
- package/dist/types/lib/component/ContextualMenu/common/MenuContext.d.ts.map +1 -0
- package/dist/types/lib/component/ContextualMenu/common/SubMenu/SubMenu.d.ts +15 -0
- package/dist/types/lib/component/ContextualMenu/common/SubMenu/SubMenu.d.ts.map +1 -0
- package/dist/types/lib/component/ContextualMenu/common/SubMenu/index.d.ts +2 -0
- package/dist/types/lib/component/ContextualMenu/common/SubMenu/index.d.ts.map +1 -0
- package/dist/types/lib/component/ContextualMenu/index.d.ts +3 -0
- package/dist/types/lib/component/ContextualMenu/index.d.ts.map +1 -0
- package/dist/types/lib/component/ContextualMenu/types.d.ts +30 -0
- package/dist/types/lib/component/ContextualMenu/types.d.ts.map +1 -0
- package/dist/types/lib/component/Popover/Popover.d.ts +16 -0
- package/dist/types/lib/component/Popover/Popover.d.ts.map +1 -0
- package/dist/types/lib/component/Popover/index.d.ts +3 -0
- package/dist/types/lib/component/Popover/index.d.ts.map +1 -0
- package/dist/types/lib/component/Popover/types.d.ts +24 -0
- package/dist/types/lib/component/Popover/types.d.ts.map +1 -0
- package/dist/types/lib/component/Tabs/Tabs.d.ts +18 -0
- package/dist/types/lib/component/Tabs/Tabs.d.ts.map +1 -0
- package/dist/types/lib/component/Tabs/common/Item/Item.d.ts +15 -0
- package/dist/types/lib/component/Tabs/common/Item/Item.d.ts.map +1 -0
- package/dist/types/lib/component/Tabs/common/Item/index.d.ts +3 -0
- package/dist/types/lib/component/Tabs/common/Item/index.d.ts.map +1 -0
- package/dist/types/lib/component/Tabs/common/Item/types.d.ts +18 -0
- package/dist/types/lib/component/Tabs/common/Item/types.d.ts.map +1 -0
- package/dist/types/lib/component/Tabs/common/index.d.ts +2 -0
- package/dist/types/lib/component/Tabs/common/index.d.ts.map +1 -0
- package/dist/types/lib/component/Tabs/index.d.ts +3 -0
- package/dist/types/lib/component/Tabs/index.d.ts.map +1 -0
- package/dist/types/lib/component/Tabs/types.d.ts +46 -0
- package/dist/types/lib/component/Tabs/types.d.ts.map +1 -0
- package/dist/types/lib/component/Tile/Tile.d.ts +2 -0
- package/dist/types/lib/component/Tile/Tile.d.ts.map +1 -1
- package/dist/types/lib/component/Tile/common/Content/types.d.ts +1 -1
- package/dist/types/lib/component/Tile/common/Header/types.d.ts +1 -1
- package/dist/types/lib/component/Tile/types.d.ts +4 -5
- package/dist/types/lib/component/Tile/types.d.ts.map +1 -1
- package/dist/types/lib/component/Tooltip/Tooltip.d.ts +1 -1
- package/dist/types/lib/component/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/lib/component/Tooltip/common/TooltipArea/TooltipArea.d.ts +1 -1
- package/dist/types/lib/component/Tooltip/common/TooltipArea/TooltipArea.d.ts.map +1 -1
- package/dist/types/lib/component/Tooltip/common/TooltipArea/types.d.ts +14 -2
- package/dist/types/lib/component/Tooltip/common/TooltipArea/types.d.ts.map +1 -1
- package/dist/types/lib/component/Tooltip/types.d.ts +6 -0
- package/dist/types/lib/component/Tooltip/types.d.ts.map +1 -1
- package/dist/types/lib/component/Tooltip/withTooltip.d.ts +10 -3
- package/dist/types/lib/component/Tooltip/withTooltip.d.ts.map +1 -1
- package/dist/types/lib/component/index.d.ts +16 -0
- package/dist/types/lib/component/index.d.ts.map +1 -0
- package/dist/types/lib/group/Cards/Cards.d.ts +40 -0
- package/dist/types/lib/group/Cards/Cards.d.ts.map +1 -0
- package/dist/types/lib/group/Cards/index.d.ts +3 -0
- package/dist/types/lib/group/Cards/index.d.ts.map +1 -0
- package/dist/types/lib/group/Cards/types.d.ts +14 -0
- package/dist/types/lib/group/Cards/types.d.ts.map +1 -0
- package/dist/types/lib/group/index.d.ts +3 -0
- package/dist/types/lib/group/index.d.ts.map +1 -0
- package/dist/types/lib/hooks/index.d.ts +3 -1
- package/dist/types/lib/hooks/index.d.ts.map +1 -1
- package/dist/types/lib/hooks/useContextualMenu/index.d.ts +3 -0
- package/dist/types/lib/hooks/useContextualMenu/index.d.ts.map +1 -0
- package/dist/types/lib/hooks/useContextualMenu/types.d.ts +71 -0
- package/dist/types/lib/hooks/useContextualMenu/types.d.ts.map +1 -0
- package/dist/types/lib/hooks/useContextualMenu/useContextualMenu.d.ts +20 -0
- package/dist/types/lib/hooks/useContextualMenu/useContextualMenu.d.ts.map +1 -0
- package/dist/types/lib/hooks/useDisclosure/index.d.ts +3 -0
- package/dist/types/lib/hooks/useDisclosure/index.d.ts.map +1 -0
- package/dist/types/lib/hooks/useDisclosure/types.d.ts +103 -0
- package/dist/types/lib/hooks/useDisclosure/types.d.ts.map +1 -0
- package/dist/types/lib/hooks/useDisclosure/useDisclosure.d.ts +32 -0
- package/dist/types/lib/hooks/useDisclosure/useDisclosure.d.ts.map +1 -0
- package/dist/types/lib/hooks/useIsMounted/index.d.ts +3 -0
- package/dist/types/lib/hooks/useIsMounted/index.d.ts.map +1 -0
- package/dist/types/lib/hooks/useIsMounted/types.d.ts +6 -0
- package/dist/types/lib/hooks/useIsMounted/types.d.ts.map +1 -0
- package/dist/types/lib/hooks/useIsMounted/useIsMounted.d.ts +15 -0
- package/dist/types/lib/hooks/useIsMounted/useIsMounted.d.ts.map +1 -0
- package/dist/types/lib/hooks/useResizeObserver/useResizeObserver.d.ts +6 -0
- package/dist/types/lib/hooks/useResizeObserver/useResizeObserver.d.ts.map +1 -1
- package/dist/types/lib/hooks/useWindowDimensions/useWindowDimensions.d.ts.map +1 -1
- package/dist/types/lib/hooks/useWindowFitment/index.d.ts +1 -0
- package/dist/types/lib/hooks/useWindowFitment/index.d.ts.map +1 -1
- package/dist/types/lib/hooks/useWindowFitment/readingDirection.d.ts +14 -0
- package/dist/types/lib/hooks/useWindowFitment/readingDirection.d.ts.map +1 -0
- package/dist/types/lib/hooks/useWindowFitment/types.d.ts +75 -4
- package/dist/types/lib/hooks/useWindowFitment/types.d.ts.map +1 -1
- package/dist/types/lib/hooks/useWindowFitment/useWindowFitment.d.ts +44 -2
- package/dist/types/lib/hooks/useWindowFitment/useWindowFitment.d.ts.map +1 -1
- package/dist/types/lib/index.d.ts +5 -25
- package/dist/types/lib/index.d.ts.map +1 -1
- package/dist/types/lib/pattern/index.d.ts +2 -0
- package/dist/types/lib/pattern/index.d.ts.map +1 -0
- package/dist/types/lib/subcomponent/Spinner/Spinner.d.ts +24 -0
- package/dist/types/lib/subcomponent/Spinner/Spinner.d.ts.map +1 -0
- package/dist/types/lib/subcomponent/Spinner/index.d.ts +3 -0
- package/dist/types/lib/subcomponent/Spinner/index.d.ts.map +1 -0
- package/dist/types/lib/subcomponent/Spinner/types.d.ts +17 -0
- package/dist/types/lib/subcomponent/Spinner/types.d.ts.map +1 -0
- package/dist/types/lib/subcomponent/index.d.ts +2 -0
- package/dist/types/lib/subcomponent/index.d.ts.map +1 -0
- package/dist/types/lib/types/index.d.ts +1 -0
- package/dist/types/lib/types/index.d.ts.map +1 -1
- package/dist/types/lib/types/link.d.ts +26 -0
- package/dist/types/lib/types/link.d.ts.map +1 -0
- package/package.json +16 -19
- package/dist/esm/lib/component/Card/common/Thumbnail/Thumbnail.js +0 -21
- package/dist/esm/lib/component/Card/common/Thumbnail/Thumbnail.js.map +0 -1
- package/dist/esm/lib/component/Card/common/Thumbnail/index.js +0 -2
- package/dist/esm/lib/component/Card/common/Thumbnail/index.js.map +0 -1
- package/dist/esm/lib/component/Card/common/Thumbnail/styles.css +0 -39
- package/dist/esm/lib/component/Card/common/Thumbnail/types.js.map +0 -1
- package/dist/esm/lib/hooks/usePopup/index.js +0 -3
- package/dist/esm/lib/hooks/usePopup/index.js.map +0 -1
- package/dist/esm/lib/hooks/usePopup/types.js.map +0 -1
- package/dist/esm/lib/hooks/usePopup/usePopup.js +0 -93
- package/dist/esm/lib/hooks/usePopup/usePopup.js.map +0 -1
- package/dist/esm/storybook/decorators.js +0 -16
- package/dist/esm/storybook/decorators.js.map +0 -1
- package/dist/types/lib/component/Card/common/Thumbnail/Thumbnail.d.ts +0 -23
- package/dist/types/lib/component/Card/common/Thumbnail/Thumbnail.d.ts.map +0 -1
- package/dist/types/lib/component/Card/common/Thumbnail/index.d.ts +0 -3
- package/dist/types/lib/component/Card/common/Thumbnail/index.d.ts.map +0 -1
- package/dist/types/lib/component/Card/common/Thumbnail/types.d.ts +0 -27
- package/dist/types/lib/component/Card/common/Thumbnail/types.d.ts.map +0 -1
- package/dist/types/lib/hooks/usePopup/index.d.ts +0 -3
- package/dist/types/lib/hooks/usePopup/index.d.ts.map +0 -1
- package/dist/types/lib/hooks/usePopup/types.d.ts +0 -65
- package/dist/types/lib/hooks/usePopup/types.d.ts.map +0 -1
- package/dist/types/lib/hooks/usePopup/usePopup.d.ts +0 -19
- package/dist/types/lib/hooks/usePopup/usePopup.d.ts.map +0 -1
- package/dist/types/storybook/decorators.d.ts +0 -15
- package/dist/types/storybook/decorators.d.ts.map +0 -1
- /package/dist/esm/lib/component/{Card/common/Thumbnail → ContextualMenu/common/Item}/types.js +0 -0
- /package/dist/esm/lib/{hooks/usePopup → component/ContextualMenu}/types.js +0 -0
package/README.md
CHANGED
|
@@ -57,6 +57,39 @@ import "@canonical/styles";
|
|
|
57
57
|
|
|
58
58
|
`@canonical/styles` provides the global design tokens (colour, spacing, typography). Each component in this package co-locates its own component-level tokens in a `styles.css` file next to the component source. These component tokens reference the global tokens from `@canonical/design-tokens` and are included automatically when the component is imported.
|
|
59
59
|
|
|
60
|
+
## Icon assets
|
|
61
|
+
|
|
62
|
+
Components that render an icon — `Icon`, `Spinner`, and any component with an
|
|
63
|
+
icon affordance (e.g. the `Accordion` caret) — reference SVGs from
|
|
64
|
+
`@canonical/ds-assets` **at runtime**, not from the JavaScript bundle. Each
|
|
65
|
+
glyph is fetched by URL, e.g. `/icons/spinner.svg#spinner`.
|
|
66
|
+
|
|
67
|
+
Your application must therefore **serve the `@canonical/ds-assets` icons at
|
|
68
|
+
`/icons`**. In most setups this means copying (or symlinking) the package's
|
|
69
|
+
`icons/` directory into the app's static/public directory so the files are
|
|
70
|
+
reachable at `/icons/*.svg`. If the icons are not served, icon-rendering
|
|
71
|
+
components mount but appear empty (the SVG `<use>` resolves to nothing).
|
|
72
|
+
|
|
73
|
+
If you serve the icons from a different path:
|
|
74
|
+
|
|
75
|
+
- **`Icon` and `Spinner`** accept a `rootPath` prop (default `/icons`) to
|
|
76
|
+
override the location per instance:
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
<Spinner rootPath="/assets/icons" />
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
There is currently no global default — the override is per component
|
|
83
|
+
instance.
|
|
84
|
+
|
|
85
|
+
- **CSS-referenced icons** (such as the `Accordion` caret) are fixed at
|
|
86
|
+
`/icons` in the stylesheet and cannot be redirected via a prop. Serve the
|
|
87
|
+
icons at `/icons`, or override the relevant component CSS custom property in
|
|
88
|
+
your own styles.
|
|
89
|
+
|
|
90
|
+
A single global source of truth for the icon root is planned; until then,
|
|
91
|
+
serving the assets at `/icons` is the path of least resistance.
|
|
92
|
+
|
|
60
93
|
## Storybook
|
|
61
94
|
|
|
62
95
|
Each component includes Storybook stories demonstrating usage patterns and variants:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "./styles.css";
|
|
3
|
-
import { Icon } from "
|
|
3
|
+
import { Icon } from "../../component/Icon/index.js";
|
|
4
4
|
import { TSection } from "../TSection/index.js";
|
|
5
5
|
const componentCssClassName = "ds icon-section";
|
|
6
6
|
const iconSelection = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconSection.js","sourceRoot":"","sources":["../../../../../src/lib/_work_in_progress/IconSection/IconSection.tsx"],"names":[],"mappings":";AAMA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"IconSection.js","sourceRoot":"","sources":["../../../../../src/lib/_work_in_progress/IconSection/IconSection.tsx"],"names":[],"mappings":";AAMA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEhD,MAAM,aAAa,GAAe;IAChC,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,UAAU;IACV,WAAW;IACX,KAAK;IACL,WAAW;IACX,cAAc;IACd,eAAe;IACf,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,QAAQ;IACR,UAAU;IACV,MAAM;IACN,OAAO;IACP,eAAe;IACf,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,MAAM;IACN,aAAa;IACb,MAAM;IACN,MAAM;IACN,eAAe;IACf,MAAM;IACN,QAAQ;IACR,UAAU;CACX,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,GAAG,CAAC,EACnB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACS,EAAmB,EAAE;IACtC,OAAO,CACL,KAAC,QAAQ,IACP,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACnE,KAAK,YAER,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC3B,cAAgB,SAAS,EAAC,cAAc,YACtC,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,GAAI,IADZ,IAAI,CAER,CACP,CAAC,GACO,CACZ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Work-in-progress tier barrel: components not yet promoted to a stable tier.
|
|
2
|
+
export * from "./CategoriesSection/index.js";
|
|
3
|
+
export * from "./ChatSection/index.js";
|
|
4
|
+
export * from "./DescriptionSection/index.js";
|
|
5
|
+
export * from "./grid/index.js";
|
|
6
|
+
export * from "./IconSection/index.js";
|
|
7
|
+
export * from "./Label/index.js";
|
|
8
|
+
export * from "./Link/index.js";
|
|
9
|
+
export * from "./Rule/index.js";
|
|
10
|
+
export * from "./Section/index.js";
|
|
11
|
+
export * from "./SkipLink/index.js";
|
|
12
|
+
export * from "./TSection/index.js";
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/_work_in_progress/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
* auto-steps on nested .surface contexts to layer2/layer3), text uses
|
|
9
9
|
* color-text, the chevron uses color-icon, and dividers use color-border-muted.
|
|
10
10
|
* Vertical padding is expressed in baseline multiples.
|
|
11
|
+
*
|
|
12
|
+
* NOTE: the apps/sites element-size sizing (collapsed item at 36px sites / 32px
|
|
13
|
+
* apps, and the matching h6 line box) is intentionally NOT set here — control
|
|
14
|
+
* heights across apps vs sites are owned by the density/height bucket, not this
|
|
15
|
+
* design-review geometry pass.
|
|
11
16
|
*/
|
|
12
17
|
:root {
|
|
13
18
|
--accordion-item-color-text: var(--color-text);
|
|
@@ -25,16 +30,20 @@
|
|
|
25
30
|
/* Default header background (surface 1). The surface channel is applied on
|
|
26
31
|
the element below — NOT here — because a var() referencing
|
|
27
32
|
--surface-color-foreground-ghost resolved in :root would capture the :root
|
|
28
|
-
value (where no .surface is active) and never step. The surface
|
|
29
|
-
re-channels the base ghost (no hover/active channel), so
|
|
30
|
-
to the non-layered ghost vars
|
|
33
|
+
value (where no .surface is active) and never step. The built surface
|
|
34
|
+
layer re-channels only the base ghost (no hover/active channel), so
|
|
35
|
+
hover/active default to the non-layered ghost state vars here and are
|
|
36
|
+
re-pointed per surface nesting depth by the stopgap rules below the
|
|
37
|
+
header. */
|
|
31
38
|
--accordion-item-header-background: var(--color-foreground-ghost);
|
|
32
39
|
--accordion-item-header-background-hover: var(--color-foreground-ghost-hover);
|
|
33
40
|
--accordion-item-header-background-active: var(
|
|
34
41
|
--color-foreground-ghost-active
|
|
35
42
|
);
|
|
36
43
|
|
|
37
|
-
--accordion-item-header-gap: var(--dimension-
|
|
44
|
+
--accordion-item-header-gap: var(--dimension-200);
|
|
45
|
+
/* Header block padding in baseline multiples (dimension-100 = 1 bU). The
|
|
46
|
+
apps/sites element-size sizing (6px → 36/32) is owned by the height bucket. */
|
|
38
47
|
--accordion-item-header-padding-block: var(--dimension-100);
|
|
39
48
|
--accordion-item-header-padding-inline: var(--dimension-200);
|
|
40
49
|
|
|
@@ -95,79 +104,81 @@
|
|
|
95
104
|
display: none;
|
|
96
105
|
}
|
|
97
106
|
|
|
107
|
+
/* Prefer the surface hover/active channels so a future token build that
|
|
108
|
+
ships them steps automatically; today they are unset everywhere, so these
|
|
109
|
+
resolve to the fallback tokens, re-pointed per nesting depth below. */
|
|
98
110
|
&:hover {
|
|
99
|
-
background-color: var(
|
|
111
|
+
background-color: var(
|
|
112
|
+
--surface-color-foreground-ghost-hover,
|
|
113
|
+
var(--accordion-item-header-background-hover)
|
|
114
|
+
);
|
|
100
115
|
}
|
|
101
116
|
|
|
102
117
|
&:active {
|
|
103
|
-
background-color: var(
|
|
118
|
+
background-color: var(
|
|
119
|
+
--surface-color-foreground-ghost-active,
|
|
120
|
+
var(--accordion-item-header-background-active)
|
|
121
|
+
);
|
|
104
122
|
}
|
|
105
123
|
}
|
|
106
124
|
|
|
125
|
+
/* STOPGAP — step the header hover/active backgrounds with surface nesting.
|
|
126
|
+
The built surfaces modifier re-channels only the base ghost (it exposes no
|
|
127
|
+
--surface-color-foreground-ghost-hover/-active), so without this, hovering
|
|
128
|
+
a header on a layer-2/3 surface painted the base-layer colour. These rules
|
|
129
|
+
mirror the modifier's own nesting selectors to re-point the hover/active
|
|
130
|
+
tokens at the layered state tokens. Hard-coding surface depth in component
|
|
131
|
+
CSS is exactly what the token block above avoids — delete both rules once
|
|
132
|
+
the surfaces modifier ships the hover/active channels (the :hover/:active
|
|
133
|
+
rules above already prefer them). */
|
|
134
|
+
.surface .surface .ds.accordion-item {
|
|
135
|
+
--accordion-item-header-background-hover: var(
|
|
136
|
+
--color-foreground-ghost-layer2-hover
|
|
137
|
+
);
|
|
138
|
+
--accordion-item-header-background-active: var(
|
|
139
|
+
--color-foreground-ghost-layer2-active
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.surface .surface .surface .ds.accordion-item {
|
|
144
|
+
--accordion-item-header-background-hover: var(
|
|
145
|
+
--color-foreground-ghost-layer3-hover
|
|
146
|
+
);
|
|
147
|
+
--accordion-item-header-background-active: var(
|
|
148
|
+
--color-foreground-ghost-layer3-active
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
107
152
|
/* The consumer supplies the heading content — plain text by default (rendered
|
|
108
|
-
as body
|
|
109
|
-
|
|
153
|
+
as the text-primary body tier) or an <h6>, which renders at the heading-6
|
|
154
|
+
tier. Only those two type tokens are allowed on the accordion heading; any
|
|
155
|
+
other heading element is normalised to the text-primary body tier. */
|
|
110
156
|
.ds.accordion-item > .header > .heading {
|
|
111
157
|
flex: 1;
|
|
112
158
|
min-width: 0;
|
|
113
159
|
|
|
114
|
-
/* Default: body copy for plain
|
|
160
|
+
/* Default: body copy (text-primary) for plain text and any heading element. */
|
|
115
161
|
font-family: var(--typography-text-primary-font-family);
|
|
116
162
|
font-size: var(--typography-text-primary-font-size);
|
|
117
163
|
font-weight: var(--typography-text-primary-font-weight);
|
|
118
164
|
line-height: var(--typography-text-primary-line-height);
|
|
119
165
|
letter-spacing: var(--typography-text-primary-letter-spacing);
|
|
120
166
|
|
|
121
|
-
|
|
167
|
+
/* Normalise every heading element except <h6> down to the inherited body
|
|
168
|
+
tier. <h6> keeps the base h6 tier from @canonical/styles-typography
|
|
169
|
+
(correct heading-6 tokens, including the baseline-snapped line-height) — no
|
|
170
|
+
heading-6 tokens are restated here.
|
|
171
|
+
NOTE: the per-context h6 line box (24px sites / 20px apps) and zeroing the
|
|
172
|
+
heading padding-block nudges to make the header height padding-driven are
|
|
173
|
+
part of the apps/sites height bucket, not this pass. */
|
|
174
|
+
& :is(h1, h2, h3, h4, h5) {
|
|
122
175
|
margin: 0;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
& h1 {
|
|
126
|
-
font-family: var(--typography-heading-1-font-family);
|
|
127
|
-
font-size: var(--typography-heading-1-font-size);
|
|
128
|
-
font-weight: var(--typography-heading-1-font-weight);
|
|
129
|
-
line-height: var(--typography-heading-1-line-height);
|
|
130
|
-
letter-spacing: var(--typography-heading-1-letter-spacing);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
& h2 {
|
|
134
|
-
font-family: var(--typography-heading-2-font-family);
|
|
135
|
-
font-size: var(--typography-heading-2-font-size);
|
|
136
|
-
font-weight: var(--typography-heading-2-font-weight);
|
|
137
|
-
line-height: var(--typography-heading-2-line-height);
|
|
138
|
-
letter-spacing: var(--typography-heading-2-letter-spacing);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
& h3 {
|
|
142
|
-
font-family: var(--typography-heading-3-font-family);
|
|
143
|
-
font-size: var(--typography-heading-3-font-size);
|
|
144
|
-
font-weight: var(--typography-heading-3-font-weight);
|
|
145
|
-
line-height: var(--typography-heading-3-line-height);
|
|
146
|
-
letter-spacing: var(--typography-heading-3-letter-spacing);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
& h4 {
|
|
150
|
-
font-family: var(--typography-heading-4-font-family);
|
|
151
|
-
font-size: var(--typography-heading-4-font-size);
|
|
152
|
-
font-weight: var(--typography-heading-4-font-weight);
|
|
153
|
-
line-height: var(--typography-heading-4-line-height);
|
|
154
|
-
letter-spacing: var(--typography-heading-4-letter-spacing);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
& h5 {
|
|
158
|
-
font-family: var(--typography-heading-5-font-family);
|
|
159
|
-
font-size: var(--typography-heading-5-font-size);
|
|
160
|
-
font-weight: var(--typography-heading-5-font-weight);
|
|
161
|
-
line-height: var(--typography-heading-5-line-height);
|
|
162
|
-
letter-spacing: var(--typography-heading-5-letter-spacing);
|
|
176
|
+
font: inherit;
|
|
177
|
+
letter-spacing: inherit;
|
|
163
178
|
}
|
|
164
179
|
|
|
165
180
|
& h6 {
|
|
166
|
-
|
|
167
|
-
font-size: var(--typography-heading-6-font-size);
|
|
168
|
-
font-weight: var(--typography-heading-6-font-weight);
|
|
169
|
-
line-height: var(--typography-heading-6-line-height);
|
|
170
|
-
letter-spacing: var(--typography-heading-6-letter-spacing);
|
|
181
|
+
margin: 0;
|
|
171
182
|
}
|
|
172
183
|
}
|
|
173
184
|
|
|
@@ -182,16 +193,22 @@
|
|
|
182
193
|
transition: transform var(--motion-duration-fast)
|
|
183
194
|
var(--motion-easing-standard);
|
|
184
195
|
|
|
196
|
+
/* Chevron glyph from the Canonical icon set, masked so it can take the theme
|
|
197
|
+
icon colour (same technique as CheckboxInput's checkmark). */
|
|
185
198
|
&::before {
|
|
186
199
|
content: "";
|
|
187
200
|
display: block;
|
|
188
201
|
width: 100%;
|
|
189
202
|
height: 100%;
|
|
190
203
|
background-color: var(--accordion-item-color-icon);
|
|
191
|
-
mask-image: url("
|
|
204
|
+
mask-image: url("/icons/chevron-down.svg#chevron-down");
|
|
192
205
|
mask-repeat: no-repeat;
|
|
193
206
|
mask-position: center;
|
|
194
207
|
mask-size: contain;
|
|
208
|
+
-webkit-mask-image: url("/icons/chevron-down.svg#chevron-down");
|
|
209
|
+
-webkit-mask-repeat: no-repeat;
|
|
210
|
+
-webkit-mask-position: center;
|
|
211
|
+
-webkit-mask-size: contain;
|
|
195
212
|
}
|
|
196
213
|
}
|
|
197
214
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Accordion styles
|
|
3
|
-
* @implements
|
|
3
|
+
* @implements ds:global.component.accordion
|
|
4
4
|
*
|
|
5
5
|
* DSL anatomy mapping:
|
|
6
6
|
* - layout.type: stack -> display: flex; flex-direction: column
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
display: flex;
|
|
19
19
|
flex-direction: column;
|
|
20
20
|
|
|
21
|
+
/* When placed in a grid, span all columns (inert outside a grid). The
|
|
22
|
+
accordion is a full-width block, not a grid cell. */
|
|
23
|
+
grid-column: 1 / -1;
|
|
24
|
+
|
|
21
25
|
/* The accordion background uses the surface channel, which auto-steps with
|
|
22
26
|
.surface nesting (surface 1 -> base, 2 -> layer2, 3 -> layer3). Referenced
|
|
23
27
|
here on the element (not in :root) so the value resolves in the element's
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "./styles.css";
|
|
3
3
|
const componentCssClassName = "ds announcement";
|
|
4
4
|
/**
|
|
5
5
|
* The announcement is a persistent, high-visibility UI block used to
|
|
6
6
|
* communicate time-sensitive or critical contextual information directly within
|
|
7
7
|
* a page. It is not triggered by specific system or user events; instead, it is
|
|
8
|
-
* a non-transient call-out used for broad
|
|
8
|
+
* a non-transient call-out used for broad organisational updates, compliance
|
|
9
9
|
* warnings, or upcoming deadlines.
|
|
10
10
|
*
|
|
11
11
|
* @implements ds:global.component.announcement
|
|
12
12
|
*/
|
|
13
|
-
const Announcement = ({
|
|
13
|
+
const Announcement = ({ criticality = "information", heading, children, className, ...props }) => (_jsxs("div", { className: [componentCssClassName, criticality, className]
|
|
14
|
+
.filter(Boolean)
|
|
15
|
+
.join(" "), ...props, children: [_jsx("span", { className: "icon", "aria-hidden": "true" }), _jsxs("span", { className: "text", children: [heading != null && _jsx("span", { className: "heading", children: heading }), _jsx("span", { className: "content", children: children })] })] }));
|
|
14
16
|
export default Announcement;
|
|
15
17
|
//# sourceMappingURL=Announcement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Announcement.js","sourceRoot":"","sources":["../../../../../src/lib/component/Announcement/Announcement.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,YAAY,GAAG,CAAC,EACpB,
|
|
1
|
+
{"version":3,"file":"Announcement.js","sourceRoot":"","sources":["../../../../../src/lib/component/Announcement/Announcement.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,YAAY,GAAG,CAAC,EACpB,WAAW,GAAG,aAAa,EAC3B,OAAO,EACP,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACU,EAAsB,EAAE,CAAC,CAC3C,eACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,WAAW,EAAE,SAAS,CAAC;SACvD,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,KACR,KAAK,aAOT,eAAM,SAAS,EAAC,MAAM,iBAAa,MAAM,GAAG,EAC5C,gBAAM,SAAS,EAAC,MAAM,aACnB,OAAO,IAAI,IAAI,IAAI,eAAM,SAAS,EAAC,SAAS,YAAE,OAAO,GAAQ,EAC9D,eAAM,SAAS,EAAC,SAAS,YAAE,QAAQ,GAAQ,IACtC,IACH,CACP,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/lib/component/Announcement/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/lib/component/Announcement/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,48 +1,72 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Announcement styles
|
|
3
|
-
* @implements
|
|
3
|
+
* @implements ds:global.component.announcement
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
5
|
+
* Criticality-wired (this pass). The `criticality` prop applies a modifier
|
|
6
|
+
* class (.information | .success | .warning | .error) from the criticality
|
|
7
|
+
* modifier family (@canonical/design-tokens → modifiers.criticality.css), which
|
|
8
|
+
* remaps the --modifier-color-* channels. The criticality tints the SURFACE —
|
|
9
|
+
* background, side bar, and icon — via those channels; the text stays the
|
|
10
|
+
* neutral root colour (`--color-text`) on every criticality, per Figma. The
|
|
11
|
+
* component restates no criticality token; it only reads channels. The default
|
|
12
|
+
* look comes from the `criticality="information"` prop default, which applies
|
|
13
|
+
* `.information` and supplies the channel values; no class ⇒ no tint, by design.
|
|
14
|
+
*
|
|
15
|
+
* The icon is driven the same way: `--modifier-icon` (a mask-image, supplied by
|
|
16
|
+
* @canonical/styles' criticality shim) picks the glyph for the type, and
|
|
17
|
+
* `--modifier-color-icon` fills it. No per-criticality markup in the component.
|
|
18
|
+
*
|
|
19
|
+
* NOTE: full token pairing (spacing, typography, radius) is deferred to ADR-Q02.
|
|
20
|
+
* The values below cover layout + the criticality colour surface + the side bar.
|
|
15
21
|
*/
|
|
16
22
|
|
|
17
|
-
:root {
|
|
18
|
-
--announcement-color-background: var(
|
|
19
|
-
--color-surface-announcement,
|
|
20
|
-
var(--color-foreground-ghost)
|
|
21
|
-
);
|
|
22
|
-
--announcement-color-text: var(
|
|
23
|
-
--color-text-on-announcement,
|
|
24
|
-
var(--color-text)
|
|
25
|
-
);
|
|
26
|
-
--announcement-font-size: var(--font-size-small);
|
|
27
|
-
--announcement-color-border: var(--color-border);
|
|
28
|
-
--announcement-padding-vertical: var(--spacing-input-padding-vertical);
|
|
29
|
-
--announcement-padding-horizontal: var(--spacing-horizontal-large);
|
|
30
|
-
--announcement-border-width: var(--spacing-border-width);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
23
|
.ds.announcement {
|
|
34
24
|
display: flex;
|
|
35
25
|
flex-direction: row;
|
|
36
|
-
align-items:
|
|
37
|
-
|
|
26
|
+
align-items: flex-start;
|
|
27
|
+
gap: var(--dimension-100);
|
|
28
|
+
|
|
29
|
+
/* Side bar (Figma part 4): leading rule carrying the criticality colour. */
|
|
30
|
+
border-inline-start-style: solid;
|
|
31
|
+
border-inline-start-width: var(--dimension-stroke-thickness-large);
|
|
32
|
+
border-inline-start-color: var(--modifier-color-border);
|
|
33
|
+
|
|
34
|
+
padding: var(--dimension-100);
|
|
35
|
+
|
|
36
|
+
/* Text is always the root text colour — the criticality tints the icon,
|
|
37
|
+
side bar and background, but the copy stays neutral (Figma: color/text/root
|
|
38
|
+
on every criticality). Only the icon reads the criticality colour channel. */
|
|
39
|
+
color: var(--color-text);
|
|
40
|
+
background-color: var(--modifier-color-foreground-secondary);
|
|
38
41
|
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
/* Icon — a masked box. The glyph shape comes from the criticality modifier's
|
|
43
|
+
--modifier-icon channel; the fill from --modifier-color-icon. Masking (not
|
|
44
|
+
background-image) so the glyph takes the theme colour — same technique as
|
|
45
|
+
Accordion's chevron and the form CheckboxInput checkmark. */
|
|
46
|
+
& > .icon {
|
|
47
|
+
flex: 0 0 auto;
|
|
48
|
+
inline-size: var(--dimension-200);
|
|
49
|
+
block-size: var(--dimension-200);
|
|
50
|
+
background-color: var(--modifier-color-icon);
|
|
51
|
+
mask-image: var(--modifier-icon);
|
|
52
|
+
mask-repeat: no-repeat;
|
|
53
|
+
mask-position: center;
|
|
54
|
+
mask-size: contain;
|
|
55
|
+
-webkit-mask-image: var(--modifier-icon);
|
|
56
|
+
-webkit-mask-repeat: no-repeat;
|
|
57
|
+
-webkit-mask-position: center;
|
|
58
|
+
-webkit-mask-size: contain;
|
|
59
|
+
}
|
|
41
60
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
61
|
+
& > .text {
|
|
62
|
+
display: flex;
|
|
63
|
+
flex: 1 1 auto;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
gap: var(--dimension-050);
|
|
66
|
+
min-width: 0;
|
|
67
|
+
}
|
|
45
68
|
|
|
46
|
-
|
|
47
|
-
|
|
69
|
+
& .heading {
|
|
70
|
+
font-weight: var(--typography-text-primary-bold-font-weight);
|
|
71
|
+
}
|
|
48
72
|
}
|
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
--badge-color-
|
|
1
|
+
/* Badge.css */
|
|
2
|
+
.ds.badge {
|
|
3
|
+
/* Component tokens — sourced from @canonical/design-tokens */
|
|
4
|
+
--badge-color-background: var(--color-foreground-secondary);
|
|
5
|
+
--badge-color-text: var(--color-text-onForegroundSecondary);
|
|
5
6
|
|
|
6
|
-
--badge-border-radius:
|
|
7
|
-
--badge-font-
|
|
8
|
-
--badge-font-
|
|
9
|
-
--badge-
|
|
7
|
+
--badge-border-radius: var(--dimension-radius-full);
|
|
8
|
+
--badge-font-family: var(--typography-text-tertiary-bold-font-family);
|
|
9
|
+
--badge-font-size: var(--typography-text-tertiary-bold-font-size);
|
|
10
|
+
--badge-font-weight: var(--typography-text-tertiary-bold-font-weight);
|
|
11
|
+
--badge-letter-spacing: var(--typography-text-tertiary-bold-letter-spacing);
|
|
12
|
+
--badge-line-height: var(--typography-text-tertiary-bold-line-height);
|
|
10
13
|
--badge-padding-vertical: 0;
|
|
11
|
-
--badge-padding-horizontal: var(--
|
|
14
|
+
--badge-padding-horizontal: var(--dimension-050);
|
|
12
15
|
--badge-margin-bottom: 0;
|
|
13
16
|
|
|
14
|
-
--badge-
|
|
15
|
-
--badge-min-width: calc(
|
|
16
|
-
var(--badge-line-height) -
|
|
17
|
-
(2 * var(--badge-padding-horizontal))
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/* Badge.css */
|
|
22
|
-
.ds.badge {
|
|
23
|
-
/** Pull the badge closer to the edge of a chip */
|
|
24
|
-
--badge-chip-margin-tweak: 0.15rem;
|
|
17
|
+
--badge-min-width: calc(var(--badge-line-height) * 1em);
|
|
25
18
|
|
|
26
19
|
/* Base badge styles using tokens */
|
|
27
20
|
background-color: var(
|
|
@@ -29,16 +22,24 @@
|
|
|
29
22
|
var(--badge-color-background)
|
|
30
23
|
);
|
|
31
24
|
border-radius: var(--badge-border-radius);
|
|
32
|
-
box-sizing:
|
|
33
|
-
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
/* Label sits on the badge's own (criticality) surface, so it reads the
|
|
27
|
+
* on-surface text channel — NOT --modifier-color-text (the standalone
|
|
28
|
+
* criticality text colour), which would render same-hue-on-same-hue with
|
|
29
|
+
* failing contrast. Falls back to the neutral on-surface token for the
|
|
30
|
+
* default (no-criticality) badge. */
|
|
31
|
+
color: var(
|
|
32
|
+
--modifier-color-text-onForegroundSecondary,
|
|
33
|
+
var(--badge-color-text)
|
|
34
|
+
);
|
|
34
35
|
display: inline-block;
|
|
36
|
+
font-family: var(--badge-font-family);
|
|
35
37
|
font-size: var(--badge-font-size);
|
|
36
38
|
font-weight: var(--badge-font-weight);
|
|
39
|
+
letter-spacing: var(--badge-letter-spacing);
|
|
37
40
|
line-height: var(--badge-line-height);
|
|
38
41
|
margin-bottom: var(--badge-margin-bottom);
|
|
39
|
-
max-width: var(--badge-max-width);
|
|
40
42
|
min-width: var(--badge-min-width);
|
|
41
|
-
overflow: hidden;
|
|
42
43
|
padding: var(--badge-padding-vertical) var(--badge-padding-horizontal);
|
|
43
44
|
text-align: center;
|
|
44
45
|
}
|
|
@@ -5,8 +5,8 @@ import "./styles.css";
|
|
|
5
5
|
const componentCssClassName = "ds breadcrumbs";
|
|
6
6
|
/**
|
|
7
7
|
* Breadcrumbs are a navigational aid that shows users their current location
|
|
8
|
-
* within a site's information
|
|
9
|
-
* root of the information
|
|
8
|
+
* within a site's information architecture. They provide a clear path from the
|
|
9
|
+
* root of the information architecture (IA) to the current page, allowing users
|
|
10
10
|
* to quickly understand where they are and easily navigate back to previous
|
|
11
11
|
* levels in the IA. Breadcrumbs should reflect the IA, not the user's path
|
|
12
12
|
* they took to arrive at the current page. They work best in websites or
|
|
@@ -11,12 +11,22 @@ const componentCssClassName = "ds breadcrumbs-item";
|
|
|
11
11
|
*/
|
|
12
12
|
const Item = ({ children, label, url, current = false, separator = "/", disabled = false, className, LinkComponent = "a",
|
|
13
13
|
// Destructure Item props we don't spread to DOM
|
|
14
|
-
key: _key, items: _items,
|
|
14
|
+
key: _key, items: _items, Component: _Component, ...props }) => {
|
|
15
15
|
const content = children ?? label;
|
|
16
16
|
const Link = LinkComponent;
|
|
17
|
-
return (_jsxs("li", { className: [
|
|
17
|
+
return (_jsxs("li", { className: [
|
|
18
|
+
componentCssClassName,
|
|
19
|
+
current && "current",
|
|
20
|
+
disabled && "disabled",
|
|
21
|
+
className,
|
|
22
|
+
]
|
|
18
23
|
.filter(Boolean)
|
|
19
|
-
.join(" "), ...props, children: [
|
|
24
|
+
.join(" "), ...props, children: [_jsx("span", { className: "separator", "aria-hidden": "true", children: separator }), current || disabled ? (
|
|
25
|
+
// `aria-disabled` is only honored by AT on elements with a widget role;
|
|
26
|
+
// a bare `<span>` has none, so `role="link"` is added when disabled to
|
|
27
|
+
// give it the role this item represents. This way, the disabled item
|
|
28
|
+
// is announced as a disabled link.
|
|
29
|
+
_jsx("span", { className: "link", "aria-current": current ? "page" : undefined, "aria-disabled": disabled ? "true" : undefined, role: disabled ? "link" : undefined, children: content })) : (_jsx(Link, { className: "link", href: url, children: content }))] }));
|
|
20
30
|
};
|
|
21
31
|
Item.displayName = "Breadcrumbs.Item";
|
|
22
32
|
export default Item;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../../../../src/lib/component/Breadcrumbs/common/Item/Item.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,QAAQ,EACR,KAAK,EACL,GAAG,EACH,OAAO,GAAG,KAAK,EACf,SAAS,GAAG,GAAG,EACf,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,aAAa,GAAG,GAAG;AACnB,gDAAgD;AAChD,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,MAAM,EACb,
|
|
1
|
+
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../../../../src/lib/component/Breadcrumbs/common/Item/Item.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,QAAQ,EACR,KAAK,EACL,GAAG,EACH,OAAO,GAAG,KAAK,EACf,SAAS,GAAG,GAAG,EACf,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,aAAa,GAAG,GAAG;AACnB,gDAAgD;AAChD,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,UAAU,EACrB,GAAG,KAAK,EACE,EAAsB,EAAE;IAClC,MAAM,OAAO,GAAG,QAAQ,IAAI,KAAK,CAAC;IAClC,MAAM,IAAI,GAAG,aAAa,CAAC;IAE3B,OAAO,CACL,cACE,SAAS,EAAE;YACT,qBAAqB;YACrB,OAAO,IAAI,SAAS;YACpB,QAAQ,IAAI,UAAU;YACtB,SAAS;SACV;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,KACR,KAAK,aAMT,eAAM,SAAS,EAAC,WAAW,iBAAa,MAAM,YAC3C,SAAS,GACL,EAEN,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC;YACrB,wEAAwE;YACxE,uEAAuE;YACvE,qEAAqE;YACrE,mCAAmC;YACnC,eACE,SAAS,EAAC,MAAM,kBACF,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,mBAC3B,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC5C,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,YAElC,OAAO,GACH,CACR,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,SAAS,EAAC,MAAM,EAAC,IAAI,EAAE,GAAG,YAC7B,OAAO,GACH,CACR,IACE,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,IAAI,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAEtC,eAAe,IAAI,CAAC"}
|
|
@@ -12,15 +12,16 @@
|
|
|
12
12
|
* dimension scale (Figma specs 6px, which is not on the scale; the nearest
|
|
13
13
|
* token is dimension-100 = 8px).
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
.ds.breadcrumbs-item {
|
|
16
|
+
/* Component tokens — pure aliases to semantic tokens, component-scoped
|
|
17
|
+
per cs:styling.tokens.scoping */
|
|
16
18
|
--breadcrumbs-item-link-color: var(--color-text-link);
|
|
17
19
|
--breadcrumbs-item-current-color: var(--color-text);
|
|
20
|
+
--breadcrumbs-item-disabled-color: var(--color-text-disabled);
|
|
18
21
|
--breadcrumbs-item-separator-color: var(--color-text);
|
|
19
22
|
--breadcrumbs-item-separator-margin: var(--dimension-100);
|
|
20
23
|
--breadcrumbs-item-focus-color: var(--color-text-link);
|
|
21
|
-
}
|
|
22
24
|
|
|
23
|
-
.ds.breadcrumbs-item {
|
|
24
25
|
/* layout.type: flow, layout.direction: horizontal */
|
|
25
26
|
display: flex;
|
|
26
27
|
flex-direction: row;
|
|
@@ -48,13 +49,14 @@
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
/* Separator element — DSL role: separator.
|
|
52
|
+
/* Separator element — DSL role: separator. Rendered before the link so a
|
|
53
|
+
wrapped row starts with the slash; hidden on the first item. */
|
|
52
54
|
& > .separator {
|
|
53
55
|
margin-inline: var(--breadcrumbs-item-separator-margin);
|
|
54
56
|
color: var(--breadcrumbs-item-separator-color);
|
|
55
57
|
}
|
|
56
58
|
|
|
57
|
-
&:
|
|
59
|
+
&:first-of-type > .separator {
|
|
58
60
|
display: none;
|
|
59
61
|
}
|
|
60
62
|
|
|
@@ -67,4 +69,14 @@
|
|
|
67
69
|
text-decoration: none;
|
|
68
70
|
}
|
|
69
71
|
}
|
|
72
|
+
|
|
73
|
+
/* Disabled item (not a link) */
|
|
74
|
+
&.disabled > .link {
|
|
75
|
+
color: var(--breadcrumbs-item-disabled-color);
|
|
76
|
+
cursor: not-allowed;
|
|
77
|
+
|
|
78
|
+
&:hover {
|
|
79
|
+
text-decoration: none;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
70
82
|
}
|