@astryxdesign/lab 0.7.5-canary.577e8ca → 0.7.5-canary.6322d94

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/lab",
3
- "version": "0.7.5-canary.577e8ca",
3
+ "version": "0.7.5-canary.6322d94",
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",
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@stylexjs/stylex": ">=0.10.0",
52
- "@astryxdesign/core": "0.7.5-canary.577e8ca",
52
+ "@astryxdesign/core": "0.7.5-canary.6322d94",
53
53
  "react": ">=19.0.0",
54
54
  "react-dom": ">=19.0.0"
55
55
  },
@@ -59,8 +59,8 @@
59
59
  "d3-shape": "^3.2.0"
60
60
  },
61
61
  "devDependencies": {
62
- "@astryxdesign/a11y-spec": "0.7.5-canary.577e8ca",
63
- "@astryxdesign/cli": "0.7.5-canary.577e8ca",
62
+ "@astryxdesign/a11y-spec": "0.7.5-canary.6322d94",
63
+ "@astryxdesign/cli": "0.7.5-canary.6322d94",
64
64
  "@babel/cli": "^7.29.7",
65
65
  "@babel/core": "^7.29.7",
66
66
  "@babel/preset-react": "^7.29.7",
@@ -74,14 +74,14 @@
74
74
  },
75
75
  "scripts": {
76
76
  "build": "node ../../scripts/clean-dist.mjs && pnpm build:esm && tsc --project tsconfig.build.json && node ../../scripts/add-declaration-extensions.mjs && pnpm build:css && node ../../scripts/check-no-dev-jsx.mjs && node ../../scripts/check-fully-specified.mjs",
77
- "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.json",
77
+ "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.cjs",
78
78
  "build:css": "node ../../scripts/build-css.mjs --package lab",
79
- "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.json",
79
+ "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.cjs",
80
80
  "test": "vitest run --root ../..",
81
81
  "test:watch": "vitest --root ../..",
82
82
  "lint": "eslint src",
83
83
  "typecheck:docs": "tsc --project tsconfig.docs.json",
84
- "typecheck": "tsc --project tsconfig.json --noEmit",
84
+ "typecheck": "tsc --project tsconfig.json --noEmit && pnpm typecheck:docs",
85
85
  "generate:emoji-data": "node scripts/generate-emoji-data.mjs"
86
86
  }
87
87
  }
@@ -1,4 +1,5 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ // @pr-a11y release-only
2
3
 
3
4
  /** Real-browser and accessibility-tree binding for ChatTypingIndicator. */
4
5
 
@@ -1,4 +1,5 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ // @pr-a11y scope ^(internal/a11y-spec/src/patterns/progressbar\.|packages/core/src/ProgressBar/|packages/lab/src/CircularProgress/|apps/storybook/stories/ProgressbarA11y)
2
3
 
3
4
  /**
4
5
  * @file CircularProgress.a11y.chromium.spec.ts
@@ -82,6 +82,12 @@ import type {
82
82
  CommentUser,
83
83
  } from './types';
84
84
 
85
+ // The page's shared live regions are not the component's error Banner.
86
+ const errorBanner = () =>
87
+ screen
88
+ .queryAllByRole('alert')
89
+ .find(element => !element.hasAttribute('data-astryx-live-region'));
90
+
85
91
  const VIEWER: CommentUser = {id: 'avery', name: 'Avery Kim'};
86
92
  const OTHER: CommentUser = {id: 'maya', name: 'Maya Chen'};
87
93
  const AGENT: CommentUser = {
@@ -900,12 +906,12 @@ describe('Comments threads', () => {
900
906
  }),
901
907
  );
902
908
  await flush();
903
- const banner = screen.getByRole('alert');
909
+ const banner = errorBanner()!;
904
910
  expect(banner.textContent).toContain("Your reaction couldn't be saved.");
905
911
  await click(within(banner).getByRole('button', {name: 'Retry'}));
906
912
  await flush();
907
913
  expect(onReact).toHaveBeenCalledTimes(2);
908
- expect(screen.queryByRole('alert')).toBeNull();
914
+ expect(errorBanner()).toBeUndefined();
909
915
  });
910
916
 
911
917
  it('copies a link to the comment', async () => {
@@ -999,7 +1005,7 @@ describe('Comments threads', () => {
999
1005
  />
1000
1006
  </Sized>,
1001
1007
  );
1002
- const banner = screen.getByRole('alert');
1008
+ const banner = errorBanner()!;
1003
1009
  expect(banner.textContent).toContain("Couldn't post this comment.");
1004
1010
  await click(within(banner).getByRole('button', {name: 'Retry'}));
1005
1011
  await flush();
@@ -1022,7 +1028,7 @@ describe('Comments threads', () => {
1022
1028
  );
1023
1029
  await click(screen.getByRole('button', {name: 'Load earlier comments'}));
1024
1030
  await flush();
1025
- const banner = screen.getByRole('alert');
1031
+ const banner = errorBanner()!;
1026
1032
  expect(banner.textContent).toContain("Earlier comments couldn't load");
1027
1033
  await click(within(banner).getByRole('button', {name: 'Retry'}));
1028
1034
  await flush();
@@ -660,10 +660,13 @@ describe('ListInput', () => {
660
660
  expect(animate).not.toHaveBeenCalled();
661
661
  expect(screen.queryByDisplayValue('Ada')).not.toBeInTheDocument();
662
662
  expect(screen.getByRole('button', {name: 'Add guest'})).toHaveFocus();
663
+ // The removal and the empty state that appears join in one frame (FR9).
663
664
  await waitFor(() => {
664
665
  expect(
665
666
  Array.from(document.querySelectorAll('[aria-live="polite"]')).some(
666
- node => node.textContent === 'Removed guest 1.',
667
+ node =>
668
+ node.textContent ===
669
+ 'Removed guest 1. No guests yet Add a guest to get started.',
667
670
  ),
668
671
  ).toBe(true);
669
672
  });
@@ -56,7 +56,14 @@ function Harness({
56
56
  );
57
57
  }
58
58
 
59
- function CreateHarness({spy}: {spy: ReturnType<typeof vi.fn>}) {
59
+ function CreateHarness({
60
+ spy,
61
+ }: {
62
+ spy: (
63
+ items: SearchableItem[],
64
+ change: MobileTokenizerChange<SearchableItem>,
65
+ ) => void;
66
+ }) {
60
67
  const [value, setValue] = useState<SearchableItem[]>([]);
61
68
  return (
62
69
  <MobileTokenizer
@@ -105,8 +112,10 @@ beforeEach(() => {
105
112
  window.scrollTo = vi.fn();
106
113
  vi.stubGlobal(
107
114
  'requestAnimationFrame',
115
+ // Next microtask, not synchronously: a real frame never runs before
116
+ // requestAnimationFrame returns, and callers may rely on its id.
108
117
  vi.fn((cb: FrameRequestCallback) => {
109
- cb(0);
118
+ queueMicrotask(() => cb(0));
110
119
  return 1;
111
120
  }),
112
121
  );
@@ -302,7 +311,7 @@ describe('MobileTokenizer (Lab, single-sheet flow)', () => {
302
311
  const title = await screen.findByRole('heading', {
303
312
  name: 'No results found',
304
313
  });
305
- const emptyState = title.closest('[role="status"]');
314
+ const emptyState = title.closest('.astryx-empty-state');
306
315
  expect(emptyState).toHaveTextContent('Try a different search.');
307
316
  expect(emptyState?.querySelector('.astryx-icon')).toHaveAttribute(
308
317
  'data-size',
@@ -1,4 +1,5 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ // @pr-a11y always
2
3
 
3
4
  /**
4
5
  * @file ReorderGripPinchZoom.a11y.chromium.spec.ts