@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
package/dist/layout.js ADDED
@@ -0,0 +1,93 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cx } from "./cx.js";
3
+ /**
4
+ * A horizontal run of things, vertically centred.
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 row.
9
+ */
10
+ export function Row({ className, ...rest }) {
11
+ return _jsx("div", { ...rest, className: cx("ui-row", className) });
12
+ }
13
+ /** A horizontal run of buttons. Separate from `Row` because it is
14
+ * what a reader looks for at the foot of a panel.
15
+ *
16
+ * @param className — added to the element's classes, beside the one the
17
+ * theme gives it.
18
+ * @param rest — the remaining props, spread onto the row of actions.
19
+ */
20
+ export function Actions({ className, ...rest }) {
21
+ return _jsx("div", { ...rest, className: cx("ui-actions", className) });
22
+ }
23
+ /**
24
+ * A vertical stack.
25
+ *
26
+ * @param className — added to the element's classes, beside the one the
27
+ * theme gives it.
28
+ * @param rest — the remaining props, spread onto the list.
29
+ */
30
+ export function List({ className, ...rest }) {
31
+ return _jsx("div", { ...rest, className: cx("ui-list", className) });
32
+ }
33
+ /**
34
+ * A row of controls at the top of a panel: what the panel is, and what
35
+ * you can do to it.
36
+ *
37
+ * @param className — added to the element's classes, beside the one the
38
+ * theme gives it.
39
+ * @param rest — the remaining props, spread onto the toolbar.
40
+ */
41
+ export function Toolbar({ className, ...rest }) {
42
+ return _jsx("div", { ...rest, className: cx("ui-toolbar", className) });
43
+ }
44
+ /**
45
+ * A surface: background, border, radius, padding.
46
+ *
47
+ * @param className — added to the element's classes, beside the one the
48
+ * theme gives it.
49
+ * @param rest — the remaining props, spread onto the card.
50
+ */
51
+ export function Card({ className, ...rest }) {
52
+ return _jsx("div", { ...rest, className: cx("ui-card", className) });
53
+ }
54
+ /** One selectable row inside a list. Renders a button, because
55
+ * something clickable that is not a button is a keyboard trap.
56
+ *
57
+ * @param className — added to the element's classes, beside the one the
58
+ * theme gives it.
59
+ * @param rest — the remaining props, spread onto the button.
60
+ */
61
+ export function Item({ className, ...rest }) {
62
+ return (_jsx("button", { type: "button", ...rest, className: cx("ui-item", className) }));
63
+ }
64
+ /**
65
+ * A table.
66
+ *
67
+ * The class only; the head, the rows and the cells are yours, because
68
+ * a table that decides its own columns is a table you cannot use for
69
+ * anything the app has not already seen.
70
+ *
71
+ * @param className — added to the element's classes, beside the one the
72
+ * theme gives it.
73
+ * @param rest — the remaining props, spread onto the table.
74
+ */
75
+ export function Table({ className, ...rest }) {
76
+ return _jsx("table", { ...rest, className: cx("ui-table", className) });
77
+ }
78
+ /**
79
+ * What to show where there is nothing.
80
+ *
81
+ * See {@link EmptyProps} for why the `action` slot exists.
82
+ *
83
+ * @param children — what to show where there is nothing.
84
+ * @param action — a button, usually: the one thing to do about being
85
+ * empty.
86
+ * @param className — added to the element's classes, beside the one the
87
+ * theme gives it.
88
+ * @param rest — the remaining props, spread onto the element.
89
+ */
90
+ export function Empty({ children, action, className, ...rest }) {
91
+ return (_jsxs("div", { ...rest, className: cx("ui-empty", className), children: [children, action] }));
92
+ }
93
+ //# sourceMappingURL=layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.js","sourceRoot":"","sources":["../src/layout.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B;;;;;;GAMG;AACH,MAAM,UAAU,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAkC;IACxE,OAAO,iBAAS,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAI,CAAC;AAC/D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,EACtB,SAAS,EACT,GAAG,IAAI,EACwB;IAC/B,OAAO,iBAAS,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,GAAI,CAAC;AACnE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAkC;IACzE,OAAO,iBAAS,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,GAAI,CAAC;AAChE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAC,EACtB,SAAS,EACT,GAAG,IAAI,EACwB;IAC/B,OAAO,iBAAS,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,GAAI,CAAC;AACnE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAkC;IACzE,OAAO,iBAAS,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,GAAI,CAAC;AAChE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,IAAI,CAAC,EACnB,SAAS,EACT,GAAG,IAAI,EACiC;IACxC,OAAO,CACL,iBAAQ,IAAI,EAAC,QAAQ,KAAK,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,GAAI,CACxE,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,KAAK,CAAC,EACpB,SAAS,EACT,GAAG,IAAI,EAC0B;IACjC,OAAO,mBAAW,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,GAAI,CAAC;AACnE,CAAC;AAeD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAc;IACxE,OAAO,CACL,kBAAS,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,aAChD,QAAQ,EACR,MAAM,IACH,CACP,CAAC;AACJ,CAAC"}
@@ -17,367 +17,17 @@
17
17
  * `Dialog` is the exception and says so at its own definition — a
18
18
  * dialog is behaviour, not just a box.
19
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
+ *
20
23
  * **Under the compatibility floor.** A prop here is a promise; see
21
24
  * EXTENSIBILITY.md §8.
22
25
  */
23
- import type { ButtonHTMLAttributes, HTMLAttributes, InputHTMLAttributes, ReactNode, SelectHTMLAttributes, TextareaHTMLAttributes } from "react";
24
- /**
25
- * How a button reads.
26
- *
27
- * `default` is a plain button, `primary` is the one action on the
28
- * panel, `danger` is the one that destroys something, `warn` says the
29
- * action is not what it sounds like, and `quiet` is a button that
30
- * should not be the first thing the eye lands on.
31
- */
32
- export type ButtonVariant = "default" | "primary" | "danger" | "warn" | "quiet";
33
- /** `md` unless the row is dense, in which case `sm` or `xs`. */
34
- export type ButtonSize = "md" | "sm" | "xs";
35
- /** What a {@link Button} takes. */
36
- export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
37
- /** How it reads. */
38
- variant?: ButtonVariant;
39
- /** Its size. */
40
- size?: ButtonSize;
41
- }
42
- /**
43
- * A button.
44
- *
45
- * The variant is a prop rather than a class name you spell:
46
- * `btn-primery` is a typo that renders as a plain button and looks
47
- * like nothing at all, which is exactly why the name is one the
48
- * compiler checks.
49
- */
50
- export declare function Button({ variant, size, className, ...rest }: ButtonProps): import("react").JSX.Element;
51
- /** What an {@link Input} takes. */
52
- export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
53
- }
54
- /** A single-line text field. */
55
- export declare function Input({ className, ...rest }: InputProps): import("react").JSX.Element;
56
- /**
57
- * How loud a status is.
58
- *
59
- * `neutral` for a state nothing is wrong with, and the three that
60
- * mean something.
61
- */
62
- export type Tone = "neutral" | "success" | "warning" | "danger";
63
- /**
64
- * A tag the reader can scan past.
65
- *
66
- * Bordered, pill-shaped, muted, `--text-sm`. Use it for a filter, a
67
- * label, a piece of metadata — something that describes the row it
68
- * sits on.
69
- *
70
- * `Chip` and `Badge` take the same props and are not
71
- * interchangeable. If the thing you are showing is a *state* that
72
- * changes — ready, failed, three unread — it is a {@link Badge},
73
- * which is filled by tone and bold so it is noticed. If it is a fact
74
- * about the thing, it is a `Chip`.
75
- */
76
- export interface ChipProps extends HTMLAttributes<HTMLSpanElement> {
77
- /** How loud it is. */
78
- tone?: Tone;
79
- }
80
- /**
81
- * A tag the reader can scan past. See {@link ChipProps} for when to
82
- * reach for a chip and when for a badge.
83
- */
84
- export declare function Chip({ tone, className, ...rest }: ChipProps): import("react").JSX.Element;
85
- /**
86
- * A state the reader is meant to notice.
87
- *
88
- * Filled by tone, bold, `--text-xs`, no border. See {@link ChipProps}
89
- * for which of the two to reach for.
90
- *
91
- * The tone is colour, and colour alone is not a message: put the
92
- * state in the text too. "Failed" in a danger badge survives being
93
- * read aloud and being looked at by somebody who cannot tell it from
94
- * the success one; an empty red badge does not.
95
- */
96
- export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
97
- /** How loud it is. */
98
- tone?: Tone;
99
- }
100
- /**
101
- * A state the reader is meant to notice. See {@link BadgeProps} for
102
- * what the tone does and does not say.
103
- */
104
- export declare function Badge({ tone, className, ...rest }: BadgeProps): import("react").JSX.Element;
105
- /** A horizontal run of things, vertically centred. */
106
- export declare function Row({ className, ...rest }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
107
- /** A horizontal run of buttons. Separate from `Row` because it is
108
- * what a reader looks for at the foot of a panel. */
109
- export declare function Actions({ className, ...rest }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
110
- /** A vertical stack. */
111
- export declare function List({ className, ...rest }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
112
- /**
113
- * A row of controls at the top of a panel: what the panel is, and what
114
- * you can do to it.
115
- */
116
- export declare function Toolbar({ className, ...rest }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
117
- /** A surface: background, border, radius, padding. */
118
- export declare function Card({ className, ...rest }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
119
- /** One selectable row inside a list. Renders a button, because
120
- * something clickable that is not a button is a keyboard trap. */
121
- export declare function Item({ className, ...rest }: ButtonHTMLAttributes<HTMLButtonElement>): import("react").JSX.Element;
122
- /**
123
- * A table.
124
- *
125
- * The class only; the head, the rows and the cells are yours, because
126
- * a table that decides its own columns is a table you cannot use for
127
- * anything the app has not already seen.
128
- */
129
- export declare function Table({ className, ...rest }: HTMLAttributes<HTMLTableElement>): import("react").JSX.Element;
130
- /**
131
- * What to show where there is nothing.
132
- *
133
- * Its own component rather than a paragraph with a class, because an
134
- * empty state that says only "nothing here" is the commonest way a
135
- * panel wastes the one moment it had the reader's attention. The
136
- * `action` slot is a nudge to say what to do next.
137
- */
138
- export interface EmptyProps extends HTMLAttributes<HTMLDivElement> {
139
- /** A button, usually: the one thing to do about being empty. */
140
- action?: ReactNode;
141
- }
142
- /**
143
- * What to show where there is nothing.
144
- *
145
- * See {@link EmptyProps} for why the `action` slot exists.
146
- */
147
- export declare function Empty({ children, action, className, ...rest }: EmptyProps): import("react").JSX.Element;
148
- /** What a {@link Dialog} takes. */
149
- export interface DialogProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
150
- /** Its title. Also the accessible name of the dialog. */
151
- title: ReactNode;
152
- /** Shown under the title. A sentence, not a paragraph. */
153
- sub?: ReactNode;
154
- /** The body. */
155
- children?: ReactNode;
156
- /** The buttons. Rendered in an `Actions` row at the foot. */
157
- actions?: ReactNode;
158
- /** Escape, or a click on the backdrop. */
159
- onClose: () => void;
160
- }
161
- /**
162
- * The one primitive here that is behaviour rather than a box.
163
- *
164
- * A dialog has to trap focus, close on Escape, restore focus to
165
- * whatever opened it, and not let a click inside the panel count as a
166
- * click on the backdrop. Every extension that built its own would get
167
- * some of that wrong, and the ones they get wrong are the ones only
168
- * keyboard and screen-reader users notice.
169
- */
170
- export declare function Dialog({ title, sub, children, actions, onClose, className, ...rest }: DialogProps): import("react").JSX.Element;
171
- /** What a {@link Select} takes. */
172
- export interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
173
- }
174
- /** A drop-down. */
175
- export declare function Select({ className, ...rest }: SelectProps): import("react").JSX.Element;
176
- /** What a {@link Textarea} takes. */
177
- export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
178
- }
179
- /** A multi-line text field. */
180
- export declare function Textarea({ className, ...rest }: TextareaProps): import("react").JSX.Element;
181
- /** What a {@link Checkbox} takes. */
182
- export interface CheckboxProps extends InputHTMLAttributes<HTMLInputElement> {
183
- /** The text beside the box. It is the accessible name too. */
184
- label: ReactNode;
185
- }
186
- /**
187
- * A native checkbox, wrapped in its own label.
188
- *
189
- * Wrapped rather than associated by `id`, because an `id` an
190
- * extension forgets to make unique is a label that checks somebody
191
- * else's box — and nothing about the page looks wrong when it does.
192
- */
193
- export declare function Checkbox({ label, className, ...rest }: CheckboxProps): import("react").JSX.Element;
194
- /** What a {@link Radio} takes. */
195
- export interface RadioProps extends InputHTMLAttributes<HTMLInputElement> {
196
- /** The text beside the box. It is the accessible name too. */
197
- label: ReactNode;
198
- }
199
- /**
200
- * A native radio, wrapped in its own label.
201
- *
202
- * Wrapped for the same reason a {@link Checkbox} is: an `id` an
203
- * extension forgets to make unique is a label that picks somebody
204
- * else's radio.
205
- */
206
- export declare function Radio({ label, className, ...rest }: RadioProps): import("react").JSX.Element;
207
- /** What a {@link Switch} takes. */
208
- export interface SwitchProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> {
209
- /** Whether it is on. */
210
- checked: boolean;
211
- /** Called with the next value. It takes effect at once. */
212
- onChange: (next: boolean) => void;
213
- /**
214
- * Shown beside the switch, and used as its accessible name.
215
- *
216
- * Visible, like `Checkbox.label` and `Radio.label`. It was an
217
- * `aria-label` and nothing else, so one prop name meant opposite
218
- * things on two components in the same package and a sighted user
219
- * got a bare toggle.
220
- */
221
- label: ReactNode;
222
- }
223
- /**
224
- * A switch, which is a button rather than a checkbox.
225
- *
226
- * The difference is not cosmetic. A checkbox is a value you submit; a
227
- * switch takes effect the moment it moves. `role="switch"` is what
228
- * tells a screen reader which of those it is looking at.
229
- */
230
- export declare function Switch({ checked, onChange, label, className, ...rest }: SwitchProps): import("react").JSX.Element;
231
- /**
232
- * A label, a control, and room for the reason it is wrong.
233
- *
234
- * The error slot is the part that gets left out, and a form that
235
- * rejects input without saying why is the one people abandon. When
236
- * `error` is set it is wired to the control through
237
- * `aria-describedby`, so it is announced rather than merely shown.
238
- */
239
- export interface FieldProps extends HTMLAttributes<HTMLDivElement> {
240
- /** The label. It is visible, not a placeholder. */
241
- label: ReactNode;
242
- /** A sentence under the control, for when nothing is wrong. */
243
- hint?: ReactNode;
244
- /** Why the control is wrong. It replaces the hint while it is set. */
245
- error?: ReactNode;
246
- /** The id of the control, so the label points at it. */
247
- htmlFor?: string;
248
- }
249
- /**
250
- * A label, a control, and room for the reason it is wrong.
251
- *
252
- * See {@link FieldProps}. The error slot is the part that gets left
253
- * out, and a form that rejects input without saying why is the one
254
- * people abandon.
255
- */
256
- export declare function Field({ label, hint, error, htmlFor, children, className, ...rest }: FieldProps): import("react").JSX.Element;
257
- /**
258
- * Work whose duration is unknown. `Skeleton` is for known shapes.
259
- *
260
- * `label` is required for the same reason `Progress.label` is. This
261
- * was `role="status"` on an empty span: a live region with nothing
262
- * to say, so a screen reader got silence while a sighted user
263
- * watched something spin.
264
- */
265
- export interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {
266
- /** Required: a spinner with no name is a live region with nothing in it. */
267
- label: string;
268
- }
269
- /**
270
- * Work whose duration is unknown.
271
- *
272
- * See {@link SpinnerProps} for why `label` is required.
273
- */
274
- export declare function Spinner({ label, className, ...rest }: SpinnerProps): import("react").JSX.Element;
275
- /** What a {@link Progress} takes. */
276
- export interface ProgressProps extends HTMLAttributes<HTMLDivElement> {
277
- /**
278
- * How far along, against `max`. Omit for indeterminate, which
279
- * slides rather than sits.
280
- *
281
- * This was 0–1 while the ARIA attributes beside it were 0–100, so
282
- * `value={50}` meant 5000% and was silently clamped — the clamp hid
283
- * the mistake instead of surfacing it. Every other progress API,
284
- * `<progress>` included, takes a value against a max.
285
- */
286
- value?: number;
287
- /** Defaults to 100. */
288
- max?: number;
289
- /** Its name, for a screen reader. */
290
- label: string;
291
- }
292
- /**
293
- * A bar that fills.
294
- *
295
- * See {@link ProgressProps}. Without a `value` it slides, because a
296
- * bar that sits still while unknown work is happening is a bar that
297
- * looks broken.
298
- */
299
- export declare function Progress({ value, max, label, className, ...rest }: ProgressProps): import("react").JSX.Element;
300
- /** What a {@link Tabs} takes. */
301
- export interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
302
- /** The tabs. The `id` is what {@link TabPanel}s match on. */
303
- tabs: {
304
- id: string;
305
- label: ReactNode;
306
- }[];
307
- /** Which tab is showing. */
308
- active: string;
309
- /** Called with the id of the tab the reader chose. */
310
- onChange: (id: string) => void;
311
- /** The strip's name, for a screen reader. */
312
- label: string;
313
- /**
314
- * The id prefix shared with this strip's {@link TabPanel}s.
315
- *
316
- * Optional, and generated when it is absent — but a `TabPanel`
317
- * *requires* one, and for as long as this did not accept it there
318
- * was no way for a caller to learn what was generated. The two were
319
- * published as a pair that could not be used as a pair, and nothing
320
- * noticed because each is unit-tested on its own and neither had a
321
- * consumer. Found by building a second extension against them.
322
- */
323
- base?: string;
324
- }
325
- /**
326
- * Tabs with the arrow keys wired, because a tab strip that only
327
- * responds to clicks is a tab strip half the people cannot use.
328
- */
329
- export declare function Tabs({ tabs, active, onChange, label, base: givenBase, className, ...rest }: TabsProps): import("react").JSX.Element;
330
- /**
331
- * The panel a tab controls. Needs the same `base` the strip used.
332
- *
333
- * Published because `Tabs` without it is half the ARIA pattern: the
334
- * strip announced that it controlled something and there was nothing
335
- * for it to control.
336
- */
337
- export interface TabPanelProps extends HTMLAttributes<HTMLDivElement> {
338
- /** The id prefix shared with its {@link Tabs}, so the two agree. */
339
- base: string;
340
- /** Which tab this panel belongs to. */
341
- id: string;
342
- /** Which tab is showing. The panel renders only when they match. */
343
- active: string;
344
- }
345
- /**
346
- * The panel a tab controls.
347
- *
348
- * See {@link TabPanelProps}. It renders nothing at all when its tab is
349
- * not the active one, so the content of a panel that is not showing
350
- * is not in the page.
351
- */
352
- export declare function TabPanel({ base, id, active, children, className, ...rest }: TabPanelProps): import("react").JSX.Element | null;
353
- /** A horizontal rule. */
354
- export declare function Divider({ className, ...rest }: HTMLAttributes<HTMLHRElement>): import("react").JSX.Element;
355
- /** What a {@link Heading} takes. */
356
- export interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
357
- /** The outline level. Also picks the size, so they cannot disagree. */
358
- level?: 1 | 2 | 3 | 4;
359
- }
360
- /**
361
- * A heading, at the level you say.
362
- *
363
- * The size follows the level, so the outline and the type cannot
364
- * disagree — which is the whole reason there is no `Title`.
365
- */
366
- export declare function Heading({ level, className, style, ...rest }: HeadingProps): import("react").JSX.Element;
367
- /** How loud. Not {@link Tone}: this is emphasis, not status. */
368
- export type TextTone = "default" | "muted" | "faint";
369
- /** What a {@link Text} takes. */
370
- export interface TextProps extends HTMLAttributes<HTMLParagraphElement> {
371
- /** How loud it is. */
372
- tone?: TextTone;
373
- }
374
- /**
375
- * A paragraph.
376
- *
377
- * {@link TextTone} says how loud it is — emphasis, not status. A
378
- * status is a {@link Badge}.
379
- */
380
- export declare function Text({ tone, className, ...rest }: TextProps): import("react").JSX.Element;
381
- /** Inline code: a name, a path, a flag. */
382
- export declare function Code({ className, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
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";
383
33
  //# sourceMappingURL=primitives.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../src/primitives.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EACV,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EAEnB,SAAS,EACT,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,OAAO,CAAC;AAiBf;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MA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