@tooark/web-components 1.6.1 → 1.7.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/README.md +13 -5
- package/README.pt-BR.md +13 -5
- package/dist/index.cjs +8045 -3632
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +699 -10
- package/dist/index.d.ts +699 -10
- package/dist/index.js +8038 -3634
- package/dist/index.js.map +1 -1
- package/dist/styles.css +2 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ The native Custom Elements (`ark-*`) of the Tooark design system, styled with Ta
|
|
|
28
28
|
|
|
29
29
|
The `@tooark/web-components` package provides:
|
|
30
30
|
|
|
31
|
-
-
|
|
31
|
+
- 50 elements: buttons and toggles, form fields (input, textarea, select, checkbox, radio, switch, file input, datepicker, key/value editor), overlays on the Popover API (dialog, drawer, menu, tooltip, command palette, toaster), layout (card, tabs, split pane, carousel), data (data view as table or cards, pagination, tree), feedback (alert, badge, progress, spinner, skeleton, empty, status dot) the calendar/clock/scheduler family and relative time (`ark-time`);
|
|
32
32
|
- light DOM: components never move or wrap your children; the host is the control or container;
|
|
33
33
|
- `styles.css` is the only stylesheet you need: tokens, motion presets and component styles, all prefixed (`ark:*`, `--ark-*`), with no global reset;
|
|
34
34
|
- themes by `color-scheme` (`theme="light|dark"` per element), sizes `xs…xl`, intents `primary…neutral`, `rounded`;
|
|
@@ -65,7 +65,7 @@ registerTooarkComponents(); // idempotent
|
|
|
65
65
|
|
|
66
66
|
A JS property your framework assigns to a raw tag before this call is picked up when the element upgrades, so the order does not matter.
|
|
67
67
|
|
|
68
|
-
Declare the page's `color-scheme` to pick the theme (`light`, `dark` or `light dark` to follow the system); set `theme="light|dark"` on an element to force one side, and `lang="en|pt|es"` (or `lang="custom"` with `locale-json`) on the elements that show text.
|
|
68
|
+
Declare the page's `color-scheme` to pick the theme (`light`, `dark` or `light dark` to follow the system); set `theme="light|dark"` on an element to force one side, and `lang="en|pt|es"` (or `lang="custom"` with `locale-json`) on the elements that show text; a tag with a region (`pt-BR`, `es-419`) uses its base language. To set it once for the app, call `setArkLocale("pt-BR")` from `@tooark/core`: every element without its own `lang` follows it, mounted ones included.
|
|
69
69
|
|
|
70
70
|
---
|
|
71
71
|
|
|
@@ -84,6 +84,7 @@ Declare the page's `color-scheme` to pick the theme (`light`, `dark` or `light d
|
|
|
84
84
|
- `ark-command-item` — Command palette item (the host is the `role="option"`): free children, `slot="trailing"` for a shortcut, `value`, `group`, `label` (filter text), `disabled`. Emits `ark-select`.
|
|
85
85
|
- `ark-command-palette` — Command palette on the Popover API: search field (an `ark-input` of its own), `ark-command-item` children grouped and filtered (`filter`) or searched by the app (`ark-query`), arrows + Enter, `hotkey` (`/`, `mod+k`), `hint` and `busy` for the empty message. Emits `ark-select`, `ark-query`, `ark-open`, `ark-close`.
|
|
86
86
|
- `ark-copy-button` — Copy button: extends `ark-button` (same variants, sizes, `icon-only`, forms, hooks); copies `value` or the `for` element, swaps the icon for a check and the text/`title` for "copied" for `feedback-ms`, announces it. Emits `ark-copy`.
|
|
87
|
+
- `ark-data-view` — Records as a table or as cards from `rows` + `columns` (JS properties): `view` auto by the component's own width, search, sortable headers, pagination, `client`/`server` mode, custom cell `render`, opt-in `selectable`/`reorderable`/`clickable`. Emits `ark-query-change`, `ark-row-click`, `ark-selection-change`, `ark-reorder`.
|
|
87
88
|
- `ark-datepicker` — Date/time picker composing `ark-input` + `ark-calendar` + `ark-clock`: `mode` datetime (default)/date/time, inline or `input` mode with field + popup, localized formatting, typed input parsing, forms (Enter in the field submits once the popup is closed).
|
|
88
89
|
- `ark-dialog` — Modal dialog on the Popover API (top layer, `::backdrop` scrim, no portal): the host is the panel, your children are the body, `slot="footer"` is the footer; header from `label`, focus trap, Esc/scrim, `sm`–`xl` or `full`.
|
|
89
90
|
- `ark-drawer` — Drawer anchored to an edge: `overlay` (Popover API, scrim, focus trap, Esc) or `inline` (in the page flow, e.g. a bottom console); `side`, `size` preset or CSS length, header from `label` with a `slot="actions"` row, `slot="footer"`, slide with the `sheet` easing. Emits `ark-open`/`ark-close`.
|
|
@@ -95,6 +96,11 @@ Declare the page's `color-scheme` to pick the theme (`light`, `dark` or `light d
|
|
|
95
96
|
- `ark-mark` — Scope mark: one of ten shapes (`circle`, `square`, `triangle`, `diamond`, `star`, `hexagon`, `cross`, `pentagon`, `moon`, `asterisk`) in a `color`, color and shape together so identity never relies on color alone; `size`, `label`.
|
|
96
97
|
- `ark-menu` — Dropdown/context menu on the Popover API (`role="menu"`, `popover="auto"`): anchored to a trigger by `for`, `align`/`direction` with flip, keyboard, `openAt(x, y)`; items stay as children. Emits `ark-select`.
|
|
97
98
|
- `ark-menu-item` — Menu item (the host is the item): free children, `slot="trailing"`, `disabled`, `intent`, `checked` (checkbox item), `divider`, `static` (non-interactive content).
|
|
99
|
+
- `ark-menu-group` — Labelled group of menu items (`role="group"`, named by its own label); the menu's arrows cross groups.
|
|
100
|
+
- `ark-nav` — App navigation (`role="navigation"`): `sidebar` (collapses to an icon rail or, with `collapsible="hidden"`, to the logo alone), `navbar` or `tabbar` (mobile bottom tabs); `slot="header"`/`slot="footer"` ordered by CSS, `value` marks the current item, `size`/`intent` propagated. Emits `ark-collapse`.
|
|
101
|
+
- `ark-nav-group` — Navigation section (`role="group"` named by `label`): plain heading, or an `expandable` button (`open`, `aria-expanded`) that shows and hides the items; a separated band in the rail, inline items in the bars. Emits `ark-toggle`.
|
|
102
|
+
- `ark-nav-item` — Navigation item (the host is the row): `href` → a real stretched `<a>` (Ctrl+click, new tab), `label`, `slot="icon"`, `slot="trailing"`, `current` (`aria-current`), `disabled`, `divider`; without `href` a `role="button"`. Emits cancelable `ark-navigate`.
|
|
103
|
+
- `ark-pagination` — Pagination (`role="navigation"`): range summary, optional page-size select (`page-sizes`), page strip with ellipses, previous/next; `page`/`page-size`/`total` rewritten on click, localized, announced. Emits `ark-page-change`.
|
|
98
104
|
- `ark-progress` — Progress bar (`role="progressbar"` on the host): `value`/`max` with token-driven width transition, `show-value`, `indeterminate` loop exempt from reduced motion, `label`, sizes, intents.
|
|
99
105
|
- `ark-radio` — Radio drawn by the component (`role="radio"` button + hidden native input): groups by `name` in the same form, one tab stop per group, arrows move and check, `label`/children as the label, `helper` hint. Emits `change` on the one checked.
|
|
100
106
|
- `ark-scheduler` — Scheduler with `week`/`day` views (time grid with overlap resolved into columns), plus `month` and `agenda`; colored, clickable events.
|
|
@@ -108,10 +114,12 @@ Declare the page's `color-scheme` to pick the theme (`light`, `dark` or `light d
|
|
|
108
114
|
- `ark-tab` — Tab item (`role="tab"`, the host is the control): free children, `disabled`, `controls`, `closable` and `dirty` in the editor variant. Emits `ark-close`.
|
|
109
115
|
- `ark-tabs` — Tab strip (`role="tablist"`): `underline`/`chips`/`editor`, roving tabindex with arrows/Home/End, `slot="actions"` at the end, `change` with the active value. Panels stay with the app.
|
|
110
116
|
- `ark-textarea` — Multi-line field with the `ark-input` grid: `rows`, `autosize` (native `field-sizing`, JS fallback), `monospace`, `resize`, helper/error with aria, sizes, intents, `rounded`.
|
|
117
|
+
- `ark-time` — Date and time through `Intl`: relative to now ("3 minutes ago", "yesterday") and updating itself, or absolute (`date`, `time`, `datetime`); a `<time datetime>` with the full date as `title`.
|
|
111
118
|
- `ark-toaster` — Sonner-style toasts: programmatic API, positions, rich colors, actions, animated enter/exit, localized close button.
|
|
112
119
|
- `ark-toggle` — Pressed-state button (`aria-pressed`), standalone (outline/tinted per intent) or as a group item.
|
|
113
120
|
- `ark-toggle-group` — Segmented control: exclusive (default) or multiple selection, synced `value`, propagates `size`/`intent`/`theme`/`disabled` to items.
|
|
114
121
|
- `ark-tooltip` — Tooltip on the Popover API: wraps your trigger without moving it, text via `content` or rich `slot="content"`, `side` with flip, `delay`, hover/focus/Esc, `aria-describedby` on the trigger.
|
|
122
|
+
- `ark-tree` / `ark-tree-item` — Declarative tree: nested items stay in place; selection none / single / multiple, checkboxes with propagate, lazy loading, WAI-ARIA keyboard and typeahead.
|
|
115
123
|
|
|
116
124
|
Full attribute reference, theming guide and E2E hooks: [https://github.com/Tooark/web-components#readme](https://github.com/Tooark/web-components#readme) · live examples with interaction tests: [Storybook](https://tooark.com/web-components/).
|
|
117
125
|
|
|
@@ -186,9 +194,9 @@ Installed automatically unless marked as peer; peer dependencies are yours to in
|
|
|
186
194
|
|
|
187
195
|
| Package | Version | Description |
|
|
188
196
|
| ---------------------------------------------------------------- | ------- | ---------------------------------------------------------------- |
|
|
189
|
-
| [`@tooark/core`](https://www.npmjs.com/package/@tooark/core) | ^1.
|
|
190
|
-
| [`@tooark/tokens`](https://www.npmjs.com/package/@tooark/tokens) | ^1.
|
|
191
|
-
| [`tslib`](https://www.npmjs.com/package/tslib) | ^2.
|
|
197
|
+
| [`@tooark/core`](https://www.npmjs.com/package/@tooark/core) | ^1.7.0 | Types, i18n, toast/announce services, motion and overlay helpers |
|
|
198
|
+
| [`@tooark/tokens`](https://www.npmjs.com/package/@tooark/tokens) | ^1.7.0 | Design tokens (colors, sizes, motion) and primitive types |
|
|
199
|
+
| [`tslib`](https://www.npmjs.com/package/tslib) | ^2.9.1 | TypeScript runtime helpers |
|
|
192
200
|
|
|
193
201
|
---
|
|
194
202
|
|
package/README.pt-BR.md
CHANGED
|
@@ -28,7 +28,7 @@ Os Custom Elements nativos (`ark-*`) do design system Tooark, estilizados com Ta
|
|
|
28
28
|
|
|
29
29
|
O pacote `@tooark/web-components` fornece:
|
|
30
30
|
|
|
31
|
-
-
|
|
31
|
+
- 50 elementos: botões e toggles, campos de formulário (input, textarea, select, checkbox, radio, switch, file input, datepicker, editor chave/valor), overlays sobre a Popover API (dialog, drawer, menu, tooltip, paleta de comandos, toaster), layout (card, tabs, split pane, carousel), dados (data view em tabela ou cards, paginação, árvore), feedback (alert, badge, progress, spinner, skeleton, empty, status dot) a família calendário/relógio/agenda e o tempo relativo (`ark-time`);
|
|
32
32
|
- light DOM: os componentes nunca movem nem envolvem os seus filhos; o host é o controle ou o container;
|
|
33
33
|
- `styles.css` é a única folha de estilo necessária: tokens, presets de motion e estilos dos componentes, tudo com prefixo (`ark:*`, `--ark-*`), sem reset global;
|
|
34
34
|
- temas por `color-scheme` (`theme="light|dark"` por elemento), tamanhos `xs…xl`, intents `primary…neutral`, `rounded`;
|
|
@@ -65,7 +65,7 @@ registerTooarkComponents(); // idempotente
|
|
|
65
65
|
|
|
66
66
|
Uma propriedade JS que o framework atribui a uma tag crua antes desta chamada é aplicada quando o elemento faz o upgrade, então a ordem não importa.
|
|
67
67
|
|
|
68
|
-
Declare o `color-scheme` da página para escolher o tema (`light`, `dark` ou `light dark` para seguir o sistema); `theme="light|dark"` num elemento força um lado, e `lang="en|pt|es"` (ou `lang="custom"` com `locale-json`) nos elementos que mostram texto.
|
|
68
|
+
Declare o `color-scheme` da página para escolher o tema (`light`, `dark` ou `light dark` para seguir o sistema); `theme="light|dark"` num elemento força um lado, e `lang="en|pt|es"` (ou `lang="custom"` com `locale-json`) nos elementos que mostram texto; uma tag com região (`pt-BR`, `es-419`) usa o idioma base. Para definir uma vez para o app, chame `setArkLocale("pt-BR")` do `@tooark/core`: todo elemento sem `lang` próprio segue, inclusive os já montados.
|
|
69
69
|
|
|
70
70
|
---
|
|
71
71
|
|
|
@@ -84,6 +84,7 @@ Declare o `color-scheme` da página para escolher o tema (`light`, `dark` ou `li
|
|
|
84
84
|
- `ark-command-item` — Item da paleta de comandos (o host é o `role="option"`): filhos livres, `slot="trailing"` para o atalho, `value`, `group`, `label` (texto do filtro), `disabled`. Emite `ark-select`.
|
|
85
85
|
- `ark-command-palette` — Paleta de comandos sobre a Popover API: campo de busca (um `ark-input` próprio), filhos `ark-command-item` agrupados e filtrados (`filter`) ou buscados pelo app (`ark-query`), setas + Enter, `hotkey` (`/`, `mod+k`), `hint` e `busy` para a mensagem de vazio. Emite `ark-select`, `ark-query`, `ark-open`, `ark-close`.
|
|
86
86
|
- `ark-copy-button` — Botão de copiar: estende o `ark-button` (mesmas variantes, tamanhos, `icon-only`, formulário, hooks); copia `value` ou o elemento de `for`, troca o ícone por um check e o texto/`title` por "copiado" durante `feedback-ms`, anuncia. Emite `ark-copy`.
|
|
87
|
+
- `ark-data-view` — Registros em tabela ou cards a partir de `rows` + `columns` (propriedades JS): `view` auto pela largura do próprio componente, busca, cabeçalhos ordenáveis, paginação, modo `client`/`server`, `render` próprio por célula, `selectable`/`reorderable`/`clickable` opcionais. Emite `ark-query-change`, `ark-row-click`, `ark-selection-change`, `ark-reorder`.
|
|
87
88
|
- `ark-datepicker` — Seletor de data/hora que compõe `ark-input` + `ark-calendar` + `ark-clock`: `mode` datetime (padrão)/date/time, inline ou modo `input` com campo + popup, formatação localizada, parse da digitação, formulário (Enter no campo envia com o popup fechado).
|
|
88
89
|
- `ark-dialog` — Diálogo modal sobre a Popover API (top layer, scrim por `::backdrop`, sem portal): o host é o painel, seus filhos são o corpo, `slot="footer"` é o rodapé; cabeçalho de `label`, focus trap, Esc/scrim, `sm`–`xl` ou `full`.
|
|
89
90
|
- `ark-drawer` — Gaveta ancorada numa borda: `overlay` (Popover API, scrim, focus trap, Esc) ou `inline` (no fluxo da página, ex.: console inferior); `side`, `size` preset ou comprimento CSS, cabeçalho de `label` com a linha `slot="actions"`, `slot="footer"`, slide com o easing `sheet`. Emite `ark-open`/`ark-close`.
|
|
@@ -95,6 +96,11 @@ Declare o `color-scheme` da página para escolher o tema (`light`, `dark` ou `li
|
|
|
95
96
|
- `ark-mark` — Marca de escopo: uma de dez formas (`circle`, `square`, `triangle`, `diamond`, `star`, `hexagon`, `cross`, `pentagon`, `moon`, `asterisk`) numa `color`, cor e forma juntas para a identidade nunca depender só da cor; `size`, `label`.
|
|
96
97
|
- `ark-menu` — Menu suspenso/de contexto sobre a Popover API (`role="menu"`, `popover="auto"`): ancorado ao gatilho por `for`, `align`/`direction` com flip, teclado, `openAt(x, y)`; itens ficam como filhos. Emite `ark-select`.
|
|
97
98
|
- `ark-menu-item` — Item de menu (o host é o item): filhos livres, `slot="trailing"`, `disabled`, `intent`, `checked` (item checkbox), `divider`, `static` (conteúdo não interativo).
|
|
99
|
+
- `ark-menu-group` — Grupo rotulado de itens de menu (`role="group"`, nomeado pelo próprio rótulo); as setas do menu atravessam os grupos.
|
|
100
|
+
- `ark-nav` — Navegação do app (`role="navigation"`): `sidebar` (recolhe para um trilho de ícones ou, com `collapsible="hidden"`, para só o logo), `navbar` ou `tabbar` (abas de rodapé do celular); `slot="header"`/`slot="footer"` ordenados por CSS, `value` marca o item atual, `size`/`intent` propagados. Emite `ark-collapse`.
|
|
101
|
+
- `ark-nav-group` — Seção da navegação (`role="group"` nomeado por `label`): título simples ou botão `expandable` (`open`, `aria-expanded`) que mostra e esconde os itens; faixa separada no trilho, itens soltos nas barras. Emite `ark-toggle`.
|
|
102
|
+
- `ark-nav-item` — Item de navegação (o host é a linha): `href` → um `<a>` real esticado (Ctrl+clique, nova aba), `label`, `slot="icon"`, `slot="trailing"`, `current` (`aria-current`), `disabled`, `divider`; sem `href` um `role="button"`. Emite `ark-navigate` cancelável.
|
|
103
|
+
- `ark-pagination` — Paginação (`role="navigation"`): resumo do intervalo, seletor opcional de itens por página (`page-sizes`), faixa de páginas com reticências, anterior/próxima; `page`/`page-size`/`total` reescritos no clique, localizada, anunciada. Emite `ark-page-change`.
|
|
98
104
|
- `ark-progress` — Barra de progresso (`role="progressbar"` no host): `value`/`max` com transição de largura pelos tokens, `show-value`, `indeterminate` em loop isento de movimento reduzido, `label`, tamanhos, intents.
|
|
99
105
|
- `ark-radio` — Radio desenhado pelo componente (botão `role="radio"` + input nativo oculto): agrupa por `name` no mesmo form, um tab stop por grupo, setas movem e marcam, `label`/filhos como rótulo, dica `helper`. Emite `change` na que marcou.
|
|
100
106
|
- `ark-scheduler` — Agenda com views `week`/`day` (timeline por horário e sobreposição em colunas), `month` e `agenda`; eventos coloridos e clicáveis.
|
|
@@ -108,10 +114,12 @@ Declare o `color-scheme` da página para escolher o tema (`light`, `dark` ou `li
|
|
|
108
114
|
- `ark-tab` — Aba (`role="tab"`, o host é o controle): filhos livres, `disabled`, `controls`, `closable` e `dirty` na variante editor. Emite `ark-close`.
|
|
109
115
|
- `ark-tabs` — Faixa de abas (`role="tablist"`): `underline`/`chips`/`editor`, roving tabindex com setas/Home/End, `slot="actions"` no fim, `change` com o value ativo. Painéis ficam com o app.
|
|
110
116
|
- `ark-textarea` — Campo multilinha com a grid do `ark-input`: `rows`, `autosize` (`field-sizing` nativo, fallback JS), `monospace`, `resize`, helper/erro com aria, tamanhos, intents, `rounded`.
|
|
117
|
+
- `ark-time` — Data e hora pelo `Intl`: relativa a agora ("há 3 minutos", "ontem") e atualizando sozinha, ou absoluta (`date`, `time`, `datetime`); um `<time datetime>` com a data completa no `title`.
|
|
111
118
|
- `ark-toaster` — Toasts no estilo Sonner: API programática, posições, rich colors, ações, entrada/saída animadas, botão de fechar localizado.
|
|
112
119
|
- `ark-toggle` — Botão de estado pressionado (`aria-pressed`), standalone (outline/tinted por intent) ou como item de grupo.
|
|
113
120
|
- `ark-toggle-group` — Segmented control: seleção exclusiva (padrão) ou múltipla, `value` sincronizado, propaga `size`/`intent`/`theme`/`disabled` aos itens.
|
|
114
121
|
- `ark-tooltip` — Tooltip sobre a Popover API: envolve o gatilho sem movê-lo, texto por `content` ou `slot="content"` rico, `side` com flip, `delay`, hover/foco/Esc, `aria-describedby` no gatilho.
|
|
122
|
+
- `ark-tree` / `ark-tree-item` — Árvore declarativa: os itens aninhados ficam onde estão; seleção none / single / multiple, caixas com propagate, carga lazy, teclado WAI-ARIA e busca por digitação.
|
|
115
123
|
|
|
116
124
|
Referência completa de atributos, guia de tema e hooks de E2E: [https://github.com/Tooark/web-components/blob/main/README.pt-BR.md](https://github.com/Tooark/web-components/blob/main/README.pt-BR.md) · exemplos vivos com testes de interação: [Storybook](https://tooark.com/web-components/).
|
|
117
125
|
|
|
@@ -186,9 +194,9 @@ Instaladas automaticamente, salvo as marcadas como peer, que ficam por sua conta
|
|
|
186
194
|
|
|
187
195
|
| Pacote | Versão | Descrição |
|
|
188
196
|
| ---------------------------------------------------------------- | ------ | -------------------------------------------------------------------- |
|
|
189
|
-
| [`@tooark/core`](https://www.npmjs.com/package/@tooark/core) | ^1.
|
|
190
|
-
| [`@tooark/tokens`](https://www.npmjs.com/package/@tooark/tokens) | ^1.
|
|
191
|
-
| [`tslib`](https://www.npmjs.com/package/tslib) | ^2.
|
|
197
|
+
| [`@tooark/core`](https://www.npmjs.com/package/@tooark/core) | ^1.7.0 | Tipos, i18n, serviços de toast/announce, motion e helpers de overlay |
|
|
198
|
+
| [`@tooark/tokens`](https://www.npmjs.com/package/@tooark/tokens) | ^1.7.0 | Design tokens (cores, tamanhos, motion) e tipos primitivos |
|
|
199
|
+
| [`tslib`](https://www.npmjs.com/package/tslib) | ^2.9.1 | Helpers de runtime do TypeScript |
|
|
192
200
|
|
|
193
201
|
---
|
|
194
202
|
|