@dxos/react-ui 0.7.5-main.9d26e3a → 0.7.5-main.b19bfc8
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/index.mjs +290 -216
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +663 -592
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +290 -216
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Avatars/Avatar.d.ts +6 -10
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts +12 -13
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/AvatarGroup.d.ts +1 -1
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts +2 -2
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts +3 -3
- package/dist/types/src/components/Buttons/Button.stories.d.ts +2 -2
- package/dist/types/src/components/Buttons/IconButton.d.ts +7 -2
- package/dist/types/src/components/Buttons/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/IconButton.stories.d.ts +2 -2
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts +2 -2
- package/dist/types/src/components/Buttons/ToggleGroup.d.ts +4 -4
- package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts +6 -6
- package/dist/types/src/components/Clipboard/ClipboardProvider.d.ts +1 -1
- package/dist/types/src/components/Clipboard/ClipboardProvider.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts +6 -3
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/index.d.ts +8 -3
- package/dist/types/src/components/Clipboard/index.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/Dialogs/AlertDialog.d.ts +1 -1
- package/dist/types/src/components/Dialogs/AlertDialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts +2 -2
- package/dist/types/src/components/Dialogs/Dialog.d.ts +4 -2
- package/dist/types/src/components/Dialogs/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts +2 -2
- 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.map +1 -1
- package/dist/types/src/components/Input/Input.d.ts +1 -1
- 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/Lists/List.stories.d.ts +5 -5
- package/dist/types/src/components/Lists/ListDropIndicator.d.ts +3 -2
- package/dist/types/src/components/Lists/ListDropIndicator.d.ts.map +1 -1
- package/dist/types/src/components/Lists/Tree.stories.d.ts +3 -3
- package/dist/types/src/components/Lists/TreeDropIndicator.d.ts +1 -2
- package/dist/types/src/components/Lists/TreeDropIndicator.d.ts.map +1 -1
- package/dist/types/src/components/Lists/Treegrid.stories.d.ts +2 -2
- package/dist/types/src/components/Main/Main.d.ts +35 -24
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.stories.d.ts +3 -4
- package/dist/types/src/components/Main/Main.stories.d.ts.map +1 -1
- package/dist/types/src/components/Menus/ContextMenu.d.ts +6 -6
- package/dist/types/src/components/Menus/ContextMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menus/ContextMenu.stories.d.ts +8 -8
- package/dist/types/src/components/Menus/DropdownMenu.d.ts +3 -7
- package/dist/types/src/components/Menus/DropdownMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts +4 -4
- package/dist/types/src/components/Message/Message.stories.d.ts +2 -2
- 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/Popover/Popover.stories.d.ts +5 -5
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts +5 -5
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +7 -7
- package/dist/types/src/components/Select/Select.d.ts +9 -9
- package/dist/types/src/components/Select/Select.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.stories.d.ts +2 -3
- package/dist/types/src/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/types/src/components/Separator/Separator.d.ts +3 -1
- package/dist/types/src/components/Separator/Separator.d.ts.map +1 -1
- package/dist/types/src/components/Status/Status.stories.d.ts +3 -3
- 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 +12 -5
- package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts +5 -3
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.d.ts +4 -4
- package/dist/types/src/components/Toast/Toast.stories.d.ts +8 -8
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +20 -10
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +17 -12
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +2 -2
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +16 -4
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- 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/hooks/useSafeArea.d.ts +9 -0
- package/dist/types/src/hooks/useSafeArea.d.ts.map +1 -0
- package/dist/types/src/hooks/useSafeCollisionPadding.d.ts +10 -0
- package/dist/types/src/hooks/useSafeCollisionPadding.d.ts.map +1 -0
- package/dist/types/src/hooks/useThemeContext.d.ts +1 -1
- package/dist/types/src/hooks/useThemeContext.d.ts.map +1 -1
- package/dist/types/src/hooks/useTranslationsContext.d.ts +1 -1
- package/dist/types/src/hooks/useVisualViewport.d.ts +1 -1
- package/dist/types/src/hooks/useVisualViewport.d.ts.map +1 -1
- package/dist/types/src/playground/Controls.stories.d.ts +2 -3
- package/dist/types/src/playground/Controls.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Typography.stories.d.ts +2 -3
- package/dist/types/src/playground/Typography.stories.d.ts.map +1 -1
- package/dist/types/src/util/ThemedClassName.d.ts +1 -1
- package/dist/types/src/util/ThemedClassName.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +43 -42
- package/src/components/Avatars/Avatar.tsx +5 -13
- package/src/components/Buttons/IconButton.tsx +32 -7
- package/src/components/Clipboard/CopyButton.tsx +6 -2
- package/src/components/Dialogs/AlertDialog.tsx +3 -1
- package/src/components/Dialogs/Dialog.stories.tsx +1 -1
- package/src/components/Dialogs/Dialog.tsx +10 -13
- package/src/components/Icon/Icon.tsx +4 -1
- package/src/components/Input/Input.tsx +1 -1
- package/src/components/Lists/ListDropIndicator.tsx +15 -7
- package/src/components/Main/Main.stories.tsx +1 -1
- package/src/components/Main/Main.tsx +78 -108
- package/src/components/Menus/ContextMenu.tsx +4 -2
- package/src/components/Menus/DropdownMenu.tsx +4 -2
- package/src/components/Popover/Popover.tsx +4 -0
- package/src/components/Select/Select.tsx +4 -1
- package/src/components/Separator/Separator.tsx +14 -11
- package/src/components/Tag/Tag.stories.tsx +17 -31
- package/src/components/Tag/Tag.tsx +15 -6
- package/src/components/ThemeProvider/ThemeProvider.tsx +12 -3
- package/src/components/Toolbar/Toolbar.tsx +40 -10
- package/src/components/Tooltip/Tooltip.stories.tsx +13 -2
- package/src/components/Tooltip/Tooltip.tsx +17 -13
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useSafeArea.ts +25 -0
- package/src/hooks/useSafeCollisionPadding.ts +39 -0
- package/src/hooks/useVisualViewport.ts +11 -12
- package/src/util/ThemedClassName.ts +1 -1
|
@@ -1,21 +1,27 @@
|
|
|
1
|
+
import type { ToggleGroupItemProps as ToggleGroupItemPrimitiveProps } from '@radix-ui/react-toggle-group';
|
|
1
2
|
import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { type ThemedClassName } from '../../util';
|
|
4
|
-
import { type ButtonGroupProps, type ButtonProps, type ToggleGroupItemProps, type ToggleProps } from '../Buttons';
|
|
5
|
+
import { type ButtonGroupProps, type ButtonProps, type ToggleGroupItemProps, type ToggleProps, type IconButtonProps } from '../Buttons';
|
|
5
6
|
import { type LinkProps } from '../Link';
|
|
6
7
|
import { type SeparatorProps } from '../Separator';
|
|
7
8
|
type ToolbarRootProps = ThemedClassName<ToolbarPrimitive.ToolbarProps>;
|
|
8
9
|
type ToolbarButtonProps = ButtonProps;
|
|
10
|
+
type ToolbarIconButtonProps = IconButtonProps;
|
|
9
11
|
type ToolbarToggleProps = ToggleProps;
|
|
10
12
|
type ToolbarLinkProps = LinkProps;
|
|
11
13
|
type ToolbarToggleGroupProps = (Omit<ToolbarPrimitive.ToolbarToggleGroupSingleProps, 'className'> | Omit<ToolbarPrimitive.ToolbarToggleGroupMultipleProps, 'className'>) & ButtonGroupProps;
|
|
12
14
|
type ToolbarToggleGroupItemProps = ToggleGroupItemProps;
|
|
13
|
-
type
|
|
15
|
+
type ToolbarToggleGroupIconItemProps = Omit<ToggleGroupItemPrimitiveProps, 'className'> & IconButtonProps;
|
|
16
|
+
type ToolbarSeparatorProps = SeparatorProps & {
|
|
17
|
+
variant?: 'gap' | 'line';
|
|
18
|
+
};
|
|
14
19
|
export declare const Toolbar: {
|
|
15
20
|
Root: React.ForwardRefExoticComponent<Omit<ToolbarPrimitive.ToolbarProps, "className"> & {
|
|
16
|
-
classNames?: import("
|
|
21
|
+
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
|
17
22
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
18
23
|
Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
24
|
+
IconButton: React.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
19
25
|
Link: React.ForwardRefExoticComponent<Omit<LinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
20
26
|
Toggle: React.ForwardRefExoticComponent<Omit<ToggleProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
21
27
|
ToggleGroup: React.ForwardRefExoticComponent<(Omit<Omit<ToolbarPrimitive.ToolbarToggleGroupSingleProps, "className"> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
@@ -23,23 +29,27 @@ export declare const Toolbar: {
|
|
|
23
29
|
} & {
|
|
24
30
|
asChild?: boolean;
|
|
25
31
|
}, "className"> & {
|
|
26
|
-
classNames?: import("
|
|
32
|
+
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
|
27
33
|
} & {
|
|
28
|
-
elevation?: import("
|
|
34
|
+
elevation?: import("@dxos/react-ui-types").Elevation;
|
|
29
35
|
asChild?: boolean;
|
|
30
36
|
}, "ref"> | Omit<Omit<ToolbarPrimitive.ToolbarToggleGroupMultipleProps, "className"> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
31
37
|
ref?: ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
32
38
|
} & {
|
|
33
39
|
asChild?: boolean;
|
|
34
40
|
}, "className"> & {
|
|
35
|
-
classNames?: import("
|
|
41
|
+
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
|
36
42
|
} & {
|
|
37
|
-
elevation?: import("
|
|
43
|
+
elevation?: import("@dxos/react-ui-types").Elevation;
|
|
38
44
|
asChild?: boolean;
|
|
39
45
|
}, "ref">) & React.RefAttributes<HTMLDivElement>>;
|
|
40
46
|
ToggleGroupItem: React.ForwardRefExoticComponent<Omit<ToggleGroupItemProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
ToggleGroupIconItem: React.ForwardRefExoticComponent<Omit<ToolbarToggleGroupIconItemProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
48
|
+
Separator: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-separator").SeparatorProps, "className"> & {
|
|
49
|
+
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
|
50
|
+
} & {
|
|
51
|
+
variant?: "gap" | "line";
|
|
52
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
43
53
|
};
|
|
44
|
-
export type { ToolbarRootProps, ToolbarButtonProps, ToolbarLinkProps, ToolbarToggleProps, ToolbarToggleGroupProps, ToolbarToggleGroupItemProps, ToolbarSeparatorProps, };
|
|
54
|
+
export type { ToolbarRootProps, ToolbarButtonProps, ToolbarIconButtonProps, ToolbarLinkProps, ToolbarToggleProps, ToolbarToggleGroupProps, ToolbarToggleGroupItemProps, ToolbarToggleGroupIconItemProps, ToolbarSeparatorProps, };
|
|
45
55
|
//# sourceMappingURL=Toolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toolbar/Toolbar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAEhB,KAAK,oBAAoB,EACzB,KAAK,WAAW,
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toolbar/Toolbar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,IAAI,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAC1G,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAEhB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAEhB,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9D,KAAK,gBAAgB,GAAG,eAAe,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;AAWvE,KAAK,kBAAkB,GAAG,WAAW,CAAC;AAUtC,KAAK,sBAAsB,GAAG,eAAe,CAAC;AAU9C,KAAK,kBAAkB,GAAG,WAAW,CAAC;AAUtC,KAAK,gBAAgB,GAAG,SAAS,CAAC;AAUlC,KAAK,uBAAuB,GAAG,CAC3B,IAAI,CAAC,gBAAgB,CAAC,6BAA6B,EAAE,WAAW,CAAC,GACjE,IAAI,CAAC,gBAAgB,CAAC,+BAA+B,EAAE,WAAW,CAAC,CACtE,GACC,gBAAgB,CAAC;AAYnB,KAAK,2BAA2B,GAAG,oBAAoB,CAAC;AAYxD,KAAK,+BAA+B,GAAG,IAAI,CAAC,6BAA6B,EAAE,WAAW,CAAC,GAAG,eAAe,CAAC;AAY1G,KAAK,qBAAqB,GAAG,cAAc,GAAG;IAAE,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CAAE,CAAC;AAc3E,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAdsC,KAAK,GAAG,MAAM;;CAwBvE,CAAC;AAEF,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,2BAA2B,EAC3B,+BAA+B,EAC/B,qBAAqB,GACtB,CAAC"}
|
|
@@ -5,36 +5,41 @@ declare const _default: {
|
|
|
5
5
|
title: string;
|
|
6
6
|
component: {
|
|
7
7
|
Root: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-toolbar").ToolbarProps, "className"> & {
|
|
8
|
-
classNames?: import("
|
|
8
|
+
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
|
9
9
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
-
Button: React.ForwardRefExoticComponent<Omit<import("
|
|
10
|
+
Button: React.ForwardRefExoticComponent<Omit<import("..").ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
IconButton: React.ForwardRefExoticComponent<Omit<import("..").IconButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
11
12
|
Link: React.ForwardRefExoticComponent<Omit<import("..").LinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
12
|
-
Toggle: React.ForwardRefExoticComponent<Omit<import("
|
|
13
|
+
Toggle: React.ForwardRefExoticComponent<Omit<import("..").ToggleProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
13
14
|
ToggleGroup: React.ForwardRefExoticComponent<(Omit<Omit<import("@radix-ui/react-toolbar").ToolbarToggleGroupSingleProps, "className"> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
14
15
|
ref?: ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
15
16
|
} & {
|
|
16
17
|
asChild?: boolean;
|
|
17
18
|
}, "className"> & {
|
|
18
|
-
classNames?: import("
|
|
19
|
+
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
|
19
20
|
} & {
|
|
20
|
-
elevation?: import("
|
|
21
|
+
elevation?: import("@dxos/react-ui-types").Elevation;
|
|
21
22
|
asChild?: boolean;
|
|
22
23
|
}, "ref"> | Omit<Omit<import("@radix-ui/react-toolbar").ToolbarToggleGroupMultipleProps, "className"> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
23
24
|
ref?: ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
24
25
|
} & {
|
|
25
26
|
asChild?: boolean;
|
|
26
27
|
}, "className"> & {
|
|
27
|
-
classNames?: import("
|
|
28
|
+
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
|
28
29
|
} & {
|
|
29
|
-
elevation?: import("
|
|
30
|
+
elevation?: import("@dxos/react-ui-types").Elevation;
|
|
30
31
|
asChild?: boolean;
|
|
31
32
|
}, "ref">) & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
-
ToggleGroupItem: React.ForwardRefExoticComponent<Omit<import("
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
ToggleGroupItem: React.ForwardRefExoticComponent<Omit<import("..").ToggleGroupItemProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
34
|
+
ToggleGroupIconItem: React.ForwardRefExoticComponent<Omit<import("./Toolbar").ToolbarToggleGroupIconItemProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
35
|
+
Separator: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-separator").SeparatorProps, "className"> & {
|
|
36
|
+
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
|
37
|
+
} & {
|
|
38
|
+
variant?: "gap" | "line";
|
|
39
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
35
40
|
};
|
|
36
|
-
render: (props: StorybookToolbarProps) =>
|
|
37
|
-
decorators: import("@storybook/react
|
|
41
|
+
render: (props: StorybookToolbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
decorators: import("@storybook/react").Decorator[];
|
|
38
43
|
parameters: {
|
|
39
44
|
chromatic: {
|
|
40
45
|
disableSnapshot: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toolbar/Toolbar.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,KAAK,qBAAqB,GAAG,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"Toolbar.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toolbar/Toolbar.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,KAAK,qBAAqB,GAAG,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAEC,qBAAqB;;;;;;;;AAuDtD,wBAME;AAEF,eAAO,MAAM,OAAO;;CAEnB,CAAC"}
|
|
@@ -13,10 +13,10 @@ export declare const Tooltip: {
|
|
|
13
13
|
Portal: React.FC<TooltipPortalPrimitiveProps>;
|
|
14
14
|
Trigger: React.ForwardRefExoticComponent<TooltipTriggerPrimitiveProps & React.RefAttributes<HTMLButtonElement>>;
|
|
15
15
|
Arrow: React.ForwardRefExoticComponent<Omit<TooltipArrowPrimitiveProps, "className"> & {
|
|
16
|
-
classNames?: import("
|
|
16
|
+
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
|
17
17
|
} & React.RefAttributes<SVGSVGElement>>;
|
|
18
18
|
Content: React.ForwardRefExoticComponent<Omit<TooltipContentPrimitiveProps, "className"> & {
|
|
19
|
-
classNames?: import("
|
|
19
|
+
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
|
20
20
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
21
21
|
};
|
|
22
22
|
export type { TooltipProviderProps, TooltipRootProps, TooltipPortalProps, TooltipTriggerProps, TooltipArrowProps, TooltipContentProps, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,oBAAoB,IAAI,6BAA6B,EAE1D,KAAK,YAAY,IAAI,yBAAyB,EAC9C,KAAK,mBAAmB,IAAI,4BAA4B,EAExD,KAAK,mBAAmB,IAAI,4BAA4B,EAExD,KAAK,kBAAkB,IAAI,2BAA2B,EAEtD,KAAK,iBAAiB,IAAI,0BAA0B,EAErD,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAA6C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,oBAAoB,IAAI,6BAA6B,EAE1D,KAAK,YAAY,IAAI,yBAAyB,EAC9C,KAAK,mBAAmB,IAAI,4BAA4B,EAExD,KAAK,mBAAmB,IAAI,4BAA4B,EAExD,KAAK,kBAAkB,IAAI,2BAA2B,EAEtD,KAAK,iBAAiB,IAAI,0BAA0B,EAErD,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAA6C,MAAM,OAAO,CAAC;AAIlE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,KAAK,oBAAoB,GAAG,6BAA6B,CAAC;AAI1D,KAAK,gBAAgB,GAAG,yBAAyB,CAAC;AAIlD,KAAK,kBAAkB,GAAG,2BAA2B,CAAC;AAItD,KAAK,mBAAmB,GAAG,4BAA4B,CAAC;AAIxD,KAAK,iBAAiB,GAAG,eAAe,CAAC,0BAA0B,CAAC,CAAC;AAarE,KAAK,mBAAmB,GAAG,eAAe,CAAC,4BAA4B,CAAC,CAAC;AAmBzE,eAAO,MAAM,OAAO;;;;;;;;;;;CAOnB,CAAC;AAEF,YAAY,EACV,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,CAAC"}
|
|
@@ -2,6 +2,7 @@ import '@dxos-theme';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
type StoryTooltipProps = {
|
|
4
4
|
content: string;
|
|
5
|
+
defaultOpen?: boolean;
|
|
5
6
|
};
|
|
6
7
|
declare const _default: {
|
|
7
8
|
title: string;
|
|
@@ -11,14 +12,14 @@ declare const _default: {
|
|
|
11
12
|
Portal: React.FC<import("@radix-ui/react-tooltip").TooltipPortalProps>;
|
|
12
13
|
Trigger: React.ForwardRefExoticComponent<import("@radix-ui/react-tooltip").TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
13
14
|
Arrow: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-tooltip").TooltipArrowProps, "className"> & {
|
|
14
|
-
classNames?: import("
|
|
15
|
+
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
|
15
16
|
} & React.RefAttributes<SVGSVGElement>>;
|
|
16
17
|
Content: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-tooltip").TooltipContentProps, "className"> & {
|
|
17
|
-
classNames?: import("
|
|
18
|
+
classNames?: import("@dxos/react-ui-types").ClassNameValue;
|
|
18
19
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
19
20
|
};
|
|
20
|
-
render: ({ content }: StoryTooltipProps) =>
|
|
21
|
-
decorators: import("@storybook/react
|
|
21
|
+
render: ({ content, defaultOpen }: StoryTooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
decorators: import("@storybook/react").Decorator[];
|
|
22
23
|
parameters: {
|
|
23
24
|
chromatic: {
|
|
24
25
|
disableSnapshot: boolean;
|
|
@@ -36,4 +37,15 @@ export declare const Default: {
|
|
|
36
37
|
};
|
|
37
38
|
};
|
|
38
39
|
};
|
|
40
|
+
export declare const Testing: {
|
|
41
|
+
args: {
|
|
42
|
+
defaultOption: boolean;
|
|
43
|
+
content: string;
|
|
44
|
+
};
|
|
45
|
+
parameters: {
|
|
46
|
+
chromatic: {
|
|
47
|
+
delay: number;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
39
51
|
//# sourceMappingURL=Tooltip.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tooltip/Tooltip.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Tooltip.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tooltip/Tooltip.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;;;;;;;;;;;;;;;uCAE8C,iBAAiB;;;;;;;;AAcjE,wBAME;AAEF,eAAO,MAAM,OAAO;;;;;;;;;CAOnB,CAAC;AAEF,eAAO,MAAM,OAAO;;;;;;;;;;CAQnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type SafeAreaPadding = Record<'top' | 'right' | 'bottom' | 'left', number>;
|
|
2
|
+
export declare const initialSafeArea: {
|
|
3
|
+
top: number;
|
|
4
|
+
right: number;
|
|
5
|
+
bottom: number;
|
|
6
|
+
left: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const useSafeArea: () => SafeAreaPadding;
|
|
9
|
+
//# sourceMappingURL=useSafeArea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSafeArea.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useSafeArea.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC;AAElF,eAAO,MAAM,eAAe;;;;;CAAmD,CAAC;AAEhF,eAAO,MAAM,WAAW,QAAO,eAY9B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type TooltipContentProps } from '@radix-ui/react-tooltip';
|
|
2
|
+
type PaddingProp = TooltipContentProps['collisionPadding'];
|
|
3
|
+
export declare const useSafeCollisionPadding: (collisionPadding?: PaddingProp) => {
|
|
4
|
+
top: number;
|
|
5
|
+
right: number;
|
|
6
|
+
bottom: number;
|
|
7
|
+
left: number;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=useSafeCollisionPadding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSafeCollisionPadding.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useSafeCollisionPadding.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAMnE,KAAK,WAAW,GAAG,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;AAiB3D,eAAO,MAAM,uBAAuB,sBAAuB,WAAW;;;;;CAWrE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const useThemeContext: () => import("
|
|
1
|
+
export declare const useThemeContext: () => import("..").ThemeContextValue;
|
|
2
2
|
//# sourceMappingURL=useThemeContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThemeContext.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useThemeContext.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"useThemeContext.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useThemeContext.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,eAAe,sCAA6E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVisualViewport.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useVisualViewport.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"useVisualViewport.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useVisualViewport.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAI9D,eAAO,MAAM,iBAAiB,UAAW,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;;;CAcvE,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import '@dxos-theme';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
export declare const Default: {};
|
|
4
3
|
declare const _default: {
|
|
5
4
|
title: string;
|
|
6
|
-
render: () =>
|
|
7
|
-
decorators: import("@storybook/react
|
|
5
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
decorators: import("@storybook/react").Decorator[];
|
|
8
7
|
parameters: {
|
|
9
8
|
chromatic: {
|
|
10
9
|
disableSnapshot: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Controls.stories.d.ts","sourceRoot":"","sources":["../../../../src/playground/Controls.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Controls.stories.d.ts","sourceRoot":"","sources":["../../../../src/playground/Controls.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AA+ErB,eAAO,MAAM,OAAO,IAAK,CAAC;;;;;;;;;;;AAE1B,wBAKE"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import '@dxos-theme';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
declare const _default: {
|
|
4
3
|
title: string;
|
|
5
|
-
render: () =>
|
|
6
|
-
decorators: import("@storybook/react
|
|
4
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
decorators: import("@storybook/react").Decorator[];
|
|
7
6
|
parameters: {
|
|
8
7
|
chromatic: {
|
|
9
8
|
disableSnapshot: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.stories.d.ts","sourceRoot":"","sources":["../../../../src/playground/Typography.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC
|
|
1
|
+
{"version":3,"file":"Typography.stories.d.ts","sourceRoot":"","sources":["../../../../src/playground/Typography.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;;;;;;;;;;;AAyCrB,wBAKE;AAEF,eAAO,MAAM,OAAO;;CAEnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemedClassName.d.ts","sourceRoot":"","sources":["../../../../src/util/ThemedClassName.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG;IAAE,UAAU,CAAC,EAAE,cAAc,CAAA;CAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"ThemedClassName.d.ts","sourceRoot":"","sources":["../../../../src/util/ThemedClassName.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG;IAAE,UAAU,CAAC,EAAE,cAAc,CAAA;CAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.7.
|
|
1
|
+
{"version":"5.7.3"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui",
|
|
3
|
-
"version": "0.7.5-main.
|
|
3
|
+
"version": "0.7.5-main.b19bfc8",
|
|
4
4
|
"description": "Low-level React components for DXOS, applying a theme to a core group of primitives",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "DXOS.org",
|
|
9
9
|
"sideEffects": true,
|
|
10
|
+
"type": "module",
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
12
13
|
"types": "./dist/types/src/index.d.ts",
|
|
@@ -24,49 +25,49 @@
|
|
|
24
25
|
],
|
|
25
26
|
"dependencies": {
|
|
26
27
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.3",
|
|
27
|
-
"@fluentui/react-tabster": "
|
|
28
|
-
"@radix-ui/primitive": "
|
|
29
|
-
"@radix-ui/react-alert-dialog": "
|
|
30
|
-
"@radix-ui/react-avatar": "
|
|
31
|
-
"@radix-ui/react-checkbox": "
|
|
32
|
-
"@radix-ui/react-collapsible": "
|
|
33
|
-
"@radix-ui/react-compose-refs": "
|
|
34
|
-
"@radix-ui/react-context": "
|
|
35
|
-
"@radix-ui/react-context-menu": "
|
|
36
|
-
"@radix-ui/react-dialog": "
|
|
37
|
-
"@radix-ui/react-dismissable-layer": "
|
|
38
|
-
"@radix-ui/react-focus-guards": "
|
|
39
|
-
"@radix-ui/react-focus-scope": "
|
|
40
|
-
"@radix-ui/react-id": "
|
|
41
|
-
"@radix-ui/react-menu": "
|
|
42
|
-
"@radix-ui/react-popper": "
|
|
43
|
-
"@radix-ui/react-portal": "
|
|
44
|
-
"@radix-ui/react-presence": "
|
|
45
|
-
"@radix-ui/react-primitive": "
|
|
46
|
-
"@radix-ui/react-scroll-area": "
|
|
47
|
-
"@radix-ui/react-select": "
|
|
48
|
-
"@radix-ui/react-separator": "
|
|
49
|
-
"@radix-ui/react-slot": "
|
|
50
|
-
"@radix-ui/react-switch": "
|
|
51
|
-
"@radix-ui/react-toast": "
|
|
52
|
-
"@radix-ui/react-toggle": "
|
|
53
|
-
"@radix-ui/react-toggle-group": "
|
|
54
|
-
"@radix-ui/react-toolbar": "
|
|
55
|
-
"@radix-ui/react-tooltip": "
|
|
56
|
-
"@radix-ui/react-use-controllable-state": "
|
|
28
|
+
"@fluentui/react-tabster": "9.23.3",
|
|
29
|
+
"@radix-ui/primitive": "1.1.1",
|
|
30
|
+
"@radix-ui/react-alert-dialog": "1.1.6",
|
|
31
|
+
"@radix-ui/react-avatar": "1.1.3",
|
|
32
|
+
"@radix-ui/react-checkbox": "1.1.4",
|
|
33
|
+
"@radix-ui/react-collapsible": "1.1.3",
|
|
34
|
+
"@radix-ui/react-compose-refs": "1.1.1",
|
|
35
|
+
"@radix-ui/react-context": "1.1.1",
|
|
36
|
+
"@radix-ui/react-context-menu": "2.2.6",
|
|
37
|
+
"@radix-ui/react-dialog": "1.1.6",
|
|
38
|
+
"@radix-ui/react-dismissable-layer": "1.1.5",
|
|
39
|
+
"@radix-ui/react-focus-guards": "1.1.1",
|
|
40
|
+
"@radix-ui/react-focus-scope": "1.1.2",
|
|
41
|
+
"@radix-ui/react-id": "1.1.0",
|
|
42
|
+
"@radix-ui/react-menu": "2.1.6",
|
|
43
|
+
"@radix-ui/react-popper": "1.2.2",
|
|
44
|
+
"@radix-ui/react-portal": "1.1.4",
|
|
45
|
+
"@radix-ui/react-presence": "1.1.2",
|
|
46
|
+
"@radix-ui/react-primitive": "2.0.2",
|
|
47
|
+
"@radix-ui/react-scroll-area": "1.2.3",
|
|
48
|
+
"@radix-ui/react-select": "2.1.6",
|
|
49
|
+
"@radix-ui/react-separator": "1.1.2",
|
|
50
|
+
"@radix-ui/react-slot": "1.1.2",
|
|
51
|
+
"@radix-ui/react-switch": "1.1.3",
|
|
52
|
+
"@radix-ui/react-toast": "1.2.6",
|
|
53
|
+
"@radix-ui/react-toggle": "1.1.2",
|
|
54
|
+
"@radix-ui/react-toggle-group": "1.1.2",
|
|
55
|
+
"@radix-ui/react-toolbar": "1.1.2",
|
|
56
|
+
"@radix-ui/react-tooltip": "1.1.8",
|
|
57
|
+
"@radix-ui/react-use-controllable-state": "1.1.0",
|
|
57
58
|
"aria-hidden": "^1.2.4",
|
|
58
59
|
"date-fns": "^3.3.1",
|
|
59
60
|
"i18next": "^21.10.0",
|
|
60
61
|
"keyborg": "^2.5.0",
|
|
61
62
|
"react-i18next": "^11.18.6",
|
|
62
63
|
"react-remove-scroll": "^2.6.0",
|
|
63
|
-
"@dxos/debug": "0.7.5-main.
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/react-
|
|
67
|
-
"@dxos/react-
|
|
68
|
-
"@dxos/react-ui-types": "0.7.5-main.
|
|
69
|
-
"@dxos/util": "0.7.5-main.
|
|
64
|
+
"@dxos/debug": "0.7.5-main.b19bfc8",
|
|
65
|
+
"@dxos/react-input": "0.7.5-main.b19bfc8",
|
|
66
|
+
"@dxos/log": "0.7.5-main.b19bfc8",
|
|
67
|
+
"@dxos/react-list": "0.7.5-main.b19bfc8",
|
|
68
|
+
"@dxos/react-hooks": "0.7.5-main.b19bfc8",
|
|
69
|
+
"@dxos/react-ui-types": "0.7.5-main.b19bfc8",
|
|
70
|
+
"@dxos/util": "0.7.5-main.b19bfc8"
|
|
70
71
|
},
|
|
71
72
|
"devDependencies": {
|
|
72
73
|
"@dnd-kit/core": "^6.0.5",
|
|
@@ -78,15 +79,15 @@
|
|
|
78
79
|
"react": "~18.2.0",
|
|
79
80
|
"react-dom": "~18.2.0",
|
|
80
81
|
"vite": "5.4.7",
|
|
81
|
-
"@dxos/random": "0.7.5-main.
|
|
82
|
-
"@dxos/react-ui-theme": "0.7.5-main.
|
|
83
|
-
"@dxos/util": "0.7.5-main.
|
|
82
|
+
"@dxos/random": "0.7.5-main.b19bfc8",
|
|
83
|
+
"@dxos/react-ui-theme": "0.7.5-main.b19bfc8",
|
|
84
|
+
"@dxos/util": "0.7.5-main.b19bfc8"
|
|
84
85
|
},
|
|
85
86
|
"peerDependencies": {
|
|
86
87
|
"@phosphor-icons/react": "^2.1.5",
|
|
87
88
|
"react": "~18.2.0",
|
|
88
89
|
"react-dom": "~18.2.0",
|
|
89
|
-
"@dxos/react-ui-theme": "0.7.5-main.
|
|
90
|
+
"@dxos/react-ui-theme": "0.7.5-main.b19bfc8"
|
|
90
91
|
},
|
|
91
92
|
"publishConfig": {
|
|
92
93
|
"access": "public"
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import {
|
|
6
6
|
Root as AvatarRootPrimitive,
|
|
7
7
|
type AvatarProps as AvatarRootPrimitiveProps,
|
|
8
|
-
type ImageLoadingStatus,
|
|
9
8
|
Fallback as AvatarFallbackPrimitive,
|
|
9
|
+
type AvatarImageProps as AvatarImagePrimitiveProps,
|
|
10
10
|
} from '@radix-ui/react-avatar';
|
|
11
11
|
import { createContext } from '@radix-ui/react-context';
|
|
12
12
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
@@ -112,15 +112,10 @@ const AvatarFrame = forwardRef<HTMLSpanElement, AvatarFrameProps>(
|
|
|
112
112
|
</mask>
|
|
113
113
|
</defs>
|
|
114
114
|
{variant === 'circle' ? (
|
|
115
|
-
<circle
|
|
116
|
-
className={hue ? tx('hue.fill', 'avatar__frame__circle', { hue }) : 'fill-[var(--surface-bg)]'}
|
|
117
|
-
cx='50%'
|
|
118
|
-
cy='50%'
|
|
119
|
-
r={r}
|
|
120
|
-
/>
|
|
115
|
+
<circle cx='50%' cy='50%' r={r} fill={hue ? `var(--dx-${hue}Fill)` : 'var(--surface-bg)'} />
|
|
121
116
|
) : (
|
|
122
117
|
<rect
|
|
123
|
-
|
|
118
|
+
fill={hue ? `var(--dx-${hue}Fill)` : 'var(--surface-bg)'}
|
|
124
119
|
x={ringGap + ringWidth}
|
|
125
120
|
y={ringGap + ringWidth}
|
|
126
121
|
width={2 * r}
|
|
@@ -243,9 +238,7 @@ const AvatarMaskedText = (props: AvatarMaskedTextProps) => {
|
|
|
243
238
|
);
|
|
244
239
|
};
|
|
245
240
|
|
|
246
|
-
type AvatarImageProps = ComponentPropsWithRef<'image'> &
|
|
247
|
-
onLoadingStatusChange?: (status: ImageLoadingStatus) => void;
|
|
248
|
-
};
|
|
241
|
+
type AvatarImageProps = ComponentPropsWithRef<'image'> & Pick<AvatarImagePrimitiveProps, 'onLoadingStatusChange'>;
|
|
249
242
|
|
|
250
243
|
const AvatarImage = forwardRef<SVGImageElement, AvatarImageProps>(
|
|
251
244
|
({ onLoadingStatusChange, ...props }, forwardedRef) => {
|
|
@@ -264,8 +257,7 @@ const AvatarImage = forwardRef<SVGImageElement, AvatarImageProps>(
|
|
|
264
257
|
|
|
265
258
|
type AvatarIconProps = {
|
|
266
259
|
icon: string;
|
|
267
|
-
|
|
268
|
-
};
|
|
260
|
+
} & Pick<AvatarImagePrimitiveProps, 'onLoadingStatusChange'>;
|
|
269
261
|
|
|
270
262
|
const AvatarIcon = forwardRef<SVGSVGElement, AvatarIconProps>(({ onLoadingStatusChange, ...props }, forwardedRef) => {
|
|
271
263
|
const { size } = useAvatarContext('AvatarIcon');
|
|
@@ -2,34 +2,55 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { forwardRef } from 'react';
|
|
5
|
+
import React, { forwardRef, type ReactNode, type MutableRefObject, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Button, type ButtonProps } from './Button';
|
|
8
8
|
import { useThemeContext } from '../../hooks';
|
|
9
9
|
import { type ThemedClassName } from '../../util';
|
|
10
10
|
import { Icon, type IconProps } from '../Icon';
|
|
11
|
-
import { Tooltip } from '../Tooltip';
|
|
11
|
+
import { Tooltip, type TooltipContentProps } from '../Tooltip';
|
|
12
12
|
|
|
13
13
|
type IconButtonProps = Omit<ButtonProps, 'children'> &
|
|
14
14
|
Pick<IconProps, 'icon' | 'size'> & {
|
|
15
|
-
label:
|
|
15
|
+
label: NonNullable<ReactNode>;
|
|
16
16
|
iconOnly?: boolean;
|
|
17
|
+
noTooltip?: boolean;
|
|
18
|
+
caretDown?: boolean;
|
|
17
19
|
// TODO(burdon): Create slots abstraction?
|
|
18
20
|
iconClassNames?: ThemedClassName<any>['classNames'];
|
|
19
21
|
tooltipPortal?: boolean;
|
|
20
22
|
tooltipZIndex?: string;
|
|
23
|
+
tooltipSide?: TooltipContentProps['side'];
|
|
24
|
+
suppressNextTooltip?: MutableRefObject<boolean>;
|
|
21
25
|
};
|
|
22
26
|
|
|
23
27
|
const IconOnlyButton = forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
24
|
-
(
|
|
28
|
+
(
|
|
29
|
+
{ noTooltip, tooltipPortal = true, tooltipZIndex: zIndex, tooltipSide, suppressNextTooltip, ...props },
|
|
30
|
+
forwardedRef,
|
|
31
|
+
) => {
|
|
32
|
+
const [triggerTooltipOpen, setTriggerTooltipOpen] = useState(false);
|
|
33
|
+
if (noTooltip) {
|
|
34
|
+
return <LabelledIconButton {...props} ref={forwardedRef} />;
|
|
35
|
+
}
|
|
25
36
|
const content = (
|
|
26
|
-
<Tooltip.Content {...(zIndex && { style: { zIndex } })}>
|
|
37
|
+
<Tooltip.Content {...(zIndex && { style: { zIndex } })} side={tooltipSide}>
|
|
27
38
|
{props.label}
|
|
28
39
|
<Tooltip.Arrow />
|
|
29
40
|
</Tooltip.Content>
|
|
30
41
|
);
|
|
31
42
|
return (
|
|
32
|
-
<Tooltip.Root
|
|
43
|
+
<Tooltip.Root
|
|
44
|
+
open={triggerTooltipOpen}
|
|
45
|
+
onOpenChange={(nextOpen) => {
|
|
46
|
+
if (suppressNextTooltip?.current) {
|
|
47
|
+
setTriggerTooltipOpen(false);
|
|
48
|
+
suppressNextTooltip.current = false;
|
|
49
|
+
} else {
|
|
50
|
+
setTriggerTooltipOpen(nextOpen);
|
|
51
|
+
}
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
33
54
|
<Tooltip.Trigger asChild>
|
|
34
55
|
<LabelledIconButton {...props} ref={forwardedRef} />
|
|
35
56
|
</Tooltip.Trigger>
|
|
@@ -40,12 +61,16 @@ const IconOnlyButton = forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
|
40
61
|
);
|
|
41
62
|
|
|
42
63
|
const LabelledIconButton = forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
43
|
-
(
|
|
64
|
+
(
|
|
65
|
+
{ icon, size, iconOnly, label, classNames, iconClassNames, caretDown, suppressNextTooltip, ...props },
|
|
66
|
+
forwardedRef,
|
|
67
|
+
) => {
|
|
44
68
|
const { tx } = useThemeContext();
|
|
45
69
|
return (
|
|
46
70
|
<Button {...props} classNames={tx('iconButton.root', 'iconButton', {}, classNames)} ref={forwardedRef}>
|
|
47
71
|
<Icon icon={icon} size={size} classNames={iconClassNames} />
|
|
48
72
|
<span className={iconOnly ? 'sr-only' : undefined}>{label}</span>
|
|
73
|
+
{caretDown && <Icon size={3} icon='ph--caret-down--bold' />}
|
|
49
74
|
</Button>
|
|
50
75
|
);
|
|
51
76
|
},
|
|
@@ -44,11 +44,15 @@ export const CopyButton = ({ value, classNames, iconProps, ...props }: CopyButto
|
|
|
44
44
|
);
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
type CopyButtonIconOnlyProps = CopyButtonProps & {
|
|
48
|
+
label?: string;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const CopyButtonIconOnly = ({ value, classNames, iconProps, variant, ...props }: CopyButtonIconOnlyProps) => {
|
|
48
52
|
const { t } = useTranslation('os');
|
|
49
53
|
const { textValue, setTextValue } = useClipboard();
|
|
50
54
|
const isCopied = textValue === value;
|
|
51
|
-
const label = isCopied ? t('copy success label') : t('copy label');
|
|
55
|
+
const label = isCopied ? t('copy success label') : props.label ?? t('copy label');
|
|
52
56
|
const [open, setOpen] = useState(false);
|
|
53
57
|
return (
|
|
54
58
|
<Tooltip.Root delayDuration={1500} open={open} onOpenChange={setOpen}>
|