@hussmartinez/ui 0.0.0-stage → 0.1.1

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.
Files changed (3) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +190 -2
  3. package/package.json +77 -3
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
202
+
package/README.md CHANGED
@@ -1,3 +1,191 @@
1
- # Temporary Holding Version
1
+ # @hussmartinez/ui
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![npm version of @hussmartinez/ui](https://img.shields.io/npm/v/@hussmartinez/ui)](https://www.npmjs.com/package/@hussmartinez/ui) [![Verify workflow status on main](https://github.com/ie-huss-martinez/ui/actions/workflows/verify.yml/badge.svg?branch=main)](https://github.com/ie-huss-martinez/ui/actions/workflows/verify.yml?query=branch%3Amain) [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue)](https://github.com/ie-huss-martinez/ui/blob/main/LICENSE)
4
+
5
+ The design system of the `@hussmartinez` SDK family: design tokens, themes, base styles and accessible React components. Every SDK's editor uses it, and standalone applications can too.
6
+
7
+ > Status: `0.x`, so the API may still change between minor versions. Tokens, theming and the first components are available; more components are on the way.
8
+
9
+ ## Install
10
+
11
+ ```sh
12
+ npm install @hussmartinez/ui
13
+ ```
14
+
15
+ For the React components, your application also needs `react` and `react-dom` 18.3 or later. They're optional peer dependencies, so the tokens and theme helpers work without them.
16
+
17
+ ## Quick start
18
+
19
+ Import the stylesheet once, at the root of your application, and use the components:
20
+
21
+ ```tsx
22
+ import "@hussmartinez/ui/styles.css";
23
+ import { Button, ThemeProvider } from "@hussmartinez/ui/react";
24
+
25
+ export function App() {
26
+ return (
27
+ <ThemeProvider mode="system">
28
+ <Button variant="primary">Save</Button>
29
+ </ThemeProvider>
30
+ );
31
+ }
32
+ ```
33
+
34
+ `mode="system"` follows the operating system's light or dark preference, in CSS, so nothing flashes on load. Without `ThemeProvider`, the page follows the system preference too; the provider is for a forced mode, a density or a custom theme.
35
+
36
+ ## Entry points
37
+
38
+ The package is ESM only ([ADR 0004](https://github.com/ie-huss-martinez/sdk-core/blob/main/docs/adr/0004-entry-points-and-module-format.md)).
39
+
40
+ | Entry | Contents |
41
+ |---|---|
42
+ | `@hussmartinez/ui` | Tokens, `createTheme`, `themeToCss`, the built-in themes and their types. No React and no DOM access on import, so it's safe in Server Components and build scripts |
43
+ | `@hussmartinez/ui/react` | `ThemeProvider`, `UiMessagesProvider` and the components. Starts with `"use client"`. React and React DOM `>=18.3` are optional peer dependencies |
44
+ | `@hussmartinez/ui/styles.css` | All styles: the built-in tokens and base styles, in the cascade layers `hm.tokens` and `hm.base`. Import it once in your application |
45
+
46
+ JavaScript never imports CSS, so your application decides where the stylesheet loads. Your own unlayered CSS overrides every `hm` layer without `!important` ([ADR 0005](https://github.com/ie-huss-martinez/sdk-core/blob/main/docs/adr/0005-plain-css-with-cascade-layers.md)).
47
+
48
+ ## Tokens
49
+
50
+ Every visual value is a CSS custom property, such as `--hm-color-accent` or `--hm-radius-control`. Base tokens are raw scales; semantic tokens name a purpose, and are the ones to use. The [token reference](https://github.com/ie-huss-martinez/ui/blob/main/packages/ui/docs/tokens.md) lists them all, with their light, dark and compact values.
51
+
52
+ ```css
53
+ .my-panel {
54
+ background: var(--hm-color-surface);
55
+ border-radius: var(--hm-radius-surface);
56
+ padding: var(--hm-inset-normal);
57
+ }
58
+ ```
59
+
60
+ ## Themes
61
+
62
+ With `styles.css` loaded, the built-in light and dark themes follow the operating system's preference, in pure CSS, so nothing flashes on load. Attributes change any subtree:
63
+
64
+ ```html
65
+ <section data-hm-theme="dark">Always dark</section>
66
+ <section data-hm-theme="system">Follows the system again</section>
67
+ <aside data-hm-density="compact">Tighter controls</aside>
68
+ ```
69
+
70
+ `data-hm-theme` takes `light`, `dark` or `system`, and `data-hm-density` takes `comfortable` (the default) or `compact`. On touch screens, targets are 44 px in either density. A themed subtree also sets its text colour to `--hm-color-text`, in the lowest-priority layer, so your own CSS still wins. Backgrounds are left to you: paint them with `--hm-color-bg` or `--hm-color-surface`.
71
+
72
+ ### Custom themes
73
+
74
+ `createTheme` validates a set of token values. Extend a built-in theme and change only what you need, or set every semantic token to replace the look entirely.
75
+
76
+ ```ts
77
+ import { createTheme } from "@hussmartinez/ui";
78
+
79
+ export const brandLight = createTheme({
80
+ extends: "light",
81
+ tokens: { "color-accent": "#5b21b6", "radius-control": "0" },
82
+ });
83
+ export const brandDark = createTheme({
84
+ extends: "dark",
85
+ tokens: { "color-accent": "#c4b5fd", "radius-control": "0" },
86
+ });
87
+ ```
88
+
89
+ - **Validation:** every value is checked against its token's type and an allowlist grammar, so a value can't break out of its CSS, even when it comes from a user. Invalid values throw `UiError` with the code `INVALID_THEME_TOKEN`. Show users the text from `uiMessages`, never the error's `message`.
90
+ - **Contrast:** in development, `createTheme` warns when text, boundary or focus colours fall below WCAG 2.2 AA contrast. `checkContrast(theme)` returns the same report, for checking colours users choose.
91
+
92
+ There are two ways to apply a theme.
93
+
94
+ **`ThemeProvider`** applies a theme, a colour mode and a density to everything inside it. It renders on the server, so there's no flash before hydration. Create themes once, at module level, not during render.
95
+
96
+ ```tsx
97
+ import { ThemeProvider } from "@hussmartinez/ui/react";
98
+
99
+ <ThemeProvider theme={{ light: brandLight, dark: brandDark }} mode="system" density="compact">
100
+ <App />
101
+ </ThemeProvider>;
102
+ ```
103
+
104
+ Without `theme`, it applies the built-in themes. `mode` is `light`, `dark` or `system`. Themes must come from `createTheme`; pass one loaded as JSON through `createTheme` first. An application that uses only the built-in themes doesn't ship the theme validator: `ThemeProvider` on its own is about 1 kB, minified and compressed.
105
+
106
+ **`themeToCss`** writes a theme as a static stylesheet, at build time or on the server:
107
+
108
+ ```ts
109
+ import { themeToCss } from "@hussmartinez/ui";
110
+
111
+ const css = themeToCss({ light: brandLight, dark: brandDark }); // applies to :root
112
+ const scoped = themeToCss(brandLight, ".marketing"); // only inside .marketing
113
+ ```
114
+
115
+ Custom themes always beat the built-in ones, whatever order stylesheets load in. Themes can nest; the closest one wins. Invalid selectors throw `UiError` with the code `INVALID_THEME_SELECTOR`.
116
+
117
+ ## Server rendering and frameworks
118
+
119
+ Every component renders on the server and hydrates without warnings; end-to-end tests check it in a Next.js App Router application and a server-rendered Vite application ([ADR 0007](https://github.com/ie-huss-martinez/sdk-core/blob/main/docs/adr/0007-server-rendering-and-nextjs.md)). Nothing touches the browser when either entry is imported.
120
+
121
+ - **Next.js Server Components** can import `@hussmartinez/ui` (tokens, `createTheme`, `themeToCss`) and render components from `@hussmartinez/ui/react` directly, as long as they pass no functions. Put components that need callbacks, such as `Dialog`, in a client component.
122
+ - **Custom themes in Server Components:** a theme passed to a client component is serialised, so `ThemeProvider` can't receive one from a Server Component. Write it as CSS instead, `<style>{themeToCss(theme, ".brand")}</style>`, or create the theme in a client module.
123
+ - **Vite** may print "module level directive may not be preserved" for `@hussmartinez/ui/react`. It's harmless: `"use client"` only matters to frameworks with Server Components.
124
+
125
+ ## Content Security Policy
126
+
127
+ - **The built-in themes** need no inline styles: `styles.css` and the `data-hm-*` attributes are enough.
128
+ - **`ThemeProvider` with a custom theme** renders a `<style>` element. Allow it with a nonce, `style-src 'self' 'nonce-…'`, and pass the same nonce to the `nonce` prop.
129
+ - **A strict policy without nonces:** generate the theme with `themeToCss` at build time and serve it as a stylesheet, then use `ThemeProvider` without `theme`, or plain `data-hm-*` attributes.
130
+
131
+ No styles are evaluated as JavaScript, and nothing needs `unsafe-eval`.
132
+
133
+ ## Components
134
+
135
+ Every component follows one contract ([ADR 0003](https://github.com/ie-huss-martinez/ui/blob/main/docs/adr/0003-component-contract.md)):
136
+
137
+ - **Styling:** `className` on the root, `classNames` per named part, and stable `.hm-*` classes to target. `unstyled` drops colours, borders, typography and motion, and keeps layout, focus rings and target sizes.
138
+ - **Theming:** component tokens, such as `--hm-button-radius`, fall back to semantic tokens. Set them on any ancestor.
139
+ - **Refs and props:** refs reach the root element, and native props pass through.
140
+ - **Text:** text props, falling back to `UiMessagesProvider`.
141
+
142
+ | Component | Use it for |
143
+ |---|---|
144
+ | `Button` | Actions. `variant` is `primary`, `secondary` (default), `quiet` or `danger`; `size` is `medium` or `small`; `pressed` makes a toggle button; `startIcon` and `endIcon` take icons |
145
+ | `IconButton` | Icon-only actions. `label` is required: it's the accessible name |
146
+ | `VisuallyHidden` | Text for assistive technology only |
147
+ | `Toolbar`, `ToolbarGroup`, `ToolbarSeparator` | A row or column of controls with one Tab stop: arrow keys move between items, Home and End jump to the ends. `label` is required on the toolbar and its groups |
148
+ | `SegmentedControl` | A few mutually exclusive choices side by side. A radio group: arrow keys move and select. Inside a `Toolbar`, it joins the toolbar's arrow keys, and Space or Enter selects |
149
+ | `Dialog` | A modal dialog on the native `<dialog>`: focus moves in and is trapped, the page behind is inert, Escape asks to close through `onOpenChange(false)`, and focus returns to the opener. Controlled by `open`; labelled by `title`. Long content scrolls in the body, which becomes keyboard-scrollable when it overflows |
150
+ | `Spinner` | Loading for an unknown time. An indeterminate progress bar to assistive technology, named by `label`; its size follows `--hm-spinner-size` |
151
+ | `ProgressBar` | Progress for a known amount, on the native `<progress>`: `value`, `max`, `label`, `valueText`. Indeterminate without `value`. It needs no inline styles, so it works under a strict Content Security Policy |
152
+ | `AnnouncerProvider`, `useAnnounce` | Announcements for screen readers, such as "Saved 1.3 MB": `announce(message, { politeness })`. The provider renders the live regions once, on the server too |
153
+
154
+ ```tsx
155
+ import { Button, IconButton } from "@hussmartinez/ui/react";
156
+
157
+ <Button variant="primary" startIcon={<DownloadIcon />} onClick={save}>
158
+ {messages.t("toolbar.download")}
159
+ </Button>
160
+ <IconButton label={messages.t("toolbar.rotate")} icon={<RotateIcon />} onClick={rotate} />
161
+ ```
162
+
163
+ Icons are yours: pass any element that draws with `currentColor`. Each component costs a few hundred bytes minified and compressed, and a bundler drops the ones you don't import.
164
+
165
+ ### Text
166
+
167
+ Components never contain inline text. Text props win; otherwise, components read `UiMessagesProvider`, which takes an sdk-core `Messages` object whose catalogue includes `uiMessages`:
168
+
169
+ ```tsx
170
+ const messages = createMessages({ ...sdkCoreMessages, ...uiMessages, ...yourMessages }, { locale });
171
+
172
+ <UiMessagesProvider messages={messages}>
173
+ <App />
174
+ </UiMessagesProvider>
175
+ ```
176
+
177
+ ## Errors and messages
178
+
179
+ Errors are `UiError`s, subclasses of sdk-core's `SdkError`, with a stable `code` and `details`. `uiMessages` has English text for each code; spread it into your catalogue next to `sdkCoreMessages`:
180
+
181
+ ```ts
182
+ import { createMessages, defineMessages, sdkCoreMessages } from "@hussmartinez/sdk-core";
183
+ import { uiMessages } from "@hussmartinez/ui";
184
+
185
+ const messages = createMessages(defineMessages({ ...sdkCoreMessages, ...uiMessages }));
186
+ messages.error(error); // "The theme setting color-accent has a value that can't be used."
187
+ ```
188
+
189
+ ## License
190
+
191
+ [Apache-2.0](https://github.com/ie-huss-martinez/ui/blob/main/LICENSE)
package/package.json CHANGED
@@ -1,6 +1,80 @@
1
1
  {
2
2
  "name": "@hussmartinez/ui",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "description": "Design system of the @hussmartinez SDK family: tokens, themes, base styles and accessible React components.",
5
+ "license": "Apache-2.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/ie-huss-martinez/ui.git",
9
+ "directory": "packages/ui"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/ie-huss-martinez/ui/issues"
13
+ },
14
+ "homepage": "https://github.com/ie-huss-martinez/ui/tree/main/packages/ui#readme",
15
+ "type": "module",
16
+ "sideEffects": [
17
+ "**/*.css"
18
+ ],
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/index.d.ts",
22
+ "default": "./dist/index.js"
23
+ },
24
+ "./react": {
25
+ "types": "./dist/react.d.ts",
26
+ "default": "./dist/react.js"
27
+ },
28
+ "./styles.css": "./dist/styles.css",
29
+ "./package.json": "./package.json"
30
+ },
31
+ "files": [
32
+ "dist"
33
+ ],
34
+ "dependencies": {
35
+ "@hussmartinez/sdk-core": "^0.1.0"
36
+ },
37
+ "peerDependencies": {
38
+ "react": ">=18.3",
39
+ "react-dom": ">=18.3"
40
+ },
41
+ "peerDependenciesMeta": {
42
+ "react": {
43
+ "optional": true
44
+ },
45
+ "react-dom": {
46
+ "optional": true
47
+ }
48
+ },
49
+ "devDependencies": {
50
+ "@arethetypeswrong/cli": "^0.18.5",
51
+ "@hussmartinez/sdk-config": "^0.1.3",
52
+ "@microsoft/api-extractor": "^7.60.1",
53
+ "@size-limit/file": "^14.3.0",
54
+ "@types/node": "^24.19.2",
55
+ "@types/react": "^19.3.0",
56
+ "@types/react-dom": "^19.3.0",
57
+ "@vitest/browser-playwright": "5.1.0",
58
+ "esbuild": "^0.28.2",
59
+ "playwright": "^1.64.1",
60
+ "publint": "^0.3.25",
61
+ "react": "^19.3.0",
62
+ "react-dom": "^19.3.0",
63
+ "size-limit": "^14.3.0",
64
+ "typescript": "^6.0.3",
65
+ "vite": "^8.3.6",
66
+ "vitest": "^5.1.0"
67
+ },
68
+ "scripts": {
69
+ "typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.test.json",
70
+ "build": "vite build && pnpm check:api",
71
+ "test": "vitest run --project unit",
72
+ "test:browser": "vitest run --project browser",
73
+ "test:browser:all": "vitest run --project browser --mode all-browsers",
74
+ "check:size": "size-limit",
75
+ "check:api": "tsc -p tsconfig.build.json && api-extractor run && api-extractor run -c api-extractor.react.json",
76
+ "check:package": "publint run --pack pnpm --strict && attw --pack . --profile esm-only --exclude-entrypoints ./styles.css",
77
+ "api:update": "tsc -p tsconfig.build.json && api-extractor run --local && api-extractor run -c api-extractor.react.json --local",
78
+ "tokens": "node scripts/generate-tokens.ts"
79
+ }
6
80
  }