@dxos/react-ui 0.8.4-main.406dc2a → 0.8.4-main.59c2e9b
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 +774 -0
- package/dist/lib/browser/chunk-CEKVHJ27.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3067 -64
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +34 -46
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/chunk-2NHEX4AD.mjs +776 -0
- package/dist/lib/node-esm/chunk-2NHEX4AD.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +3067 -64
- 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 +34 -46
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/types/src/components/{Buttons → Button}/Button.d.ts +1 -1
- package/dist/types/src/components/Button/Button.d.ts.map +1 -0
- package/dist/types/src/components/Button/Button.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Buttons → Button}/IconButton.d.ts +2 -2
- package/dist/types/src/components/Button/IconButton.d.ts.map +1 -0
- package/dist/types/src/components/Button/IconButton.stories.d.ts.map +1 -0
- package/dist/types/src/components/Button/Toggle.d.ts.map +1 -0
- package/dist/types/src/components/Button/Toggle.stories.d.ts +16 -0
- package/dist/types/src/components/Button/Toggle.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Buttons → Button}/ToggleGroup.d.ts +4 -4
- package/dist/types/src/components/Button/ToggleGroup.d.ts.map +1 -0
- package/dist/types/src/components/{Buttons → Button}/ToggleGroup.stories.d.ts +4 -4
- package/dist/types/src/components/Button/ToggleGroup.stories.d.ts.map +1 -0
- package/dist/types/src/components/Button/index.d.ts.map +1 -0
- package/dist/types/src/components/Clipboard/CopyButton.d.ts +1 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -1
- package/dist/types/src/components/DensityProvider/DensityProvider.d.ts +1 -1
- package/dist/types/src/components/DensityProvider/DensityProvider.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/AlertDialog.d.ts.map +1 -0
- package/dist/types/src/components/Dialog/AlertDialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/Dialog/Dialog.d.ts +40 -0
- package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/types/src/components/{Dialogs → Dialog}/Dialog.stories.d.ts +7 -5
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/Dialog/index.d.ts.map +1 -0
- package/dist/types/src/components/ElevationProvider/ElevationProvider.d.ts +1 -1
- package/dist/types/src/components/ElevationProvider/ElevationProvider.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.d.ts +1 -1
- package/dist/types/src/components/Icon/Icon.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.stories.d.ts +17 -0
- package/dist/types/src/components/Icon/Icon.stories.d.ts.map +1 -0
- package/dist/types/src/components/Input/Input.d.ts +5 -2
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/types/src/components/{Lists → List}/List.d.ts +1 -1
- package/dist/types/src/components/List/List.d.ts.map +1 -0
- package/dist/types/src/components/List/List.stories.d.ts.map +1 -0
- package/dist/types/src/components/List/ListDropIndicator.d.ts.map +1 -0
- package/dist/types/src/components/List/Tree.d.ts.map +1 -0
- package/dist/types/src/components/List/Tree.stories.d.ts.map +1 -0
- package/dist/types/src/components/List/TreeDropIndicator.d.ts.map +1 -0
- package/dist/types/src/components/List/Treegrid.d.ts.map +1 -0
- package/dist/types/src/components/List/Treegrid.stories.d.ts.map +1 -0
- package/dist/types/src/components/List/index.d.ts.map +1 -0
- package/dist/types/src/components/Main/Main.d.ts +8 -8
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/{Menus → Menu}/ContextMenu.d.ts +6 -6
- package/dist/types/src/components/Menu/ContextMenu.d.ts.map +1 -0
- package/dist/types/src/components/Menu/ContextMenu.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Menus → Menu}/DropdownMenu.d.ts +3 -4
- package/dist/types/src/components/Menu/DropdownMenu.d.ts.map +1 -0
- package/dist/types/src/components/Menu/DropdownMenu.stories.d.ts.map +1 -0
- package/dist/types/src/components/Menu/index.d.ts.map +1 -0
- package/dist/types/src/components/Message/Message.d.ts +1 -1
- package/dist/types/src/components/Message/Message.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.stories.d.ts +1 -1
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts +9 -7
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +4 -0
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts +39 -0
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts.map +1 -0
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts +19 -0
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/ScrollContainer/index.d.ts +2 -0
- package/dist/types/src/components/ScrollContainer/index.d.ts.map +1 -0
- package/dist/types/src/components/Select/Select.d.ts +10 -10
- package/dist/types/src/components/Select/Select.d.ts.map +1 -1
- package/dist/types/src/components/Separator/Separator.d.ts +1 -1
- package/dist/types/src/components/Tag/Tag.d.ts +1 -1
- package/dist/types/src/components/Tag/Tag.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts +1 -2
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts +1 -8
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/index.d.ts +2 -1
- package/dist/types/src/components/ThemeProvider/index.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.d.ts +4 -4
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +11 -9
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +5 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDensityContext.d.ts +1 -1
- package/dist/types/src/hooks/useDensityContext.d.ts.map +1 -1
- package/dist/types/src/hooks/useElevationContext.d.ts +1 -1
- package/dist/types/src/hooks/useElevationContext.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/playground/Custom.stories.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/index.d.ts +1 -1
- package/dist/types/src/testing/decorators/index.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withLayout.d.ts +3 -3
- package/dist/types/src/testing/decorators/withLayout.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withLayoutVariants.d.ts +12 -0
- package/dist/types/src/testing/decorators/withLayoutVariants.d.ts.map +1 -0
- package/dist/types/src/testing/decorators/withTheme.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -2
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +32 -24
- package/src/components/Avatars/Avatar.stories.tsx +2 -2
- package/src/components/Avatars/Avatar.tsx +1 -1
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +1 -1
- package/src/components/{Buttons → Button}/Button.stories.tsx +2 -2
- package/src/components/{Buttons → Button}/Button.tsx +1 -1
- package/src/components/{Buttons → Button}/IconButton.tsx +19 -13
- package/src/components/{Buttons → Button}/Toggle.stories.tsx +5 -4
- package/src/components/Clipboard/CopyButton.tsx +4 -4
- package/src/components/DensityProvider/DensityProvider.tsx +1 -1
- package/src/components/{Dialogs → Dialog}/AlertDialog.stories.tsx +1 -1
- package/src/components/Dialog/Dialog.stories.tsx +97 -0
- package/src/components/{Dialogs → Dialog}/Dialog.tsx +140 -40
- package/src/components/ElevationProvider/ElevationProvider.tsx +1 -1
- package/src/components/Icon/Icon.stories.tsx +113 -0
- package/src/components/Icon/Icon.tsx +2 -2
- package/src/components/Input/Input.stories.tsx +2 -2
- package/src/components/Input/Input.tsx +13 -4
- package/src/components/{Lists → List}/List.stories.tsx +17 -13
- package/src/components/{Lists → List}/List.tsx +1 -1
- package/src/components/{Lists → List}/ListDropIndicator.tsx +1 -1
- package/src/components/Main/Main.stories.tsx +1 -1
- package/src/components/Main/Main.tsx +13 -13
- package/src/components/{Menus → Menu}/DropdownMenu.stories.tsx +1 -1
- package/src/components/{Menus → Menu}/DropdownMenu.tsx +79 -58
- package/src/components/Message/Message.stories.tsx +1 -1
- package/src/components/Message/Message.tsx +30 -5
- package/src/components/Popover/Popover.stories.tsx +1 -1
- package/src/components/Popover/Popover.tsx +52 -33
- package/src/components/ScrollArea/ScrollArea.stories.tsx +54 -4
- package/src/components/ScrollArea/ScrollArea.tsx +50 -4
- package/src/components/ScrollContainer/ScrollContainer.stories.tsx +70 -0
- package/src/components/ScrollContainer/ScrollContainer.tsx +233 -0
- package/src/components/ScrollContainer/index.ts +5 -0
- package/src/components/Select/Select.stories.tsx +2 -2
- package/src/components/Select/Select.tsx +4 -4
- package/src/components/Tag/Tag.stories.tsx +2 -2
- package/src/components/Tag/Tag.tsx +1 -1
- package/src/components/ThemeProvider/ThemeProvider.tsx +1 -3
- package/src/components/ThemeProvider/TranslationsProvider.tsx +1 -16
- package/src/components/ThemeProvider/index.ts +3 -3
- package/src/components/Toast/Toast.stories.tsx +1 -1
- package/src/components/Toolbar/Toolbar.stories.tsx +2 -4
- package/src/components/Toolbar/Toolbar.tsx +24 -9
- package/src/components/Tooltip/Tooltip.stories.tsx +1 -1
- package/src/components/Tooltip/Tooltip.tsx +22 -20
- package/src/components/index.ts +5 -4
- package/src/hooks/useDensityContext.ts +1 -1
- package/src/hooks/useElevationContext.ts +1 -1
- package/src/index.ts +1 -1
- package/src/playground/Controls.stories.tsx +2 -2
- package/src/playground/Custom.stories.tsx +6 -8
- package/src/testing/decorators/index.ts +1 -1
- package/src/testing/decorators/withLayout.tsx +22 -15
- package/src/testing/decorators/{withSurfaceVariantsLayout.tsx → withLayoutVariants.tsx} +5 -5
- package/src/testing/decorators/withTheme.tsx +3 -2
- package/src/util/index.ts +2 -2
- package/dist/lib/browser/chunk-KX5JDELJ.mjs +0 -4521
- package/dist/lib/browser/chunk-KX5JDELJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3HDQYL5S.mjs +0 -4523
- package/dist/lib/node-esm/chunk-3HDQYL5S.mjs.map +0 -7
- package/dist/types/src/components/Buttons/Button.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/Button.stories.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/IconButton.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/IconButton.stories.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/Toggle.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts +0 -13
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/ToggleGroup.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/index.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/AlertDialog.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/Dialog.d.ts +0 -31
- package/dist/types/src/components/Dialogs/Dialog.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/index.d.ts.map +0 -1
- package/dist/types/src/components/Lists/List.d.ts.map +0 -1
- package/dist/types/src/components/Lists/List.stories.d.ts.map +0 -1
- package/dist/types/src/components/Lists/ListDropIndicator.d.ts.map +0 -1
- package/dist/types/src/components/Lists/Tree.d.ts.map +0 -1
- package/dist/types/src/components/Lists/Tree.stories.d.ts.map +0 -1
- package/dist/types/src/components/Lists/TreeDropIndicator.d.ts.map +0 -1
- package/dist/types/src/components/Lists/Treegrid.d.ts.map +0 -1
- package/dist/types/src/components/Lists/Treegrid.stories.d.ts.map +0 -1
- package/dist/types/src/components/Lists/index.d.ts.map +0 -1
- package/dist/types/src/components/Menus/ContextMenu.d.ts.map +0 -1
- package/dist/types/src/components/Menus/ContextMenu.stories.d.ts.map +0 -1
- package/dist/types/src/components/Menus/DropdownMenu.d.ts.map +0 -1
- package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts.map +0 -1
- package/dist/types/src/components/Menus/index.d.ts.map +0 -1
- package/dist/types/src/testing/decorators/withSurfaceVariantsLayout.d.ts +0 -12
- package/dist/types/src/testing/decorators/withSurfaceVariantsLayout.d.ts.map +0 -1
- package/dist/types/src/util/ThemedClassName.d.ts +0 -5
- package/dist/types/src/util/ThemedClassName.d.ts.map +0 -1
- package/dist/types/src/util/domino.d.ts +0 -18
- package/dist/types/src/util/domino.d.ts.map +0 -1
- package/src/components/Dialogs/Dialog.stories.tsx +0 -67
- package/src/util/ThemedClassName.ts +0 -7
- package/src/util/domino.ts +0 -53
- /package/dist/types/src/components/{Buttons → Button}/Button.stories.d.ts +0 -0
- /package/dist/types/src/components/{Buttons → Button}/IconButton.stories.d.ts +0 -0
- /package/dist/types/src/components/{Buttons → Button}/Toggle.d.ts +0 -0
- /package/dist/types/src/components/{Buttons → Button}/index.d.ts +0 -0
- /package/dist/types/src/components/{Dialogs → Dialog}/AlertDialog.d.ts +0 -0
- /package/dist/types/src/components/{Dialogs → Dialog}/AlertDialog.stories.d.ts +0 -0
- /package/dist/types/src/components/{Dialogs → Dialog}/index.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/List.stories.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/ListDropIndicator.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/Tree.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/Tree.stories.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/TreeDropIndicator.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/Treegrid.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/Treegrid.stories.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/index.d.ts +0 -0
- /package/dist/types/src/components/{Menus → Menu}/ContextMenu.stories.d.ts +0 -0
- /package/dist/types/src/components/{Menus → Menu}/DropdownMenu.stories.d.ts +0 -0
- /package/dist/types/src/components/{Menus → Menu}/index.d.ts +0 -0
- /package/src/components/{Buttons → Button}/IconButton.stories.tsx +0 -0
- /package/src/components/{Buttons → Button}/Toggle.tsx +0 -0
- /package/src/components/{Buttons → Button}/ToggleGroup.stories.tsx +0 -0
- /package/src/components/{Buttons → Button}/ToggleGroup.tsx +0 -0
- /package/src/components/{Buttons → Button}/index.ts +0 -0
- /package/src/components/{Dialogs → Dialog}/AlertDialog.tsx +0 -0
- /package/src/components/{Dialogs → Dialog}/index.ts +0 -0
- /package/src/components/{Lists → List}/Tree.stories.tsx +0 -0
- /package/src/components/{Lists → List}/Tree.tsx +0 -0
- /package/src/components/{Lists → List}/TreeDropIndicator.tsx +0 -0
- /package/src/components/{Lists → List}/Treegrid.stories.tsx +0 -0
- /package/src/components/{Lists → List}/Treegrid.tsx +0 -0
- /package/src/components/{Lists → List}/index.ts +0 -0
- /package/src/components/{Menus → Menu}/ContextMenu.stories.tsx +0 -0
- /package/src/components/{Menus → Menu}/ContextMenu.tsx +0 -0
- /package/src/components/{Menus → Menu}/index.ts +0 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { IconBase, type IconProps, type IconWeight } from '@phosphor-icons/react';
|
|
6
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
7
|
+
import React, { type FC, type ReactElement, type SVGProps, forwardRef } from 'react';
|
|
8
|
+
|
|
9
|
+
import { getSize, mx } from '@dxos/ui-theme';
|
|
10
|
+
|
|
11
|
+
import { withTheme } from '../../testing';
|
|
12
|
+
|
|
13
|
+
import { Icon } from './Icon';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Create icon from serializable data.
|
|
17
|
+
* https://github.com/phosphor-icons/react#custom-icons
|
|
18
|
+
* https://github.com/phosphor-icons/core/tree/main/assets
|
|
19
|
+
*/
|
|
20
|
+
const createIcon = ({
|
|
21
|
+
name,
|
|
22
|
+
weights,
|
|
23
|
+
}: {
|
|
24
|
+
name: string;
|
|
25
|
+
weights: Record<string, SVGProps<SVGPathElement>[]>;
|
|
26
|
+
}): FC<IconProps> => {
|
|
27
|
+
const CustomIcon = forwardRef<SVGSVGElement, IconProps>((props, ref) => (
|
|
28
|
+
<IconBase
|
|
29
|
+
ref={ref}
|
|
30
|
+
{...props}
|
|
31
|
+
weights={
|
|
32
|
+
new Map<IconWeight, ReactElement>(
|
|
33
|
+
Object.entries(weights).map(
|
|
34
|
+
([key, paths]) =>
|
|
35
|
+
[
|
|
36
|
+
key,
|
|
37
|
+
<>
|
|
38
|
+
{paths.map((props, i) => (
|
|
39
|
+
<path key={`${key}-${i}`} {...props} />
|
|
40
|
+
))}
|
|
41
|
+
</>,
|
|
42
|
+
] as [IconWeight, ReactElement],
|
|
43
|
+
),
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
/>
|
|
47
|
+
));
|
|
48
|
+
|
|
49
|
+
CustomIcon.displayName = name;
|
|
50
|
+
return CustomIcon;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const DefaultStory = ({ CustomIcon }: { CustomIcon: FC<IconProps> }) => {
|
|
54
|
+
return (
|
|
55
|
+
<div className='grid grid-cols-2 gap-8'>
|
|
56
|
+
<CustomIcon weight={'regular'} className={mx(getSize(16))} />
|
|
57
|
+
<Icon icon='ph--github-logo--regular' classNames={mx(getSize(16))} />
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const meta = {
|
|
63
|
+
title: 'ui/react-ui-core/Icon',
|
|
64
|
+
render: DefaultStory,
|
|
65
|
+
decorators: [withTheme],
|
|
66
|
+
parameters: {
|
|
67
|
+
layout: 'centered',
|
|
68
|
+
},
|
|
69
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
70
|
+
|
|
71
|
+
export default meta;
|
|
72
|
+
|
|
73
|
+
type Story = StoryObj<typeof meta>;
|
|
74
|
+
|
|
75
|
+
export const Default: Story = {
|
|
76
|
+
args: {
|
|
77
|
+
CustomIcon: createIcon({
|
|
78
|
+
name: 'GithubLogo',
|
|
79
|
+
weights: {
|
|
80
|
+
// https://github.com/phosphor-icons/core/tree/main/assets
|
|
81
|
+
// <path d="M119.83,56A52,52,0,0,0,76,32a51.92,51.92,0,0,0-3.49,44.7A49.28,49.28,0,0,0,64,104v8a48,48,0,0,0,48,48h48a48,48,0,0,0,48-48v-8a49.28,49.28,0,0,0-8.51-27.3A51.92,51.92,0,0,0,196,32a52,52,0,0,0-43.83,24Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
|
|
82
|
+
// <path d="M104,232V192a32,32,0,0,1,32-32h0a32,32,0,0,1,32,32v40" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
|
|
83
|
+
// <path d="M104,208H72a32,32,0,0,1-32-32A32,32,0,0,0,8,144" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
|
|
84
|
+
regular: [
|
|
85
|
+
{
|
|
86
|
+
d: 'M119.83,56A52,52,0,0,0,76,32a51.92,51.92,0,0,0-3.49,44.7A49.28,49.28,0,0,0,64,104v8a48,48,0,0,0,48,48h48a48,48,0,0,0,48-48v-8a49.28,49.28,0,0,0-8.51-27.3A51.92,51.92,0,0,0,196,32a52,52,0,0,0-43.83,24Z',
|
|
87
|
+
fill: 'none',
|
|
88
|
+
stroke: 'currentColor',
|
|
89
|
+
strokeLinecap: 'round',
|
|
90
|
+
strokeLinejoin: 'round',
|
|
91
|
+
strokeWidth: '16',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
d: 'M104,232V192a32,32,0,0,1,32-32h0a32,32,0,0,1,32,32v40',
|
|
95
|
+
fill: 'none',
|
|
96
|
+
stroke: 'currentColor',
|
|
97
|
+
strokeLinecap: 'round',
|
|
98
|
+
strokeLinejoin: 'round',
|
|
99
|
+
strokeWidth: '16',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
d: 'M104,208H72a32,32,0,0,1-32-32A32,32,0,0,0,8,144',
|
|
103
|
+
fill: 'none',
|
|
104
|
+
stroke: 'currentColor',
|
|
105
|
+
strokeLinecap: 'round',
|
|
106
|
+
strokeLinejoin: 'round',
|
|
107
|
+
strokeWidth: '16',
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
}),
|
|
112
|
+
},
|
|
113
|
+
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type Primitive } from '@radix-ui/react-primitive';
|
|
6
6
|
import React, { type ComponentPropsWithRef, forwardRef, memo } from 'react';
|
|
7
7
|
|
|
8
|
-
import { type Size } from '@dxos/
|
|
8
|
+
import { type Size } from '@dxos/ui-types';
|
|
9
9
|
|
|
10
10
|
import { useIconHref, useThemeContext } from '../../hooks';
|
|
11
11
|
import { type ThemedClassName } from '../../util';
|
|
@@ -16,7 +16,7 @@ export type IconProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.s
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
export const Icon = memo(
|
|
19
|
-
forwardRef<SVGSVGElement, IconProps>(({ icon, classNames, size, ...props }, forwardedRef) => {
|
|
19
|
+
forwardRef<SVGSVGElement, IconProps>(({ icon, classNames, size = 4, ...props }, forwardedRef) => {
|
|
20
20
|
const { tx } = useThemeContext();
|
|
21
21
|
const href = useIconHref(icon);
|
|
22
22
|
return (
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import { baseSurface, modalSurface, mx, surfaceShadow } from '@dxos/
|
|
9
|
-
import { type MessageValence } from '@dxos/
|
|
8
|
+
import { baseSurface, modalSurface, mx, surfaceShadow } from '@dxos/ui-theme';
|
|
9
|
+
import { type MessageValence } from '@dxos/ui-types';
|
|
10
10
|
|
|
11
11
|
import { withTheme } from '../../testing';
|
|
12
12
|
|
|
@@ -27,8 +27,8 @@ import {
|
|
|
27
27
|
type ValidationProps as ValidationPrimitiveProps,
|
|
28
28
|
useInputContext,
|
|
29
29
|
} from '@dxos/react-input';
|
|
30
|
-
import { mx } from '@dxos/
|
|
31
|
-
import { type ClassNameValue, type Density, type Elevation, type Size } from '@dxos/
|
|
30
|
+
import { mx } from '@dxos/ui-theme';
|
|
31
|
+
import { type ClassNameValue, type Density, type Elevation, type Size } from '@dxos/ui-types';
|
|
32
32
|
|
|
33
33
|
import { useDensityContext, useElevationContext, useThemeContext } from '../../hooks';
|
|
34
34
|
import { type ThemedClassName } from '../../util';
|
|
@@ -162,10 +162,17 @@ const PinInput = forwardRef<HTMLInputElement, PinInputProps>(
|
|
|
162
162
|
|
|
163
163
|
// TODO(burdon): Implement inline icon within button: e.g., https://www.radix-ui.com/themes/playground#text-field
|
|
164
164
|
|
|
165
|
-
type
|
|
165
|
+
type AutoFillProps = {
|
|
166
|
+
noAutoFill?: boolean;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
type TextInputProps = InputSharedProps & ThemedClassName<TextInputPrimitiveProps> & AutoFillProps;
|
|
166
170
|
|
|
167
171
|
const TextInput = forwardRef<HTMLInputElement, InputScopedProps<TextInputProps>>(
|
|
168
|
-
(
|
|
172
|
+
(
|
|
173
|
+
{ __inputScope, classNames, density: propsDensity, elevation: propsElevation, variant, noAutoFill, ...props },
|
|
174
|
+
forwardedRef,
|
|
175
|
+
) => {
|
|
169
176
|
const { hasIosKeyboard } = useThemeContext();
|
|
170
177
|
const themeContextValue = useThemeContext();
|
|
171
178
|
const density = useDensityContext(propsDensity);
|
|
@@ -177,6 +184,8 @@ const TextInput = forwardRef<HTMLInputElement, InputScopedProps<TextInputProps>>
|
|
|
177
184
|
return (
|
|
178
185
|
<TextInputPrimitive
|
|
179
186
|
{...props}
|
|
187
|
+
// TODO(wittjosiah): Factor out autofill properies.
|
|
188
|
+
{...{ 'data-1p-ignore': noAutoFill }}
|
|
180
189
|
className={tx(
|
|
181
190
|
'input.input',
|
|
182
191
|
'input',
|
|
@@ -7,7 +7,7 @@ import { SortableContext, arrayMove, useSortable, verticalListSortingStrategy }
|
|
|
7
7
|
import { CSS } from '@dnd-kit/utilities';
|
|
8
8
|
import { useArrowNavigationGroup } from '@fluentui/react-tabster';
|
|
9
9
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
10
|
-
import React, { type ReactNode, useState } from 'react';
|
|
10
|
+
import React, { type ReactNode, useCallback, useState } from 'react';
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
13
|
getSize,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
ghostSelectedTrackingInterFromNormal,
|
|
17
17
|
mx,
|
|
18
18
|
surfaceShadow,
|
|
19
|
-
} from '@dxos/
|
|
19
|
+
} from '@dxos/ui-theme';
|
|
20
20
|
|
|
21
21
|
import { withTheme } from '../../testing';
|
|
22
22
|
import { Icon } from '../Icon';
|
|
@@ -63,16 +63,20 @@ export const UniformSizeDraggable: Story = {
|
|
|
63
63
|
})),
|
|
64
64
|
);
|
|
65
65
|
|
|
66
|
-
const handleDragEnd = (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
66
|
+
const handleDragEnd = useCallback(
|
|
67
|
+
(event: DragEndEvent) => {
|
|
68
|
+
const { active, over } = event;
|
|
69
|
+
if (active.id !== over?.id) {
|
|
70
|
+
setItems((items) => {
|
|
71
|
+
const oldIndex = items.findIndex((item) => item.id === active.id);
|
|
72
|
+
const newIndex = items.findIndex((item) => item.id === over?.id);
|
|
73
|
+
return arrayMove(items, oldIndex, newIndex);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
[items],
|
|
78
|
+
);
|
|
79
|
+
|
|
76
80
|
return (
|
|
77
81
|
<DndContext onDragEnd={handleDragEnd}>
|
|
78
82
|
<SortableContext items={items.map(({ id }) => id)} strategy={verticalListSortingStrategy}>
|
|
@@ -229,7 +233,7 @@ export const SelectableListbox: Story = {
|
|
|
229
233
|
onClick={() => setSelectedId(id)}
|
|
230
234
|
onKeyUp={(event) => handleKeyUp(event, id)}
|
|
231
235
|
>
|
|
232
|
-
<ListItem.Heading classNames='flex
|
|
236
|
+
<ListItem.Heading classNames='flex pli-1 items-center grow truncate'>{text}</ListItem.Heading>
|
|
233
237
|
</ListItem.Root>
|
|
234
238
|
))}
|
|
235
239
|
</List>
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
useListContext,
|
|
24
24
|
useListItemContext,
|
|
25
25
|
} from '@dxos/react-list';
|
|
26
|
-
import { type Density } from '@dxos/
|
|
26
|
+
import { type Density } from '@dxos/ui-types';
|
|
27
27
|
|
|
28
28
|
import { useDensityContext, useThemeContext } from '../../hooks';
|
|
29
29
|
import { type ThemedClassName } from '../../util';
|
|
@@ -18,7 +18,7 @@ const orientationStyles: Record<Orientation, HTMLAttributes<HTMLElement>['classN
|
|
|
18
18
|
horizontal:
|
|
19
19
|
'h-[--line-thickness] left-[calc(var(--line-inset)+var(--terminal-radius))] right-[--line-inset] before:left-[--terminal-inset]',
|
|
20
20
|
vertical:
|
|
21
|
-
'
|
|
21
|
+
'is-[--line-thickness] top-[calc(var(--line-inset)+var(--terminal-radius))] bottom-[--line-inset] before:top-[--terminal-inset]',
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const edgeStyles: Record<Edge, HTMLAttributes<HTMLElement>['className']> = {
|
|
@@ -6,7 +6,7 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
8
|
import { withTheme } from '../../testing';
|
|
9
|
-
import { Button } from '../
|
|
9
|
+
import { Button } from '../Button';
|
|
10
10
|
|
|
11
11
|
import { Main, useSidebars } from './Main';
|
|
12
12
|
|
|
@@ -31,22 +31,12 @@ import { type Label, toLocalizedString, useTranslation } from '../ThemeProvider'
|
|
|
31
31
|
|
|
32
32
|
import { useSwipeToDismiss } from './useSwipeToDismiss';
|
|
33
33
|
|
|
34
|
+
const MAIN_NAME = 'Main';
|
|
34
35
|
const MAIN_ROOT_NAME = 'MainRoot';
|
|
35
36
|
const NAVIGATION_SIDEBAR_NAME = 'NavigationSidebar';
|
|
36
37
|
const COMPLEMENTARY_SIDEBAR_NAME = 'ComplementarySidebar';
|
|
37
|
-
const MAIN_NAME = 'Main';
|
|
38
38
|
const GENERIC_CONSUMER_NAME = 'GenericConsumer';
|
|
39
39
|
|
|
40
|
-
type SidebarState = 'expanded' | 'collapsed' | 'closed';
|
|
41
|
-
|
|
42
|
-
type MainContextValue = {
|
|
43
|
-
resizing: boolean;
|
|
44
|
-
navigationSidebarState: SidebarState;
|
|
45
|
-
setNavigationSidebarState: Dispatch<SetStateAction<SidebarState | undefined>>;
|
|
46
|
-
complementarySidebarState: SidebarState;
|
|
47
|
-
setComplementarySidebarState: Dispatch<SetStateAction<SidebarState | undefined>>;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
40
|
const landmarkAttr = 'data-main-landmark';
|
|
51
41
|
|
|
52
42
|
/**
|
|
@@ -72,8 +62,8 @@ const useLandmarkMover = (propsOnKeyDown: ComponentPropsWithoutRef<'div'>['onKey
|
|
|
72
62
|
[propsOnKeyDown],
|
|
73
63
|
);
|
|
74
64
|
|
|
75
|
-
// TODO(thure): This was disconnected once before in #8818
|
|
76
|
-
// extension, please ensure the change doesn’t break web, desktop and mobile.
|
|
65
|
+
// TODO(thure): This was disconnected once before in #8818;
|
|
66
|
+
// if this should change again to support the browser extension, please ensure the change doesn’t break web, desktop and mobile.
|
|
77
67
|
const focusableGroupAttrs = useFocusableGroup({ tabBehavior: 'limited', ignoreDefaultKeydown: { Tab: true } });
|
|
78
68
|
|
|
79
69
|
return {
|
|
@@ -84,6 +74,16 @@ const useLandmarkMover = (propsOnKeyDown: ComponentPropsWithoutRef<'div'>['onKey
|
|
|
84
74
|
};
|
|
85
75
|
};
|
|
86
76
|
|
|
77
|
+
type SidebarState = 'expanded' | 'collapsed' | 'closed';
|
|
78
|
+
|
|
79
|
+
type MainContextValue = {
|
|
80
|
+
resizing: boolean;
|
|
81
|
+
navigationSidebarState: SidebarState;
|
|
82
|
+
setNavigationSidebarState: Dispatch<SetStateAction<SidebarState | undefined>>;
|
|
83
|
+
complementarySidebarState: SidebarState;
|
|
84
|
+
setComplementarySidebarState: Dispatch<SetStateAction<SidebarState | undefined>>;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
87
|
const [MainProvider, useMainContext] = createContext<MainContextValue>(MAIN_NAME, {
|
|
88
88
|
resizing: false,
|
|
89
89
|
navigationSidebarState: 'closed',
|
|
@@ -6,7 +6,7 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
import React, { useRef, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { withTheme } from '../../testing';
|
|
9
|
-
import { Button } from '../
|
|
9
|
+
import { Button } from '../Button';
|
|
10
10
|
|
|
11
11
|
import { DropdownMenu } from './DropdownMenu';
|
|
12
12
|
|
|
@@ -25,6 +25,7 @@ import React, {
|
|
|
25
25
|
forwardRef,
|
|
26
26
|
useCallback,
|
|
27
27
|
useEffect,
|
|
28
|
+
useMemo,
|
|
28
29
|
useRef,
|
|
29
30
|
} from 'react';
|
|
30
31
|
|
|
@@ -34,15 +35,15 @@ import { type ThemedClassName } from '../../util';
|
|
|
34
35
|
|
|
35
36
|
type Direction = 'ltr' | 'rtl';
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
//
|
|
39
|
+
// DropdownMenu
|
|
40
|
+
//
|
|
40
41
|
|
|
41
42
|
const DROPDOWN_MENU_NAME = 'DropdownMenu';
|
|
42
43
|
|
|
43
44
|
type ScopedProps<P> = P & { __scopeDropdownMenu?: Scope };
|
|
44
45
|
const [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(DROPDOWN_MENU_NAME, [createMenuScope]);
|
|
45
|
-
const useMenuScope = createMenuScope();
|
|
46
|
+
const useMenuScope: (scope?: Scope) => any = createMenuScope();
|
|
46
47
|
|
|
47
48
|
type DropdownMenuContextValue = {
|
|
48
49
|
triggerId: string;
|
|
@@ -96,9 +97,9 @@ const DropdownMenuRoot: FC<DropdownMenuRootProps> = (props: ScopedProps<Dropdown
|
|
|
96
97
|
|
|
97
98
|
DropdownMenuRoot.displayName = DROPDOWN_MENU_NAME;
|
|
98
99
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
//
|
|
101
|
+
// DropdownMenuTrigger
|
|
102
|
+
//
|
|
102
103
|
|
|
103
104
|
const TRIGGER_NAME = 'DropdownMenuTrigger';
|
|
104
105
|
|
|
@@ -161,9 +162,9 @@ const DropdownMenuTrigger = forwardRef<DropdownMenuTriggerElement, DropdownMenuT
|
|
|
161
162
|
|
|
162
163
|
DropdownMenuTrigger.displayName = TRIGGER_NAME;
|
|
163
164
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
//
|
|
166
|
+
// DropdownMenuVirtualTrigger
|
|
167
|
+
//
|
|
167
168
|
|
|
168
169
|
const VIRTUAL_TRIGGER_NAME = 'DropdownMenuVirtualTrigger';
|
|
169
170
|
|
|
@@ -185,9 +186,9 @@ const DropdownMenuVirtualTrigger = (props: ScopedProps<DropdownMenuVirtualTrigge
|
|
|
185
186
|
|
|
186
187
|
DropdownMenuVirtualTrigger.displayName = VIRTUAL_TRIGGER_NAME;
|
|
187
188
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
//
|
|
190
|
+
// DropdownMenuPortal
|
|
191
|
+
//
|
|
191
192
|
|
|
192
193
|
const PORTAL_NAME = 'DropdownMenuPortal';
|
|
193
194
|
|
|
@@ -202,9 +203,9 @@ const DropdownMenuPortal: FC<DropdownMenuPortalProps> = (props: ScopedProps<Drop
|
|
|
202
203
|
|
|
203
204
|
DropdownMenuPortal.displayName = PORTAL_NAME;
|
|
204
205
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
//
|
|
207
|
+
// DropdownMenuViewport
|
|
208
|
+
//
|
|
208
209
|
|
|
209
210
|
type DropdownMenuViewportProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.div>> & {
|
|
210
211
|
asChild?: boolean;
|
|
@@ -222,9 +223,9 @@ const DropdownMenuViewport = forwardRef<HTMLDivElement, DropdownMenuViewportProp
|
|
|
222
223
|
},
|
|
223
224
|
);
|
|
224
225
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
//
|
|
227
|
+
// DropdownMenuContent
|
|
228
|
+
//
|
|
228
229
|
|
|
229
230
|
const CONTENT_NAME = 'DropdownMenuContent';
|
|
230
231
|
|
|
@@ -234,19 +235,35 @@ interface DropdownMenuContentProps extends Omit<MenuContentProps, 'onEntryFocus'
|
|
|
234
235
|
|
|
235
236
|
const DropdownMenuContent = forwardRef<DropdownMenuContentElement, DropdownMenuContentProps>(
|
|
236
237
|
(props: ScopedProps<DropdownMenuContentProps>, forwardedRef) => {
|
|
237
|
-
const { __scopeDropdownMenu, classNames, collisionPadding = 8, ...contentProps } = props;
|
|
238
|
+
const { __scopeDropdownMenu, classNames, collisionPadding = 8, collisionBoundary, ...contentProps } = props;
|
|
238
239
|
const { tx } = useThemeContext();
|
|
239
240
|
const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);
|
|
240
241
|
const elevation = useElevationContext();
|
|
241
242
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
242
243
|
const hasInteractedOutsideRef = useRef(false);
|
|
243
244
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
245
|
+
|
|
246
|
+
// Check for the closest annotated collision boundary in the DOM tree.
|
|
247
|
+
const computedCollisionBoundary = useMemo(() => {
|
|
248
|
+
const closestBoundary = context.triggerRef.current?.closest(
|
|
249
|
+
'[data-popover-collision-boundary]',
|
|
250
|
+
) as HTMLElement | null;
|
|
251
|
+
return closestBoundary
|
|
252
|
+
? Array.isArray(collisionBoundary)
|
|
253
|
+
? [closestBoundary, ...collisionBoundary]
|
|
254
|
+
: collisionBoundary
|
|
255
|
+
? [closestBoundary, collisionBoundary]
|
|
256
|
+
: [closestBoundary]
|
|
257
|
+
: collisionBoundary;
|
|
258
|
+
}, [context.open, collisionBoundary, context.triggerRef.current]);
|
|
259
|
+
|
|
244
260
|
return (
|
|
245
261
|
<MenuPrimitive.Content
|
|
246
262
|
id={context.contentId}
|
|
247
263
|
aria-labelledby={context.triggerId}
|
|
248
264
|
{...menuScope}
|
|
249
265
|
{...contentProps}
|
|
266
|
+
collisionBoundary={computedCollisionBoundary}
|
|
250
267
|
collisionPadding={safeCollisionPadding}
|
|
251
268
|
ref={forwardedRef}
|
|
252
269
|
onCloseAutoFocus={composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
@@ -285,9 +302,9 @@ const DropdownMenuContent = forwardRef<DropdownMenuContentElement, DropdownMenuC
|
|
|
285
302
|
|
|
286
303
|
DropdownMenuContent.displayName = CONTENT_NAME;
|
|
287
304
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
305
|
+
//
|
|
306
|
+
// DropdownMenuGroup
|
|
307
|
+
//
|
|
291
308
|
|
|
292
309
|
const GROUP_NAME = 'DropdownMenuGroup';
|
|
293
310
|
|
|
@@ -305,9 +322,9 @@ const DropdownMenuGroup = forwardRef<DropdownMenuGroupElement, DropdownMenuGroup
|
|
|
305
322
|
|
|
306
323
|
DropdownMenuGroup.displayName = GROUP_NAME;
|
|
307
324
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
325
|
+
//
|
|
326
|
+
// DropdownMenuLabel
|
|
327
|
+
//
|
|
311
328
|
|
|
312
329
|
const LABEL_NAME = 'DropdownMenuLabel';
|
|
313
330
|
|
|
@@ -333,9 +350,9 @@ const DropdownMenuGroupLabel = forwardRef<DropdownMenuLabelElement, DropdownMenu
|
|
|
333
350
|
|
|
334
351
|
DropdownMenuGroupLabel.displayName = LABEL_NAME;
|
|
335
352
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
353
|
+
//
|
|
354
|
+
// DropdownMenuItem
|
|
355
|
+
//
|
|
339
356
|
|
|
340
357
|
const ITEM_NAME = 'DropdownMenuItem';
|
|
341
358
|
|
|
@@ -361,9 +378,9 @@ const DropdownMenuItem = forwardRef<DropdownMenuItemElement, DropdownMenuItemPro
|
|
|
361
378
|
|
|
362
379
|
DropdownMenuItem.displayName = ITEM_NAME;
|
|
363
380
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
381
|
+
//
|
|
382
|
+
// DropdownMenuCheckboxItem
|
|
383
|
+
//
|
|
367
384
|
|
|
368
385
|
const CHECKBOX_ITEM_NAME = 'DropdownMenuCheckboxItem';
|
|
369
386
|
|
|
@@ -389,9 +406,9 @@ const DropdownMenuCheckboxItem = forwardRef<DropdownMenuCheckboxItemElement, Dro
|
|
|
389
406
|
|
|
390
407
|
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
391
408
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
409
|
+
//
|
|
410
|
+
// DropdownMenuRadioGroup
|
|
411
|
+
//
|
|
395
412
|
|
|
396
413
|
const RADIO_GROUP_NAME = 'DropdownMenuRadioGroup';
|
|
397
414
|
|
|
@@ -409,9 +426,9 @@ const DropdownMenuRadioGroup = forwardRef<DropdownMenuRadioGroupElement, Dropdow
|
|
|
409
426
|
|
|
410
427
|
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
411
428
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
429
|
+
//
|
|
430
|
+
// DropdownMenuRadioItem
|
|
431
|
+
//
|
|
415
432
|
|
|
416
433
|
const RADIO_ITEM_NAME = 'DropdownMenuRadioItem';
|
|
417
434
|
|
|
@@ -437,9 +454,9 @@ const DropdownMenuRadioItem = forwardRef<DropdownMenuRadioItemElement, DropdownM
|
|
|
437
454
|
|
|
438
455
|
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
439
456
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
457
|
+
//
|
|
458
|
+
// DropdownMenuItemIndicator
|
|
459
|
+
//
|
|
443
460
|
|
|
444
461
|
const INDICATOR_NAME = 'DropdownMenuItemIndicator';
|
|
445
462
|
|
|
@@ -457,9 +474,9 @@ const DropdownMenuItemIndicator = forwardRef<DropdownMenuItemIndicatorElement, D
|
|
|
457
474
|
|
|
458
475
|
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
459
476
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
477
|
+
//
|
|
478
|
+
// DropdownMenuSeparator
|
|
479
|
+
//
|
|
463
480
|
|
|
464
481
|
const SEPARATOR_NAME = 'DropdownMenuSeparator';
|
|
465
482
|
|
|
@@ -485,9 +502,9 @@ const DropdownMenuSeparator = forwardRef<DropdownMenuSeparatorElement, DropdownM
|
|
|
485
502
|
|
|
486
503
|
DropdownMenuSeparator.displayName = SEPARATOR_NAME;
|
|
487
504
|
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
505
|
+
//
|
|
506
|
+
// DropdownMenuArrow
|
|
507
|
+
//
|
|
491
508
|
|
|
492
509
|
const ARROW_NAME = 'DropdownMenuArrow';
|
|
493
510
|
|
|
@@ -513,9 +530,9 @@ const DropdownMenuArrow = forwardRef<DropdownMenuArrowElement, DropdownMenuArrow
|
|
|
513
530
|
|
|
514
531
|
DropdownMenuArrow.displayName = ARROW_NAME;
|
|
515
532
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
533
|
+
//
|
|
534
|
+
// DropdownMenuSub
|
|
535
|
+
//
|
|
519
536
|
|
|
520
537
|
interface DropdownMenuSubProps {
|
|
521
538
|
children?: ReactNode;
|
|
@@ -540,9 +557,9 @@ const DropdownMenuSub: FC<DropdownMenuSubProps> = (props: ScopedProps<DropdownMe
|
|
|
540
557
|
);
|
|
541
558
|
};
|
|
542
559
|
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
560
|
+
//
|
|
561
|
+
// DropdownMenuSubTrigger
|
|
562
|
+
//
|
|
546
563
|
|
|
547
564
|
const SUB_TRIGGER_NAME = 'DropdownMenuSubTrigger';
|
|
548
565
|
|
|
@@ -560,9 +577,9 @@ const DropdownMenuSubTrigger = forwardRef<DropdownMenuSubTriggerElement, Dropdow
|
|
|
560
577
|
|
|
561
578
|
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
562
579
|
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
580
|
+
//
|
|
581
|
+
// DropdownMenuSubContent
|
|
582
|
+
//
|
|
566
583
|
|
|
567
584
|
const SUB_CONTENT_NAME = 'DropdownMenuSubContent';
|
|
568
585
|
|
|
@@ -598,7 +615,9 @@ const DropdownMenuSubContent = forwardRef<DropdownMenuSubContentElement, Dropdow
|
|
|
598
615
|
|
|
599
616
|
DropdownMenuSubContent.displayName = SUB_CONTENT_NAME;
|
|
600
617
|
|
|
601
|
-
|
|
618
|
+
//
|
|
619
|
+
// DropdownMenu
|
|
620
|
+
//
|
|
602
621
|
|
|
603
622
|
export const DropdownMenu = {
|
|
604
623
|
Root: DropdownMenuRoot,
|
|
@@ -621,7 +640,9 @@ export const DropdownMenu = {
|
|
|
621
640
|
SubContent: DropdownMenuSubContent,
|
|
622
641
|
};
|
|
623
642
|
|
|
624
|
-
|
|
643
|
+
type DropdownMenuScope = Scope;
|
|
644
|
+
|
|
645
|
+
const useDropdownMenuMenuScope: (scope?: DropdownMenuScope) => any = useMenuScope;
|
|
625
646
|
|
|
626
647
|
export { createDropdownMenuScope, useDropdownMenuContext, useDropdownMenuMenuScope };
|
|
627
648
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import { type MessageValence } from '@dxos/
|
|
8
|
+
import { type MessageValence } from '@dxos/ui-types';
|
|
9
9
|
|
|
10
10
|
import { withTheme } from '../../testing';
|
|
11
11
|
|