@astryxdesign/lab 0.1.9-canary.d2d84f8 → 0.1.9-canary.e00a241
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/BottomSheet/BottomSheet.d.ts +95 -0
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -0
- package/dist/BottomSheet/BottomSheet.js +150 -0
- package/dist/BottomSheet/index.d.ts +9 -0
- package/dist/BottomSheet/index.d.ts.map +1 -0
- package/dist/BottomSheet/index.js +10 -0
- package/dist/BottomSheet/useSheetGestures.d.ts +69 -0
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -0
- package/dist/BottomSheet/useSheetGestures.js +163 -0
- package/dist/RichTextEditor/RichTextEditor.d.ts +67 -6
- package/dist/RichTextEditor/RichTextEditor.d.ts.map +1 -1
- package/dist/RichTextEditor/RichTextEditor.js +165 -12
- package/dist/RichTextEditor/editorTheme.d.ts.map +1 -1
- package/dist/RichTextEditor/editorTheme.js +33 -7
- package/dist/RichTextEditor/index.d.ts +1 -1
- package/dist/RichTextEditor/index.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/lab.css +23 -0
- package/package.json +2 -2
- package/src/BottomSheet/BottomSheet.doc.mjs +105 -0
- package/src/BottomSheet/BottomSheet.test.tsx +233 -0
- package/src/BottomSheet/BottomSheet.tsx +226 -0
- package/src/BottomSheet/index.ts +11 -0
- package/src/BottomSheet/useSheetGestures.doc.mjs +31 -0
- package/src/BottomSheet/useSheetGestures.test.ts +160 -0
- package/src/BottomSheet/useSheetGestures.ts +226 -0
- package/src/ChatReasoning/ChatReasoning.doc.mjs +49 -2
- package/src/CodeEditor/CodeEditor.doc.mjs +67 -2
- package/src/LogStream/LogStream.doc.mjs +53 -2
- package/src/RichTextEditor/RichTextEditor.doc.mjs +19 -1
- package/src/RichTextEditor/RichTextEditor.test.tsx +441 -11
- package/src/RichTextEditor/RichTextEditor.tsx +289 -31
- package/src/RichTextEditor/editorTheme.ts +63 -3
- package/src/RichTextEditor/index.ts +2 -0
- package/src/Schedule/Schedule.doc.mjs +143 -3
- package/src/Stepper/Stepper.doc.mjs +6 -0
- package/src/__tests__/labApiContractDrift.test.tsx +57 -0
- package/src/index.ts +5 -0
|
@@ -23,12 +23,13 @@
|
|
|
23
23
|
* Component Specification Protocol. `lexical` and `@lexical/*` are OPTIONAL peer
|
|
24
24
|
* dependencies — install them to use this component.
|
|
25
25
|
*/
|
|
26
|
-
import { useEffect, useId, useRef } from 'react';
|
|
26
|
+
import { useEffect, useId, useImperativeHandle, useMemo, useRef, useState, forwardRef } from 'react';
|
|
27
27
|
import * as stylex from '@stylexjs/stylex';
|
|
28
28
|
import '@astryxdesign/core/theme/tokens.stylex';
|
|
29
29
|
import { colorVars, spacingVars, typographyVars, typeScaleVars } from '@astryxdesign/core/theme/tokens.stylex';
|
|
30
30
|
import { sharedEditorTheme } from "./editorTheme.js";
|
|
31
31
|
import { Field, inputWrapperStyles, inputStatusBorderStyles, inputStatusHoverShadowStyles, inputStatusFocusWithinStyles } from '@astryxdesign/core/Field';
|
|
32
|
+
import { VisuallyHidden } from '@astryxdesign/core/VisuallyHidden';
|
|
32
33
|
import { useSize } from '@astryxdesign/core/SizeContext';
|
|
33
34
|
import { themeProps } from '@astryxdesign/core/utils';
|
|
34
35
|
import { LexicalComposer } from '@lexical/react/LexicalComposer';
|
|
@@ -42,12 +43,43 @@ import { LinkPlugin } from '@lexical/react/LexicalLinkPlugin';
|
|
|
42
43
|
import { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin';
|
|
43
44
|
import { MarkdownShortcutPlugin } from '@lexical/react/LexicalMarkdownShortcutPlugin';
|
|
44
45
|
import { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin';
|
|
45
|
-
import { TRANSFORMERS } from '@lexical/markdown';
|
|
46
|
+
import { TRANSFORMERS, $convertToMarkdownString } from '@lexical/markdown';
|
|
46
47
|
import { ListNode, ListItemNode } from '@lexical/list';
|
|
47
48
|
import { HeadingNode, QuoteNode } from '@lexical/rich-text';
|
|
48
49
|
import { LinkNode, AutoLinkNode } from '@lexical/link';
|
|
49
50
|
import { CodeNode, CodeHighlightNode } from '@lexical/code';
|
|
50
51
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
52
|
+
/**
|
|
53
|
+
* Serialized state for an empty editor: a root containing a single empty
|
|
54
|
+
* paragraph. Used by the imperative `clear()` handle.
|
|
55
|
+
*
|
|
56
|
+
* We deliberately reset the editor via `editor.setEditorState(...)` rather than
|
|
57
|
+
* an `editor.update(() => { $getRoot()... })` callback, because `$getRoot` /
|
|
58
|
+
* `$createParagraphNode` are *runtime value* imports from the top-level
|
|
59
|
+
* `lexical` package. In the sandbox's Next build a top-level `lexical` value
|
|
60
|
+
* import forces Babel to transpile lexical's raw `src/*.ts` (which uses
|
|
61
|
+
* `declare` class fields) and fails the build. `parseEditorState` /
|
|
62
|
+
* `setEditorState` are methods on the editor instance, so no top-level
|
|
63
|
+
* `lexical` value import is needed. Setting a fresh state still notifies update
|
|
64
|
+
* listeners, so `onChange` fires.
|
|
65
|
+
*/
|
|
66
|
+
const EMPTY_EDITOR_STATE_JSON = JSON.stringify({
|
|
67
|
+
root: {
|
|
68
|
+
children: [{
|
|
69
|
+
children: [],
|
|
70
|
+
direction: null,
|
|
71
|
+
format: '',
|
|
72
|
+
indent: 0,
|
|
73
|
+
type: 'paragraph',
|
|
74
|
+
version: 1
|
|
75
|
+
}],
|
|
76
|
+
direction: null,
|
|
77
|
+
format: '',
|
|
78
|
+
indent: 0,
|
|
79
|
+
type: 'root',
|
|
80
|
+
version: 1
|
|
81
|
+
}
|
|
82
|
+
});
|
|
51
83
|
const styles = {
|
|
52
84
|
wrapper: {
|
|
53
85
|
kXwgrk: "xdt5ytf",
|
|
@@ -76,6 +108,18 @@ const sizeStyles = {
|
|
|
76
108
|
|
|
77
109
|
/** The default OSS node set registered with the editor. */
|
|
78
110
|
const DEFAULT_NODES = [HeadingNode, QuoteNode, ListNode, ListItemNode, LinkNode, AutoLinkNode, CodeNode, CodeHighlightNode];
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Fraction of `maxLength` at which the character counter begins announcing
|
|
114
|
+
* remaining/over-limit characters to screen readers. Matches TextArea.
|
|
115
|
+
*/
|
|
116
|
+
const COUNTER_WARNING_THRESHOLD = 0.8;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Imperative handle exposed via `ref`. Lets callers focus, clear, and read the
|
|
120
|
+
* editor without wiring a custom plugin. Available after mount.
|
|
121
|
+
*/
|
|
122
|
+
|
|
79
123
|
/**
|
|
80
124
|
* A WYSIWYG rich-text editor built on Lexical, styled with Astryx design
|
|
81
125
|
* tokens. Experimental — ships from `@astryxdesign/lab` (canary). `lexical` and
|
|
@@ -86,17 +130,22 @@ const DEFAULT_NODES = [HeadingNode, QuoteNode, ListNode, ListItemNode, LinkNode,
|
|
|
86
130
|
* `plugins` to layer richer behaviour (toolbars, mentions, hover cards) on top
|
|
87
131
|
* without forking.
|
|
88
132
|
*
|
|
133
|
+
* The forwarded `RichTextEditorRef` exposes imperative `focus()` and `clear()`
|
|
134
|
+
* methods for callers that manage the editor from outside.
|
|
135
|
+
*
|
|
89
136
|
* @example
|
|
90
137
|
* ```
|
|
91
|
-
* import {RichTextEditor} from '@astryxdesign/lab';
|
|
138
|
+
* import {RichTextEditor, type RichTextEditorRef} from '@astryxdesign/lab';
|
|
139
|
+
* const ref = useRef<RichTextEditorRef>(null);
|
|
92
140
|
* <RichTextEditor
|
|
141
|
+
* ref={ref}
|
|
93
142
|
* label="Notes"
|
|
94
143
|
* placeholder="Write something..."
|
|
95
144
|
* onChange={state => save(JSON.stringify(state.toJSON()))}
|
|
96
145
|
* />
|
|
97
146
|
* ```
|
|
98
147
|
*/
|
|
99
|
-
export function RichTextEditor({
|
|
148
|
+
export const RichTextEditor = /*#__PURE__*/forwardRef(function RichTextEditor({
|
|
100
149
|
label,
|
|
101
150
|
isLabelHidden = false,
|
|
102
151
|
description,
|
|
@@ -114,18 +163,25 @@ export function RichTextEditor({
|
|
|
114
163
|
nodes,
|
|
115
164
|
plugins,
|
|
116
165
|
hasMarkdownShortcuts = true,
|
|
166
|
+
transformers = TRANSFORMERS,
|
|
117
167
|
hasAutoFocus = false,
|
|
168
|
+
maxLength,
|
|
118
169
|
namespace = 'astryx-editor',
|
|
119
170
|
xstyle,
|
|
120
171
|
className,
|
|
121
172
|
style,
|
|
122
173
|
...rest
|
|
123
|
-
}) {
|
|
174
|
+
}, ref) {
|
|
124
175
|
const size = useSize(sizeProp, 'md');
|
|
125
176
|
const id = useId();
|
|
126
177
|
const descriptionID = useId();
|
|
127
178
|
const statusMessageID = useId();
|
|
128
179
|
const placeholderID = useId();
|
|
180
|
+
const counterID = useId();
|
|
181
|
+
|
|
182
|
+
// Plain-text character count, tracked from inside the composer via
|
|
183
|
+
// CharCountPlugin. Only used when maxLength is set.
|
|
184
|
+
const [charCount, setCharCount] = useState(0);
|
|
129
185
|
|
|
130
186
|
// Theme is stable per render; build once.
|
|
131
187
|
const themeRef = useRef(null);
|
|
@@ -133,6 +189,12 @@ export function RichTextEditor({
|
|
|
133
189
|
themeRef.current = sharedEditorTheme();
|
|
134
190
|
}
|
|
135
191
|
const editable = !isReadOnly && !isDisabled;
|
|
192
|
+
|
|
193
|
+
// Stabilize the transformers array so MarkdownShortcutPlugin doesn't
|
|
194
|
+
// re-register on every render. `[...transformers]` would allocate a new
|
|
195
|
+
// array each time; memoize on the prop identity instead. (React Compiler
|
|
196
|
+
// isn't running the transform in this repo, so this isn't auto-memoized.)
|
|
197
|
+
const markdownTransformers = useMemo(() => [...transformers], [transformers]);
|
|
136
198
|
const initialConfig = {
|
|
137
199
|
namespace,
|
|
138
200
|
theme: themeRef.current,
|
|
@@ -144,8 +206,8 @@ export function RichTextEditor({
|
|
|
144
206
|
throw error;
|
|
145
207
|
}
|
|
146
208
|
};
|
|
147
|
-
const ariaDescribedBy = [description ? descriptionID : null, status?.message ? statusMessageID : null, placeholder ? placeholderID : null].filter(Boolean).join(' ') || undefined;
|
|
148
|
-
return /*#__PURE__*/
|
|
209
|
+
const ariaDescribedBy = [description ? descriptionID : null, status?.message ? statusMessageID : null, placeholder ? placeholderID : null, maxLength != null ? counterID : null].filter(Boolean).join(' ') || undefined;
|
|
210
|
+
return /*#__PURE__*/_jsxs(Field, {
|
|
149
211
|
label: label,
|
|
150
212
|
isLabelHidden: isLabelHidden,
|
|
151
213
|
description: description,
|
|
@@ -161,7 +223,7 @@ export function RichTextEditor({
|
|
|
161
223
|
} : undefined,
|
|
162
224
|
labelTooltip: labelTooltip,
|
|
163
225
|
width: width,
|
|
164
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
226
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
165
227
|
...themeProps('rich-text-editor', {
|
|
166
228
|
size,
|
|
167
229
|
status: status?.type ?? null
|
|
@@ -189,17 +251,37 @@ export function RichTextEditor({
|
|
|
189
251
|
placeholder: null,
|
|
190
252
|
ErrorBoundary: LexicalErrorBoundary
|
|
191
253
|
}), /*#__PURE__*/_jsx(HistoryPlugin, {}), /*#__PURE__*/_jsx(ListPlugin, {}), /*#__PURE__*/_jsx(LinkPlugin, {}), /*#__PURE__*/_jsx(TabIndentationPlugin, {}), hasMarkdownShortcuts && /*#__PURE__*/_jsx(MarkdownShortcutPlugin, {
|
|
192
|
-
transformers:
|
|
254
|
+
transformers: markdownTransformers
|
|
193
255
|
}), hasAutoFocus && /*#__PURE__*/_jsx(AutoFocusOnMount, {}), onChange && /*#__PURE__*/_jsx(OnChangePlugin, {
|
|
194
256
|
onChange: onChange,
|
|
195
257
|
ignoreHistoryMergeTagChange: true,
|
|
196
258
|
ignoreSelectionChange: true
|
|
197
|
-
}), plugins
|
|
259
|
+
}), plugins, /*#__PURE__*/_jsx(EditorRefBridge, {
|
|
260
|
+
editorRef: ref,
|
|
261
|
+
editable: editable,
|
|
262
|
+
transformers: markdownTransformers
|
|
263
|
+
}), maxLength != null && /*#__PURE__*/_jsx(CharCountPlugin, {
|
|
264
|
+
onCountChange: setCharCount
|
|
265
|
+
})]
|
|
198
266
|
})
|
|
199
267
|
})
|
|
200
|
-
})
|
|
268
|
+
}), maxLength != null && /*#__PURE__*/_jsxs("div", {
|
|
269
|
+
id: counterID,
|
|
270
|
+
...{
|
|
271
|
+
0: {
|
|
272
|
+
className: "x78zum5 x13a6bvl xcsaf9d x9ynric x141an7d xv1l7n4"
|
|
273
|
+
},
|
|
274
|
+
1: {
|
|
275
|
+
className: "x78zum5 x13a6bvl xcsaf9d x9ynric x141an7d xjt36v0"
|
|
276
|
+
}
|
|
277
|
+
}[!!(charCount > maxLength) << 0],
|
|
278
|
+
children: [charCount, "/", maxLength, /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
279
|
+
"aria-live": "polite",
|
|
280
|
+
children: charCount >= maxLength * COUNTER_WARNING_THRESHOLD ? charCount > maxLength ? `${charCount - maxLength} characters over limit` : `${maxLength - charCount} characters remaining` : ''
|
|
281
|
+
})]
|
|
282
|
+
})]
|
|
201
283
|
});
|
|
202
|
-
}
|
|
284
|
+
});
|
|
203
285
|
RichTextEditor.displayName = 'RichTextEditor';
|
|
204
286
|
|
|
205
287
|
/**
|
|
@@ -214,6 +296,77 @@ function AutoFocusOnMount() {
|
|
|
214
296
|
return null;
|
|
215
297
|
}
|
|
216
298
|
|
|
299
|
+
/**
|
|
300
|
+
* Wires the imperative `RichTextEditorRef` handle. Split into its own plugin so
|
|
301
|
+
* it runs inside the composer context and can reach the `LexicalEditor` via
|
|
302
|
+
* `useLexicalComposerContext()`. Renders nothing.
|
|
303
|
+
*
|
|
304
|
+
* `focus()` and `clear()` are gated on `editable` so a read-only or disabled
|
|
305
|
+
* editor cannot be mutated or focused through the imperative handle — matching
|
|
306
|
+
* the behaviour of the editable surface itself.
|
|
307
|
+
*/
|
|
308
|
+
function EditorRefBridge({
|
|
309
|
+
editorRef,
|
|
310
|
+
editable,
|
|
311
|
+
transformers
|
|
312
|
+
}) {
|
|
313
|
+
const [editor] = useLexicalComposerContext();
|
|
314
|
+
useImperativeHandle(editorRef, () => ({
|
|
315
|
+
focus: () => {
|
|
316
|
+
if (!editable) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
editor.focus();
|
|
320
|
+
},
|
|
321
|
+
clear: () => {
|
|
322
|
+
if (!editable) {
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
// Reset to a single empty paragraph via a fresh EditorState. Uses the
|
|
326
|
+
// editor instance's own parse/set methods so we avoid a top-level
|
|
327
|
+
// `lexical` value import (see EMPTY_EDITOR_STATE_JSON). This still
|
|
328
|
+
// notifies update listeners, so `onChange` fires.
|
|
329
|
+
editor.setEditorState(editor.parseEditorState(EMPTY_EDITOR_STATE_JSON));
|
|
330
|
+
},
|
|
331
|
+
getEditorState: () => editor.getEditorState(),
|
|
332
|
+
getMarkdown: () =>
|
|
333
|
+
// $convertToMarkdownString must run inside a read context. Honors the
|
|
334
|
+
// same transformers the editor uses for shortcuts, so custom
|
|
335
|
+
// transformers round-trip to Markdown. `@lexical/markdown` is a
|
|
336
|
+
// subpackage (built dist) — safe, unlike a top-level `lexical` import.
|
|
337
|
+
editor.getEditorState().read(() => $convertToMarkdownString(transformers)),
|
|
338
|
+
getEditor: () => editor
|
|
339
|
+
}), [editor, editable, transformers]);
|
|
340
|
+
return null;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Tracks the editor's plain-text length and reports it to the host component.
|
|
345
|
+
* Split into its own plugin so it runs inside the composer context and can
|
|
346
|
+
* read the editor state via `useLexicalComposerContext()`. Renders nothing.
|
|
347
|
+
*/
|
|
348
|
+
function CharCountPlugin({
|
|
349
|
+
onCountChange
|
|
350
|
+
}) {
|
|
351
|
+
const [editor] = useLexicalComposerContext();
|
|
352
|
+
useEffect(() => {
|
|
353
|
+
// Report the initial count (e.g. seeded via defaultValue) from the mounted
|
|
354
|
+
// root element's text, then track changes via registerTextContentListener,
|
|
355
|
+
// which hands us the plain-text content directly.
|
|
356
|
+
//
|
|
357
|
+
// We deliberately avoid importing `$getRoot` from the top-level `lexical`
|
|
358
|
+
// package: that is a *runtime value* import, and in the sandbox's Next
|
|
359
|
+
// build it forces Babel to transpile lexical's raw `src/*.ts` (which uses
|
|
360
|
+
// `declare` class fields) and fails. Both APIs used here are methods on the
|
|
361
|
+
// editor instance, so no top-level `lexical` value import is needed.
|
|
362
|
+
onCountChange(editor.getRootElement()?.textContent?.length ?? 0);
|
|
363
|
+
return editor.registerTextContentListener(textContent => {
|
|
364
|
+
onCountChange(textContent.length);
|
|
365
|
+
});
|
|
366
|
+
}, [editor, onCountChange]);
|
|
367
|
+
return null;
|
|
368
|
+
}
|
|
369
|
+
|
|
217
370
|
/**
|
|
218
371
|
* Renders the Lexical ContentEditable. Split out so the placeholder
|
|
219
372
|
* discriminated union (`placeholder` + `aria-placeholder` present together, or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorTheme.d.ts","sourceRoot":"","sources":["../../src/RichTextEditor/editorTheme.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"editorTheme.d.ts","sourceRoot":"","sources":["../../src/RichTextEditor/editorTheme.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAC;AA2GhD;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,kBAAkB,CA8CtD"}
|
|
@@ -19,6 +19,24 @@ import { colorVars, spacingVars, radiusVars, typographyVars, typeScaleVars, font
|
|
|
19
19
|
* class-name strings, which `stylex.props(...).className` yields.
|
|
20
20
|
*/
|
|
21
21
|
export function sharedEditorTheme() {
|
|
22
|
+
const ulClass = {
|
|
23
|
+
className: "xsq74q5 x31w388 xtaz4m5 x43c9pm"
|
|
24
|
+
}.className ?? '';
|
|
25
|
+
const olClass = {
|
|
26
|
+
className: "xsq74q5 x31w388 x3yw8vx x43c9pm"
|
|
27
|
+
}.className ?? '';
|
|
28
|
+
const ulDepth2Class = {
|
|
29
|
+
className: "x31w388 x43c9pm x10im51j xrylv2j"
|
|
30
|
+
}.className ?? '';
|
|
31
|
+
const ulDepth3Class = {
|
|
32
|
+
className: "x31w388 x43c9pm x10im51j x152237o"
|
|
33
|
+
}.className ?? '';
|
|
34
|
+
const olDepth2Class = {
|
|
35
|
+
className: "x31w388 x43c9pm x10im51j x1rrqm6h"
|
|
36
|
+
}.className ?? '';
|
|
37
|
+
const olDepth3Class = {
|
|
38
|
+
className: "x31w388 x43c9pm x10im51j x19k9dhg"
|
|
39
|
+
}.className ?? '';
|
|
22
40
|
return {
|
|
23
41
|
paragraph: {
|
|
24
42
|
className: "xsq74q5"
|
|
@@ -38,15 +56,23 @@ export function sharedEditorTheme() {
|
|
|
38
56
|
className: "x1g06x3t xrxpjvj x126nfab xct1zlm x1t7ytsu x14ydlgx xv1l7n4"
|
|
39
57
|
}.className,
|
|
40
58
|
list: {
|
|
41
|
-
ul:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
className: "xsq74q5 x31w388"
|
|
59
|
+
ul: ulClass,
|
|
60
|
+
ol: olClass,
|
|
61
|
+
checklist: {
|
|
62
|
+
className: "xsq74q5 x43c9pm x3ct3a4 x12gdq22"
|
|
46
63
|
}.className,
|
|
47
64
|
listitem: {
|
|
48
|
-
className: "x1yqqeh1"
|
|
49
|
-
}.className
|
|
65
|
+
className: "x1yqqeh1 x1sle589"
|
|
66
|
+
}.className,
|
|
67
|
+
nested: {
|
|
68
|
+
listitem: {
|
|
69
|
+
className: "x1yqqeh1 x1sle589"
|
|
70
|
+
}.className
|
|
71
|
+
},
|
|
72
|
+
// Depth arrays cycle via `depth % length`, so three entries give three
|
|
73
|
+
// distinct nesting levels before repeating (disc→circle→square, etc.).
|
|
74
|
+
ulDepth: [ulClass, ulDepth2Class, ulDepth3Class],
|
|
75
|
+
olDepth: [olClass, olDepth2Class, olDepth3Class]
|
|
50
76
|
},
|
|
51
77
|
link: {
|
|
52
78
|
className: "xjse4m1 x1bvjpef x1ypdohk"
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* SYNC: When modified, update this header and the editor component doc files.
|
|
9
9
|
*/
|
|
10
10
|
export { RichTextEditor } from './RichTextEditor';
|
|
11
|
-
export type { RichTextEditorProps, RichTextEditorStatus, RichTextEditorStatusType, RichTextEditorSize, } from './RichTextEditor';
|
|
11
|
+
export type { RichTextEditorProps, RichTextEditorRef, RichTextEditorStatus, RichTextEditorStatusType, RichTextEditorSize, Transformer, } from './RichTextEditor';
|
|
12
12
|
export { RichTextView } from './RichTextView';
|
|
13
13
|
export type { RichTextViewProps } from './RichTextView';
|
|
14
14
|
export { sharedEditorTheme } from './editorTheme';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/RichTextEditor/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/RichTextEditor/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,kBAAkB,EAClB,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,YAAY,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export { InfoTip, type InfoTipProps, type InfoTipSize } from './InfoTip';
|
|
|
16
16
|
export { ChatReasoning, type ChatReasoningProps, } from './ChatReasoning/ChatReasoning';
|
|
17
17
|
export * from './Chat';
|
|
18
18
|
export { Drawer, type DrawerProps } from './Drawer';
|
|
19
|
+
export { BottomSheet, type BottomSheetProps } from './BottomSheet';
|
|
19
20
|
export { Stat, type StatProps, type StatDelta, type StatDeltaDirection, type StatDeltaSentiment, type StatSize, } from './Stat';
|
|
20
21
|
export * from './Schedule';
|
|
21
22
|
export { SVGIcon, type SVGIconProps, type SVGIconVariation, type SVGIconSize, type SVGIconColor, type SVGIconDef, type IconShape, type IconShapeRole, iconVars, variations, opticalSize, xIcon, checkIcon, bellIcon, homeIcon, settingsIcon, calendarIcon, menuIcon, heartIcon, eyeIcon, starIcon, folderIcon, shieldIcon, searchIcon, mailIcon, lockIcon, starterIcons, } from './SVGIcon';
|
|
@@ -27,5 +28,5 @@ export { SankeyChart, type SankeyChartProps, SankeyLink, type SankeyLinkProps, S
|
|
|
27
28
|
export * from './Stepper';
|
|
28
29
|
export * from './CircularProgress';
|
|
29
30
|
export { LogStream, type LogStreamProps, type LogEntry, type LogStreamLevel, } from './LogStream';
|
|
30
|
-
export { RichTextEditor, type RichTextEditorProps, type RichTextEditorStatus, type RichTextEditorStatusType, type RichTextEditorSize, RichTextView, type RichTextViewProps, sharedEditorTheme, } from './RichTextEditor';
|
|
31
|
+
export { RichTextEditor, type RichTextEditorProps, type RichTextEditorRef, type RichTextEditorStatus, type RichTextEditorStatusType, type RichTextEditorSize, type Transformer, RichTextView, type RichTextViewProps, sharedEditorTheme, } from './RichTextEditor';
|
|
31
32
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","s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,EACpB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,SAAS,EACT,KAAK,cAAc,EACnB,WAAW,EACX,KAAK,gBAAgB,EACrB,kBAAkB,EAClB,KAAK,uBAAuB,GAC7B,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,EACrB,UAAU,EACV,KAAK,eAAe,EACpB,UAAU,EACV,KAAK,eAAe,EACpB,WAAW,EACX,KAAK,gBAAgB,EACrB,SAAS,EACT,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,UAAU,CAAC;AAIlB,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AAGnC,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;AAIrB,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,YAAY,EACZ,KAAK,iBAAiB,EACtB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,9 @@ export * from "./Chat/index.js";
|
|
|
27
27
|
// Drawer — experimental overlay panel
|
|
28
28
|
export { Drawer } from "./Drawer/index.js";
|
|
29
29
|
|
|
30
|
+
// BottomSheet — mobile touch sheet built on the Drawer <dialog> engine
|
|
31
|
+
export { BottomSheet } from "./BottomSheet/index.js";
|
|
32
|
+
|
|
30
33
|
// Stat — experimental KPI/metric display
|
|
31
34
|
export { Stat } from "./Stat/index.js";
|
|
32
35
|
|
package/dist/lab.css
CHANGED
|
@@ -111,11 +111,13 @@
|
|
|
111
111
|
.xz51j44:not(#\#):not(#\#){grid-row:3}
|
|
112
112
|
.x33j1x8:not(#\#):not(#\#){grid-row:var(--x-gridRow)}
|
|
113
113
|
.x17y0mx6:not(#\#):not(#\#){inset-inline:0}
|
|
114
|
+
.x10im51j:not(#\#):not(#\#){margin-block:0}
|
|
114
115
|
.x1yqqeh1:not(#\#):not(#\#){margin-block:var(--spacing-0-5)}
|
|
115
116
|
.xsq74q5:not(#\#):not(#\#){margin-block:var(--spacing-1)}
|
|
116
117
|
.x1g06x3t:not(#\#):not(#\#){margin-block:var(--spacing-2)}
|
|
117
118
|
.x1oqu0vw:not(#\#):not(#\#){margin-block:var(--x-marginBlock)}
|
|
118
119
|
.xrxpjvj:not(#\#):not(#\#){margin-inline:0}
|
|
120
|
+
.xvueqy4:not(#\#):not(#\#){margin-inline:auto}
|
|
119
121
|
.x1a2a7pz:not(#\#):not(#\#){outline:none}
|
|
120
122
|
.xysyzu8:not(#\#):not(#\#){overflow:auto}
|
|
121
123
|
.xb3r6kr:not(#\#):not(#\#){overflow:hidden}
|
|
@@ -232,7 +234,10 @@
|
|
|
232
234
|
.x1t7ytsu:not(#\#):not(#\#):not(#\#){border-inline-start-style:solid}
|
|
233
235
|
.xct1zlm:not(#\#):not(#\#):not(#\#){border-inline-start-width:3px}
|
|
234
236
|
.xgbv0en:not(#\#):not(#\#):not(#\#){border-inline-start-width:var(--border-width)}
|
|
237
|
+
.x663v1:not(#\#):not(#\#):not(#\#){border-start-end-radius:var(--radius-page)}
|
|
238
|
+
.x183tx6i:not(#\#):not(#\#):not(#\#){border-start-start-radius:var(--radius-page)}
|
|
235
239
|
.x18oyj42:not(#\#):not(#\#):not(#\#){box-shadow:0 0 0 1px var(--color-accent)}
|
|
240
|
+
.x1gnnqk1:not(#\#):not(#\#):not(#\#){box-shadow:none}
|
|
236
241
|
.x1kcpxr7:not(#\#):not(#\#):not(#\#){box-shadow:var(--shadow-high)}
|
|
237
242
|
.x14hfi27:not(#\#):not(#\#):not(#\#){box-shadow:var(--shadow-med)}
|
|
238
243
|
.x9f619:not(#\#):not(#\#):not(#\#){box-sizing:border-box}
|
|
@@ -287,6 +292,7 @@
|
|
|
287
292
|
.xewh9hi:not(#\#):not(#\#):not(#\#){column-gap:var(--spacing-3)}
|
|
288
293
|
.x1w36mze:not(#\#):not(#\#):not(#\#){contain-intrinsic-height:auto 28px}
|
|
289
294
|
.xb5mbof:not(#\#):not(#\#):not(#\#){content-visibility:auto}
|
|
295
|
+
.x1jm3nie:not(#\#):not(#\#):not(#\#){cursor:grab}
|
|
290
296
|
.x1h6gzvc:not(#\#):not(#\#):not(#\#){cursor:not-allowed}
|
|
291
297
|
.x1ypdohk:not(#\#):not(#\#):not(#\#){cursor:pointer}
|
|
292
298
|
.x1lliihq:not(#\#):not(#\#):not(#\#){display:block}
|
|
@@ -370,7 +376,15 @@
|
|
|
370
376
|
.x1cpk1wn:not(#\#):not(#\#):not(#\#){line-height:var(--text-heading-2-leading)}
|
|
371
377
|
.x1kq96og:not(#\#):not(#\#):not(#\#){line-height:var(--text-label-leading)}
|
|
372
378
|
.x1ltkj2j:not(#\#):not(#\#):not(#\#){line-height:var(--text-supporting-leading)}
|
|
379
|
+
.x43c9pm:not(#\#):not(#\#):not(#\#){list-style-position:outside}
|
|
380
|
+
.xrylv2j:not(#\#):not(#\#):not(#\#){list-style-type:circle}
|
|
381
|
+
.x3yw8vx:not(#\#):not(#\#):not(#\#){list-style-type:decimal}
|
|
382
|
+
.xtaz4m5:not(#\#):not(#\#):not(#\#){list-style-type:disc}
|
|
383
|
+
.x1sle589:not(#\#):not(#\#):not(#\#){list-style-type:inherit}
|
|
384
|
+
.x1rrqm6h:not(#\#):not(#\#):not(#\#){list-style-type:lower-alpha}
|
|
385
|
+
.x19k9dhg:not(#\#):not(#\#):not(#\#){list-style-type:lower-roman}
|
|
373
386
|
.x3ct3a4:not(#\#):not(#\#):not(#\#){list-style-type:none}
|
|
387
|
+
.x152237o:not(#\#):not(#\#):not(#\#){list-style-type:square}
|
|
374
388
|
.x1h1dc9q:not(#\#):not(#\#):not(#\#){margin-inline-end:calc(var(--spacing-0-5) + var(--border-width))}
|
|
375
389
|
.xhi58n4:not(#\#):not(#\#):not(#\#){margin-inline-start:calc(var(--spacing-1) * -1)}
|
|
376
390
|
.xladpz9:not(#\#):not(#\#):not(#\#){margin-inline-start:var(--spacing-0-5)}
|
|
@@ -389,6 +403,7 @@
|
|
|
389
403
|
.xmarwi5:not(#\#):not(#\#):not(#\#){padding-inline-start:var(--icon-inline-offset)}
|
|
390
404
|
.x18gyask:not(#\#):not(#\#):not(#\#){padding-inline-start:var(--spacing-0)}
|
|
391
405
|
.x1vsv5vr:not(#\#):not(#\#):not(#\#){padding-inline-start:var(--spacing-1)}
|
|
406
|
+
.x12gdq22:not(#\#):not(#\#):not(#\#){padding-inline-start:var(--spacing-2)}
|
|
392
407
|
.x126nfab:not(#\#):not(#\#):not(#\#){padding-inline-start:var(--spacing-3)}
|
|
393
408
|
.x1rey3nv:not(#\#):not(#\#):not(#\#){padding-inline-start:var(--spacing-4)}
|
|
394
409
|
.x31w388:not(#\#):not(#\#):not(#\#){padding-inline-start:var(--spacing-6)}
|
|
@@ -417,6 +432,7 @@
|
|
|
417
432
|
.x1yc453h:not(#\#):not(#\#):not(#\#){text-align:start}
|
|
418
433
|
.xlyipyv:not(#\#):not(#\#):not(#\#){text-overflow:ellipsis}
|
|
419
434
|
.xtvhhri:not(#\#):not(#\#):not(#\#){text-transform:uppercase}
|
|
435
|
+
.x5ve5x3:not(#\#):not(#\#):not(#\#){touch-action:none}
|
|
420
436
|
.xx69xxh:not(#\#):not(#\#):not(#\#){touch-action:pan-y}
|
|
421
437
|
.x9tu13d:not(#\#):not(#\#):not(#\#){transform:rotate(-90deg)}
|
|
422
438
|
.x19jd1h0:not(#\#):not(#\#):not(#\#){transform:rotate(180deg)}
|
|
@@ -445,6 +461,7 @@
|
|
|
445
461
|
.xuxw1ft:not(#\#):not(#\#):not(#\#){white-space:nowrap}
|
|
446
462
|
.x126k92a:not(#\#):not(#\#):not(#\#){white-space:pre-wrap}
|
|
447
463
|
.x1sdyfia:not(#\#):not(#\#):not(#\#){white-space:pre}
|
|
464
|
+
.x1so62im:not(#\#):not(#\#):not(#\#){will-change:transform}
|
|
448
465
|
.x1lldw8n:not(#\#):not(#\#):not(#\#){word-break:normal}
|
|
449
466
|
.x98t3bc:not(#\#):not(#\#):not(#\#){writing-mode:vertical-rl}
|
|
450
467
|
.x1vjfegm:not(#\#):not(#\#):not(#\#){z-index:1}
|
|
@@ -482,6 +499,7 @@
|
|
|
482
499
|
.x1ey2m1c:not(#\#):not(#\#):not(#\#):not(#\#){bottom:0}
|
|
483
500
|
.xdd4er5:not(#\#):not(#\#):not(#\#):not(#\#){bottom:auto}
|
|
484
501
|
.x1hmuevu:not(#\#):not(#\#):not(#\#):not(#\#){bottom:var(--spacing-3)}
|
|
502
|
+
.x5yr21d:not(#\#):not(#\#):not(#\#):not(#\#){height:100%}
|
|
485
503
|
.xtdtrs8:not(#\#):not(#\#):not(#\#):not(#\#){height:100dvh}
|
|
486
504
|
.x170jfvy:not(#\#):not(#\#):not(#\#):not(#\#){height:10px}
|
|
487
505
|
.x1v9usgg:not(#\#):not(#\#):not(#\#):not(#\#){height:14px}
|
|
@@ -493,6 +511,7 @@
|
|
|
493
511
|
.xqu0tyb:not(#\#):not(#\#):not(#\#):not(#\#){height:4px}
|
|
494
512
|
.x1ycjhwn:not(#\#):not(#\#):not(#\#):not(#\#){height:5px}
|
|
495
513
|
.x1d9x2de:not(#\#):not(#\#):not(#\#):not(#\#){height:640px}
|
|
514
|
+
.xg7h5cd:not(#\#):not(#\#):not(#\#):not(#\#){height:fit-content}
|
|
496
515
|
.xhigkf7:not(#\#):not(#\#):not(#\#):not(#\#){height:var(--icon-size)}
|
|
497
516
|
.x6b6gus:not(#\#):not(#\#):not(#\#):not(#\#){height:var(--spacing-4)}
|
|
498
517
|
.x1grt7ep:not(#\#):not(#\#):not(#\#):not(#\#){height:var(--spacing-5)}
|
|
@@ -503,9 +522,11 @@
|
|
|
503
522
|
.xcsaf9d:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:var(--spacing-1)}
|
|
504
523
|
.xtbrsbv:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:var(--spacing-2)}
|
|
505
524
|
.x1vhfslr:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:var(--x-marginBlockStart)}
|
|
525
|
+
.x1ismmbu:not(#\#):not(#\#):not(#\#):not(#\#){max-height:90dvh}
|
|
506
526
|
.x7ab17h:not(#\#):not(#\#):not(#\#):not(#\#){max-height:none}
|
|
507
527
|
.x1jols5v:not(#\#):not(#\#):not(#\#):not(#\#){max-height:var(--x-maxHeight)}
|
|
508
528
|
.x1k2d6hx:not(#\#):not(#\#):not(#\#):not(#\#){max-width:44px}
|
|
529
|
+
.x11gisft:not(#\#):not(#\#):not(#\#):not(#\#){max-width:640px}
|
|
509
530
|
.x1x1rfll:not(#\#):not(#\#):not(#\#):not(#\#){max-width:none}
|
|
510
531
|
.xf68679:not(#\#):not(#\#):not(#\#):not(#\#){max-width:var(--x-maxWidth)}
|
|
511
532
|
.x2lwn1j:not(#\#):not(#\#):not(#\#):not(#\#){min-height:0}
|
|
@@ -525,6 +546,7 @@
|
|
|
525
546
|
.x6ikm8r:not(#\#):not(#\#):not(#\#):not(#\#){overflow-x:hidden}
|
|
526
547
|
.x1odjw0f:not(#\#):not(#\#):not(#\#):not(#\#){overflow-y:auto}
|
|
527
548
|
.x1j85h84:not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:1px}
|
|
549
|
+
.x1a148e8:not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:env(safe-area-inset-bottom,0px)}
|
|
528
550
|
.xy143xn:not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:var(--spacing-1)}
|
|
529
551
|
.xpgmcrp:not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--icon-block-offset)}
|
|
530
552
|
.xbx876j:not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--spacing-0-5)}
|
|
@@ -545,6 +567,7 @@
|
|
|
545
567
|
.x1dz1jew:not(#\#):not(#\#):not(#\#):not(#\#){width:280px}
|
|
546
568
|
.x1849jeq:not(#\#):not(#\#):not(#\#):not(#\#){width:30px}
|
|
547
569
|
.x1td3qas:not(#\#):not(#\#):not(#\#):not(#\#){width:32px}
|
|
570
|
+
.x14qfxbe:not(#\#):not(#\#):not(#\#):not(#\#){width:36px}
|
|
548
571
|
.x51ohtg:not(#\#):not(#\#):not(#\#):not(#\#){width:4px}
|
|
549
572
|
.x1ftt334:not(#\#):not(#\#):not(#\#):not(#\#){width:5px}
|
|
550
573
|
.x1oai4fc:not(#\#):not(#\#):not(#\#):not(#\#){width:var(--icon-size)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/lab",
|
|
3
|
-
"version": "0.1.9-canary.
|
|
3
|
+
"version": "0.1.9-canary.e00a241",
|
|
4
4
|
"description": "Experimental Astryx components — published to npm only under the @canary dist-tag for early testing; never released as a stable (latest) version.",
|
|
5
5
|
"author": "Meta Open Source",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@stylexjs/stylex": ">=0.10.0",
|
|
48
|
-
"@astryxdesign/core": "0.1.9-canary.
|
|
48
|
+
"@astryxdesign/core": "0.1.9-canary.e00a241",
|
|
49
49
|
"react": ">=19.0.0",
|
|
50
50
|
"react-dom": ">=19.0.0",
|
|
51
51
|
"lexical": "^0.46.0",
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
/** @type {import('../../../core/src/docs-types').ComponentDoc} */
|
|
3
|
+
|
|
4
|
+
export const docs = {
|
|
5
|
+
name: 'BottomSheet',
|
|
6
|
+
displayName: 'BottomSheet',
|
|
7
|
+
group: 'BottomSheet',
|
|
8
|
+
category: 'Overlay',
|
|
9
|
+
keywords: ["bottom sheet","sheet","mobile","touch","drag","swipe","dismiss","grab handle","dialog","overlay","modal"],
|
|
10
|
+
theming: {
|
|
11
|
+
targets: [
|
|
12
|
+
{className: 'astryx-bottom-sheet', visualProps: []},
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
description: 'A mobile touch sheet that rises from the bottom edge, with a grab handle and swipe-to-dismiss. Built on the Drawer <dialog> engine.',
|
|
16
|
+
props: [
|
|
17
|
+
{
|
|
18
|
+
name: 'isOpen',
|
|
19
|
+
type: 'boolean',
|
|
20
|
+
description: 'Whether the sheet is open. Fully controlled; pair with onOpenChange.',
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'onOpenChange',
|
|
25
|
+
type: '(isOpen: boolean) => void',
|
|
26
|
+
description: 'Called when the sheet opens or closes. The boolean is the requested next state (false on Escape, scrim click, or a swipe past the dismiss threshold). The caller owns the open state.',
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'label',
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: 'Accessible label for the sheet. Required; the sheet has no built-in heading to derive a name from.',
|
|
33
|
+
required: true,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'children',
|
|
37
|
+
type: 'ReactNode',
|
|
38
|
+
description: 'Sheet content, rendered below the grab handle in a scrollable area.',
|
|
39
|
+
required: true,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'height',
|
|
43
|
+
type: "'short' | 'medium' | 'tall' | 'auto'",
|
|
44
|
+
description: "How tall the sheet is: 'short' is a fixed peek height, 'medium' is half the viewport, 'tall' is nearly the full viewport, and 'auto' fits its content up to the 'tall' budget. On shorter viewports the sheet fills the available height.",
|
|
45
|
+
default: "'medium'",
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
usage: {
|
|
49
|
+
description: 'A mobile touch surface for filters, actions, and detail views that should rise from the bottom of the screen. The sheet is modal: focus is trapped while open and restored to the opener on close, and Escape dismisses, so the swipe gesture always has a keyboard equivalent. Content padding clears the home indicator via env(safe-area-inset-bottom).',
|
|
50
|
+
bestPractices: [
|
|
51
|
+
{ guidance: true, description: 'Use for mobile-first surfaces (filters, share sheets, quick actions) where the content should rise from the bottom edge.' },
|
|
52
|
+
{ guidance: true, description: 'Keep the caller as the source of truth: derive isOpen from state and clear it in onOpenChange.' },
|
|
53
|
+
{ guidance: true, description: "Pick a height that fits the content: 'auto' for short sheets, 'medium'/'tall' for lists and forms." },
|
|
54
|
+
{ guidance: false, description: 'Use a BottomSheet for desktop inspectors or master-detail; use Drawer (side="end", hasScrim={false}) instead.' },
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
examples: [
|
|
58
|
+
{
|
|
59
|
+
label: 'Basic',
|
|
60
|
+
code: `const [isOpen, setIsOpen] = useState(false);
|
|
61
|
+
<BottomSheet
|
|
62
|
+
isOpen={isOpen}
|
|
63
|
+
onOpenChange={setIsOpen}
|
|
64
|
+
label="Filters">
|
|
65
|
+
<FilterControls />
|
|
66
|
+
</BottomSheet>`,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: 'Tall sheet (a list)',
|
|
70
|
+
code: `const [isOpen, setIsOpen] = useState(false);
|
|
71
|
+
<BottomSheet
|
|
72
|
+
isOpen={isOpen}
|
|
73
|
+
onOpenChange={setIsOpen}
|
|
74
|
+
label="Nearby places"
|
|
75
|
+
height="tall">
|
|
76
|
+
<PlaceList />
|
|
77
|
+
</BottomSheet>`,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
label: 'Auto height (fits content)',
|
|
81
|
+
code: `const [isOpen, setIsOpen] = useState(false);
|
|
82
|
+
<BottomSheet
|
|
83
|
+
isOpen={isOpen}
|
|
84
|
+
onOpenChange={setIsOpen}
|
|
85
|
+
label="Share"
|
|
86
|
+
height="auto">
|
|
87
|
+
<ShareActions />
|
|
88
|
+
</BottomSheet>`,
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/** @type {import('../../../core/src/docs-types').TranslationDoc} */
|
|
94
|
+
export const docsDense = {
|
|
95
|
+
description: 'mobile touch sheet rising from the bottom edge (built on the Drawer <dialog> engine): grab handle, swipe-to-dismiss, named height scale',
|
|
96
|
+
usage: {
|
|
97
|
+
description: 'Mobile surface for filters, actions, and detail views. Modal: focus trap + restore, and Escape dismisses so swipe has a keyboard equivalent. Content clears the home indicator via safe-area inset.',
|
|
98
|
+
bestPractices: [
|
|
99
|
+
{ guidance: true, description: 'Use for mobile-first bottom surfaces (filters, share sheets, quick actions).' },
|
|
100
|
+
{ guidance: true, description: 'Derive isOpen from state; clear it in onOpenChange.' },
|
|
101
|
+
{ guidance: true, description: "Pick a height that fits: 'auto' for short sheets, 'medium'/'tall' for lists and forms." },
|
|
102
|
+
{ guidance: false, description: 'Use for desktop inspectors or master-detail; use Drawer instead.' },
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
};
|