@ignite-ember/ui-react 0.2.0 → 0.2.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 (127) hide show
  1. package/NOTICE +1 -1
  2. package/README.md +56 -13
  3. package/dist/CopySource.d.ts.map +1 -1
  4. package/dist/CopySource.js +16 -2
  5. package/dist/CopySource.js.map +1 -1
  6. package/dist/DataTable.d.ts +17 -1
  7. package/dist/DataTable.d.ts.map +1 -1
  8. package/dist/DataTable.js +17 -1
  9. package/dist/DataTable.js.map +1 -1
  10. package/dist/Dialog.d.ts +41 -0
  11. package/dist/Dialog.d.ts.map +1 -0
  12. package/dist/Dialog.js +94 -0
  13. package/dist/Dialog.js.map +1 -0
  14. package/dist/ErrorBoundary.d.ts +31 -2
  15. package/dist/ErrorBoundary.d.ts.map +1 -1
  16. package/dist/ErrorBoundary.js +38 -4
  17. package/dist/ErrorBoundary.js.map +1 -1
  18. package/dist/LiveRegion.d.ts +7 -1
  19. package/dist/LiveRegion.d.ts.map +1 -1
  20. package/dist/LiveRegion.js +7 -1
  21. package/dist/LiveRegion.js.map +1 -1
  22. package/dist/Markdown.d.ts +4 -0
  23. package/dist/Markdown.d.ts.map +1 -1
  24. package/dist/Markdown.js +4 -0
  25. package/dist/Markdown.js.map +1 -1
  26. package/dist/MarkdownInline.d.ts +13 -4
  27. package/dist/MarkdownInline.d.ts.map +1 -1
  28. package/dist/MarkdownInline.js +20 -5
  29. package/dist/MarkdownInline.js.map +1 -1
  30. package/dist/MenuIcon.d.ts +10 -4
  31. package/dist/MenuIcon.d.ts.map +1 -1
  32. package/dist/MenuIcon.js +8 -2
  33. package/dist/MenuIcon.js.map +1 -1
  34. package/dist/Mermaid.d.ts +2 -0
  35. package/dist/Mermaid.d.ts.map +1 -1
  36. package/dist/Mermaid.js +2 -0
  37. package/dist/Mermaid.js.map +1 -1
  38. package/dist/Monogram.d.ts +7 -3
  39. package/dist/Monogram.d.ts.map +1 -1
  40. package/dist/Monogram.js +14 -6
  41. package/dist/Monogram.js.map +1 -1
  42. package/dist/OverflowMenu.d.ts +6 -1
  43. package/dist/OverflowMenu.d.ts.map +1 -1
  44. package/dist/OverflowMenu.js +10 -2
  45. package/dist/OverflowMenu.js.map +1 -1
  46. package/dist/Shell.d.ts +13 -0
  47. package/dist/Shell.d.ts.map +1 -1
  48. package/dist/Shell.js +13 -0
  49. package/dist/Shell.js.map +1 -1
  50. package/dist/Skeleton.d.ts +30 -0
  51. package/dist/Skeleton.d.ts.map +1 -1
  52. package/dist/Skeleton.js +30 -0
  53. package/dist/Skeleton.js.map +1 -1
  54. package/dist/Split.d.ts +24 -5
  55. package/dist/Split.d.ts.map +1 -1
  56. package/dist/Split.js +27 -4
  57. package/dist/Split.js.map +1 -1
  58. package/dist/Tabs.d.ts +77 -0
  59. package/dist/Tabs.d.ts.map +1 -0
  60. package/dist/Tabs.js +91 -0
  61. package/dist/Tabs.js.map +1 -0
  62. package/dist/Toast.d.ts +12 -1
  63. package/dist/Toast.d.ts.map +1 -1
  64. package/dist/Toast.js +11 -0
  65. package/dist/Toast.js.map +1 -1
  66. package/dist/Tooltip.d.ts +12 -3
  67. package/dist/Tooltip.d.ts.map +1 -1
  68. package/dist/Tooltip.js +29 -7
  69. package/dist/Tooltip.js.map +1 -1
  70. package/dist/controls.d.ts +117 -0
  71. package/dist/controls.d.ts.map +1 -0
  72. package/dist/controls.js +59 -0
  73. package/dist/controls.js.map +1 -0
  74. package/dist/fenceInfo.d.ts +4 -1
  75. package/dist/fenceInfo.d.ts.map +1 -1
  76. package/dist/fenceInfo.js +4 -1
  77. package/dist/fenceInfo.js.map +1 -1
  78. package/dist/formControls.d.ts +143 -0
  79. package/dist/formControls.d.ts.map +1 -0
  80. package/dist/formControls.js +108 -0
  81. package/dist/formControls.js.map +1 -0
  82. package/dist/index.d.ts +5 -9
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +5 -9
  85. package/dist/index.js.map +1 -1
  86. package/dist/layout.d.ts +95 -0
  87. package/dist/layout.d.ts.map +1 -0
  88. package/dist/layout.js +93 -0
  89. package/dist/layout.js.map +1 -0
  90. package/dist/primitives.d.ts +10 -360
  91. package/dist/primitives.d.ts.map +1 -1
  92. package/dist/primitives.js +31 -338
  93. package/dist/primitives.js.map +1 -1
  94. package/dist/progress.d.ts +64 -0
  95. package/dist/progress.d.ts.map +1 -0
  96. package/dist/progress.js +51 -0
  97. package/dist/progress.js.map +1 -0
  98. package/dist/text.d.ts +63 -0
  99. package/dist/text.d.ts.map +1 -0
  100. package/dist/text.js +61 -0
  101. package/dist/text.js.map +1 -0
  102. package/package.json +4 -4
  103. package/src/CopySource.tsx +17 -2
  104. package/src/DataTable.tsx +17 -1
  105. package/src/Dialog.tsx +158 -0
  106. package/src/ErrorBoundary.tsx +39 -4
  107. package/src/LiveRegion.tsx +7 -1
  108. package/src/Markdown.tsx +4 -0
  109. package/src/MarkdownInline.tsx +20 -7
  110. package/src/MenuIcon.tsx +10 -4
  111. package/src/Mermaid.tsx +2 -0
  112. package/src/Monogram.tsx +14 -5
  113. package/src/OverflowMenu.tsx +9 -2
  114. package/src/Shell.tsx +13 -0
  115. package/src/Skeleton.tsx +30 -0
  116. package/src/Split.tsx +32 -7
  117. package/src/Tabs.tsx +194 -0
  118. package/src/Toast.tsx +12 -1
  119. package/src/Tooltip.tsx +33 -8
  120. package/src/controls.tsx +159 -0
  121. package/src/fenceInfo.ts +5 -2
  122. package/src/formControls.tsx +249 -0
  123. package/src/index.ts +5 -9
  124. package/src/layout.tsx +141 -0
  125. package/src/primitives.tsx +10 -864
  126. package/src/progress.tsx +129 -0
  127. package/src/text.tsx +99 -0
@@ -1,340 +1,33 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cloneElement, isValidElement, useCallback, useEffect, useId, useRef, } from "react";
3
- /** Joins class names, skipping anything falsy. */
4
- function cx(...parts) {
5
- return parts.filter(Boolean).join(" ");
6
- }
7
1
  /**
8
- * A button.
9
- *
10
- * The variant is a prop rather than a class name you spell:
11
- * `btn-primery` is a typo that renders as a plain button and looks
12
- * like nothing at all, which is exactly why the name is one the
13
- * compiler checks.
14
- */
15
- export function Button({ variant = "default", size = "md", className, ...rest }) {
16
- return (_jsx("button", { type: "button", ...rest, className: cx("btn", variant !== "default" && `btn-${variant}`, size !== "md" && `btn-${size}`, className) }));
17
- }
18
- /** A single-line text field. */
19
- export function Input({ className, ...rest }) {
20
- return _jsx("input", { ...rest, className: cx("panel-input", className) });
21
- }
22
- /**
23
- * A tag the reader can scan past. See {@link ChipProps} for when to
24
- * reach for a chip and when for a badge.
25
- */
26
- export function Chip({ tone = "neutral", className, ...rest }) {
27
- return _jsx("span", { ...rest, "data-tone": tone, className: cx("chip", className) });
28
- }
29
- /**
30
- * A state the reader is meant to notice. See {@link BadgeProps} for
31
- * what the tone does and does not say.
32
- */
33
- export function Badge({ tone = "neutral", className, ...rest }) {
34
- return (_jsx("span", { ...rest, "data-tone": tone, className: cx("ui-badge", className) }));
35
- }
36
- // ── Layout ──────────────────────────────────────────────────────────
37
- /** A horizontal run of things, vertically centred. */
38
- export function Row({ className, ...rest }) {
39
- return _jsx("div", { ...rest, className: cx("ui-row", className) });
40
- }
41
- /** A horizontal run of buttons. Separate from `Row` because it is
42
- * what a reader looks for at the foot of a panel. */
43
- export function Actions({ className, ...rest }) {
44
- return _jsx("div", { ...rest, className: cx("ui-actions", className) });
45
- }
46
- /** A vertical stack. */
47
- export function List({ className, ...rest }) {
48
- return _jsx("div", { ...rest, className: cx("ui-list", className) });
49
- }
50
- /**
51
- * A row of controls at the top of a panel: what the panel is, and what
52
- * you can do to it.
53
- */
54
- export function Toolbar({ className, ...rest }) {
55
- return _jsx("div", { ...rest, className: cx("ui-toolbar", className) });
56
- }
57
- // ── Containers ──────────────────────────────────────────────────────
58
- /** A surface: background, border, radius, padding. */
59
- export function Card({ className, ...rest }) {
60
- return _jsx("div", { ...rest, className: cx("ui-card", className) });
61
- }
62
- /** One selectable row inside a list. Renders a button, because
63
- * something clickable that is not a button is a keyboard trap. */
64
- export function Item({ className, ...rest }) {
65
- return (_jsx("button", { type: "button", ...rest, className: cx("ui-item", className) }));
66
- }
67
- /**
68
- * A table.
69
- *
70
- * The class only; the head, the rows and the cells are yours, because
71
- * a table that decides its own columns is a table you cannot use for
72
- * anything the app has not already seen.
73
- */
74
- export function Table({ className, ...rest }) {
75
- return _jsx("table", { ...rest, className: cx("ui-table", className) });
76
- }
77
- /**
78
- * What to show where there is nothing.
79
- *
80
- * See {@link EmptyProps} for why the `action` slot exists.
81
- */
82
- export function Empty({ children, action, className, ...rest }) {
83
- return (_jsxs("div", { ...rest, className: cx("ui-empty", className), children: [children, action] }));
84
- }
85
- /**
86
- * The one primitive here that is behaviour rather than a box.
87
- *
88
- * A dialog has to trap focus, close on Escape, restore focus to
89
- * whatever opened it, and not let a click inside the panel count as a
90
- * click on the backdrop. Every extension that built its own would get
91
- * some of that wrong, and the ones they get wrong are the ones only
92
- * keyboard and screen-reader users notice.
93
- */
94
- export function Dialog({ title, sub, children, actions, onClose, className, ...rest }) {
95
- const panel = useRef(null);
96
- const opener = useRef(null);
97
- const titleId = useId();
98
- useEffect(() => {
99
- opener.current = document.activeElement;
100
- // Focus the panel itself rather than the first control: reading
101
- // the title before the buttons is the point of having one.
102
- panel.current?.focus();
103
- return () => {
104
- // Only if it is still in the document: an opener that has
105
- // unmounted drops focus to <body> silently, which is worse than
106
- // leaving it where the closing action put it.
107
- const back = opener.current;
108
- if (back instanceof HTMLElement && back.isConnected)
109
- back.focus();
110
- };
111
- }, []);
112
- const onKeyDown = useCallback((event) => {
113
- if (event.key === "Escape") {
114
- event.stopPropagation();
115
- onClose();
116
- return;
117
- }
118
- if (event.key !== "Tab")
119
- return;
120
- // `:not([disabled])` matters more than it looks: a modal whose
121
- // confirm button is disabled until a field is typed is the
122
- // commonest pattern there is, and without this the wrap targets
123
- // a disabled element, preventDefault fires, focus() is a no-op
124
- // and Tab appears dead. Dead Tab is worse than escaping Tab.
125
- // `iframe` is here because an extension *is* one.
126
- const focusable = panel.current?.querySelectorAll([
127
- "button:not([disabled])",
128
- "a[href]",
129
- "input:not([disabled]):not([type=hidden])",
130
- "select:not([disabled])",
131
- "textarea:not([disabled])",
132
- "iframe",
133
- "summary",
134
- "[contenteditable]",
135
- '[tabindex]:not([tabindex="-1"])',
136
- ].join(", "));
137
- if (!focusable || focusable.length === 0) {
138
- // Nothing to move to, so hold the focus here rather than let
139
- // Tab walk into the page behind a modal with no way back.
140
- event.preventDefault();
141
- return;
142
- }
143
- const first = focusable[0];
144
- const last = focusable[focusable.length - 1];
145
- if (event.shiftKey && document.activeElement === first) {
146
- event.preventDefault();
147
- last.focus();
148
- }
149
- else if (!event.shiftKey && document.activeElement === last) {
150
- event.preventDefault();
151
- first.focus();
152
- }
153
- }, [onClose]);
154
- return (_jsx("div", { className: "overlay", onMouseDown: (e) => {
155
- // Primary button only, and only on the backdrop itself. A
156
- // right-click raising a context menu used to dismiss the
157
- // modal underneath it.
158
- if (e.button === 0 && e.target === e.currentTarget)
159
- onClose();
160
- }, children: _jsxs("div", { ...rest, ref: panel, className: cx("dialog", className), role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, tabIndex: -1, onKeyDown: onKeyDown,
161
- // Without this a drag that starts inside and ends outside
162
- // closes the dialog, which eats a selection.
163
- onMouseDown: (e) => e.stopPropagation(), children: [_jsx("h2", { className: "dialog-title", id: titleId, children: title }), sub ? _jsx("p", { className: "dialog-sub", children: sub }) : null, children, actions ? (_jsx(Actions, { className: "dialog-actions", children: actions })) : null] }) }));
164
- }
165
- /** A drop-down. */
166
- export function Select({ className, ...rest }) {
167
- return _jsx("select", { ...rest, className: cx("ui-select", className) });
168
- }
169
- /** A multi-line text field. */
170
- export function Textarea({ className, ...rest }) {
171
- return _jsx("textarea", { ...rest, className: cx("ui-textarea", className) });
172
- }
173
- /**
174
- * A native checkbox, wrapped in its own label.
175
- *
176
- * Wrapped rather than associated by `id`, because an `id` an
177
- * extension forgets to make unique is a label that checks somebody
178
- * else's box — and nothing about the page looks wrong when it does.
179
- */
180
- export function Checkbox({ label, className, ...rest }) {
181
- return (_jsxs("label", { className: cx("ui-check", className), children: [_jsx("input", { type: "checkbox", ...rest }), _jsx("span", { children: label })] }));
182
- }
183
- /**
184
- * A native radio, wrapped in its own label.
185
- *
186
- * Wrapped for the same reason a {@link Checkbox} is: an `id` an
187
- * extension forgets to make unique is a label that picks somebody
188
- * else's radio.
189
- */
190
- export function Radio({ label, className, ...rest }) {
191
- return (_jsxs("label", { className: cx("ui-check", className), children: [_jsx("input", { type: "radio", ...rest }), _jsx("span", { children: label })] }));
192
- }
193
- /**
194
- * A switch, which is a button rather than a checkbox.
195
- *
196
- * The difference is not cosmetic. A checkbox is a value you submit; a
197
- * switch takes effect the moment it moves. `role="switch"` is what
198
- * tells a screen reader which of those it is looking at.
199
- */
200
- export function Switch({ checked, onChange, label, className, ...rest }) {
201
- const id = useId();
202
- return (_jsxs("span", { className: "ui-check", children: [_jsx("button", { ...rest, type: "button", role: "switch", "aria-checked": checked, "aria-labelledby": id, onClick: () => onChange(!checked), className: cx("ui-switch", className) }), _jsx("span", { id: id, children: label })] }));
203
- }
204
- /**
205
- * A label, a control, and room for the reason it is wrong.
206
- *
207
- * See {@link FieldProps}. The error slot is the part that gets left
208
- * out, and a form that rejects input without saying why is the one
209
- * people abandon.
210
- */
211
- export function Field({ label, hint, error, htmlFor, children, className, ...rest }) {
212
- const describedBy = htmlFor ? `${htmlFor}-note` : undefined;
213
- // Cloned, not merely rendered beside. The first version put the id
214
- // on the note and stopped, while the docstring claimed the control
215
- // was wired to it — a claim its own test did not check, because the
216
- // test asserted the id existed and never that anything referenced
217
- // it. Nothing was announced. A Field cannot set an attribute on an
218
- // opaque child without doing this.
219
- const control = isValidElement(children) && describedBy && (error || hint)
220
- ? cloneElement(children, {
221
- "aria-describedby": describedBy,
222
- ...(error ? { "aria-invalid": true } : {}),
223
- })
224
- : children;
225
- return (_jsxs("div", { ...rest, className: cx("ui-field", className), children: [_jsx("label", { className: "ui-label", htmlFor: htmlFor, children: label }), control, error ? (_jsx("span", { className: "ui-error", id: describedBy, role: "alert", children: error })) : hint ? (_jsx("span", { className: "ui-hint", id: describedBy, children: hint })) : null] }));
226
- }
227
- /**
228
- * Work whose duration is unknown.
229
- *
230
- * See {@link SpinnerProps} for why `label` is required.
231
- */
232
- export function Spinner({ label, className, ...rest }) {
233
- return (_jsx("span", { ...rest, role: "status", "aria-live": "polite", className: cx("ui-spinner", className), children: _jsx("span", { className: "ui-visually-hidden", children: label }) }));
234
- }
235
- /**
236
- * A bar that fills.
237
- *
238
- * See {@link ProgressProps}. Without a `value` it slides, because a
239
- * bar that sits still while unknown work is happening is a bar that
240
- * looks broken.
241
- */
242
- export function Progress({ value, max = 100, label, className, ...rest }) {
243
- const determinate = typeof value === "number";
244
- const clamped = determinate
245
- ? Math.max(0, Math.min(max, value))
246
- : undefined;
247
- const pct = determinate ? (clamped / max) * 100 : undefined;
248
- return (_jsx("div", { ...rest, className: cx("ui-progress", className), role: "progressbar", "aria-label": label, "aria-valuenow": clamped, "aria-valuemin": 0, "aria-valuemax": max, "aria-valuetext": determinate ? `${Math.round(pct)}%` : undefined, "data-indeterminate": !determinate, children: _jsx("div", { className: "ui-progress-fill", style: determinate ? { width: `${pct}%` } : undefined }) }));
249
- }
250
- /**
251
- * Tabs with the arrow keys wired, because a tab strip that only
252
- * responds to clicks is a tab strip half the people cannot use.
253
- */
254
- export function Tabs({ tabs, active, onChange, label, base: givenBase, className, ...rest }) {
255
- // Hooks run unconditionally; the generated id is simply unused
256
- // when a caller supplied one.
257
- const generated = useId();
258
- const base = givenBase ?? generated;
259
- const strip = useRef(null);
260
- // Focus follows selection, which the ARIA practices require and
261
- // this did not do. Without it the focus ring sits on a tab that is
262
- // now tabIndex={-1} while a different one is selected, and the next
263
- // Tab leaves the strip from somewhere the reader cannot see.
264
- useEffect(() => {
265
- const el = strip.current?.querySelector('[aria-selected="true"]');
266
- if (el && strip.current?.contains(document.activeElement))
267
- el.focus();
268
- }, [active]);
269
- const onKeyDown = (event) => {
270
- if (tabs.length === 0)
271
- return;
272
- const i = tabs.findIndex((t) => t.id === active);
273
- let next = null;
274
- if (event.key === "ArrowRight")
275
- next = (Math.max(i, 0) + 1) % tabs.length;
276
- else if (event.key === "ArrowLeft")
277
- next = (Math.max(i, 0) - 1 + tabs.length) % tabs.length;
278
- else if (event.key === "Home")
279
- next = 0;
280
- else if (event.key === "End")
281
- next = tabs.length - 1;
282
- if (next === null)
283
- return;
284
- event.preventDefault();
285
- onChange(tabs[next].id);
286
- };
287
- return (_jsx("div", { ...rest, ref: strip, role: "tablist", "aria-label": label, "aria-orientation": "horizontal", className: cx("ui-tabs", className), onKeyDown: onKeyDown, children: tabs.map((tab) => (_jsx("button", {
288
- // Real DOM ids, so a panel can point back with
289
- // aria-labelledby and this one can point at it. Without
290
- // them a screen reader announces "tab, 1 of 2" controlling
291
- // nothing.
292
- id: `${base}-${tab.id}`, "aria-controls": `${base}-${tab.id}-panel`, type: "button", role: "tab", "aria-selected": tab.id === active, tabIndex: tab.id === active ? 0 : -1, className: "ui-tab", onClick: () => onChange(tab.id), children: tab.label }, tab.id))) }));
293
- }
294
- /**
295
- * The panel a tab controls.
296
- *
297
- * See {@link TabPanelProps}. It renders nothing at all when its tab is
298
- * not the active one, so the content of a panel that is not showing
299
- * is not in the page.
300
- */
301
- export function TabPanel({ base, id, active, children, className, ...rest }) {
302
- if (id !== active)
303
- return null;
304
- return (_jsx("div", { ...rest, id: `${base}-${id}-panel`, role: "tabpanel", "aria-labelledby": `${base}-${id}`, tabIndex: 0, className: className, children: children }));
305
- }
306
- // ── Text ────────────────────────────────────────────────────────────
307
- /** A horizontal rule. */
308
- export function Divider({ className, ...rest }) {
309
- return _jsx("hr", { ...rest, className: cx("ui-divider", className) });
310
- }
311
- const HEADING_SIZE = {
312
- 1: "var(--text-2xl)",
313
- 2: "var(--text-xl)",
314
- 3: "var(--text-lg)",
315
- 4: "var(--text-sm)",
316
- };
317
- /**
318
- * A heading, at the level you say.
319
- *
320
- * The size follows the level, so the outline and the type cannot
321
- * disagree — which is the whole reason there is no `Title`.
322
- */
323
- export function Heading({ level = 2, className, style, ...rest }) {
324
- const Tag = `h${level}`;
325
- return (_jsx(Tag, { ...rest, className: cx("ui-heading", className), style: { fontSize: HEADING_SIZE[level], ...style } }));
326
- }
327
- /**
328
- * A paragraph.
329
- *
330
- * {@link TextTone} says how loud it is — emphasis, not status. A
331
- * status is a {@link Badge}.
332
- */
333
- export function Text({ tone = "default", className, ...rest }) {
334
- return _jsx("p", { ...rest, "data-tone": tone, className: cx("ui-text", className) });
335
- }
336
- /** Inline code: a name, a path, a flag. */
337
- export function Code({ className, ...rest }) {
338
- return _jsx("code", { ...rest, className: cx("ui-code", className) });
339
- }
2
+ * Typed wrappers over the CSS primitives.
3
+ *
4
+ * The classes already existed — `btn`, `ui-card`, `ui-row`,
5
+ * `ui-badge` — and an extension could write them by hand. These
6
+ * exist because writing them by hand is not an API: there is no
7
+ * autocomplete, no way to learn the variant names short of reading
8
+ * `theme.css`, and nothing stops `class="btn btn-primery"` from
9
+ * shipping as an invisible bug.
10
+ *
11
+ * Every one of these is a thin mapping from props to class names.
12
+ * They hold no state and make no decisions. That is deliberate: the
13
+ * appearance lives in CSS where the app and the extension share it,
14
+ * and a wrapper that started making layout choices would be a second
15
+ * place for the design to live.
16
+ *
17
+ * `Dialog` is the exception and says so at its own definition — a
18
+ * dialog is behaviour, not just a box.
19
+ *
20
+ * This module is the one name the primitives are imported by. Each
21
+ * group lives in its own file, re-exported here in reading order.
22
+ *
23
+ * **Under the compatibility floor.** A prop here is a promise; see
24
+ * EXTENSIBILITY.md §8.
25
+ */
26
+ export * from "./controls.js";
27
+ export * from "./layout.js";
28
+ export * from "./Dialog.js";
29
+ export * from "./formControls.js";
30
+ export * from "./progress.js";
31
+ export * from "./Tabs.js";
32
+ export * from "./text.js";
340
33
  //# sourceMappingURL=primitives.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"primitives.js","sourceRoot":"","sources":["../src/primitives.tsx"],"names":[],"mappings":";AAgCA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,WAAW,EACX,SAAS,EACT,KAAK,EACL,MAAM,GACP,MAAM,OAAO,CAAC;AAEf,kDAAkD;AAClD,SAAS,EAAE,CAAC,GAAG,KAA4C;IACzD,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzC,CAAC;AAyBD;;;;;;;GAOG;AACH,MAAM,UAAU,MAAM,CAAC,EACrB,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,IAAI,EACX,SAAS,EACT,GAAG,IAAI,EACK;IACZ,OAAO,CACL,iBACE,IAAI,EAAC,QAAQ,KACT,IAAI,EACR,SAAS,EAAE,EAAE,CACX,KAAK,EACL,OAAO,KAAK,SAAS,IAAI,OAAO,OAAO,EAAE,EACzC,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,EAAE,EAC9B,SAAS,CACV,GACD,CACH,CAAC;AACJ,CAAC;AAKD,gCAAgC;AAChC,MAAM,UAAU,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAc;IACtD,OAAO,mBAAW,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC,GAAI,CAAC;AACtE,CAAC;AA4BD;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,EAAE,SAAS,EAAE,GAAG,IAAI,EAAa;IACtE,OAAO,kBAAU,IAAI,eAAa,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,GAAI,CAAC;AAC/E,CAAC;AAkBD;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,IAAI,GAAG,SAAS,EAAE,SAAS,EAAE,GAAG,IAAI,EAAc;IACxE,OAAO,CACL,kBA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;;;;;;;;;;;;;;GAwBG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Work in progress: a spinner for work of unknown length, and a bar
3
+ * for work that can say how far along it is.
4
+ *
5
+ * Part of the primitives; see `primitives.tsx`. **Under the
6
+ * compatibility floor.**
7
+ */
8
+ import type { HTMLAttributes } from "react";
9
+ /**
10
+ * Work whose duration is unknown. `Skeleton` is for known shapes.
11
+ *
12
+ * `label` is required for the same reason `Progress.label` is: a
13
+ * `role="status"` with nothing in it gives a screen reader silence
14
+ * while a sighted user watches something spin.
15
+ */
16
+ export interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {
17
+ /** Required: a spinner with no name is a live region with nothing in it. */
18
+ label: string;
19
+ }
20
+ /**
21
+ * Work whose duration is unknown.
22
+ *
23
+ * See {@link SpinnerProps} for why `label` is required.
24
+ *
25
+ * @param label — required: a spinner with no name is a live region with
26
+ * nothing in it.
27
+ * @param className — added to the element's classes, beside the one the
28
+ * theme gives it.
29
+ * @param rest — the remaining props, spread onto the span.
30
+ */
31
+ export declare function Spinner({ label, className, ...rest }: SpinnerProps): import("react").JSX.Element;
32
+ /** What a {@link Progress} takes. */
33
+ export interface ProgressProps extends HTMLAttributes<HTMLDivElement> {
34
+ /**
35
+ * How far along, against `max`. Omit for indeterminate, which
36
+ * slides rather than sits.
37
+ *
38
+ * A value against a max, as `<progress>` and the ARIA attributes
39
+ * take it, so `value={50}` means half way.
40
+ */
41
+ value?: number;
42
+ /** Defaults to 100. */
43
+ max?: number;
44
+ /** Its name, for a screen reader. */
45
+ label: string;
46
+ }
47
+ /**
48
+ * A bar that fills.
49
+ *
50
+ * See {@link ProgressProps}. Without a `value` it slides, because a
51
+ * bar that sits still while unknown work is happening is a bar that
52
+ * looks broken.
53
+ *
54
+ * @param value — how far along, against `max`; omit it for
55
+ * indeterminate, which slides rather than sits.
56
+ * @param max — the value that counts as complete, against which `value`
57
+ * is measured; it defaults to 100.
58
+ * @param label — its name, for a screen reader.
59
+ * @param className — added to the element's classes, beside the one the
60
+ * theme gives it.
61
+ * @param rest — the remaining props, spread onto the element.
62
+ */
63
+ export declare function Progress({ value, max, label, className, ...rest }: ProgressProps): import("react").JSX.Element;
64
+ //# sourceMappingURL=progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../src/progress.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C;;;;;;GAMG;AACH,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,eAAe,CAAC;IACnE,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,YAAY,+BAWlE;AAED,qCAAqC;AACrC,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,cAAc,CAAC;IACnE;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uBAAuB;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;CACf;AAwBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,GAAS,EACT,KAAK,EACL,SAAS,EACT,GAAG,IAAI,EACR,EAAE,aAAa,+BAoBf"}
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cx } from "./cx.js";
3
+ /**
4
+ * Work whose duration is unknown.
5
+ *
6
+ * See {@link SpinnerProps} for why `label` is required.
7
+ *
8
+ * @param label — required: a spinner with no name is a live region with
9
+ * nothing in it.
10
+ * @param className — added to the element's classes, beside the one the
11
+ * theme gives it.
12
+ * @param rest — the remaining props, spread onto the span.
13
+ */
14
+ export function Spinner({ label, className, ...rest }) {
15
+ return (_jsx("span", { ...rest, role: "status", "aria-live": "polite", className: cx("ui-spinner", className), children: _jsx("span", { className: "ui-visually-hidden", children: label }) }));
16
+ }
17
+ /**
18
+ * `value` measured against `max`, or `null` when there is nothing to
19
+ * measure and the bar is indeterminate.
20
+ */
21
+ function measure(value, max) {
22
+ // NaN is not a measurement: it reads as unknown, like no value.
23
+ if (typeof value !== "number" || Number.isNaN(value))
24
+ return null;
25
+ const now = Math.max(0, Math.min(max, value));
26
+ // A `max` of zero or less has nothing to measure against; an empty
27
+ // bar is honest where `0 / 0` would write "NaN%".
28
+ const pct = max > 0 ? (now / max) * 100 : 0;
29
+ return { now, pct };
30
+ }
31
+ /**
32
+ * A bar that fills.
33
+ *
34
+ * See {@link ProgressProps}. Without a `value` it slides, because a
35
+ * bar that sits still while unknown work is happening is a bar that
36
+ * looks broken.
37
+ *
38
+ * @param value — how far along, against `max`; omit it for
39
+ * indeterminate, which slides rather than sits.
40
+ * @param max — the value that counts as complete, against which `value`
41
+ * is measured; it defaults to 100.
42
+ * @param label — its name, for a screen reader.
43
+ * @param className — added to the element's classes, beside the one the
44
+ * theme gives it.
45
+ * @param rest — the remaining props, spread onto the element.
46
+ */
47
+ export function Progress({ value, max = 100, label, className, ...rest }) {
48
+ const reading = measure(value, max);
49
+ return (_jsx("div", { ...rest, className: cx("ui-progress", className), role: "progressbar", "aria-label": label, "aria-valuenow": reading?.now, "aria-valuemin": 0, "aria-valuemax": max, "aria-valuetext": reading ? `${Math.round(reading.pct)}%` : undefined, "data-indeterminate": reading === null, children: _jsx("div", { className: "ui-progress-fill", style: reading ? { width: `${reading.pct}%` } : undefined }) }));
50
+ }
51
+ //# sourceMappingURL=progress.js.map
@@ -0,0 +1 @@
1
+ {"version":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a,gBACN,KAAK,mBACF,OAAO,EAAE,GAAG,mBACZ,CAAC,mBACD,GAAG,oBACF,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,wBAC/C,OAAO,KAAK,IAAI,YAEpC,cACE,SAAS,EAAC,kBAAkB,EAC5B,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,GACzD,GACE,CACP,CAAC;AACJ,CAAC"}
package/dist/text.d.ts ADDED
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Text: a rule, a heading, a paragraph and inline code.
3
+ *
4
+ * Part of the primitives; see `primitives.tsx`. **Under the
5
+ * compatibility floor.**
6
+ */
7
+ import type { HTMLAttributes } from "react";
8
+ /**
9
+ * A horizontal rule.
10
+ *
11
+ * @param className — added to the element's classes, beside the one the
12
+ * theme gives it.
13
+ * @param rest — the remaining props, spread onto the rule.
14
+ */
15
+ export declare function Divider({ className, ...rest }: HTMLAttributes<HTMLHRElement>): import("react").JSX.Element;
16
+ /** What a {@link Heading} takes. */
17
+ export interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
18
+ /** The outline level. Also picks the size, so they cannot disagree. */
19
+ level?: 1 | 2 | 3 | 4;
20
+ }
21
+ /**
22
+ * A heading, at the level you say.
23
+ *
24
+ * The size follows the level, so the outline and the type cannot
25
+ * disagree — which is the whole reason there is no `Title`.
26
+ *
27
+ * @param level — the outline level; it also picks the size, so the two
28
+ * cannot disagree.
29
+ * @param className — added to the element's classes, beside the one the
30
+ * theme gives it.
31
+ * @param style — the element's inline style, merged over the size the
32
+ * level picks.
33
+ * @param rest — the remaining props, spread onto the heading.
34
+ */
35
+ export declare function Heading({ level, className, style, ...rest }: HeadingProps): import("react").JSX.Element;
36
+ /** How loud. Not {@link Tone}: this is emphasis, not status. */
37
+ export type TextTone = "default" | "muted" | "faint";
38
+ /** What a {@link Text} takes. */
39
+ export interface TextProps extends HTMLAttributes<HTMLParagraphElement> {
40
+ /** How loud it is. */
41
+ tone?: TextTone;
42
+ }
43
+ /**
44
+ * A paragraph.
45
+ *
46
+ * {@link TextTone} says how loud it is — emphasis, not status. A
47
+ * status is a {@link Badge}.
48
+ *
49
+ * @param tone — how loud it is: emphasis rather than status.
50
+ * @param className — added to the element's classes, beside the one the
51
+ * theme gives it.
52
+ * @param rest — the remaining props, spread onto the paragraph.
53
+ */
54
+ export declare function Text({ tone, className, ...rest }: TextProps): import("react").JSX.Element;
55
+ /**
56
+ * Inline code: a name, a path, a flag.
57
+ *
58
+ * @param className — added to the element's classes, beside the one the
59
+ * theme gives it.
60
+ * @param rest — the remaining props, spread onto the element.
61
+ */
62
+ export declare function Code({ className, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
63
+ //# sourceMappingURL=text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../src/text.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,cAAc,CAAC,aAAa,CAAC,+BAE5E;AAED,oCAAoC;AACpC,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,kBAAkB,CAAC;IACtE,uEAAuE;IACvE,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACvB;AASD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,EACtB,KAAS,EACT,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,YAAY,+BASd;AAED,gEAAgE;AAChE,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAErD,iCAAiC;AACjC,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,oBAAoB,CAAC;IACrE,sBAAsB;IACtB,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,EAAE,IAAgB,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,+BAEvE;AAED;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,cAAc,CAAC,WAAW,CAAC,+BAEvE"}
package/dist/text.js ADDED
@@ -0,0 +1,61 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cx } from "./cx.js";
3
+ /**
4
+ * A horizontal rule.
5
+ *
6
+ * @param className — added to the element's classes, beside the one the
7
+ * theme gives it.
8
+ * @param rest — the remaining props, spread onto the rule.
9
+ */
10
+ export function Divider({ className, ...rest }) {
11
+ return _jsx("hr", { ...rest, className: cx("ui-divider", className) });
12
+ }
13
+ const HEADING_SIZE = {
14
+ 1: "var(--text-2xl)",
15
+ 2: "var(--text-xl)",
16
+ 3: "var(--text-lg)",
17
+ 4: "var(--text-sm)",
18
+ };
19
+ /**
20
+ * A heading, at the level you say.
21
+ *
22
+ * The size follows the level, so the outline and the type cannot
23
+ * disagree — which is the whole reason there is no `Title`.
24
+ *
25
+ * @param level — the outline level; it also picks the size, so the two
26
+ * cannot disagree.
27
+ * @param className — added to the element's classes, beside the one the
28
+ * theme gives it.
29
+ * @param style — the element's inline style, merged over the size the
30
+ * level picks.
31
+ * @param rest — the remaining props, spread onto the heading.
32
+ */
33
+ export function Heading({ level = 2, className, style, ...rest }) {
34
+ const Tag = `h${level}`;
35
+ return (_jsx(Tag, { ...rest, className: cx("ui-heading", className), style: { fontSize: HEADING_SIZE[level], ...style } }));
36
+ }
37
+ /**
38
+ * A paragraph.
39
+ *
40
+ * {@link TextTone} says how loud it is — emphasis, not status. A
41
+ * status is a {@link Badge}.
42
+ *
43
+ * @param tone — how loud it is: emphasis rather than status.
44
+ * @param className — added to the element's classes, beside the one the
45
+ * theme gives it.
46
+ * @param rest — the remaining props, spread onto the paragraph.
47
+ */
48
+ export function Text({ tone = "default", className, ...rest }) {
49
+ return _jsx("p", { ...rest, "data-tone": tone, className: cx("ui-text", className) });
50
+ }
51
+ /**
52
+ * Inline code: a name, a path, a flag.
53
+ *
54
+ * @param className — added to the element's classes, beside the one the
55
+ * theme gives it.
56
+ * @param rest — the remaining props, spread onto the element.
57
+ */
58
+ export function Code({ className, ...rest }) {
59
+ return _jsx("code", { ...rest, className: cx("ui-code", className) });
60
+ }
61
+ //# sourceMappingURL=text.js.map