@dxos/react-ui 0.6.14-main.7bd9c89 → 0.6.14-main.f49f251

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.
Files changed (92) hide show
  1. package/dist/lib/browser/index.mjs +697 -169
  2. package/dist/lib/browser/index.mjs.map +3 -3
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node/index.cjs +670 -140
  5. package/dist/lib/node/index.cjs.map +3 -3
  6. package/dist/lib/node/meta.json +1 -1
  7. package/dist/lib/node-esm/index.mjs +697 -169
  8. package/dist/lib/node-esm/index.mjs.map +3 -3
  9. package/dist/lib/node-esm/meta.json +1 -1
  10. package/dist/types/src/components/Avatars/Avatar.stories.d.ts +15 -1
  11. package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
  12. package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts +6 -1
  13. package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts.map +1 -1
  14. package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts +9 -1
  15. package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts.map +1 -1
  16. package/dist/types/src/components/Buttons/Button.d.ts +1 -1
  17. package/dist/types/src/components/Buttons/Button.d.ts.map +1 -1
  18. package/dist/types/src/components/Buttons/Button.stories.d.ts +1 -1
  19. package/dist/types/src/components/Buttons/Toggle.stories.d.ts +2 -1
  20. package/dist/types/src/components/Buttons/Toggle.stories.d.ts.map +1 -1
  21. package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts +20 -1
  22. package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts.map +1 -1
  23. package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts +12 -1
  24. package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts.map +1 -1
  25. package/dist/types/src/components/Dialogs/Dialog.stories.d.ts +11 -1
  26. package/dist/types/src/components/Dialogs/Dialog.stories.d.ts.map +1 -1
  27. package/dist/types/src/components/Icon/Icon.d.ts +1 -1
  28. package/dist/types/src/components/Icon/Icon.d.ts.map +1 -1
  29. package/dist/types/src/components/Input/Input.stories.d.ts +16 -1
  30. package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
  31. package/dist/types/src/components/Lists/List.stories.d.ts +2 -3
  32. package/dist/types/src/components/Lists/List.stories.d.ts.map +1 -1
  33. package/dist/types/src/components/Lists/Tree.stories.d.ts +5 -1
  34. package/dist/types/src/components/Lists/Tree.stories.d.ts.map +1 -1
  35. package/dist/types/src/components/Main/Main.stories.d.ts +5 -1
  36. package/dist/types/src/components/Main/Main.stories.d.ts.map +1 -1
  37. package/dist/types/src/components/Menus/ContextMenu.stories.d.ts +29 -1
  38. package/dist/types/src/components/Menus/ContextMenu.stories.d.ts.map +1 -1
  39. package/dist/types/src/components/Menus/DropdownMenu.d.ts +105 -44
  40. package/dist/types/src/components/Menus/DropdownMenu.d.ts.map +1 -1
  41. package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts +29 -1
  42. package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts.map +1 -1
  43. package/dist/types/src/components/Message/Message.stories.d.ts +6 -1
  44. package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
  45. package/dist/types/src/components/Popover/Popover.d.ts +87 -21
  46. package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
  47. package/dist/types/src/components/Popover/Popover.stories.d.ts +20 -1
  48. package/dist/types/src/components/Popover/Popover.stories.d.ts.map +1 -1
  49. package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +20 -1
  50. package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
  51. package/dist/types/src/components/Toast/Toast.stories.d.ts +20 -1
  52. package/dist/types/src/components/Toast/Toast.stories.d.ts.map +1 -1
  53. package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +30 -1
  54. package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
  55. package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +13 -1
  56. package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
  57. package/dist/types/src/playground/Surfaces.stories.d.ts +6 -2
  58. package/dist/types/src/playground/Surfaces.stories.d.ts.map +1 -1
  59. package/dist/types/src/playground/Typography.stories.d.ts +1 -1
  60. package/package.json +25 -19
  61. package/src/components/Avatars/Avatar.stories.tsx +3 -2
  62. package/src/components/Avatars/AvatarGroup.stories.tsx +3 -2
  63. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +3 -2
  64. package/src/components/Buttons/Button.stories.tsx +1 -1
  65. package/src/components/Buttons/Button.tsx +46 -36
  66. package/src/components/Buttons/Toggle.stories.tsx +3 -2
  67. package/src/components/Buttons/ToggleGroup.stories.tsx +3 -2
  68. package/src/components/Dialogs/AlertDialog.stories.tsx +3 -2
  69. package/src/components/Dialogs/Dialog.stories.tsx +3 -2
  70. package/src/components/Icon/Icon.tsx +11 -9
  71. package/src/components/Input/Input.stories.tsx +4 -3
  72. package/src/components/Link/Link.stories.tsx +1 -1
  73. package/src/components/Lists/List.stories.tsx +4 -4
  74. package/src/components/Lists/Tree.stories.tsx +3 -2
  75. package/src/components/Lists/Treegrid.stories.tsx +1 -1
  76. package/src/components/Main/Main.stories.tsx +3 -2
  77. package/src/components/Menus/ContextMenu.stories.tsx +3 -2
  78. package/src/components/Menus/DropdownMenu.stories.tsx +43 -3
  79. package/src/components/Menus/DropdownMenu.tsx +518 -69
  80. package/src/components/Message/Message.stories.tsx +3 -2
  81. package/src/components/Popover/Popover.stories.tsx +27 -3
  82. package/src/components/Popover/Popover.tsx +524 -55
  83. package/src/components/ScrollArea/ScrollArea.stories.tsx +3 -2
  84. package/src/components/Select/Select.stories.tsx +1 -1
  85. package/src/components/Status/Status.stories.tsx +1 -1
  86. package/src/components/Tag/Tag.stories.tsx +1 -1
  87. package/src/components/Toast/Toast.stories.tsx +3 -2
  88. package/src/components/Toolbar/Toolbar.stories.tsx +3 -2
  89. package/src/components/Tooltip/Tooltip.stories.tsx +3 -2
  90. package/src/playground/Controls.stories.tsx +1 -1
  91. package/src/playground/Surfaces.stories.tsx +4 -3
  92. package/src/playground/Typography.stories.tsx +2 -2
@@ -13,7 +13,26 @@ type StorybookToastProps = Partial<{
13
13
  }>;
14
14
  declare const _default: {
15
15
  title: string;
16
- component: (props: StorybookToastProps) => React.JSX.Element;
16
+ component: {
17
+ Provider: React.FunctionComponent<import("@radix-ui/react-toast").ToastProviderProps>;
18
+ Viewport: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-toast").ToastViewportProps, "className"> & {
19
+ classNames?: import("packages/ui/react-ui-types/dist/types/src").ClassNameValue;
20
+ } & React.RefAttributes<HTMLOListElement>>;
21
+ Root: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-toast").ToastProps, "className"> & {
22
+ classNames?: import("packages/ui/react-ui-types/dist/types/src").ClassNameValue;
23
+ } & React.RefAttributes<HTMLLIElement>>;
24
+ Body: React.ForwardRefExoticComponent<Omit<import("./Toast").ToastBodyProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
25
+ Title: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-toast").ToastTitleProps, "className"> & {
26
+ classNames?: import("packages/ui/react-ui-types/dist/types/src").ClassNameValue;
27
+ } & React.RefAttributes<HTMLHeadingElement>>;
28
+ Description: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-toast").ToastDescriptionProps, "className"> & {
29
+ classNames?: import("packages/ui/react-ui-types/dist/types/src").ClassNameValue;
30
+ } & React.RefAttributes<HTMLParagraphElement>>;
31
+ Actions: React.ForwardRefExoticComponent<Omit<import("./Toast").ToastActionsProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
32
+ Action: React.FunctionComponent<import("@radix-ui/react-toast").ToastActionProps>;
33
+ Close: React.FunctionComponent<import("@radix-ui/react-toast").ToastCloseProps>;
34
+ };
35
+ render: (props: StorybookToastProps) => React.JSX.Element;
17
36
  decorators: import("@storybook/react/*").Decorator[];
18
37
  parameters: {
19
38
  chromatic: {
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toast/Toast.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAMxD,KAAK,kBAAkB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,SAAS,CAAA;CAAE,CAAC;AAElE,KAAK,mBAAmB,GAAG,OAAO,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,kBAAkB,EAAE,CAAC;IACrC,YAAY,EAAE,SAAS,CAAC;CACzB,CAAC,CAAC;;;uBAE4B,mBAAmB;;;;;;;;AAwBlD,wBAKE;AAEF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;CAWnB,CAAC"}
1
+ {"version":3,"file":"Toast.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toast/Toast.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAMxD,KAAK,kBAAkB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,SAAS,CAAA;CAAE,CAAC;AAElE,KAAK,mBAAmB,GAAG,OAAO,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,kBAAkB,EAAE,CAAC;IACrC,YAAY,EAAE,SAAS,CAAC;CACzB,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;oBAE4B,mBAAmB;;;;;;;;AAwBlD,wBAME;AAEF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;CAWnB,CAAC"}
@@ -3,7 +3,36 @@ import React from 'react';
3
3
  type StorybookToolbarProps = {};
4
4
  declare const _default: {
5
5
  title: string;
6
- component: (props: StorybookToolbarProps) => React.JSX.Element;
6
+ component: {
7
+ Root: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-toolbar").ToolbarProps, "className"> & {
8
+ classNames?: import("packages/ui/react-ui-types/dist/types/src").ClassNameValue;
9
+ } & React.RefAttributes<HTMLDivElement>>;
10
+ Button: React.ForwardRefExoticComponent<Omit<import("../Buttons").ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
11
+ Link: React.ForwardRefExoticComponent<Omit<import("..").LinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
12
+ Toggle: React.ForwardRefExoticComponent<Omit<import("../Buttons").ToggleProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
13
+ ToggleGroup: React.ForwardRefExoticComponent<(Omit<Omit<import("@radix-ui/react-toolbar").ToolbarToggleGroupSingleProps, "className"> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
14
+ 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
+ asChild?: boolean;
17
+ }, "className"> & {
18
+ classNames?: import("packages/ui/react-ui-types/dist/types/src").ClassNameValue;
19
+ } & {
20
+ elevation?: import("packages/ui/react-ui-types/dist/types/src").Elevation;
21
+ asChild?: boolean;
22
+ }, "ref"> | Omit<Omit<import("@radix-ui/react-toolbar").ToolbarToggleGroupMultipleProps, "className"> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
23
+ 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
+ asChild?: boolean;
26
+ }, "className"> & {
27
+ classNames?: import("packages/ui/react-ui-types/dist/types/src").ClassNameValue;
28
+ } & {
29
+ elevation?: import("packages/ui/react-ui-types/dist/types/src").Elevation;
30
+ asChild?: boolean;
31
+ }, "ref">) & React.RefAttributes<HTMLDivElement>>;
32
+ ToggleGroupItem: React.ForwardRefExoticComponent<Omit<import("../Buttons").ToggleGroupItemProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
33
+ Separator: (props: import("..").SeparatorProps) => React.JSX.Element;
34
+ };
35
+ render: (props: StorybookToolbarProps) => React.JSX.Element;
7
36
  decorators: import("@storybook/react/*").Decorator[];
8
37
  parameters: {
9
38
  chromatic: {
@@ -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;;;uBAEC,qBAAqB;;;;;;;;AAuDtD,wBAKE;AAEF,eAAO,MAAM,OAAO;;CAEnB,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"}
@@ -5,7 +5,19 @@ type StoryTooltipProps = {
5
5
  };
6
6
  declare const _default: {
7
7
  title: string;
8
- component: ({ content }: StoryTooltipProps) => React.JSX.Element;
8
+ component: {
9
+ Provider: React.FunctionComponent<import("@radix-ui/react-tooltip").TooltipProviderProps>;
10
+ Root: React.FunctionComponent<import("@radix-ui/react-tooltip").TooltipProps>;
11
+ Portal: React.FC<import("@radix-ui/react-tooltip").TooltipPortalProps>;
12
+ Trigger: React.ForwardRefExoticComponent<import("@radix-ui/react-tooltip").TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
13
+ Arrow: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-tooltip").TooltipArrowProps, "className"> & {
14
+ classNames?: import("packages/ui/react-ui-types/dist/types/src").ClassNameValue;
15
+ } & React.RefAttributes<SVGSVGElement>>;
16
+ Content: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-tooltip").TooltipContentProps, "className"> & {
17
+ classNames?: import("packages/ui/react-ui-types/dist/types/src").ClassNameValue;
18
+ } & React.RefAttributes<HTMLDivElement>>;
19
+ };
20
+ render: ({ content }: StoryTooltipProps) => React.JSX.Element;
9
21
  decorators: import("@storybook/react/*").Decorator[];
10
22
  parameters: {
11
23
  chromatic: {
@@ -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;CACjB,CAAC;;;6BAEiC,iBAAiB;;;;;;;;AAcpD,wBAKE;AAEF,eAAO,MAAM,OAAO;;;;;;;;;CAOnB,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;CACjB,CAAC;;;;;;;;;;;;;;;0BAEiC,iBAAiB;;;;;;;;AAcpD,wBAME;AAEF,eAAO,MAAM,OAAO;;;;;;;;;CAOnB,CAAC"}
@@ -1,8 +1,12 @@
1
1
  import '@dxos-theme';
2
- import React from 'react';
2
+ import React, { type PropsWithChildren } from 'react';
3
+ type SurfaceLevel = 'base' | 'group' | 'chrome' | 'fixed' | 'input' | 'accent';
3
4
  declare const _default: {
4
5
  title: string;
5
- component: () => React.JSX.Element;
6
+ component: ({ children, level }: PropsWithChildren & {
7
+ level: SurfaceLevel;
8
+ }) => React.JSX.Element;
9
+ render: () => React.JSX.Element;
6
10
  decorators: import("@storybook/react/*").Decorator[];
7
11
  parameters: {
8
12
  chromatic: {
@@ -1 +1 @@
1
- {"version":3,"file":"Surfaces.stories.d.ts","sourceRoot":"","sources":["../../../../src/playground/Surfaces.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAiC,MAAM,OAAO,CAAC;;;;;;;;;;;AAwDtD,wBAKE;AAEF,eAAO,MAAM,OAAO;;CAEnB,CAAC"}
1
+ {"version":3,"file":"Surfaces.stories.d.ts","sourceRoot":"","sources":["../../../../src/playground/Surfaces.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAgBtD,KAAK,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;;;qCAEzC,iBAAiB,GAAG;QAAE,KAAK,EAAE,YAAY,CAAA;KAAE;;;;;;;;;AAsCjF,wBAME;AAEF,eAAO,MAAM,OAAO;;CAEnB,CAAC"}
@@ -2,7 +2,7 @@ import '@dxos-theme';
2
2
  import React from 'react';
3
3
  declare const _default: {
4
4
  title: string;
5
- component: () => React.JSX.Element;
5
+ render: () => React.JSX.Element;
6
6
  decorators: import("@storybook/react/*").Decorator[];
7
7
  parameters: {
8
8
  chromatic: {
package/package.json CHANGED
@@ -1,19 +1,17 @@
1
1
  {
2
2
  "name": "@dxos/react-ui",
3
- "version": "0.6.14-main.7bd9c89",
3
+ "version": "0.6.14-main.f49f251",
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
+ "sideEffects": true,
9
10
  "exports": {
10
11
  ".": {
12
+ "types": "./dist/types/src/index.d.ts",
11
13
  "browser": "./dist/lib/browser/index.mjs",
12
- "node": {
13
- "require": "./dist/lib/node/index.cjs",
14
- "default": "./dist/lib/node-esm/index.mjs"
15
- },
16
- "types": "./dist/types/src/index.d.ts"
14
+ "node": "./dist/lib/node-esm/index.mjs"
17
15
  }
18
16
  },
19
17
  "types": "dist/types/src/index.d.ts",
@@ -26,6 +24,7 @@
26
24
  ],
27
25
  "dependencies": {
28
26
  "@fluentui/react-tabster": "^9.19.0",
27
+ "@radix-ui/primitive": "^1.0.0",
29
28
  "@radix-ui/react-alert-dialog": "^1.0.3",
30
29
  "@radix-ui/react-avatar": "^1.0.2",
31
30
  "@radix-ui/react-checkbox": "^1.0.3",
@@ -34,9 +33,14 @@
34
33
  "@radix-ui/react-context": "^1.0.0",
35
34
  "@radix-ui/react-context-menu": "^2.1.5",
36
35
  "@radix-ui/react-dialog": "^1.0.3",
37
- "@radix-ui/react-dropdown-menu": "2.0.7-rc.10",
38
- "@radix-ui/react-popover": "1.0.8-rc.8",
36
+ "@radix-ui/react-dismissable-layer": "^1.1.1",
37
+ "@radix-ui/react-focus-guards": "^1.1.1",
38
+ "@radix-ui/react-focus-scope": "^1.1.0",
39
+ "@radix-ui/react-id": "^1.1.0",
40
+ "@radix-ui/react-menu": "^2.0.6",
39
41
  "@radix-ui/react-popper": "^1.1.2",
42
+ "@radix-ui/react-portal": "^1.1.2",
43
+ "@radix-ui/react-presence": "^1.1.1",
40
44
  "@radix-ui/react-primitive": "^1.0.2",
41
45
  "@radix-ui/react-scroll-area": "^1.0.3",
42
46
  "@radix-ui/react-select": "^1.2.1",
@@ -49,17 +53,19 @@
49
53
  "@radix-ui/react-toolbar": "^1.0.3",
50
54
  "@radix-ui/react-tooltip": "^1.1.2",
51
55
  "@radix-ui/react-use-controllable-state": "^1.0.0",
56
+ "aria-hidden": "^1.2.4",
52
57
  "date-fns": "^3.3.1",
53
58
  "i18next": "^21.10.0",
54
59
  "keyborg": "^2.5.0",
55
60
  "react-i18next": "^11.18.6",
56
- "@dxos/debug": "0.6.14-main.7bd9c89",
57
- "@dxos/log": "0.6.14-main.7bd9c89",
58
- "@dxos/react-hooks": "0.6.14-main.7bd9c89",
59
- "@dxos/react-input": "0.6.14-main.7bd9c89",
60
- "@dxos/util": "0.6.14-main.7bd9c89",
61
- "@dxos/react-list": "0.6.14-main.7bd9c89",
62
- "@dxos/react-ui-types": "0.6.14-main.7bd9c89"
61
+ "react-remove-scroll": "^2.6.0",
62
+ "@dxos/log": "0.6.14-main.f49f251",
63
+ "@dxos/debug": "0.6.14-main.f49f251",
64
+ "@dxos/react-hooks": "0.6.14-main.f49f251",
65
+ "@dxos/react-input": "0.6.14-main.f49f251",
66
+ "@dxos/react-list": "0.6.14-main.f49f251",
67
+ "@dxos/util": "0.6.14-main.f49f251",
68
+ "@dxos/react-ui-types": "0.6.14-main.f49f251"
63
69
  },
64
70
  "devDependencies": {
65
71
  "@dnd-kit/core": "^6.0.5",
@@ -71,15 +77,15 @@
71
77
  "react": "~18.2.0",
72
78
  "react-dom": "~18.2.0",
73
79
  "vite": "5.4.7",
74
- "@dxos/random": "0.6.14-main.7bd9c89",
75
- "@dxos/react-ui-theme": "0.6.14-main.7bd9c89",
76
- "@dxos/util": "0.6.14-main.7bd9c89"
80
+ "@dxos/random": "0.6.14-main.f49f251",
81
+ "@dxos/react-ui-theme": "0.6.14-main.f49f251",
82
+ "@dxos/util": "0.6.14-main.f49f251"
77
83
  },
78
84
  "peerDependencies": {
79
85
  "@phosphor-icons/react": "^2.1.5",
80
86
  "react": "~18.2.0",
81
87
  "react-dom": "~18.2.0",
82
- "@dxos/react-ui-theme": "0.6.14-main.7bd9c89"
88
+ "@dxos/react-ui-theme": "0.6.14-main.f49f251"
83
89
  },
84
90
  "publishConfig": {
85
91
  "access": "public"
@@ -57,8 +57,9 @@ const StorybookAvatar = (props: PropsWithChildren<StorybookAvatarProps>) => {
57
57
  };
58
58
 
59
59
  export default {
60
- title: 'ui/react-ui/Avatar',
61
- component: StorybookAvatar,
60
+ title: 'ui/react-ui-core/Avatar',
61
+ component: Avatar,
62
+ render: StorybookAvatar,
62
63
  decorators: [withTheme],
63
64
  parameters: { chromatic: { disableSnapshot: false } },
64
65
  };
@@ -44,8 +44,9 @@ const StorybookAvatarGroup = () => {
44
44
  };
45
45
 
46
46
  export default {
47
- title: 'ui/react-ui/Avatar Group',
48
- component: StorybookAvatarGroup,
47
+ title: 'ui/react-ui-core/AvatarGroup',
48
+ component: AvatarGroup,
49
+ render: StorybookAvatarGroup,
49
50
  decorators: [withTheme],
50
51
  parameters: { chromatic: { disableSnapshot: false } },
51
52
  };
@@ -39,8 +39,9 @@ const StorybookBreadcrumb = () => {
39
39
  };
40
40
 
41
41
  export default {
42
- title: 'ui/react-ui/Breadcrumb',
43
- component: StorybookBreadcrumb,
42
+ title: 'ui/react-ui-core/Breadcrumb',
43
+ component: Breadcrumb,
44
+ render: StorybookBreadcrumb,
44
45
  decorators: [withTheme],
45
46
  parameters: { chromatic: { disableSnapshot: false } },
46
47
  };
@@ -54,7 +54,7 @@ export const Ghost = {
54
54
  };
55
55
 
56
56
  export default {
57
- title: 'ui/react-ui/Button',
57
+ title: 'ui/react-ui-core/Button',
58
58
  component: Button,
59
59
  decorators: [withVariants(), withTheme],
60
60
  render: DefaultStory,
@@ -5,7 +5,7 @@
5
5
  import { createContext } from '@radix-ui/react-context';
6
6
  import { Primitive } from '@radix-ui/react-primitive';
7
7
  import { Slot } from '@radix-ui/react-slot';
8
- import React, { type ComponentPropsWithRef, forwardRef } from 'react';
8
+ import React, { type ComponentPropsWithRef, forwardRef, memo } from 'react';
9
9
 
10
10
  import { type Density, type Elevation } from '@dxos/react-ui-types';
11
11
 
@@ -27,41 +27,51 @@ const [ButtonGroupProvider, useButtonGroupContext] = createContext<ButtonGroupCo
27
27
  inGroup: false,
28
28
  });
29
29
 
30
- const Button = forwardRef<HTMLButtonElement, ButtonProps>(
31
- (
32
- { classNames, children, density: propsDensity, elevation: propsElevation, variant = 'default', asChild, ...props },
33
- ref,
34
- ) => {
35
- const { inGroup } = useButtonGroupContext(BUTTON_NAME);
36
- const { tx } = useThemeContext();
37
- const elevation = useElevationContext(propsElevation);
38
- const density = useDensityContext(propsDensity);
39
- const Root = asChild ? Slot : Primitive.button;
40
- return (
41
- <Root
42
- ref={ref}
43
- {...props}
44
- data-variant={variant}
45
- data-density={density}
46
- data-props={inGroup ? 'grouped' : ''}
47
- className={tx(
48
- 'button.root',
49
- 'button',
50
- {
51
- variant,
52
- inGroup,
53
- disabled: props.disabled,
54
- density,
55
- elevation,
56
- },
57
- classNames,
58
- )}
59
- {...(props.disabled && { disabled: true })}
60
- >
61
- {children}
62
- </Root>
63
- );
64
- },
30
+ const Button = memo(
31
+ forwardRef<HTMLButtonElement, ButtonProps>(
32
+ (
33
+ {
34
+ classNames,
35
+ children,
36
+ density: propsDensity,
37
+ elevation: propsElevation,
38
+ variant = 'default',
39
+ asChild,
40
+ ...props
41
+ },
42
+ ref,
43
+ ) => {
44
+ const { inGroup } = useButtonGroupContext(BUTTON_NAME);
45
+ const { tx } = useThemeContext();
46
+ const elevation = useElevationContext(propsElevation);
47
+ const density = useDensityContext(propsDensity);
48
+ const Root = asChild ? Slot : Primitive.button;
49
+ return (
50
+ <Root
51
+ ref={ref}
52
+ {...props}
53
+ data-variant={variant}
54
+ data-density={density}
55
+ data-props={inGroup ? 'grouped' : ''}
56
+ className={tx(
57
+ 'button.root',
58
+ 'button',
59
+ {
60
+ variant,
61
+ inGroup,
62
+ disabled: props.disabled,
63
+ density,
64
+ elevation,
65
+ },
66
+ classNames,
67
+ )}
68
+ {...(props.disabled && { disabled: true })}
69
+ >
70
+ {children}
71
+ </Root>
72
+ );
73
+ },
74
+ ),
65
75
  );
66
76
 
67
77
  Button.displayName = BUTTON_NAME;
@@ -21,8 +21,9 @@ const StorybookToggle = (props: StorybookToggleProps) => {
21
21
  };
22
22
 
23
23
  export default {
24
- title: 'ui/react-ui/Toggle button',
25
- component: StorybookToggle,
24
+ title: 'ui/react-ui-core/Toggle',
25
+ component: Toggle,
26
+ render: StorybookToggle,
26
27
  decorators: [withTheme],
27
28
  parameters: { chromatic: { disableSnapshot: false } },
28
29
  };
@@ -29,8 +29,9 @@ const StorybookToggleGroup = (props: StorybookToggleGroupProps) => {
29
29
  };
30
30
 
31
31
  export default {
32
- title: 'ui/react-ui/Toggle button group',
33
- component: StorybookToggleGroup,
32
+ title: 'ui/react-ui-core/ToggleGroup',
33
+ component: ToggleGroup,
34
+ render: StorybookToggleGroup,
34
35
  decorators: [withTheme],
35
36
  parameters: { chromatic: { disableSnapshot: false } },
36
37
  };
@@ -54,8 +54,9 @@ const StorybookAlertDialog = ({
54
54
  };
55
55
 
56
56
  export default {
57
- title: 'ui/react-ui/Dialog (alert)',
58
- component: StorybookAlertDialog,
57
+ title: 'ui/react-ui-core/AlertDialog',
58
+ component: AlertDialog,
59
+ render: StorybookAlertDialog,
59
60
  decorators: [withTheme],
60
61
  parameters: { chromatic: { disableSnapshot: false } },
61
62
  };
@@ -40,8 +40,9 @@ const StorybookDialog = ({ title, openTrigger, description, body, closeTrigger,
40
40
  };
41
41
 
42
42
  export default {
43
- title: 'ui/react-ui/Dialog',
44
- component: StorybookDialog,
43
+ title: 'ui/react-ui-core/Dialog',
44
+ component: Dialog,
45
+ render: StorybookDialog,
45
46
  decorators: [withTheme],
46
47
  parameters: { chromatic: { disableSnapshot: false } },
47
48
  };
@@ -3,7 +3,7 @@
3
3
  //
4
4
 
5
5
  import { type Primitive } from '@radix-ui/react-primitive';
6
- import React, { type ComponentPropsWithRef, forwardRef } from 'react';
6
+ import React, { type ComponentPropsWithRef, forwardRef, memo } from 'react';
7
7
 
8
8
  import { type Size } from '@dxos/react-ui-types';
9
9
 
@@ -12,11 +12,13 @@ import { type ThemedClassName } from '../../util';
12
12
 
13
13
  export type IconProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.svg>> & { icon: string; size?: Size };
14
14
 
15
- export const Icon = forwardRef<SVGSVGElement, IconProps>(({ icon, classNames, size, ...props }, forwardedRef) => {
16
- const { tx } = useThemeContext();
17
- return (
18
- <svg {...props} className={tx('icon.root', 'icon', { size }, classNames)} ref={forwardedRef}>
19
- <use href={`/icons.svg#${icon}`} />
20
- </svg>
21
- );
22
- });
15
+ export const Icon = memo(
16
+ forwardRef<SVGSVGElement, IconProps>(({ icon, classNames, size, ...props }, forwardedRef) => {
17
+ const { tx } = useThemeContext();
18
+ return (
19
+ <svg {...props} className={tx('icon.root', 'icon', { size }, classNames)} ref={forwardedRef}>
20
+ <use href={`/icons.svg#${icon}`} />
21
+ </svg>
22
+ );
23
+ }),
24
+ );
@@ -72,9 +72,10 @@ const StoryInput = (props: StoryInputProps) => {
72
72
  };
73
73
 
74
74
  export default {
75
- title: 'ui/react-ui/Input',
76
- component: StoryInput,
77
- // TODO(thure): Refactor
75
+ title: 'ui/react-ui-core/Input',
76
+ component: Input,
77
+ render: StoryInput,
78
+ // TODO(thure): Refactor.
78
79
  argTypes: {
79
80
  label: { control: 'text' },
80
81
  description: { control: 'text' },
@@ -8,7 +8,7 @@ import { Link } from './Link';
8
8
  import { withTheme } from '../../testing';
9
9
 
10
10
  export default {
11
- title: 'ui/react-ui/Link',
11
+ title: 'ui/react-ui-core/Link',
12
12
  component: Link,
13
13
  decorators: [withTheme],
14
14
  parameters: { chromatic: { disableSnapshot: false } },
@@ -9,7 +9,7 @@ import { arrayMove, SortableContext, useSortable, verticalListSortingStrategy }
9
9
  import { CSS } from '@dnd-kit/utilities';
10
10
  import { useArrowNavigationGroup } from '@fluentui/react-tabster';
11
11
  import { DotsSixVertical, PushPin } from '@phosphor-icons/react';
12
- import React, { type FC, type ReactNode, useState } from 'react';
12
+ import React, { type ReactNode, useState } from 'react';
13
13
 
14
14
  import {
15
15
  getSize,
@@ -20,12 +20,12 @@ import {
20
20
  surfaceElevation,
21
21
  } from '@dxos/react-ui-theme';
22
22
 
23
- import { List, ListItem, type ListProps, type ListScopedProps } from './List';
23
+ import { List, ListItem, type ListScopedProps } from './List';
24
24
  import { withTheme } from '../../testing';
25
25
 
26
26
  export default {
27
- title: 'ui/react-ui/List',
28
- component: List as FC<ListProps>,
27
+ title: 'ui/react-ui-core/List',
28
+ component: List,
29
29
  decorators: [withTheme],
30
30
  parameters: { chromatic: { disableSnapshot: false } },
31
31
  };
@@ -56,8 +56,9 @@ const StorybookTree = ({ data }: StorybookTreeProps) => {
56
56
  };
57
57
 
58
58
  export default {
59
- title: 'ui/react-ui/Tree',
60
- component: StorybookTree,
59
+ title: 'ui/react-ui-core/Tree',
60
+ component: Tree,
61
+ render: StorybookTree,
61
62
  decorators: [withTheme],
62
63
  parameters: { chromatic: { disableSnapshot: false } },
63
64
  };
@@ -144,7 +144,7 @@ const DefaultStory = () => {
144
144
  export const Default = {};
145
145
 
146
146
  export default {
147
- title: 'ui/react-ui/Treegrid',
147
+ title: 'ui/react-ui-core/Treegrid',
148
148
  component: Tg.Root,
149
149
  render: DefaultStory,
150
150
  decorators: [withTheme],
@@ -46,8 +46,9 @@ const StoryMain = (_args: StoryMainArgs) => {
46
46
  };
47
47
 
48
48
  export default {
49
- title: 'ui/react-ui/Main',
50
- component: StoryMain,
49
+ title: 'ui/react-ui-core/Main',
50
+ component: Main.Root,
51
+ render: StoryMain,
51
52
  decorators: [withTheme],
52
53
  parameters: { chromatic: { disableSnapshot: false } },
53
54
  };
@@ -92,8 +92,9 @@ const StorybookContextMenu = () => {
92
92
  };
93
93
 
94
94
  export default {
95
- title: 'ui/react-ui/Context menu',
96
- component: StorybookContextMenu,
95
+ title: 'ui/react-ui-core/ContextMenu',
96
+ component: ContextMenu,
97
+ render: StorybookContextMenu,
97
98
  decorators: [withTheme],
98
99
  parameters: { chromatic: { disableSnapshot: false } },
99
100
  };
@@ -4,7 +4,7 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
- import React from 'react';
7
+ import React, { useRef, useState } from 'react';
8
8
 
9
9
  import { DropdownMenu } from './DropdownMenu';
10
10
  import { withTheme } from '../../testing';
@@ -92,8 +92,9 @@ const StorybookDropdownMenu = () => {
92
92
  };
93
93
 
94
94
  export default {
95
- title: 'ui/react-ui/Dropdown menu',
96
- component: StorybookDropdownMenu,
95
+ title: 'ui/react-ui-core/DropdownMenu',
96
+ component: DropdownMenu,
97
+ render: StorybookDropdownMenu,
97
98
  decorators: [withTheme],
98
99
  parameters: { chromatic: { disableSnapshot: false } },
99
100
  };
@@ -104,3 +105,42 @@ export const Default = {
104
105
  chromatic: { delay: 1600 },
105
106
  },
106
107
  };
108
+
109
+ export const VirtualTrigger = {
110
+ render: () => {
111
+ const [menuOpen, setMenuOpen] = useState(true);
112
+ const buttonRef = useRef<HTMLButtonElement | null>(null);
113
+ return (
114
+ <>
115
+ <Button onClick={() => setMenuOpen(true)} ref={buttonRef}>
116
+ Customise options
117
+ </Button>
118
+ <DropdownMenu.Root open={menuOpen} onOpenChange={setMenuOpen}>
119
+ <DropdownMenu.VirtualTrigger virtualRef={buttonRef} />
120
+ <DropdownMenu.Content sideOffset={4} collisionPadding={8}>
121
+ <DropdownMenu.Viewport>
122
+ <DropdownMenu.Item>
123
+ <span className='grow'>New Tab</span>
124
+ <span className='opacity-50'>⌘+T</span>
125
+ </DropdownMenu.Item>
126
+ <DropdownMenu.Item>
127
+ <span className='grow'>New Window</span>
128
+ <span className='opacity-50'>⌘+N</span>
129
+ </DropdownMenu.Item>
130
+ <DropdownMenu.Item disabled>
131
+ <span className='grow'>New Private Window</span>
132
+ <span className='opacity-50'>⇧+⌘+N</span>
133
+ </DropdownMenu.Item>
134
+
135
+ <DropdownMenu.Separator />
136
+
137
+ <DropdownMenu.GroupLabel>People</DropdownMenu.GroupLabel>
138
+ </DropdownMenu.Viewport>
139
+
140
+ <DropdownMenu.Arrow />
141
+ </DropdownMenu.Content>
142
+ </DropdownMenu.Root>
143
+ </>
144
+ );
145
+ },
146
+ };