@imfusion/web-ui 0.6.1-dev.1.g23386714 → 0.6.1-dev.14.g8fac1dfb
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/README.md +102 -151
- package/dist/{code-Blo48PGr.js → code-C_56u-Vk.js} +2 -2
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toast/toast.d.ts +197 -0
- package/dist/components/toast/toast.meta.d.ts +2 -0
- package/dist/icons/icon-config.d.ts +12 -0
- package/dist/{icons-wBmF0U2x.js → icons-Cy1HAosO.js} +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +992 -829
- package/dist/integrations/code-highlight.js +2 -2
- package/dist/integrations/image-display-options.js +1 -1
- package/dist/provider/web-ui-provider.d.ts +3 -3
- package/dist/style.css +1 -1
- package/package.json +3 -2
- package/src/docgen/doc.gen.json +381 -0
- package/src/llms/install-templates/AGENTS.md +15 -18
- package/src/llms/llms.gen.txt +39 -33
- package/src/llms/skills/imf-web-ui/SKILL.md +29 -39
- package/src/llms/skills/imf-web-ui-audit/SKILL.md +50 -102
- package/src/llms/skills/imf-web-ui-components/SKILL.md +47 -104
- package/src/llms/skills/imf-web-ui-conventions/SKILL.md +39 -52
- package/src/llms/skills/imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md +1 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/agent-tooling.md +40 -62
- package/src/llms/skills/imf-web-ui-conventions/topics/assets.md +11 -12
- package/src/llms/skills/imf-web-ui-conventions/topics/authentication.md +31 -46
- package/src/llms/skills/imf-web-ui-conventions/topics/class-names.md +18 -23
- package/src/llms/skills/imf-web-ui-conventions/topics/components.md +20 -69
- package/src/llms/skills/imf-web-ui-conventions/topics/data.md +50 -146
- package/src/llms/skills/imf-web-ui-conventions/topics/docs-structure.md +17 -23
- package/src/llms/skills/imf-web-ui-conventions/topics/git.md +15 -20
- package/src/llms/skills/imf-web-ui-conventions/topics/library-boundary.md +28 -19
- package/src/llms/skills/imf-web-ui-conventions/topics/library-setup.md +20 -16
- package/src/llms/skills/imf-web-ui-conventions/topics/npm-project.md +28 -42
- package/src/llms/skills/imf-web-ui-conventions/topics/project-structure.md +28 -30
- package/src/llms/skills/imf-web-ui-conventions/topics/react.md +28 -74
- package/src/llms/skills/imf-web-ui-conventions/topics/styling.md +65 -62
- package/src/llms/skills/imf-web-ui-conventions/topics/testing.md +12 -14
- package/src/llms/skills/imf-web-ui-conventions/topics/tokens.md +9 -4
- package/src/llms/skills/imf-web-ui-conventions/topics/tooling.md +40 -68
- package/src/llms/skills/imf-web-ui-conventions/topics/typescript.md +26 -50
- package/src/llms/skills/imf-web-ui-conventions/topics/validation.md +19 -25
- package/src/llms/skills/imf-web-ui-setup/SKILL.md +43 -64
- package/src/llms/skills/imf-web-ui-update/SKILL.md +48 -114
- package/src/llms/skills/imf-web-ui-ux/SKILL.md +64 -92
- package/src/llms/skills/imf-web-ui-ux/references/forms.md +16 -36
- package/src/llms/skills/imf-web-ui-ux/references/usability-heuristics.md +14 -27
- package/src/llms/skills/imf-web-ui-ux/references/visual-design.md +22 -38
- package/dist/icons/icon-config-provider.d.ts +0 -8
- package/dist/icons/icon-context.d.ts +0 -4
package/README.md
CHANGED
|
@@ -1,209 +1,160 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @imfusion/web-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The shared React UI library for ImFusion web apps. It provides accessible primitives, ImFusion tokens, and one public import
|
|
4
|
+
surface. Base UI supplies behavior for the primitives that need it; consumers do not depend on Base UI directly.
|
|
4
5
|
|
|
5
|
-
- [
|
|
6
|
-
- [
|
|
7
|
-
- [
|
|
8
|
-
- [
|
|
6
|
+
- [Use the library](#use-the-library)
|
|
7
|
+
- [Read the docs](#read-the-docs)
|
|
8
|
+
- [Work on the library](#work-on-the-library)
|
|
9
|
+
- [Release it](#release-it)
|
|
9
10
|
|
|
10
|
-
##
|
|
11
|
+
## Use the library
|
|
11
12
|
|
|
12
|
-
The
|
|
13
|
+
The package is private. Get the Web SDK npm token from the
|
|
14
|
+
[Test Licenses page](https://imfusion.atlassian.net/wiki/spaces/DEV/pages/255590402/Test+Licenses), then save it in your
|
|
15
|
+
user-level npm config:
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
[Test Licenses](https://imfusion.atlassian.net/wiki/spaces/DEV/pages/255590402/Test+Licenses) page on Confluence and add it
|
|
16
|
-
to your user-level `.npmrc`:
|
|
17
|
-
|
|
18
|
-
```bash
|
|
17
|
+
```sh
|
|
19
18
|
npm config set //registry.npmjs.org/:_authToken=<token> --location=user
|
|
20
19
|
```
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
Install the latest release:
|
|
23
22
|
|
|
24
|
-
```
|
|
23
|
+
```sh
|
|
25
24
|
npm install @imfusion/web-ui
|
|
26
25
|
```
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
To follow builds from `master`, use the `dev` dist-tag:
|
|
29
28
|
|
|
30
|
-
```
|
|
29
|
+
```sh
|
|
31
30
|
npm install @imfusion/web-ui@dev
|
|
32
31
|
```
|
|
33
32
|
|
|
34
|
-
Import the stylesheet and
|
|
33
|
+
Import the stylesheet and mount the provider once at your app root:
|
|
35
34
|
|
|
36
35
|
```tsx
|
|
37
36
|
import "@imfusion/web-ui/styles.css";
|
|
38
37
|
import { WebUIProvider } from "@imfusion/web-ui";
|
|
39
|
-
```
|
|
40
38
|
|
|
41
|
-
|
|
39
|
+
export function App() {
|
|
40
|
+
return <WebUIProvider>{/* app */}</WebUIProvider>;
|
|
41
|
+
}
|
|
42
|
+
```
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
### Agent skills
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
The package can install optional skills for agents working in a consumer project:
|
|
46
47
|
|
|
47
|
-
```
|
|
48
|
+
```sh
|
|
48
49
|
npx web-ui-install
|
|
49
50
|
```
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
The optional `--hooks` flag also installs the agent lifecycle hooks and registers them for both hosts, in
|
|
55
|
-
`.claude/settings.json` (Claude Code) and `.codex/hooks.json` (Codex). Three hooks inject one fixed line each: `SessionStart`
|
|
56
|
-
and `SubagentStart` point the agent at the `imf-web-ui` skills router, and `UserPromptSubmit` names the companion skills to
|
|
57
|
-
consult per task. A fourth, the `Stop` gate, blocks a turn that edited source files once, until the agent has addressed the
|
|
58
|
-
project's verification. Re-running the installer refreshes the scripts and prunes retired ones along with their
|
|
59
|
-
registrations. Without `--hooks`, the skills are still available but no lifecycle hook runs. The full flow is documented in
|
|
60
|
-
the shipped [`agent-tooling` topic](./src/llms/skills/imf-web-ui-conventions/topics/agent-tooling.md) of the conventions
|
|
61
|
-
skill.
|
|
62
|
-
|
|
63
|
-
**Available consumer skills - `/imf-web-ui-*`**
|
|
64
|
-
|
|
65
|
-
| Skill | What it does |
|
|
66
|
-
| ------------------------- | ------------------------------------------------------------------------------ |
|
|
67
|
-
| `/imf-web-ui` | The router: decides whether guidance is needed, then which companion to open. |
|
|
68
|
-
| `/imf-web-ui-setup` | Plan and, after approval, bootstrap a consumer project by topic. |
|
|
69
|
-
| `/imf-web-ui-components` | Component and icon reference — what exists and how it's meant to be used. |
|
|
70
|
-
| `/imf-web-ui-ux` | UX guidance for building interfaces with the library. |
|
|
71
|
-
| `/imf-web-ui-conventions` | The frontend conventions baseline, including the sanctioned styling seams. |
|
|
72
|
-
| `/imf-web-ui-audit` | Read-only health check for a consumer project, ending in a plan you approve. |
|
|
73
|
-
| `/imf-web-ui-update` | Update the library, skills, and optional hooks, then verify before committing. |
|
|
74
|
-
|
|
75
|
-
Start at `/imf-web-ui` — it routes to the rest. Storybook's **User Guide → AI Agents** page covers the whole family.
|
|
76
|
-
|
|
77
|
-
### Versions and updates
|
|
78
|
-
|
|
79
|
-
Every merge to master publishes a new build under the `dev` dist-tag. Which spec you install decides how you pick those up:
|
|
80
|
-
|
|
81
|
-
| Spec in `package.json` | Gets | Update with |
|
|
82
|
-
| ---------------------------------- | -------------------------- | ------------------------------ |
|
|
83
|
-
| `"@imfusion/web-ui": "^0.5.0"` | matching releases | `npm update @imfusion/web-ui` |
|
|
84
|
-
| `"@imfusion/web-ui": "latest"` | the newest release | `npm update @imfusion/web-ui` |
|
|
85
|
-
| `"@imfusion/web-ui": "dev"` | the newest build of master | `npm update @imfusion/web-ui` |
|
|
86
|
-
| `"@imfusion/web-ui": "file:….tgz"` | a packed tarball, frozen | re-pack and re-install by hand |
|
|
87
|
-
|
|
88
|
-
- **Two dist-tags.** `latest` moves when a release is tagged, `dev` on every build of master (and onto the release when one
|
|
89
|
-
is cut).
|
|
90
|
-
- **A range like `^0.5.0` is the usual choice.** It tracks releases and states which major you expect; bare `latest` follows
|
|
91
|
-
releases across majors, breaking changes included.
|
|
92
|
-
- **Dist-tag specs stay literal.** npm keeps `dev` or `latest` as-is in `package.json` and re-resolves on every `npm update`.
|
|
93
|
-
The concrete version lands in `package-lock.json`, so builds stay reproducible until you update.
|
|
94
|
-
- **Track `dev` while building against the library**, to get new components as they land. Use a release spec for anything you
|
|
95
|
-
cut a production release from, since `dev` moves whenever someone merges.
|
|
96
|
-
- **A `file:` tarball never updates.** npm copies the archive into `node_modules` and re-copies the same one on every
|
|
97
|
-
install. Switch to `dev` or a version range to get updates.
|
|
98
|
-
|
|
99
|
-
## Documentation
|
|
100
|
-
|
|
101
|
-
**[Storybook](https://storybook.js.org/)** is the documentation platform — the component catalog, every prop, and the setup
|
|
102
|
-
guides. It isn't hosted yet, so run it locally:
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
npm run dev # builds the library, then Storybook + a rebuild watcher
|
|
106
|
-
```
|
|
52
|
+
Run the command again after updating the package. It refreshes the skills already installed in the project. Use
|
|
53
|
+
`--reconfigure` to choose a different target. Add `--hooks` to install the lifecycle hooks for Claude Code and Codex.
|
|
107
54
|
|
|
108
|
-
|
|
55
|
+
Start with `/imf-web-ui`. It routes a task to the companion skills it needs, or tells the agent to work without extra
|
|
56
|
+
guidance.
|
|
109
57
|
|
|
110
|
-
|
|
58
|
+
| Skill | Use it for |
|
|
59
|
+
| ------------------------- | ------------------------------------------------------------ |
|
|
60
|
+
| `/imf-web-ui` | Route UI work to the right companion. |
|
|
61
|
+
| `/imf-web-ui-setup` | Plan library wiring, project setup, or tooling changes. |
|
|
62
|
+
| `/imf-web-ui-components` | Look up component and icon APIs. |
|
|
63
|
+
| `/imf-web-ui-ux` | Choose components and shape screens and flows. |
|
|
64
|
+
| `/imf-web-ui-conventions` | Follow the frontend conventions and token seams. |
|
|
65
|
+
| `/imf-web-ui-audit` | Inspect an existing frontend without changing it. |
|
|
66
|
+
| `/imf-web-ui-update` | Update the package, skills, and hooks in a consumer project. |
|
|
111
67
|
|
|
112
|
-
|
|
68
|
+
The shipped [`agent-tooling` topic](./src/llms/skills/imf-web-ui-conventions/topics/agent-tooling.md) explains the hook
|
|
69
|
+
installation and Codex trust step.
|
|
113
70
|
|
|
114
|
-
|
|
115
|
-
npm install
|
|
116
|
-
npm run git:config # hooks path + rebase-only pull/merge
|
|
117
|
-
```
|
|
71
|
+
### Versions
|
|
118
72
|
|
|
119
|
-
|
|
73
|
+
Use a release version or range for production and `dev` while building against the library:
|
|
120
74
|
|
|
121
|
-
|
|
75
|
+
| Dependency spec | Resolves to | Update with |
|
|
76
|
+
| --------------- | -------------------------------- | ----------------------------- |
|
|
77
|
+
| `^0.6.0` | compatible releases | `npm update @imfusion/web-ui` |
|
|
78
|
+
| `latest` | newest release | `npm update @imfusion/web-ui` |
|
|
79
|
+
| `dev` | newest build of `master` | `npm update @imfusion/web-ui` |
|
|
80
|
+
| `file:…tgz` | the packed archive you installed | pack and install again |
|
|
122
81
|
|
|
123
|
-
|
|
124
|
-
|
|
82
|
+
`latest` and `dev` are dist-tags. npm records the resolved version in `package-lock.json`; the tag stays in `package.json`
|
|
83
|
+
until you update it. A bare `latest` can cross major versions, while a range keeps the expected major. A file tarball is a
|
|
84
|
+
copy, so it never updates by itself.
|
|
125
85
|
|
|
126
|
-
|
|
127
|
-
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
128
|
-
| `/documentation-writer` | External `npx skills` workflow for Diátaxis documentation. |
|
|
129
|
-
| `/web-ui-dev-getting-started` | Interactive intro — gauges your experience, works out your goal, routes you. |
|
|
130
|
-
| `/web-ui-dev-start` | Starting ritual for any task: Jira context, `master` vs. a worktree, context summary. |
|
|
131
|
-
| `/web-ui-dev-new-component` | Scaffolds an architecture-compliant primitive (adapted or absorbed). |
|
|
132
|
-
| `/web-ui-dev-update-component` | Pointers to every file a prop, variant, or sub-component change touches. |
|
|
133
|
-
| `/web-ui-dev-design-component` | Brand design pass for a component that works but isn't styled yet. |
|
|
134
|
-
| `/web-ui-dev-story` | Author or update a Storybook story. |
|
|
135
|
-
| `/web-ui-dev-commit` | Commit workflow: changelog skill, staged docs audit, CI-parity checks, house commit format. |
|
|
136
|
-
| `/web-ui-dev-release` | Prepare release notes, commit them, and ship the approved release. |
|
|
137
|
-
| `/web-ui-dev-changelog` | Generate and validate the required one-line CHANGELOG.md entry for a web-ui change, including direct commits to master. |
|
|
138
|
-
| `/web-ui-dev-audit-docs` | Audit docs against staged or recent changes for staleness, gaps, and drift. |
|
|
139
|
-
| `/web-ui-dev-audit-pass-through-defaults` | Check `@default` annotations on pass-through props against Base UI upstream. |
|
|
140
|
-
| `/web-ui-dev-teardown-worktree` | Tear down a worktree, wherever it lives — merging its branch first or dropping it. |
|
|
141
|
-
| `/web-ui-dev-refresh-design-reference` | Refresh the committed brand snapshots in `design/` from the Figma styleguide. |
|
|
142
|
-
| `/web-ui-dev-mcp` | Set up or recover Storybook, DevTools, Atlassian, or Figma MCP access. |
|
|
86
|
+
## Read the docs
|
|
143
87
|
|
|
144
|
-
|
|
88
|
+
[Storybook](https://storybook.js.org/) is the public documentation site. It contains the setup guide, usage patterns, token
|
|
89
|
+
reference, and component examples. It is not hosted yet; run it locally from this repository:
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
npm run dev
|
|
93
|
+
```
|
|
145
94
|
|
|
146
|
-
|
|
147
|
-
commit workflow requires an entry for pull-request commits and direct commits to `master`, with only narrow mechanical
|
|
148
|
-
exceptions. Each entry ends with its author as ` — Name <email>`, taken from the committer's git config.
|
|
95
|
+
The source for the contributor docs is [`docs/README.md`](./docs/README.md). Start there if you are changing the library.
|
|
149
96
|
|
|
150
|
-
|
|
97
|
+
## Work on the library
|
|
151
98
|
|
|
152
|
-
|
|
153
|
-
|
|
99
|
+
```sh
|
|
100
|
+
npm install
|
|
101
|
+
npm run git:config
|
|
102
|
+
```
|
|
154
103
|
|
|
155
|
-
|
|
104
|
+
`git:config` sets the tracked hooks path, enables rebase pulls, and requires fast-forward merges. The
|
|
105
|
+
[`web-ui-dev-getting-started`](./.agents/skills/web-ui-dev-getting-started/SKILL.md) skill can route a first task.
|
|
156
106
|
|
|
157
|
-
|
|
107
|
+
The main development skills are:
|
|
158
108
|
|
|
159
|
-
|
|
109
|
+
| Skill | Use it for |
|
|
110
|
+
| ----------------------------------------- | ------------------------------------------------ |
|
|
111
|
+
| `/web-ui-dev-getting-started` | Route a first task based on experience and goal. |
|
|
112
|
+
| `/web-ui-dev-start` | Establish task context and working location. |
|
|
113
|
+
| `/web-ui-dev-new-component` | Add a primitive. |
|
|
114
|
+
| `/web-ui-dev-update-component` | Change an existing primitive. |
|
|
115
|
+
| `/web-ui-dev-design-component` | Apply the ImFusion brand to a component. |
|
|
116
|
+
| `/web-ui-dev-story` | Author a Storybook story. |
|
|
117
|
+
| `/web-ui-dev-commit` | Verify and commit a change. |
|
|
118
|
+
| `/web-ui-dev-release` | Prepare and ship a release. |
|
|
119
|
+
| `/web-ui-dev-audit-docs` | Check docs for drift before a commit. |
|
|
120
|
+
| `/web-ui-dev-audit-pass-through-defaults` | Check adapted prop defaults against Base UI. |
|
|
121
|
+
| `/web-ui-dev-refresh-design-reference` | Refresh the committed brand snapshots. |
|
|
122
|
+
| `/web-ui-dev-teardown-worktree` | Remove a finished worktree. |
|
|
123
|
+
| `/web-ui-dev-mcp` | Recover one optional MCP capability. |
|
|
160
124
|
|
|
161
|
-
|
|
162
|
-
| -------------------------- | ----------------------- | -------- |
|
|
163
|
-
| Exactly on `web-ui/v0.5.0` | `0.5.0` | `latest` |
|
|
164
|
-
| 5 commits after that tag | `0.5.1-dev.5.gb4de52d7` | `dev` |
|
|
125
|
+
## Release it
|
|
165
126
|
|
|
166
|
-
The
|
|
127
|
+
The published version comes from git tags. The repository keeps `package.json` at `0.0.0`; CI writes the real version into
|
|
128
|
+
the build copy.
|
|
167
129
|
|
|
168
|
-
|
|
169
|
-
0.5.1-dev.5.gb4de52d7
|
|
170
|
-
└─┬─┘ └┬┘ │ └───┬────┘
|
|
171
|
-
│ │ │ └── commit hash, abbreviated; the leading g means "git"
|
|
172
|
-
│ │ └──────── commits since the tag
|
|
173
|
-
│ └─────────── pre-release marker, which is what puts it on the dev tag
|
|
174
|
-
└──────────────── the tag's version, patch bumped
|
|
175
|
-
```
|
|
130
|
+
For a tag such as `web-ui/v0.6.0`:
|
|
176
131
|
|
|
177
|
-
|
|
132
|
+
| HEAD is | Published version | Tag |
|
|
133
|
+
| --------------------- | --------------------- | -------- |
|
|
134
|
+
| `web-ui/v0.6.0` | `0.6.0` | `latest` |
|
|
135
|
+
| five commits after it | `0.6.1-dev.5.g<hash>` | `dev` |
|
|
178
136
|
|
|
179
|
-
|
|
137
|
+
Check the version for the current checkout without changing files:
|
|
180
138
|
|
|
181
|
-
```
|
|
182
|
-
npx tsx scripts/version.ts
|
|
139
|
+
```sh
|
|
140
|
+
npx tsx scripts/version.ts
|
|
183
141
|
```
|
|
184
142
|
|
|
185
|
-
|
|
143
|
+
Use `/web-ui-dev-release <version>` to prepare release notes and get the release commit approved. The final command is:
|
|
186
144
|
|
|
187
|
-
|
|
188
|
-
approval gate. Then ship that prepared commit:
|
|
189
|
-
|
|
190
|
-
```bash
|
|
145
|
+
```sh
|
|
191
146
|
npm run release
|
|
192
147
|
```
|
|
193
148
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
version.
|
|
197
|
-
|
|
198
|
-
The tag name must match `web-ui/vX.Y.Z` exactly. Both the version script's `--match` and the TeamCity branch filter in
|
|
199
|
-
[`.teamcity/settings.kts`](./.teamcity/settings.kts) key off that shape; a tag in any other form publishes nothing.
|
|
149
|
+
It requires a clean tree, runs the full verification, creates `web-ui/v<version>`, and pushes the tag. TeamCity builds that
|
|
150
|
+
tag and publishes npm. The tag must match that shape exactly.
|
|
200
151
|
|
|
201
|
-
|
|
152
|
+
To build a local tarball with a real version:
|
|
202
153
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
```bash
|
|
206
|
-
npx tsx scripts/version.ts --write # writes it into package.json
|
|
154
|
+
```sh
|
|
155
|
+
npx tsx scripts/version.ts --write
|
|
207
156
|
npm run build
|
|
208
|
-
git checkout package.json
|
|
157
|
+
git checkout package.json
|
|
209
158
|
```
|
|
159
|
+
|
|
160
|
+
The release skill covers the optional TeamCity CLI checks and the publication verification.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./chunk-DmhlhrBa.js";
|
|
2
2
|
import { t } from "./meta-CySnRuVp.js";
|
|
3
|
-
import { Ma as n, Qt as r, Xo as i, hn as a, r as o } from "./icons-
|
|
3
|
+
import { Ma as n, Qt as r, Xo as i, hn as a, r as o } from "./icons-Cy1HAosO.js";
|
|
4
4
|
import { cx as s } from "class-variance-authority";
|
|
5
5
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
6
|
import { useCallback as u, useEffect as d, useRef as f, useState as p } from "react";
|
|
@@ -129,7 +129,7 @@ var b = {
|
|
|
129
129
|
category: t.display,
|
|
130
130
|
status: "stable",
|
|
131
131
|
namespace: !0,
|
|
132
|
-
description: "Displays source code
|
|
132
|
+
description: "Displays source code inline or in a block, with optional language labels and copying. Also called a code snippet or code block.",
|
|
133
133
|
origin: "native"
|
|
134
134
|
};
|
|
135
135
|
//#endregion
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { Toast as ToastPrimitive } from '@base-ui/react/toast';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
type UpstreamProvider = React.ComponentProps<typeof ToastPrimitive.Provider>;
|
|
4
|
+
type UpstreamPortal = React.ComponentProps<typeof ToastPrimitive.Portal>;
|
|
5
|
+
type UpstreamViewport = React.ComponentProps<typeof ToastPrimitive.Viewport>;
|
|
6
|
+
type UpstreamRoot = React.ComponentProps<typeof ToastPrimitive.Root>;
|
|
7
|
+
type UpstreamContent = React.ComponentProps<typeof ToastPrimitive.Content>;
|
|
8
|
+
type UpstreamTitle = React.ComponentProps<typeof ToastPrimitive.Title>;
|
|
9
|
+
type UpstreamDescription = React.ComponentProps<typeof ToastPrimitive.Description>;
|
|
10
|
+
type UpstreamClose = React.ComponentProps<typeof ToastPrimitive.Close>;
|
|
11
|
+
type UpstreamAction = React.ComponentProps<typeof ToastPrimitive.Action>;
|
|
12
|
+
type UpstreamPositioner = React.ComponentProps<typeof ToastPrimitive.Positioner>;
|
|
13
|
+
type UpstreamArrow = React.ComponentProps<typeof ToastPrimitive.Arrow>;
|
|
14
|
+
declare const toastViewport: (props?: ({
|
|
15
|
+
position?: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | null | undefined;
|
|
16
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
17
|
+
declare const toastRoot: (props?: ({
|
|
18
|
+
variant?: "warning" | "info" | "neutral" | "success" | "error" | null | undefined;
|
|
19
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
20
|
+
/**
|
|
21
|
+
* Toast.useToastManager — reads the queue and the add/close/update/promise
|
|
22
|
+
* methods from the surrounding provider. Must run inside a provider; the one
|
|
23
|
+
* `WebUIProvider` mounts satisfies that for the standard setup.
|
|
24
|
+
*/
|
|
25
|
+
export declare const useToastManager: typeof ToastPrimitive.useToastManager;
|
|
26
|
+
/**
|
|
27
|
+
* Toast.createToastManager — creates a manager that lives outside React so
|
|
28
|
+
* non-component code can add toasts. Pass it to a `Toast.Provider` via
|
|
29
|
+
* `toastManager`.
|
|
30
|
+
*/
|
|
31
|
+
export declare const createToastManager: typeof ToastPrimitive.createToastManager;
|
|
32
|
+
type ProviderProps = {
|
|
33
|
+
timeout?: UpstreamProvider["timeout"];
|
|
34
|
+
limit?: UpstreamProvider["limit"];
|
|
35
|
+
toastManager?: UpstreamProvider["toastManager"];
|
|
36
|
+
children?: UpstreamProvider["children"];
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Toast.Provider — owns the toast queue for its subtree. Renders no DOM element.
|
|
40
|
+
*
|
|
41
|
+
* `WebUIProvider` already mounts one, so most applications never write this
|
|
42
|
+
* part. Use it for a scoped queue or to attach an external manager.
|
|
43
|
+
*
|
|
44
|
+
* @see https://base-ui.com/react/components/toast
|
|
45
|
+
* @llm https://base-ui.com/react/components/toast.md
|
|
46
|
+
*/
|
|
47
|
+
export declare function Provider({ timeout, limit, ...props }: ProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare namespace Provider {
|
|
49
|
+
var displayName: string;
|
|
50
|
+
}
|
|
51
|
+
type PortalProps = Omit<React.HTMLAttributes<HTMLDivElement>, "className"> & {
|
|
52
|
+
container?: UpstreamPortal["container"];
|
|
53
|
+
className?: UpstreamPortal["className"];
|
|
54
|
+
render?: UpstreamPortal["render"];
|
|
55
|
+
children?: UpstreamPortal["children"];
|
|
56
|
+
};
|
|
57
|
+
/** Toast.Portal — moves the viewport out of the page flow so toasts float above the app. */
|
|
58
|
+
export declare function Portal({ className, ...props }: PortalProps): import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
export declare namespace Portal {
|
|
60
|
+
var displayName: string;
|
|
61
|
+
}
|
|
62
|
+
type ViewportProps = Omit<React.HTMLAttributes<HTMLDivElement>, "className"> & {
|
|
63
|
+
/** Which edge or corner of the screen the stack anchors to. */
|
|
64
|
+
position?: VariantProps<typeof toastViewport>["position"];
|
|
65
|
+
className?: UpstreamViewport["className"];
|
|
66
|
+
render?: UpstreamViewport["render"];
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Toast.Viewport — the fixed layer that holds the stack. Hovering or focusing it
|
|
70
|
+
* expands the collapsed toasts; it ignores pointer events except on the toasts
|
|
71
|
+
* themselves so the app underneath stays clickable.
|
|
72
|
+
*/
|
|
73
|
+
export declare function Viewport({ className, position, ...props }: ViewportProps): import("react/jsx-runtime").JSX.Element;
|
|
74
|
+
export declare namespace Viewport {
|
|
75
|
+
var displayName: string;
|
|
76
|
+
}
|
|
77
|
+
type RootProps = Omit<React.HTMLAttributes<HTMLDivElement>, "className"> & {
|
|
78
|
+
/** Semantic treatment for the toast surface. */
|
|
79
|
+
variant?: VariantProps<typeof toastRoot>["variant"];
|
|
80
|
+
/** The toast object from the manager's `toasts` array. */
|
|
81
|
+
toast: UpstreamRoot["toast"];
|
|
82
|
+
/** @default ['down', 'right'] */
|
|
83
|
+
swipeDirection?: UpstreamRoot["swipeDirection"];
|
|
84
|
+
className?: UpstreamRoot["className"];
|
|
85
|
+
render?: UpstreamRoot["render"];
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Toast.Root — one toast surface. Carries the upstream state as data attributes
|
|
89
|
+
* (`data-starting-style`, `data-ending-style`, `data-expanded`, `data-limited`,
|
|
90
|
+
* `data-swiping`) which the stylesheet uses for stack and exit motion.
|
|
91
|
+
*/
|
|
92
|
+
export declare function Root({ className, variant, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
|
|
93
|
+
export declare namespace Root {
|
|
94
|
+
var displayName: string;
|
|
95
|
+
}
|
|
96
|
+
type ContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, "className"> & {
|
|
97
|
+
className?: UpstreamContent["className"];
|
|
98
|
+
render?: UpstreamContent["render"];
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Toast.Content — lays out title, description, action, and close. Fades out on
|
|
102
|
+
* the toasts stacked behind the frontmost one via `data-behind`.
|
|
103
|
+
*/
|
|
104
|
+
export declare function Content({ className, ...props }: ContentProps): import("react/jsx-runtime").JSX.Element;
|
|
105
|
+
export declare namespace Content {
|
|
106
|
+
var displayName: string;
|
|
107
|
+
}
|
|
108
|
+
type TitleProps = Omit<React.HTMLAttributes<HTMLHeadingElement>, "className"> & {
|
|
109
|
+
className?: UpstreamTitle["className"];
|
|
110
|
+
render?: UpstreamTitle["render"];
|
|
111
|
+
};
|
|
112
|
+
/** Toast.Title — the message heading. Falls back to the toast object's `title` when given no children. */
|
|
113
|
+
export declare function Title({ className, ...props }: TitleProps): import("react/jsx-runtime").JSX.Element;
|
|
114
|
+
export declare namespace Title {
|
|
115
|
+
var displayName: string;
|
|
116
|
+
}
|
|
117
|
+
type DescriptionProps = Omit<React.HTMLAttributes<HTMLParagraphElement>, "className"> & {
|
|
118
|
+
className?: UpstreamDescription["className"];
|
|
119
|
+
render?: UpstreamDescription["render"];
|
|
120
|
+
};
|
|
121
|
+
/** Toast.Description — supporting copy. Falls back to the toast object's `description` when given no children. */
|
|
122
|
+
export declare function Description({ className, ...props }: DescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
123
|
+
export declare namespace Description {
|
|
124
|
+
var displayName: string;
|
|
125
|
+
}
|
|
126
|
+
type CloseProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className"> & {
|
|
127
|
+
/** @default true */
|
|
128
|
+
nativeButton?: UpstreamClose["nativeButton"];
|
|
129
|
+
className?: UpstreamClose["className"];
|
|
130
|
+
render?: UpstreamClose["render"];
|
|
131
|
+
};
|
|
132
|
+
/** Toast.Close — dismisses the toast it sits in. */
|
|
133
|
+
export declare function Close({ className, ...props }: CloseProps): import("react/jsx-runtime").JSX.Element;
|
|
134
|
+
export declare namespace Close {
|
|
135
|
+
var displayName: string;
|
|
136
|
+
}
|
|
137
|
+
type ActionProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className"> & {
|
|
138
|
+
/** @default true */
|
|
139
|
+
nativeButton?: UpstreamAction["nativeButton"];
|
|
140
|
+
className?: UpstreamAction["className"];
|
|
141
|
+
render?: UpstreamAction["render"];
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Toast.Action — the toast's single affordance, typically an undo. Its behavior
|
|
145
|
+
* comes from `actionProps` on the toast object passed to the manager.
|
|
146
|
+
*/
|
|
147
|
+
export declare function Action({ className, ...props }: ActionProps): import("react/jsx-runtime").JSX.Element;
|
|
148
|
+
export declare namespace Action {
|
|
149
|
+
var displayName: string;
|
|
150
|
+
}
|
|
151
|
+
type PositionerProps = Omit<React.HTMLAttributes<HTMLDivElement>, "className"> & {
|
|
152
|
+
/** The toast object from the manager's `toasts` array. */
|
|
153
|
+
toast: UpstreamPositioner["toast"];
|
|
154
|
+
/** @default 'top' */
|
|
155
|
+
side?: UpstreamPositioner["side"];
|
|
156
|
+
/** @default 'center' */
|
|
157
|
+
align?: UpstreamPositioner["align"];
|
|
158
|
+
/** @default 0 */
|
|
159
|
+
sideOffset?: UpstreamPositioner["sideOffset"];
|
|
160
|
+
/** @default 0 */
|
|
161
|
+
alignOffset?: UpstreamPositioner["alignOffset"];
|
|
162
|
+
/** @default 5 */
|
|
163
|
+
arrowPadding?: UpstreamPositioner["arrowPadding"];
|
|
164
|
+
anchor?: UpstreamPositioner["anchor"];
|
|
165
|
+
collisionAvoidance?: UpstreamPositioner["collisionAvoidance"];
|
|
166
|
+
/** @default 'clipping-ancestors' */
|
|
167
|
+
collisionBoundary?: UpstreamPositioner["collisionBoundary"];
|
|
168
|
+
/** @default 5 */
|
|
169
|
+
collisionPadding?: UpstreamPositioner["collisionPadding"];
|
|
170
|
+
/** @default 'absolute' */
|
|
171
|
+
positionMethod?: UpstreamPositioner["positionMethod"];
|
|
172
|
+
/** @default false */
|
|
173
|
+
sticky?: UpstreamPositioner["sticky"];
|
|
174
|
+
/** @default false */
|
|
175
|
+
disableAnchorTracking?: UpstreamPositioner["disableAnchorTracking"];
|
|
176
|
+
className?: UpstreamPositioner["className"];
|
|
177
|
+
render?: UpstreamPositioner["render"];
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* Toast.Positioner — anchors a toast to an element instead of the stack, for
|
|
181
|
+
* feedback that belongs next to the control that caused it. Wrap a `Root` in it
|
|
182
|
+
* and the root switches to the compact content-sized surface.
|
|
183
|
+
*/
|
|
184
|
+
export declare function Positioner({ className, ...props }: PositionerProps): import("react/jsx-runtime").JSX.Element;
|
|
185
|
+
export declare namespace Positioner {
|
|
186
|
+
var displayName: string;
|
|
187
|
+
}
|
|
188
|
+
type ArrowProps = Omit<React.HTMLAttributes<HTMLDivElement>, "className"> & {
|
|
189
|
+
className?: UpstreamArrow["className"];
|
|
190
|
+
render?: UpstreamArrow["render"];
|
|
191
|
+
};
|
|
192
|
+
/** Toast.Arrow — pointer joining an anchored toast to its anchor. Receives `data-side` for orientation. */
|
|
193
|
+
export declare function Arrow({ className, ...props }: ArrowProps): import("react/jsx-runtime").JSX.Element;
|
|
194
|
+
export declare namespace Arrow {
|
|
195
|
+
var displayName: string;
|
|
196
|
+
}
|
|
197
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode, SVGProps } from 'react';
|
|
2
|
+
type IconConfig = Omit<SVGProps<SVGSVGElement>, "children" | "ref">;
|
|
3
|
+
interface ProviderProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
value?: IconConfig;
|
|
6
|
+
}
|
|
7
|
+
/** IconConfig.Provider — sets SVG defaults (color, size, stroke width) for icons in its subtree. Providers shallow-merge with the closest parent's config. */
|
|
8
|
+
export declare function Provider({ children, value }: ProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare namespace Provider {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -71,7 +71,7 @@ var a5 = {
|
|
|
71
71
|
name: "Icon",
|
|
72
72
|
category: e.display,
|
|
73
73
|
status: "stable",
|
|
74
|
-
description: "
|
|
74
|
+
description: "Renders a Web UI icon with an optional semantic foreground color. The default inherits the surrounding currentColor.",
|
|
75
75
|
origin: "native"
|
|
76
76
|
};
|
|
77
77
|
//#endregion
|