@dxos/react-ui 0.8.4-main.bc674ce → 0.8.4-main.c351d160a8
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/dist/lib/browser/{chunk-CEKVHJ27.mjs → chunk-EJSGYGYH.mjs} +117 -117
- package/dist/lib/browser/chunk-EJSGYGYH.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +2747 -1997
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +56 -32
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/{chunk-2NHEX4AD.mjs → chunk-B7MXDDMJ.mjs} +117 -117
- package/dist/lib/node-esm/chunk-B7MXDDMJ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +2747 -1997
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +56 -32
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/types/src/components/Button/Button.d.ts +2 -2
- package/dist/types/src/components/Button/Button.d.ts.map +1 -1
- package/dist/types/src/components/Button/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Button/Toggle.d.ts +2 -2
- package/dist/types/src/components/Button/Toggle.d.ts.map +1 -1
- package/dist/types/src/components/Button/ToggleGroup.d.ts +6 -6
- package/dist/types/src/components/Button/ToggleGroup.d.ts.map +1 -1
- package/dist/types/src/components/Card/Card.d.ts +107 -0
- package/dist/types/src/components/Card/Card.d.ts.map +1 -0
- package/dist/types/src/components/Card/Card.stories.d.ts +21 -0
- package/dist/types/src/components/Card/Card.stories.d.ts.map +1 -0
- package/dist/types/src/components/Card/index.d.ts +2 -0
- package/dist/types/src/components/Card/index.d.ts.map +1 -0
- package/dist/types/src/components/Clipboard/index.d.ts +10 -1
- package/dist/types/src/components/Clipboard/index.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/AlertDialog.d.ts +26 -17
- package/dist/types/src/components/Dialog/AlertDialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/AlertDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/Dialog.d.ts +25 -18
- package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts +3 -6
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/ErrorFallback/ErrorFallback.d.ts +11 -0
- package/dist/types/src/components/ErrorFallback/ErrorFallback.d.ts.map +1 -0
- package/dist/types/src/components/ErrorFallback/ErrorFallback.stories.d.ts +7 -0
- package/dist/types/src/components/ErrorFallback/ErrorFallback.stories.d.ts.map +1 -0
- package/dist/types/src/components/ErrorFallback/ErrorStack.d.ts +8 -0
- package/dist/types/src/components/ErrorFallback/ErrorStack.d.ts.map +1 -0
- package/dist/types/src/components/ErrorFallback/ThrowError.d.ts +9 -0
- package/dist/types/src/components/ErrorFallback/ThrowError.d.ts.map +1 -0
- package/dist/types/src/components/ErrorFallback/index.d.ts +5 -0
- package/dist/types/src/components/ErrorFallback/index.d.ts.map +1 -0
- package/dist/types/src/components/Icon/Icon.d.ts.map +1 -1
- package/dist/types/src/components/Image/Image.d.ts +14 -0
- package/dist/types/src/components/Image/Image.d.ts.map +1 -0
- package/dist/types/src/components/Image/Image.stories.d.ts +33 -0
- package/dist/types/src/components/Image/Image.stories.d.ts.map +1 -0
- package/dist/types/src/components/Image/index.d.ts +2 -0
- package/dist/types/src/components/Image/index.d.ts.map +1 -0
- package/dist/types/src/components/Input/Input.d.ts +4 -7
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +7 -7
- package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/List.d.ts.map +1 -1
- package/dist/types/src/components/List/List.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/Treegrid.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.d.ts +6 -32
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.stories.d.ts +1 -5
- package/dist/types/src/components/Main/Main.stories.d.ts.map +1 -1
- package/dist/types/src/components/Menu/ContextMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menu/DropdownMenu.d.ts +51 -49
- package/dist/types/src/components/Menu/DropdownMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menu/DropdownMenu.stories.d.ts +6 -1
- package/dist/types/src/components/Menu/DropdownMenu.stories.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.stories.d.ts +2 -3
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +28 -22
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts +21 -26
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +41 -9
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts +6 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.d.ts.map +1 -1
- package/dist/types/src/components/Separator/Separator.d.ts +3 -3
- package/dist/types/src/components/Separator/Separator.d.ts.map +1 -1
- package/dist/types/src/components/Skeleton/Skeleton.d.ts +12 -0
- package/dist/types/src/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/types/src/components/Skeleton/Skeleton.stories.d.ts +17 -0
- package/dist/types/src/components/Skeleton/Skeleton.stories.d.ts.map +1 -0
- package/dist/types/src/components/Skeleton/index.d.ts +2 -0
- package/dist/types/src/components/Skeleton/index.d.ts.map +1 -0
- package/dist/types/src/components/Splitter/Splitter.d.ts +32 -0
- package/dist/types/src/components/Splitter/Splitter.d.ts.map +1 -0
- package/dist/types/src/components/Splitter/Splitter.stories.d.ts +7 -0
- package/dist/types/src/components/Splitter/Splitter.stories.d.ts.map +1 -0
- package/dist/types/src/components/Splitter/index.d.ts +2 -0
- package/dist/types/src/components/Splitter/index.d.ts.map +1 -0
- package/dist/types/src/components/Status/Status.stories.d.ts +4 -2
- package/dist/types/src/components/Status/Status.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.stories.d.ts +0 -5
- package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts +1 -0
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.stories.d.ts +12 -0
- package/dist/types/src/components/ThemeProvider/ThemeProvider.stories.d.ts.map +1 -0
- package/dist/types/src/components/Toast/Toast.d.ts +15 -15
- package/dist/types/src/components/Toast/Toast.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +33 -11
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +9 -9
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +8 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/exemplars/generics.stories.d.ts +18 -0
- package/dist/types/src/exemplars/generics.stories.d.ts.map +1 -0
- package/dist/types/src/exemplars/slot.stories.d.ts +14 -0
- package/dist/types/src/exemplars/slot.stories.d.ts.map +1 -0
- package/dist/types/src/exemplars/tabster.stories.d.ts +8 -0
- package/dist/types/src/exemplars/tabster.stories.d.ts.map +1 -0
- package/dist/types/src/exemplars/virtualizer.stories.d.ts +11 -0
- package/dist/types/src/exemplars/virtualizer.stories.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/playground/Controls.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Column/Column.d.ts +26 -0
- package/dist/types/src/primitives/Column/Column.d.ts.map +1 -0
- package/dist/types/src/primitives/Column/Column.stories.d.ts +6 -0
- package/dist/types/src/primitives/Column/Column.stories.d.ts.map +1 -0
- package/dist/types/src/primitives/Column/index.d.ts +2 -0
- package/dist/types/src/primitives/Column/index.d.ts.map +1 -0
- package/dist/types/src/primitives/Container/Container.d.ts +8 -0
- package/dist/types/src/primitives/Container/Container.d.ts.map +1 -0
- package/dist/types/src/primitives/Container/Container.stories.d.ts +6 -0
- package/dist/types/src/primitives/Container/Container.stories.d.ts.map +1 -0
- package/dist/types/src/primitives/Container/index.d.ts +2 -0
- package/dist/types/src/primitives/Container/index.d.ts.map +1 -0
- package/dist/types/src/primitives/Flex/Flex.d.ts +13 -0
- package/dist/types/src/primitives/Flex/Flex.d.ts.map +1 -0
- package/dist/types/src/primitives/Flex/Flex.stories.d.ts +8 -0
- package/dist/types/src/primitives/Flex/Flex.stories.d.ts.map +1 -0
- package/dist/types/src/primitives/Flex/index.d.ts +2 -0
- package/dist/types/src/primitives/Flex/index.d.ts.map +1 -0
- package/dist/types/src/primitives/Grid/Grid.d.ts +15 -0
- package/dist/types/src/primitives/Grid/Grid.d.ts.map +1 -0
- package/dist/types/src/primitives/Grid/Grid.stories.d.ts +8 -0
- package/dist/types/src/primitives/Grid/Grid.stories.d.ts.map +1 -0
- package/dist/types/src/primitives/Grid/index.d.ts +2 -0
- package/dist/types/src/primitives/Grid/index.d.ts.map +1 -0
- package/dist/types/src/primitives/Panel/Panel.d.ts +26 -0
- package/dist/types/src/primitives/Panel/Panel.d.ts.map +1 -0
- package/dist/types/src/primitives/Panel/Panel.stories.d.ts +6 -0
- package/dist/types/src/primitives/Panel/Panel.stories.d.ts.map +1 -0
- package/dist/types/src/primitives/Panel/index.d.ts +2 -0
- package/dist/types/src/primitives/Panel/index.d.ts.map +1 -0
- package/dist/types/src/primitives/index.d.ts +6 -0
- package/dist/types/src/primitives/index.d.ts.map +1 -0
- package/dist/types/src/testing/Loading.d.ts +9 -0
- package/dist/types/src/testing/Loading.d.ts.map +1 -0
- package/dist/types/src/testing/decorators/withLayout.d.ts +1 -1
- package/dist/types/src/testing/decorators/withLayout.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withLayoutVariants.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withTheme.d.ts +3 -2
- package/dist/types/src/testing/decorators/withTheme.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +11 -0
- package/dist/types/src/translations.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +25 -21
- package/src/components/Avatars/Avatar.stories.tsx +5 -6
- package/src/components/Avatars/Avatar.tsx +5 -12
- package/src/components/Avatars/AvatarGroup.stories.tsx +2 -2
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +3 -3
- package/src/components/Breadcrumb/Breadcrumb.tsx +11 -37
- package/src/components/Button/Button.stories.tsx +3 -3
- package/src/components/Button/Button.tsx +8 -14
- package/src/components/Button/IconButton.stories.tsx +4 -4
- package/src/components/Button/IconButton.tsx +2 -3
- package/src/components/Button/Toggle.stories.tsx +2 -2
- package/src/components/Button/Toggle.tsx +4 -4
- package/src/components/Button/ToggleGroup.stories.tsx +2 -2
- package/src/components/Button/ToggleGroup.tsx +12 -16
- package/src/components/Card/Card.stories.tsx +151 -0
- package/src/components/Card/Card.tsx +390 -0
- package/src/components/Card/index.ts +5 -0
- package/src/components/Clipboard/CopyButton.tsx +3 -3
- package/src/components/Dialog/AlertDialog.stories.tsx +15 -15
- package/src/components/Dialog/AlertDialog.tsx +137 -54
- package/src/components/Dialog/Dialog.stories.tsx +40 -15
- package/src/components/Dialog/Dialog.tsx +94 -78
- package/src/components/ErrorFallback/ErrorFallback.stories.tsx +50 -0
- package/src/components/ErrorFallback/ErrorFallback.tsx +70 -0
- package/src/components/ErrorFallback/ErrorStack.tsx +80 -0
- package/src/components/ErrorFallback/ThrowError.tsx +37 -0
- package/src/components/ErrorFallback/index.ts +9 -0
- package/src/components/Icon/Icon.stories.tsx +2 -2
- package/src/components/Icon/Icon.tsx +3 -2
- package/src/components/Image/Image.stories.tsx +86 -0
- package/src/components/Image/Image.tsx +223 -0
- package/src/components/Image/index.ts +5 -0
- package/src/components/Input/Input.stories.tsx +20 -39
- package/src/components/Input/Input.tsx +24 -69
- package/src/components/Link/Link.stories.tsx +2 -2
- package/src/components/Link/Link.tsx +2 -2
- package/src/components/List/List.stories.tsx +15 -22
- package/src/components/List/List.tsx +11 -16
- package/src/components/List/ListDropIndicator.tsx +7 -7
- package/src/components/List/Tree.stories.tsx +4 -4
- package/src/components/List/TreeDropIndicator.tsx +6 -6
- package/src/components/List/Treegrid.stories.tsx +3 -3
- package/src/components/List/Treegrid.tsx +10 -15
- package/src/components/Main/Main.stories.tsx +6 -95
- package/src/components/Main/Main.tsx +61 -211
- package/src/components/Menu/ContextMenu.stories.tsx +2 -2
- package/src/components/Menu/ContextMenu.tsx +9 -33
- package/src/components/Menu/DropdownMenu.stories.tsx +2 -2
- package/src/components/Menu/DropdownMenu.tsx +56 -50
- package/src/components/Message/Message.stories.tsx +25 -10
- package/src/components/Message/Message.tsx +17 -29
- package/src/components/Popover/Popover.stories.tsx +4 -4
- package/src/components/Popover/Popover.tsx +61 -58
- package/src/components/ScrollArea/ScrollArea.stories.tsx +152 -76
- package/src/components/ScrollArea/ScrollArea.tsx +72 -116
- package/src/components/ScrollArea/index.ts +1 -1
- package/src/components/ScrollContainer/ScrollContainer.stories.tsx +41 -22
- package/src/components/ScrollContainer/ScrollContainer.tsx +18 -13
- package/src/components/Select/Select.stories.tsx +2 -2
- package/src/components/Select/Select.tsx +11 -27
- package/src/components/Separator/Separator.tsx +5 -8
- package/src/components/Skeleton/Skeleton.stories.tsx +52 -0
- package/src/components/Skeleton/Skeleton.tsx +26 -0
- package/src/components/Skeleton/index.ts +5 -0
- package/src/components/Splitter/Splitter.stories.tsx +83 -0
- package/src/components/Splitter/Splitter.tsx +126 -0
- package/src/components/Splitter/index.ts +5 -0
- package/src/components/Status/Status.stories.tsx +21 -17
- package/src/components/Status/Status.tsx +2 -2
- package/src/components/Tag/Tag.stories.tsx +4 -9
- package/src/components/Tag/Tag.tsx +2 -7
- package/src/components/ThemeProvider/ThemeProvider.stories.tsx +32 -0
- package/src/components/ThemeProvider/ThemeProvider.tsx +4 -3
- package/src/components/Toast/Toast.stories.tsx +2 -2
- package/src/components/Toast/Toast.tsx +22 -41
- package/src/components/Toolbar/Toolbar.stories.tsx +2 -2
- package/src/components/Toolbar/Toolbar.tsx +166 -21
- package/src/components/Tooltip/Tooltip.stories.tsx +15 -13
- package/src/components/Tooltip/Tooltip.tsx +18 -18
- package/src/components/index.ts +9 -5
- package/src/exemplars/generics.stories.tsx +49 -0
- package/src/exemplars/slot.stories.tsx +107 -0
- package/src/exemplars/tabster.stories.tsx +127 -0
- package/src/exemplars/virtualizer.stories.tsx +137 -0
- package/src/hooks/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/playground/Controls.stories.tsx +3 -10
- package/src/playground/Custom.stories.tsx +11 -11
- package/src/playground/Typography.stories.tsx +3 -3
- package/src/primitives/Column/Column.stories.tsx +78 -0
- package/src/primitives/Column/Column.tsx +133 -0
- package/src/primitives/Column/index.ts +5 -0
- package/src/primitives/Container/Container.stories.tsx +30 -0
- package/src/primitives/Container/Container.tsx +22 -0
- package/src/primitives/Container/index.ts +5 -0
- package/src/primitives/Flex/Flex.stories.tsx +58 -0
- package/src/primitives/Flex/Flex.tsx +29 -0
- package/src/primitives/Flex/index.ts +5 -0
- package/src/primitives/Grid/Grid.stories.tsx +57 -0
- package/src/primitives/Grid/Grid.tsx +35 -0
- package/src/primitives/Grid/index.ts +5 -0
- package/src/primitives/Panel/Panel.stories.tsx +67 -0
- package/src/primitives/Panel/Panel.tsx +119 -0
- package/src/primitives/Panel/index.ts +5 -0
- package/src/primitives/index.ts +9 -0
- package/src/testing/Loading.tsx +26 -0
- package/src/testing/decorators/withLayout.tsx +21 -7
- package/src/testing/decorators/withLayoutVariants.tsx +18 -21
- package/src/testing/decorators/withTheme.tsx +19 -17
- package/src/testing/index.ts +2 -0
- package/src/translations.ts +19 -0
- package/dist/lib/browser/chunk-CEKVHJ27.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2NHEX4AD.mjs.map +0 -7
- package/dist/types/src/components/AnchoredOverflow/AnchoredOverflow.d.ts +0 -15
- package/dist/types/src/components/AnchoredOverflow/AnchoredOverflow.d.ts.map +0 -1
- package/dist/types/src/components/AnchoredOverflow/index.d.ts +0 -2
- package/dist/types/src/components/AnchoredOverflow/index.d.ts.map +0 -1
- package/src/components/AnchoredOverflow/AnchoredOverflow.tsx +0 -59
- package/src/components/AnchoredOverflow/index.ts +0 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/testing/decorators/withLayout.tsx", "../../../../src/testing/decorators/withLayoutVariants.tsx", "../../../../src/testing/decorators/withTheme.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport React, { type FC, type PropsWithChildren, memo } from 'react';\n\nimport { type ClassNameValue, type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nexport type ContainerProps = ThemedClassName<PropsWithChildren>;\n\nexport type ContainerType = 'fullscreen' | 'column';\n\nexport type WithLayoutProps =\n | FC<ContainerProps>\n | {\n classNames?: ClassNameValue;\n layout?: ContainerType;\n scroll?: boolean;\n };\n\n/**\n * Adds layout container.\n */\nexport const withLayout =\n (props: WithLayoutProps = {}): Decorator =>\n (Story) => {\n // Prevent re-rendering of the story.\n const MemoizedStory = memo(Story);\n if (typeof props === 'function') {\n const Container = props;\n return (\n <Container>\n <MemoizedStory />\n </Container>\n );\n } else {\n const { layout = '
|
|
5
|
-
"mappings": ";;;;;;AAKA,OAAOA,SAA0CC,YAAY;AAG7D,SAASC,UAAU;AAiBZ,IAAMC,aACX,CAACC,QAAyB,CAAC,MAC3B,CAACC,UAAAA;AAEC,QAAMC,gBAAgBC,qBAAKF,KAAAA;AAC3B,MAAI,OAAOD,UAAU,YAAY;AAC/B,UAAMI,aAAYJ;AAClB,WACE,sBAAA,cAACI,YAAAA,MACC,sBAAA,cAACF,eAAAA,IAAAA,CAAAA;EAGP,OAAO;AACL,UAAM,EAAEG,SAAS,
|
|
6
|
-
"names": ["React", "memo", "mx", "withLayout", "props", "Story", "MemoizedStory", "memo", "Container", "layout", "classNames", "scroll", "layouts", "fullscreen", "mx", "children", "div", "role", "className", "column", "React", "mx", "surfaceShadow", "Container", "children", "elevation", "surface", "React", "div", "className", "mx", "surfaceShadow", "Panel", "Story", "elevations", "densities", "map", "density", "key", "withLayoutVariants", "React", "memo", "defaultTx", "withTheme", "Story", "context", "globals", "theme", "parameters", "translations", "MemoizedStory", "memo", "React", "ThemeProvider", "
|
|
3
|
+
"sources": ["../../../../src/testing/decorators/withLayout.tsx", "../../../../src/testing/decorators/withLayoutVariants.tsx", "../../../../src/testing/decorators/withTheme.tsx", "../../../../src/testing/Loading.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport React, { type FC, type PropsWithChildren, memo } from 'react';\n\nimport { type ClassNameValue, type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nexport type ContainerProps = ThemedClassName<PropsWithChildren>;\n\nexport type ContainerType = 'default' | 'fullscreen' | 'centered' | 'column';\n\nexport type WithLayoutProps =\n | FC<ContainerProps>\n | {\n classNames?: ClassNameValue;\n layout?: ContainerType;\n scroll?: boolean;\n };\n\n/**\n * Adds layout container.\n */\nexport const withLayout =\n (props: WithLayoutProps = {}): Decorator =>\n (Story) => {\n // Prevent re-rendering of the story.\n const MemoizedStory = memo(Story);\n if (typeof props === 'function') {\n const Container = props;\n return (\n <Container>\n <MemoizedStory />\n </Container>\n );\n } else {\n const { layout = 'default', classNames, scroll } = props;\n const Container = layouts[layout] ?? layouts.fullscreen;\n return (\n <Container classNames={mx(classNames, scroll ? 'overflow-y-auto' : 'overflow-hidden')}>\n <MemoizedStory />\n </Container>\n );\n }\n };\n\nconst layouts: Record<ContainerType, FC<ContainerProps>> = {\n default: ({ classNames, children }: ContainerProps) => (\n <div role='none' className={mx('p-4', classNames)}>\n {children}\n </div>\n ),\n\n fullscreen: ({ classNames, children }: ContainerProps) => (\n <div role='none' className={mx('fixed inset-0 flex overflow-hidden bg-base-surface', classNames)}>\n {children}\n </div>\n ),\n\n centered: ({ classNames, children }: ContainerProps) => (\n <div role='none' className={mx('fixed inset-0 grid overflow-hidden place-items-center bg-base-surface')}>\n <div role='none' className={mx('flex flex-col bg-group-surface', classNames)}>\n {children}\n </div>\n </div>\n ),\n\n column: ({ classNames, children }: ContainerProps) => (\n <div role='none' className='fixed inset-0 flex overflow-hidden justify-center bg-base-surface'>\n <div role='none' className={mx('flex flex-col w-[40rem] bg-group-surface', classNames)}>\n {children}\n </div>\n </div>\n ),\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport React, { type ComponentType, type PropsWithChildren } from 'react';\n\nimport { mx, surfaceShadow } from '@dxos/ui-theme';\nimport { type Density, type Elevation } from '@dxos/ui-types';\n\ntype Config = {\n elevations?: { elevation: Elevation; surface?: string }[];\n densities?: Density[];\n};\n\nconst Container = ({ children, elevation, surface }: PropsWithChildren<{ elevation: Elevation; surface?: string }>) => (\n <div className={mx('p-4 rounded-sm', surface, surfaceShadow({ elevation }))}>{children}</div>\n);\n\nconst Panel = ({\n Story,\n elevations,\n densities,\n className,\n}: { Story: ComponentType } & Config & { className?: string }) => {\n return (\n <div className={mx('flex flex-col h-full p-8 gap-8', className)}>\n {elevations?.map(({ elevation, surface }) =>\n densities?.map((density) => (\n <Container key={`${elevation}--${density}`} surface={surface} elevation={elevation}>\n <Story />\n </Container>\n )),\n )}\n </div>\n );\n};\n\nexport const withLayoutVariants = ({\n elevations = [\n { elevation: 'dialog', surface: 'bg-modal-surface' },\n { elevation: 'positioned', surface: 'bg-card-surface' },\n { elevation: 'base', surface: 'bg-base-surface' },\n ],\n densities = ['coarse'],\n}: Config = {}): Decorator => {\n return (Story) => <Panel Story={Story} elevations={elevations} densities={densities} />;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport React, { memo } from 'react';\n\nimport { defaultTx } from '@dxos/ui-theme';\nimport { type ThemeMode } from '@dxos/ui-types';\n\nimport { type ThemeContextValue, ThemeProvider, Tooltip } from '../../components';\n\n/**\n * Adds theme decorator.\n */\nexport const withTheme =\n ({ tx = defaultTx, ...props }: Partial<ThemeContextValue> = {}): Decorator =>\n (Story, context) => {\n const {\n globals: { theme },\n parameters: { translations },\n } = context;\n\n // Prevent re-rendering of the story.\n const MemoizedStory = memo(Story);\n\n return (\n <ThemeProvider {...props} tx={tx} themeMode={theme as ThemeMode} resourceExtensions={translations} noCache>\n <Tooltip.Provider>\n <MemoizedStory />\n </Tooltip.Provider>\n </ThemeProvider>\n );\n };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { mx } from '@dxos/ui-theme';\nimport { safeStringify } from '@dxos/util';\nimport React, { useEffect, useState } from 'react';\n\nexport type LoadingProps = { data?: any };\n\n/**\n * Storybook loading component.\n */\nexport const Loading = ({ data }: LoadingProps) => {\n const [visible, setVisible] = useState(false);\n useEffect(() => {\n const t = setTimeout(() => setVisible(true), 500);\n return () => clearTimeout(t);\n }, []);\n return (\n <div className={mx('flex flex-col opacity-0 transition delay-1000 duration-1000', visible && 'opacity-100')}>\n <h2 className='uppercase'>Loading</h2>\n <pre>{safeStringify(data, undefined, 2)}</pre>\n </div>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;AAKA,OAAOA,SAA0CC,YAAY;AAG7D,SAASC,UAAU;AAiBZ,IAAMC,aACX,CAACC,QAAyB,CAAC,MAC3B,CAACC,UAAAA;AAEC,QAAMC,gBAAgBC,qBAAKF,KAAAA;AAC3B,MAAI,OAAOD,UAAU,YAAY;AAC/B,UAAMI,aAAYJ;AAClB,WACE,sBAAA,cAACI,YAAAA,MACC,sBAAA,cAACF,eAAAA,IAAAA,CAAAA;EAGP,OAAO;AACL,UAAM,EAAEG,SAAS,WAAWC,YAAYC,OAAM,IAAKP;AACnD,UAAMI,aAAYI,QAAQH,MAAAA,KAAWG,QAAQC;AAC7C,WACE,sBAAA,cAACL,YAAAA;MAAUE,YAAYI,GAAGJ,YAAYC,SAAS,oBAAoB,iBAAA;OACjE,sBAAA,cAACL,eAAAA,IAAAA,CAAAA;EAGP;AACF;AAEF,IAAMM,UAAqD;EACzDG,SAAS,CAAC,EAAEL,YAAYM,SAAQ,MAC9B,sBAAA,cAACC,OAAAA;IAAIC,MAAK;IAAOC,WAAWL,GAAG,OAAOJ,UAAAA;KACnCM,QAAAA;EAILH,YAAY,CAAC,EAAEH,YAAYM,SAAQ,MACjC,sBAAA,cAACC,OAAAA;IAAIC,MAAK;IAAOC,WAAWL,GAAG,sDAAsDJ,UAAAA;KAClFM,QAAAA;EAILI,UAAU,CAAC,EAAEV,YAAYM,SAAQ,MAC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A;IAAMC;IAAcC;IAAwBC;;AACjE;;;AC1CA,OAAOK,UAASC,QAAAA,aAAY;AAE5B,SAASC,iBAAiB;AAQnB,IAAMC,YACX,CAAC,EAAEC,KAAKC,WAAW,GAAGC,MAAAA,IAAsC,CAAC,MAC7D,CAACC,OAAOC,YAAAA;AACN,QAAM,EACJC,SAAS,EAAEC,MAAK,GAChBC,YAAY,EAAEC,aAAY,EAAE,IAC1BJ;AAGJ,QAAMK,gBAAgBC,gBAAAA,MAAKP,KAAAA;AAE3B,SACE,gBAAAQ,OAAA,cAACC,eAAAA;IAAe,GAAGV;IAAOF;IAAQa,WAAWP;IAAoBQ,oBAAoBN;IAAcO,SAAAA;KACjG,gBAAAJ,OAAA,cAACK,QAAQC,UAAQ,MACf,gBAAAN,OAAA,cAACF,eAAAA,IAAAA,CAAAA,CAAAA;AAIT;;;AC7BF,SAASS,MAAAA,WAAU;AACnB,SAASC,qBAAqB;AAC9B,OAAOC,UAASC,WAAWC,gBAAgB;AAOpC,IAAMC,UAAU,CAAC,EAAEC,KAAI,MAAgB;AAC5C,QAAM,CAACC,SAASC,UAAAA,IAAcC,SAAS,KAAA;AACvCC,YAAU,MAAA;AACR,UAAMC,IAAIC,WAAW,MAAMJ,WAAW,IAAA,GAAO,GAAA;AAC7C,WAAO,MAAMK,aAAaF,CAAAA;EAC5B,GAAG,CAAA,CAAE;AACL,SACE,gBAAAG,OAAA,cAACC,OAAAA;IAAIC,WAAWC,IAAG,+DAA+DV,WAAW,aAAA;KAC3F,gBAAAO,OAAA,cAACI,MAAAA;IAAGF,WAAU;KAAY,SAAA,GAC1B,gBAAAF,OAAA,cAACK,OAAAA,MAAKC,cAAcd,MAAMe,QAAW,CAAA,CAAA,CAAA;AAG3C;",
|
|
6
|
+
"names": ["React", "memo", "mx", "withLayout", "props", "Story", "MemoizedStory", "memo", "Container", "layout", "classNames", "scroll", "layouts", "fullscreen", "mx", "default", "children", "div", "role", "className", "centered", "column", "React", "mx", "surfaceShadow", "Container", "children", "elevation", "surface", "React", "div", "className", "mx", "surfaceShadow", "Panel", "Story", "elevations", "densities", "map", "density", "key", "withLayoutVariants", "React", "memo", "defaultTx", "withTheme", "tx", "defaultTx", "props", "Story", "context", "globals", "theme", "parameters", "translations", "MemoizedStory", "memo", "React", "ThemeProvider", "themeMode", "resourceExtensions", "noCache", "Tooltip", "Provider", "mx", "safeStringify", "React", "useEffect", "useState", "Loading", "data", "visible", "setVisible", "useState", "useEffect", "t", "setTimeout", "clearTimeout", "React", "div", "className", "mx", "h2", "pre", "safeStringify", "undefined"]
|
|
7
7
|
}
|
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
|
|
3
|
+
// src/components/DensityProvider/DensityProvider.tsx
|
|
4
|
+
import React, { createContext } from "react";
|
|
5
|
+
var DensityContext = /* @__PURE__ */ createContext({
|
|
6
|
+
density: "fine"
|
|
7
|
+
});
|
|
8
|
+
var DensityProvider = ({ density, children }) => /* @__PURE__ */ React.createElement(DensityContext.Provider, {
|
|
9
|
+
value: {
|
|
10
|
+
density
|
|
11
|
+
}
|
|
12
|
+
}, children);
|
|
13
|
+
|
|
14
|
+
// src/components/ElevationProvider/ElevationProvider.tsx
|
|
15
|
+
import React2, { createContext as createContext2 } from "react";
|
|
16
|
+
var ElevationContext = /* @__PURE__ */ createContext2({
|
|
17
|
+
elevation: "base"
|
|
18
|
+
});
|
|
19
|
+
var ElevationProvider = ({ elevation, children }) => /* @__PURE__ */ React2.createElement(ElevationContext.Provider, {
|
|
20
|
+
value: {
|
|
21
|
+
elevation
|
|
22
|
+
}
|
|
23
|
+
}, children);
|
|
24
|
+
|
|
3
25
|
// src/hooks/useElevationContext.ts
|
|
4
26
|
import { useContext as useContext3 } from "react";
|
|
5
27
|
|
|
28
|
+
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
29
|
+
import { createKeyborg } from "keyborg";
|
|
30
|
+
import React4, { createContext as createContext4, useEffect as useEffect2, useMemo } from "react";
|
|
31
|
+
|
|
6
32
|
// src/hooks/useThemeContext.ts
|
|
7
33
|
import { useContext } from "react";
|
|
8
34
|
import { raise } from "@dxos/debug";
|
|
@@ -34,7 +60,7 @@ var useSafeArea = () => {
|
|
|
34
60
|
// src/components/ThemeProvider/TranslationsProvider.tsx
|
|
35
61
|
import { enUS as dtLocaleEnUs } from "date-fns/locale";
|
|
36
62
|
import i18Next from "i18next";
|
|
37
|
-
import
|
|
63
|
+
import React3, { Suspense, createContext as createContext3, useContext as useContext2, useEffect, useState as useState2 } from "react";
|
|
38
64
|
import { initReactI18next, useTranslation as useI18NextTranslation } from "react-i18next";
|
|
39
65
|
var initialLng = "en-US";
|
|
40
66
|
var initialNs = "dxos-common";
|
|
@@ -54,7 +80,7 @@ void i18Next.use(initReactI18next).init({
|
|
|
54
80
|
escapeValue: false
|
|
55
81
|
}
|
|
56
82
|
});
|
|
57
|
-
var TranslationsContext = /* @__PURE__ */
|
|
83
|
+
var TranslationsContext = /* @__PURE__ */ createContext3({
|
|
58
84
|
appNs: initialNs,
|
|
59
85
|
dtLocale: initialDtLocale
|
|
60
86
|
});
|
|
@@ -83,16 +109,64 @@ var TranslationsProvider = ({ fallback, resourceExtensions, children, appNs, dtL
|
|
|
83
109
|
}, [
|
|
84
110
|
resourceExtensions
|
|
85
111
|
]);
|
|
86
|
-
return /* @__PURE__ */
|
|
112
|
+
return /* @__PURE__ */ React3.createElement(TranslationsContext.Provider, {
|
|
87
113
|
value: {
|
|
88
114
|
appNs: appNs ?? initialNs,
|
|
89
115
|
dtLocale: dtLocale ?? initialDtLocale
|
|
90
116
|
}
|
|
91
|
-
}, /* @__PURE__ */
|
|
117
|
+
}, /* @__PURE__ */ React3.createElement(Suspense, {
|
|
92
118
|
fallback
|
|
93
119
|
}, loaded ? children : fallback));
|
|
94
120
|
};
|
|
95
121
|
|
|
122
|
+
// src/util/hasIosKeyboard.ts
|
|
123
|
+
var hasIosKeyboard = () => {
|
|
124
|
+
return !!navigator.userAgent.match(/iP(ad|od|hone).+Safari/);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
128
|
+
var ThemeContext = /* @__PURE__ */ createContext4(void 0);
|
|
129
|
+
var ThemeProvider = ({ children, fallback = null, resourceExtensions, appNs, tx = (_path, _styleProps, ..._options) => void 0, themeMode = "dark", rootDensity = "fine", ...rest }) => {
|
|
130
|
+
useEffect2(() => {
|
|
131
|
+
if (document.defaultView) {
|
|
132
|
+
const kb = createKeyborg(document.defaultView);
|
|
133
|
+
kb.subscribe(handleInputModalityChange);
|
|
134
|
+
return () => kb.unsubscribe(handleInputModalityChange);
|
|
135
|
+
}
|
|
136
|
+
}, []);
|
|
137
|
+
const safeAreaPadding = useSafeArea();
|
|
138
|
+
const contextValue = useMemo(() => ({
|
|
139
|
+
tx,
|
|
140
|
+
themeMode,
|
|
141
|
+
hasIosKeyboard: hasIosKeyboard(),
|
|
142
|
+
safeAreaPadding,
|
|
143
|
+
...rest
|
|
144
|
+
}), [
|
|
145
|
+
tx,
|
|
146
|
+
themeMode,
|
|
147
|
+
safeAreaPadding,
|
|
148
|
+
rest
|
|
149
|
+
]);
|
|
150
|
+
return /* @__PURE__ */ React4.createElement(ThemeContext.Provider, {
|
|
151
|
+
value: contextValue
|
|
152
|
+
}, /* @__PURE__ */ React4.createElement(TranslationsProvider, {
|
|
153
|
+
fallback,
|
|
154
|
+
resourceExtensions,
|
|
155
|
+
appNs
|
|
156
|
+
}, /* @__PURE__ */ React4.createElement(ElevationProvider, {
|
|
157
|
+
elevation: "base"
|
|
158
|
+
}, /* @__PURE__ */ React4.createElement(DensityProvider, {
|
|
159
|
+
density: rootDensity
|
|
160
|
+
}, children))));
|
|
161
|
+
};
|
|
162
|
+
var handleInputModalityChange = (isUsingKeyboard) => {
|
|
163
|
+
if (isUsingKeyboard) {
|
|
164
|
+
document.body.setAttribute("data-w-keyboard", "true");
|
|
165
|
+
} else {
|
|
166
|
+
document.body.removeAttribute("data-w-keyboard");
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
|
|
96
170
|
// src/components/Tooltip/Tooltip.tsx
|
|
97
171
|
import { composeEventHandlers } from "@radix-ui/primitive";
|
|
98
172
|
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
@@ -107,7 +181,7 @@ import { Primitive } from "@radix-ui/react-primitive";
|
|
|
107
181
|
import { Slottable } from "@radix-ui/react-slot";
|
|
108
182
|
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
109
183
|
import * as VisuallyHiddenPrimitive from "@radix-ui/react-visually-hidden";
|
|
110
|
-
import
|
|
184
|
+
import React5, { forwardRef, useCallback as useCallback2, useEffect as useEffect3, useMemo as useMemo2, useRef, useState as useState3 } from "react";
|
|
111
185
|
var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
|
|
112
186
|
createPopperScope
|
|
113
187
|
]);
|
|
@@ -121,7 +195,7 @@ var TooltipProvider = (props) => {
|
|
|
121
195
|
const isOpenDelayedRef = useRef(true);
|
|
122
196
|
const isPointerInTransitRef = useRef(false);
|
|
123
197
|
const skipDelayTimerRef = useRef(0);
|
|
124
|
-
|
|
198
|
+
useEffect3(() => {
|
|
125
199
|
const skipDelayTimer = skipDelayTimerRef.current;
|
|
126
200
|
return () => window.clearTimeout(skipDelayTimer);
|
|
127
201
|
}, []);
|
|
@@ -158,7 +232,7 @@ var TooltipProvider = (props) => {
|
|
|
158
232
|
defaultProp: defaultOpen,
|
|
159
233
|
onChange: handleOpenChange
|
|
160
234
|
});
|
|
161
|
-
const stateAttribute =
|
|
235
|
+
const stateAttribute = useMemo2(() => {
|
|
162
236
|
return open ? wasOpenDelayedRef.current ? "delayed-open" : "instant-open" : "closed";
|
|
163
237
|
}, [
|
|
164
238
|
open
|
|
@@ -189,7 +263,7 @@ var TooltipProvider = (props) => {
|
|
|
189
263
|
delayDuration,
|
|
190
264
|
setOpen
|
|
191
265
|
]);
|
|
192
|
-
|
|
266
|
+
useEffect3(() => {
|
|
193
267
|
return () => {
|
|
194
268
|
if (openTimerRef.current) {
|
|
195
269
|
window.clearTimeout(openTimerRef.current);
|
|
@@ -199,7 +273,7 @@ var TooltipProvider = (props) => {
|
|
|
199
273
|
}, []);
|
|
200
274
|
const { tx } = useThemeContext();
|
|
201
275
|
const elevation = useElevationContext();
|
|
202
|
-
return /* @__PURE__ */
|
|
276
|
+
return /* @__PURE__ */ React5.createElement(PopperPrimitive.Root, popperScope, /* @__PURE__ */ React5.createElement(TooltipContextProvider, {
|
|
203
277
|
scope: __scopeTooltip,
|
|
204
278
|
contentId,
|
|
205
279
|
open,
|
|
@@ -235,21 +309,21 @@ var TooltipProvider = (props) => {
|
|
|
235
309
|
onPointerInTransitChange: useCallback2((inTransit) => {
|
|
236
310
|
isPointerInTransitRef.current = inTransit;
|
|
237
311
|
}, [])
|
|
238
|
-
}, /* @__PURE__ */
|
|
312
|
+
}, /* @__PURE__ */ React5.createElement(TooltipContent, {
|
|
239
313
|
side,
|
|
240
|
-
className: tx("tooltip.content",
|
|
314
|
+
className: tx("tooltip.content", {
|
|
241
315
|
elevation
|
|
242
316
|
})
|
|
243
|
-
}, content, /* @__PURE__ */
|
|
244
|
-
className: tx("tooltip.arrow"
|
|
245
|
-
})), /* @__PURE__ */
|
|
317
|
+
}, content, /* @__PURE__ */ React5.createElement(TooltipArrow, {
|
|
318
|
+
className: tx("tooltip.arrow")
|
|
319
|
+
})), /* @__PURE__ */ React5.createElement(TooltipVirtualTrigger, {
|
|
246
320
|
virtualRef: triggerRef
|
|
247
321
|
}), children));
|
|
248
322
|
};
|
|
249
323
|
TooltipProvider.displayName = TOOLTIP_NAME;
|
|
250
324
|
var TooltipVirtualTrigger = ({ virtualRef, __scopeTooltip }) => {
|
|
251
325
|
const popperScope = usePopperScope(__scopeTooltip);
|
|
252
|
-
return /* @__PURE__ */
|
|
326
|
+
return /* @__PURE__ */ React5.createElement(PopperPrimitive.Anchor, {
|
|
253
327
|
asChild: true,
|
|
254
328
|
...popperScope,
|
|
255
329
|
virtualRef
|
|
@@ -272,12 +346,12 @@ var TooltipTrigger = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
|
272
346
|
const isPointerDownRef = useRef(false);
|
|
273
347
|
const hasPointerMoveOpenedRef = useRef(false);
|
|
274
348
|
const handlePointerUp = useCallback2(() => isPointerDownRef.current = false, []);
|
|
275
|
-
|
|
349
|
+
useEffect3(() => {
|
|
276
350
|
return () => document.removeEventListener("pointerup", handlePointerUp);
|
|
277
351
|
}, [
|
|
278
352
|
handlePointerUp
|
|
279
353
|
]);
|
|
280
|
-
return /* @__PURE__ */
|
|
354
|
+
return /* @__PURE__ */ React5.createElement(Primitive.button, {
|
|
281
355
|
// We purposefully avoid adding `type=button` here because tooltip triggers are also
|
|
282
356
|
// commonly anchors and the anchor `type` attribute signifies MIME type.
|
|
283
357
|
"aria-describedby": context.open ? context.contentId : void 0,
|
|
@@ -326,12 +400,12 @@ var [PortalProvider, usePortalContext] = createTooltipContext(PORTAL_NAME, {
|
|
|
326
400
|
var TooltipPortal = (props) => {
|
|
327
401
|
const { __scopeTooltip, forceMount, children, container } = props;
|
|
328
402
|
const context = useTooltipContext(PORTAL_NAME, __scopeTooltip);
|
|
329
|
-
return /* @__PURE__ */
|
|
403
|
+
return /* @__PURE__ */ React5.createElement(PortalProvider, {
|
|
330
404
|
scope: __scopeTooltip,
|
|
331
405
|
forceMount
|
|
332
|
-
}, /* @__PURE__ */
|
|
406
|
+
}, /* @__PURE__ */ React5.createElement(Presence, {
|
|
333
407
|
present: forceMount || context.open
|
|
334
|
-
}, /* @__PURE__ */
|
|
408
|
+
}, /* @__PURE__ */ React5.createElement(PortalPrimitive, {
|
|
335
409
|
asChild: true,
|
|
336
410
|
container
|
|
337
411
|
}, children)));
|
|
@@ -342,13 +416,13 @@ var TooltipContent = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
|
342
416
|
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeTooltip);
|
|
343
417
|
const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props;
|
|
344
418
|
const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);
|
|
345
|
-
return /* @__PURE__ */
|
|
419
|
+
return /* @__PURE__ */ React5.createElement(Presence, {
|
|
346
420
|
present: forceMount || context.open
|
|
347
|
-
}, context.disableHoverableContent ? /* @__PURE__ */
|
|
421
|
+
}, context.disableHoverableContent ? /* @__PURE__ */ React5.createElement(TooltipContentImpl, {
|
|
348
422
|
side,
|
|
349
423
|
...contentProps,
|
|
350
424
|
ref: forwardedRef
|
|
351
|
-
}) : /* @__PURE__ */
|
|
425
|
+
}) : /* @__PURE__ */ React5.createElement(TooltipContentHoverable, {
|
|
352
426
|
side,
|
|
353
427
|
...contentProps,
|
|
354
428
|
ref: forwardedRef
|
|
@@ -386,12 +460,12 @@ var TooltipContentHoverable = /* @__PURE__ */ forwardRef((props, forwardedRef) =
|
|
|
386
460
|
}, [
|
|
387
461
|
onPointerInTransitChange
|
|
388
462
|
]);
|
|
389
|
-
|
|
463
|
+
useEffect3(() => {
|
|
390
464
|
return () => handleRemoveGraceArea();
|
|
391
465
|
}, [
|
|
392
466
|
handleRemoveGraceArea
|
|
393
467
|
]);
|
|
394
|
-
|
|
468
|
+
useEffect3(() => {
|
|
395
469
|
if (trigger && content) {
|
|
396
470
|
const handleTriggerLeave = (event) => handleCreateGraceArea(event, content);
|
|
397
471
|
const handleContentLeave = (event) => handleCreateGraceArea(event, trigger);
|
|
@@ -408,7 +482,7 @@ var TooltipContentHoverable = /* @__PURE__ */ forwardRef((props, forwardedRef) =
|
|
|
408
482
|
handleCreateGraceArea,
|
|
409
483
|
handleRemoveGraceArea
|
|
410
484
|
]);
|
|
411
|
-
|
|
485
|
+
useEffect3(() => {
|
|
412
486
|
if (pointerGraceArea) {
|
|
413
487
|
const handleTrackPointerGrace = (event) => {
|
|
414
488
|
const target = event.target;
|
|
@@ -435,7 +509,7 @@ var TooltipContentHoverable = /* @__PURE__ */ forwardRef((props, forwardedRef) =
|
|
|
435
509
|
onClose,
|
|
436
510
|
handleRemoveGraceArea
|
|
437
511
|
]);
|
|
438
|
-
return /* @__PURE__ */
|
|
512
|
+
return /* @__PURE__ */ React5.createElement(TooltipContentImpl, {
|
|
439
513
|
...props,
|
|
440
514
|
ref: composedRefs
|
|
441
515
|
});
|
|
@@ -448,13 +522,13 @@ var TooltipContentImpl = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
|
448
522
|
const context = useTooltipContext(CONTENT_NAME, __scopeTooltip);
|
|
449
523
|
const popperScope = usePopperScope(__scopeTooltip);
|
|
450
524
|
const { onClose } = context;
|
|
451
|
-
|
|
525
|
+
useEffect3(() => {
|
|
452
526
|
document.addEventListener(TOOLTIP_OPEN, onClose);
|
|
453
527
|
return () => document.removeEventListener(TOOLTIP_OPEN, onClose);
|
|
454
528
|
}, [
|
|
455
529
|
onClose
|
|
456
530
|
]);
|
|
457
|
-
|
|
531
|
+
useEffect3(() => {
|
|
458
532
|
if (context.trigger) {
|
|
459
533
|
const handleScroll = (event) => {
|
|
460
534
|
const target = event.target;
|
|
@@ -473,14 +547,14 @@ var TooltipContentImpl = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
|
473
547
|
context.trigger,
|
|
474
548
|
onClose
|
|
475
549
|
]);
|
|
476
|
-
return /* @__PURE__ */
|
|
550
|
+
return /* @__PURE__ */ React5.createElement(DismissableLayer, {
|
|
477
551
|
asChild: true,
|
|
478
552
|
disableOutsidePointerEvents: false,
|
|
479
553
|
onEscapeKeyDown,
|
|
480
554
|
onPointerDownOutside,
|
|
481
555
|
onFocusOutside: (event) => event.preventDefault(),
|
|
482
556
|
onDismiss: onClose
|
|
483
|
-
}, /* @__PURE__ */
|
|
557
|
+
}, /* @__PURE__ */ React5.createElement(PopperPrimitive.Content, {
|
|
484
558
|
"data-state": context.stateAttribute,
|
|
485
559
|
...popperScope,
|
|
486
560
|
...contentProps,
|
|
@@ -496,10 +570,10 @@ var TooltipContentImpl = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
|
496
570
|
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
497
571
|
}
|
|
498
572
|
}
|
|
499
|
-
}, /* @__PURE__ */
|
|
573
|
+
}, /* @__PURE__ */ React5.createElement(Slottable, null, children), /* @__PURE__ */ React5.createElement(VisuallyHiddenContentContextProvider, {
|
|
500
574
|
scope: __scopeTooltip,
|
|
501
575
|
isInside: true
|
|
502
|
-
}, /* @__PURE__ */
|
|
576
|
+
}, /* @__PURE__ */ React5.createElement(VisuallyHiddenPrimitive.Root, {
|
|
503
577
|
id: context.contentId,
|
|
504
578
|
role: "tooltip"
|
|
505
579
|
}, ariaLabel || children))));
|
|
@@ -510,7 +584,7 @@ var TooltipArrow = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
|
510
584
|
const { __scopeTooltip, ...arrowProps } = props;
|
|
511
585
|
const popperScope = usePopperScope(__scopeTooltip);
|
|
512
586
|
const visuallyHiddenContentContext = useVisuallyHiddenContentContext(ARROW_NAME, __scopeTooltip);
|
|
513
|
-
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */
|
|
587
|
+
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ React5.createElement(PopperPrimitive.Arrow, {
|
|
514
588
|
...popperScope,
|
|
515
589
|
...arrowProps,
|
|
516
590
|
ref: forwardedRef
|
|
@@ -675,80 +749,6 @@ var Tooltip = {
|
|
|
675
749
|
Trigger: TooltipTrigger
|
|
676
750
|
};
|
|
677
751
|
|
|
678
|
-
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
679
|
-
import { createKeyborg } from "keyborg";
|
|
680
|
-
import React5, { createContext as createContext4, useEffect as useEffect3, useMemo as useMemo2 } from "react";
|
|
681
|
-
|
|
682
|
-
// src/util/hasIosKeyboard.ts
|
|
683
|
-
var hasIosKeyboard = () => {
|
|
684
|
-
return !!navigator.userAgent.match(/iP(ad|od|hone).+Safari/);
|
|
685
|
-
};
|
|
686
|
-
|
|
687
|
-
// src/components/DensityProvider/DensityProvider.tsx
|
|
688
|
-
import React3, { createContext as createContext2 } from "react";
|
|
689
|
-
var DensityContext = /* @__PURE__ */ createContext2({
|
|
690
|
-
density: "fine"
|
|
691
|
-
});
|
|
692
|
-
var DensityProvider = ({ density, children }) => /* @__PURE__ */ React3.createElement(DensityContext.Provider, {
|
|
693
|
-
value: {
|
|
694
|
-
density
|
|
695
|
-
}
|
|
696
|
-
}, children);
|
|
697
|
-
|
|
698
|
-
// src/components/ElevationProvider/ElevationProvider.tsx
|
|
699
|
-
import React4, { createContext as createContext3 } from "react";
|
|
700
|
-
var ElevationContext = /* @__PURE__ */ createContext3({
|
|
701
|
-
elevation: "base"
|
|
702
|
-
});
|
|
703
|
-
var ElevationProvider = ({ elevation, children }) => /* @__PURE__ */ React4.createElement(ElevationContext.Provider, {
|
|
704
|
-
value: {
|
|
705
|
-
elevation
|
|
706
|
-
}
|
|
707
|
-
}, children);
|
|
708
|
-
|
|
709
|
-
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
710
|
-
var ThemeContext = /* @__PURE__ */ createContext4(void 0);
|
|
711
|
-
var ThemeProvider = ({ children, fallback = null, resourceExtensions, appNs, tx = (_path, defaultClassName, _styleProps, ..._options) => defaultClassName, themeMode = "dark", rootDensity = "fine", ...rest }) => {
|
|
712
|
-
useEffect3(() => {
|
|
713
|
-
if (document.defaultView) {
|
|
714
|
-
const kb = createKeyborg(document.defaultView);
|
|
715
|
-
kb.subscribe(handleInputModalityChange);
|
|
716
|
-
return () => kb.unsubscribe(handleInputModalityChange);
|
|
717
|
-
}
|
|
718
|
-
}, []);
|
|
719
|
-
const safeAreaPadding = useSafeArea();
|
|
720
|
-
const contextValue = useMemo2(() => ({
|
|
721
|
-
tx,
|
|
722
|
-
themeMode,
|
|
723
|
-
hasIosKeyboard: hasIosKeyboard(),
|
|
724
|
-
safeAreaPadding,
|
|
725
|
-
...rest
|
|
726
|
-
}), [
|
|
727
|
-
tx,
|
|
728
|
-
themeMode,
|
|
729
|
-
safeAreaPadding,
|
|
730
|
-
rest
|
|
731
|
-
]);
|
|
732
|
-
return /* @__PURE__ */ React5.createElement(ThemeContext.Provider, {
|
|
733
|
-
value: contextValue
|
|
734
|
-
}, /* @__PURE__ */ React5.createElement(TranslationsProvider, {
|
|
735
|
-
fallback,
|
|
736
|
-
resourceExtensions,
|
|
737
|
-
appNs
|
|
738
|
-
}, /* @__PURE__ */ React5.createElement(ElevationProvider, {
|
|
739
|
-
elevation: "base"
|
|
740
|
-
}, /* @__PURE__ */ React5.createElement(DensityProvider, {
|
|
741
|
-
density: rootDensity
|
|
742
|
-
}, children))));
|
|
743
|
-
};
|
|
744
|
-
var handleInputModalityChange = (isUsingKeyboard) => {
|
|
745
|
-
if (isUsingKeyboard) {
|
|
746
|
-
document.body.setAttribute("data-is-keyboard", "true");
|
|
747
|
-
} else {
|
|
748
|
-
document.body.removeAttribute("data-is-keyboard");
|
|
749
|
-
}
|
|
750
|
-
};
|
|
751
|
-
|
|
752
752
|
// src/hooks/useElevationContext.ts
|
|
753
753
|
var useElevationContext = (propsElevation) => {
|
|
754
754
|
const { elevation } = useContext3(ElevationContext);
|
|
@@ -756,21 +756,21 @@ var useElevationContext = (propsElevation) => {
|
|
|
756
756
|
};
|
|
757
757
|
|
|
758
758
|
export {
|
|
759
|
+
DensityContext,
|
|
760
|
+
DensityProvider,
|
|
761
|
+
ElevationContext,
|
|
762
|
+
ElevationProvider,
|
|
759
763
|
useElevationContext,
|
|
760
764
|
useThemeContext,
|
|
761
765
|
initialSafeArea,
|
|
762
766
|
useSafeArea,
|
|
763
767
|
TranslationsContext,
|
|
764
768
|
useTranslation,
|
|
765
|
-
createTooltipScope,
|
|
766
|
-
useTooltipContext,
|
|
767
|
-
Tooltip,
|
|
768
769
|
hasIosKeyboard,
|
|
769
|
-
DensityContext,
|
|
770
|
-
DensityProvider,
|
|
771
|
-
ElevationContext,
|
|
772
|
-
ElevationProvider,
|
|
773
770
|
ThemeContext,
|
|
774
|
-
ThemeProvider
|
|
771
|
+
ThemeProvider,
|
|
772
|
+
createTooltipScope,
|
|
773
|
+
useTooltipContext,
|
|
774
|
+
Tooltip
|
|
775
775
|
};
|
|
776
|
-
//# sourceMappingURL=chunk-
|
|
776
|
+
//# sourceMappingURL=chunk-B7MXDDMJ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/DensityProvider/DensityProvider.tsx", "../../../src/components/ElevationProvider/ElevationProvider.tsx", "../../../src/hooks/useElevationContext.ts", "../../../src/components/ThemeProvider/ThemeProvider.tsx", "../../../src/hooks/useThemeContext.ts", "../../../src/hooks/useSafeArea.ts", "../../../src/components/ThemeProvider/TranslationsProvider.tsx", "../../../src/util/hasIosKeyboard.ts", "../../../src/components/Tooltip/Tooltip.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type PropsWithChildren, createContext } from 'react';\n\nimport { type Density } from '@dxos/ui-types';\n\nexport interface DensityContextValue {\n density?: Density;\n}\n\nexport type DensityProviderProps = PropsWithChildren<{\n density?: Density;\n}>;\n\nexport const DensityContext = createContext<DensityContextValue>({ density: 'fine' });\n\nexport const DensityProvider = ({ density, children }: DensityProviderProps) => (\n <DensityContext.Provider value={{ density }}>{children}</DensityContext.Provider>\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type PropsWithChildren, createContext } from 'react';\n\nimport { type Elevation } from '@dxos/ui-types';\n\nexport interface ElevationContextValue {\n elevation?: Elevation;\n}\n\nexport type ElevationProviderProps = PropsWithChildren<{\n elevation?: Elevation;\n}>;\n\nexport const ElevationContext = createContext<ElevationContextValue>({ elevation: 'base' });\n\nexport const ElevationProvider = ({ elevation, children }: ElevationProviderProps) => (\n <ElevationContext.Provider value={{ elevation }}>{children}</ElevationContext.Provider>\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useContext } from 'react';\n\nimport { type Elevation } from '@dxos/ui-types';\n\nimport { ElevationContext } from '../components';\n\nexport const useElevationContext = (propsElevation?: Elevation) => {\n const { elevation } = useContext(ElevationContext);\n return propsElevation ?? elevation;\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { createKeyborg } from 'keyborg';\nimport React, { type PropsWithChildren, createContext, useEffect, useMemo } from 'react';\n\nimport { type Density, type Elevation, type ThemeFunction, type ThemeMode } from '@dxos/ui-types';\n\nimport { type SafeAreaPadding, useSafeArea } from '../../hooks';\nimport { hasIosKeyboard } from '../../util';\nimport { DensityProvider } from '../DensityProvider';\nimport { ElevationProvider } from '../ElevationProvider';\n\nimport { TranslationsProvider, type TranslationsProviderProps } from './TranslationsProvider';\n\nexport type ThemeContextValue = {\n tx: ThemeFunction<any>;\n themeMode: ThemeMode;\n hasIosKeyboard: boolean;\n safeAreaPadding?: SafeAreaPadding;\n noCache?: boolean;\n platform?: 'mobile' | 'desktop';\n};\n\n/**\n * @internal\n */\nexport const ThemeContext = createContext<ThemeContextValue | undefined>(undefined);\n\nexport type ThemeProviderProps = Omit<TranslationsProviderProps, 'children'> &\n Partial<Omit<ThemeContextValue, 'safeAreaPadding'>> &\n PropsWithChildren<{\n rootDensity?: Density;\n rootElevation?: Elevation;\n }>;\n\nexport const ThemeProvider = ({\n children,\n fallback = null,\n resourceExtensions,\n appNs,\n tx = (_path, _styleProps, ..._options) => undefined,\n themeMode = 'dark',\n rootDensity = 'fine',\n ...rest\n}: ThemeProviderProps) => {\n useEffect(() => {\n if (document.defaultView) {\n const kb = createKeyborg(document.defaultView);\n kb.subscribe(handleInputModalityChange);\n return () => kb.unsubscribe(handleInputModalityChange);\n }\n }, []);\n\n const safeAreaPadding = useSafeArea();\n const contextValue = useMemo(\n () => ({ tx, themeMode, hasIosKeyboard: hasIosKeyboard(), safeAreaPadding, ...rest }),\n [tx, themeMode, safeAreaPadding, rest],\n );\n\n return (\n <ThemeContext.Provider value={contextValue}>\n <TranslationsProvider\n {...{\n fallback,\n resourceExtensions,\n appNs,\n }}\n >\n <ElevationProvider elevation='base'>\n <DensityProvider density={rootDensity}>{children}</DensityProvider>\n </ElevationProvider>\n </TranslationsProvider>\n </ThemeContext.Provider>\n );\n};\n\nconst handleInputModalityChange = (isUsingKeyboard: boolean) => {\n if (isUsingKeyboard) {\n document.body.setAttribute('data-w-keyboard', 'true');\n } else {\n document.body.removeAttribute('data-w-keyboard');\n }\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { ThemeContext } from '../components';\n\nexport const useThemeContext = () => useContext(ThemeContext) ?? raise(new Error('Missing ThemeContext'));\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useCallback, useState } from 'react';\n\nimport { useViewportResize } from '@dxos/react-hooks';\n\nexport type SafeAreaPadding = Record<'top' | 'right' | 'bottom' | 'left', number>;\n\nexport const initialSafeArea = { top: NaN, right: NaN, bottom: NaN, left: NaN };\n\nexport const useSafeArea = (): SafeAreaPadding => {\n const [padding, setPadding] = useState<SafeAreaPadding>(initialSafeArea);\n const handleResize = useCallback(() => {\n setPadding({\n top: parseFloat(getComputedStyle(document.documentElement).getPropertyValue('--safe-area-top')),\n right: parseFloat(getComputedStyle(document.documentElement).getPropertyValue('--safe-area-right')),\n bottom: parseFloat(getComputedStyle(document.documentElement).getPropertyValue('--safe-area-bottom')),\n left: parseFloat(getComputedStyle(document.documentElement).getPropertyValue('--safe-area-left')),\n });\n }, []);\n\n useViewportResize(handleResize);\n return padding;\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type Locale, enUS as dtLocaleEnUs } from 'date-fns/locale';\nimport i18Next, { type Resource } from 'i18next';\nimport React, { type ReactNode, Suspense, createContext, useContext, useEffect, useState } from 'react';\nimport { initReactI18next, useTranslation as useI18NextTranslation } from 'react-i18next';\n\nconst initialLng = 'en-US';\nconst initialNs = 'dxos-common';\nconst initialDtLocale = dtLocaleEnUs;\n\nexport const resources = {\n [initialLng]: {\n [initialNs]: {\n 'loading translations': 'Loading translations…',\n },\n },\n} as const satisfies Resource;\n\nvoid i18Next.use(initReactI18next).init({\n resources,\n lng: initialLng,\n defaultNS: initialNs,\n interpolation: {\n escapeValue: false,\n },\n});\n\nexport interface TranslationsProviderProps {\n children?: ReactNode;\n // TODO(wittjosiah): Rename to `placeholder` to match ClientProvider?\n // Placeholder => loading, fallback => error.\n fallback?: ReactNode;\n resourceExtensions?: Resource[];\n appNs?: string;\n dtLocale?: Locale;\n}\n\nexport const TranslationsContext = createContext({\n appNs: initialNs,\n dtLocale: initialDtLocale,\n});\n\nexport const useTranslation = (...args: Parameters<typeof useI18NextTranslation>) => {\n const result = useI18NextTranslation(...args);\n const { dtLocale } = useContext(TranslationsContext);\n return { ...result, dtLocale };\n};\n\nexport const TranslationsProvider = ({\n fallback,\n resourceExtensions,\n children,\n appNs,\n dtLocale,\n}: TranslationsProviderProps) => {\n const [loaded, setLoaded] = useState(false);\n useEffect(() => {\n setLoaded(false);\n if (resourceExtensions && resourceExtensions.length) {\n resourceExtensions.forEach((resource) => {\n Object.keys(resource).forEach((language) => {\n Object.keys(resource[language]).forEach((ns) => {\n i18Next.addResourceBundle(language, ns, resource[language][ns]);\n });\n });\n });\n }\n\n setLoaded(true);\n }, [resourceExtensions]);\n\n // TODO(thure): This is not ideal, but i18next was causing `Suspense` to not render the fallback even when the child was asking for namespaces yet to be added.\n // TODO(burdon): Fallbacks should only appear after a short delay, and if the displayed then be visible for 500mx to avoid startup flickering.\n return (\n <TranslationsContext.Provider value={{ appNs: appNs ?? initialNs, dtLocale: dtLocale ?? initialDtLocale }}>\n <Suspense fallback={fallback}>{loaded ? children : fallback}</Suspense>\n </TranslationsContext.Provider>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nexport const hasIosKeyboard = () => {\n // TODO(thure): UA sniffing is never good, however I haven’t found a better way to query for whether the on-screen keyboard will appear on `focus` outside of a click handler.\n return !!navigator.userAgent.match(/iP(ad|od|hone).+Safari/);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// This is based upon `@radix-ui/react-tooltip` fetched 17 March 2025 at https://github.com/radix-ui/primitives at commit 6e75e11.\n// TODO(burdon): Replace with https://ui.shadcn.com/docs/components/radix/tooltip\n\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport type { Scope } from '@radix-ui/react-context';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { useId } from '@radix-ui/react-id';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { type PopperAnchorProps, createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slottable } from '@radix-ui/react-slot';\nimport { type TooltipProps } from '@radix-ui/react-tooltip';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport * as VisuallyHiddenPrimitive from '@radix-ui/react-visually-hidden';\nimport React, {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n type FC,\n type ReactNode,\n type RefObject,\n type SyntheticEvent,\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { useElevationContext, useThemeContext } from '../../hooks';\n\ntype TooltipScopedProps<P = {}> = P & { __scopeTooltip?: Scope };\nconst [createTooltipContext, createTooltipScope] = createContextScope('Tooltip', [createPopperScope]);\nconst usePopperScope = createPopperScope();\n\n//\n// Tooltip\n//\n\nconst DEFAULT_DELAY_DURATION = 700;\nconst TOOLTIP_OPEN = 'tooltip.open';\nconst TOOLTIP_NAME = 'Tooltip';\n\ntype TooltipContextValue = {\n contentId: string;\n open: boolean;\n stateAttribute: 'closed' | 'delayed-open' | 'instant-open';\n trigger: TooltipTriggerElement | null;\n onTriggerChange(trigger: TooltipTriggerElement | null): void;\n onTriggerEnter(): void;\n onTriggerLeave(): void;\n onOpen(): void;\n onClose(): void;\n onPointerInTransitChange(inTransit: boolean): void;\n isPointerInTransitRef: RefObject<boolean>;\n disableHoverableContent: boolean;\n};\n\nconst [TooltipContextProvider, useTooltipContext] = createTooltipContext<TooltipContextValue>(TOOLTIP_NAME);\n\ntype TooltipProviderProps = {\n children?: ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /**\n * The duration from when the pointer enters the trigger until the tooltip gets opened. This will\n * override the prop with the same name passed to Provider.\n * @defaultValue 700\n */\n delayDuration?: number;\n /**\n * When `true`, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger.\n * @defaultValue false\n */\n disableHoverableContent?: boolean;\n /**\n * How much time a user has to enter another trigger without incurring a delay again.\n * @defaultValue 300\n */\n skipDelayDuration?: number;\n};\n\nconst TooltipProvider: FC<TooltipProviderProps> = (props: TooltipScopedProps<TooltipProviderProps>) => {\n const {\n __scopeTooltip,\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n disableHoverableContent = false,\n delayDuration = DEFAULT_DELAY_DURATION,\n skipDelayDuration = 300,\n } = props;\n const isOpenDelayedRef = useRef(true);\n const isPointerInTransitRef = useRef(false);\n const skipDelayTimerRef = useRef(0);\n\n useEffect(() => {\n const skipDelayTimer = skipDelayTimerRef.current;\n return () => window.clearTimeout(skipDelayTimer);\n }, []);\n\n const popperScope = usePopperScope(__scopeTooltip);\n const [trigger, setTrigger] = useState<HTMLButtonElement | null>(null);\n const [content, setContent] = useState<string>('');\n const [side, setSide] = useState<TooltipSide | undefined>(undefined);\n const triggerRef = useRef<HTMLButtonElement | null>(trigger);\n const handleTriggerChange = useCallback((nextTrigger: HTMLButtonElement | null) => {\n setTrigger(nextTrigger);\n triggerRef.current = nextTrigger;\n setContent(nextTrigger?.getAttribute('data-tooltip-content') ?? '');\n setSide((nextTrigger?.getAttribute('data-tooltip-side') as TooltipSide | null) ?? undefined);\n }, []);\n const contentId = useId();\n const openTimerRef = useRef(0);\n const wasOpenDelayedRef = useRef(false);\n const handleOpenChange = useCallback(\n (open: boolean) => {\n if (open) {\n window.clearTimeout(skipDelayTimerRef.current);\n isOpenDelayedRef.current = false;\n // as `onChange` is called within a lifecycle method we\n // avoid dispatching via `dispatchDiscreteCustomEvent`.\n document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN));\n } else {\n window.clearTimeout(skipDelayTimerRef.current);\n skipDelayTimerRef.current = window.setTimeout(() => (isOpenDelayedRef.current = true), skipDelayDuration);\n }\n onOpenChange?.(open);\n },\n [skipDelayDuration, onOpenChange],\n );\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: handleOpenChange,\n });\n const stateAttribute = useMemo(() => {\n return open ? (wasOpenDelayedRef.current ? 'delayed-open' : 'instant-open') : 'closed';\n }, [open]);\n\n const handleOpen = useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = 0;\n wasOpenDelayedRef.current = false;\n setOpen(true);\n }, [setOpen]);\n\n const handleClose = useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = 0;\n setOpen(false);\n }, [setOpen]);\n\n const handleDelayedOpen = useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = window.setTimeout(() => {\n wasOpenDelayedRef.current = true;\n setOpen(true);\n openTimerRef.current = 0;\n }, delayDuration);\n }, [delayDuration, setOpen]);\n\n useEffect(() => {\n return () => {\n if (openTimerRef.current) {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = 0;\n }\n };\n }, []);\n\n const { tx } = useThemeContext();\n const elevation = useElevationContext();\n\n return (\n <PopperPrimitive.Root {...popperScope}>\n <TooltipContextProvider\n scope={__scopeTooltip}\n contentId={contentId}\n open={open}\n stateAttribute={stateAttribute}\n trigger={trigger}\n onTriggerChange={handleTriggerChange}\n onTriggerEnter={useCallback(() => {\n if (isOpenDelayedRef.current) {\n handleDelayedOpen();\n } else {\n handleOpen();\n }\n }, [isOpenDelayedRef, handleDelayedOpen, handleOpen])}\n onTriggerLeave={useCallback(() => {\n if (disableHoverableContent) {\n handleClose();\n } else {\n // Clear the timer in case the pointer leaves the trigger before the tooltip is opened.\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = 0;\n }\n }, [handleClose, disableHoverableContent])}\n onOpen={handleOpen}\n onClose={handleClose}\n disableHoverableContent={disableHoverableContent}\n isPointerInTransitRef={isPointerInTransitRef}\n onPointerInTransitChange={useCallback((inTransit: boolean) => {\n isPointerInTransitRef.current = inTransit;\n }, [])}\n >\n <TooltipContent side={side} className={tx('tooltip.content', { elevation })}>\n {content}\n <TooltipArrow className={tx('tooltip.arrow')} />\n </TooltipContent>\n <TooltipVirtualTrigger virtualRef={triggerRef as RefObject<HTMLButtonElement>} />\n {children}\n </TooltipContextProvider>\n </PopperPrimitive.Root>\n );\n};\n\nTooltipProvider.displayName = TOOLTIP_NAME;\n\n//\n// TooltipVirtualTrigger\n//\n\nconst TooltipVirtualTrigger = ({\n virtualRef,\n __scopeTooltip,\n}: TooltipScopedProps<Pick<PopperAnchorProps, 'virtualRef'>>) => {\n const popperScope = usePopperScope(__scopeTooltip);\n return <PopperPrimitive.Anchor asChild {...popperScope} virtualRef={virtualRef} />;\n};\n\n//\n// TooltipTrigger\n//\n\nconst TRIGGER_NAME = 'TooltipTrigger';\n\ntype TooltipTriggerElement = ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = ComponentPropsWithoutRef<typeof Primitive.button>;\ntype TooltipTriggerProps = PrimitiveButtonProps &\n Pick<TooltipProps, 'delayDuration'> & {\n content?: string;\n side?: TooltipSide;\n onInteract?: (event: SyntheticEvent) => void;\n };\n\nconst TooltipTrigger = forwardRef<TooltipTriggerElement, TooltipTriggerProps>(\n (props: TooltipScopedProps<TooltipTriggerProps>, forwardedRef) => {\n const {\n __scopeTooltip,\n onInteract,\n // TODO(thure): Pass `delayDuration` into the context.\n delayDuration: _delayDuration,\n side,\n content,\n ...triggerProps\n } = props;\n const context = useTooltipContext(TRIGGER_NAME, __scopeTooltip);\n const ref = useRef<TooltipTriggerElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const isPointerDownRef = useRef(false);\n const hasPointerMoveOpenedRef = useRef(false);\n const handlePointerUp = useCallback(() => (isPointerDownRef.current = false), []);\n\n useEffect(() => {\n return () => document.removeEventListener('pointerup', handlePointerUp);\n }, [handlePointerUp]);\n\n return (\n <Primitive.button\n // We purposefully avoid adding `type=button` here because tooltip triggers are also\n // commonly anchors and the anchor `type` attribute signifies MIME type.\n aria-describedby={context.open ? context.contentId : undefined}\n data-state={context.stateAttribute}\n data-tooltip-content={content}\n data-tooltip-side={side}\n {...triggerProps}\n ref={composedRefs}\n onPointerMove={composeEventHandlers(props.onPointerMove, (event) => {\n if (event.pointerType === 'touch') {\n return;\n }\n if (!hasPointerMoveOpenedRef.current && !context.isPointerInTransitRef.current) {\n onInteract?.(event);\n if (event.defaultPrevented) {\n return;\n }\n context.onTriggerChange(ref.current);\n context.onTriggerEnter();\n hasPointerMoveOpenedRef.current = true;\n }\n })}\n onPointerLeave={composeEventHandlers(props.onPointerLeave, () => {\n context.onTriggerLeave();\n hasPointerMoveOpenedRef.current = false;\n })}\n onPointerDown={composeEventHandlers(props.onPointerDown, () => {\n if (context.open) {\n context.onClose();\n }\n isPointerDownRef.current = true;\n document.addEventListener('pointerup', handlePointerUp, { once: true });\n })}\n onFocus={props.onFocus}\n onBlur={composeEventHandlers(props.onBlur, context.onClose)}\n onClick={composeEventHandlers(props.onClick, context.onClose)}\n />\n );\n },\n);\n\nTooltipTrigger.displayName = TRIGGER_NAME;\n\n//\n// TooltipPortal\n//\n\nconst PORTAL_NAME = 'TooltipPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createTooltipContext<PortalContextValue>(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = ComponentPropsWithoutRef<typeof PortalPrimitive>;\ntype TooltipPortalProps = {\n children?: ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n};\n\nconst TooltipPortal: FC<TooltipPortalProps> = (props: TooltipScopedProps<TooltipPortalProps>) => {\n const { __scopeTooltip, forceMount, children, container } = props;\n const context = useTooltipContext(PORTAL_NAME, __scopeTooltip);\n return (\n <PortalProvider scope={__scopeTooltip} forceMount={forceMount}>\n <Presence present={forceMount || context.open}>\n <PortalPrimitive asChild container={container}>\n {children}\n </PortalPrimitive>\n </Presence>\n </PortalProvider>\n );\n};\n\nTooltipPortal.displayName = PORTAL_NAME;\n\n//\n// TooltipContent\n//\n\nconst CONTENT_NAME = 'TooltipContent';\n\ntype TooltipContentElement = TooltipContentImplElement;\ntype TooltipContentProps = TooltipContentImplProps & {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n};\n\nconst TooltipContent = forwardRef<TooltipContentElement, TooltipContentProps>(\n (props: TooltipScopedProps<TooltipContentProps>, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeTooltip);\n const { forceMount = portalContext.forceMount, side = 'top', ...contentProps } = props;\n const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);\n\n return (\n <Presence present={forceMount || context.open}>\n {context.disableHoverableContent ? (\n <TooltipContentImpl side={side} {...contentProps} ref={forwardedRef} />\n ) : (\n <TooltipContentHoverable side={side} {...contentProps} ref={forwardedRef} />\n )}\n </Presence>\n );\n },\n);\n\ntype Point = { x: number; y: number };\ntype Polygon = Point[];\n\ntype TooltipContentHoverableElement = TooltipContentImplElement;\ntype TooltipContentHoverableProps = TooltipContentImplProps;\n\nconst TooltipContentHoverable = forwardRef<TooltipContentHoverableElement, TooltipContentHoverableProps>(\n (props: TooltipScopedProps<TooltipContentHoverableProps>, forwardedRef) => {\n const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);\n const ref = useRef<TooltipContentHoverableElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [pointerGraceArea, setPointerGraceArea] = useState<Polygon | null>(null);\n\n const { trigger, onClose } = context;\n const content = ref.current;\n\n const { onPointerInTransitChange } = context;\n\n const handleRemoveGraceArea = useCallback(() => {\n setPointerGraceArea(null);\n onPointerInTransitChange(false);\n }, [onPointerInTransitChange]);\n\n const handleCreateGraceArea = useCallback(\n (event: PointerEvent, hoverTarget: HTMLElement) => {\n const currentTarget = event.currentTarget as HTMLElement;\n const exitPoint = { x: event.clientX, y: event.clientY };\n const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());\n const paddedExitPoints = getPaddedExitPoints(exitPoint, exitSide);\n const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect());\n const graceArea = getHull([...paddedExitPoints, ...hoverTargetPoints]);\n setPointerGraceArea(graceArea);\n onPointerInTransitChange(true);\n },\n [onPointerInTransitChange],\n );\n\n useEffect(() => {\n return () => handleRemoveGraceArea();\n }, [handleRemoveGraceArea]);\n\n useEffect(() => {\n if (trigger && content) {\n const handleTriggerLeave = (event: PointerEvent) => handleCreateGraceArea(event, content);\n const handleContentLeave = (event: PointerEvent) => handleCreateGraceArea(event, trigger);\n\n trigger.addEventListener('pointerleave', handleTriggerLeave);\n content.addEventListener('pointerleave', handleContentLeave);\n return () => {\n trigger.removeEventListener('pointerleave', handleTriggerLeave);\n content.removeEventListener('pointerleave', handleContentLeave);\n };\n }\n }, [trigger, content, handleCreateGraceArea, handleRemoveGraceArea]);\n\n useEffect(() => {\n if (pointerGraceArea) {\n const handleTrackPointerGrace = (event: PointerEvent) => {\n const target = event.target as HTMLElement;\n const pointerPosition = { x: event.clientX, y: event.clientY };\n const hasEnteredTarget = trigger?.contains(target) || content?.contains(target);\n const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, pointerGraceArea);\n\n if (hasEnteredTarget) {\n handleRemoveGraceArea();\n } else if (isPointerOutsideGraceArea) {\n handleRemoveGraceArea();\n onClose();\n }\n };\n document.addEventListener('pointermove', handleTrackPointerGrace);\n return () => document.removeEventListener('pointermove', handleTrackPointerGrace);\n }\n }, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]);\n\n return <TooltipContentImpl {...props} ref={composedRefs} />;\n },\n);\n\nconst [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, {\n isInside: false,\n});\n\ntype TooltipContentImplElement = ComponentRef<typeof PopperPrimitive.Content>;\ntype DismissableLayerProps = ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype PopperContentProps = ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;\ntype TooltipContentImplProps = Omit<PopperContentProps, 'onPlaced'> & {\n /**\n * A more descriptive label for accessibility purpose\n */\n 'aria-label'?: string;\n\n /**\n * Event handler called when the escape key is down.\n * Can be prevented.\n */\n onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];\n /**\n * Event handler called when the a `pointerdown` event happens outside of the `Tooltip`.\n * Can be prevented.\n */\n onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];\n};\n\nconst TooltipContentImpl = forwardRef<TooltipContentImplElement, TooltipContentImplProps>(\n (props: TooltipScopedProps<TooltipContentImplProps>, forwardedRef) => {\n const {\n __scopeTooltip,\n children,\n 'aria-label': ariaLabel,\n onEscapeKeyDown,\n onPointerDownOutside,\n ...contentProps\n } = props;\n const context = useTooltipContext(CONTENT_NAME, __scopeTooltip);\n const popperScope = usePopperScope(__scopeTooltip);\n const { onClose } = context;\n\n // Close this tooltip if another one opens\n useEffect(() => {\n document.addEventListener(TOOLTIP_OPEN, onClose);\n return () => document.removeEventListener(TOOLTIP_OPEN, onClose);\n }, [onClose]);\n\n // Close the tooltip if the trigger is scrolled\n useEffect(() => {\n if (context.trigger) {\n const handleScroll = (event: Event) => {\n const target = event.target as HTMLElement;\n if (target?.contains(context.trigger)) {\n onClose();\n }\n };\n window.addEventListener('scroll', handleScroll, { capture: true });\n return () => window.removeEventListener('scroll', handleScroll, { capture: true });\n }\n }, [context.trigger, onClose]);\n\n return (\n <DismissableLayer\n asChild\n disableOutsidePointerEvents={false}\n onEscapeKeyDown={onEscapeKeyDown}\n onPointerDownOutside={onPointerDownOutside}\n onFocusOutside={(event) => event.preventDefault()}\n onDismiss={onClose}\n >\n <PopperPrimitive.Content\n data-state={context.stateAttribute}\n {...popperScope}\n {...contentProps}\n ref={forwardedRef}\n style={{\n ...contentProps.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-tooltip-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-tooltip-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-tooltip-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-tooltip-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-tooltip-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n >\n <Slottable>{children}</Slottable>\n <VisuallyHiddenContentContextProvider scope={__scopeTooltip} isInside={true}>\n <VisuallyHiddenPrimitive.Root id={context.contentId} role='tooltip'>\n {ariaLabel || children}\n </VisuallyHiddenPrimitive.Root>\n </VisuallyHiddenContentContextProvider>\n </PopperPrimitive.Content>\n </DismissableLayer>\n );\n },\n);\n\nTooltipContent.displayName = CONTENT_NAME;\n\n//\n// TooltipArrow\n//\n\nconst ARROW_NAME = 'TooltipArrow';\n\ntype TooltipArrowElement = ComponentRef<typeof PopperPrimitive.Arrow>;\ntype PopperArrowProps = ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;\ntype TooltipArrowProps = PopperArrowProps;\n\nconst TooltipArrow = forwardRef<TooltipArrowElement, TooltipArrowProps>(\n (props: TooltipScopedProps<TooltipArrowProps>, forwardedRef) => {\n const { __scopeTooltip, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeTooltip);\n const visuallyHiddenContentContext = useVisuallyHiddenContentContext(ARROW_NAME, __scopeTooltip);\n // if the arrow is inside the `VisuallyHidden`, we don't want to render it all to\n // prevent issues in positioning the arrow due to the duplicate\n return visuallyHiddenContentContext.isInside ? null : (\n <PopperPrimitive.Arrow {...popperScope} {...arrowProps} ref={forwardedRef} />\n );\n },\n);\n\nTooltipArrow.displayName = ARROW_NAME;\n\ntype TooltipSide = NonNullable<TooltipContentProps['side']>;\n\nconst getExitSideFromRect = (point: Point, rect: DOMRect): TooltipSide => {\n const top = Math.abs(rect.top - point.y);\n const bottom = Math.abs(rect.bottom - point.y);\n const right = Math.abs(rect.right - point.x);\n const left = Math.abs(rect.left - point.x);\n\n switch (Math.min(top, bottom, right, left)) {\n case left:\n return 'left';\n case right:\n return 'right';\n case top:\n return 'top';\n case bottom:\n return 'bottom';\n default:\n throw new Error('unreachable');\n }\n};\n\nconst getPaddedExitPoints = (exitPoint: Point, exitSide: TooltipSide, padding = 5) => {\n const paddedExitPoints: Point[] = [];\n switch (exitSide) {\n case 'top':\n paddedExitPoints.push(\n { x: exitPoint.x - padding, y: exitPoint.y + padding },\n { x: exitPoint.x + padding, y: exitPoint.y + padding },\n );\n break;\n case 'bottom':\n paddedExitPoints.push(\n { x: exitPoint.x - padding, y: exitPoint.y - padding },\n { x: exitPoint.x + padding, y: exitPoint.y - padding },\n );\n break;\n case 'left':\n paddedExitPoints.push(\n { x: exitPoint.x + padding, y: exitPoint.y - padding },\n { x: exitPoint.x + padding, y: exitPoint.y + padding },\n );\n break;\n case 'right':\n paddedExitPoints.push(\n { x: exitPoint.x - padding, y: exitPoint.y - padding },\n { x: exitPoint.x - padding, y: exitPoint.y + padding },\n );\n break;\n }\n return paddedExitPoints;\n};\n\nconst getPointsFromRect = (rect: DOMRect) => {\n const { top, right, bottom, left } = rect;\n return [\n { x: left, y: top },\n { x: right, y: top },\n { x: right, y: bottom },\n { x: left, y: bottom },\n ];\n};\n\n// Determine if a point is inside of a polygon.\n// Based on https://github.com/substack/point-in-polygon\nconst isPointInPolygon = (point: Point, polygon: Polygon) => {\n const { x, y } = point;\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const xi = polygon[i].x;\n const yi = polygon[i].y;\n const xj = polygon[j].x;\n const yj = polygon[j].y;\n\n // prettier-ignore\n const intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);\n if (intersect) {\n inside = !inside;\n }\n }\n\n return inside;\n};\n\n// Returns a new array of points representing the convex hull of the given set of points.\n// https://www.nayuki.io/page/convex-hull-algorithm\nconst getHull = <P extends Point>(points: Readonly<Array<P>>): Array<P> => {\n const newPoints: Array<P> = points.slice();\n newPoints.sort((a: Point, b: Point) => {\n if (a.x < b.x) {\n return -1;\n } else if (a.x > b.x) {\n return +1;\n } else if (a.y < b.y) {\n return -1;\n } else if (a.y > b.y) {\n return +1;\n } else {\n return 0;\n }\n });\n return getHullPresorted(newPoints);\n};\n\n// Returns the convex hull, assuming that each points[i] <= points[i + 1]. Runs in O(n) time.\nconst getHullPresorted = <P extends Point>(points: Readonly<Array<P>>): Array<P> => {\n if (points.length <= 1) {\n return points.slice();\n }\n\n const upperHull: Array<P> = [];\n for (let i = 0; i < points.length; i++) {\n const p = points[i];\n while (upperHull.length >= 2) {\n const q = upperHull[upperHull.length - 1];\n const r = upperHull[upperHull.length - 2];\n if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) {\n upperHull.pop();\n } else {\n break;\n }\n }\n upperHull.push(p);\n }\n upperHull.pop();\n\n const lowerHull: Array<P> = [];\n for (let i = points.length - 1; i >= 0; i--) {\n const p = points[i];\n while (lowerHull.length >= 2) {\n const q = lowerHull[lowerHull.length - 1];\n const r = lowerHull[lowerHull.length - 2];\n if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) {\n lowerHull.pop();\n } else {\n break;\n }\n }\n lowerHull.push(p);\n }\n lowerHull.pop();\n\n if (\n upperHull.length === 1 &&\n lowerHull.length === 1 &&\n upperHull[0].x === lowerHull[0].x &&\n upperHull[0].y === lowerHull[0].y\n ) {\n return upperHull;\n } else {\n return upperHull.concat(lowerHull);\n }\n};\n\n//\n// Tooltip\n//\n\nexport const Tooltip = {\n Provider: TooltipProvider,\n Trigger: TooltipTrigger,\n};\n\nexport { createTooltipScope, useTooltipContext };\n\nexport type { TooltipProviderProps, TooltipTriggerProps, TooltipScopedProps, TooltipSide };\n"],
|
|
5
|
+
"mappings": ";;;AAIA,OAAOA,SAAiCC,qBAAqB;AAYtD,IAAMC,iBAAiBC,8BAAmC;EAAEC,SAAS;AAAO,CAAA;AAE5E,IAAMC,kBAAkB,CAAC,EAAED,SAASE,SAAQ,MACjD,sBAAA,cAACJ,eAAeK,UAAQ;EAACC,OAAO;IAAEJ;EAAQ;GAAIE,QAAAA;;;ACfhD,OAAOG,UAAiCC,iBAAAA,sBAAqB;AAYtD,IAAMC,mBAAmBC,gBAAAA,eAAqC;EAAEC,WAAW;AAAO,CAAA;AAElF,IAAMC,oBAAoB,CAAC,EAAED,WAAWE,SAAQ,MACrD,gBAAAC,OAAA,cAACL,iBAAiBM,UAAQ;EAACC,OAAO;IAAEL;EAAU;GAAIE,QAAAA;;;ACfpD,SAASI,cAAAA,mBAAkB;;;ACA3B,SAASC,qBAAqB;AAC9B,OAAOC,UAAiCC,iBAAAA,gBAAeC,aAAAA,YAAWC,eAAe;;;ACDjF,SAASC,kBAAkB;AAE3B,SAASC,aAAa;AAIf,IAAMC,kBAAkB,MAAMC,WAAWC,YAAAA,KAAiBC,MAAM,IAAIC,MAAM,sBAAA,CAAA;;;ACNjF,SAASC,aAAaC,gBAAgB;AAEtC,SAASC,yBAAyB;AAI3B,IAAMC,kBAAkB;EAAEC,KAAKC;EAAKC,OAAOD;EAAKE,QAAQF;EAAKG,MAAMH;AAAI;AAEvE,IAAMI,cAAc,MAAA;AACzB,QAAM,CAACC,SAASC,UAAAA,IAAcC,S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1E,MAAMwE,EAAE1E,IAAI4E,EAAE5E,IAAI;AAC1D8E,kBAAUD,IAAG;MACf,OAAO;AACL;MACF;IACF;AACAC,cAAUvB,KAAKmB,CAAAA;EACjB;AACAI,YAAUD,IAAG;AAEb,MACEJ,UAAUb,WAAW,KACrBkB,UAAUlB,WAAW,KACrBa,UAAU,CAAA,EAAGzE,MAAM8E,UAAU,CAAA,EAAG9E,KAChCyE,UAAU,CAAA,EAAGvE,MAAM4E,UAAU,CAAA,EAAG5E,GAChC;AACA,WAAOuE;EACT,OAAO;AACL,WAAOA,UAAUM,OAAOD,SAAAA;EAC1B;AACF;AAMO,IAAME,UAAU;EACrBC,UAAUlN;EACVmN,SAASvI;AACX;;;ANhvBO,IAAMwI,sBAAsB,CAACC,mBAAAA;AAClC,QAAM,EAAEC,UAAS,IAAKC,YAAWC,gBAAAA;AACjC,SAAOH,kBAAkBC;AAC3B;",
|
|
6
|
+
"names": ["React", "createContext", "DensityContext", "createContext", "density", "DensityProvider", "children", "Provider", "value", "React", "createContext", "ElevationContext", "createContext", "elevation", "ElevationProvider", "children", "React", "Provider", "value", "useContext", "createKeyborg", "React", "createContext", "useEffect", "useMemo", "useContext", "raise", "useThemeContext", "useContext", "ThemeContext", "raise", "Error", "useCallback", "useState", "useViewportResize", "initialSafeArea", "top", "NaN", "right", "bottom", "left", "useSafeArea", "padding", "setPadding", "useState", "handleResize", "useCallback", "parseFloat", "getComputedStyle", "document", "documentElement", "getPropertyValue", "useViewportResize", "enUS", "dtLocaleEnUs", "i18Next", "React", "Suspense", "createContext", "useContext", "useEffect", "useState", "initReactI18next", "useTranslation", "useI18NextTranslation", "initialLng", "initialNs", "initialDtLocale", "dtLocaleEnUs", "resources", "i18Next", "use", "initReactI18next", "init", "lng", "defaultNS", "interpolation", "escapeValue", "TranslationsContext", "createContext", "appNs", "dtLocale", "useTranslation", "args", "result", "useI18NextTranslation", "useContext", "TranslationsProvider", "fallback", "resourceExtensions", "children", "loaded", "setLoaded", "useState", "useEffect", "length", "forEach", "resource", "Object", "keys", "language", "ns", "addResourceBundle", "React", "Provider", "value", "Suspense", "hasIosKeyboard", "navigator", "userAgent", "match", "ThemeContext", "createContext", "undefined", "ThemeProvider", "children", "fallback", "resourceExtensions", "appNs", "tx", "_path", "_styleProps", "_options", "themeMode", "rootDensity", "rest", "useEffect", "document", "defaultView", "kb", "createKeyborg", "subscribe", "handleInputModalityChange", "unsubscribe", "safeAreaPadding", "useSafeArea", "contextValue", "useMemo", "hasIosKeyboard", "React", "Provider", "value", "TranslationsProvider", "ElevationProvider", "elevation", "DensityProvider", "density", "isUsingKeyboard", "body", "setAttribute", "removeAttribute", "composeEventHandlers", "useComposedRefs", "createContextScope", "DismissableLayer", "useId", "PopperPrimitive", "createPopperScope", "Portal", "PortalPrimitive", "Presence", "Primitive", "Slottable", "useControllableState", "VisuallyHiddenPrimitive", "React", "forwardRef", "useCallback", "useEffect", "useMemo", "useRef", "useState", "createTooltipContext", "createTooltipScope", "createContextScope", "createPopperScope", "usePopperScope", "DEFAULT_DELAY_DURATION", "TOOLTIP_OPEN", "TOOLTIP_NAME", "TooltipContextProvider", "useTooltipContext", "TooltipProvider", "props", "__scopeTooltip", "children", "open", "openProp", "defaultOpen", "onOpenChange", "disableHoverableContent", "delayDuration", "skipDelayDuration", "isOpenDelayedRef", "useRef", "isPointerInTransitRef", "skipDelayTimerRef", "useEffect", "skipDelayTimer", "current", "window", "clearTimeout", "popperScope", "trigger", "setTrigger", "useState", "content", "setContent", "side", "setSide", "undefined", "triggerRef", "handleTriggerChange", "useCallback", "nextTrigger", "getAttribute", "contentId", "useId", "openTimerRef", "wasOpenDelayedRef", "handleOpenChange", "document", "dispatchEvent", "CustomEvent", "setTimeout", "setOpen", "useControllableState", "prop", "defaultProp", "onChange", "stateAttribute", "useMemo", "handleOpen", "handleClose", "handleDelayedOpen", "tx", "useThemeContext", "elevation", "useElevationContext", "React", "Root", "scope", "onTriggerChange", "onTriggerEnter", "onTriggerLeave", "onOpen", "onClose", "onPointerInTransitChange", "inTransit", "TooltipContent", "className", "TooltipArrow", "TooltipVirtualTrigger", "virtualRef", "displayName", "Anchor", "asChild", "TRIGGER_NAME", "TooltipTrigger", "forwardRef", "forwardedRef", "onInteract", "_delayDuration", "triggerProps", "context", "ref", "composedRefs", "useComposedRefs", "isPointerDownRef", "hasPointerMoveOpenedRef", "handlePointerUp", "removeEventListener", "Primitive", "button", "aria-describedby", "data-state", "data-tooltip-content", "data-tooltip-side", "onPointerMove", "composeEventHandlers", "event", "pointerType", "defaultPrevented", "onPointerLeave", "onPointerDown", "addEventListener", "once", "onFocus", "onBlur", "onClick", "PORTAL_NAME", "PortalProvider", "usePortalContext", "forceMount", "TooltipPortal", "container", "Presence", "present", "PortalPrimitive", "CONTENT_NAME", "portalContext", "contentProps", "TooltipContentImpl", "TooltipContentHoverable", "pointerGraceArea", "setPointerGraceArea", "handleRemoveGraceArea", "handleCreateGraceArea", "hoverTarget", "currentTarget", "exitPoint", "x", "clientX", "y", "clientY", "exitSide", "getExitSideFromRect", "getBoundingClientRect", "paddedExitPoints", "getPaddedExitPoints", "hoverTargetPoints", "getPointsFromRect", "graceArea", "getHull", "handleTriggerLeave", "handleContentLeave", "handleTrackPointerGrace", "target", "pointerPosition", "hasEnteredTarget", "contains", "isPointerOutsideGraceArea", "isPointInPolygon", "VisuallyHiddenContentContextProvider", "useVisuallyHiddenContentContext", "isInside", "ariaLabel", "onEscapeKeyDown", "onPointerDownOutside", "handleScroll", "capture", "DismissableLayer", "disableOutsidePointerEvents", "onFocusOutside", "preventDefault", "onDismiss", "Content", "style", "Slottable", "id", "role", "ARROW_NAME", "arrowProps", "visuallyHiddenContentContext", "Arrow", "point", "rect", "top", "Math", "abs", "bottom", "right", "left", "min", "Error", "padding", "push", "polygon", "inside", "i", "j", "length", "xi", "yi", "xj", "yj", "intersect", "points", "newPoints", "slice", "sort", "a", "b", "getHullPresorted", "upperHull", "p", "q", "r", "pop", "lowerHull", "concat", "Tooltip", "Provider", "Trigger", "useElevationContext", "propsElevation", "elevation", "useContext", "ElevationContext"]
|
|
7
|
+
}
|