@aurea-uds/react 0.1.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.
- package/LICENSE +202 -0
- package/README.md +53 -0
- package/dist/actions.d.ts +33 -0
- package/dist/actions.js +32 -0
- package/dist/code-editor.d.ts +18 -0
- package/dist/code-editor.js +111 -0
- package/dist/code.d.ts +13 -0
- package/dist/code.js +18 -0
- package/dist/communication.d.ts +31 -0
- package/dist/communication.js +27 -0
- package/dist/data-display.d.ts +23 -0
- package/dist/data-display.js +13 -0
- package/dist/data-grid.d.ts +14 -0
- package/dist/data-grid.js +76 -0
- package/dist/disclosure.d.ts +8 -0
- package/dist/disclosure.js +2 -0
- package/dist/feedback.d.ts +53 -0
- package/dist/feedback.js +71 -0
- package/dist/file-input.d.ts +25 -0
- package/dist/file-input.js +106 -0
- package/dist/identity.d.ts +8 -0
- package/dist/identity.js +3 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +30 -0
- package/dist/inputs.d.ts +65 -0
- package/dist/inputs.js +61 -0
- package/dist/internal.d.ts +72 -0
- package/dist/internal.js +31 -0
- package/dist/layout.d.ts +14 -0
- package/dist/layout.js +22 -0
- package/dist/media.d.ts +9 -0
- package/dist/media.js +98 -0
- package/dist/navigation.d.ts +59 -0
- package/dist/navigation.js +113 -0
- package/dist/overlays.d.ts +46 -0
- package/dist/overlays.js +36 -0
- package/dist/qrcode.d.ts +10 -0
- package/dist/qrcode.js +34 -0
- package/dist/system.d.ts +17 -0
- package/dist/system.js +25 -0
- package/package.json +144 -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/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# @aurea-uds/react
|
|
2
|
+
|
|
3
|
+
React components for **Aurea Universal Design System**.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pnpm add @aurea-uds/react @aurea-uds/core @aurea-uds/fonts @aurea-uds/icons
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Use
|
|
10
|
+
|
|
11
|
+
Load the fonts **before** the stylesheet — the core no longer embeds IBM Plex.
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import "@aurea-uds/fonts/css";
|
|
15
|
+
import "@aurea-uds/core/css";
|
|
16
|
+
import {AureaProvider, Button} from "@aurea-uds/react";
|
|
17
|
+
|
|
18
|
+
export default () => (
|
|
19
|
+
<AureaProvider spriteUrl="/aurea-icons.svg">
|
|
20
|
+
<Button variant="primary">Ship it</Button>
|
|
21
|
+
</AureaProvider>
|
|
22
|
+
);
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`spriteUrl` points at the file from `@aurea-uds/icons` — copy it into whatever your app
|
|
26
|
+
serves as static assets. It is configuration, so it belongs to the provider, not to every
|
|
27
|
+
component that draws an icon.
|
|
28
|
+
|
|
29
|
+
## Subpath imports
|
|
30
|
+
|
|
31
|
+
The barrel works, but each category is also its own entry point, so you can take a part of
|
|
32
|
+
the system without the rest:
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
import {Button} from "@aurea-uds/react/actions";
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Three components carry a heavy optional dependency and are therefore **outside the barrel** —
|
|
39
|
+
importing a Button must never pull in a code editor:
|
|
40
|
+
|
|
41
|
+
| Import | Needs you to install |
|
|
42
|
+
|---|---|
|
|
43
|
+
| `@aurea-uds/react/code-editor` | `codemirror` and its `@codemirror/*` packages |
|
|
44
|
+
| `@aurea-uds/react/data-grid` | `@tanstack/react-table` |
|
|
45
|
+
| `@aurea-uds/react/qrcode` | `qr` |
|
|
46
|
+
|
|
47
|
+
## Requirements
|
|
48
|
+
|
|
49
|
+
React 19 or later. `ref` is a plain prop in React 19, and the types depend on that.
|
|
50
|
+
|
|
51
|
+
## Licence
|
|
52
|
+
|
|
53
|
+
Apache-2.0.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React, { type ButtonHTMLAttributes, type HTMLAttributes, type RefAttributes } from "react";
|
|
2
|
+
import { type IconName } from "./system.js";
|
|
3
|
+
export type ButtonVariant = "primary" | "secondary" | "outline" | "ghost" | "danger" | "danger-outline" | "danger-ghost" | "link" | "link-primary" | "link-danger" | "nav";
|
|
4
|
+
export type ComponentSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
5
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, RefAttributes<HTMLButtonElement> {
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
size?: ComponentSize;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
leadingIcon?: IconName;
|
|
10
|
+
trailingIcon?: IconName;
|
|
11
|
+
href?: string;
|
|
12
|
+
fullWidth?: boolean;
|
|
13
|
+
pressed?: boolean;
|
|
14
|
+
kbd?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
export interface IconButtonProps extends Omit<ButtonProps, "children"> {
|
|
18
|
+
label: string;
|
|
19
|
+
icon: IconName;
|
|
20
|
+
}
|
|
21
|
+
export declare const IconButton: React.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
22
|
+
export declare function ButtonGroup({ label, className, ...props }: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement> & {
|
|
23
|
+
label?: string;
|
|
24
|
+
}): React.JSX.Element;
|
|
25
|
+
export declare function Toolbar({ orientation, label, className, ...props }: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement> & {
|
|
26
|
+
orientation?: "horizontal" | "vertical";
|
|
27
|
+
label?: string;
|
|
28
|
+
}): React.JSX.Element;
|
|
29
|
+
export declare function ToolbarGroup({ label, className, ...props }: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement> & {
|
|
30
|
+
label?: string;
|
|
31
|
+
}): React.JSX.Element;
|
|
32
|
+
export declare function ToolbarSeparator({ className, ...props }: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>): React.JSX.Element;
|
|
33
|
+
export declare const ToolbarButton: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
package/dist/actions.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Fase 9 (achado A5): este arquivo saiu do index.tsx de 970 linhas. Um módulo por categoria
|
|
3
|
+
// do registry — a taxonomia já existia e é gateada. A ordem de import entre eles é um DAG:
|
|
4
|
+
// internal → system → actions → feedback → inputs → navigation → layout → data-display → resto.
|
|
5
|
+
import { forwardRef } from "react";
|
|
6
|
+
import { Toolbar as BaseToolbar } from "@base-ui/react/toolbar";
|
|
7
|
+
import { cx, useAureaStrings, Kbd } from "./internal.js";
|
|
8
|
+
import { Icon } from "./system.js";
|
|
9
|
+
// type="button" por default: o default do HTML é submit, e um "Cancelar"/"Remover"
|
|
10
|
+
// dentro de <form> dispararia a ação principal (auditoria 18/07/2026, ALTO 1).
|
|
11
|
+
// Quem quer submeter passa type="submit" explícito (como o MessageComposer faz).
|
|
12
|
+
export const Button = forwardRef(function Button({ variant = "secondary", size = "md", loading, leadingIcon, trailingIcon, className, children, disabled, type = "button", href, fullWidth, pressed, kbd, ...props }, ref) {
|
|
13
|
+
const cls = cx("btn", `btn-${variant}`, size !== "md" && `btn-${size}`, fullWidth && "btn-block", className);
|
|
14
|
+
// kbd dentro do botão: mostra o atalho E o anuncia (aria-keyshortcuts), senão é enfeite.
|
|
15
|
+
const inner = _jsxs(_Fragment, { children: [loading && _jsx("span", { className: "spinner" }), leadingIcon && _jsx(Icon, { name: leadingIcon }), _jsx("span", { children: children }), kbd && _jsx(Kbd, { children: kbd }), trailingIcon && _jsx(Icon, { name: trailingIcon })] });
|
|
16
|
+
const off = disabled || loading;
|
|
17
|
+
const shared = { "aria-keyshortcuts": kbd || undefined, "aria-busy": loading || undefined };
|
|
18
|
+
if (href !== undefined)
|
|
19
|
+
return _jsx("a", { ref: ref, className: cls, ...(off ? { "aria-disabled": true } : { href }), ...shared, ...props, children: inner });
|
|
20
|
+
return _jsx("button", { ref: ref, type: type, className: cls, disabled: off, "aria-pressed": pressed, ...shared, ...props, children: inner });
|
|
21
|
+
});
|
|
22
|
+
// default ghost (não secondary): um ícone-ação solto — hambúrguer, tema, fechar — é sem
|
|
23
|
+
// caixa por convenção (pedido do Victor: hambúrguer sem borda). Quem quer a caixa passa
|
|
24
|
+
// variant. Alinha o React ao HTML dos docs, onde .btn-icon já é transparente.
|
|
25
|
+
export const IconButton = forwardRef(function IconButton({ label, icon, variant = "ghost", className, ...props }, ref) { return _jsx(Button, { ref: ref, variant: variant, className: cx("btn-icon", className), "aria-label": label, ...props, children: _jsx(Icon, { name: icon }) }); });
|
|
26
|
+
// ButtonGroup: agrupamento semântico. Sem roving tabindex — cada botão continua tabulável (use Toolbar para roving).
|
|
27
|
+
export function ButtonGroup({ label, className, ...props }) { const s = useAureaStrings(); return _jsx("div", { role: "group", "aria-label": label ?? s.optionsLabel, className: cx("btn-group", className), ...props }); }
|
|
28
|
+
// Toolbar: roving tabindex (setas navegam, Tab entra/sai) via Base UI.
|
|
29
|
+
export function Toolbar({ orientation = "horizontal", label, className, ...props }) { const s = useAureaStrings(); return _jsx(BaseToolbar.Root, { orientation: orientation, "aria-label": label ?? s.toolbarLabel, className: cx("toolbar", className), ...props }); }
|
|
30
|
+
export function ToolbarGroup({ label, className, ...props }) { return _jsx(BaseToolbar.Group, { "aria-label": label, className: cx("toolbar-group", className), ...props }); }
|
|
31
|
+
export function ToolbarSeparator({ className, ...props }) { return _jsx(BaseToolbar.Separator, { className: cx("toolbar-sep", className), ...props }); }
|
|
32
|
+
export const ToolbarButton = forwardRef(function ToolbarButton({ variant = "ghost", ...props }, ref) { return _jsx(BaseToolbar.Button, { ref: ref, disabled: props.disabled, render: _jsx(Button, { variant: variant, ...props }) }); });
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type Extension } from "@codemirror/state";
|
|
3
|
+
import { HighlightStyle } from "@codemirror/language";
|
|
4
|
+
export declare const aureaEditorTheme: Extension;
|
|
5
|
+
export declare const aureaHighlightStyle: HighlightStyle;
|
|
6
|
+
export interface CodeEditorProps {
|
|
7
|
+
/** Conteúdo inicial. Não controlado (precedente MediaPlayer/FileInput): mudanças depois da montagem não recarregam o doc. */
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
/** Notificado a cada edição com o texto atual. */
|
|
10
|
+
onChange?: (value: string) => void;
|
|
11
|
+
/** Extensões do consumidor: a extensão de LINGUAGEM (@codemirror/lang-*) e o que mais quiser. Memorize o array para não reconfigurar à toa. */
|
|
12
|
+
extensions?: Extension[];
|
|
13
|
+
readOnly?: boolean;
|
|
14
|
+
/** Nome acessível do editor; default vem da i18n (`codeEditor`). */
|
|
15
|
+
ariaLabel?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function CodeEditor({ defaultValue, onChange, extensions, readOnly, ariaLabel, className }: CodeEditorProps): React.JSX.Element;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Fase 9 (achado A5): este arquivo saiu do index.tsx de 970 linhas. Um módulo por categoria
|
|
3
|
+
// do registry — a taxonomia já existia e é gateada. A ordem de import entre eles é um DAG:
|
|
4
|
+
// internal → system → actions → feedback → inputs → navigation → layout → data-display → resto.
|
|
5
|
+
// SUBPATH PRÓPRIO (ver ./qrcode): é o único componente que precisa do CodeMirror — seis
|
|
6
|
+
// pacotes, todos peer OPCIONAIS. Antes, quem instalava a biblioteca para usar um Button
|
|
7
|
+
// baixava um editor de código inteiro. Era o achado A5.
|
|
8
|
+
import React from "react";
|
|
9
|
+
import { EditorView } from "@codemirror/view";
|
|
10
|
+
import { EditorState, Compartment } from "@codemirror/state";
|
|
11
|
+
import { HighlightStyle, syntaxHighlighting } from "@codemirror/language";
|
|
12
|
+
import { tags as t } from "@lezer/highlight";
|
|
13
|
+
import { basicSetup } from "codemirror";
|
|
14
|
+
import { cx, useAureaStrings } from "./internal.js";
|
|
15
|
+
// CodeEditor (Fase 5 etapa 3): CodeMirror 6 com tema Aurea via tokens. O MOTOR de
|
|
16
|
+
// edição é do CodeMirror (como o vídeo é do browser no MediaPlayer) — o componente
|
|
17
|
+
// só monta a EditorView, dá a pele Aurea e liga defaultValue/onChange. Dependência
|
|
18
|
+
// nova AUTORIZADA aqui (07/2026: codemirror 6.0.2 / @codemirror/view 6.43.6 /
|
|
19
|
+
// @codemirror/state 6.7.1 / @codemirror/language 6.12.4 / @lezer/highlight 1.2.3 —
|
|
20
|
+
// tudo MIT, ativamente mantido, versões atuais medidas no pacote instalado).
|
|
21
|
+
//
|
|
22
|
+
// LINGUAGENS FICAM FORA (regra da etapa): não embutimos nenhuma extensão de
|
|
23
|
+
// linguagem — o consumidor passa a dele em `extensions` (ex.: @codemirror/lang-*).
|
|
24
|
+
// Assim o peso e a escolha de linguagem são dele, e a lista de deps não incha.
|
|
25
|
+
//
|
|
26
|
+
// SEM COR HARDCODED FORA DE TOKEN: o tema só referencia var(--*) do core. Uso só
|
|
27
|
+
// tokens que VIRAM entre dark/light (foreground, muted-foreground, os semânticos
|
|
28
|
+
// success/warning/danger/info-400 que têm override no [data-theme="light"], e
|
|
29
|
+
// selection/border/surface). NÃO uso --primary como cor de texto de sintaxe: o
|
|
30
|
+
// amarelo é invariável e falha contraste sobre o inset claro. --primary fica só em
|
|
31
|
+
// realce de par de brackets/seleção de autocomplete (14% — idioma do tree-node).
|
|
32
|
+
// Sem CSS novo no core: a pele vive no EditorView.theme (StyleModule injetado pelo
|
|
33
|
+
// próprio CodeMirror), não no stylesheet do core — o core/os baselines não mudam.
|
|
34
|
+
// /*@__PURE__*/: as factories rodam no topo do módulo; sem a anotação o bundler
|
|
35
|
+
// não prova que são puras e mantém o CodeMirror mesmo em quem importa só o Button
|
|
36
|
+
// (auditoria 18/07/2026, ALTO 5). Com a anotação + sideEffects:false, o tema e o
|
|
37
|
+
// CodeEditor (e o CodeMirror) somem quando não usados. Split por subpath = decisão do Victor.
|
|
38
|
+
export const aureaEditorTheme = /*@__PURE__*/ EditorView.theme({
|
|
39
|
+
"&": { backgroundColor: "var(--surface-inset)", color: "var(--foreground)", border: "var(--border-width) solid var(--border)", borderRadius: "var(--radius-lg)", fontSize: "var(--text-xs)" },
|
|
40
|
+
"&.cm-focused": { outline: "2px solid var(--focus-strong)", outlineOffset: "-2px" },
|
|
41
|
+
".cm-scroller": { fontFamily: "var(--font-code)", lineHeight: "var(--leading-relaxed)", borderRadius: "inherit" },
|
|
42
|
+
".cm-content": { caretColor: "var(--foreground)", padding: "var(--space-2) 0" },
|
|
43
|
+
".cm-line": { padding: "0 var(--space-3)" },
|
|
44
|
+
".cm-cursor, .cm-dropCursor": { borderLeftColor: "var(--foreground)" },
|
|
45
|
+
"&.cm-focused .cm-cursor": { borderLeftColor: "var(--foreground)" },
|
|
46
|
+
".cm-selectionBackground, ::selection": { backgroundColor: "var(--selection)" },
|
|
47
|
+
"&.cm-focused .cm-selectionBackground": { backgroundColor: "var(--selection)" },
|
|
48
|
+
".cm-selectionMatch": { backgroundColor: "var(--selection)" },
|
|
49
|
+
".cm-activeLine": { backgroundColor: "color-mix(in srgb,var(--foreground) 5%,transparent)" },
|
|
50
|
+
".cm-gutters": { backgroundColor: "var(--surface-inset)", color: "var(--muted-foreground)", border: "none", borderRight: "var(--border-width) solid var(--border)" },
|
|
51
|
+
".cm-gutterElement": { padding: "0 var(--space-2)" },
|
|
52
|
+
".cm-activeLineGutter": { backgroundColor: "color-mix(in srgb,var(--foreground) 5%,transparent)", color: "var(--foreground)" },
|
|
53
|
+
".cm-matchingBracket, &.cm-focused .cm-matchingBracket": { backgroundColor: "color-mix(in srgb,var(--foreground) 16%,transparent)", color: "var(--foreground)", outline: "none" },
|
|
54
|
+
".cm-nonmatchingBracket": { color: "var(--danger-400)" },
|
|
55
|
+
".cm-searchMatch": { backgroundColor: "color-mix(in srgb,var(--warning-400) 30%,transparent)" },
|
|
56
|
+
".cm-searchMatch.cm-searchMatch-selected": { backgroundColor: "var(--selection)" },
|
|
57
|
+
".cm-panels": { backgroundColor: "var(--surface-2)", color: "var(--foreground)" },
|
|
58
|
+
".cm-panels.cm-panels-top": { borderBottom: "var(--border-width) solid var(--border)" },
|
|
59
|
+
".cm-panels.cm-panels-bottom": { borderTop: "var(--border-width) solid var(--border)" },
|
|
60
|
+
".cm-tooltip": { backgroundColor: "var(--popover)", color: "var(--popover-foreground)", border: "var(--border-width) solid var(--border)", borderRadius: "var(--radius-md)" },
|
|
61
|
+
".cm-tooltip-autocomplete ul li[aria-selected]": { backgroundColor: "color-mix(in srgb,var(--primary) 14%,transparent)", color: "var(--foreground)" },
|
|
62
|
+
".cm-completionLabel": { color: "var(--foreground)" },
|
|
63
|
+
});
|
|
64
|
+
// HighlightStyle: tags do @lezer/highlight → tokens. Só cores que viram entre temas.
|
|
65
|
+
// A default fallback do basicSetup fica só para tags que não cobrimos (fallback:true).
|
|
66
|
+
export const aureaHighlightStyle = /*@__PURE__*/ HighlightStyle.define([
|
|
67
|
+
{ tag: [t.comment, t.lineComment, t.blockComment, t.docComment], color: "var(--muted-foreground)", fontStyle: "italic" },
|
|
68
|
+
{ tag: [t.keyword, t.controlKeyword, t.moduleKeyword, t.operatorKeyword, t.definitionKeyword, t.modifier, t.self, t.atom, t.bool, t.null, t.typeName, t.className, t.namespace, t.tagName], color: "var(--info-400)" },
|
|
69
|
+
{ tag: [t.string, t.character, t.docString, t.regexp, t.escape, t.special(t.string)], color: "var(--success-400)" },
|
|
70
|
+
{ tag: [t.number, t.integer, t.float, t.unit], color: "var(--warning-400)" },
|
|
71
|
+
{ tag: [t.propertyName, t.attributeName, t.labelName], color: "var(--foreground)" },
|
|
72
|
+
{ tag: t.function(t.variableName), color: "var(--foreground)", fontWeight: "600" },
|
|
73
|
+
{ tag: t.invalid, color: "var(--danger-400)" },
|
|
74
|
+
{ tag: [t.link, t.url], color: "var(--info-400)", textDecoration: "underline" },
|
|
75
|
+
{ tag: t.heading, fontWeight: "700" },
|
|
76
|
+
{ tag: t.strong, fontWeight: "700" },
|
|
77
|
+
{ tag: t.emphasis, fontStyle: "italic" },
|
|
78
|
+
{ tag: t.strikethrough, textDecoration: "line-through" },
|
|
79
|
+
]);
|
|
80
|
+
export function CodeEditor({ defaultValue = "", onChange, extensions, readOnly = false, ariaLabel, className }) {
|
|
81
|
+
const s = useAureaStrings();
|
|
82
|
+
const host = React.useRef(null);
|
|
83
|
+
const view = React.useRef(null);
|
|
84
|
+
const dyn = React.useRef(new Compartment());
|
|
85
|
+
// onChange por ref: notifica sempre o mais recente sem recriar o listener (logo sem remontar).
|
|
86
|
+
const onChangeRef = React.useRef(onChange);
|
|
87
|
+
onChangeRef.current = onChange;
|
|
88
|
+
const label = ariaLabel ?? s.codeEditor;
|
|
89
|
+
// Parte reconfigurável (linguagem/readOnly/rótulo) num Compartment: troca sem
|
|
90
|
+
// remontar o editor — preserva doc, seleção e histórico.
|
|
91
|
+
const dynExt = () => [
|
|
92
|
+
EditorState.readOnly.of(readOnly),
|
|
93
|
+
EditorView.editable.of(!readOnly),
|
|
94
|
+
EditorView.contentAttributes.of({ "aria-label": label }),
|
|
95
|
+
...(extensions ?? []),
|
|
96
|
+
];
|
|
97
|
+
React.useEffect(() => {
|
|
98
|
+
const v = new EditorView({ parent: host.current, state: EditorState.create({ doc: defaultValue, extensions: [
|
|
99
|
+
basicSetup,
|
|
100
|
+
aureaEditorTheme,
|
|
101
|
+
syntaxHighlighting(aureaHighlightStyle),
|
|
102
|
+
EditorView.updateListener.of(u => { if (u.docChanged)
|
|
103
|
+
onChangeRef.current?.(u.state.doc.toString()); }),
|
|
104
|
+
dyn.current.of(dynExt()),
|
|
105
|
+
] }) });
|
|
106
|
+
view.current = v;
|
|
107
|
+
return () => { v.destroy(); view.current = null; };
|
|
108
|
+
}, []); // defaultValue só na montagem (não controlado).
|
|
109
|
+
React.useEffect(() => { view.current?.dispatch({ effects: dyn.current.reconfigure(dynExt()) }); }, [readOnly, label, extensions]);
|
|
110
|
+
return _jsx("div", { ref: host, className: cx("code-editor", className) });
|
|
111
|
+
}
|
package/dist/code.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function CodeBlock({ children, language, copyable, className }: {
|
|
2
|
+
children: string;
|
|
3
|
+
language?: string;
|
|
4
|
+
copyable?: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
export declare function LogStream({ lines }: {
|
|
8
|
+
lines: Array<{
|
|
9
|
+
time?: string;
|
|
10
|
+
level?: string;
|
|
11
|
+
text: string;
|
|
12
|
+
}>;
|
|
13
|
+
}): import("react").JSX.Element;
|
package/dist/code.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Fase 9 (achado A5): este arquivo saiu do index.tsx de 970 linhas. Um módulo por categoria
|
|
3
|
+
// do registry — a taxonomia já existia e é gateada. A ordem de import entre eles é um DAG:
|
|
4
|
+
// internal → system → actions → feedback → inputs → navigation → layout → data-display → resto.
|
|
5
|
+
import { cx, useAureaStrings } from "./internal.js";
|
|
6
|
+
import { Icon } from "./system.js";
|
|
7
|
+
// copyable: o gatilho é marcado com data-aurea-copy e o COMPORTAMENTO mora no aurea.js do
|
|
8
|
+
// core (uma implementação para React e para HTML puro). O onClick daqui atende quem só
|
|
9
|
+
// carrega o pacote React; ele para a propagação pro core não copiar duas vezes.
|
|
10
|
+
export function CodeBlock({ children, language = "text", copyable, className }) {
|
|
11
|
+
const s = useAureaStrings();
|
|
12
|
+
const pre = _jsx("pre", { className: cx("code-block", !copyable && className), "data-language": language, children: _jsx("code", { children: children }) });
|
|
13
|
+
if (!copyable)
|
|
14
|
+
return pre;
|
|
15
|
+
const onCopy = (e) => { e.stopPropagation(); window.Aurea?.copy?.(e.currentTarget) ?? navigator.clipboard?.writeText(children); };
|
|
16
|
+
return _jsxs("div", { className: cx("code-block-wrap", className), "data-aurea-copy-scope": true, children: [_jsxs("button", { type: "button", className: "btn btn-icon btn-ghost copy-code", "data-aurea-copy": true, "aria-label": s.copyCode, onClick: onCopy, children: [_jsx(Icon, { name: "copy", size: "sm", className: "c-copy" }), _jsx(Icon, { name: "checkmark", size: "sm", className: "c-done" })] }), pre] });
|
|
17
|
+
}
|
|
18
|
+
export function LogStream({ lines }) { return _jsx("div", { className: "log-stream", role: "log", "aria-live": "polite", children: lines.map((l, n) => _jsxs("div", { className: cx("log-line", l.level && `log-${l.level}`), children: [_jsx("time", { children: l.time }), _jsx("span", { children: l.text })] }, n)) }); }
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { type ReactNode } from "react";
|
|
2
|
+
import { type IconName } from "./system.js";
|
|
3
|
+
import { type BadgeVariant } from "./feedback.js";
|
|
4
|
+
export interface ChatMessage {
|
|
5
|
+
id: string;
|
|
6
|
+
body: ReactNode;
|
|
7
|
+
author?: ReactNode;
|
|
8
|
+
time?: ReactNode;
|
|
9
|
+
avatar?: {
|
|
10
|
+
src?: string;
|
|
11
|
+
fallback?: ReactNode;
|
|
12
|
+
};
|
|
13
|
+
status?: {
|
|
14
|
+
label: ReactNode;
|
|
15
|
+
variant?: BadgeVariant;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare function MessageList({ messages, label, className }: {
|
|
19
|
+
messages: ChatMessage[];
|
|
20
|
+
label?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
}): React.JSX.Element;
|
|
23
|
+
export declare function MessageComposer({ onSend, placeholder, label, icon, sendLabel, disabled, className }: {
|
|
24
|
+
onSend: (text: string) => void;
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
label?: string;
|
|
27
|
+
icon?: IconName;
|
|
28
|
+
sendLabel?: string;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
className?: string;
|
|
31
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Fase 9 (achado A5): este arquivo saiu do index.tsx de 970 linhas. Um módulo por categoria
|
|
3
|
+
// do registry — a taxonomia já existia e é gateada. A ordem de import entre eles é um DAG:
|
|
4
|
+
// internal → system → actions → feedback → inputs → navigation → layout → data-display → resto.
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { cx, useAureaStrings } from "./internal.js";
|
|
7
|
+
import { Icon } from "./system.js";
|
|
8
|
+
import { IconButton } from "./actions.js";
|
|
9
|
+
import { Avatar } from "./identity.js";
|
|
10
|
+
import { Badge } from "./feedback.js";
|
|
11
|
+
export function MessageList({ messages, label, className }) {
|
|
12
|
+
const s = useAureaStrings();
|
|
13
|
+
return _jsx("div", { className: cx("stack", className), role: "log", "aria-live": "polite", "aria-label": label ?? s.chatLabel, children: messages.map(m => _jsxs("div", { className: "message", children: [m.avatar ? _jsx(Avatar, { src: m.avatar.src, fallback: m.avatar.fallback }) : _jsx("span", {}), _jsxs("div", { className: "message-bubble", children: [(m.author || m.time) && _jsxs("div", { className: "label", children: [_jsx("span", { children: m.author }), m.time && _jsx("span", { className: "hint", children: m.time })] }), m.body, m.status && _jsx("div", { className: "message-status", children: _jsxs(Badge, { variant: m.status.variant, children: [_jsx("i", { className: "status-dot" }), m.status.label] }) })] })] }, m.id)) });
|
|
14
|
+
}
|
|
15
|
+
// Composer: <form> sobre .input-wrap + .input; Enter envia (submit nativo) e limpa.
|
|
16
|
+
// Texto é estado interno (não controlado — controlar de fora só com demanda real,
|
|
17
|
+
// precedente MediaPlayer/FileInput). Não envia texto vazio/só-espaço; o botão de
|
|
18
|
+
// envio desabilita enquanto vazio. O input sempre tem nome acessível (aria-label),
|
|
19
|
+
// pois placeholder não serve de nome. ponytail: input de uma linha; textarea +
|
|
20
|
+
// Shift+Enter quando surgir demanda de multilinha.
|
|
21
|
+
export function MessageComposer({ onSend, placeholder, label, icon, sendLabel, disabled, className }) {
|
|
22
|
+
const s = useAureaStrings();
|
|
23
|
+
const [text, setText] = React.useState("");
|
|
24
|
+
const submit = (e) => { e.preventDefault(); const t = text.trim(); if (!t)
|
|
25
|
+
return; onSend(t); setText(""); };
|
|
26
|
+
return _jsxs("form", { className: cx("message-composer", className), onSubmit: submit, children: [_jsxs("div", { className: "input-wrap", children: [icon && _jsx(Icon, { name: icon }), _jsx("input", { className: "input", value: text, disabled: disabled, placeholder: placeholder, "aria-label": label ?? s.chatMessage, onChange: e => setText(e.target.value) })] }), _jsx(IconButton, { type: "submit", variant: "primary", icon: "send", label: sendLabel ?? s.chatSend, disabled: disabled || !text.trim() })] });
|
|
27
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { type HTMLAttributes, type RefAttributes, type ReactNode } from "react";
|
|
2
|
+
export { Kbd } from "./internal.js";
|
|
3
|
+
export declare function KPI({ label, value, trend, className, ...props }: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement> & {
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
value: ReactNode;
|
|
6
|
+
trend?: ReactNode;
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
export declare function DataList({ items }: {
|
|
9
|
+
items: Array<{
|
|
10
|
+
term: ReactNode;
|
|
11
|
+
value: ReactNode;
|
|
12
|
+
}>;
|
|
13
|
+
}): React.JSX.Element;
|
|
14
|
+
export declare function Timeline({ items }: {
|
|
15
|
+
items: Array<{
|
|
16
|
+
title: ReactNode;
|
|
17
|
+
description?: ReactNode;
|
|
18
|
+
time?: ReactNode;
|
|
19
|
+
}>;
|
|
20
|
+
}): React.JSX.Element;
|
|
21
|
+
export declare function Table({ caption, children, className, ...props }: HTMLAttributes<HTMLTableElement> & RefAttributes<HTMLTableElement> & {
|
|
22
|
+
caption?: ReactNode;
|
|
23
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Fase 9 (achado A5): este arquivo saiu do index.tsx de 970 linhas. Um módulo por categoria
|
|
3
|
+
// do registry — a taxonomia já existia e é gateada. A ordem de import entre eles é um DAG:
|
|
4
|
+
// internal → system → actions → feedback → inputs → navigation → layout → data-display → resto.
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { cx, useAureaStrings } from "./internal.js";
|
|
7
|
+
import { Card } from "./layout.js";
|
|
8
|
+
// Kbd é implementado em ./internal (o Button depende dele); a casa PÚBLICA dele é esta.
|
|
9
|
+
export { Kbd } from "./internal.js";
|
|
10
|
+
export function KPI({ label, value, trend, className, ...props }) { return _jsxs(Card, { className: cx("kpi", className), ...props, children: [_jsx("span", { className: "muted", children: label }), _jsx("strong", { children: value }), trend && _jsx("small", { children: trend })] }); }
|
|
11
|
+
export function DataList({ items }) { return _jsx("dl", { className: "data-list", children: items.map((i, n) => _jsxs(React.Fragment, { children: [_jsx("dt", { children: i.term }), _jsx("dd", { children: i.value })] }, n)) }); }
|
|
12
|
+
export function Timeline({ items }) { return _jsx("ol", { className: "timeline", children: items.map((i, n) => _jsxs("li", { children: [_jsx("span", { className: "timeline-dot" }), _jsxs("div", { children: [_jsx("strong", { children: i.title }), i.description && _jsx("p", { children: i.description }), i.time && _jsx("small", { className: "muted", children: i.time })] })] }, n)) }); }
|
|
13
|
+
export function Table({ caption, children, className, ...props }) { const s = useAureaStrings(); return _jsx("div", { className: "table-region", role: "region", "aria-label": typeof caption === "string" ? caption : s.tableLabel, tabIndex: 0, children: _jsxs("table", { className: cx("table", className), ...props, children: [caption && _jsx("caption", { children: caption }), children] }) }); }
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type ColumnDef } from "@tanstack/react-table";
|
|
3
|
+
export type { ColumnDef } from "@tanstack/react-table";
|
|
4
|
+
export declare function DataGrid<T>({ data, columns, label, filterable, pageSize, selectable, onSelectionChange, getRowId, className }: {
|
|
5
|
+
data: T[];
|
|
6
|
+
columns: Array<ColumnDef<T, any>>;
|
|
7
|
+
label?: string;
|
|
8
|
+
filterable?: boolean;
|
|
9
|
+
pageSize?: number;
|
|
10
|
+
selectable?: boolean;
|
|
11
|
+
onSelectionChange?: (rows: T[]) => void;
|
|
12
|
+
getRowId?: (row: T, index: number) => string;
|
|
13
|
+
className?: string;
|
|
14
|
+
}): React.JSX.Element;
|