@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
|
@@ -1,40 +1,38 @@
|
|
|
1
|
-
/* Component tokens — sourced from @canonical/design-tokens
|
|
1
|
+
/* Component tokens — sourced from @canonical/design-tokens.
|
|
2
|
+
The tooltip runs on the `contrasted` surface so its colours invert against
|
|
3
|
+
the ambient theme (dark chip on a light UI, light chip on a dark UI). The
|
|
4
|
+
surface channels (--surface-color-*) are read directly on the .contrasted
|
|
5
|
+
element below, NOT via a :root intermediate (which would see them unset and
|
|
6
|
+
fall back to the base colour). */
|
|
2
7
|
:root {
|
|
3
|
-
/*
|
|
4
|
-
TODO the tooltip's color tokens should be inverted from the active color theme.
|
|
5
|
-
This is to provide greater color contrast against its context.
|
|
6
|
-
This will be implemented once theming DS-wide is added.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
--tooltip-color-background: var(--color-foreground-ghost);
|
|
10
|
-
--tooltip-color-background-hover: var(--color-foreground-ghost-hover);
|
|
11
|
-
--tooltip-color-background-active: var(--color-foreground-ghost-active);
|
|
12
|
-
--tooltip-color-text: var(--color-text);
|
|
13
|
-
--tooltip-color-border: var(--color-border-high-contrast);
|
|
14
|
-
--tooltip-color-border-hover: var(--tooltip-color-border);
|
|
15
|
-
--tooltip-color-border-active: var(--tooltip-color-border);
|
|
16
|
-
|
|
17
8
|
--tooltip-border-radius: 0;
|
|
18
9
|
--tooltip-margin-left: 0;
|
|
19
10
|
--tooltip-margin-bottom: 0;
|
|
20
|
-
|
|
21
|
-
--tooltip-padding-
|
|
22
|
-
--tooltip-
|
|
23
|
-
--tooltip-
|
|
11
|
+
/* Figma: py = dimension-100 (8px), px = dimension-200 (16px). */
|
|
12
|
+
--tooltip-padding-vertical: var(--dimension-100);
|
|
13
|
+
--tooltip-padding-horizontal: var(--dimension-200);
|
|
14
|
+
--tooltip-border-width: 0;
|
|
15
|
+
/* Figma: text-secondary (14px / 20px line-height). */
|
|
16
|
+
--tooltip-font-size: var(--font-size-small, 14px);
|
|
24
17
|
--tooltip-font-weight: var(--font-weight-default);
|
|
25
|
-
--tooltip-line-height: var(--line-height-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
--tooltip-line-height: var(--line-height-small, 20px);
|
|
19
|
+
--tooltip-max-width: 284px;
|
|
20
|
+
/* Gap between an optional leading icon and the text (dimension-100). */
|
|
21
|
+
--tooltip-gap: var(--dimension-100);
|
|
22
|
+
|
|
23
|
+
/* Arrow geometry, independent of `distance` (the gap to the trigger).
|
|
24
|
+
Figma: 14px base (dimension-175) across the edge, 8px depth pointing out. */
|
|
25
|
+
--tooltip-arrow-width: var(--dimension-175, 14px);
|
|
26
|
+
--tooltip-arrow-depth: var(--dimension-100, 8px);
|
|
27
|
+
|
|
28
|
+
/* Duration of the open/close fade. */
|
|
29
|
+
--tooltip-motion-duration: 0.1s;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
/* component variables
|
|
31
33
|
--tooltip-color-background: background color of the tooltip
|
|
32
|
-
--tooltip-color-background-hover: background color of the tooltip on hover
|
|
33
|
-
--tooltip-color-background-active: background color of the tooltip on active
|
|
34
34
|
--tooltip-color-text: text color of the tooltip
|
|
35
35
|
--tooltip-color-border: border color of the tooltip
|
|
36
|
-
--tooltip-color-border-hover: border color of the tooltip on hover
|
|
37
|
-
--tooltip-color-border-active: border color of the tooltip on active
|
|
38
36
|
|
|
39
37
|
--tooltip-margin-left: left margin of the tooltip
|
|
40
38
|
--tooltip-margin-bottom: bottom margin of the tooltip
|
|
@@ -44,32 +42,39 @@
|
|
|
44
42
|
--tooltip-font-weight: font weight of the tooltip
|
|
45
43
|
--tooltip-line-height: line height of the tooltip
|
|
46
44
|
|
|
47
|
-
--tooltip-spacing-arrow-size: size of the arrow
|
|
45
|
+
--tooltip-spacing-arrow-size: size of the arrow (independent of `distance`)
|
|
48
46
|
|
|
49
|
-
--tooltip-arrow-offset-left: offset of the arrow
|
|
50
|
-
--tooltip-arrow-offset-top: offset of the arrow
|
|
47
|
+
--tooltip-arrow-offset-left: offset of the arrow along the x-axis (top/bottom placements)
|
|
48
|
+
--tooltip-arrow-offset-top: offset of the arrow along the y-axis (left/right placements)
|
|
51
49
|
*/
|
|
52
50
|
|
|
53
51
|
.ds.tooltip {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
--tooltip-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
transparent;
|
|
60
|
-
|
|
61
|
-
color: var(
|
|
62
|
-
--modifier-color-text,
|
|
63
|
-
var(--tooltip-color-text, var(--color-text-default))
|
|
64
|
-
);
|
|
65
|
-
background-color: var(
|
|
66
|
-
--modifier-color-foreground-ghost,
|
|
67
|
-
var(--tooltip-color-background, var(--color-background-default))
|
|
68
|
-
);
|
|
69
|
-
border-color: var(
|
|
70
|
-
--modifier-color-border,
|
|
71
|
-
var(--tooltip-color-border, transparent)
|
|
52
|
+
/* The tooltip's own background colour, read from the contrasted surface on
|
|
53
|
+
this element (so the arrow, which reuses it, is coloured correctly too). */
|
|
54
|
+
--tooltip-color-background: var(
|
|
55
|
+
--surface-color-background,
|
|
56
|
+
var(--color-background)
|
|
72
57
|
);
|
|
58
|
+
--tooltip-color-text: var(--surface-color-text, var(--color-text));
|
|
59
|
+
|
|
60
|
+
/* Figma arrow: 14px across the edge (base), 8px deep (point). The base is
|
|
61
|
+
built from two half-width transparent borders; the depth from the coloured
|
|
62
|
+
border on the pointing side. */
|
|
63
|
+
--tooltip-arrow-half-width: calc(var(--tooltip-arrow-width) / 2);
|
|
64
|
+
/* Centre of the edge. `left`/`top` positions the ZERO-width pseudo-element's
|
|
65
|
+
origin, but its two half-width side borders render the triangle from that
|
|
66
|
+
origin OUTWARD, so the visible apex sits half-a-width past `left`. To centre
|
|
67
|
+
the apex on the box we therefore pull the origin back by half-width:
|
|
68
|
+
`50% - half-width`. (Verified by pixel measurement: plain `50%` renders the
|
|
69
|
+
apex +7px off-centre.) The magnetic offset then shifts from this centre. */
|
|
70
|
+
--tooltip-arrow-middle: calc(50% - var(--tooltip-arrow-half-width));
|
|
71
|
+
--tooltip-arrow-edge: calc(-1 * var(--tooltip-arrow-depth));
|
|
72
|
+
--tooltip-arrow-offset-left: 0px;
|
|
73
|
+
--tooltip-arrow-offset-top: 0px;
|
|
74
|
+
|
|
75
|
+
color: var(--tooltip-color-text);
|
|
76
|
+
background-color: var(--tooltip-color-background);
|
|
77
|
+
border-color: var(--tooltip-color-background);
|
|
73
78
|
border-style: solid;
|
|
74
79
|
border-radius: var(--tooltip-border-radius);
|
|
75
80
|
border-width: var(--tooltip-border-width, 1px);
|
|
@@ -80,70 +85,130 @@
|
|
|
80
85
|
margin-inline-end: var(--tooltip-margin-left, 0);
|
|
81
86
|
padding-block: var(--tooltip-padding-vertical, 5px);
|
|
82
87
|
padding-inline: var(--tooltip-padding-horizontal, 10px);
|
|
83
|
-
white-space: pre;
|
|
84
88
|
text-align: left;
|
|
85
89
|
text-decoration: initial;
|
|
86
90
|
pointer-events: auto;
|
|
91
|
+
/* The box stays `inline-block` — it is the positioning context for the arrow
|
|
92
|
+
`::before`, and its `50%` centring must resolve against this box. The
|
|
93
|
+
icon+text layout lives in an inner `.content` flex row so the pseudo-element
|
|
94
|
+
is never a flex item (which would shift the arrow and reserve gap for it). */
|
|
87
95
|
display: inline-block;
|
|
88
|
-
|
|
96
|
+
max-width: var(--tooltip-max-width);
|
|
89
97
|
position: fixed;
|
|
90
|
-
|
|
98
|
+
/* MUST stay `visible`: the arrow is a `::before` positioned just outside the
|
|
99
|
+
box (e.g. bottom: -8px). Any `overflow: auto | hidden | clip` clips it and
|
|
100
|
+
the triangle disappears entirely. */
|
|
101
|
+
overflow: visible;
|
|
102
|
+
|
|
103
|
+
/* Inner row: optional leading icon before the text, top-aligned with the
|
|
104
|
+
first line (Figma). Without an icon it is just the text. */
|
|
105
|
+
& > .content {
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: flex-start;
|
|
108
|
+
gap: var(--tooltip-gap);
|
|
109
|
+
}
|
|
91
110
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
111
|
+
/* Leading icon: fixed 16px box, top-aligned with the first text line, purely
|
|
112
|
+
decorative (the text carries the meaning). */
|
|
113
|
+
& .icon {
|
|
114
|
+
flex: 0 0 auto;
|
|
115
|
+
display: inline-flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
justify-content: center;
|
|
118
|
+
inline-size: var(--dimension-200, 16px);
|
|
119
|
+
block-size: var(--tooltip-line-height, 20px);
|
|
120
|
+
|
|
121
|
+
& > svg {
|
|
122
|
+
inline-size: var(--dimension-200, 16px);
|
|
123
|
+
block-size: var(--dimension-200, 16px);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* The text wraps at max-width (Figma shows multi-line) while honouring any
|
|
128
|
+
explicit newlines in the message. */
|
|
129
|
+
& .text {
|
|
130
|
+
white-space: pre-wrap;
|
|
96
131
|
}
|
|
97
132
|
|
|
133
|
+
/*
|
|
134
|
+
CSS-only enter/exit animation. `allow-discrete` lets `visibility` (a discrete
|
|
135
|
+
property) transition alongside `opacity`, and `@starting-style` gives the
|
|
136
|
+
opening frame a starting opacity so the fade-in runs. No JavaScript timing.
|
|
137
|
+
*/
|
|
138
|
+
opacity: 0;
|
|
139
|
+
visibility: hidden;
|
|
140
|
+
transition:
|
|
141
|
+
opacity var(--tooltip-motion-duration) ease-in-out,
|
|
142
|
+
visibility var(--tooltip-motion-duration) allow-discrete;
|
|
143
|
+
|
|
98
144
|
&[aria-hidden="false"] {
|
|
99
145
|
opacity: 1;
|
|
100
146
|
pointer-events: auto;
|
|
101
147
|
visibility: visible;
|
|
148
|
+
|
|
149
|
+
@starting-style {
|
|
150
|
+
opacity: 0;
|
|
151
|
+
}
|
|
102
152
|
}
|
|
103
153
|
|
|
104
|
-
|
|
154
|
+
&[aria-hidden="true"] {
|
|
155
|
+
opacity: 0;
|
|
156
|
+
pointer-events: none;
|
|
157
|
+
visibility: hidden;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@media (prefers-reduced-motion: reduce) {
|
|
161
|
+
transition: none;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/*
|
|
165
|
+
The arrow is a CSS border-triangle: 14px across the edge (two
|
|
166
|
+
half-width transparent borders) and 8px deep (the coloured border on the
|
|
167
|
+
pointing side). The always-on offset shifts it along the edge so the tip
|
|
168
|
+
stays pinned to the trigger centre for every placement — including after a
|
|
169
|
+
resize or scroll reposition (the offset is recomputed live).
|
|
170
|
+
*/
|
|
105
171
|
&::before {
|
|
106
172
|
content: "";
|
|
107
173
|
width: 0;
|
|
108
174
|
height: 0;
|
|
109
|
-
border: var(--tooltip-border-arrow-hidden);
|
|
110
175
|
position: absolute;
|
|
176
|
+
transform: translateX(var(--tooltip-arrow-offset-left))
|
|
177
|
+
translateY(var(--tooltip-arrow-offset-top));
|
|
111
178
|
}
|
|
112
179
|
|
|
113
|
-
|
|
114
|
-
&::before {
|
|
115
|
-
transform: translateX(var(--tooltip-arrow-offset-left))
|
|
116
|
-
translateY(var(--tooltip-arrow-offset-top));
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
180
|
+
/* Placed above the trigger → arrow points down, on the tooltip's bottom edge. */
|
|
120
181
|
&.top::before {
|
|
121
|
-
border-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
&.right::before {
|
|
126
|
-
border-right: var(--tooltip-border-arrow-visible);
|
|
127
|
-
left: var(--tooltip-spacing-arrow-edge);
|
|
182
|
+
border-inline: var(--tooltip-arrow-half-width) solid transparent;
|
|
183
|
+
border-top: var(--tooltip-arrow-depth) solid var(--tooltip-color-background);
|
|
184
|
+
bottom: var(--tooltip-arrow-edge);
|
|
185
|
+
left: var(--tooltip-arrow-middle);
|
|
128
186
|
}
|
|
129
187
|
|
|
188
|
+
/* Placed below → arrow points up, on the top edge. */
|
|
130
189
|
&.bottom::before {
|
|
131
|
-
border-
|
|
132
|
-
|
|
190
|
+
border-inline: var(--tooltip-arrow-half-width) solid transparent;
|
|
191
|
+
border-bottom: var(--tooltip-arrow-depth) solid
|
|
192
|
+
var(--tooltip-color-background);
|
|
193
|
+
top: var(--tooltip-arrow-edge);
|
|
194
|
+
left: var(--tooltip-arrow-middle);
|
|
133
195
|
}
|
|
134
196
|
|
|
197
|
+
/* Placed left → arrow points right, on the right edge. */
|
|
135
198
|
&.left::before {
|
|
136
|
-
border-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
&.bottom::before {
|
|
142
|
-
left: var(--tooltip-spacing-arrow-middle);
|
|
199
|
+
border-block: var(--tooltip-arrow-half-width) solid transparent;
|
|
200
|
+
border-left: var(--tooltip-arrow-depth) solid
|
|
201
|
+
var(--tooltip-color-background);
|
|
202
|
+
right: var(--tooltip-arrow-edge);
|
|
203
|
+
top: var(--tooltip-arrow-middle);
|
|
143
204
|
}
|
|
144
205
|
|
|
145
|
-
|
|
206
|
+
/* Placed right → arrow points left, on the left edge. */
|
|
146
207
|
&.right::before {
|
|
147
|
-
|
|
208
|
+
border-block: var(--tooltip-arrow-half-width) solid transparent;
|
|
209
|
+
border-right: var(--tooltip-arrow-depth) solid
|
|
210
|
+
var(--tooltip-color-background);
|
|
211
|
+
left: var(--tooltip-arrow-edge);
|
|
212
|
+
top: var(--tooltip-arrow-middle);
|
|
148
213
|
}
|
|
149
214
|
}
|
|
@@ -4,11 +4,11 @@ import { TooltipArea } from "./common/TooltipArea/index.js";
|
|
|
4
4
|
* A higher-order component that wraps a component with a tooltip.
|
|
5
5
|
* @param Component The component function to wrap. If you need to use a Node instead of a function, use [`TooltipArea`](/?path=/docs/tooltip-withtooltip--docs) instead.
|
|
6
6
|
* @param Message The content of the tooltip
|
|
7
|
-
* @param popupProps
|
|
7
|
+
* @param popupProps Tooltip options forwarded to the underlying `TooltipArea`
|
|
8
8
|
*/
|
|
9
9
|
const withTooltip = (Component, Message, popupProps = {}) => {
|
|
10
|
-
const WrappedComponent = (props
|
|
11
|
-
return (_jsx(TooltipArea, { Message: Message, ...popupProps, children: _jsx(Component, { ...props
|
|
10
|
+
const WrappedComponent = (props) => {
|
|
11
|
+
return (_jsx(TooltipArea, { Message: Message, ...popupProps, children: _jsx(Component, { ...props }) }));
|
|
12
12
|
};
|
|
13
13
|
// Set the displayName for easier debugging
|
|
14
14
|
WrappedComponent.displayName = `withTooltip(${Component.displayName || Component.name || "Component"})`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTooltip.js","sourceRoot":"","sources":["../../../../../src/lib/component/Tooltip/withTooltip.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"withTooltip.js","sourceRoot":"","sources":["../../../../../src/lib/component/Tooltip/withTooltip.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAW5D;;;;;GAKG;AACH,MAAM,WAAW,GAAG,CAClB,SAAgC,EAChC,OAAkB,EAClB,aAAiC,EAAE,EACvB,EAAE;IACd,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAwB,EAAE;QAC/D,OAAO,CACL,KAAC,WAAW,IAAC,OAAO,EAAE,OAAO,KAAM,UAAU,YAC3C,KAAC,SAAS,OAAK,KAAK,GAAI,GACZ,CACf,CAAC;IACJ,CAAC,CAAC;IAEF,2CAA2C;IAC3C,gBAAgB,CAAC,WAAW,GAAG,eAC7B,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,WAC7C,GAAG,CAAC;IAEJ,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// ds:Component tier barrel: the standalone global components.
|
|
2
|
+
export * from "./Accordion/index.js";
|
|
3
|
+
export * from "./Announcement/index.js";
|
|
4
|
+
export * from "./Badge/index.js";
|
|
5
|
+
export * from "./Breadcrumbs/index.js";
|
|
6
|
+
export * from "./Button/index.js";
|
|
7
|
+
export * from "./Card/index.js";
|
|
8
|
+
export * from "./Chip/index.js";
|
|
9
|
+
export * from "./ContextualMenu/index.js";
|
|
10
|
+
export * from "./Icon/index.js";
|
|
11
|
+
export * from "./InlineCode/index.js";
|
|
12
|
+
export * from "./KeyboardKey/index.js";
|
|
13
|
+
export * from "./Popover/index.js";
|
|
14
|
+
export * from "./Tabs/index.js";
|
|
15
|
+
export * from "./Tile/index.js";
|
|
16
|
+
export * from "./Tooltip/index.js";
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/component/index.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "./styles.css";
|
|
3
|
+
const componentCssClassName = "ds cards subgrid";
|
|
4
|
+
/**
|
|
5
|
+
* Cards — lays out a set of `Card`s on a shared grid so that not only the cards
|
|
6
|
+
* themselves, but each card's SECTIONS (image, header, content, footer) line up
|
|
7
|
+
* across the row.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* **Requires a top-level grid.** `Cards` is a `.subgrid`: it inherits the column
|
|
11
|
+
* tracks of the nearest parent `.grid` rather than defining its own. Wrap it in
|
|
12
|
+
* a `.grid` (e.g. the `grid()` storybook decorator or the `grid` addon param,
|
|
13
|
+
* the same way Accordion or a form field opts in). Outside a grid it degrades to
|
|
14
|
+
* a plain block — still renders, just without column alignment.
|
|
15
|
+
*
|
|
16
|
+
* **Two-level subgrid.** The parent grid supplies the columns; `Cards` inherits
|
|
17
|
+
* them and defines the shared section ROW tracks; each `Card` spans `cardSpan`
|
|
18
|
+
* columns and is itself a row-subgrid, so its sections snap to the shared
|
|
19
|
+
* tracks. See `styles.css` for the full model.
|
|
20
|
+
*
|
|
21
|
+
* **`cardSpan`** is the number of master columns each card spans (not a pixel
|
|
22
|
+
* width) — use multiples of 2/4 so cards tile evenly into the 4/8/12-column
|
|
23
|
+
* responsive grid.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* // inside a `.grid` context (decorator/addon)
|
|
28
|
+
* <Cards cardSpan={4}>
|
|
29
|
+
* <Card>…</Card>
|
|
30
|
+
* <Card>…</Card>
|
|
31
|
+
* <Card>…</Card>
|
|
32
|
+
* </Cards>
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @implements dso:global.group.cards
|
|
36
|
+
* @returns {ReactElement} the Cards group
|
|
37
|
+
*/
|
|
38
|
+
const Cards = ({ className, children, cardSpan = 1, style, ...props }) => {
|
|
39
|
+
// Guard the column span: a 0/negative/NaN/non-integer would produce an invalid
|
|
40
|
+
// `span …` and break the layout. At least 1.
|
|
41
|
+
const span = Math.max(1, Math.floor(Number(cardSpan) || 1));
|
|
42
|
+
const cardsStyle = {
|
|
43
|
+
...style,
|
|
44
|
+
"--card-span": span,
|
|
45
|
+
};
|
|
46
|
+
return (_jsx("div", { className: [componentCssClassName, className].filter(Boolean).join(" "), style: cardsStyle, ...props, children: children }));
|
|
47
|
+
};
|
|
48
|
+
export default Cards;
|
|
49
|
+
//# sourceMappingURL=Cards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cards.js","sourceRoot":"","sources":["../../../../../src/lib/group/Cards/Cards.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,KAAK,GAAG,CAAC,EACb,SAAS,EACT,QAAQ,EACR,QAAQ,GAAG,CAAC,EACZ,KAAK,EACL,GAAG,KAAK,EACG,EAAgB,EAAE;IAC7B,+EAA+E;IAC/E,6CAA6C;IAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAE5D,MAAM,UAAU,GAAkB;QAChC,GAAG,KAAK;QACR,aAAa,EAAE,IAAI;KACH,CAAC;IAEnB,OAAO,CACL,cACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACvE,KAAK,EAAE,UAAU,KACb,KAAK,YAER,QAAQ,GACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/lib/group/Cards/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cards — a group that lays out `Card`s on a shared grid so their sections line
|
|
3
|
+
* up ACROSS the row, not just within each card.
|
|
4
|
+
*
|
|
5
|
+
* ── How the alignment works ─────────────────────────────────────────────────
|
|
6
|
+
* A plain grid of cards only matches heights by luck — a two-line card and a
|
|
7
|
+
* one-line card end up different heights. `Cards` fixes that: it defines FOUR
|
|
8
|
+
* shared section row tracks (image / header / content / footer), and each `Card`
|
|
9
|
+
* is a ROW SUBGRID that spans those four tracks (its own grid logic — see the
|
|
10
|
+
* Card styles). So the tallest section in a track sizes it for every card on the
|
|
11
|
+
* band, and footers pin to a common bottom line. The four-track vocabulary is
|
|
12
|
+
* fixed because a Card only ever has those four section types; a card missing a
|
|
13
|
+
* section just leaves that track empty for itself.
|
|
14
|
+
*
|
|
15
|
+
* Cards are single grid items (each spans `--card-span` columns × 4 rows) and
|
|
16
|
+
* auto-place in DOM order, so they tile into columns and wrap to a fresh
|
|
17
|
+
* four-row band when the row is full — no overlap.
|
|
18
|
+
*
|
|
19
|
+
* ── Requires a top-level grid ───────────────────────────────────────────────
|
|
20
|
+
* `Cards` is a `.subgrid`: it inherits the column tracks of the nearest parent
|
|
21
|
+
* `.grid` (via the `grid` story param / addon). Outside a grid it degrades to a
|
|
22
|
+
* plain block.
|
|
23
|
+
*
|
|
24
|
+
* ── --card-span (columns per card) ──────────────────────────────────────────
|
|
25
|
+
* `--card-span` (the `cardSpan` prop) is the NUMBER OF PARENT COLUMNS each card
|
|
26
|
+
* spans — not a pixel width. `1` (default) packs the most cards per row; use 2
|
|
27
|
+
* or 4 for fewer, wider cards on the 4/8/12-column responsive grid.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
.ds.cards {
|
|
31
|
+
display: grid;
|
|
32
|
+
grid-template-columns: subgrid;
|
|
33
|
+
/* The Cards container itself always spans the full master grid; `--card-span`
|
|
34
|
+
* (the per-card column span) inherits down to each Card, it is NOT the
|
|
35
|
+
* container's own span. */
|
|
36
|
+
grid-column: 1 / -1;
|
|
37
|
+
|
|
38
|
+
/* The four shared section tracks (image / header / content / footer), repeated
|
|
39
|
+
* for every wrapped band via `grid-auto-rows`. They are ALL `auto`, so each
|
|
40
|
+
* track sizes to the tallest of that section across the row — every card takes
|
|
41
|
+
* its intrinsic height plus only the extra needed to align with the tallest
|
|
42
|
+
* card on the band (no `1fr`, which would stretch a card to fill surplus
|
|
43
|
+
* container height). Cards each `span 4` rows and auto-place across the columns
|
|
44
|
+
* (DOM order), wrapping to the next band. */
|
|
45
|
+
grid-auto-flow: row;
|
|
46
|
+
grid-auto-rows: auto;
|
|
47
|
+
|
|
48
|
+
/* Bands take their intrinsic height and pack to the top — never stretch to
|
|
49
|
+
* fill a taller container. */
|
|
50
|
+
align-self: start;
|
|
51
|
+
align-content: start;
|
|
52
|
+
|
|
53
|
+
gap: var(--grid-row-gap, var(--grid-gutter))
|
|
54
|
+
var(--grid-column-gap, var(--grid-gutter));
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/lib/group/Cards/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/group/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAElE,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
export * from "./useContextualMenu/index.js";
|
|
1
2
|
export * from "./useDelayedToggle/index.js";
|
|
2
|
-
export * from "./
|
|
3
|
+
export * from "./useDisclosure/index.js";
|
|
4
|
+
export * from "./useIsMounted/index.js";
|
|
3
5
|
export * from "./useResizeObserver/index.js";
|
|
4
6
|
export * from "./useWindowDimensions/index.js";
|
|
5
7
|
export * from "./useWindowFitment/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/lib/hooks/useContextualMenu/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/lib/hooks/useContextualMenu/types.ts"],"names":[],"mappings":""}
|