strata-react 0.0.0-stage → 0.1.3

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.
@@ -0,0 +1,70 @@
1
+ import { RenderOptions } from '@testing-library/react';
2
+ import { QueryClient } from '@tanstack/react-query';
3
+ /**
4
+ * Test helpers: render a component inside a router and a query client, as a Strata app runs it.
5
+ * Use with MSW for the network, never module mocks.
6
+ *
7
+ * @module strata-react/testing
8
+ */
9
+ import * as React from "react";
10
+ export declare function createTestQueryClient(): QueryClient;
11
+ export declare function renderWithStrata(ui: React.ReactElement, { route, client, ...options }?: RenderOptions & {
12
+ route?: string;
13
+ client?: QueryClient;
14
+ }): {
15
+ container: HTMLElement;
16
+ baseElement: HTMLElement;
17
+ debug: (baseElement?: import('react-dom/client').Container | (Element | Document) | Array<import('react-dom/client').Container | (Element | Document)> | undefined, maxLength?: number | undefined, options?: import('pretty-format').OptionsReceived | undefined) => void;
18
+ rerender: (ui: React.ReactNode) => void;
19
+ unmount: () => void;
20
+ asFragment: () => DocumentFragment;
21
+ getByLabelText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').SelectorMatcherOptions | undefined) => HTMLElement;
22
+ getAllByLabelText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').SelectorMatcherOptions | undefined) => HTMLElement[];
23
+ queryByLabelText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').SelectorMatcherOptions | undefined) => HTMLElement | null;
24
+ queryAllByLabelText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').SelectorMatcherOptions | undefined) => HTMLElement[];
25
+ findByLabelText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').SelectorMatcherOptions | undefined, waitForElementOptions?: import('@testing-library/dom').waitForOptions | undefined) => Promise<HTMLElement>;
26
+ findAllByLabelText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').SelectorMatcherOptions | undefined, waitForElementOptions?: import('@testing-library/dom').waitForOptions | undefined) => Promise<HTMLElement[]>;
27
+ getByPlaceholderText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement;
28
+ getAllByPlaceholderText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement[];
29
+ queryByPlaceholderText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement | null;
30
+ queryAllByPlaceholderText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement[];
31
+ findByPlaceholderText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/dom').waitForOptions | undefined) => Promise<HTMLElement>;
32
+ findAllByPlaceholderText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/dom').waitForOptions | undefined) => Promise<HTMLElement[]>;
33
+ getByText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').SelectorMatcherOptions | undefined) => HTMLElement;
34
+ getAllByText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').SelectorMatcherOptions | undefined) => HTMLElement[];
35
+ queryByText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').SelectorMatcherOptions | undefined) => HTMLElement | null;
36
+ queryAllByText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').SelectorMatcherOptions | undefined) => HTMLElement[];
37
+ findByText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').SelectorMatcherOptions | undefined, waitForElementOptions?: import('@testing-library/dom').waitForOptions | undefined) => Promise<HTMLElement>;
38
+ findAllByText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').SelectorMatcherOptions | undefined, waitForElementOptions?: import('@testing-library/dom').waitForOptions | undefined) => Promise<HTMLElement[]>;
39
+ getByAltText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement;
40
+ getAllByAltText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement[];
41
+ queryByAltText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement | null;
42
+ queryAllByAltText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement[];
43
+ findByAltText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/dom').waitForOptions | undefined) => Promise<HTMLElement>;
44
+ findAllByAltText: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/dom').waitForOptions | undefined) => Promise<HTMLElement[]>;
45
+ getByTitle: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement;
46
+ getAllByTitle: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement[];
47
+ queryByTitle: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement | null;
48
+ queryAllByTitle: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement[];
49
+ findByTitle: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/dom').waitForOptions | undefined) => Promise<HTMLElement>;
50
+ findAllByTitle: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/dom').waitForOptions | undefined) => Promise<HTMLElement[]>;
51
+ getByDisplayValue: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement;
52
+ getAllByDisplayValue: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement[];
53
+ queryByDisplayValue: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement | null;
54
+ queryAllByDisplayValue: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement[];
55
+ findByDisplayValue: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/dom').waitForOptions | undefined) => Promise<HTMLElement>;
56
+ findAllByDisplayValue: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/dom').waitForOptions | undefined) => Promise<HTMLElement[]>;
57
+ getByRole: (role: import('@testing-library/dom').ByRoleMatcher, options?: import('@testing-library/dom').ByRoleOptions | undefined) => HTMLElement;
58
+ getAllByRole: (role: import('@testing-library/dom').ByRoleMatcher, options?: import('@testing-library/dom').ByRoleOptions | undefined) => HTMLElement[];
59
+ queryByRole: (role: import('@testing-library/dom').ByRoleMatcher, options?: import('@testing-library/dom').ByRoleOptions | undefined) => HTMLElement | null;
60
+ queryAllByRole: (role: import('@testing-library/dom').ByRoleMatcher, options?: import('@testing-library/dom').ByRoleOptions | undefined) => HTMLElement[];
61
+ findByRole: (role: import('@testing-library/dom').ByRoleMatcher, options?: import('@testing-library/dom').ByRoleOptions | undefined, waitForElementOptions?: import('@testing-library/dom').waitForOptions | undefined) => Promise<HTMLElement>;
62
+ findAllByRole: (role: import('@testing-library/dom').ByRoleMatcher, options?: import('@testing-library/dom').ByRoleOptions | undefined, waitForElementOptions?: import('@testing-library/dom').waitForOptions | undefined) => Promise<HTMLElement[]>;
63
+ getByTestId: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement;
64
+ getAllByTestId: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement[];
65
+ queryByTestId: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement | null;
66
+ queryAllByTestId: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined) => HTMLElement[];
67
+ findByTestId: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/dom').waitForOptions | undefined) => Promise<HTMLElement>;
68
+ findAllByTestId: (id: import('@testing-library/dom').Matcher, options?: import('@testing-library/dom').MatcherOptions | undefined, waitForElementOptions?: import('@testing-library/dom').waitForOptions | undefined) => Promise<HTMLElement[]>;
69
+ client: QueryClient;
70
+ };
@@ -0,0 +1,32 @@
1
+ import { n as StrataQueryProvider, r as createQueryClient } from "./query-DZVmYJSx.js";
2
+ import "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { MemoryRouter } from "react-router";
5
+ import { render } from "@testing-library/react";
6
+ // src/testing/index.tsx
7
+ function createTestQueryClient() {
8
+ return createQueryClient({ defaultOptions: { queries: {
9
+ retry: false,
10
+ staleTime: Infinity,
11
+ gcTime: Infinity
12
+ } } });
13
+ }
14
+ function renderWithStrata(ui, { route = "/", client = createTestQueryClient(), ...options } = {}) {
15
+ const Wrapper = ({ children }) => /* @__PURE__ */ jsx(StrataQueryProvider, {
16
+ client,
17
+ children: /* @__PURE__ */ jsx(MemoryRouter, {
18
+ initialEntries: [route],
19
+ children
20
+ })
21
+ });
22
+ return {
23
+ client,
24
+ ...render(ui, {
25
+ wrapper: Wrapper,
26
+ ...options
27
+ })
28
+ };
29
+ }
30
+ export { createTestQueryClient, renderWithStrata };
31
+
32
+ //# sourceMappingURL=testing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.js","names":[],"sources":["../src/testing/index.tsx"],"sourcesContent":["/**\n * Test helpers: render a component inside a router and a query client, as a Strata app runs it.\n * Use with MSW for the network, never module mocks.\n *\n * @module strata-react/testing\n */\nimport * as React from \"react\";\nimport { render, type RenderOptions } from \"@testing-library/react\";\nimport { MemoryRouter } from \"react-router\";\nimport { QueryClient } from \"@tanstack/react-query\";\nimport { StrataQueryProvider, createQueryClient } from \"../query\";\n\n// Render a component the way a Strata app runs it: inside a router and a query client. Tests use\n// MSW for the network (see CLAUDE.md), never module mocks, so the real fetch/query/DataView path\n// runs. Each call gets a fresh QueryClient with retries off, so a test that serves a 500 sees the\n// error at once instead of after the retry delay.\n\nexport function createTestQueryClient() {\n return createQueryClient({ defaultOptions: { queries: { retry: false, staleTime: Infinity, gcTime: Infinity } } });\n}\n\nexport function renderWithStrata(\n ui: React.ReactElement,\n { route = \"/\", client = createTestQueryClient(), ...options }: RenderOptions & { route?: string; client?: QueryClient } = {},\n) {\n const Wrapper = ({ children }: { children: React.ReactNode }) => (\n <StrataQueryProvider client={client}>\n <MemoryRouter initialEntries={[route]}>{children}</MemoryRouter>\n </StrataQueryProvider>\n );\n return { client, ...render(ui, { wrapper: Wrapper, ...options }) };\n}\n"],"mappings":";;;;;;AAiBA,SAAgB,wBAAwB;CACtC,OAAO,kBAAkB,EAAE,gBAAgB,EAAE,SAAS;EAAE,OAAO;EAAO,WAAW;EAAU,QAAQ;CAAS,EAAE,EAAE,CAAC;AACnH;AAEA,SAAgB,iBACd,IACA,EAAE,QAAQ,KAAK,SAAS,sBAAsB,GAAG,GAAG,YAAsE,CAAC,GAC3H;CACA,MAAM,WAAW,EAAE,eACjB,oBAAC,qBAAD;EAA6B;EAC3B,UAAA,oBAAC,cAAD;GAAc,gBAAgB,CAAC,KAAK;GAAI;EAAuB,CAAA;CAC5C,CAAA;CAEvB,OAAO;EAAE;EAAQ,GAAG,OAAO,IAAI;GAAE,SAAS;GAAS,GAAG;EAAQ,CAAC;CAAE;AACnE"}
package/package.json CHANGED
@@ -1,6 +1,129 @@
1
1
  {
2
2
  "name": "strata-react",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.3",
4
+ "description": "React + Tailwind v4 components that ship structure, behaviour, states and a token contract, and no look: each product brings a theme generated from its own subject.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/jburnhams/strata-react.git"
8
+ },
9
+ "type": "module",
10
+ "sideEffects": [
11
+ "**/*.css"
12
+ ],
13
+ "main": "./dist/index.js",
14
+ "module": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js",
20
+ "default": "./dist/index.js"
21
+ },
22
+ "./testing": {
23
+ "types": "./dist/testing/index.d.ts",
24
+ "import": "./dist/testing.js",
25
+ "default": "./dist/testing.js"
26
+ },
27
+ "./strata.css": {
28
+ "style": "./dist/strata.css",
29
+ "default": "./dist/strata.css"
30
+ },
31
+ "./package.json": "./package.json"
32
+ },
33
+ "files": [
34
+ "dist",
35
+ "README.md"
36
+ ],
37
+ "scripts": {
38
+ "clean": "node scripts/clean.mjs",
39
+ "build": "npm run clean && vite build && node scripts/copy-css.mjs",
40
+ "typecheck": "tsc --noEmit",
41
+ "test": "npm run typecheck && npm run test:unit",
42
+ "test:unit": "vitest run --project unit",
43
+ "test:integration": "npm run build && vitest run --project integration",
44
+ "test:all": "npm run test && npm run test:integration",
45
+ "coverage": "vitest run --project unit --coverage",
46
+ "storybook": "storybook dev -p 6006",
47
+ "build-storybook": "storybook build --quiet -o storybook-static",
48
+ "test:visual": "npm run build-storybook && node scripts/visual.mjs",
49
+ "test:visual:update": "npm run build-storybook && node scripts/visual.mjs --update",
50
+ "prepare": "npm run build",
51
+ "prepublishOnly": "npm run test:all",
52
+ "docs:api": "typedoc",
53
+ "site": "npm run build-storybook && typedoc && node scripts/build-site.mjs"
54
+ },
55
+ "keywords": [
56
+ "react",
57
+ "tailwindcss",
58
+ "design-system",
59
+ "components",
60
+ "storybook"
61
+ ],
62
+ "author": "jburnhams",
63
+ "license": "MIT",
64
+ "peerDependencies": {
65
+ "@tanstack/react-query": "^5.0.0",
66
+ "@testing-library/react": "^16.0.0",
67
+ "react": "^19.0.0",
68
+ "react-dom": "^19.0.0",
69
+ "react-router": "^7.0.0 || ^8.0.0",
70
+ "tailwindcss": "^4.1.0"
71
+ },
72
+ "peerDependenciesMeta": {
73
+ "@testing-library/react": {
74
+ "optional": true
75
+ }
76
+ },
77
+ "dependencies": {
78
+ "@radix-ui/react-slot": "^1.2.0",
79
+ "@tanstack/react-table": "^8.21.3",
80
+ "@tanstack/react-virtual": "^3.14.26",
81
+ "class-variance-authority": "^0.7.1",
82
+ "clsx": "^2.1.1",
83
+ "lucide-react": "^0.500.0",
84
+ "tailwind-merge": "^3.3.0"
85
+ },
86
+ "devDependencies": {
87
+ "@fontsource-variable/archivo": "^5.3.0",
88
+ "@fontsource-variable/public-sans": "^5.3.0",
89
+ "@storybook/addon-a11y": "^10.6.6",
90
+ "@storybook/addon-docs": "^10.6.6",
91
+ "@storybook/react-vite": "^10.6.6",
92
+ "@tailwindcss/node": "^4.3.5",
93
+ "@tailwindcss/vite": "^4.3.5",
94
+ "@tanstack/react-query": "^5.107.1",
95
+ "@testing-library/jest-dom": "^7.0.1",
96
+ "@testing-library/react": "^16.3.3",
97
+ "@testing-library/user-event": "^14.6.8",
98
+ "@types/node": "^26.6.6",
99
+ "@types/pngjs": "^6.0.5",
100
+ "@types/react": "^19.3.0",
101
+ "@types/react-dom": "^19.3.0",
102
+ "@vitejs/plugin-react": "^6.2.1",
103
+ "@vitest/coverage-v8": "^5.1.0",
104
+ "jsdom": "^31.0.0",
105
+ "msw": "^3.0.4",
106
+ "msw-storybook-addon": "^3.0.3",
107
+ "pixelmatch": "^8.0.0",
108
+ "playwright": "1.63.0",
109
+ "pngjs": "^7.0.0",
110
+ "react": "^19.3.1",
111
+ "react-dom": "^19.3.1",
112
+ "react-router": "^8.5.1",
113
+ "storybook": "^10.6.6",
114
+ "tailwindcss": "^4.3.5",
115
+ "typedoc": "^0.28.20",
116
+ "typescript": "~5.9",
117
+ "vite": "^8.3.6",
118
+ "vite-plugin-dts": "^5.1.2",
119
+ "vitest": "^5.1.0"
120
+ },
121
+ "engines": {
122
+ "node": ">=26.0.0"
123
+ },
124
+ "msw": {
125
+ "workerDirectory": [
126
+ ".storybook/public"
127
+ ]
128
+ }
129
+ }