@dxos/storybook-utils 0.8.3 → 0.8.4-main.2e9d522
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 +139 -90
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +139 -90
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/CardContainers/ExtrinsicCardContainer.d.ts +12 -0
- package/dist/types/src/components/CardContainers/ExtrinsicCardContainer.d.ts.map +1 -0
- package/dist/types/src/components/CardContainers/IntrinsicCardContainer.d.ts +9 -0
- package/dist/types/src/components/CardContainers/IntrinsicCardContainer.d.ts.map +1 -0
- package/dist/types/src/components/CardContainers/PopoverCardContainer.d.ts +5 -0
- package/dist/types/src/components/CardContainers/PopoverCardContainer.d.ts.map +1 -0
- package/dist/types/src/components/CardContainers/index.d.ts +4 -0
- package/dist/types/src/components/CardContainers/index.d.ts.map +1 -0
- package/dist/types/src/components/DocsContainer.d.ts +4 -0
- package/dist/types/src/components/DocsContainer.d.ts.map +1 -0
- package/dist/types/src/components/ThemeEditor.d.ts +5 -0
- package/dist/types/src/components/ThemeEditor.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +3 -0
- package/dist/types/src/components/index.d.ts.map +1 -0
- package/dist/types/src/decorators/index.d.ts +1 -1
- package/dist/types/src/decorators/index.d.ts.map +1 -1
- package/dist/types/src/decorators/withLayout.d.ts +5 -4
- package/dist/types/src/decorators/withLayout.d.ts.map +1 -1
- package/dist/types/src/decorators/withTheme.d.ts +1 -2
- package/dist/types/src/decorators/withTheme.d.ts.map +1 -1
- package/dist/types/src/decorators/withThemeEditor.d.ts +6 -0
- package/dist/types/src/decorators/withThemeEditor.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/stories/test/Test.d.ts +6 -0
- package/dist/types/src/stories/test/Test.d.ts.map +1 -0
- package/dist/types/src/stories/test/Test.stories.d.ts +12 -0
- package/dist/types/src/stories/test/Test.stories.d.ts.map +1 -0
- package/dist/types/src/stories/test/Test.test.d.ts +2 -0
- package/dist/types/src/stories/test/Test.test.d.ts.map +1 -0
- package/dist/types/src/vitest-setup.d.ts +2 -0
- package/dist/types/src/vitest-setup.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -14
- package/src/components/CardContainers/ExtrinsicCardContainer.tsx +72 -0
- package/src/components/CardContainers/IntrinsicCardContainer.tsx +48 -0
- package/src/components/CardContainers/PopoverCardContainer.tsx +24 -0
- package/src/components/CardContainers/index.ts +7 -0
- package/src/components/DocsContainer.tsx +18 -0
- package/src/components/ThemeEditor.tsx +18 -0
- package/src/components/index.ts +7 -0
- package/src/decorators/index.ts +1 -1
- package/src/decorators/withLayout.tsx +9 -6
- package/src/decorators/withTheme.tsx +9 -63
- package/src/decorators/withThemeEditor.tsx +28 -0
- package/src/index.ts +1 -0
- package/src/stories/test/Test.stories.tsx +62 -0
- package/src/stories/test/Test.test.tsx +40 -0
- package/src/stories/test/Test.tsx +15 -0
- package/src/stories/test/__snapshots__/Test.test.tsx.snap +3 -0
- package/src/stories/test/index.mdx +14 -0
- package/src/vitest-setup.ts +11 -0
- package/README.yml +0 -1
- package/dist/lib/node/index.cjs +0 -170
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/types/src/decorators/withSignals.d.ts +0 -6
- package/dist/types/src/decorators/withSignals.d.ts.map +0 -1
- package/src/decorators/withSignals.tsx +0 -16
|
@@ -1,11 +1,103 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
|
|
3
|
-
//
|
|
4
|
-
import { registerSignalsRuntime
|
|
3
|
+
// src/index.ts
|
|
4
|
+
import { registerSignalsRuntime } from "@dxos/echo-signals/react";
|
|
5
|
+
|
|
6
|
+
// src/components/ThemeEditor.tsx
|
|
7
|
+
import React, { memo } from "react";
|
|
8
|
+
import { DxThemeEditor as NaturalDxThemeEditor } from "@dxos/lit-theme-editor";
|
|
9
|
+
import { createComponent } from "@dxos/lit-ui/react";
|
|
10
|
+
import "@dxos/lit-theme-editor/dx-theme-editor.pcss";
|
|
11
|
+
var DxThemeEditor = createComponent({
|
|
12
|
+
tagName: "dx-theme-editor",
|
|
13
|
+
elementClass: NaturalDxThemeEditor,
|
|
14
|
+
react: React
|
|
15
|
+
});
|
|
16
|
+
var ThemeEditor = /* @__PURE__ */ memo(DxThemeEditor);
|
|
17
|
+
|
|
18
|
+
// src/components/CardContainers/ExtrinsicCardContainer.tsx
|
|
19
|
+
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
20
|
+
import React2 from "react";
|
|
21
|
+
import { ResizeHandle, resizeAttributes, sizeStyle } from "@dxos/react-ui-dnd";
|
|
22
|
+
var DEFAULT_INLINE_SIZE = 24;
|
|
23
|
+
var MIN_INLINE_SIZE = 8;
|
|
24
|
+
var DEFAULT_BLOCK_SIZE = 24;
|
|
25
|
+
var MIN_BLOCK_SIZE = 8;
|
|
26
|
+
var ExtrinsicCardContainer = ({ children, defaultInlineSize, inlineSize: propInlineSize, defaultBlockSize, blockSize: propBlockSize, onInlineSizeChange, onBlockSizeChange }) => {
|
|
27
|
+
const [inlineSize = DEFAULT_INLINE_SIZE, setInlineSize] = useControllableState({
|
|
28
|
+
prop: propInlineSize,
|
|
29
|
+
defaultProp: defaultInlineSize,
|
|
30
|
+
onChange: onInlineSizeChange
|
|
31
|
+
});
|
|
32
|
+
const [blockSize = DEFAULT_BLOCK_SIZE, setBlockSize] = useControllableState({
|
|
33
|
+
prop: propBlockSize,
|
|
34
|
+
defaultProp: defaultBlockSize,
|
|
35
|
+
onChange: onBlockSizeChange
|
|
36
|
+
});
|
|
37
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
38
|
+
className: "grid relative border border-dashed border-subduedSeparator p-4 rounded-lg overflow-hidden contain-layout",
|
|
39
|
+
style: {
|
|
40
|
+
...sizeStyle(inlineSize, "horizontal"),
|
|
41
|
+
...sizeStyle(blockSize, "vertical")
|
|
42
|
+
},
|
|
43
|
+
...resizeAttributes
|
|
44
|
+
}, children, /* @__PURE__ */ React2.createElement(ResizeHandle, {
|
|
45
|
+
side: "inline-end",
|
|
46
|
+
fallbackSize: DEFAULT_INLINE_SIZE,
|
|
47
|
+
minSize: MIN_INLINE_SIZE,
|
|
48
|
+
size: inlineSize,
|
|
49
|
+
onSizeChange: setInlineSize
|
|
50
|
+
}), /* @__PURE__ */ React2.createElement(ResizeHandle, {
|
|
51
|
+
side: "block-end",
|
|
52
|
+
fallbackSize: DEFAULT_BLOCK_SIZE,
|
|
53
|
+
minSize: MIN_BLOCK_SIZE,
|
|
54
|
+
size: blockSize,
|
|
55
|
+
onSizeChange: setBlockSize
|
|
56
|
+
}));
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// src/components/CardContainers/IntrinsicCardContainer.tsx
|
|
60
|
+
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
61
|
+
import React3 from "react";
|
|
62
|
+
import { ResizeHandle as ResizeHandle2, resizeAttributes as resizeAttributes2, sizeStyle as sizeStyle2 } from "@dxos/react-ui-dnd";
|
|
63
|
+
var DEFAULT_SIZE = 24;
|
|
64
|
+
var MIN_SIZE = 8;
|
|
65
|
+
var IntrinsicCardContainer = ({ children, defaultSize, size: propSize, onSizeChange }) => {
|
|
66
|
+
const [size = DEFAULT_SIZE, setSize] = useControllableState2({
|
|
67
|
+
prop: propSize,
|
|
68
|
+
defaultProp: defaultSize,
|
|
69
|
+
onChange: onSizeChange
|
|
70
|
+
});
|
|
71
|
+
return /* @__PURE__ */ React3.createElement("div", {
|
|
72
|
+
className: "relative border border-dashed border-subduedSeparator p-4 rounded-lg",
|
|
73
|
+
style: sizeStyle2(size, "horizontal"),
|
|
74
|
+
...resizeAttributes2
|
|
75
|
+
}, children, /* @__PURE__ */ React3.createElement(ResizeHandle2, {
|
|
76
|
+
side: "inline-end",
|
|
77
|
+
fallbackSize: DEFAULT_SIZE,
|
|
78
|
+
minSize: MIN_SIZE,
|
|
79
|
+
size,
|
|
80
|
+
onSizeChange: setSize
|
|
81
|
+
}));
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// src/components/CardContainers/PopoverCardContainer.tsx
|
|
85
|
+
import React4 from "react";
|
|
86
|
+
import { Icon, Popover } from "@dxos/react-ui";
|
|
87
|
+
var PopoverCardContainer = ({ children, icon = "ph--placeholder--regular" }) => {
|
|
88
|
+
return /* @__PURE__ */ React4.createElement(Popover.Root, {
|
|
89
|
+
open: true
|
|
90
|
+
}, /* @__PURE__ */ React4.createElement(Popover.Content, {
|
|
91
|
+
onOpenAutoFocus: (event) => event.preventDefault()
|
|
92
|
+
}, /* @__PURE__ */ React4.createElement(Popover.Viewport, null, children), /* @__PURE__ */ React4.createElement(Popover.Arrow, null)), /* @__PURE__ */ React4.createElement(Popover.Trigger, null, /* @__PURE__ */ React4.createElement(Icon, {
|
|
93
|
+
icon,
|
|
94
|
+
size: 5
|
|
95
|
+
})));
|
|
96
|
+
};
|
|
5
97
|
|
|
6
|
-
//
|
|
98
|
+
// src/decorators/withLayout.tsx
|
|
7
99
|
import defaultsDeep from "lodash.defaultsdeep";
|
|
8
|
-
import
|
|
100
|
+
import React5 from "react";
|
|
9
101
|
import { DensityProvider } from "@dxos/react-ui";
|
|
10
102
|
import { mx } from "@dxos/react-ui-theme";
|
|
11
103
|
var defaultOptions = {
|
|
@@ -13,131 +105,88 @@ var defaultOptions = {
|
|
|
13
105
|
};
|
|
14
106
|
var providers = [
|
|
15
107
|
(children, options) => {
|
|
16
|
-
return options?.density ? /* @__PURE__ */
|
|
108
|
+
return options?.density ? /* @__PURE__ */ React5.createElement(DensityProvider, {
|
|
17
109
|
density: options.density
|
|
18
110
|
}, children) : children;
|
|
19
111
|
}
|
|
20
112
|
];
|
|
21
|
-
var withLayout = ({ classNames, fullscreen, Container = fullscreen ?
|
|
113
|
+
var withLayout = ({ classNames, fullscreen, Container = fullscreen ? FullscreenContainer : DefaultContainer, ...providedOptions } = {}) => {
|
|
22
114
|
return (Story, _context) => {
|
|
23
|
-
const children = /* @__PURE__ */
|
|
115
|
+
const children = /* @__PURE__ */ React5.createElement(Container, {
|
|
24
116
|
classNames,
|
|
25
117
|
fullscreen
|
|
26
|
-
}, /* @__PURE__ */
|
|
118
|
+
}, /* @__PURE__ */ React5.createElement(Story, null));
|
|
27
119
|
const options = defaultsDeep({}, providedOptions, defaultOptions);
|
|
28
120
|
return providers.reduceRight((acc, provider) => provider(acc, options), children);
|
|
29
121
|
};
|
|
30
122
|
};
|
|
123
|
+
var layoutCentered = "bg-deckSurface justify-center overflow-y-auto";
|
|
31
124
|
var DefaultContainer = ({ children, classNames }) => {
|
|
32
|
-
return /* @__PURE__ */
|
|
125
|
+
return /* @__PURE__ */ React5.createElement("div", {
|
|
33
126
|
role: "none",
|
|
34
127
|
className: mx(classNames)
|
|
35
128
|
}, children);
|
|
36
129
|
};
|
|
37
|
-
var
|
|
38
|
-
return /* @__PURE__ */
|
|
130
|
+
var FullscreenContainer = ({ children, classNames }) => {
|
|
131
|
+
return /* @__PURE__ */ React5.createElement("div", {
|
|
39
132
|
role: "none",
|
|
40
133
|
className: mx("fixed inset-0 flex overflow-hidden", classNames)
|
|
41
134
|
}, children);
|
|
42
135
|
};
|
|
43
136
|
var ColumnContainer = ({ children, classNames = "w-[30rem]", ...props }) => {
|
|
44
|
-
return /* @__PURE__ */
|
|
137
|
+
return /* @__PURE__ */ React5.createElement(FullscreenContainer, {
|
|
45
138
|
classNames: "justify-center bg-modalSurface",
|
|
46
139
|
...props
|
|
47
|
-
}, /* @__PURE__ */
|
|
140
|
+
}, /* @__PURE__ */ React5.createElement("div", {
|
|
48
141
|
role: "none",
|
|
49
142
|
className: mx("flex flex-col h-full overflow-y-auto bg-baseSurface", classNames)
|
|
50
143
|
}, children));
|
|
51
144
|
};
|
|
52
145
|
|
|
53
|
-
//
|
|
54
|
-
import
|
|
55
|
-
import {
|
|
56
|
-
var withSignals = (Story) => {
|
|
57
|
-
registerSignalsRuntime();
|
|
58
|
-
return /* @__PURE__ */ React2.createElement(Story, null);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
// packages/common/storybook-utils/src/decorators/withTheme.tsx
|
|
62
|
-
import { addons } from "@storybook/preview-api";
|
|
63
|
-
import React3, { memo, useCallback, useEffect, useState } from "react";
|
|
64
|
-
import { DARK_MODE_EVENT_NAME } from "storybook-dark-mode";
|
|
65
|
-
import { DxThemeEditor as NaturalDxThemeEditor } from "@dxos/lit-theme-editor";
|
|
66
|
-
import "@dxos/lit-theme-editor/dx-theme-editor.pcss";
|
|
67
|
-
import { createComponent } from "@dxos/lit-ui/react";
|
|
68
|
-
import { ThemeProvider, Tooltip, Dialog, IconButton } from "@dxos/react-ui";
|
|
146
|
+
// src/decorators/withTheme.tsx
|
|
147
|
+
import React6, { memo as memo2 } from "react";
|
|
148
|
+
import { ThemeProvider, Tooltip } from "@dxos/react-ui";
|
|
69
149
|
import { defaultTx } from "@dxos/react-ui-theme";
|
|
70
|
-
import { PARAM_KEY } from "@dxos/theme-editor-addon";
|
|
71
|
-
var DxThemeEditor = createComponent({
|
|
72
|
-
tagName: "dx-theme-editor",
|
|
73
|
-
elementClass: NaturalDxThemeEditor,
|
|
74
|
-
react: React3
|
|
75
|
-
});
|
|
76
150
|
var withTheme = (Story, context) => {
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
const handleOpenChange = useCallback((nextOpen) => {
|
|
81
|
-
setEditorOpen(nextOpen);
|
|
82
|
-
}, []);
|
|
83
|
-
useEffect(() => {
|
|
84
|
-
const handleDarkModeUpdate = (darkMode) => setThemeMode(darkMode ? "dark" : "light");
|
|
85
|
-
addons.getChannel().on(DARK_MODE_EVENT_NAME, handleDarkModeUpdate);
|
|
86
|
-
return () => addons.getChannel().off(DARK_MODE_EVENT_NAME, handleDarkModeUpdate);
|
|
87
|
-
}, []);
|
|
88
|
-
useEffect(() => {
|
|
89
|
-
const openEditor = () => {
|
|
90
|
-
handleOpenChange(true);
|
|
91
|
-
};
|
|
92
|
-
addons.getChannel().on(PARAM_KEY, openEditor);
|
|
93
|
-
return () => addons.getChannel().off(PARAM_KEY, openEditor);
|
|
94
|
-
}, []);
|
|
95
|
-
return /* @__PURE__ */ React3.createElement(ThemeProvider, {
|
|
151
|
+
const { globals: { theme }, parameters: { translations } } = context;
|
|
152
|
+
const MemoizedStory = /* @__PURE__ */ memo2(Story);
|
|
153
|
+
return /* @__PURE__ */ React6.createElement(ThemeProvider, {
|
|
96
154
|
tx: defaultTx,
|
|
97
|
-
themeMode,
|
|
98
|
-
resourceExtensions:
|
|
155
|
+
themeMode: theme,
|
|
156
|
+
resourceExtensions: translations,
|
|
99
157
|
noCache: true
|
|
100
|
-
}, /* @__PURE__ */
|
|
101
|
-
open: editorOpen,
|
|
102
|
-
onOpenChange: handleOpenChange,
|
|
103
|
-
modal: false
|
|
104
|
-
}, /* @__PURE__ */ React3.createElement("div", {
|
|
105
|
-
role: "none",
|
|
106
|
-
className: "dx-dialog__overlay bg-transparent pointer-events-none",
|
|
107
|
-
style: {
|
|
108
|
-
placeContent: "end"
|
|
109
|
-
}
|
|
110
|
-
}, /* @__PURE__ */ React3.createElement(Dialog.Content, {
|
|
111
|
-
classNames: "relative box-content py-0 px-2 md:is-[35rem] md:max-is-none overflow-y-auto layout-contain pointer-events-auto",
|
|
112
|
-
style: {
|
|
113
|
-
maxBlockSize: "50dvh"
|
|
114
|
-
},
|
|
115
|
-
onInteractOutside: (event) => event.preventDefault()
|
|
116
|
-
}, /* @__PURE__ */ React3.createElement(Dialog.Title, {
|
|
117
|
-
srOnly: true
|
|
118
|
-
}, "Theme Editor"), editorOpen && /* @__PURE__ */ React3.createElement(DxThemeEditor, null), /* @__PURE__ */ React3.createElement(Dialog.Close, {
|
|
119
|
-
asChild: true
|
|
120
|
-
}, /* @__PURE__ */ React3.createElement(IconButton, {
|
|
121
|
-
iconOnly: true,
|
|
122
|
-
icon: "ph--x--regular",
|
|
123
|
-
label: "Close",
|
|
124
|
-
classNames: "absolute block-start-2 inline-end-2"
|
|
125
|
-
})))))));
|
|
158
|
+
}, /* @__PURE__ */ React6.createElement(Tooltip.Provider, null, /* @__PURE__ */ React6.createElement(MemoizedStory, null)));
|
|
126
159
|
};
|
|
127
160
|
|
|
128
|
-
//
|
|
129
|
-
import
|
|
130
|
-
var
|
|
161
|
+
// src/decorators/withThemeEditor.tsx
|
|
162
|
+
import React7, { memo as memo3 } from "react";
|
|
163
|
+
var withThemeEditor = (Story, context) => {
|
|
164
|
+
const MemoizedStory = /* @__PURE__ */ memo3(Story);
|
|
165
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(MemoizedStory, null), /* @__PURE__ */ React7.createElement("div", {
|
|
166
|
+
className: "absolute top-4 bottom-4 right-4 z-10"
|
|
167
|
+
}, /* @__PURE__ */ React7.createElement("div", {
|
|
168
|
+
className: "h-full is-[35rem] overflow-auto bg-baseSurface border border-separator rounded"
|
|
169
|
+
}, /* @__PURE__ */ React7.createElement(ThemeEditor, null))));
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// src/util.tsx
|
|
173
|
+
import React8 from "react";
|
|
174
|
+
var render = (r) => (args) => /* @__PURE__ */ React8.createElement(React8.Fragment, null, r(args) ?? /* @__PURE__ */ React8.createElement("div", null));
|
|
131
175
|
|
|
132
|
-
//
|
|
133
|
-
|
|
176
|
+
// src/index.ts
|
|
177
|
+
registerSignalsRuntime();
|
|
134
178
|
export {
|
|
135
179
|
ColumnContainer,
|
|
136
180
|
DefaultContainer,
|
|
137
|
-
|
|
181
|
+
ExtrinsicCardContainer,
|
|
182
|
+
FullscreenContainer,
|
|
183
|
+
IntrinsicCardContainer,
|
|
184
|
+
PopoverCardContainer,
|
|
185
|
+
ThemeEditor,
|
|
186
|
+
layoutCentered,
|
|
138
187
|
render,
|
|
139
188
|
withLayout,
|
|
140
|
-
|
|
141
|
-
|
|
189
|
+
withTheme,
|
|
190
|
+
withThemeEditor
|
|
142
191
|
};
|
|
143
192
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/index.ts", "../../../src/decorators/withLayout.tsx", "../../../src/decorators/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { registerSignalsRuntime } from '@dxos/echo-signals/react';\n\nexport { type Meta } from '@storybook/react';\n\nexport * from './decorators';\nexport * from './util';\n\nregisterSignalsRuntime();\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport defaultsDeep from 'lodash.defaultsdeep';\nimport React, { type PropsWithChildren, type JSX, type FC } from 'react';\n\nimport { type Density, DensityProvider, type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\n\ntype ProviderOptions = {\n fullscreen?: boolean;\n density?: Density;\n};\n\nconst defaultOptions: ProviderOptions = {\n density: 'fine',\n};\n\ntype Provider = (children: JSX.Element, options: ProviderOptions) => JSX.Element;\n\nconst providers: Provider[] = [\n (children, options) => {\n return options?.density ? <DensityProvider density={options.density}>{children}</DensityProvider> : children;\n },\n];\n\nexport type ContainerProps = ThemedClassName<PropsWithChildren<Pick<ProviderOptions, 'fullscreen'>>>;\n\nexport type WithLayoutProps = ThemedClassName<ProviderOptions & { Container?: FC<ContainerProps> }>;\n\n/**\n * Decorator to layout the story container, adding optional providers.\n */\nexport const withLayout = ({\n classNames,\n fullscreen,\n Container = fullscreen ?
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,
|
|
6
|
-
"names": ["registerSignalsRuntime", "
|
|
3
|
+
"sources": ["../../../src/index.ts", "../../../src/components/ThemeEditor.tsx", "../../../src/components/CardContainers/ExtrinsicCardContainer.tsx", "../../../src/components/CardContainers/IntrinsicCardContainer.tsx", "../../../src/components/CardContainers/PopoverCardContainer.tsx", "../../../src/decorators/withLayout.tsx", "../../../src/decorators/withTheme.tsx", "../../../src/decorators/withThemeEditor.tsx", "../../../src/util.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { registerSignalsRuntime } from '@dxos/echo-signals/react';\n\nexport { type Meta } from '@storybook/react';\n\nexport * from './components';\nexport * from './decorators';\nexport * from './util';\n\nregisterSignalsRuntime();\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { memo } from 'react';\n\nimport { DxThemeEditor as NaturalDxThemeEditor } from '@dxos/lit-theme-editor';\nimport { createComponent } from '@dxos/lit-ui/react';\n\nimport '@dxos/lit-theme-editor/dx-theme-editor.pcss';\n\nconst DxThemeEditor = createComponent({\n tagName: 'dx-theme-editor',\n elementClass: NaturalDxThemeEditor,\n react: React,\n});\n\nexport const ThemeEditor = memo(DxThemeEditor);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, { type PropsWithChildren } from 'react';\n\nimport { ResizeHandle, resizeAttributes, sizeStyle, type Size } from '@dxos/react-ui-dnd';\n\n// Default size in rem\nconst DEFAULT_INLINE_SIZE = 24;\nconst MIN_INLINE_SIZE = 8;\nconst DEFAULT_BLOCK_SIZE = 24;\nconst MIN_BLOCK_SIZE = 8;\n\nexport type ExtrinsicCardContainerProps = PropsWithChildren<{\n defaultInlineSize?: Size;\n inlineSize?: Size;\n defaultBlockSize?: Size;\n blockSize?: Size;\n onInlineSizeChange?: (size: Size, commit?: boolean) => void;\n onBlockSizeChange?: (size: Size, commit?: boolean) => void;\n}>;\n\nexport const ExtrinsicCardContainer = ({\n children,\n defaultInlineSize,\n inlineSize: propInlineSize,\n defaultBlockSize,\n blockSize: propBlockSize,\n onInlineSizeChange,\n onBlockSizeChange,\n}: ExtrinsicCardContainerProps) => {\n const [inlineSize = DEFAULT_INLINE_SIZE, setInlineSize] = useControllableState<Size>({\n prop: propInlineSize,\n defaultProp: defaultInlineSize,\n onChange: onInlineSizeChange,\n });\n\n const [blockSize = DEFAULT_BLOCK_SIZE, setBlockSize] = useControllableState<Size>({\n prop: propBlockSize,\n defaultProp: defaultBlockSize,\n onChange: onBlockSizeChange,\n });\n\n return (\n <div\n className='grid relative border border-dashed border-subduedSeparator p-4 rounded-lg overflow-hidden contain-layout'\n style={{\n ...sizeStyle(inlineSize, 'horizontal'),\n ...sizeStyle(blockSize, 'vertical'),\n }}\n {...resizeAttributes}\n >\n {children}\n <ResizeHandle\n side='inline-end'\n fallbackSize={DEFAULT_INLINE_SIZE}\n minSize={MIN_INLINE_SIZE}\n size={inlineSize}\n onSizeChange={setInlineSize}\n />\n <ResizeHandle\n side='block-end'\n fallbackSize={DEFAULT_BLOCK_SIZE}\n minSize={MIN_BLOCK_SIZE}\n size={blockSize}\n onSizeChange={setBlockSize}\n />\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, { type PropsWithChildren } from 'react';\n\nimport { ResizeHandle, resizeAttributes, sizeStyle, type Size } from '@dxos/react-ui-dnd';\n\n// Default size in rem\nconst DEFAULT_SIZE = 24;\nconst MIN_SIZE = 8;\n\nexport type IntrinsicCardContainerProps = PropsWithChildren<{\n defaultSize?: Size;\n size?: Size;\n onSizeChange?: (size: Size, commit?: boolean) => void;\n}>;\n\nexport const IntrinsicCardContainer = ({\n children,\n defaultSize,\n size: propSize,\n onSizeChange,\n}: IntrinsicCardContainerProps) => {\n const [size = DEFAULT_SIZE, setSize] = useControllableState<Size>({\n prop: propSize,\n defaultProp: defaultSize,\n onChange: onSizeChange,\n });\n\n return (\n <div\n className='relative border border-dashed border-subduedSeparator p-4 rounded-lg'\n style={sizeStyle(size, 'horizontal')}\n {...resizeAttributes}\n >\n {children}\n <ResizeHandle\n side='inline-end'\n fallbackSize={DEFAULT_SIZE}\n minSize={MIN_SIZE}\n size={size}\n onSizeChange={setSize}\n />\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type PropsWithChildren } from 'react';\n\nimport { Icon, Popover } from '@dxos/react-ui';\n\nexport const PopoverCardContainer = ({\n children,\n icon = 'ph--placeholder--regular',\n}: PropsWithChildren<{ icon: string }>) => {\n return (\n <Popover.Root open>\n <Popover.Content onOpenAutoFocus={(event) => event.preventDefault()}>\n <Popover.Viewport>{children}</Popover.Viewport>\n <Popover.Arrow />\n </Popover.Content>\n <Popover.Trigger>\n <Icon icon={icon} size={5} />\n </Popover.Trigger>\n </Popover.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport defaultsDeep from 'lodash.defaultsdeep';\nimport React, { type PropsWithChildren, type JSX, type FC } from 'react';\n\nimport { type Density, DensityProvider, type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\n\ntype ProviderOptions = {\n fullscreen?: boolean;\n density?: Density;\n};\n\nconst defaultOptions: ProviderOptions = {\n density: 'fine',\n};\n\ntype Provider = (children: JSX.Element, options: ProviderOptions) => JSX.Element;\n\nconst providers: Provider[] = [\n (children, options) => {\n return options?.density ? <DensityProvider density={options.density}>{children}</DensityProvider> : children;\n },\n];\n\nexport type ContainerProps = ThemedClassName<PropsWithChildren<Pick<ProviderOptions, 'fullscreen'>>>;\n\nexport type WithLayoutProps = ThemedClassName<ProviderOptions & { Container?: FC<ContainerProps> }>;\n\n/**\n * Decorator to layout the story container, adding optional providers.\n */\nexport const withLayout = ({\n classNames,\n fullscreen,\n Container = fullscreen ? FullscreenContainer : DefaultContainer,\n ...providedOptions\n}: WithLayoutProps = {}): Decorator => {\n // TODO(burdon): Inspect \"fullscreen\" parameter in context.\n return (Story, _context) => {\n const children = (\n <Container classNames={classNames} fullscreen={fullscreen}>\n <Story />\n </Container>\n );\n\n const options = defaultsDeep({}, providedOptions, defaultOptions);\n return providers.reduceRight((acc, provider) => provider(acc, options), children);\n };\n};\n\n// TODO(burdon): Use consistently.\nexport const layoutCentered = 'bg-deckSurface justify-center overflow-y-auto';\n\nexport const DefaultContainer = ({ children, classNames }: ContainerProps) => {\n return (\n <div role='none' className={mx(classNames)}>\n {children}\n </div>\n );\n};\n\nexport const FullscreenContainer = ({ children, classNames }: ContainerProps) => {\n return (\n <div role='none' className={mx('fixed inset-0 flex overflow-hidden', classNames)}>\n {children}\n </div>\n );\n};\n\nexport const ColumnContainer = ({ children, classNames = 'w-[30rem]', ...props }: ContainerProps) => {\n return (\n <FullscreenContainer classNames='justify-center bg-modalSurface' {...props}>\n <div role='none' className={mx('flex flex-col h-full overflow-y-auto bg-baseSurface', classNames)}>\n {children}\n </div>\n </FullscreenContainer>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport React, { memo } from 'react';\n\nimport { type ThemeMode, ThemeProvider, Tooltip } from '@dxos/react-ui';\nimport { defaultTx } from '@dxos/react-ui-theme';\n\n/**\n * Adds theme decorator.\n */\nexport const withTheme: Decorator = (Story, context) => {\n const {\n globals: { theme },\n parameters: { translations },\n } = context;\n\n // Prevent re-rendering of the story.\n const MemoizedStory = memo(Story);\n\n return (\n <ThemeProvider tx={defaultTx} themeMode={theme as ThemeMode} resourceExtensions={translations} noCache>\n <Tooltip.Provider>\n <MemoizedStory />\n </Tooltip.Provider>\n </ThemeProvider>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport React, { memo } from 'react';\n\nimport { ThemeEditor } from '../components';\n\n/**\n * Show theme editor.\n */\n// TODO(burdon): Ideally move to storybook-addon-theme, but this has a build issue since the addon would depend on the vite theme plugin.\nexport const withThemeEditor: Decorator = (Story, context) => {\n // Prevent re-rendering of the story.\n const MemoizedStory = memo(Story);\n\n return (\n <>\n <MemoizedStory />\n <div className='absolute top-4 bottom-4 right-4 z-10'>\n <div className='h-full is-[35rem] overflow-auto bg-baseSurface border border-separator rounded'>\n <ThemeEditor />\n </div>\n </div>\n </>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type FC } from 'react';\n\n/**\n * Story renderer wrapper.\n */\nexport const render =\n <T,>(r: FC<T>) =>\n (args: T) => <>{r(args) ?? <div />}</>;\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["registerSignalsRuntime", "React", "memo", "DxThemeEditor", "NaturalDxThemeEditor", "createComponent", "DxThemeEditor", "createComponent", "tagName", "elementClass", "NaturalDxThemeEditor", "react", "React", "ThemeEditor", "memo", "useControllableState", "React", "ResizeHandle", "resizeAttributes", "sizeStyle", "DEFAULT_INLINE_SIZE", "MIN_INLINE_SIZE", "DEFAULT_BLOCK_SIZE", "MIN_BLOCK_SIZE", "ExtrinsicCardContainer", "children", "defaultInlineSize", "inlineSize", "propInlineSize", "defaultBlockSize", "blockSize", "propBlockSize", "onInlineSizeChange", "onBlockSizeChange", "setInlineSize", "useControllableState", "prop", "defaultProp", "onChange", "setBlockSize", "React", "div", "className", "style", "sizeStyle", "resizeAttributes", "ResizeHandle", "side", "fallbackSize", "minSize", "size", "onSizeChange", "useControllableState", "React", "ResizeHandle", "resizeAttributes", "sizeStyle", "DEFAULT_SIZE", "MIN_SIZE", "IntrinsicCardContainer", "children", "defaultSize", "size", "propSize", "onSizeChange", "setSize", "useControllableState", "prop", "defaultProp", "onChange", "React", "div", "className", "style", "sizeStyle", "resizeAttributes", "ResizeHandle", "side", "fallbackSize", "minSize", "React", "Icon", "Popover", "PopoverCardContainer", "children", "icon", "React", "Popover", "Root", "open", "Content", "onOpenAutoFocus", "event", "preventDefault", "Viewport", "Arrow", "Trigger", "Icon", "size", "defaultsDeep", "React", "DensityProvider", "mx", "defaultOptions", "density", "providers", "children", "options", "React", "DensityProvider", "withLayout", "classNames", "fullscreen", "Container", "FullscreenContainer", "DefaultContainer", "providedOptions", "Story", "_context", "defaultsDeep", "reduceRight", "acc", "provider", "layoutCentered", "div", "role", "className", "mx", "ColumnContainer", "props", "React", "memo", "ThemeProvider", "Tooltip", "defaultTx", "withTheme", "Story", "context", "globals", "theme", "parameters", "translations", "MemoizedStory", "memo", "React", "ThemeProvider", "tx", "defaultTx", "themeMode", "resourceExtensions", "noCache", "Tooltip", "Provider", "React", "memo", "withThemeEditor", "Story", "context", "MemoizedStory", "memo", "React", "div", "className", "ThemeEditor", "React", "render", "r", "args", "React", "div", "registerSignalsRuntime"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"
|
|
1
|
+
{"inputs":{"src/components/ThemeEditor.tsx":{"bytes":1828,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/lit-theme-editor","kind":"import-statement","external":true},{"path":"@dxos/lit-ui/react","kind":"import-statement","external":true},{"path":"@dxos/lit-theme-editor/dx-theme-editor.pcss","kind":"import-statement","external":true}],"format":"esm"},"src/components/CardContainers/ExtrinsicCardContainer.tsx":{"bytes":6610,"imports":[{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-dnd","kind":"import-statement","external":true}],"format":"esm"},"src/components/CardContainers/IntrinsicCardContainer.tsx":{"bytes":4021,"imports":[{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-dnd","kind":"import-statement","external":true}],"format":"esm"},"src/components/CardContainers/PopoverCardContainer.tsx":{"bytes":2566,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/components/CardContainers/index.ts":{"bytes":764,"imports":[{"path":"src/components/CardContainers/ExtrinsicCardContainer.tsx","kind":"import-statement","original":"./ExtrinsicCardContainer"},{"path":"src/components/CardContainers/IntrinsicCardContainer.tsx","kind":"import-statement","original":"./IntrinsicCardContainer"},{"path":"src/components/CardContainers/PopoverCardContainer.tsx","kind":"import-statement","original":"./PopoverCardContainer"}],"format":"esm"},"src/components/index.ts":{"bytes":686,"imports":[{"path":"src/components/ThemeEditor.tsx","kind":"import-statement","original":"./ThemeEditor"},{"path":"src/components/CardContainers/index.ts","kind":"import-statement","original":"./CardContainers"}],"format":"esm"},"src/decorators/withLayout.tsx":{"bytes":7744,"imports":[{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/decorators/withTheme.tsx":{"bytes":2822,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/decorators/withThemeEditor.tsx":{"bytes":2713,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"}],"format":"esm"},"src/decorators/index.ts":{"bytes":671,"imports":[{"path":"src/decorators/withLayout.tsx","kind":"import-statement","original":"./withLayout"},{"path":"src/decorators/withTheme.tsx","kind":"import-statement","original":"./withTheme"},{"path":"src/decorators/withThemeEditor.tsx","kind":"import-statement","original":"./withThemeEditor"}],"format":"esm"},"src/util.tsx":{"bytes":999,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":1007,"imports":[{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/decorators/index.ts","kind":"import-statement","original":"./decorators"},{"path":"src/util.tsx","kind":"import-statement","original":"./util"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":15689},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/lit-theme-editor","kind":"import-statement","external":true},{"path":"@dxos/lit-ui/react","kind":"import-statement","external":true},{"path":"@dxos/lit-theme-editor/dx-theme-editor.pcss","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-dnd","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-dnd","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["ColumnContainer","DefaultContainer","ExtrinsicCardContainer","FullscreenContainer","IntrinsicCardContainer","PopoverCardContainer","ThemeEditor","layoutCentered","render","withLayout","withTheme","withThemeEditor"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":93},"src/components/ThemeEditor.tsx":{"bytesInOutput":405},"src/components/index.ts":{"bytesInOutput":0},"src/components/CardContainers/ExtrinsicCardContainer.tsx":{"bytesInOutput":1572},"src/components/CardContainers/index.ts":{"bytesInOutput":0},"src/components/CardContainers/IntrinsicCardContainer.tsx":{"bytesInOutput":949},"src/components/CardContainers/PopoverCardContainer.tsx":{"bytesInOutput":626},"src/decorators/withLayout.tsx":{"bytesInOutput":1764},"src/decorators/index.ts":{"bytesInOutput":0},"src/decorators/withTheme.tsx":{"bytesInOutput":608},"src/decorators/withThemeEditor.tsx":{"bytesInOutput":588},"src/util.tsx":{"bytesInOutput":181}},"bytes":7524}}}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
|
+
import { type Size } from '@dxos/react-ui-dnd';
|
|
3
|
+
export type ExtrinsicCardContainerProps = PropsWithChildren<{
|
|
4
|
+
defaultInlineSize?: Size;
|
|
5
|
+
inlineSize?: Size;
|
|
6
|
+
defaultBlockSize?: Size;
|
|
7
|
+
blockSize?: Size;
|
|
8
|
+
onInlineSizeChange?: (size: Size, commit?: boolean) => void;
|
|
9
|
+
onBlockSizeChange?: (size: Size, commit?: boolean) => void;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const ExtrinsicCardContainer: ({ children, defaultInlineSize, inlineSize: propInlineSize, defaultBlockSize, blockSize: propBlockSize, onInlineSizeChange, onBlockSizeChange, }: ExtrinsicCardContainerProps) => React.JSX.Element;
|
|
12
|
+
//# sourceMappingURL=ExtrinsicCardContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExtrinsicCardContainer.d.ts","sourceRoot":"","sources":["../../../../../src/components/CardContainers/ExtrinsicCardContainer.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAA6C,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAQ1F,MAAM,MAAM,2BAA2B,GAAG,iBAAiB,CAAC;IAC1D,iBAAiB,CAAC,EAAE,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,gBAAgB,CAAC,EAAE,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5D,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5D,CAAC,CAAC;AAEH,eAAO,MAAM,sBAAsB,GAAI,iJAQpC,2BAA2B,sBAuC7B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
|
+
import { type Size } from '@dxos/react-ui-dnd';
|
|
3
|
+
export type IntrinsicCardContainerProps = PropsWithChildren<{
|
|
4
|
+
defaultSize?: Size;
|
|
5
|
+
size?: Size;
|
|
6
|
+
onSizeChange?: (size: Size, commit?: boolean) => void;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const IntrinsicCardContainer: ({ children, defaultSize, size: propSize, onSizeChange, }: IntrinsicCardContainerProps) => React.JSX.Element;
|
|
9
|
+
//# sourceMappingURL=IntrinsicCardContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntrinsicCardContainer.d.ts","sourceRoot":"","sources":["../../../../../src/components/CardContainers/IntrinsicCardContainer.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAA6C,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAM1F,MAAM,MAAM,2BAA2B,GAAG,iBAAiB,CAAC;IAC1D,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACvD,CAAC,CAAC;AAEH,eAAO,MAAM,sBAAsB,GAAI,0DAKpC,2BAA2B,sBAuB7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopoverCardContainer.d.ts","sourceRoot":"","sources":["../../../../../src/components/CardContainers/PopoverCardContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAItD,eAAO,MAAM,oBAAoB,GAAI,qBAGlC,iBAAiB,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,sBAYrC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CardContainers/index.ts"],"names":[],"mappings":"AAIA,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocsContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/DocsContainer.tsx"],"names":[],"mappings":"AAQA;;GAEG"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DxThemeEditor as NaturalDxThemeEditor } from '@dxos/lit-theme-editor';
|
|
3
|
+
import '@dxos/lit-theme-editor/dx-theme-editor.pcss';
|
|
4
|
+
export declare const ThemeEditor: React.MemoExoticComponent<import("@lit/react").ReactWebComponent<NaturalDxThemeEditor, {}>>;
|
|
5
|
+
//# sourceMappingURL=ThemeEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/ThemeEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAe,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,aAAa,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG/E,OAAO,6CAA6C,CAAC;AAQrD,eAAO,MAAM,WAAW,6FAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAKA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/decorators/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/decorators/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Decorator } from '@storybook/react';
|
|
2
|
-
import { type PropsWithChildren, type FC } from 'react';
|
|
2
|
+
import { type PropsWithChildren, type JSX, type FC } from 'react';
|
|
3
3
|
import { type Density, type ThemedClassName } from '@dxos/react-ui';
|
|
4
4
|
type ProviderOptions = {
|
|
5
5
|
fullscreen?: boolean;
|
|
@@ -13,8 +13,9 @@ export type WithLayoutProps = ThemedClassName<ProviderOptions & {
|
|
|
13
13
|
* Decorator to layout the story container, adding optional providers.
|
|
14
14
|
*/
|
|
15
15
|
export declare const withLayout: ({ classNames, fullscreen, Container, ...providedOptions }?: WithLayoutProps) => Decorator;
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
16
|
+
export declare const layoutCentered = "bg-deckSurface justify-center overflow-y-auto";
|
|
17
|
+
export declare const DefaultContainer: ({ children, classNames }: ContainerProps) => JSX.Element;
|
|
18
|
+
export declare const FullscreenContainer: ({ children, classNames }: ContainerProps) => JSX.Element;
|
|
19
|
+
export declare const ColumnContainer: ({ children, classNames, ...props }: ContainerProps) => JSX.Element;
|
|
19
20
|
export {};
|
|
20
21
|
//# sourceMappingURL=withLayout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withLayout.d.ts","sourceRoot":"","sources":["../../../../src/decorators/withLayout.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAc,EAAE,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"withLayout.d.ts","sourceRoot":"","sources":["../../../../src/decorators/withLayout.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAc,EAAE,KAAK,iBAAiB,EAAE,KAAK,GAAG,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,KAAK,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGrF,KAAK,eAAe,GAAG;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAcF,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC,iBAAiB,CAAC,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;AAErG,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,eAAe,GAAG;IAAE,SAAS,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAA;CAAE,CAAC,CAAC;AAEpG;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,4DAKxB,eAAoB,KAAG,SAYzB,CAAC;AAGF,eAAO,MAAM,cAAc,kDAAkD,CAAC;AAE9E,eAAO,MAAM,gBAAgB,GAAI,0BAA0B,cAAc,gBAMxE,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,0BAA0B,cAAc,gBAM3E,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,oCAAkD,cAAc,gBAQ/F,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type Decorator } from '@storybook/react';
|
|
2
|
-
import '@dxos/lit-theme-editor/dx-theme-editor.pcss';
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
3
|
+
* Adds theme decorator.
|
|
5
4
|
*/
|
|
6
5
|
export declare const withTheme: Decorator;
|
|
7
6
|
//# sourceMappingURL=withTheme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTheme.d.ts","sourceRoot":"","sources":["../../../../src/decorators/withTheme.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"withTheme.d.ts","sourceRoot":"","sources":["../../../../src/decorators/withTheme.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAMlD;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,SAgBvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withThemeEditor.d.ts","sourceRoot":"","sources":["../../../../src/decorators/withThemeEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAKlD;;GAEG;AAEH,eAAO,MAAM,eAAe,EAAE,SAc7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
|