@ignite-ember/ui-react 0.0.0-stage → 0.2.0

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 (99) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +5 -0
  3. package/README.md +217 -2
  4. package/dist/CopySource.d.ts +4 -0
  5. package/dist/CopySource.d.ts.map +1 -0
  6. package/dist/CopySource.js +36 -0
  7. package/dist/CopySource.js.map +1 -0
  8. package/dist/DataTable.d.ts +61 -0
  9. package/dist/DataTable.d.ts.map +1 -0
  10. package/dist/DataTable.js +29 -0
  11. package/dist/DataTable.js.map +1 -0
  12. package/dist/ErrorBoundary.d.ts +68 -0
  13. package/dist/ErrorBoundary.d.ts.map +1 -0
  14. package/dist/ErrorBoundary.js +63 -0
  15. package/dist/ErrorBoundary.js.map +1 -0
  16. package/dist/LiveRegion.d.ts +35 -0
  17. package/dist/LiveRegion.d.ts.map +1 -0
  18. package/dist/LiveRegion.js +70 -0
  19. package/dist/LiveRegion.js.map +1 -0
  20. package/dist/Markdown.d.ts +18 -0
  21. package/dist/Markdown.d.ts.map +1 -0
  22. package/dist/Markdown.js +52 -0
  23. package/dist/Markdown.js.map +1 -0
  24. package/dist/MarkdownInline.d.ts +44 -0
  25. package/dist/MarkdownInline.d.ts.map +1 -0
  26. package/dist/MarkdownInline.js +144 -0
  27. package/dist/MarkdownInline.js.map +1 -0
  28. package/dist/MenuIcon.d.ts +54 -0
  29. package/dist/MenuIcon.d.ts.map +1 -0
  30. package/dist/MenuIcon.js +96 -0
  31. package/dist/MenuIcon.js.map +1 -0
  32. package/dist/Mermaid.d.ts +38 -0
  33. package/dist/Mermaid.d.ts.map +1 -0
  34. package/dist/Mermaid.js +119 -0
  35. package/dist/Mermaid.js.map +1 -0
  36. package/dist/Monogram.d.ts +42 -0
  37. package/dist/Monogram.d.ts.map +1 -0
  38. package/dist/Monogram.js +88 -0
  39. package/dist/Monogram.js.map +1 -0
  40. package/dist/OverflowMenu.d.ts +55 -0
  41. package/dist/OverflowMenu.d.ts.map +1 -0
  42. package/dist/OverflowMenu.js +141 -0
  43. package/dist/OverflowMenu.js.map +1 -0
  44. package/dist/Shell.d.ts +54 -0
  45. package/dist/Shell.d.ts.map +1 -0
  46. package/dist/Shell.js +31 -0
  47. package/dist/Shell.js.map +1 -0
  48. package/dist/Skeleton.d.ts +32 -0
  49. package/dist/Skeleton.d.ts.map +1 -0
  50. package/dist/Skeleton.js +26 -0
  51. package/dist/Skeleton.js.map +1 -0
  52. package/dist/Split.d.ts +66 -0
  53. package/dist/Split.d.ts.map +1 -0
  54. package/dist/Split.js +133 -0
  55. package/dist/Split.js.map +1 -0
  56. package/dist/Toast.d.ts +87 -0
  57. package/dist/Toast.d.ts.map +1 -0
  58. package/dist/Toast.js +118 -0
  59. package/dist/Toast.js.map +1 -0
  60. package/dist/Tooltip.d.ts +15 -0
  61. package/dist/Tooltip.d.ts.map +1 -0
  62. package/dist/Tooltip.js +144 -0
  63. package/dist/Tooltip.js.map +1 -0
  64. package/dist/cx.d.ts +3 -0
  65. package/dist/cx.d.ts.map +1 -0
  66. package/dist/cx.js +5 -0
  67. package/dist/cx.js.map +1 -0
  68. package/dist/fenceInfo.d.ts +23 -0
  69. package/dist/fenceInfo.d.ts.map +1 -0
  70. package/dist/fenceInfo.js +19 -0
  71. package/dist/fenceInfo.js.map +1 -0
  72. package/dist/index.d.ts +82 -0
  73. package/dist/index.d.ts.map +1 -0
  74. package/dist/index.js +82 -0
  75. package/dist/index.js.map +1 -0
  76. package/dist/primitives.d.ts +383 -0
  77. package/dist/primitives.d.ts.map +1 -0
  78. package/dist/primitives.js +340 -0
  79. package/dist/primitives.js.map +1 -0
  80. package/package.json +56 -4
  81. package/src/CopySource.tsx +52 -0
  82. package/src/DataTable.tsx +104 -0
  83. package/src/ErrorBoundary.tsx +102 -0
  84. package/src/LiveRegion.tsx +121 -0
  85. package/src/Markdown.tsx +71 -0
  86. package/src/MarkdownInline.tsx +164 -0
  87. package/src/MenuIcon.tsx +203 -0
  88. package/src/Mermaid.tsx +142 -0
  89. package/src/Monogram.tsx +103 -0
  90. package/src/OverflowMenu.tsx +352 -0
  91. package/src/Shell.tsx +86 -0
  92. package/src/Skeleton.tsx +68 -0
  93. package/src/Split.tsx +242 -0
  94. package/src/Toast.tsx +258 -0
  95. package/src/Tooltip.tsx +188 -0
  96. package/src/cx.ts +4 -0
  97. package/src/fenceInfo.ts +33 -0
  98. package/src/index.ts +153 -0
  99. package/src/primitives.tsx +887 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,5 @@
1
+ igni
2
+ Copyright 2026 Ignite Ember
3
+
4
+ This product includes software developed at Ignite Ember
5
+ (https://ignite-ember.sh/).
package/README.md CHANGED
@@ -1,3 +1,218 @@
1
- # Temporary Holding Version
1
+ # `@ignite-ember/ui-react`
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
+ **Full documentation:** [ignite-ember.sh/docs/sdk/ui-react](https://ignite-ember.sh/docs/sdk/ui-react) — guides and the complete API reference, a page per topic.
4
+
5
+ The React components an igni extension is allowed to build on.
6
+ Everything exported here is under the compatibility floor: removing
7
+ one, renaming it, or changing a prop's meaning is a breaking change
8
+ under `docs/EXTENSIBILITY.md` §8.
9
+
10
+ From npm, with the stylesheet it is drawn with:
11
+
12
+ ```bash
13
+ npm install @ignite-ember/ui-react @ignite-ember/ui-css
14
+ ```
15
+
16
+ ```tsx
17
+ import { AppShell, Scroll, Table, Toolbar } from "@ignite-ember/ui-react";
18
+ import "@ignite-ember/ui-css";
19
+ ```
20
+
21
+ ## Quick start
22
+
23
+ A page that fills its frame, with a toolbar, a scrolling list and a
24
+ footer:
25
+
26
+ ```tsx
27
+ import { AppShell, Scroll, Toolbar, Button, Text, Empty } from "@ignite-ember/ui-react";
28
+ import { connect } from "@ignite-ember/extension-bridge";
29
+ import "@ignite-ember/ui-css";
30
+
31
+ async function main() {
32
+ const bridge = await connect();
33
+ const notes = await bridge.rpc<Note[]>("ext.example.teamnotes.list");
34
+
35
+ return (
36
+ <AppShell
37
+ header={<Toolbar>Notes</Toolbar>}
38
+ footer={<Button variant="primary">New note</Button>}
39
+ >
40
+ <Scroll>
41
+ {notes.length === 0 ? (
42
+ <Empty>Nothing here yet.</Empty>
43
+ ) : (
44
+ notes.map((note) => (
45
+ <Text key={note.id}>{note.title}</Text>
46
+ ))
47
+ )}
48
+ </Scroll>
49
+ </AppShell>
50
+ );
51
+ }
52
+ ```
53
+
54
+ Three things to know before you write more:
55
+
56
+ - **Every component here is a thin wrapper over a class.** `Button` with
57
+ `variant="primary"` renders `<button class="btn btn-primary">`. The
58
+ appearance is in the stylesheet, shared with igni's own app; the
59
+ component adds the prop names, the types and the defaults.
60
+ - **You need the stylesheet too.** `@ignite-ember/ui-css` is not optional
61
+ and not a suggestion — see below.
62
+ - **You bring your own React.** These are React components, not web
63
+ components, and your extension bundles its own React.
64
+
65
+ ## The floor
66
+
67
+ "Everything exported here is under the compatibility floor" is a promise
68
+ about *this* list, not about igni's app. Two rules follow from it, and
69
+ they point in opposite directions:
70
+
71
+ - **You may build against anything exported here.** A component's name,
72
+ its props and the meaning of those props will not change without a
73
+ major version. If you need to know what a prop means, the reference
74
+ page says so — every prop of every component is listed with its type
75
+ and what it is for.
76
+ - **You may not build against anything else.** A class in igni's app
77
+ that is not exported here is ours to change: it may be renamed, or
78
+ restyled, or removed, and nothing an extension depends on will break
79
+ in a way we would have to warn you about.
80
+
81
+ The list is deliberately short. It is not "everything an extension might
82
+ want" — it is what the first two extensions actually import, measured
83
+ rather than estimated. `CodeIndex` needs none of it; its only app
84
+ dependency is the client type. `Artifacts` is 7,737 lines and imports
85
+ exactly seven of the app's components.
86
+
87
+ Two rules decide whether something joins the floor, and both are checked
88
+ by tests:
89
+
90
+ 1. **It must render outside this repository.** A component whose CSS
91
+ lives only in igni's `theme.css` is unstyled in the one place it is
92
+ promised for, because an extension runs on its own origin under
93
+ `default-src 'self'` and cannot link ours. `styled.test.ts` checks
94
+ every class named here against `clients/ui/igni-ui.css` and fails on
95
+ the first one that is missing. This was not hypothetical: seven
96
+ components shipped under the floor naming thirty-two classes that no
97
+ published stylesheet defined, and the reference extension did not
98
+ catch it because it happens to import only from `primitives`, which
99
+ was the half that was covered.
100
+ 2. **It must not drag the app behind it.** `boundary.test.ts` fails on
101
+ an import — static or dynamic — that leaves this directory for
102
+ anywhere but `react` and the published dependencies. `SpecBlock`
103
+ left the floor for this reason: it loaded
104
+ `../components/JsonRenderView`, a path that does not exist in a
105
+ published package, through a dynamic import that no compiler would
106
+ flag.
107
+
108
+ ## Choosing a component
109
+
110
+ There are two kinds of thing in this package, and they answer different
111
+ questions.
112
+
113
+ **The primitives** are the vocabulary: `Button`, `Input`, `Select`,
114
+ `Textarea`, `Checkbox`, `Radio`, `Switch`, `Field`, `Row`, `Actions`,
115
+ `List`, `Toolbar`, `Card`, `Item`, `Table`, `Chip`, `Badge`, `Empty`,
116
+ `Dialog`, `Tabs`, `TabPanel`, `Heading`, `Text`, `Code`, `Divider`,
117
+ `Spinner`, `Progress`. They are thin, they hold no state, and they make
118
+ no decisions. Reach for one of these first — it is the thing that will
119
+ still be here next release.
120
+
121
+ **The composites** are the parts of a page that have to be a page:
122
+ `AppShell` and `Scroll` (the frame), `DataTable`'s `SortableTh` and
123
+ `Status` (a table with a sortable header and a status cell), `Toast` and
124
+ `ToastHost` and `useToast` (saying something), `LiveRegion` and
125
+ `useAnnounce` (announcing it), `ErrorBoundary` (catching what falls
126
+ over), `Markdown` and `MarkdownInline` and `MermaidBlock` (reading what
127
+ igni said).
128
+
129
+ **The utilities** are the small pieces: `Split`, `MenuIcon`,
130
+ `Monogram`, `OverflowMenu`, `Skeleton`, `Tooltip`.
131
+
132
+ One thing is deliberately absent: there is no `Title` component, because
133
+ the app's titles varied across four type steps and that variation is the
134
+ design — a heading level, not drift. Use `Heading`, or the type scale
135
+ and a weight.
136
+
137
+ `Dialog` is the one primitive that is not thin. A dialog is behaviour,
138
+ not just a box: it traps focus, closes on escape, and restores focus
139
+ when it closes. That is why it is a component and not a class.
140
+
141
+ ## Styling
142
+
143
+ The components do not carry styles. They carry **class names**, and the
144
+ stylesheet carries the styles — so the same CSS decides what your
145
+ extension looks like and what igni's app looks like.
146
+
147
+ That is why `@ignite-ember/ui-css` is required: without it, every
148
+ component renders unstyled, and an unstyled button is not a subtle
149
+ difference.
150
+
151
+ Two things follow from sharing the stylesheet:
152
+
153
+ - **The theme is live.** The bridge pushes the computed token values
154
+ before your first paint, so your page follows dark mode, light mode,
155
+ and whatever a group's policy pack has branded, without a line of your
156
+ own. Your layout is written against tokens (`var(--space-4)`), never
157
+ against colours.
158
+ - **Your own class names still work.** `className` is passed through on
159
+ every component, so you can add your own classes alongside. Write them
160
+ in your own stylesheet; do not edit the published one.
161
+
162
+ ## Peer dependencies
163
+
164
+ You already have `react` and `react-dom`. `react-markdown` and
165
+ `remark-gfm` come with `MarkdownInline`.
166
+
167
+ `mermaid` is **optional** and loaded on demand — a page with no
168
+ diagram in it never downloads the 700KB, and an extension that never
169
+ renders one does not need the dependency at all. Install it only if
170
+ you use `MermaidBlock`.
171
+
172
+ ## Changed since 0.1.0, on purpose
173
+
174
+ - `loadMermaid()` configures mermaid on every call, with the theme in
175
+ force at that moment, so a diagram drawn after a light/dark switch is
176
+ drawn in the new theme. Each call returns a new promise, a failed load
177
+ is tried again on the next call rather than kept, and an
178
+ `initialize(...)` of your own is overwritten by the next
179
+ `MermaidBlock` render. The returned `initialize` takes igni's fixed
180
+ config (`startOnLoad`, `securityLevel: "strict"`, `theme`,
181
+ `themeVariables`) rather than any record.
182
+ - A diagram's copy button draws the `copy` and `check` icons instead of
183
+ the `⧉` and `✓` glyphs, so it has no text. It carries `data-state`
184
+ (`idle`, `copied` or `failed`). A blocked or missing clipboard is no
185
+ longer silent: the button goes to `failed`, says "Copy failed — the
186
+ clipboard is blocked" in its title and label, and resets after 1.3s,
187
+ as "Copied" does.
188
+ - `MenuIconName` has two more names, `copy` and `check`.
189
+
190
+ ## The stylesheet is not optional
191
+
192
+ `@ignite-ember/ui-css` must be bundled into your extension, not linked from
193
+ igni's origin. Your page runs under its own origin with
194
+ `default-src 'self'`, so a cross-origin stylesheet is refused — and
195
+ that refusal is deliberate.
196
+
197
+ Inside igni the bridge pushes live token values before your first
198
+ paint, so the same markup follows dark mode, light mode and whatever
199
+ a deployment has branded. Standalone, the fallbacks in the stylesheet
200
+ are igni's own values, checked against them by a test.
201
+
202
+ ## The source, and a build beside it
203
+
204
+ This package ships TypeScript source, and a compiled build beside it.
205
+
206
+ An extension bundles its own React and runs its own build, so a
207
+ bundler takes the source: it tree-shakes with the rest of your
208
+ extension, and it does not pin a JSX runtime or a target you may not
209
+ share. A consumer that does not compile `node_modules` — Node itself, a
210
+ test runner that is not told to transform it — takes the build instead:
211
+ plain JavaScript, and the declarations that go with it.
212
+
213
+ The build is ES2022 modules with source maps back to the TypeScript.
214
+ React stays a peer dependency, and so does the JSX runtime the build
215
+ imports. `exports` points at the build for `node`, and the `types`
216
+ condition at its declarations for everyone, so `import { Button } from
217
+ "@ignite-ember/ui-react"` names the same thing in a bundler and in
218
+ Node, and `tsc` finds it under `moduleResolution: node16`.
@@ -0,0 +1,4 @@
1
+ export declare function CopySource({ source }: {
2
+ source: string;
3
+ }): import("react").JSX.Element;
4
+ //# sourceMappingURL=CopySource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopySource.d.ts","sourceRoot":"","sources":["../src/CopySource.tsx"],"names":[],"mappings":"AA0BA,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,+BAyBxD"}
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * Copies a diagram's fenced source, not the rendered SVG.
4
+ *
5
+ * What somebody wants from a diagram is the text that made it —
6
+ * to paste into another document, or to fix. Nobody wants the
7
+ * markup a renderer produced.
8
+ *
9
+ * A blocked clipboard says so, on the button itself: a click that
10
+ * appears to work and leaves nothing to paste is worse than one
11
+ * that admits it failed.
12
+ */
13
+ import { useState } from "react";
14
+ import { MenuIcon } from "./MenuIcon.js";
15
+ /** How long "Copied" or "Copy failed" stays before the button resets. */
16
+ const FEEDBACK_MS = 1300;
17
+ const LABEL = {
18
+ idle: "Copy source",
19
+ copied: "Copied",
20
+ failed: "Copy failed — the clipboard is blocked",
21
+ };
22
+ export function CopySource({ source }) {
23
+ const [state, setState] = useState("idle");
24
+ const copy = async () => {
25
+ try {
26
+ await navigator.clipboard.writeText(source);
27
+ setState("copied");
28
+ }
29
+ catch {
30
+ setState("failed");
31
+ }
32
+ window.setTimeout(() => setState("idle"), FEEDBACK_MS);
33
+ };
34
+ return (_jsx("button", { type: "button", className: "diagram-copy", "data-state": state, title: LABEL[state], "aria-label": LABEL[state], onClick: () => void copy(), children: _jsx(MenuIcon, { name: state === "copied" ? "check" : "copy" }) }));
35
+ }
36
+ //# sourceMappingURL=CopySource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopySource.js","sourceRoot":"","sources":["../src/CopySource.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAIzC,yEAAyE;AACzE,MAAM,WAAW,GAAG,IAAI,CAAC;AAEzB,MAAM,KAAK,GAA8B;IACvC,IAAI,EAAE,aAAa;IACnB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,wCAAwC;CACjD,CAAC;AAEF,MAAM,UAAU,UAAU,CAAC,EAAE,MAAM,EAAsB;IACvD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAY,MAAM,CAAC,CAAC;IAEtD,MAAM,IAAI,GAAG,KAAK,IAAI,EAAE;QACtB,IAAI,CAAC;YACH,MAAM,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YAC5C,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACrB,CAAC;QAAC,MAAM,CAAC;YACP,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACrB,CAAC;QACD,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,CAAC;IACzD,CAAC,CAAC;IAEF,OAAO,CACL,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,cAAc,gBACZ,KAAK,EACjB,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,gBACP,KAAK,CAAC,KAAK,CAAC,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,IAAI,EAAE,YAE1B,KAAC,QAAQ,IAAC,IAAI,EAAE,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,GAAI,GAClD,CACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * The parts of a table the floor was missing.
3
+ *
4
+ * `Table` is a bare `<table>` and stays one — the markup inside is
5
+ * the extension's, per EXTENSIBILITY §8, and a `DataTable` that owns
6
+ * rows would have to own sorting, selection, paging and
7
+ * virtualisation with it. What was missing is narrower and entirely
8
+ * behaviour: a sortable header nobody announces wrongly, and a
9
+ * selection state that reads as selected.
10
+ *
11
+ * `.ui-table` was three CSS declarations until now — width,
12
+ * border-collapse, font-size — so cell padding, the header rule and
13
+ * the sticky header were every extension's problem too. Those are in
14
+ * `igni-ui.css` now; these are the components that drive them.
15
+ */
16
+ import type { ReactNode, ThHTMLAttributes } from "react";
17
+ /** Which way a column is sorted, or not. */
18
+ export type SortDirection = "ascending" | "descending";
19
+ /** What a {@link SortableTh} takes. */
20
+ export interface SortableThProps extends Omit<ThHTMLAttributes<HTMLTableCellElement>, "onClick" | "aria-sort"> {
21
+ /** The heading. */
22
+ children: ReactNode;
23
+ /**
24
+ * How this column is currently sorted, or `undefined` when the
25
+ * table is sorted by some other column.
26
+ */
27
+ direction?: SortDirection;
28
+ /** Asked to sort by this column. Gets the direction to go to. */
29
+ onSort: (direction: SortDirection) => void;
30
+ /** Right-align and use tabular figures. */
31
+ numeric?: boolean;
32
+ }
33
+ /**
34
+ * A column heading you can sort by.
35
+ *
36
+ * `aria-sort` goes on the `th` and nowhere else, which is what a
37
+ * screen reader reads; the arrow is `aria-hidden` so the state is
38
+ * not announced twice. Hand-rolled versions usually do the reverse —
39
+ * an arrow glyph with no `aria-sort` — and the sort is then
40
+ * invisible to the people most reliant on being told.
41
+ *
42
+ * The button fills the cell so the whole heading is the target
43
+ * rather than a word inside it.
44
+ */
45
+ export declare function SortableTh({ children, direction, onSort, numeric, className, ...rest }: SortableThProps): import("react").JSX.Element;
46
+ /** What a {@link Status} takes. */
47
+ export interface StatusProps {
48
+ /** The four states the health contract defines. */
49
+ state: "READY" | "PREPARING" | "DISABLED" | "FAILED";
50
+ /**
51
+ * What to show beside the dot. Defaults to the state itself.
52
+ *
53
+ * There is always a word. The dot is a colour, and a colour on its
54
+ * own is not a message — it says nothing when read aloud and
55
+ * nothing to somebody who cannot tell green from amber.
56
+ */
57
+ children?: ReactNode;
58
+ }
59
+ /** A state, as a coloured dot and the word it stands for. */
60
+ export declare function Status({ state, children }: StatusProps): import("react").JSX.Element;
61
+ //# sourceMappingURL=DataTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../src/DataTable.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAMzD,4CAA4C;AAC5C,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,YAAY,CAAC;AAEvD,uCAAuC;AACvC,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAC7E,mBAAmB;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,iEAAiE;IACjE,MAAM,EAAE,CAAC,SAAS,EAAE,aAAa,KAAK,IAAI,CAAC;IAC3C,2CAA2C;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAe,EACf,SAAS,EACT,GAAG,IAAI,EACR,EAAE,eAAe,+BAqBjB;AAED,mCAAmC;AACnC,MAAM,WAAW,WAAW;IAC1B,mDAAmD;IACnD,KAAK,EAAE,OAAO,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC;IACrD;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,6DAA6D;AAC7D,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,WAAW,+BAMtD"}
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ function cx(...parts) {
3
+ return parts.filter(Boolean).join(" ");
4
+ }
5
+ /**
6
+ * A column heading you can sort by.
7
+ *
8
+ * `aria-sort` goes on the `th` and nowhere else, which is what a
9
+ * screen reader reads; the arrow is `aria-hidden` so the state is
10
+ * not announced twice. Hand-rolled versions usually do the reverse —
11
+ * an arrow glyph with no `aria-sort` — and the sort is then
12
+ * invisible to the people most reliant on being told.
13
+ *
14
+ * The button fills the cell so the whole heading is the target
15
+ * rather than a word inside it.
16
+ */
17
+ export function SortableTh({ children, direction, onSort, numeric = false, className, ...rest }) {
18
+ // Clicking the sorted column reverses it; clicking any other
19
+ // column starts ascending. Starting descending is defensible for
20
+ // dates and wrong for everything else, so the caller re-sorts if
21
+ // it wants that.
22
+ const next = direction === "ascending" ? "descending" : "ascending";
23
+ return (_jsx("th", { ...rest, scope: "col", "aria-sort": direction ?? "none", className: cx(numeric && "ui-num", className), children: _jsxs("button", { type: "button", className: "ui-th-sort", onClick: () => onSort(next), children: [children, _jsx("span", { className: "ui-th-arrow", "aria-hidden": "true", children: direction === "descending" ? "▾" : "▴" })] }) }));
24
+ }
25
+ /** A state, as a coloured dot and the word it stands for. */
26
+ export function Status({ state, children }) {
27
+ return (_jsx("span", { className: "ui-status", "data-state": state, children: children ?? state }));
28
+ }
29
+ //# sourceMappingURL=DataTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataTable.js","sourceRoot":"","sources":["../src/DataTable.tsx"],"names":[],"mappings":";AAiBA,SAAS,EAAE,CAAC,GAAG,KAA4C;IACzD,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzC,CAAC;AAqBD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,GAAG,KAAK,EACf,SAAS,EACT,GAAG,IAAI,EACS;IAChB,6DAA6D;IAC7D,iEAAiE;IACjE,iEAAiE;IACjE,iBAAiB;IACjB,MAAM,IAAI,GAAkB,SAAS,KAAK,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC;IACnF,OAAO,CACL,gBACM,IAAI,EACR,KAAK,EAAC,KAAK,eACA,SAAS,IAAI,MAAM,EAC9B,SAAS,EAAE,EAAE,CAAC,OAAO,IAAI,QAAQ,EAAE,SAAS,CAAC,YAE7C,kBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,YAAY,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,aACrE,QAAQ,EACT,eAAM,SAAS,EAAC,aAAa,iBAAa,MAAM,YAC7C,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAClC,IACA,GACN,CACN,CAAC;AACJ,CAAC;AAgBD,6DAA6D;AAC7D,MAAM,UAAU,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAe;IACrD,OAAO,CACL,eAAM,SAAS,EAAC,WAAW,gBAAa,KAAK,YAC1C,QAAQ,IAAI,KAAK,GACb,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * What is shown where a subtree threw.
3
+ *
4
+ * EXTENSIBILITY §7 promises "UI throws → its own error boundary" and
5
+ * nothing provided one. The iframe does protect the *host*: igni's
6
+ * shell survives whatever an extension does. It does not protect the
7
+ * extension from itself. A React tree that throws unmounts, so what
8
+ * an author actually shipped was a blank frame inside a working app —
9
+ * the worst-looking failure available, and the one a partner demo
10
+ * finds.
11
+ *
12
+ * A class, because `componentDidCatch` and
13
+ * `getDerivedStateFromError` have no hook equivalent. This is the
14
+ * only class component under the floor and it is not a style
15
+ * preference.
16
+ *
17
+ * **It catches less than people expect**, and saying so is part of
18
+ * the contract: render, lifecycle and constructor throws, in the
19
+ * subtree below it. Not event handlers, not `setTimeout`, not
20
+ * promise rejections, not anything during SSR. An extension still
21
+ * needs to handle its own async failures — the reference extension's
22
+ * `ScannerClient` is what that looks like.
23
+ */
24
+ import { Component, type ErrorInfo, type ReactNode } from "react";
25
+ /** What an {@link ErrorBoundary} takes. */
26
+ export interface ErrorBoundaryProps {
27
+ /** The subtree this boundary guards. */
28
+ children: ReactNode;
29
+ /**
30
+ * Shown instead of the subtree. Receives the error and a function
31
+ * that clears the boundary and remounts the children.
32
+ *
33
+ * The default is deliberately plain and deliberately shows the
34
+ * message: the reader is an extension's user, and "something went
35
+ * wrong" has never once helped anybody report a bug.
36
+ */
37
+ fallback?: (error: Error, reset: () => void) => ReactNode;
38
+ /** Somewhere to send this — a logger, telemetry, a toast. */
39
+ onError?: (error: Error, info: ErrorInfo) => void;
40
+ /**
41
+ * Changing any of these clears the boundary.
42
+ *
43
+ * Without it a boundary that has caught once stays caught forever,
44
+ * so navigating away from the thing that broke shows the error
45
+ * page for the thing that works. Compared by identity, in order,
46
+ * like a hook dependency array.
47
+ */
48
+ resetKeys?: readonly unknown[];
49
+ }
50
+ interface State {
51
+ error: Error | null;
52
+ }
53
+ /**
54
+ * What is shown where a subtree threw.
55
+ *
56
+ * See the note at the top of this file: it catches less than people
57
+ * expect, and the default fallback shows the message on purpose.
58
+ */
59
+ export declare class ErrorBoundary extends Component<ErrorBoundaryProps, State> {
60
+ state: State;
61
+ static getDerivedStateFromError(error: Error): State;
62
+ componentDidCatch(error: Error, info: ErrorInfo): void;
63
+ componentDidUpdate(previous: ErrorBoundaryProps): void;
64
+ reset: () => void;
65
+ render(): ReactNode;
66
+ }
67
+ export {};
68
+ //# sourceMappingURL=ErrorBoundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../src/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IACjC,wCAAwC;IACxC,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,IAAI,KAAK,SAAS,CAAC;IAC1D,6DAA6D;IAC7D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IAClD;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;CAChC;AAED,UAAU,KAAK;IACb,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAMD;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,SAAS,CAAC,kBAAkB,EAAE,KAAK,CAAC;IACrE,KAAK,EAAE,KAAK,CAAmB;IAE/B,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;IAIpD,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI;IAItD,kBAAkB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI;IAOtD,KAAK,QAAO,IAAI,CAEd;IAEF,MAAM,IAAI,SAAS;CAcpB"}