@tooark/react 1.3.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +24 -4
  2. package/README.pt-BR.md +24 -4
  3. package/dist/ark-alert.d.ts +4 -3
  4. package/dist/ark-avatar.d.ts +4 -3
  5. package/dist/ark-badge.d.ts +4 -3
  6. package/dist/ark-button.d.ts +5 -4
  7. package/dist/ark-calendar.d.ts +4 -3
  8. package/dist/ark-card.d.ts +4 -3
  9. package/dist/ark-carousel.d.ts +4 -3
  10. package/dist/ark-checkbox.d.ts +8 -3
  11. package/dist/ark-clock.d.ts +8 -3
  12. package/dist/ark-clock.js +3 -2
  13. package/dist/ark-color-swatches.d.ts +4 -3
  14. package/dist/ark-command-palette.d.ts +15 -6
  15. package/dist/ark-command-palette.js +2 -1
  16. package/dist/ark-copy-button.d.ts +4 -3
  17. package/dist/ark-datepicker.d.ts +4 -3
  18. package/dist/ark-dialog.d.ts +4 -3
  19. package/dist/ark-drawer.d.ts +4 -3
  20. package/dist/ark-empty.d.ts +4 -3
  21. package/dist/ark-file-input.d.ts +12 -5
  22. package/dist/ark-file-input.js +2 -1
  23. package/dist/ark-input.d.ts +4 -3
  24. package/dist/ark-kbd.d.ts +4 -3
  25. package/dist/ark-kv-editor.d.ts +4 -3
  26. package/dist/ark-mark.d.ts +4 -3
  27. package/dist/ark-menu.d.ts +7 -6
  28. package/dist/ark-progress.d.ts +4 -3
  29. package/dist/ark-radio.d.ts +8 -3
  30. package/dist/ark-scheduler.d.ts +4 -3
  31. package/dist/ark-select.d.ts +4 -3
  32. package/dist/ark-shape-picker.d.ts +4 -3
  33. package/dist/ark-skeleton.d.ts +4 -3
  34. package/dist/ark-spinner.d.ts +4 -3
  35. package/dist/ark-split-pane.d.ts +4 -3
  36. package/dist/ark-status-dot.d.ts +4 -3
  37. package/dist/ark-switch.d.ts +4 -3
  38. package/dist/ark-tabs.d.ts +7 -6
  39. package/dist/ark-textarea.d.ts +4 -3
  40. package/dist/ark-toaster.d.ts +4 -3
  41. package/dist/ark-toggle.d.ts +7 -6
  42. package/dist/ark-tooltip.d.ts +4 -3
  43. package/dist/dom-props.d.ts +8 -0
  44. package/dist/dom-props.js +1 -0
  45. package/dist/jsx-intrinsics.d.ts +8 -0
  46. package/package.json +4 -4
package/README.md CHANGED
@@ -9,7 +9,7 @@ Typed React wrappers for the Tooark Web Components: camelCase props, custom even
9
9
 
10
10
  ---
11
11
 
12
- ## Contents
12
+ ## 📑 Contents
13
13
 
14
14
  - [Overview](#-overview)
15
15
  - [Installation](#-installation)
@@ -18,6 +18,8 @@ Typed React wrappers for the Tooark Web Components: camelCase props, custom even
18
18
  - [Usage examples](#-usage-examples)
19
19
  - [Dependencies](#-dependencies)
20
20
  - [Contributing](#-contributing)
21
+ - [Help & Security](#-help--security)
22
+ - [Support](#-support)
21
23
  - [License](#-license)
22
24
 
23
25
  ---
@@ -28,7 +30,7 @@ The `@tooark/react` package provides:
28
30
 
29
31
  - one component per element (41 wrappers: `ArkAlert`, `ArkAvatar`, `ArkBadge`, `ArkButton`, `ArkCalendar`, `ArkCard`, …) with typed props that extend the `Ark*StyleOptions` from `@tooark/core`;
30
32
  - camelCase props map to attributes; booleans are passed as present/absent; object props (`events`, `rows`, `options`, and `localeJson` on `ArkCalendar`/`ArkDatepicker`) are serialized or assigned as properties for you (on the other wrappers `localeJson` is a JSON string);
31
- - custom events become handlers receiving the `CustomEvent` (`onChange`, `onClose`, `onSelect`, …) or, on the calendar, datepicker, clock, carousel and scheduler, its `detail`; native events (`onClick`, `onInput`) work as usual, and `ArkButtonProps` extends `React.HTMLAttributes<HTMLElement>`, so `onClick`, `onFocus`, `id`, `style`, … are typed (a `disabled` or `loading` button never fires `onClick`);
33
+ - custom events become handlers receiving the `CustomEvent` (`onChange`, `onClose`, `onSelect`, …) or, on the calendar, datepicker, clock, carousel and scheduler, its `detail`; every props type also takes React's DOM attributes and handlers (`id`, `style`, `title`, `tabIndex`, `aria-*`, `data-*`, `onClick`, `onKeyDown`, `onFocus`, …), typed and forwarded to the element; what the wrapper defines wins over the React prop of the same name (`onChange` is the element's `CustomEvent`), and a `disabled` or `loading` button never fires `onClick`;
32
34
  - the elements register themselves on first render (`ensureTooarkComponentsRegistered`), browser only, so SSR frameworks are fine;
33
35
  - `IntrinsicElements` typings for every `ark-*` tag, for the side packages or when you prefer the raw element;
34
36
  - `toast`, `showToast`, `dismissToast` re-exported from `@tooark/core`.
@@ -165,8 +167,8 @@ Installed automatically unless marked as peer; peer dependencies are yours to in
165
167
 
166
168
  | Package | Version | Description |
167
169
  | -------------------------------------------------------------------------------- | ----------- | ---------------------------------------------------------------- |
168
- | [`@tooark/core`](https://www.npmjs.com/package/@tooark/core) | ^1.3.0 | Types, i18n, toast/announce services, motion and overlay helpers |
169
- | [`@tooark/web-components`](https://www.npmjs.com/package/@tooark/web-components) | ^1.3.0 | The `ark-*` Custom Elements and their stylesheet |
170
+ | [`@tooark/core`](https://www.npmjs.com/package/@tooark/core) | ^1.5.0 | Types, i18n, toast/announce services, motion and overlay helpers |
171
+ | [`@tooark/web-components`](https://www.npmjs.com/package/@tooark/web-components) | ^1.5.0 | The `ark-*` Custom Elements and their stylesheet |
170
172
  | [`react`](https://www.npmjs.com/package/react) | >=18 (peer) | React 18 or 19 |
171
173
  | [`react-dom`](https://www.npmjs.com/package/react-dom) | >=18 (peer) | React DOM renderer |
172
174
 
@@ -178,6 +180,24 @@ Contributions are welcome! Open issues and pull requests in the [Tooark/web-comp
178
180
 
179
181
  ---
180
182
 
183
+ ## 🆘 Help & Security
184
+
185
+ - ❓ **Questions, bugs, feature ideas** — see [SUPPORT.md](https://github.com/Tooark/web-components/blob/main/SUPPORT.md) for the right channel
186
+ - 🔒 **Security vulnerabilities** — do **not** open a public issue; follow [SECURITY.md](https://github.com/Tooark/web-components/blob/main/SECURITY.md)
187
+
188
+ ---
189
+
190
+ ## 💖 Support
191
+
192
+ If this project helps your workflow, consider supporting its development:
193
+
194
+ - 💙 [GitHub Sponsors](https://github.com/sponsors/paulosfjunior)
195
+ - ☕ [Ko-fi](https://ko-fi.com/paulosfjunior)
196
+
197
+ Every contribution helps keep the project maintained and improving. Thank you! 🙏
198
+
199
+ ---
200
+
181
201
  ## 📄 License
182
202
 
183
203
  This project is licensed under the Apache License 2.0. See the [LICENSE](https://github.com/Tooark/web-components/blob/main/LICENSE) file for details.
package/README.pt-BR.md CHANGED
@@ -9,7 +9,7 @@ Wrappers React tipados dos Tooark Web Components: props camelCase, eventos custo
9
9
 
10
10
  ---
11
11
 
12
- ## Conteúdo
12
+ ## 📑 Conteúdo
13
13
 
14
14
  - [Visão Geral](#-visão-geral)
15
15
  - [Instalação](#-instalação)
@@ -18,6 +18,8 @@ Wrappers React tipados dos Tooark Web Components: props camelCase, eventos custo
18
18
  - [Exemplos de Uso](#-exemplos-de-uso)
19
19
  - [Dependências](#-dependências)
20
20
  - [Contribuição](#-contribuição)
21
+ - [Ajuda & Segurança](#-ajuda--segurança)
22
+ - [Apoie](#-apoie)
21
23
  - [Licença](#-licença)
22
24
 
23
25
  ---
@@ -28,7 +30,7 @@ O pacote `@tooark/react` fornece:
28
30
 
29
31
  - um componente por elemento (41 wrappers: `ArkAlert`, `ArkAvatar`, `ArkBadge`, `ArkButton`, `ArkCalendar`, `ArkCard`, …) com props tipadas que estendem os `Ark*StyleOptions` do `@tooark/core`;
30
32
  - props camelCase viram atributos; booleanos vão como presente/ausente; props de objeto (`events`, `rows`, `options` e o `localeJson` de `ArkCalendar`/`ArkDatepicker`) são serializadas ou atribuídas como propriedade para você (nos demais wrappers o `localeJson` é uma string JSON);
31
- - eventos customizados viram handlers que recebem o `CustomEvent` (`onChange`, `onClose`, `onSelect`, …) ou, no calendário, datepicker, relógio, carrossel e agenda, o `detail` dele; eventos nativos (`onClick`, `onInput`) funcionam como sempre, e o `ArkButtonProps` estende `React.HTMLAttributes<HTMLElement>`, então `onClick`, `onFocus`, `id`, `style`, … são tipados (um botão `disabled` ou `loading` nunca dispara o `onClick`);
33
+ - eventos customizados viram handlers que recebem o `CustomEvent` (`onChange`, `onClose`, `onSelect`, …) ou, no calendário, datepicker, relógio, carrossel e agenda, o `detail` dele; todo tipo de props também aceita os atributos e handlers DOM do React (`id`, `style`, `title`, `tabIndex`, `aria-*`, `data-*`, `onClick`, `onKeyDown`, `onFocus`, …), tipados e repassados ao elemento; o que o wrapper define vale sobre a prop do React de mesmo nome (`onChange` é o `CustomEvent` do elemento), e um botão `disabled` ou `loading` nunca dispara o `onClick`;
32
34
  - os elementos se registram no primeiro render (`ensureTooarkComponentsRegistered`), só no navegador, então frameworks com SSR funcionam;
33
35
  - tipagens `IntrinsicElements` de toda tag `ark-*`, para os pacotes laterais ou quando você preferir o elemento cru;
34
36
  - `toast`, `showToast`, `dismissToast` reexportados do `@tooark/core`.
@@ -165,8 +167,8 @@ Instaladas automaticamente, salvo as marcadas como peer, que ficam por sua conta
165
167
 
166
168
  | Pacote | Versão | Descrição |
167
169
  | -------------------------------------------------------------------------------- | ----------- | -------------------------------------------------------------------- |
168
- | [`@tooark/core`](https://www.npmjs.com/package/@tooark/core) | ^1.3.0 | Tipos, i18n, serviços de toast/announce, motion e helpers de overlay |
169
- | [`@tooark/web-components`](https://www.npmjs.com/package/@tooark/web-components) | ^1.3.0 | Os Custom Elements `ark-*` e a folha de estilo deles |
170
+ | [`@tooark/core`](https://www.npmjs.com/package/@tooark/core) | ^1.5.0 | Tipos, i18n, serviços de toast/announce, motion e helpers de overlay |
171
+ | [`@tooark/web-components`](https://www.npmjs.com/package/@tooark/web-components) | ^1.5.0 | Os Custom Elements `ark-*` e a folha de estilo deles |
170
172
  | [`react`](https://www.npmjs.com/package/react) | >=18 (peer) | React 18 ou 19 |
171
173
  | [`react-dom`](https://www.npmjs.com/package/react-dom) | >=18 (peer) | Renderizador React DOM |
172
174
 
@@ -178,6 +180,24 @@ Contribuições são bem-vindas! Abra issues e pull requests no repositório [To
178
180
 
179
181
  ---
180
182
 
183
+ ## 🆘 Ajuda & Segurança
184
+
185
+ - ❓ **Dúvidas, bugs e ideias** — veja o [SUPPORT.md](https://github.com/Tooark/web-components/blob/main/SUPPORT.md) para escolher o canal certo
186
+ - 🔒 **Vulnerabilidades de segurança** — **não** abra issue pública; siga o [SECURITY.md](https://github.com/Tooark/web-components/blob/main/SECURITY.md)
187
+
188
+ ---
189
+
190
+ ## 💖 Apoie
191
+
192
+ Se este projeto ajuda no seu dia a dia, considere apoiar o desenvolvimento:
193
+
194
+ - 💙 [GitHub Sponsors](https://github.com/sponsors/paulosfjunior)
195
+ - ☕ [Ko-fi](https://ko-fi.com/paulosfjunior)
196
+
197
+ Cada contribuição ajuda a manter o projeto ativo e em evolução. Obrigado! 🙏
198
+
199
+ ---
200
+
181
201
  ## 📄 Licença
182
202
 
183
203
  Este projeto está licenciado sob a licença Apache 2.0. Veja o arquivo [LICENSE](https://github.com/Tooark/web-components/blob/main/LICENSE) para mais detalhes.
@@ -1,7 +1,8 @@
1
1
  import type { ArkAlertStyleOptions } from "@tooark/core";
2
2
  import type { ArkAlert as ArkAlertElement } from "@tooark/web-components";
3
3
  import React, { type PropsWithChildren } from "react";
4
- export type ArkAlertProps = PropsWithChildren<ArkAlertStyleOptions & {
4
+ import type { ArkDomProps } from "./dom-props.js";
5
+ export type ArkAlertProps = PropsWithChildren<ArkDomProps<ArkAlertStyleOptions & {
5
6
  /** Titulo proprio no inicio do alerta. */
6
7
  heading?: string;
7
8
  /** Botao de dispensar (rotulo por lang/localeJson). */
@@ -9,7 +10,7 @@ export type ArkAlertProps = PropsWithChildren<ArkAlertStyleOptions & {
9
10
  className?: string;
10
11
  /** Depois da saida animada: o host ganha `hidden`; desmontar e do app. */
11
12
  onDismiss?: (event: CustomEvent) => void;
12
- }>;
13
+ }>>;
13
14
  export declare const ArkAlert: React.ForwardRefExoticComponent<ArkAlertStyleOptions & {
14
15
  /** Titulo proprio no inicio do alerta. */
15
16
  heading?: string;
@@ -18,6 +19,6 @@ export declare const ArkAlert: React.ForwardRefExoticComponent<ArkAlertStyleOpti
18
19
  className?: string;
19
20
  /** Depois da saida animada: o host ganha `hidden`; desmontar e do app. */
20
21
  onDismiss?: (event: CustomEvent) => void;
21
- } & {
22
+ } & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | keyof ArkAlertStyleOptions | "heading" | "dismissible" | "onDismiss"> & {
22
23
  children?: React.ReactNode | undefined;
23
24
  } & React.RefAttributes<ArkAlertElement>>;
@@ -1,17 +1,18 @@
1
1
  import type { ArkAvatarStyleOptions } from "@tooark/core";
2
2
  import type { ArkAvatar as ArkAvatarElement } from "@tooark/web-components";
3
3
  import type React from "react";
4
- export type ArkAvatarProps = ArkAvatarStyleOptions & {
4
+ import type { ArkDomProps } from "./dom-props.js";
5
+ export type ArkAvatarProps = ArkDomProps<ArkAvatarStyleOptions & {
5
6
  /** Nome da pessoa: vira aria-label e as iniciais (primeira letra, ou primeira + ultima com sobrenome). */
6
7
  name?: string;
7
8
  /** Imagem; em erro de carga caem as iniciais. */
8
9
  src?: string;
9
10
  className?: string;
10
- };
11
+ }>;
11
12
  export declare const ArkAvatar: React.ForwardRefExoticComponent<ArkAvatarStyleOptions & {
12
13
  /** Nome da pessoa: vira aria-label e as iniciais (primeira letra, ou primeira + ultima com sobrenome). */
13
14
  name?: string;
14
15
  /** Imagem; em erro de carga caem as iniciais. */
15
16
  src?: string;
16
17
  className?: string;
17
- } & React.RefAttributes<ArkAvatarElement>>;
18
+ } & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | keyof ArkAvatarStyleOptions | "name" | "src"> & React.RefAttributes<ArkAvatarElement>>;
@@ -1,11 +1,12 @@
1
1
  import type { ArkBadgeStyleOptions } from "@tooark/core";
2
2
  import type { ArkBadge as ArkBadgeElement } from "@tooark/web-components";
3
3
  import React, { type PropsWithChildren } from "react";
4
- export type ArkBadgeProps = PropsWithChildren<ArkBadgeStyleOptions & {
4
+ import type { ArkDomProps } from "./dom-props.js";
5
+ export type ArkBadgeProps = PropsWithChildren<ArkDomProps<ArkBadgeStyleOptions & {
5
6
  className?: string;
6
- }>;
7
+ }>>;
7
8
  export declare const ArkBadge: React.ForwardRefExoticComponent<ArkBadgeStyleOptions & {
8
9
  className?: string;
9
- } & {
10
+ } & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | keyof ArkBadgeStyleOptions> & {
10
11
  children?: React.ReactNode | undefined;
11
12
  } & React.RefAttributes<ArkBadgeElement>>;
@@ -2,14 +2,15 @@ import type { ArkButtonStyleOptions, ArkButtonType } from "@tooark/core";
2
2
  import type { ArkButton as ArkButtonElement } from "@tooark/web-components";
3
3
  import type React from "react";
4
4
  import { type PropsWithChildren } from "react";
5
+ import type { ArkDomProps } from "./dom-props.js";
5
6
  /** Props do ArkButton: opções de estilo mais os atributos e handlers DOM do React (onClick, onFocus, id, style...). */
6
- export type ArkButtonProps = PropsWithChildren<ArkButtonStyleOptions & Omit<React.HTMLAttributes<HTMLElement>, keyof ArkButtonStyleOptions | "children"> & {
7
+ export type ArkButtonProps = PropsWithChildren<ArkDomProps<ArkButtonStyleOptions & {
7
8
  type?: ArkButtonType;
8
9
  disabled?: boolean;
9
- }>;
10
- export declare const ArkButton: React.ForwardRefExoticComponent<ArkButtonStyleOptions & Omit<React.HTMLAttributes<HTMLElement>, "children" | keyof ArkButtonStyleOptions> & {
10
+ }>>;
11
+ export declare const ArkButton: React.ForwardRefExoticComponent<ArkButtonStyleOptions & {
11
12
  type?: ArkButtonType;
12
13
  disabled?: boolean;
13
- } & {
14
+ } & Omit<React.HTMLAttributes<HTMLElement>, "children" | keyof ArkButtonStyleOptions | "type" | "disabled"> & {
14
15
  children?: React.ReactNode | undefined;
15
16
  } & React.RefAttributes<ArkButtonElement>>;
@@ -1,7 +1,8 @@
1
1
  import type { ArkCalendarEvent, ArkCalendarStyleOptions, ArkDatepickerLang, ArkLocale } from "@tooark/core";
2
2
  import type { ArkCalendar as ArkCalendarElement } from "@tooark/web-components";
3
3
  import type React from "react";
4
- export type ArkCalendarProps = ArkCalendarStyleOptions & {
4
+ import type { ArkDomProps } from "./dom-props.js";
5
+ export type ArkCalendarProps = ArkDomProps<ArkCalendarStyleOptions & {
5
6
  lang?: ArkDatepickerLang;
6
7
  localeJson?: Partial<ArkLocale>;
7
8
  value?: string;
@@ -13,7 +14,7 @@ export type ArkCalendarProps = ArkCalendarStyleOptions & {
13
14
  events: ArkCalendarEvent[];
14
15
  }) => void;
15
16
  className?: string;
16
- };
17
+ }>;
17
18
  export declare const ArkCalendar: React.ForwardRefExoticComponent<ArkCalendarStyleOptions & {
18
19
  lang?: ArkDatepickerLang;
19
20
  localeJson?: Partial<ArkLocale>;
@@ -26,4 +27,4 @@ export declare const ArkCalendar: React.ForwardRefExoticComponent<ArkCalendarSty
26
27
  events: ArkCalendarEvent[];
27
28
  }) => void;
28
29
  className?: string;
29
- } & React.RefAttributes<ArkCalendarElement>>;
30
+ } & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "lang" | "onChange" | "localeJson" | keyof ArkCalendarStyleOptions | "value" | "min" | "max"> & React.RefAttributes<ArkCalendarElement>>;
@@ -1,15 +1,16 @@
1
1
  import type { ArkCardStyleOptions } from "@tooark/core";
2
2
  import type { ArkCard as ArkCardElement } from "@tooark/web-components";
3
3
  import React, { type PropsWithChildren } from "react";
4
- export type ArkCardProps = PropsWithChildren<ArkCardStyleOptions & {
4
+ import type { ArkDomProps } from "./dom-props.js";
5
+ export type ArkCardProps = PropsWithChildren<ArkDomProps<ArkCardStyleOptions & {
5
6
  /** Titulo (h2) na linha de cima; com ele o filho slot="header" vira a linha seguinte do cabecalho. */
6
7
  heading?: string;
7
8
  className?: string;
8
- }>;
9
+ }>>;
9
10
  export declare const ArkCard: React.ForwardRefExoticComponent<ArkCardStyleOptions & {
10
11
  /** Titulo (h2) na linha de cima; com ele o filho slot="header" vira a linha seguinte do cabecalho. */
11
12
  heading?: string;
12
13
  className?: string;
13
- } & {
14
+ } & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "heading" | keyof ArkCardStyleOptions> & {
14
15
  children?: React.ReactNode | undefined;
15
16
  } & React.RefAttributes<ArkCardElement>>;
@@ -1,19 +1,20 @@
1
1
  import type { ArkCarouselSnap, ArkCarouselStyleOptions } from "@tooark/core";
2
2
  import type { ArkCarousel as ArkCarouselElement } from "@tooark/web-components";
3
3
  import React, { type PropsWithChildren } from "react";
4
- export type ArkCarouselProps = PropsWithChildren<ArkCarouselStyleOptions & {
4
+ import type { ArkDomProps } from "./dom-props.js";
5
+ export type ArkCarouselProps = PropsWithChildren<ArkDomProps<ArkCarouselStyleOptions & {
5
6
  snap?: ArkCarouselSnap;
6
7
  onSlideChange?: (detail: {
7
8
  index: number;
8
9
  }) => void;
9
10
  className?: string;
10
- }>;
11
+ }>>;
11
12
  export declare const ArkCarousel: React.ForwardRefExoticComponent<ArkCarouselStyleOptions & {
12
13
  snap?: ArkCarouselSnap;
13
14
  onSlideChange?: (detail: {
14
15
  index: number;
15
16
  }) => void;
16
17
  className?: string;
17
- } & {
18
+ } & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | keyof ArkCarouselStyleOptions | "onSlideChange"> & {
18
19
  children?: React.ReactNode | undefined;
19
20
  } & React.RefAttributes<ArkCarouselElement>>;
@@ -1,7 +1,8 @@
1
1
  import type { ArkCheckboxStyleOptions } from "@tooark/core";
2
2
  import type { ArkCheckbox as ArkCheckboxElement } from "@tooark/web-components";
3
3
  import React, { type PropsWithChildren } from "react";
4
- export type ArkCheckboxProps = PropsWithChildren<ArkCheckboxStyleOptions & {
4
+ import type { ArkDomProps } from "./dom-props.js";
5
+ export type ArkCheckboxProps = PropsWithChildren<ArkDomProps<ArkCheckboxStyleOptions & {
5
6
  disabled?: boolean;
6
7
  /** Nome no formulario (submete `value` quando marcado). */
7
8
  name?: string;
@@ -9,11 +10,13 @@ export type ArkCheckboxProps = PropsWithChildren<ArkCheckboxStyleOptions & {
9
10
  value?: string;
10
11
  /** Rotulo proprio (<label for>); sem ele use aria-label ou filhos como rotulo livre. */
11
12
  label?: string;
13
+ /** Dica abaixo do rotulo, ligada ao controle por aria-describedby. */
14
+ helper?: string;
12
15
  className?: string;
13
16
  onChange?: (event: CustomEvent<{
14
17
  checked: boolean;
15
18
  }>) => void;
16
- }>;
19
+ }>>;
17
20
  export declare const ArkCheckbox: React.ForwardRefExoticComponent<ArkCheckboxStyleOptions & {
18
21
  disabled?: boolean;
19
22
  /** Nome no formulario (submete `value` quando marcado). */
@@ -22,10 +25,12 @@ export declare const ArkCheckbox: React.ForwardRefExoticComponent<ArkCheckboxSty
22
25
  value?: string;
23
26
  /** Rotulo proprio (<label for>); sem ele use aria-label ou filhos como rotulo livre. */
24
27
  label?: string;
28
+ /** Dica abaixo do rotulo, ligada ao controle por aria-describedby. */
29
+ helper?: string;
25
30
  className?: string;
26
31
  onChange?: (event: CustomEvent<{
27
32
  checked: boolean;
28
33
  }>) => void;
29
- } & {
34
+ } & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "onChange" | "label" | "name" | "disabled" | "value" | keyof ArkCheckboxStyleOptions | "helper"> & {
30
35
  children?: React.ReactNode | undefined;
31
36
  } & React.RefAttributes<ArkCheckboxElement>>;
@@ -1,19 +1,24 @@
1
1
  import type { ArkClockStyleOptions, ArkDatepickerLang } from "@tooark/core";
2
2
  import type { ArkClock as ArkClockElement } from "@tooark/web-components";
3
3
  import type React from "react";
4
- export type ArkClockProps = ArkClockStyleOptions & {
4
+ import type { ArkDomProps } from "./dom-props.js";
5
+ export type ArkClockProps = ArkDomProps<ArkClockStyleOptions & {
5
6
  value?: string;
6
7
  lang?: ArkDatepickerLang;
8
+ /** JSON com strings proprias (hours, minutes, seconds), mesclado sobre o ingles, quando lang e "custom". */
9
+ localeJson?: string;
7
10
  className?: string;
8
11
  onChange?: (detail: {
9
12
  value: string;
10
13
  }) => void;
11
- };
14
+ }>;
12
15
  export declare const ArkClock: React.ForwardRefExoticComponent<ArkClockStyleOptions & {
13
16
  value?: string;
14
17
  lang?: ArkDatepickerLang;
18
+ /** JSON com strings proprias (hours, minutes, seconds), mesclado sobre o ingles, quando lang e "custom". */
19
+ localeJson?: string;
15
20
  className?: string;
16
21
  onChange?: (detail: {
17
22
  value: string;
18
23
  }) => void;
19
- } & React.RefAttributes<ArkClockElement>>;
24
+ } & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "lang" | "onChange" | "localeJson" | "value" | keyof ArkClockStyleOptions> & React.RefAttributes<ArkClockElement>>;
package/dist/ark-clock.js CHANGED
@@ -2,7 +2,7 @@ import { createElement, forwardRef, useEffect } from "react";
2
2
  import { ensureTooarkComponentsRegistered } from "./register.js";
3
3
  import { useForwardedRef } from "./use-forwarded-ref.js";
4
4
  export const ArkClock = forwardRef(function ArkClock(props, forwardedRef) {
5
- const { className, seconds, stepMinutes, hoursFormat, onChange, ...rest } = props;
5
+ const { className, seconds, stepMinutes, hoursFormat, localeJson, onChange, ...rest } = props;
6
6
  const [ref, setRef] = useForwardedRef(forwardedRef);
7
7
  useEffect(() => {
8
8
  ensureTooarkComponentsRegistered();
@@ -21,7 +21,8 @@ export const ArkClock = forwardRef(function ArkClock(props, forwardedRef) {
21
21
  class: className,
22
22
  seconds: seconds ? "" : undefined,
23
23
  "step-minutes": stepMinutes !== undefined ? String(stepMinutes) : undefined,
24
- "hours-format": hoursFormat
24
+ "hours-format": hoursFormat,
25
+ "locale-json": localeJson
25
26
  };
26
27
  return createElement("ark-clock", attrs);
27
28
  });
@@ -1,7 +1,8 @@
1
1
  import type { ArkColorSwatch, ArkColorSwatchesStyleOptions } from "@tooark/core";
2
2
  import type { ArkColorSwatches as ArkColorSwatchesElement } from "@tooark/web-components";
3
3
  import type React from "react";
4
- export type ArkColorSwatchesProps = ArkColorSwatchesStyleOptions & {
4
+ import type { ArkDomProps } from "./dom-props.js";
5
+ export type ArkColorSwatchesProps = ArkDomProps<ArkColorSwatchesStyleOptions & {
5
6
  /** Cor selecionada (o value da amostra). */
6
7
  value?: string;
7
8
  /** Amostras { name, value }[]; vai como JSON no atributo. */
@@ -14,7 +15,7 @@ export type ArkColorSwatchesProps = ArkColorSwatchesStyleOptions & {
14
15
  onChange?: (event: CustomEvent<{
15
16
  value: string;
16
17
  }>) => void;
17
- };
18
+ }>;
18
19
  export declare const ArkColorSwatches: React.ForwardRefExoticComponent<ArkColorSwatchesStyleOptions & {
19
20
  /** Cor selecionada (o value da amostra). */
20
21
  value?: string;
@@ -28,4 +29,4 @@ export declare const ArkColorSwatches: React.ForwardRefExoticComponent<ArkColorS
28
29
  onChange?: (event: CustomEvent<{
29
30
  value: string;
30
31
  }>) => void;
31
- } & React.RefAttributes<ArkColorSwatchesElement>>;
32
+ } & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "onChange" | "label" | "disabled" | "value" | keyof ArkColorSwatchesStyleOptions | "colors"> & React.RefAttributes<ArkColorSwatchesElement>>;
@@ -2,7 +2,8 @@ import type { ArkCommandItemStyleOptions, ArkCommandPaletteStyleOptions } from "
2
2
  import type { ArkCommandItem as ArkCommandItemElement, ArkCommandPalette as ArkCommandPaletteElement } from "@tooark/web-components";
3
3
  import type React from "react";
4
4
  import { type PropsWithChildren } from "react";
5
- export type ArkCommandPaletteProps = PropsWithChildren<ArkCommandPaletteStyleOptions & {
5
+ import type { ArkDomProps } from "./dom-props.js";
6
+ export type ArkCommandPaletteProps = PropsWithChildren<ArkDomProps<ArkCommandPaletteStyleOptions & {
6
7
  /** Aberta; a saida anima antes de sair do top layer. */
7
8
  open?: boolean;
8
9
  /** Placeholder e nome do campo de busca. Padrao: a string `search` do idioma. */
@@ -15,6 +16,10 @@ export type ArkCommandPaletteProps = PropsWithChildren<ArkCommandPaletteStyleOpt
15
16
  queryDelay?: number;
16
17
  /** Nome acessivel do dialogo. */
17
18
  label?: string;
19
+ /** Mensagem sem opcoes enquanto o campo esta vazio (no lugar de `noResults`). */
20
+ hint?: string;
21
+ /** Busca assincrona em andamento: sem opcoes a mensagem vira `searching`, e o listbox fica aria-busy. */
22
+ busy?: boolean;
18
23
  /** A pagina continua rolando com a paleta aberta. */
19
24
  noScrollLock?: boolean;
20
25
  "aria-label"?: string;
@@ -27,7 +32,7 @@ export type ArkCommandPaletteProps = PropsWithChildren<ArkCommandPaletteStyleOpt
27
32
  }>) => void;
28
33
  onOpen?: (event: CustomEvent) => void;
29
34
  onClose?: (event: CustomEvent) => void;
30
- }>;
35
+ }>>;
31
36
  export declare const ArkCommandPalette: React.ForwardRefExoticComponent<ArkCommandPaletteStyleOptions & {
32
37
  /** Aberta; a saida anima antes de sair do top layer. */
33
38
  open?: boolean;
@@ -41,6 +46,10 @@ export declare const ArkCommandPalette: React.ForwardRefExoticComponent<ArkComma
41
46
  queryDelay?: number;
42
47
  /** Nome acessivel do dialogo. */
43
48
  label?: string;
49
+ /** Mensagem sem opcoes enquanto o campo esta vazio (no lugar de `noResults`). */
50
+ hint?: string;
51
+ /** Busca assincrona em andamento: sem opcoes a mensagem vira `searching`, e o listbox fica aria-busy. */
52
+ busy?: boolean;
44
53
  /** A pagina continua rolando com a paleta aberta. */
45
54
  noScrollLock?: boolean;
46
55
  "aria-label"?: string;
@@ -53,10 +62,10 @@ export declare const ArkCommandPalette: React.ForwardRefExoticComponent<ArkComma
53
62
  }>) => void;
54
63
  onOpen?: (event: CustomEvent) => void;
55
64
  onClose?: (event: CustomEvent) => void;
56
- } & {
65
+ } & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "aria-label" | "onSelect" | "hint" | "label" | "filter" | keyof ArkCommandPaletteStyleOptions | "open" | "placeholder" | "hotkey" | "queryDelay" | "busy" | "noScrollLock" | "onQuery" | "onOpen" | "onClose"> & {
57
66
  children?: React.ReactNode | undefined;
58
67
  } & React.RefAttributes<ArkCommandPaletteElement>>;
59
- export type ArkCommandItemProps = PropsWithChildren<ArkCommandItemStyleOptions & {
68
+ export type ArkCommandItemProps = PropsWithChildren<ArkDomProps<ArkCommandItemStyleOptions & {
60
69
  value: string;
61
70
  /** Secao em que a paleta lista o item. */
62
71
  group?: string;
@@ -64,7 +73,7 @@ export type ArkCommandItemProps = PropsWithChildren<ArkCommandItemStyleOptions &
64
73
  label?: string;
65
74
  disabled?: boolean;
66
75
  className?: string;
67
- }>;
76
+ }>>;
68
77
  export declare const ArkCommandItem: React.ForwardRefExoticComponent<ArkCommandItemStyleOptions & {
69
78
  value: string;
70
79
  /** Secao em que a paleta lista o item. */
@@ -73,6 +82,6 @@ export declare const ArkCommandItem: React.ForwardRefExoticComponent<ArkCommandI
73
82
  label?: string;
74
83
  disabled?: boolean;
75
84
  className?: string;
76
- } & {
85
+ } & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "testid" | "group" | "label" | "disabled" | "value"> & {
77
86
  children?: React.ReactNode | undefined;
78
87
  } & React.RefAttributes<ArkCommandItemElement>>;
@@ -3,7 +3,7 @@ import { ensureTooarkComponentsRegistered } from "./register.js";
3
3
  import { useForwardedRef } from "./use-forwarded-ref.js";
4
4
  import { useIsomorphicLayoutEffect } from "./use-isomorphic-layout-effect.js";
5
5
  export const ArkCommandPalette = forwardRef(function ArkCommandPalette(props, forwardedRef) {
6
- const { children, className, open, filter, queryDelay, noScrollLock, localeJson, onSelect, onQuery, onOpen, onClose, ...rest } = props;
6
+ const { children, className, open, filter, busy, queryDelay, noScrollLock, localeJson, onSelect, onQuery, onOpen, onClose, ...rest } = props;
7
7
  const [ref, setRef] = useForwardedRef(forwardedRef);
8
8
  useEffect(() => {
9
9
  ensureTooarkComponentsRegistered();
@@ -33,6 +33,7 @@ export const ArkCommandPalette = forwardRef(function ArkCommandPalette(props, fo
33
33
  class: className,
34
34
  open: open ? "" : undefined,
35
35
  filter: filter ? "" : undefined,
36
+ busy: busy ? "" : undefined,
36
37
  "no-scroll-lock": noScrollLock ? "" : undefined,
37
38
  "query-delay": queryDelay === undefined ? undefined : String(queryDelay),
38
39
  "locale-json": localeJson
@@ -2,7 +2,8 @@ import type { ArkCopyButtonStyleOptions } from "@tooark/core";
2
2
  import type { ArkCopyButton as ArkCopyButtonElement } from "@tooark/web-components";
3
3
  import type React from "react";
4
4
  import { type PropsWithChildren } from "react";
5
- export type ArkCopyButtonProps = PropsWithChildren<ArkCopyButtonStyleOptions & {
5
+ import type { ArkDomProps } from "./dom-props.js";
6
+ export type ArkCopyButtonProps = PropsWithChildren<ArkDomProps<ArkCopyButtonStyleOptions & {
6
7
  /** Texto a copiar. */
7
8
  value?: string;
8
9
  /** id de um elemento (vira o atributo for): copia o value de inputs/textareas ou o textContent. */
@@ -14,7 +15,7 @@ export type ArkCopyButtonProps = PropsWithChildren<ArkCopyButtonStyleOptions & {
14
15
  onCopy?: (event: CustomEvent<{
15
16
  value: string;
16
17
  }>) => void;
17
- }>;
18
+ }>>;
18
19
  export declare const ArkCopyButton: React.ForwardRefExoticComponent<ArkCopyButtonStyleOptions & {
19
20
  /** Texto a copiar. */
20
21
  value?: string;
@@ -27,6 +28,6 @@ export declare const ArkCopyButton: React.ForwardRefExoticComponent<ArkCopyButto
27
28
  onCopy?: (event: CustomEvent<{
28
29
  value: string;
29
30
  }>) => void;
30
- } & {
31
+ } & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "onCopy" | "disabled" | "value" | keyof ArkCopyButtonStyleOptions | "htmlFor" | "feedbackMs"> & {
31
32
  children?: React.ReactNode | undefined;
32
33
  } & React.RefAttributes<ArkCopyButtonElement>>;
@@ -1,7 +1,8 @@
1
1
  import type { ArkDatepickerLang, ArkDatepickerStyleOptions, ArkLocale } from "@tooark/core";
2
2
  import type { ArkDatepicker as ArkDatepickerElement } from "@tooark/web-components";
3
3
  import React from "react";
4
- export type ArkDatepickerProps = ArkDatepickerStyleOptions & {
4
+ import type { ArkDomProps } from "./dom-props.js";
5
+ export type ArkDatepickerProps = ArkDomProps<ArkDatepickerStyleOptions & {
5
6
  lang?: ArkDatepickerLang;
6
7
  localeJson?: Partial<ArkLocale>;
7
8
  value?: string;
@@ -12,7 +13,7 @@ export type ArkDatepickerProps = ArkDatepickerStyleOptions & {
12
13
  date: Date | null;
13
14
  }) => void;
14
15
  className?: string;
15
- };
16
+ }>;
16
17
  export declare const ArkDatepicker: React.ForwardRefExoticComponent<ArkDatepickerStyleOptions & {
17
18
  lang?: ArkDatepickerLang;
18
19
  localeJson?: Partial<ArkLocale>;
@@ -24,4 +25,4 @@ export declare const ArkDatepicker: React.ForwardRefExoticComponent<ArkDatepicke
24
25
  date: Date | null;
25
26
  }) => void;
26
27
  className?: string;
27
- } & React.RefAttributes<ArkDatepickerElement>>;
28
+ } & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "lang" | "onChange" | "localeJson" | "value" | "min" | "max" | keyof ArkDatepickerStyleOptions> & React.RefAttributes<ArkDatepickerElement>>;
@@ -1,7 +1,8 @@
1
1
  import type { ArkDialogCloseReason, ArkDialogStyleOptions } from "@tooark/core";
2
2
  import type { ArkDialog as ArkDialogElement } from "@tooark/web-components";
3
3
  import React, { type PropsWithChildren } from "react";
4
- export type ArkDialogProps = PropsWithChildren<ArkDialogStyleOptions & {
4
+ import type { ArkDomProps } from "./dom-props.js";
5
+ export type ArkDialogProps = PropsWithChildren<ArkDomProps<ArkDialogStyleOptions & {
5
6
  /** Aberto; a saida anima antes de sair do top layer. */
6
7
  open?: boolean;
7
8
  /** Titulo (h2) e nome acessivel. Sem ele, passe aria-label. */
@@ -19,7 +20,7 @@ export type ArkDialogProps = PropsWithChildren<ArkDialogStyleOptions & {
19
20
  onClose?: (event: CustomEvent<{
20
21
  reason: ArkDialogCloseReason;
21
22
  }>) => void;
22
- }>;
23
+ }>>;
23
24
  export declare const ArkDialog: React.ForwardRefExoticComponent<ArkDialogStyleOptions & {
24
25
  /** Aberto; a saida anima antes de sair do top layer. */
25
26
  open?: boolean;
@@ -38,6 +39,6 @@ export declare const ArkDialog: React.ForwardRefExoticComponent<ArkDialogStyleOp
38
39
  onClose?: (event: CustomEvent<{
39
40
  reason: ArkDialogCloseReason;
40
41
  }>) => void;
41
- } & {
42
+ } & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "aria-label" | "label" | "open" | "noScrollLock" | "onOpen" | "onClose" | keyof ArkDialogStyleOptions | "noCloseButton" | "persistent"> & {
42
43
  children?: React.ReactNode | undefined;
43
44
  } & React.RefAttributes<ArkDialogElement>>;
@@ -2,7 +2,8 @@ import type { ArkDrawerCloseReason, ArkDrawerStyleOptions } from "@tooark/core";
2
2
  import type { ArkDrawer as ArkDrawerElement } from "@tooark/web-components";
3
3
  import type React from "react";
4
4
  import { type PropsWithChildren } from "react";
5
- export type ArkDrawerProps = PropsWithChildren<ArkDrawerStyleOptions & {
5
+ import type { ArkDomProps } from "./dom-props.js";
6
+ export type ArkDrawerProps = PropsWithChildren<ArkDomProps<ArkDrawerStyleOptions & {
6
7
  /** Aberta; a saida anima antes de esconder. */
7
8
  open?: boolean;
8
9
  /** Titulo (h2) e nome acessivel. Sem ele, passe aria-label. */
@@ -20,7 +21,7 @@ export type ArkDrawerProps = PropsWithChildren<ArkDrawerStyleOptions & {
20
21
  onClose?: (event: CustomEvent<{
21
22
  reason: ArkDrawerCloseReason;
22
23
  }>) => void;
23
- }>;
24
+ }>>;
24
25
  export declare const ArkDrawer: React.ForwardRefExoticComponent<ArkDrawerStyleOptions & {
25
26
  /** Aberta; a saida anima antes de esconder. */
26
27
  open?: boolean;
@@ -39,6 +40,6 @@ export declare const ArkDrawer: React.ForwardRefExoticComponent<ArkDrawerStyleOp
39
40
  onClose?: (event: CustomEvent<{
40
41
  reason: ArkDrawerCloseReason;
41
42
  }>) => void;
42
- } & {
43
+ } & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "aria-label" | "label" | "open" | "noScrollLock" | "onOpen" | "onClose" | "noCloseButton" | "persistent" | keyof ArkDrawerStyleOptions> & {
43
44
  children?: React.ReactNode | undefined;
44
45
  } & React.RefAttributes<ArkDrawerElement>>;
@@ -1,19 +1,20 @@
1
1
  import type { ArkEmptyStyleOptions } from "@tooark/core";
2
2
  import type { ArkEmpty as ArkEmptyElement } from "@tooark/web-components";
3
3
  import React, { type PropsWithChildren } from "react";
4
- export type ArkEmptyProps = PropsWithChildren<ArkEmptyStyleOptions & {
4
+ import type { ArkDomProps } from "./dom-props.js";
5
+ export type ArkEmptyProps = PropsWithChildren<ArkDomProps<ArkEmptyStyleOptions & {
5
6
  /** Titulo (h3). */
6
7
  heading?: string;
7
8
  /** Texto abaixo do titulo. */
8
9
  description?: string;
9
10
  className?: string;
10
- }>;
11
+ }>>;
11
12
  export declare const ArkEmpty: React.ForwardRefExoticComponent<ArkEmptyStyleOptions & {
12
13
  /** Titulo (h3). */
13
14
  heading?: string;
14
15
  /** Texto abaixo do titulo. */
15
16
  description?: string;
16
17
  className?: string;
17
- } & {
18
+ } & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "heading" | keyof ArkEmptyStyleOptions | "description"> & {
18
19
  children?: React.ReactNode | undefined;
19
20
  } & React.RefAttributes<ArkEmptyElement>>;