@canonical/react-ds-global 0.29.0 → 0.30.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/Accordion.js +2 -0
- package/dist/esm/lib/component/Accordion/Accordion.js.map +1 -1
- package/dist/esm/lib/component/Accordion/common/Item/styles.css +19 -50
- 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/Breadcrumbs/Breadcrumbs.js +2 -0
- package/dist/esm/lib/component/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/esm/lib/component/Breadcrumbs/common/Item/Item.js +1 -1
- package/dist/esm/lib/component/Breadcrumbs/common/Item/Item.js.map +1 -1
- package/dist/esm/lib/component/Button/Button.js +13 -5
- package/dist/esm/lib/component/Button/Button.js.map +1 -1
- package/dist/esm/lib/component/Button/styles.css +135 -39
- package/dist/esm/lib/component/Card/Card.js +9 -6
- package/dist/esm/lib/component/Card/Card.js.map +1 -1
- package/dist/esm/lib/component/Card/common/Content/styles.css +1 -1
- package/dist/esm/lib/component/Card/common/Footer/Footer.js +1 -1
- package/dist/esm/lib/component/Card/common/Footer/styles.css +1 -1
- 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 +8 -8
- package/dist/esm/lib/component/ContextualMenu/ContextualMenu.js +94 -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 +93 -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 +109 -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/Icon/Icon.js +3 -0
- package/dist/esm/lib/component/Icon/Icon.js.map +1 -1
- package/dist/esm/lib/component/InlineCode/InlineCode.js +2 -0
- package/dist/esm/lib/component/InlineCode/InlineCode.js.map +1 -1
- package/dist/esm/lib/component/KeyboardKey/KeyboardKey.js +2 -0
- package/dist/esm/lib/component/KeyboardKey/KeyboardKey.js.map +1 -1
- 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 +47 -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/KeyboardKeys/KeyboardKeys.js +3 -0
- package/dist/esm/lib/group/KeyboardKeys/KeyboardKeys.js.map +1 -1
- package/dist/esm/lib/group/index.js +3 -0
- package/dist/esm/lib/group/index.js.map +1 -0
- package/dist/esm/lib/hooks/index.js +2 -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 +175 -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/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/Accordion/Accordion.d.ts +2 -0
- package/dist/types/lib/component/Accordion/Accordion.d.ts.map +1 -1
- 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 -1
- package/dist/types/lib/component/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- 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 +8 -13
- package/dist/types/lib/component/Breadcrumbs/common/Item/types.d.ts.map +1 -1
- package/dist/types/lib/component/Breadcrumbs/types.d.ts +8 -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 +8 -4
- package/dist/types/lib/component/Button/types.d.ts.map +1 -1
- package/dist/types/lib/component/Card/Card.d.ts +3 -5
- package/dist/types/lib/component/Card/Card.d.ts.map +1 -1
- package/dist/types/lib/component/Card/common/Footer/Footer.d.ts +1 -1
- package/dist/types/lib/component/Card/common/Footer/types.d.ts +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/Icon/Icon.d.ts +3 -0
- package/dist/types/lib/component/Icon/Icon.d.ts.map +1 -1
- package/dist/types/lib/component/InlineCode/InlineCode.d.ts +2 -0
- package/dist/types/lib/component/InlineCode/InlineCode.d.ts.map +1 -1
- package/dist/types/lib/component/KeyboardKey/KeyboardKey.d.ts +2 -0
- package/dist/types/lib/component/KeyboardKey/KeyboardKey.d.ts.map +1 -1
- 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 +2 -2
- 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/KeyboardKeys/KeyboardKeys.d.ts +3 -0
- package/dist/types/lib/group/KeyboardKeys/KeyboardKeys.d.ts.map +1 -1
- package/dist/types/lib/group/index.d.ts +2 -0
- package/dist/types/lib/group/index.d.ts.map +1 -0
- package/dist/types/lib/hooks/index.d.ts +2 -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/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"}
|
|
@@ -12,6 +12,8 @@ const componentCssClassName = "ds accordion";
|
|
|
12
12
|
* efficient way. Be wary that they can also hide content from users and are
|
|
13
13
|
* not suitable when a user is meant to read all of the page content.
|
|
14
14
|
*
|
|
15
|
+
* `import { Accordion } from "@canonical/react-ds-global";`
|
|
16
|
+
*
|
|
15
17
|
* @implements dso:global.component.accordion
|
|
16
18
|
*/
|
|
17
19
|
const Accordion = ({ className, children, ...props }) => (_jsx("div", { className: [componentCssClassName, className].filter(Boolean).join(" "), ...props, children: children }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../../../../src/lib/component/Accordion/Accordion.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAE7C
|
|
1
|
+
{"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../../../../src/lib/component/Accordion/Accordion.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAE7C;;;;;;;;;;;;;GAaG;AACH,MAAM,SAAS,GAAG,CAAC,EACjB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACO,EAAsB,EAAE,CAAC,CACxC,cACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACnE,KAAK,YAER,QAAQ,GACL,CACP,CAAC;AAEF,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;AAEtB,eAAe,SAAS,CAAC"}
|
|
@@ -105,69 +105,32 @@
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
/* The consumer supplies the heading content — plain text by default (rendered
|
|
108
|
-
as body
|
|
109
|
-
|
|
108
|
+
as the text-primary body tier) or an <h6>, which renders at the heading-6
|
|
109
|
+
tier. Only those two type tokens are allowed on the accordion heading; any
|
|
110
|
+
other heading element is normalised to the text-primary body tier. */
|
|
110
111
|
.ds.accordion-item > .header > .heading {
|
|
111
112
|
flex: 1;
|
|
112
113
|
min-width: 0;
|
|
113
114
|
|
|
114
|
-
/* Default: body copy for plain
|
|
115
|
+
/* Default: body copy (text-primary) for plain text and any heading element. */
|
|
115
116
|
font-family: var(--typography-text-primary-font-family);
|
|
116
117
|
font-size: var(--typography-text-primary-font-size);
|
|
117
118
|
font-weight: var(--typography-text-primary-font-weight);
|
|
118
119
|
line-height: var(--typography-text-primary-line-height);
|
|
119
120
|
letter-spacing: var(--typography-text-primary-letter-spacing);
|
|
120
121
|
|
|
121
|
-
|
|
122
|
+
/* Normalise every heading element except <h6> down to the inherited body
|
|
123
|
+
tier. <h6> is left untouched so the base h6 tier from
|
|
124
|
+
@canonical/styles-typography applies (correct heading-6 tokens, including
|
|
125
|
+
the baseline-snapped line-height) — no heading-6 tokens are restated here. */
|
|
126
|
+
& :is(h1, h2, h3, h4, h5) {
|
|
122
127
|
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);
|
|
128
|
+
font: inherit;
|
|
129
|
+
letter-spacing: inherit;
|
|
163
130
|
}
|
|
164
131
|
|
|
165
132
|
& 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);
|
|
133
|
+
margin: 0;
|
|
171
134
|
}
|
|
172
135
|
}
|
|
173
136
|
|
|
@@ -182,16 +145,22 @@
|
|
|
182
145
|
transition: transform var(--motion-duration-fast)
|
|
183
146
|
var(--motion-easing-standard);
|
|
184
147
|
|
|
148
|
+
/* Chevron glyph from the Canonical icon set, masked so it can take the theme
|
|
149
|
+
icon colour (same technique as CheckboxInput's checkmark). */
|
|
185
150
|
&::before {
|
|
186
151
|
content: "";
|
|
187
152
|
display: block;
|
|
188
153
|
width: 100%;
|
|
189
154
|
height: 100%;
|
|
190
155
|
background-color: var(--accordion-item-color-icon);
|
|
191
|
-
mask-image: url("
|
|
156
|
+
mask-image: url("/icons/chevron-down.svg#chevron-down");
|
|
192
157
|
mask-repeat: no-repeat;
|
|
193
158
|
mask-position: center;
|
|
194
159
|
mask-size: contain;
|
|
160
|
+
-webkit-mask-image: url("/icons/chevron-down.svg#chevron-down");
|
|
161
|
+
-webkit-mask-repeat: no-repeat;
|
|
162
|
+
-webkit-mask-position: center;
|
|
163
|
+
-webkit-mask-size: contain;
|
|
195
164
|
}
|
|
196
165
|
}
|
|
197
166
|
|
|
@@ -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
|
}
|
|
@@ -13,6 +13,8 @@ const componentCssClassName = "ds breadcrumbs";
|
|
|
13
13
|
* applications with multiple levels of hierarchy and are particularly useful
|
|
14
14
|
* when users might arrive at deep pages through search or external links.
|
|
15
15
|
*
|
|
16
|
+
* `import { Breadcrumbs } from "@canonical/react-ds-global";`
|
|
17
|
+
*
|
|
16
18
|
* @implements ds:global.pattern.breadcrumbs
|
|
17
19
|
*/
|
|
18
20
|
const Breadcrumbs = ({ items, separator = "/", LinkComponent = "a", className, "aria-label": ariaLabel = "Breadcrumb", ...props }) => (_jsx("nav", { className: [componentCssClassName, className].filter(Boolean).join(" "), "aria-label": ariaLabel, ...props, children: _jsx("ol", { className: "list p", children: items.map((item) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.js","sourceRoot":"","sources":["../../../../../src/lib/component/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;AAE/C
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.js","sourceRoot":"","sources":["../../../../../src/lib/component/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,GAAG,CAAC,EACnB,KAAK,EACL,SAAS,GAAG,GAAG,EACf,aAAa,GAAG,GAAG,EACnB,SAAS,EACT,YAAY,EAAE,SAAS,GAAG,YAAY,EACtC,GAAG,KAAK,EACS,EAAsB,EAAE,CAAC,CAC1C,cACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,gBAC3D,SAAS,KACjB,KAAK,YAET,aAAI,SAAS,EAAC,QAAQ,YACnB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAClB,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;YAChC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,SAAS,EAAE,GAAG,IAAI,CAAC;YACzC,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC;YAE7C,+CAA+C;YAC/C,yCAAyC;YACzC,OAAO,CACL,KAAC,aAAa,IAEZ,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,KACxB,SAAS,IAHR,OAAO,CAIZ,CACH,CAAC;QACJ,CAAC,CAAC,GACC,GACD,CACP,CAAC;AAEF,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC;AAExB,eAAe,WAAW,CAAC"}
|
|
@@ -11,7 +11,7 @@ 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
17
|
return (_jsxs("li", { className: [componentCssClassName, current && "current", className]
|
|
@@ -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,CAAC,qBAAqB,EAAE,OAAO,IAAI,SAAS,EAAE,SAAS,CAAC;aAChE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,KACR,KAAK,aAGR,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,CACrB,eAAM,SAAS,EAAC,MAAM,kBAAe,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,YAC9D,OAAO,GACH,CACR,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,SAAS,EAAC,MAAM,EAAC,IAAI,EAAE,GAAG,YAC7B,OAAO,GACH,CACR,EAED,eAAM,SAAS,EAAC,WAAW,iBAAa,MAAM,YAC3C,SAAS,GACL,IACJ,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,IAAI,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAEtC,eAAe,IAAI,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Spinner } from "../../subcomponent/Spinner/index.js";
|
|
2
3
|
import "./styles.css";
|
|
3
4
|
const componentCssClassName = "ds button";
|
|
4
5
|
/**
|
|
@@ -6,30 +7,37 @@ const componentCssClassName = "ds button";
|
|
|
6
7
|
* data transformation or manipulation. They provide clear visual
|
|
7
8
|
* indicators of the primary actions users can perform.
|
|
8
9
|
*
|
|
10
|
+
* `import { Button } from "@canonical/react-ds-global";`
|
|
11
|
+
*
|
|
9
12
|
* @implements ds:global.component.button
|
|
10
13
|
*/
|
|
11
|
-
const Button = ({ id, className, children, style, importance, anticipation, variant, icon,
|
|
14
|
+
const Button = ({ id, className, children, style, importance = "primary", anticipation, variant, icon, loading = false, disabled, ...props }) => {
|
|
12
15
|
// Booleans and nullish children render nothing; everything else (including
|
|
13
16
|
// the number 0) produces visible text that names the button.
|
|
14
17
|
const hasVisibleChildren = children != null && typeof children !== "boolean" && children !== "";
|
|
15
18
|
if (typeof process !== "undefined" &&
|
|
16
19
|
process.env.NODE_ENV !== "production" &&
|
|
17
|
-
icon &&
|
|
20
|
+
(icon || loading) &&
|
|
18
21
|
!hasVisibleChildren &&
|
|
19
22
|
!props["aria-label"] &&
|
|
20
23
|
!props["aria-labelledby"]) {
|
|
21
24
|
console.warn("Button: icon-only buttons need an explicit `aria-label` or `aria-labelledby` to be accessible.");
|
|
22
25
|
}
|
|
23
26
|
const iconElement = icon && _jsx("span", { className: "icon", children: icon });
|
|
24
|
-
return (
|
|
27
|
+
return (_jsxs("button", { id: id, className: [
|
|
25
28
|
componentCssClassName,
|
|
29
|
+
// The `.p` baseline utility supplies the body-text tier (font, snapped
|
|
30
|
+
// line-height) and the padding-block nudges that align the button box
|
|
31
|
+
// to the baseline grid — so the box height tracks the text inside.
|
|
32
|
+
"p",
|
|
26
33
|
importance,
|
|
27
34
|
anticipation,
|
|
28
35
|
variant,
|
|
36
|
+
loading && "loading",
|
|
29
37
|
className,
|
|
30
38
|
]
|
|
31
39
|
.filter(Boolean)
|
|
32
|
-
.join(" "), style: style, ...props, children:
|
|
40
|
+
.join(" "), style: style, "aria-busy": loading || undefined, disabled: disabled || loading, ...props, children: [iconElement, hasVisibleChildren && _jsx("span", { className: "label", children: children }), loading && (_jsx("span", { className: "loading-spinner", "aria-hidden": "true", children: _jsx(Spinner, {}) }))] }));
|
|
33
41
|
};
|
|
34
42
|
export default Button;
|
|
35
43
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../../src/lib/component/Button/Button.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../../src/lib/component/Button/Button.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAE9D,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAE1C;;;;;;;;GAQG;AACH,MAAM,MAAM,GAAG,CAAC,EACd,EAAE,EACF,SAAS,EACT,QAAQ,EACR,KAAK,EACL,UAAU,GAAG,SAAS,EACtB,YAAY,EACZ,OAAO,EACP,IAAI,EACJ,OAAO,GAAG,KAAK,EACf,QAAQ,EACR,GAAG,KAAK,EACF,EAAsB,EAAE;IAC9B,2EAA2E;IAC3E,6DAA6D;IAC7D,MAAM,kBAAkB,GACtB,QAAQ,IAAI,IAAI,IAAI,OAAO,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,EAAE,CAAC;IAEvE,IACE,OAAO,OAAO,KAAK,WAAW;QAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;QACrC,CAAC,IAAI,IAAI,OAAO,CAAC;QACjB,CAAC,kBAAkB;QACnB,CAAC,KAAK,CAAC,YAAY,CAAC;QACpB,CAAC,KAAK,CAAC,iBAAiB,CAAC,EACzB,CAAC;QACD,OAAO,CAAC,IAAI,CACV,gGAAgG,CACjG,CAAC;IACJ,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,IAAI,eAAM,SAAS,EAAC,MAAM,YAAE,IAAI,GAAQ,CAAC;IAEjE,OAAO,CACL,kBACE,EAAE,EAAE,EAAE,EACN,SAAS,EAAE;YACT,qBAAqB;YACrB,uEAAuE;YACvE,sEAAsE;YACtE,mEAAmE;YACnE,GAAG;YACH,UAAU;YACV,YAAY;YACZ,OAAO;YACP,OAAO,IAAI,SAAS;YACpB,SAAS;SACV;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,EACZ,KAAK,EAAE,KAAK,eAED,OAAO,IAAI,SAAS,EAC/B,QAAQ,EAAE,QAAQ,IAAI,OAAO,KACzB,KAAK,aAMR,WAAW,EACX,kBAAkB,IAAI,eAAM,SAAS,EAAC,OAAO,YAAE,QAAQ,GAAQ,EAC/D,OAAO,IAAI,CACV,eAAM,SAAS,EAAC,iBAAiB,iBAAa,MAAM,YAClD,KAAC,OAAO,KAAG,GACN,CACR,IACM,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|