@dxos/react-ui 0.9.1-main.c7dcc2e112 → 0.9.1-staging.ee54ba693a

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 (239) hide show
  1. package/dist/lib/browser/{chunk-HFJYTGHU.mjs → chunk-CMHHVHX3.mjs} +4 -1
  2. package/dist/lib/browser/chunk-CMHHVHX3.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-F3PLXTDA.mjs → chunk-GTHV4WYK.mjs} +123 -232
  4. package/dist/lib/browser/chunk-GTHV4WYK.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +1069 -976
  6. package/dist/lib/browser/index.mjs.map +4 -4
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/browser/testing/index.mjs +5 -5
  9. package/dist/lib/browser/testing/index.mjs.map +2 -2
  10. package/dist/lib/browser/translations.mjs +1 -1
  11. package/dist/lib/node-esm/{chunk-LLVUYLAM.mjs → chunk-3VSKWNCQ.mjs} +123 -232
  12. package/dist/lib/node-esm/chunk-3VSKWNCQ.mjs.map +7 -0
  13. package/dist/lib/node-esm/{chunk-OJYUPUCY.mjs → chunk-P4KFQGJI.mjs} +4 -1
  14. package/dist/lib/node-esm/chunk-P4KFQGJI.mjs.map +7 -0
  15. package/dist/lib/node-esm/index.mjs +1069 -976
  16. package/dist/lib/node-esm/index.mjs.map +4 -4
  17. package/dist/lib/node-esm/meta.json +1 -1
  18. package/dist/lib/node-esm/testing/index.mjs +5 -5
  19. package/dist/lib/node-esm/testing/index.mjs.map +2 -2
  20. package/dist/lib/node-esm/translations.mjs +1 -1
  21. package/dist/types/src/components/Avatars/Avatar.d.ts +1 -1
  22. package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
  23. package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts +3 -3
  24. package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
  25. package/dist/types/src/components/Button/Button.d.ts +2 -2
  26. package/dist/types/src/components/Button/Button.d.ts.map +1 -1
  27. package/dist/types/src/components/Button/IconButton.stories.d.ts +3 -0
  28. package/dist/types/src/components/Button/IconButton.stories.d.ts.map +1 -1
  29. package/dist/types/src/components/Button/MicButton.d.ts +24 -0
  30. package/dist/types/src/components/Button/MicButton.d.ts.map +1 -0
  31. package/dist/types/src/components/Button/MicButton.stories.d.ts +57 -0
  32. package/dist/types/src/components/Button/MicButton.stories.d.ts.map +1 -0
  33. package/dist/types/src/components/Button/SystemIconButton.d.ts +15 -2
  34. package/dist/types/src/components/Button/SystemIconButton.d.ts.map +1 -1
  35. package/dist/types/src/components/Button/SystemIconButton.stories.d.ts +51 -0
  36. package/dist/types/src/components/Button/SystemIconButton.stories.d.ts.map +1 -0
  37. package/dist/types/src/components/Button/ToggleGroup.d.ts +2 -2
  38. package/dist/types/src/components/Button/ToggleGroup.d.ts.map +1 -1
  39. package/dist/types/src/components/Button/index.d.ts +1 -0
  40. package/dist/types/src/components/Button/index.d.ts.map +1 -1
  41. package/dist/types/src/components/Calendar/Calendar.d.ts.map +1 -1
  42. package/dist/types/src/components/Calendar/Calendar.theme.d.ts.map +1 -1
  43. package/dist/types/src/components/Card/Card.d.ts +8 -8
  44. package/dist/types/src/components/Card/Card.d.ts.map +1 -1
  45. package/dist/types/src/components/Card/Card.stories.d.ts +2 -2
  46. package/dist/types/src/components/Card/Card.stories.d.ts.map +1 -1
  47. package/dist/types/src/components/Carousel/Carousel.d.ts +29 -6
  48. package/dist/types/src/components/Carousel/Carousel.d.ts.map +1 -1
  49. package/dist/types/src/components/Carousel/Carousel.stories.d.ts +48 -2
  50. package/dist/types/src/components/Carousel/Carousel.stories.d.ts.map +1 -1
  51. package/dist/types/src/components/Column/Column.d.ts +2 -2
  52. package/dist/types/src/components/Column/Column.d.ts.map +1 -1
  53. package/dist/types/src/components/Dialog/AlertDialog.d.ts +2 -2
  54. package/dist/types/src/components/Dialog/AlertDialog.d.ts.map +1 -1
  55. package/dist/types/src/components/Dialog/Dialog.d.ts +1 -1
  56. package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -1
  57. package/dist/types/src/components/Dialog/Dialog.stories.d.ts +2 -2
  58. package/dist/types/src/components/Dialog/Dialog.stories.d.ts.map +1 -1
  59. package/dist/types/src/components/Icon/Icon.stories.d.ts +5 -0
  60. package/dist/types/src/components/Icon/Icon.stories.d.ts.map +1 -1
  61. package/dist/types/src/components/Input/Input.d.ts +4 -1
  62. package/dist/types/src/components/Input/Input.d.ts.map +1 -1
  63. package/dist/types/src/components/Input/Input.stories.d.ts +3 -3
  64. package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
  65. package/dist/types/src/components/Input/Input.theme.d.ts +10 -10
  66. package/dist/types/src/components/Input/Input.theme.d.ts.map +1 -1
  67. package/dist/types/src/components/Input/SegmentedInput.d.ts +8 -8
  68. package/dist/types/src/components/Input/SegmentedInput.d.ts.map +1 -1
  69. package/dist/types/src/components/Input/index.d.ts +0 -1
  70. package/dist/types/src/components/Input/index.d.ts.map +1 -1
  71. package/dist/types/src/components/Main/Main.d.ts +3 -3
  72. package/dist/types/src/components/Main/Main.d.ts.map +1 -1
  73. package/dist/types/src/components/Menu/ContextMenu.d.ts +1 -1
  74. package/dist/types/src/components/Menu/ContextMenu.d.ts.map +1 -1
  75. package/dist/types/src/components/Menu/DropdownMenu.d.ts +2 -2
  76. package/dist/types/src/components/Menu/DropdownMenu.d.ts.map +1 -1
  77. package/dist/types/src/components/Message/Message.d.ts +1 -1
  78. package/dist/types/src/components/Message/Message.d.ts.map +1 -1
  79. package/dist/types/src/components/Message/Message.stories.d.ts +2 -2
  80. package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
  81. package/dist/types/src/components/Panel/Panel.d.ts +1 -1
  82. package/dist/types/src/components/Panel/Panel.d.ts.map +1 -1
  83. package/dist/types/src/components/Panel/Panel.theme.d.ts.map +1 -1
  84. package/dist/types/src/components/Popover/Popover.d.ts +2 -2
  85. package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
  86. package/dist/types/src/components/ScrollArea/ScrollArea.d.ts +2 -0
  87. package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
  88. package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +1 -0
  89. package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
  90. package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts +1 -1
  91. package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts.map +1 -1
  92. package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts +2 -2
  93. package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts.map +1 -1
  94. package/dist/types/src/components/Select/Select.d.ts +1 -1
  95. package/dist/types/src/components/Select/Select.d.ts.map +1 -1
  96. package/dist/types/src/components/Select/Select.stories.d.ts +2 -2
  97. package/dist/types/src/components/Select/Select.stories.d.ts.map +1 -1
  98. package/dist/types/src/components/Separator/Separator.d.ts.map +1 -1
  99. package/dist/types/src/components/Splitter/Splitter.d.ts +30 -16
  100. package/dist/types/src/components/Splitter/Splitter.d.ts.map +1 -1
  101. package/dist/types/src/components/Splitter/Splitter.stories.d.ts +6 -1
  102. package/dist/types/src/components/Splitter/Splitter.stories.d.ts.map +1 -1
  103. package/dist/types/src/components/Splitter/Splitter.theme.d.ts +3 -1
  104. package/dist/types/src/components/Splitter/Splitter.theme.d.ts.map +1 -1
  105. package/dist/types/src/components/Tag/Tag.d.ts +1 -1
  106. package/dist/types/src/components/Tag/Tag.d.ts.map +1 -1
  107. package/dist/types/src/components/Tag/Tag.theme.d.ts +1 -1
  108. package/dist/types/src/components/Tag/Tag.theme.d.ts.map +1 -1
  109. package/dist/types/src/components/Toast/Toast.d.ts +1 -1
  110. package/dist/types/src/components/Toast/Toast.d.ts.map +1 -1
  111. package/dist/types/src/components/Toast/Toast.theme.d.ts.map +1 -1
  112. package/dist/types/src/components/Toolbar/Toolbar.d.ts +1 -1
  113. package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
  114. package/dist/types/src/components/Tooltip/Tooltip.d.ts +3 -3
  115. package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
  116. package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +2 -2
  117. package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
  118. package/dist/types/src/components/index.d.ts +0 -1
  119. package/dist/types/src/components/index.d.ts.map +1 -1
  120. package/dist/types/src/index.d.ts +1 -1
  121. package/dist/types/src/index.d.ts.map +1 -1
  122. package/dist/types/src/primitives/ThemeProvider/TranslationsProvider.d.ts +1 -8
  123. package/dist/types/src/primitives/ThemeProvider/TranslationsProvider.d.ts.map +1 -1
  124. package/dist/types/src/theme/defaultTheme.d.ts.map +1 -1
  125. package/dist/types/src/theme/index.d.ts +0 -2
  126. package/dist/types/src/theme/index.d.ts.map +1 -1
  127. package/dist/types/src/translations.d.ts +3 -0
  128. package/dist/types/src/translations.d.ts.map +1 -1
  129. package/dist/types/src/util/slots.d.ts +1 -1
  130. package/dist/types/src/util/slots.d.ts.map +1 -1
  131. package/dist/types/tsconfig.tsbuildinfo +1 -1
  132. package/package.json +22 -21
  133. package/src/components/Avatars/Avatar.stories.tsx +2 -2
  134. package/src/components/Avatars/Avatar.theme.ts +1 -1
  135. package/src/components/Avatars/Avatar.tsx +3 -3
  136. package/src/components/Breadcrumb/Breadcrumb.tsx +6 -6
  137. package/src/components/Button/Button.tsx +2 -2
  138. package/src/components/Button/MicButton.stories.tsx +60 -0
  139. package/src/components/Button/MicButton.tsx +117 -0
  140. package/src/components/Button/SystemIconButton.stories.tsx +91 -0
  141. package/src/components/Button/SystemIconButton.tsx +113 -2
  142. package/src/components/Button/ToggleGroup.tsx +2 -2
  143. package/src/components/Button/index.ts +1 -0
  144. package/src/components/Calendar/Calendar.theme.ts +2 -0
  145. package/src/components/Calendar/Calendar.tsx +3 -3
  146. package/src/components/Card/Card.stories.tsx +2 -2
  147. package/src/components/Card/Card.tsx +11 -11
  148. package/src/components/Carousel/Carousel.stories.tsx +42 -18
  149. package/src/components/Carousel/Carousel.tsx +169 -33
  150. package/src/components/Column/Column.tsx +4 -7
  151. package/src/components/Dialog/AlertDialog.stories.tsx +2 -2
  152. package/src/components/Dialog/AlertDialog.tsx +13 -13
  153. package/src/components/Dialog/Dialog.stories.tsx +3 -4
  154. package/src/components/Dialog/Dialog.theme.ts +1 -1
  155. package/src/components/Dialog/Dialog.tsx +12 -12
  156. package/src/components/Icon/Icon.stories.tsx +23 -0
  157. package/src/components/Icon/Icon.theme.ts +1 -1
  158. package/src/components/Input/Input.stories.tsx +13 -5
  159. package/src/components/Input/Input.theme.ts +17 -39
  160. package/src/components/Input/Input.tsx +30 -13
  161. package/src/components/Input/SegmentedInput.tsx +50 -41
  162. package/src/components/Input/index.ts +0 -1
  163. package/src/components/Main/Main.tsx +3 -3
  164. package/src/components/MediaPlayer/MediaPlayer.tsx +4 -4
  165. package/src/components/Menu/ContextMenu.tsx +8 -8
  166. package/src/components/Menu/DropdownMenu.tsx +12 -13
  167. package/src/components/Message/Message.stories.tsx +2 -2
  168. package/src/components/Message/Message.theme.ts +1 -1
  169. package/src/components/Message/Message.tsx +2 -2
  170. package/src/components/Panel/Panel.theme.ts +2 -1
  171. package/src/components/Panel/Panel.tsx +1 -1
  172. package/src/components/Popover/Popover.tsx +9 -9
  173. package/src/components/ScrollArea/ScrollArea.tsx +7 -4
  174. package/src/components/ScrollContainer/ScrollContainer.stories.tsx +2 -2
  175. package/src/components/ScrollContainer/ScrollContainer.tsx +2 -2
  176. package/src/components/Select/Select.stories.tsx +2 -2
  177. package/src/components/Select/Select.theme.ts +1 -1
  178. package/src/components/Select/Select.tsx +14 -14
  179. package/src/components/Separator/Separator.tsx +1 -0
  180. package/src/components/Splitter/Splitter.stories.tsx +84 -20
  181. package/src/components/Splitter/Splitter.theme.ts +20 -3
  182. package/src/components/Splitter/Splitter.tsx +320 -47
  183. package/src/components/Tag/Tag.stories.tsx +1 -1
  184. package/src/components/Tag/Tag.theme.ts +1 -1
  185. package/src/components/Tag/Tag.tsx +3 -5
  186. package/src/components/Toast/Toast.theme.ts +3 -2
  187. package/src/components/Toast/Toast.tsx +5 -5
  188. package/src/components/Toolbar/Toolbar.tsx +10 -10
  189. package/src/components/Tooltip/Tooltip.stories.tsx +2 -2
  190. package/src/components/Tooltip/Tooltip.tsx +3 -3
  191. package/src/components/index.ts +0 -1
  192. package/src/exemplars/tabster.stories.tsx +1 -1
  193. package/src/index.ts +1 -1
  194. package/src/primitives/ThemeProvider/TranslationsProvider.tsx +10 -30
  195. package/src/testing/decorators/withLayout.tsx +4 -4
  196. package/src/theme/defaultTheme.ts +0 -4
  197. package/src/theme/index.ts +0 -2
  198. package/src/translations.ts +8 -0
  199. package/src/util/slots.ts +5 -5
  200. package/dist/lib/browser/chunk-F3PLXTDA.mjs.map +0 -7
  201. package/dist/lib/browser/chunk-HFJYTGHU.mjs.map +0 -7
  202. package/dist/lib/node-esm/chunk-LLVUYLAM.mjs.map +0 -7
  203. package/dist/lib/node-esm/chunk-OJYUPUCY.mjs.map +0 -7
  204. package/dist/types/src/components/Input/constants.d.ts +0 -5
  205. package/dist/types/src/components/Input/constants.d.ts.map +0 -1
  206. package/dist/types/src/components/List/List.d.ts +0 -29
  207. package/dist/types/src/components/List/List.d.ts.map +0 -1
  208. package/dist/types/src/components/List/List.stories.d.ts +0 -16
  209. package/dist/types/src/components/List/List.stories.d.ts.map +0 -1
  210. package/dist/types/src/components/List/List.theme.d.ts +0 -7
  211. package/dist/types/src/components/List/List.theme.d.ts.map +0 -1
  212. package/dist/types/src/components/List/ListDropIndicator.d.ts +0 -13
  213. package/dist/types/src/components/List/ListDropIndicator.d.ts.map +0 -1
  214. package/dist/types/src/components/List/Tree.d.ts +0 -23
  215. package/dist/types/src/components/List/Tree.d.ts.map +0 -1
  216. package/dist/types/src/components/List/Tree.stories.d.ts +0 -15
  217. package/dist/types/src/components/List/Tree.stories.d.ts.map +0 -1
  218. package/dist/types/src/components/List/TreeDropIndicator.d.ts +0 -8
  219. package/dist/types/src/components/List/TreeDropIndicator.d.ts.map +0 -1
  220. package/dist/types/src/components/List/Treegrid.d.ts +0 -33
  221. package/dist/types/src/components/List/Treegrid.d.ts.map +0 -1
  222. package/dist/types/src/components/List/Treegrid.stories.d.ts +0 -12
  223. package/dist/types/src/components/List/Treegrid.stories.d.ts.map +0 -1
  224. package/dist/types/src/components/List/Treegrid.theme.d.ts +0 -7
  225. package/dist/types/src/components/List/Treegrid.theme.d.ts.map +0 -1
  226. package/dist/types/src/components/List/index.d.ts +0 -4
  227. package/dist/types/src/components/List/index.d.ts.map +0 -1
  228. package/src/components/Input/constants.ts +0 -8
  229. package/src/components/List/List.stories.tsx +0 -234
  230. package/src/components/List/List.theme.ts +0 -47
  231. package/src/components/List/List.tsx +0 -171
  232. package/src/components/List/ListDropIndicator.tsx +0 -69
  233. package/src/components/List/Tree.stories.tsx +0 -87
  234. package/src/components/List/Tree.tsx +0 -74
  235. package/src/components/List/TreeDropIndicator.tsx +0 -70
  236. package/src/components/List/Treegrid.stories.tsx +0 -156
  237. package/src/components/List/Treegrid.theme.ts +0 -35
  238. package/src/components/List/Treegrid.tsx +0 -187
  239. package/src/components/List/index.ts +0 -7
@@ -4,7 +4,7 @@ import {
4
4
  Tooltip,
5
5
  defaultTx,
6
6
  parseCaptureOwnerStack
7
- } from "../chunk-F3PLXTDA.mjs";
7
+ } from "../chunk-GTHV4WYK.mjs";
8
8
 
9
9
  // src/testing/decorators/withLayout.tsx
10
10
  import React, { memo } from "react";
@@ -30,14 +30,14 @@ var layouts = {
30
30
  className: mx("fixed inset-0 flex overflow-hidden bg-black", classNames)
31
31
  }, children),
32
32
  centered: ({ classNames, children }) => /* @__PURE__ */ React.createElement("div", {
33
- className: mx("fixed inset-0 grid overflow-hidden place-items-center bg-black")
33
+ className: mx("fixed inset-0 grid overflow-hidden place-items-center bg-trim-surface")
34
34
  }, /* @__PURE__ */ React.createElement("div", {
35
- className: mx("flex flex-col dx-attention-surface", classNames)
35
+ className: mx("flex flex-col bg-base-surface", classNames)
36
36
  }, children)),
37
37
  column: ({ classNames, children }) => /* @__PURE__ */ React.createElement("div", {
38
- className: "fixed inset-0 flex overflow-hidden justify-center bg-black"
38
+ className: "fixed inset-0 flex overflow-hidden justify-center bg-trim-surface"
39
39
  }, /* @__PURE__ */ React.createElement("div", {
40
- className: mx("flex flex-col w-[40rem] dx-attention-surface", classNames)
40
+ className: mx("flex flex-col w-[40rem] bg-base-surface", classNames)
41
41
  }, children))
42
42
  };
43
43
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/testing/decorators/withLayout.tsx", "../../../../src/testing/decorators/withLayoutVariants.tsx", "../../../../src/testing/decorators/withTheme.tsx", "../../../../src/testing/Loading.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport React, { type FC, type PropsWithChildren, memo } from 'react';\n\nimport { type ClassNameValue, type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nexport type ContainerProps = ThemedClassName<PropsWithChildren>;\n\nexport type ContainerType = 'default' | 'fullscreen' | 'centered' | 'column';\n\nexport type WithLayoutProps =\n | FC<ContainerProps>\n | {\n classNames?: ClassNameValue;\n layout?: ContainerType;\n scroll?: boolean;\n };\n\n/**\n * Adds layout container.\n */\nexport const withLayout =\n (props: WithLayoutProps = {}): Decorator =>\n (Story) => {\n // Prevent re-rendering of the story.\n const MemoizedStory = memo(Story);\n if (typeof props === 'function') {\n const Container = props;\n return (\n <Container>\n <MemoizedStory />\n </Container>\n );\n } else {\n const { layout = 'default', classNames, scroll } = props;\n const Container = layouts[layout] ?? layouts.fullscreen;\n return (\n <Container classNames={mx(scroll ? 'overflow-y-auto' : 'overflow-hidden', classNames)}>\n <MemoizedStory />\n </Container>\n );\n }\n };\n\nconst layouts: Record<ContainerType, FC<ContainerProps>> = {\n default: ({ classNames, children }: ContainerProps) => <div className={mx('p-4', classNames)}>{children}</div>,\n\n fullscreen: ({ classNames, children }: ContainerProps) => (\n <div className={mx('fixed inset-0 flex overflow-hidden bg-black', classNames)}>{children}</div>\n ),\n\n centered: ({ classNames, children }: ContainerProps) => (\n <div className={mx('fixed inset-0 grid overflow-hidden place-items-center bg-black')}>\n <div className={mx('flex flex-col dx-attention-surface', classNames)}>{children}</div>\n </div>\n ),\n\n column: ({ classNames, children }: ContainerProps) => (\n <div className='fixed inset-0 flex overflow-hidden justify-center bg-black'>\n <div className={mx('flex flex-col w-[40rem] dx-attention-surface', classNames)}>{children}</div>\n </div>\n ),\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport React, { type ComponentType, type PropsWithChildren } from 'react';\n\nimport { mx, surfaceShadow } from '@dxos/ui-theme';\nimport { type Density, type Elevation } from '@dxos/ui-types';\n\ntype Config = {\n elevations?: { elevation: Elevation; surface?: string }[];\n densities?: Density[];\n};\n\nconst Container = ({ children, elevation, surface }: PropsWithChildren<{ elevation: Elevation; surface?: string }>) => (\n <div className={mx('p-4 rounded-sm', surface, surfaceShadow({ elevation }))}>{children}</div>\n);\n\nconst Panel = ({\n Story,\n elevations,\n densities,\n className,\n}: { Story: ComponentType } & Config & { className?: string }) => {\n return (\n <div className={mx('flex flex-col h-full p-8 gap-8', className)}>\n {elevations?.map(({ elevation, surface }) =>\n densities?.map((density) => (\n <Container key={`${elevation}--${density}`} surface={surface} elevation={elevation}>\n <Story />\n </Container>\n )),\n )}\n </div>\n );\n};\n\nexport const withLayoutVariants = ({\n elevations = [\n { elevation: 'dialog', surface: 'bg-modal-surface' },\n { elevation: 'positioned', surface: 'bg-card-surface' },\n { elevation: 'base', surface: 'bg-base-surface' },\n ],\n densities = ['md'],\n}: Config = {}): Decorator => {\n return (Story) => <Panel Story={Story} elevations={elevations} densities={densities} />;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport React from 'react';\nimport { I18nProvider } from 'react-aria-components';\n\nimport { type ThemeMode } from '@dxos/ui-types';\n\nimport { Tooltip } from '../../components';\nimport { type ThemeContextValue, ThemeProvider } from '../../primitives';\nimport { defaultTx } from '../../theme';\n\n/**\n * Adds theme decorator.\n *\n * `I18nProvider` is included so react-aria-components-backed widgets (DateField, Calendar, …)\n * have a guaranteed locale in headless test environments where `navigator.language` may be\n * empty.\n */\nexport const withTheme =\n ({ tx = defaultTx, noCache, platform }: Partial<ThemeContextValue> = {}): Decorator =>\n (Story, context) => {\n const {\n globals: { theme },\n parameters: { translations },\n } = context;\n\n return (\n <I18nProvider locale='en-US'>\n <ThemeProvider\n tx={tx}\n themeMode={(theme as ThemeMode) || 'dark'}\n resourceExtensions={translations}\n noCache={noCache}\n platform={platform}\n >\n <Tooltip.Provider>\n <Story />\n </Tooltip.Provider>\n </ThemeProvider>\n </I18nProvider>\n );\n };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { captureOwnerStack, useEffect, useState } from 'react';\n\nimport { mx } from '@dxos/ui-theme';\nimport { safeStringify } from '@dxos/util';\n\nimport { ErrorStack, parseCaptureOwnerStack } from '../components';\n\nexport type LoadingProps = { data?: any };\n\n/**\n * Storybook loading component.\n */\nexport const Loading = ({ data }: LoadingProps) => {\n const [visible, setVisible] = useState(false);\n const ownerFrames = parseCaptureOwnerStack(captureOwnerStack());\n\n useEffect(() => {\n const t = setTimeout(() => setVisible(true), 500);\n return () => clearTimeout(t);\n }, []);\n\n return (\n <div className='grid p-2'>\n <div\n className={mx(\n 'flex flex-col w-full p-2 border-2 border-teal-500 rounded-md',\n 'opacity-0 transition delay-1000 duration-1000',\n 'overflow-auto',\n visible && 'opacity-100',\n )}\n >\n <h2 className='uppercase capitalize text-xs'>Loading State</h2>\n <pre className='text-sm text-description'>{safeStringify(data, undefined, 2)}</pre>\n\n <h3 className='uppercase capitalize text-xs mt-2'>Owner stack</h3>\n {ownerFrames && ownerFrames.length > 0 ? (\n <ErrorStack frames={ownerFrames} />\n ) : (\n <p className='text-xs text-subdued'>No owner stack (production build or unsupported context).</p>\n )}\n </div>\n </div>\n );\n};\n"],
5
- "mappings": ";;;;;;;;;AAKA,OAAOA,SAA0CC,YAAY;AAG7D,SAASC,UAAU;AAiBZ,IAAMC,aACX,CAACC,QAAyB,CAAC,MAC3B,CAACC,UAAAA;AAEC,QAAMC,gBAAgBL,qBAAKI,KAAAA;AAC3B,MAAI,OAAOD,UAAU,YAAY;AAC/B,UAAMG,aAAYH;AAClB,WACE,sBAAA,cAACG,YAAAA,MACC,sBAAA,cAACD,eAAAA,IAAAA,CAAAA;EAGP,OAAO;AACL,UAAM,EAAEE,SAAS,WAAWC,YAAYC,OAAM,IAAKN;AACnD,UAAMG,aAAYI,QAAQH,MAAAA,KAAWG,QAAQC;AAC7C,WACE,sBAAA,cAACL,YAAAA;MAAUE,YAAYP,GAAGQ,SAAS,oBAAoB,mBAAmBD,UAAAA;OACxE,sBAAA,cAACH,eAAAA,IAAAA,CAAAA;EAGP;AACF;AAEF,IAAMK,UAAqD;EACzDE,SAAS,CAAC,EAAEJ,YAAYK,SAAQ,MAAuB,sBAAA,cAACC,OAAAA;IAAIC,WAAWd,GAAG,OAAOO,UAAAA;KAAcK,QAAAA;EAE/FF,YAAY,CAAC,EAAEH,YAAYK,SAAQ,MACjC,sBAAA,cAACC,OAAAA;IAAIC,WAAWd,GAAG,+CAA+CO,UAAAA;KAAcK,QAAAA;EAGlFG,UAAU,CAAC,EAAER,YAAYK,SAAQ,MAC/B,sBAAA,cAACC,OAAAA;IAAIC,WAAWd,GAAG,gEAAA;KACjB,sBAAA,cAACa,OAAAA;IAAIC,WAAWd,GAAG,sCAAsCO,UAAAA;KAAcK,QAAAA,CAAAA;EAI3EI,QAAQ,CAAC,EAAET,YAAYK,SAAQ,MAC7B,sBAAA,cAACC,OAAAA;IAAIC,WAAU;KACb,sBAAA,cAACD,OAAAA;IAAIC,WAA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AF,OAAA,cAACG,eAAAA;IACCb;IACAc,WAAYP,SAAuB;IACnCQ,oBAAoBN;IACpBP;IACAC;KAEA,gBAAAO,OAAA,cAACM,QAAQC,UAAQ,MACf,gBAAAP,OAAA,cAACN,OAAAA,IAAAA,CAAAA,CAAAA,CAAAA;AAKX;;;ACxCF,OAAOc,UAASC,mBAAmBC,WAAWC,gBAAgB;AAE9D,SAASC,MAAAA,WAAU;AACnB,SAASC,qBAAqB;AASvB,IAAMC,UAAU,CAAC,EAAEC,KAAI,MAAgB;AAC5C,QAAM,CAACC,SAASC,UAAAA,IAAcC,SAAS,KAAA;AACvC,QAAMC,cAAcC,uBAAuBC,kBAAAA,CAAAA;AAE3CC,YAAU,MAAA;AACR,UAAMC,IAAIC,WAAW,MAAMP,WAAW,IAAA,GAAO,GAAA;AAC7C,WAAO,MAAMQ,aAAaF,CAAAA;EAC5B,GAAG,CAAA,CAAE;AAEL,SACE,gBAAAG,OAAA,cAACC,OAAAA;IAAIC,WAAU;KACb,gBAAAF,OAAA,cAACC,OAAAA;IACCC,WAAWC,IACT,gEACA,iDACA,iBACAb,WAAW,aAAA;KAGb,gBAAAU,OAAA,cAACI,MAAAA;IAAGF,WAAU;KAA+B,eAAA,GAC7C,gBAAAF,OAAA,cAACK,OAAAA;IAAIH,WAAU;KAA4BI,cAAcjB,MAAMkB,QAAW,CAAA,CAAA,GAE1E,gBAAAP,OAAA,cAACQ,MAAAA;IAAGN,WAAU;KAAoC,aAAA,GACjDT,eAAeA,YAAYgB,SAAS,IACnC,gBAAAT,OAAA,cAACU,YAAAA;IAAWC,QAAQlB;OAEpB,gBAAAO,OAAA,cAACY,KAAAA;IAAEV,WAAU;KAAuB,2DAAA,CAAA,CAAA;AAK9C;",
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport React, { type FC, type PropsWithChildren, memo } from 'react';\n\nimport { type ClassNameValue, type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nexport type ContainerProps = ThemedClassName<PropsWithChildren>;\n\nexport type ContainerType = 'default' | 'fullscreen' | 'centered' | 'column';\n\nexport type WithLayoutProps =\n | FC<ContainerProps>\n | {\n classNames?: ClassNameValue;\n layout?: ContainerType;\n scroll?: boolean;\n };\n\n/**\n * Adds layout container.\n */\nexport const withLayout =\n (props: WithLayoutProps = {}): Decorator =>\n (Story) => {\n // Prevent re-rendering of the story.\n const MemoizedStory = memo(Story);\n if (typeof props === 'function') {\n const Container = props;\n return (\n <Container>\n <MemoizedStory />\n </Container>\n );\n } else {\n const { layout = 'default', classNames, scroll } = props;\n const Container = layouts[layout] ?? layouts.fullscreen;\n return (\n <Container classNames={mx(scroll ? 'overflow-y-auto' : 'overflow-hidden', classNames)}>\n <MemoizedStory />\n </Container>\n );\n }\n };\n\nconst layouts: Record<ContainerType, FC<ContainerProps>> = {\n default: ({ classNames, children }: ContainerProps) => <div className={mx('p-4', classNames)}>{children}</div>,\n\n fullscreen: ({ classNames, children }: ContainerProps) => (\n <div className={mx('fixed inset-0 flex overflow-hidden bg-black', classNames)}>{children}</div>\n ),\n\n centered: ({ classNames, children }: ContainerProps) => (\n <div className={mx('fixed inset-0 grid overflow-hidden place-items-center bg-trim-surface')}>\n <div className={mx('flex flex-col bg-base-surface', classNames)}>{children}</div>\n </div>\n ),\n\n column: ({ classNames, children }: ContainerProps) => (\n <div className='fixed inset-0 flex overflow-hidden justify-center bg-trim-surface'>\n <div className={mx('flex flex-col w-[40rem] bg-base-surface', classNames)}>{children}</div>\n </div>\n ),\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport React, { type ComponentType, type PropsWithChildren } from 'react';\n\nimport { mx, surfaceShadow } from '@dxos/ui-theme';\nimport { type Density, type Elevation } from '@dxos/ui-types';\n\ntype Config = {\n elevations?: { elevation: Elevation; surface?: string }[];\n densities?: Density[];\n};\n\nconst Container = ({ children, elevation, surface }: PropsWithChildren<{ elevation: Elevation; surface?: string }>) => (\n <div className={mx('p-4 rounded-sm', surface, surfaceShadow({ elevation }))}>{children}</div>\n);\n\nconst Panel = ({\n Story,\n elevations,\n densities,\n className,\n}: { Story: ComponentType } & Config & { className?: string }) => {\n return (\n <div className={mx('flex flex-col h-full p-8 gap-8', className)}>\n {elevations?.map(({ elevation, surface }) =>\n densities?.map((density) => (\n <Container key={`${elevation}--${density}`} surface={surface} elevation={elevation}>\n <Story />\n </Container>\n )),\n )}\n </div>\n );\n};\n\nexport const withLayoutVariants = ({\n elevations = [\n { elevation: 'dialog', surface: 'bg-modal-surface' },\n { elevation: 'positioned', surface: 'bg-card-surface' },\n { elevation: 'base', surface: 'bg-base-surface' },\n ],\n densities = ['md'],\n}: Config = {}): Decorator => {\n return (Story) => <Panel Story={Story} elevations={elevations} densities={densities} />;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport React from 'react';\nimport { I18nProvider } from 'react-aria-components';\n\nimport { type ThemeMode } from '@dxos/ui-types';\n\nimport { Tooltip } from '../../components';\nimport { type ThemeContextValue, ThemeProvider } from '../../primitives';\nimport { defaultTx } from '../../theme';\n\n/**\n * Adds theme decorator.\n *\n * `I18nProvider` is included so react-aria-components-backed widgets (DateField, Calendar, …)\n * have a guaranteed locale in headless test environments where `navigator.language` may be\n * empty.\n */\nexport const withTheme =\n ({ tx = defaultTx, noCache, platform }: Partial<ThemeContextValue> = {}): Decorator =>\n (Story, context) => {\n const {\n globals: { theme },\n parameters: { translations },\n } = context;\n\n return (\n <I18nProvider locale='en-US'>\n <ThemeProvider\n tx={tx}\n themeMode={(theme as ThemeMode) || 'dark'}\n resourceExtensions={translations}\n noCache={noCache}\n platform={platform}\n >\n <Tooltip.Provider>\n <Story />\n </Tooltip.Provider>\n </ThemeProvider>\n </I18nProvider>\n );\n };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { captureOwnerStack, useEffect, useState } from 'react';\n\nimport { mx } from '@dxos/ui-theme';\nimport { safeStringify } from '@dxos/util';\n\nimport { ErrorStack, parseCaptureOwnerStack } from '../components';\n\nexport type LoadingProps = { data?: any };\n\n/**\n * Storybook loading component.\n */\nexport const Loading = ({ data }: LoadingProps) => {\n const [visible, setVisible] = useState(false);\n const ownerFrames = parseCaptureOwnerStack(captureOwnerStack());\n\n useEffect(() => {\n const t = setTimeout(() => setVisible(true), 500);\n return () => clearTimeout(t);\n }, []);\n\n return (\n <div className='grid p-2'>\n <div\n className={mx(\n 'flex flex-col w-full p-2 border-2 border-teal-500 rounded-md',\n 'opacity-0 transition delay-1000 duration-1000',\n 'overflow-auto',\n visible && 'opacity-100',\n )}\n >\n <h2 className='uppercase capitalize text-xs'>Loading State</h2>\n <pre className='text-sm text-description'>{safeStringify(data, undefined, 2)}</pre>\n\n <h3 className='uppercase capitalize text-xs mt-2'>Owner stack</h3>\n {ownerFrames && ownerFrames.length > 0 ? (\n <ErrorStack frames={ownerFrames} />\n ) : (\n <p className='text-xs text-subdued'>No owner stack (production build or unsupported context).</p>\n )}\n </div>\n </div>\n );\n};\n"],
5
+ "mappings": ";;;;;;;;;AAKA,OAAOA,SAA0CC,YAAY;AAG7D,SAASC,UAAU;AAiBZ,IAAMC,aACX,CAACC,QAAyB,CAAC,MAC3B,CAACC,UAAAA;AAEC,QAAMC,gBAAgBL,qBAAKI,KAAAA;AAC3B,MAAI,OAAOD,UAAU,YAAY;AAC/B,UAAMG,aAAYH;AAClB,WACE,sBAAA,cAACG,YAAAA,MACC,sBAAA,cAACD,eAAAA,IAAAA,CAAAA;EAGP,OAAO;AACL,UAAM,EAAEE,SAAS,WAAWC,YAAYC,OAAM,IAAKN;AACnD,UAAMG,aAAYI,QAAQH,MAAAA,KAAWG,QAAQC;AAC7C,WACE,sBAAA,cAACL,YAAAA;MAAUE,YAAYP,GAAGQ,SAAS,oBAAoB,mBAAmBD,UAAAA;OACxE,sBAAA,cAACH,eAAAA,IAAAA,CAAAA;EAGP;AACF;AAE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ACA,iBACAb,WAAW,aAAA;KAGb,gBAAAU,OAAA,cAACI,MAAAA;IAAGF,WAAU;KAA+B,eAAA,GAC7C,gBAAAF,OAAA,cAACK,OAAAA;IAAIH,WAAU;KAA4BI,cAAcjB,MAAMkB,QAAW,CAAA,CAAA,GAE1E,gBAAAP,OAAA,cAACQ,MAAAA;IAAGN,WAAU;KAAoC,aAAA,GACjDT,eAAeA,YAAYgB,SAAS,IACnC,gBAAAT,OAAA,cAACU,YAAAA;IAAWC,QAAQlB;OAEpB,gBAAAO,OAAA,cAACY,KAAAA;IAAEV,WAAU;KAAuB,2DAAA,CAAA,CAAA;AAK9C;",
6
6
  "names": ["React", "memo", "mx", "withLayout", "props", "Story", "MemoizedStory", "Container", "layout", "classNames", "scroll", "layouts", "fullscreen", "default", "children", "div", "className", "centered", "column", "React", "mx", "surfaceShadow", "Container", "children", "elevation", "surface", "div", "className", "Panel", "Story", "elevations", "densities", "map", "density", "key", "withLayoutVariants", "React", "I18nProvider", "withTheme", "tx", "defaultTx", "noCache", "platform", "Story", "context", "globals", "theme", "parameters", "translations", "React", "I18nProvider", "locale", "ThemeProvider", "themeMode", "resourceExtensions", "Tooltip", "Provider", "React", "captureOwnerStack", "useEffect", "useState", "mx", "safeStringify", "Loading", "data", "visible", "setVisible", "useState", "ownerFrames", "parseCaptureOwnerStack", "captureOwnerStack", "useEffect", "t", "setTimeout", "clearTimeout", "React", "div", "className", "mx", "h2", "pre", "safeStringify", "undefined", "h3", "length", "ErrorStack", "frames", "p"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  translationKey,
3
3
  translations
4
- } from "./chunk-HFJYTGHU.mjs";
4
+ } from "./chunk-CMHHVHX3.mjs";
5
5
  export {
6
6
  translationKey,
7
7
  translations