@astryxdesign/lab 0.1.8-canary.bce8928 → 0.1.8-canary.becff91

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../src/Drawer/Drawer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AA6SlD,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IAC/D,iDAAiD;IACjD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAEnC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;;OAKG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAC;IAE1C;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAEvB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAEjD;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAMD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAA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AAM,CAAC;CACxB;AAMD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,OAAO,EACP,IAAY,EACZ,IAAU,EACV,KAAK,EACL,QAAe,EACf,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,+BAmQb;yBAnRe,MAAM"}
@@ -40,7 +40,7 @@ import '@astryxdesign/core/theme/tokens.stylex';
40
40
  import { borderVars, colorVars, durationVars, easeVars, shadowVars, spacingVars, typeScaleVars } from '@astryxdesign/core/theme/tokens.stylex';
41
41
  import { Icon } from '@astryxdesign/core/Icon';
42
42
  import { IconButton } from '@astryxdesign/core/IconButton';
43
- import { useScrollLock } from '@astryxdesign/core/hooks';
43
+ import { useScrollLock, useDevWarning } from '@astryxdesign/core/hooks';
44
44
  import { mergeProps, mergeRefs, themeProps } from '@astryxdesign/core/utils';
45
45
 
46
46
  // =============================================================================
@@ -291,14 +291,8 @@ export function Drawer({
291
291
  const collapsed = canCollapse && isCollapsed === true;
292
292
  const showCloseButton = hasCloseButton ?? hasScrim;
293
293
 
294
- // Dev warning for unsupported collapse combinations (repo idiom:
295
- // console.error, see BaseTable plugin errors).
296
- const hasInvalidCollapse = isCollapsed != null && !canCollapse;
297
- useEffect(() => {
298
- if (hasInvalidCollapse) {
299
- console.error('[Drawer] `isCollapsed` is only supported for non-modal drawers ' + '(hasScrim={false}) with side="start" or side="end". The prop is ' + 'ignored.');
300
- }
301
- }, [hasInvalidCollapse]);
294
+ // Dev warning for unsupported collapse combinations.
295
+ useDevWarning('Drawer', '`isCollapsed` is only supported for non-modal drawers ' + '(hasScrim={false}) with side="start" or side="end". The prop is ' + 'ignored.', isCollapsed != null && !canCollapse);
302
296
 
303
297
  // Open/close the native dialog. close() is delayed so the slide-out
304
298
  // transition can play; focus restore happens after close() because a
@@ -131,10 +131,9 @@ export interface RichTextEditorProps extends Omit<BaseProps, 'onChange' | 'defau
131
131
  * @example
132
132
  * ```
133
133
  * import {RichTextEditor} from '@astryxdesign/lab';
134
- *
135
134
  * <RichTextEditor
136
135
  * label="Notes"
137
- * placeholder="Write something…"
136
+ * placeholder="Write something..."
138
137
  * onChange={state => save(JSON.stringify(state.toJSON()))}
139
138
  * />
140
139
  * ```
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextEditor.d.ts","sourceRoot":"","sources":["../../src/RichTextEditor/RichTextEditor.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAA2B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAgB/D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAC;AAuBxD,OAAO,KAAK,EACV,WAAW,EACX,KAAK,EACL,aAAa,EACb,WAAW,EAEZ,MAAM,SAAS,CAAC;AAiEjB,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAEvE,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpD,MAAM,WAAW,oBAAoB;IACnC,qCAAqC;IACrC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAC/C,SAAS,EACT,UAAU,GAAG,cAAc,CAC5B;IACC,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAA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;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1C;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,yEAAyE;IACzE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,MAAM,EACN,KAAK,EACL,YAAY,EACZ,IAAI,EAAE,QAAQ,EACd,KAAK,EACL,OAAO,EACP,oBAA2B,EAC3B,YAAoB,EACpB,SAA2B,EAC3B,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,mBAAmB,+BAkHrB;yBA1Ie,cAAc"}
@@ -89,10 +89,9 @@ const DEFAULT_NODES = [HeadingNode, QuoteNode, ListNode, ListItemNode, LinkNode,
89
89
  * @example
90
90
  * ```
91
91
  * import {RichTextEditor} from '@astryxdesign/lab';
92
- *
93
92
  * <RichTextEditor
94
93
  * label="Notes"
95
- * placeholder="Write something…"
94
+ * placeholder="Write something..."
96
95
  * onChange={state => save(JSON.stringify(state.toJSON()))}
97
96
  * />
98
97
  * ```
@@ -55,7 +55,6 @@ export interface RichTextViewProps extends BaseProps {
55
55
  * @example
56
56
  * ```
57
57
  * import {RichTextView} from '@astryxdesign/lab';
58
- *
59
58
  * <RichTextView value={storedEditorStateJSON} />
60
59
  * ```
61
60
  */
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextView.d.ts","sourceRoot":"","sources":["../../src/RichTextEditor/RichTextView.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAmB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAGvD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAalD,OAAO,KAAK,EAAC,KAAK,EAAE,WAAW,EAAqB,MAAM,SAAS,CAAC;AAmBpE,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IAClD;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1C;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACtC;;;;OAIG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;CAC3B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,OAAO,EACP,SAAyB,EACzB,YAAY,EACZ,aAAoB,EACpB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,iBAAiB,+BAwEnB;yBAnFe,YAAY"}
1
+ {"version":3,"file":"RichTextView.d.ts","sourceRoot":"","sources":["../../src/RichTextEditor/RichTextView.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAmB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAGvD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAalD,OAAO,KAAK,EAAC,KAAK,EAAE,WAAW,EAAqB,MAAM,SAAS,CAAC;AAmBpE,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IAClD;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1C;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACtC;;;;OAIG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;CAC3B;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,OAAO,EACP,SAAyB,EACzB,YAAY,EACZ,aAAoB,EACpB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,iBAAiB,+BAwEnB;yBAnFe,YAAY"}
@@ -41,7 +41,6 @@ const DEFAULT_NODES = [HeadingNode, QuoteNode, ListNode, ListItemNode, LinkNode,
41
41
  * @example
42
42
  * ```
43
43
  * import {RichTextView} from '@astryxdesign/lab';
44
- *
45
44
  * <RichTextView value={storedEditorStateJSON} />
46
45
  * ```
47
46
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/lab",
3
- "version": "0.1.8-canary.bce8928",
3
+ "version": "0.1.8-canary.becff91",
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.8-canary.bce8928",
48
+ "@astryxdesign/core": "0.1.8-canary.becff91",
49
49
  "react": ">=19.0.0",
50
50
  "react-dom": ">=19.0.0",
51
51
  "lexical": "^0.46.0",
@@ -103,9 +103,9 @@
103
103
  },
104
104
  "scripts": {
105
105
  "build": "rm -rf dist && pnpm build:esm && tsc --project tsconfig.build.json && pnpm build:css && node ../../scripts/check-no-dev-jsx.mjs",
106
- "build:esm": "babel src --out-dir dist --extensions '.ts,.tsx' --out-file-extension '.js' --ignore '**/*.test.ts,**/*.test.tsx,**/__tests__/**,**/*.perf.test.*,**/*.doc.mjs,**/*.d.ts,**/*.css,**/*.css.d.ts' --config-file ./babel.config.js",
106
+ "build:esm": "babel src --out-dir dist --extensions .ts,.tsx --out-file-extension .js --ignore \"**/*.test.ts,**/*.test.tsx,**/__tests__/**,**/*.perf.test.*,**/*.doc.mjs,**/*.d.ts,**/*.css,**/*.css.d.ts\" --config-file ./babel.config.js",
107
107
  "build:css": "node ../../scripts/build-css.mjs --package lab",
108
- "dev": "babel src --watch --out-dir dist --extensions '.ts,.tsx' --out-file-extension '.js' --ignore '**/*.test.*,**/*.doc.mjs,**/*.d.ts,**/*.css*' --config-file ./babel.config.js",
108
+ "dev": "babel src --watch --out-dir dist --extensions .ts,.tsx --out-file-extension .js --ignore \"**/*.test.*,**/*.doc.mjs,**/*.d.ts,**/*.css*\" --config-file ./babel.config.js",
109
109
  "test": "vitest run --root ../..",
110
110
  "test:watch": "vitest --root ../..",
111
111
  "lint": "eslint src",
@@ -483,8 +483,8 @@ describe('Drawer', () => {
483
483
  });
484
484
 
485
485
  it('dev-warns and ignores isCollapsed on a modal drawer', () => {
486
- const consoleError = vi
487
- .spyOn(console, 'error')
486
+ const consoleWarn = vi
487
+ .spyOn(console, 'warn')
488
488
  .mockImplementation(() => {});
489
489
  try {
490
490
  render(
@@ -497,20 +497,20 @@ describe('Drawer', () => {
497
497
  Content
498
498
  </Drawer>,
499
499
  );
500
- expect(consoleError).toHaveBeenCalledWith(
501
- expect.stringContaining('[Drawer]'),
500
+ expect(consoleWarn).toHaveBeenCalledWith(
501
+ expect.stringContaining('Drawer:'),
502
502
  );
503
503
  expect(
504
504
  screen.queryByRole('button', {name: 'Expand Inspector'}),
505
505
  ).not.toBeInTheDocument();
506
506
  } finally {
507
- consoleError.mockRestore();
507
+ consoleWarn.mockRestore();
508
508
  }
509
509
  });
510
510
 
511
511
  it('dev-warns and ignores isCollapsed on a sheet', () => {
512
- const consoleError = vi
513
- .spyOn(console, 'error')
512
+ const consoleWarn = vi
513
+ .spyOn(console, 'warn')
514
514
  .mockImplementation(() => {});
515
515
  try {
516
516
  render(
@@ -525,14 +525,14 @@ describe('Drawer', () => {
525
525
  Content
526
526
  </Drawer>,
527
527
  );
528
- expect(consoleError).toHaveBeenCalledWith(
529
- expect.stringContaining('[Drawer]'),
528
+ expect(consoleWarn).toHaveBeenCalledWith(
529
+ expect.stringContaining('Drawer:'),
530
530
  );
531
531
  expect(
532
532
  screen.queryByRole('button', {name: 'Expand Inspector'}),
533
533
  ).not.toBeInTheDocument();
534
534
  } finally {
535
- consoleError.mockRestore();
535
+ consoleWarn.mockRestore();
536
536
  }
537
537
  });
538
538
  });
@@ -56,7 +56,7 @@ import {
56
56
  } from '@astryxdesign/core/theme/tokens.stylex';
57
57
  import {Icon} from '@astryxdesign/core/Icon';
58
58
  import {IconButton} from '@astryxdesign/core/IconButton';
59
- import {useScrollLock} from '@astryxdesign/core/hooks';
59
+ import {useScrollLock, useDevWarning} from '@astryxdesign/core/hooks';
60
60
  import {mergeProps, mergeRefs, themeProps} from '@astryxdesign/core/utils';
61
61
 
62
62
  // =============================================================================
@@ -494,18 +494,14 @@ export function Drawer({
494
494
  const collapsed = canCollapse && isCollapsed === true;
495
495
  const showCloseButton = hasCloseButton ?? hasScrim;
496
496
 
497
- // Dev warning for unsupported collapse combinations (repo idiom:
498
- // console.error, see BaseTable plugin errors).
499
- const hasInvalidCollapse = isCollapsed != null && !canCollapse;
500
- useEffect(() => {
501
- if (hasInvalidCollapse) {
502
- console.error(
503
- '[Drawer] `isCollapsed` is only supported for non-modal drawers ' +
504
- '(hasScrim={false}) with side="start" or side="end". The prop is ' +
505
- 'ignored.',
506
- );
507
- }
508
- }, [hasInvalidCollapse]);
497
+ // Dev warning for unsupported collapse combinations.
498
+ useDevWarning(
499
+ 'Drawer',
500
+ '`isCollapsed` is only supported for non-modal drawers ' +
501
+ '(hasScrim={false}) with side="start" or side="end". The prop is ' +
502
+ 'ignored.',
503
+ isCollapsed != null && !canCollapse,
504
+ );
509
505
 
510
506
  // Open/close the native dialog. close() is delayed so the slide-out
511
507
  // transition can play; focus restore happens after close() because a
@@ -40,7 +40,7 @@ export const docs = {
40
40
  name: 'defaultValue',
41
41
  type: 'string',
42
42
  description:
43
- 'Initial serialized editor state (JSON string from editorState.toJSON()). Read once on mount — the editor is uncontrolled.',
43
+ 'Initial serialized editor state (JSON string from editorState.toJSON()). Read once on mount; the editor is uncontrolled.',
44
44
  },
45
45
  {
46
46
  name: 'onChange',
@@ -250,10 +250,9 @@ export interface RichTextEditorProps extends Omit<
250
250
  * @example
251
251
  * ```
252
252
  * import {RichTextEditor} from '@astryxdesign/lab';
253
- *
254
253
  * <RichTextEditor
255
254
  * label="Notes"
256
- * placeholder="Write something…"
255
+ * placeholder="Write something..."
257
256
  * onChange={state => save(JSON.stringify(state.toJSON()))}
258
257
  * />
259
258
  * ```
@@ -93,7 +93,6 @@ export interface RichTextViewProps extends BaseProps {
93
93
  * @example
94
94
  * ```
95
95
  * import {RichTextView} from '@astryxdesign/lab';
96
- *
97
96
  * <RichTextView value={storedEditorStateJSON} />
98
97
  * ```
99
98
  */