@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/lib/hooks/useWindowFitment/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/lib/hooks/useWindowFitment/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contextual-menu placements: open toward the trigger's reading-flow (leading)
|
|
3
|
+
* edge, top-aligned, flipping alignment then side as space runs out. Logical, so
|
|
4
|
+
* it mirrors automatically — resolves to the historical right-start/… order in
|
|
5
|
+
* LTR and left-start/… in RTL.
|
|
6
|
+
*/
|
|
7
|
+
export const MENU_PLACEMENT = [
|
|
8
|
+
{ side: "inline-end", align: "start" }, // right-start LTR / left-start RTL
|
|
9
|
+
{ side: "inline-end", align: "end" }, // vertical overflow → bottom-aligned
|
|
10
|
+
{ side: "inline-start", align: "start" }, // horizontal overflow → flip side
|
|
11
|
+
{ side: "inline-start", align: "end" },
|
|
12
|
+
{ side: "block-end", align: "center" }, // last-resort bottom-centre
|
|
13
|
+
{ side: "block-start", align: "center" }, // top-centre
|
|
14
|
+
];
|
|
15
|
+
/**
|
|
16
|
+
* Arrow-bearing overlay (tooltip/popover) placements: open toward the reading
|
|
17
|
+
* direction first, centred. Resolves in LTR to [right, bottom, left, top].
|
|
18
|
+
*/
|
|
19
|
+
export const OVERLAY_PLACEMENT = [
|
|
20
|
+
"inline-end",
|
|
21
|
+
"block-end",
|
|
22
|
+
"inline-start",
|
|
23
|
+
"block-start",
|
|
24
|
+
];
|
|
25
|
+
//# sourceMappingURL=readingDirection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readingDirection.js","sourceRoot":"","sources":["../../../../../src/lib/hooks/useWindowFitment/readingDirection.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAA6B;IACtD,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,mCAAmC;IAC3E,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,uCAAuC;IAC7E,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,kCAAkC;IAC5E,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE;IACtC,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,6BAA6B;IACrE,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,aAAa;CACxD,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAwB;IACpD,YAAY;IACZ,WAAW;IACX,cAAc;IACd,aAAa;CACd,CAAC"}
|
|
@@ -1,11 +1,100 @@
|
|
|
1
|
-
import { useCallback, useEffect, useMemo, useRef, } from "react";
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef, useState, } from "react";
|
|
2
2
|
import { useResizeObserver } from "../useResizeObserver/index.js";
|
|
3
3
|
import { useWindowDimensions } from "../useWindowDimensions/index.js";
|
|
4
|
-
|
|
4
|
+
/** Coerce a bare logical side or a placement into a full logical placement. */
|
|
5
|
+
export const toPlacement = (entry) => typeof entry === "string" ? { side: entry, align: "center" } : entry;
|
|
6
|
+
/**
|
|
7
|
+
* Map a LOGICAL placement to a PHYSICAL one for a writing direction. The inline
|
|
8
|
+
* axis follows `dir` (mirrors in RTL); the block axis is dir-invariant.
|
|
9
|
+
*
|
|
10
|
+
* INVARIANT: `align` is passed through UNMODIFIED. This is only correct because
|
|
11
|
+
* every `inline-*` side has a dir-invariant (block/vertical) cross-axis, and
|
|
12
|
+
* every `block-*` side in use is `align: "center"` (dir-blind). If a future
|
|
13
|
+
* `block-*` placement ever needs `start`/`end`, that align becomes dir-dependent
|
|
14
|
+
* and MUST be flipped here for RTL — do not add one without handling it.
|
|
15
|
+
*/
|
|
16
|
+
export const resolveLogicalPlacement = (placement, dir) => {
|
|
17
|
+
let direction;
|
|
18
|
+
switch (placement.side) {
|
|
19
|
+
case "inline-start":
|
|
20
|
+
direction = dir === "rtl" ? "right" : "left";
|
|
21
|
+
break;
|
|
22
|
+
case "inline-end":
|
|
23
|
+
direction = dir === "rtl" ? "left" : "right";
|
|
24
|
+
break;
|
|
25
|
+
case "block-start":
|
|
26
|
+
direction = "top";
|
|
27
|
+
break;
|
|
28
|
+
default:
|
|
29
|
+
direction = "bottom";
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
return { direction, align: placement.align };
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Read the document's writing direction from the root `<html>` element — the
|
|
36
|
+
* single source of truth for the app's locale direction. Since the popup is
|
|
37
|
+
* portalled under `<html>` too, both the positioning and any CSS keyed on
|
|
38
|
+
* `html[dir="rtl"]` (e.g. a mirrored caret) agree without per-element reads.
|
|
39
|
+
* @note Impure — reads the DOM. Defaults `ltr` on the server.
|
|
40
|
+
*/
|
|
41
|
+
const readHtmlDirection = () => {
|
|
42
|
+
if (typeof document === "undefined")
|
|
43
|
+
return "ltr";
|
|
44
|
+
return document.documentElement.dir === "rtl" ? "rtl" : "ltr";
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Compute the cross-axis displacement needed to keep an arrow pointing at the
|
|
48
|
+
* target's centre for a given placement. The arrow sits at the popup edge
|
|
49
|
+
* centre by default; this returns how far to shift it so it aligns with the
|
|
50
|
+
* target centre, clamped to the popup's half-extent so it never leaves the edge.
|
|
51
|
+
* @param direction The side of the target the popup is placed on.
|
|
52
|
+
* @param targetRect The bounding client rect of the target element.
|
|
53
|
+
* @param popupRect The bounding client rect of the popup element.
|
|
54
|
+
* @returns The arrow axis and offset in pixels.
|
|
55
|
+
*/
|
|
56
|
+
export const computeArrowOffset = (direction, targetRect, popupRect,
|
|
57
|
+
/**
|
|
58
|
+
* The authoritative popup position (top-left, viewport coordinates) as just
|
|
59
|
+
* computed by fitment. The popup's live `getBoundingClientRect()` lags one
|
|
60
|
+
* frame behind `bestPosition` (it still reflects the previous placement while
|
|
61
|
+
* the new `left`/`top` are applied), so measuring the centre from the live
|
|
62
|
+
* rect yields a stale offset and the arrow drifts off the anchor. Passing the
|
|
63
|
+
* authoritative position removes that lag; the rect is still used for the
|
|
64
|
+
* popup's stable width/height. Defaults to the rect's own top-left.
|
|
65
|
+
*/
|
|
66
|
+
popupPosition = {
|
|
67
|
+
top: popupRect.top,
|
|
68
|
+
left: popupRect.left,
|
|
69
|
+
}) => {
|
|
70
|
+
const isVerticalPlacement = direction === "top" || direction === "bottom";
|
|
71
|
+
const axis = isVerticalPlacement ? "x" : "y";
|
|
72
|
+
const targetCentre = isVerticalPlacement
|
|
73
|
+
? targetRect.left + targetRect.width / 2
|
|
74
|
+
: targetRect.top + targetRect.height / 2;
|
|
75
|
+
const popupCentre = isVerticalPlacement
|
|
76
|
+
? popupPosition.left + popupRect.width / 2
|
|
77
|
+
: popupPosition.top + popupRect.height / 2;
|
|
78
|
+
const halfExtent = isVerticalPlacement
|
|
79
|
+
? popupRect.width / 2
|
|
80
|
+
: popupRect.height / 2;
|
|
81
|
+
const rawOffset = targetCentre - popupCentre;
|
|
82
|
+
const clampedOffset = Math.max(-halfExtent, Math.min(halfExtent, rawOffset));
|
|
83
|
+
return { axis, offset: clampedOffset };
|
|
84
|
+
};
|
|
85
|
+
const useWindowFitment = ({ preferredDirections = [
|
|
86
|
+
"block-start",
|
|
87
|
+
"block-end",
|
|
88
|
+
"inline-start",
|
|
89
|
+
"inline-end",
|
|
90
|
+
], distance = "0px", gutter = "0px", maxWidth = "350px", resizeDelay = 150, scrollDelay = 150, onBestPositionChange, autoFit = false, direction: directionProp, }) => {
|
|
5
91
|
const isServer = typeof window === "undefined";
|
|
6
92
|
const targetRef = useRef(null);
|
|
7
93
|
const popupRef = useRef(null);
|
|
8
94
|
const prevBestPosition = useRef(undefined);
|
|
95
|
+
// Bumped when the anchored element's `dir` flips with no layout change, so the
|
|
96
|
+
// logical→physical resolution re-runs (see the MutationObserver effect below).
|
|
97
|
+
const [dirVersion, setDirVersion] = useState(0);
|
|
9
98
|
const windowDimensions = useWindowDimensions({ resizeDelay, scrollDelay });
|
|
10
99
|
const targetSize = useResizeObserver(targetRef?.current);
|
|
11
100
|
const popupSize = useResizeObserver(popupRef?.current);
|
|
@@ -36,7 +125,7 @@ const useWindowFitment = ({ preferredDirections = ["top", "bottom", "left", "rig
|
|
|
36
125
|
* @param popupRect The bounding client rect of the popup element.
|
|
37
126
|
* @returns The calculated relative position of the popup.
|
|
38
127
|
*/
|
|
39
|
-
const calculateRelativePosition = useCallback((direction, targetRect, popupRect) => {
|
|
128
|
+
const calculateRelativePosition = useCallback((direction, align, targetRect, popupRect) => {
|
|
40
129
|
let left = 0;
|
|
41
130
|
let top = 0;
|
|
42
131
|
if (isServer) {
|
|
@@ -51,11 +140,26 @@ const useWindowFitment = ({ preferredDirections = ["top", "bottom", "left", "rig
|
|
|
51
140
|
The fake margin is already included in `targetRect` dimensions, as it is rendered hidden at least once before the popup is shown.
|
|
52
141
|
In cases where `targetRect` is not included in the calculation, we add `distanceAsPixelsNumber` to account for the fake margin.
|
|
53
142
|
*/
|
|
143
|
+
// Cross-axis offset along a side's cross-axis:
|
|
144
|
+
// start → target's leading edge (offset 0)
|
|
145
|
+
// end → target's trailing edge
|
|
146
|
+
// center → centred (legacy; identical to the pre-align formula)
|
|
147
|
+
const crossAxisOffset = (targetExtent, popupExtent) => {
|
|
148
|
+
switch (align) {
|
|
149
|
+
case "start":
|
|
150
|
+
return 0;
|
|
151
|
+
case "end":
|
|
152
|
+
return targetExtent - popupExtent;
|
|
153
|
+
default:
|
|
154
|
+
return (targetExtent - popupExtent) / 2;
|
|
155
|
+
}
|
|
156
|
+
};
|
|
54
157
|
// horizontal offset
|
|
55
158
|
switch (direction) {
|
|
56
159
|
case "top":
|
|
57
160
|
case "bottom":
|
|
58
|
-
|
|
161
|
+
// horizontal is the CROSS axis here → align applies
|
|
162
|
+
left = crossAxisOffset(targetRect.width, popupRect.width);
|
|
59
163
|
break;
|
|
60
164
|
case "right":
|
|
61
165
|
left = targetRect.width;
|
|
@@ -74,7 +178,8 @@ const useWindowFitment = ({ preferredDirections = ["top", "bottom", "left", "rig
|
|
|
74
178
|
break;
|
|
75
179
|
case "right":
|
|
76
180
|
case "left":
|
|
77
|
-
|
|
181
|
+
// vertical is the CROSS axis here → align applies
|
|
182
|
+
top = crossAxisOffset(targetRect.height, popupRect.height);
|
|
78
183
|
break;
|
|
79
184
|
}
|
|
80
185
|
return { left, top };
|
|
@@ -106,22 +211,31 @@ const useWindowFitment = ({ preferredDirections = ["top", "bottom", "left", "rig
|
|
|
106
211
|
* @param popupRect The bounding client rect of the popup element.
|
|
107
212
|
* @returns The best absolute position for the popup.
|
|
108
213
|
*/
|
|
109
|
-
const findBestPosition = useCallback((targetRect, popupRect,
|
|
214
|
+
const findBestPosition = useCallback((targetRect, popupRect, placements) => {
|
|
110
215
|
if (isServer)
|
|
111
216
|
return;
|
|
112
217
|
let fallbackPosition;
|
|
113
|
-
|
|
218
|
+
let fallbackScore = Number.POSITIVE_INFINITY;
|
|
219
|
+
if (!placements.length) {
|
|
114
220
|
throw new Error("Preferred directions must not be empty.");
|
|
115
221
|
}
|
|
116
|
-
for (const direction of
|
|
117
|
-
const relativePosition = calculateRelativePosition(direction, targetRect, popupRect);
|
|
118
|
-
|
|
222
|
+
for (const { direction, align } of placements) {
|
|
223
|
+
const relativePosition = calculateRelativePosition(direction, align, targetRect, popupRect);
|
|
224
|
+
// The natural (unclamped) placement for this side.
|
|
225
|
+
const naturalPosition = {
|
|
119
226
|
top: targetRect.top + relativePosition.top,
|
|
120
227
|
left: targetRect.left + relativePosition.left,
|
|
121
228
|
};
|
|
229
|
+
// Whether this side fits WITHOUT auto-fit clamping. This must be tested
|
|
230
|
+
// on the natural position — testing a clamped position would always
|
|
231
|
+
// report `fits: true`, so the loop would return the first placement and
|
|
232
|
+
// never flip to a side that actually has room.
|
|
233
|
+
const naturallyFits = fitsInWindow(naturalPosition, popupRect);
|
|
234
|
+
// Auto-fit produces a clamped variant (nudged back into bounds) used
|
|
235
|
+
// only as the fallback when no side fits naturally.
|
|
236
|
+
const absolutePosition = { ...naturalPosition };
|
|
122
237
|
const autoFitOffset = { top: 0, left: 0 };
|
|
123
238
|
if (autoFit && bounds) {
|
|
124
|
-
// Adjust position if it overflows the bounds
|
|
125
239
|
if (absolutePosition.top < bounds.top) {
|
|
126
240
|
autoFitOffset.top = bounds.top - absolutePosition.top;
|
|
127
241
|
absolutePosition.top = bounds.top;
|
|
@@ -141,38 +255,107 @@ const useWindowFitment = ({ preferredDirections = ["top", "bottom", "left", "rig
|
|
|
141
255
|
absolutePosition.left = bounds.right - popupRect.width;
|
|
142
256
|
}
|
|
143
257
|
}
|
|
144
|
-
|
|
258
|
+
// A side that naturally fits wins immediately, at its exact position.
|
|
259
|
+
if (naturallyFits) {
|
|
260
|
+
return {
|
|
261
|
+
positionName: direction,
|
|
262
|
+
align,
|
|
263
|
+
position: naturalPosition,
|
|
264
|
+
fits: true,
|
|
265
|
+
autoFitOffset: { top: 0, left: 0 },
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
// No side fits naturally → this placement is a fallback candidate. Keep
|
|
269
|
+
// the LEAST-clamped one (smallest total auto-fit offset) rather than
|
|
270
|
+
// always taking the first: the placement that overflows the viewport
|
|
271
|
+
// least sits closest to its ideal spot. (Note: this is the only useful
|
|
272
|
+
// per-candidate signal here — the popup's own dimensions are the same for
|
|
273
|
+
// every candidate in one pass, so a wide-vs-tall metric would be constant
|
|
274
|
+
// and cannot break ties.)
|
|
275
|
+
const candidate = {
|
|
145
276
|
positionName: direction,
|
|
277
|
+
align,
|
|
146
278
|
position: absolutePosition,
|
|
147
|
-
fits:
|
|
279
|
+
fits: false,
|
|
148
280
|
autoFitOffset,
|
|
149
281
|
};
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
282
|
+
const clampCost = Math.abs(candidate.autoFitOffset.top) +
|
|
283
|
+
Math.abs(candidate.autoFitOffset.left);
|
|
284
|
+
if (!fallbackPosition || clampCost < fallbackScore) {
|
|
285
|
+
fallbackPosition = candidate;
|
|
286
|
+
fallbackScore = clampCost;
|
|
155
287
|
}
|
|
156
288
|
}
|
|
157
289
|
return fallbackPosition;
|
|
158
290
|
}, [calculateRelativePosition, fitsInWindow, isServer, autoFit, bounds]);
|
|
291
|
+
/** Normalise the mixed side/placement list once (bare side → centred). */
|
|
292
|
+
const placements = useMemo(() => preferredDirections.map(toPlacement), [preferredDirections]);
|
|
159
293
|
/** The best possible position for the popup. */
|
|
294
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: dirVersion is a deliberate re-resolution trigger — the memo reads document.documentElement.dir (not tracked by React), and the <html dir> MutationObserver bumps dirVersion to force a re-read.
|
|
160
295
|
const bestPosition = useMemo(() => {
|
|
161
296
|
if (!isServer &&
|
|
162
297
|
targetRef.current &&
|
|
163
298
|
popupRef.current &&
|
|
164
299
|
windowDimensions &&
|
|
165
300
|
popupSize &&
|
|
166
|
-
targetSize)
|
|
167
|
-
|
|
301
|
+
targetSize) {
|
|
302
|
+
// Resolve logical → physical BEFORE findBestPosition so positionName stays
|
|
303
|
+
// a physical direction. The direction is the `direction` override if given,
|
|
304
|
+
// else the document's <html dir>. Re-runs on resize/scroll/content (deps)
|
|
305
|
+
// and on an <html dir> flip (dirVersion, from the observer below).
|
|
306
|
+
const dir = directionProp ?? readHtmlDirection();
|
|
307
|
+
const physical = placements.map((p) => resolveLogicalPlacement(p, dir));
|
|
308
|
+
return findBestPosition(targetRef.current.getBoundingClientRect(), popupRef.current.getBoundingClientRect(), physical);
|
|
309
|
+
}
|
|
168
310
|
}, [
|
|
169
311
|
findBestPosition,
|
|
170
|
-
|
|
312
|
+
placements,
|
|
171
313
|
windowDimensions,
|
|
172
314
|
popupSize,
|
|
173
315
|
targetSize,
|
|
174
316
|
isServer,
|
|
317
|
+
directionProp,
|
|
318
|
+
dirVersion,
|
|
175
319
|
]);
|
|
320
|
+
// Re-resolve when the document's <html dir> flips (a language toggle) with no
|
|
321
|
+
// size/scroll change. A single observer on the root — the one source of truth.
|
|
322
|
+
useEffect(() => {
|
|
323
|
+
if (isServer || directionProp)
|
|
324
|
+
return;
|
|
325
|
+
const observer = new MutationObserver(() => setDirVersion((v) => v + 1));
|
|
326
|
+
observer.observe(document.documentElement, {
|
|
327
|
+
attributes: true,
|
|
328
|
+
attributeFilter: ["dir"],
|
|
329
|
+
});
|
|
330
|
+
return () => observer.disconnect();
|
|
331
|
+
}, [isServer, directionProp]);
|
|
332
|
+
/**
|
|
333
|
+
* The arrow offset that keeps an arrow pointing at the target centre, computed
|
|
334
|
+
* for every placement (not only when auto-fit clamps). Consumers without an
|
|
335
|
+
* arrow ignore it.
|
|
336
|
+
*/
|
|
337
|
+
const arrowOffset = useMemo(() => {
|
|
338
|
+
if (isServer ||
|
|
339
|
+
!bestPosition ||
|
|
340
|
+
!targetRef.current ||
|
|
341
|
+
!popupRef.current ||
|
|
342
|
+
!targetSize ||
|
|
343
|
+
!popupSize)
|
|
344
|
+
return;
|
|
345
|
+
// Use the SAME popup dimensions that drove this reposition (popupSize, the
|
|
346
|
+
// observed size that `bestPosition` was recomputed from), not a fresh live
|
|
347
|
+
// rect — otherwise the width the arrow centres against can differ from the
|
|
348
|
+
// width the position was computed against, and the apex drifts a few px.
|
|
349
|
+
// The width/height are all `computeArrowOffset` reads off the popup rect.
|
|
350
|
+
const popupRect = {
|
|
351
|
+
...bestPosition.position,
|
|
352
|
+
width: popupSize.width,
|
|
353
|
+
height: popupSize.height,
|
|
354
|
+
};
|
|
355
|
+
return computeArrowOffset(bestPosition.positionName, targetRef.current.getBoundingClientRect(), popupRect,
|
|
356
|
+
// Authoritative placement — avoids the one-frame lag of the live popup rect.
|
|
357
|
+
bestPosition.position);
|
|
358
|
+
}, [bestPosition, isServer, targetSize, popupSize]);
|
|
176
359
|
/** Notify the consumer when the best position changes. */
|
|
177
360
|
useEffect(() => {
|
|
178
361
|
if (bestPosition?.positionName !== prevBestPosition.current?.positionName) {
|
|
@@ -209,11 +392,18 @@ const useWindowFitment = ({ preferredDirections = ["top", "bottom", "left", "rig
|
|
|
209
392
|
// Fake margin around the popup to prevent a mouseleave event when moving from the target to the popup.
|
|
210
393
|
...fakeMargin,
|
|
211
394
|
}), [bestPosition, maxWidth, fakeMargin]);
|
|
395
|
+
// The resolved writing direction — the `direction` override, else <html dir>.
|
|
396
|
+
// Exposed so a portalled popup can set `dir` on itself and any CSS keyed on
|
|
397
|
+
// `[dir="rtl"]` (e.g. a mirrored caret) works despite the portal.
|
|
398
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: dirVersion is a deliberate re-resolution trigger for the untracked document.documentElement.dir read.
|
|
399
|
+
const direction = useMemo(() => directionProp ?? readHtmlDirection(), [directionProp, dirVersion]);
|
|
212
400
|
return {
|
|
213
401
|
targetRef,
|
|
214
402
|
popupRef,
|
|
215
403
|
bestPosition,
|
|
216
404
|
popupPositionStyle,
|
|
405
|
+
arrowOffset,
|
|
406
|
+
direction,
|
|
217
407
|
};
|
|
218
408
|
};
|
|
219
409
|
export default useWindowFitment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWindowFitment.js","sourceRoot":"","sources":["../../../../../src/lib/hooks/useWindowFitment/useWindowFitment.tsx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AsB,CAAC,CAAC,CAAC;IAE3C,2DAA2D;IAC3D,MAAM,kBAAkB,GAAkB,OAAO,CAC/C,GAAG,EAAE,CAAC,CAAC;QACL,QAAQ,EAAE,QAAQ;QAClB,GAAG,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QACrC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC;QACvC,uGAAuG;QACvG,GAAG,UAAU;KACd,CAAC,EACF,CAAC,YAAY,EAAE,QAAQ,EAAE,UAAU,CAAC,CACrC,CAAC;IAEF,OAAO;QACL,SAAS;QACT,QAAQ;QACR,YAAY;QACZ,kBAAkB;KACnB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"useWindowFitment.js","sourceRoot":"","sources":["../../../../../src/lib/hooks/useWindowFitment/useWindowFitment.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAmBtE,+EAA+E;AAC/E,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,KAAiD,EACzB,EAAE,CAC1B,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AAEvE;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,SAAiC,EACjC,GAAkB,EACC,EAAE;IACrB,IAAI,SAAiC,CAAC;IACtC,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;QACvB,KAAK,cAAc;YACjB,SAAS,GAAG,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,O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,EAAE,EAC1C,CAAC,aAAa,EAAE,UAAU,CAAC,CAC5B,CAAC;IAEF,OAAO;QACL,SAAS;QACT,QAAQ;QACR,YAAY;QACZ,kBAAkB;QAClB,WAAW;QACX,SAAS;KACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
package/dist/esm/lib/index.js
CHANGED
|
@@ -1,26 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export * from "./_work_in_progress/
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./_work_in_progress/Section/index.js";
|
|
10
|
-
export * from "./_work_in_progress/SkipLink/index.js";
|
|
11
|
-
export * from "./_work_in_progress/TSection/index.js";
|
|
12
|
-
export * from "./component/Accordion/index.js";
|
|
13
|
-
export * from "./component/Announcement/index.js";
|
|
14
|
-
export * from "./component/Badge/index.js";
|
|
15
|
-
export * from "./component/Breadcrumbs/index.js";
|
|
16
|
-
export * from "./component/Button/index.js";
|
|
17
|
-
export * from "./component/Card/index.js";
|
|
18
|
-
export * from "./component/Chip/index.js";
|
|
19
|
-
export * from "./component/Icon/index.js";
|
|
20
|
-
export * from "./component/InlineCode/index.js";
|
|
21
|
-
export * from "./component/KeyboardKey/index.js";
|
|
22
|
-
export * from "./component/Tile/index.js";
|
|
23
|
-
export * from "./component/Tooltip/index.js";
|
|
24
|
-
export * from "./group/KeyboardKeys/index.js";
|
|
25
|
-
export * from "./pattern/Timeline/index.js";
|
|
1
|
+
// Public package surface, composed from the per-tier barrels rather than
|
|
2
|
+
// reaching into individual component folders. Each tier's members are
|
|
3
|
+
// enumerated in its own `index.ts`.
|
|
4
|
+
export * from "./_work_in_progress/index.js";
|
|
5
|
+
export * from "./component/index.js";
|
|
6
|
+
export * from "./group/index.js";
|
|
7
|
+
export * from "./pattern/index.js";
|
|
8
|
+
export * from "./subcomponent/index.js";
|
|
26
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,sEAAsE;AACtE,oCAAoC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/pattern/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "./styles.css";
|
|
3
|
+
const componentCssClassName = "ds spinner";
|
|
4
|
+
/** An empty or whitespace-only label provides no accessible name. */
|
|
5
|
+
const hasAccessibleName = (value) => typeof value === "string" && value.trim() !== "";
|
|
6
|
+
/**
|
|
7
|
+
* An indeterminate activity indicator: the `spinner` icon (the Canonical
|
|
8
|
+
* "circle of friends") rotating continuously to signal that work is in
|
|
9
|
+
* progress. Mirrors `Icon`'s rendering and accessibility model — decorative by
|
|
10
|
+
* default, exposed as a named `img` when given an `aria-label`/`aria-labelledby`
|
|
11
|
+
* — and adds the continuous rotation, which pauses under `prefers-reduced-motion`.
|
|
12
|
+
*
|
|
13
|
+
* The glyph is referenced from `@canonical/ds-assets` at runtime
|
|
14
|
+
* (`${rootPath}/spinner.svg#spinner`, default `/icons`), not bundled — the
|
|
15
|
+
* consuming app must serve those SVGs at that path, or the spinner renders
|
|
16
|
+
* empty. If the app serves icons from a different location, pass `rootPath`
|
|
17
|
+
* (per instance; there is no global default yet). See the package README
|
|
18
|
+
* ("Icon assets").
|
|
19
|
+
*
|
|
20
|
+
* `import { Spinner } from "@canonical/react-ds-global";`
|
|
21
|
+
*
|
|
22
|
+
* @implements ds:global.subcomponent.spinner
|
|
23
|
+
*/
|
|
24
|
+
const Spinner = ({ className, rootPath = "/icons", role, ...props }) => {
|
|
25
|
+
// Decorative by default and hidden from assistive technology; providing an
|
|
26
|
+
// accessible name (or an explicit role) exposes it as a named image instead.
|
|
27
|
+
// An empty label counts as decorative, mirroring the `alt=""` convention.
|
|
28
|
+
const isLabelled = hasAccessibleName(props["aria-label"]) ||
|
|
29
|
+
hasAccessibleName(props["aria-labelledby"]);
|
|
30
|
+
return (
|
|
31
|
+
// biome-ignore lint/a11y/noSvgWithoutTitle: decorative spinners render aria-hidden="true"; labelled spinners render role="img" with an aria-label/aria-labelledby (computed at runtime)
|
|
32
|
+
_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", className: [componentCssClassName, className].filter(Boolean).join(" "), role: role ?? (isLabelled ? "img" : undefined), "aria-hidden": isLabelled || role ? undefined : true, ...props, children: _jsx("use", { href: `${rootPath}/spinner.svg#spinner` }) }));
|
|
33
|
+
};
|
|
34
|
+
export default Spinner;
|
|
35
|
+
//# sourceMappingURL=Spinner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spinner.js","sourceRoot":"","sources":["../../../../../src/lib/subcomponent/Spinner/Spinner.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAE3C,qEAAqE;AACrE,MAAM,iBAAiB,GAAG,CAAC,KAAyB,EAAW,EAAE,CAC/D,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;AAEnD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,GAAG,CAAC,EACf,SAAS,EACT,QAAQ,GAAG,QAAQ,EACnB,IAAI,EACJ,GAAG,KAAK,EACK,EAAgB,EAAE;IAC/B,2EAA2E;IAC3E,6EAA6E;IAC7E,0EAA0E;IAC1E,MAAM,UAAU,GACd,iBAAiB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QACtC,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAE9C,OAAO;IACL,wLAAwL;IACxL,cACE,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,WAAW,EACnB,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACvE,IAAI,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,iBACjC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,KAC9C,KAAK,YAET,cAAK,IAAI,EAAE,GAAG,QAAQ,sBAAsB,GAAI,GAC5C,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/lib/subcomponent/Spinner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spinner styles
|
|
3
|
+
* @implements dso:global.subcomponent.spinner
|
|
4
|
+
*
|
|
5
|
+
* The Spinner renders the `spinner` glyph and rotates it continuously. The
|
|
6
|
+
* rotation is a linear, infinite animation so the motion reads as steady
|
|
7
|
+
* rather than eased.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/* A full 0→360deg turn. Keep it a full turn: Chromatic freezes infinite
|
|
11
|
+
animations at the last frame of the cycle, so a complete rotation lands on
|
|
12
|
+
360deg (visually identical to 0deg) and the snapshot stays deterministic. A
|
|
13
|
+
partial arc here would make visual tests flaky. */
|
|
14
|
+
@keyframes ds-spinner-rotate {
|
|
15
|
+
from {
|
|
16
|
+
transform: rotate(0deg);
|
|
17
|
+
}
|
|
18
|
+
to {
|
|
19
|
+
transform: rotate(360deg);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ds.spinner {
|
|
24
|
+
display: inline-block;
|
|
25
|
+
vertical-align: middle;
|
|
26
|
+
|
|
27
|
+
/* Sized from the text: the `1em` base makes the spinner track the container
|
|
28
|
+
`font-size`, so it matches adjacent text. The cascade is, in order:
|
|
29
|
+
`--spinner-size` (per-instance override) → `--icon-size` (the shared icon
|
|
30
|
+
convention, so a global icon-size tweak also sizes spinners) → `1em`. No
|
|
31
|
+
value is hard-declared here, so `:root`/ancestor overrides win. */
|
|
32
|
+
width: var(--spinner-size, var(--icon-size, 1em));
|
|
33
|
+
height: var(--spinner-size, var(--icon-size, 1em));
|
|
34
|
+
|
|
35
|
+
/* A continuous spinner wants a much longer, linear cycle than the eased
|
|
36
|
+
transition tokens describe (the fastest, `--motion-duration-slow`, is 0.4s
|
|
37
|
+
— frantic for a loop). Default to ~1s/turn via a `var()` fallback (not a
|
|
38
|
+
hard declaration) so a consumer can retune the cycle from `:root` or an
|
|
39
|
+
ancestor with `--spinner-duration`. There is no ratified motion token this
|
|
40
|
+
long yet, hence the literal fallback. */
|
|
41
|
+
animation: ds-spinner-rotate var(--spinner-duration, 1s) linear infinite;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Honour users who have asked for reduced motion: hold the icon still rather
|
|
45
|
+
than spinning it. The spinner remains visible as a static activity glyph. */
|
|
46
|
+
@media (prefers-reduced-motion: reduce) {
|
|
47
|
+
.ds.spinner {
|
|
48
|
+
animation: none;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/lib/subcomponent/Spinner/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/subcomponent/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../../../src/lib/types/link.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/_work_in_progress/Link/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/_work_in_progress/Link/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,UAAU,YAAY;IACpB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,+BAA+B;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,SAAS,CAAC,QAAQ,SAAS,WAAW,GAAG,GAAG,IACtD,yBAAyB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./CategoriesSection/index.js";
|
|
2
|
+
export * from "./ChatSection/index.js";
|
|
3
|
+
export * from "./DescriptionSection/index.js";
|
|
4
|
+
export * from "./grid/index.js";
|
|
5
|
+
export * from "./IconSection/index.js";
|
|
6
|
+
export * from "./Label/index.js";
|
|
7
|
+
export * from "./Link/index.js";
|
|
8
|
+
export * from "./Rule/index.js";
|
|
9
|
+
export * from "./Section/index.js";
|
|
10
|
+
export * from "./SkipLink/index.js";
|
|
11
|
+
export * from "./TSection/index.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/_work_in_progress/index.ts"],"names":[],"mappings":"AACA,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"}
|
|
@@ -11,6 +11,8 @@ import "./styles.css";
|
|
|
11
11
|
* efficient way. Be wary that they can also hide content from users and are
|
|
12
12
|
* not suitable when a user is meant to read all of the page content.
|
|
13
13
|
*
|
|
14
|
+
* `import { Accordion } from "@canonical/react-ds-global";`
|
|
15
|
+
*
|
|
14
16
|
* @implements dso:global.component.accordion
|
|
15
17
|
*/
|
|
16
18
|
declare const Accordion: {
|