@1doc/1ds-react 2.8.0 → 2.10.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/CHANGELOG.md +1540 -0
- package/dist/components/AILabel/AILabel.js +1 -1
- package/dist/components/Accordion/Accordion.css +13 -0
- package/dist/components/Accordion/Accordion.d.ts +9 -2
- package/dist/components/Accordion/Accordion.js +1 -0
- package/dist/components/AppSubheader/AppSubheader.css +10 -1
- package/dist/components/AttachmentCard/AttachmentCard.css +26 -8
- package/dist/components/AttachmentCard/AttachmentCard.d.ts +22 -2
- package/dist/components/AttachmentCard/AttachmentCard.js +47 -3
- package/dist/components/Avatar/Avatar.css +7 -2
- package/dist/components/Avatar/AvatarGroup.d.ts +17 -0
- package/dist/components/Avatar/AvatarGroup.js +22 -8
- package/dist/components/Badge/Badge.css +67 -2
- package/dist/components/Badge/Badge.d.ts +23 -4
- package/dist/components/Badge/Badge.js +4 -0
- package/dist/components/Box/Box.css +83 -0
- package/dist/components/Box/Box.d.ts +82 -2
- package/dist/components/Box/Box.js +42 -2
- package/dist/components/Button/Button.css +29 -0
- package/dist/components/Button/Button.d.ts +4 -4
- package/dist/components/Button/Button.js +4 -1
- package/dist/components/Calendar/Calendar.css +245 -0
- package/dist/components/Calendar/Calendar.d.ts +126 -0
- package/dist/components/Calendar/Calendar.js +320 -0
- package/dist/components/Chips/Chips.css +38 -0
- package/dist/components/Chips/Chips.d.ts +5 -2
- package/dist/components/Chips/Chips.js +2 -1
- package/dist/components/Coachmark/Coachmark.css +128 -0
- package/dist/components/Coachmark/Coachmark.d.ts +87 -0
- package/dist/components/Coachmark/Coachmark.js +362 -0
- package/dist/components/CodeBlock/CodeBlock.css +96 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts +47 -0
- package/dist/components/CodeBlock/CodeBlock.js +103 -0
- package/dist/components/ColorPicker/ColorPicker.css +140 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +73 -0
- package/dist/components/ColorPicker/ColorPicker.js +219 -0
- package/dist/components/Combobox/Combobox.css +8 -0
- package/dist/components/DataTable/DataTable.css +254 -0
- package/dist/components/DataTable/DataTable.d.ts +81 -5
- package/dist/components/DataTable/DataTable.js +335 -19
- package/dist/components/DatePicker/DatePicker.css +8 -0
- package/dist/components/DatePicker/DatePicker.js +10 -1
- package/dist/components/DescriptionList/DescriptionList.css +127 -0
- package/dist/components/DescriptionList/DescriptionList.d.ts +62 -0
- package/dist/components/DescriptionList/DescriptionList.js +52 -0
- package/dist/components/EmptyState/EmptyState.d.ts +4 -2
- package/dist/components/EmptyState/EmptyState.js +2 -2
- package/dist/components/FileInput/FileInput.css +16 -0
- package/dist/components/FileInput/FileInput.d.ts +4 -2
- package/dist/components/FileInput/FileInput.js +8 -2
- package/dist/components/Grid/Grid.js +5 -5
- package/dist/components/IconPicker/IconPicker.css +107 -0
- package/dist/components/IconPicker/IconPicker.d.ts +74 -0
- package/dist/components/IconPicker/IconPicker.js +194 -0
- package/dist/components/Input/Input.css +59 -0
- package/dist/components/Input/Input.d.ts +17 -1
- package/dist/components/Input/Input.js +67 -5
- package/dist/components/Kanban/Kanban.css +4 -0
- package/dist/components/Kbd/Kbd.css +66 -0
- package/dist/components/Kbd/Kbd.d.ts +32 -0
- package/dist/components/Kbd/Kbd.js +40 -0
- package/dist/components/List/List.css +136 -0
- package/dist/components/List/List.d.ts +82 -0
- package/dist/components/List/List.js +53 -0
- package/dist/components/List/ListItem.d.ts +97 -0
- package/dist/components/List/ListItem.js +82 -0
- package/dist/components/Modal/Modal.css +80 -0
- package/dist/components/Modal/Modal.d.ts +33 -6
- package/dist/components/Modal/Modal.js +101 -6
- package/dist/components/MultiSelect/MultiSelect.css +8 -0
- package/dist/components/MultiSelect/MultiSelect.js +10 -1
- package/dist/components/OrgChart/OrgChart.css +149 -0
- package/dist/components/OrgChart/OrgChart.d.ts +83 -0
- package/dist/components/OrgChart/OrgChart.js +297 -0
- package/dist/components/OtpInput/OtpInput.css +93 -0
- package/dist/components/OtpInput/OtpInput.d.ts +60 -0
- package/dist/components/OtpInput/OtpInput.js +215 -0
- package/dist/components/PhoneInput/PhoneInput.css +8 -0
- package/dist/components/Popover/Popover.d.ts +7 -0
- package/dist/components/Popover/Popover.js +11 -1
- package/dist/components/RichTextEditor/RichTextEditor.css +250 -0
- package/dist/components/RichTextEditor/RichTextEditor.d.ts +97 -0
- package/dist/components/RichTextEditor/RichTextEditor.js +951 -0
- package/dist/components/SegmentedControl/SegmentedControl.css +24 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +2 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +10 -2
- package/dist/components/Select/Select.css +164 -0
- package/dist/components/Select/Select.d.ts +34 -0
- package/dist/components/Select/Select.js +258 -28
- package/dist/components/Stack/Stack.css +49 -0
- package/dist/components/Stack/Stack.d.ts +65 -7
- package/dist/components/Stack/Stack.js +30 -2
- package/dist/components/StatCard/StatCard.css +138 -0
- package/dist/components/StatCard/StatCard.d.ts +26 -0
- package/dist/components/StatCard/StatCard.js +13 -1
- package/dist/components/Tabs/Tab.d.ts +15 -0
- package/dist/components/Tabs/Tab.js +30 -1
- package/dist/components/Tabs/Tabs.css +132 -0
- package/dist/components/Tabs/Tabs.d.ts +7 -0
- package/dist/components/Tabs/Tabs.js +13 -2
- package/dist/components/Tag/Tag.css +85 -2
- package/dist/components/Tag/Tag.d.ts +13 -6
- package/dist/components/Tag/Tag.js +1 -0
- package/dist/components/Text/Text.js +2 -2
- package/dist/components/Textarea/Textarea.css +8 -0
- package/dist/components/TimePicker/TimePicker.css +8 -0
- package/dist/components/Toast/Toast.css +32 -0
- package/dist/components/Toast/Toast.d.ts +18 -0
- package/dist/components/Toast/Toast.js +14 -1
- package/dist/components/Toast/ToastStack.js +8 -1
- package/dist/components/Tooltip/Tooltip.css +25 -0
- package/dist/components/Tooltip/Tooltip.d.ts +11 -0
- package/dist/components/Tooltip/Tooltip.js +18 -3
- package/dist/index.d.ts +25 -0
- package/dist/index.js +14 -0
- package/dist/teste/AILabel.test.d.ts +1 -0
- package/dist/teste/AILabel.test.js +33 -0
- package/dist/teste/AccordionConteudoLivre.test.d.ts +1 -0
- package/dist/teste/AccordionConteudoLivre.test.js +29 -0
- package/dist/teste/AccordionTituloNeutro.test.d.ts +1 -0
- package/dist/teste/AccordionTituloNeutro.test.js +23 -0
- package/dist/teste/AppSubheaderRegiao.test.d.ts +1 -0
- package/dist/teste/AppSubheaderRegiao.test.js +13 -0
- package/dist/teste/AtributosRepassados.test.d.ts +1 -0
- package/dist/teste/AtributosRepassados.test.js +52 -0
- package/dist/teste/AttachmentCardIA.test.d.ts +1 -0
- package/dist/teste/AttachmentCardIA.test.js +89 -0
- package/dist/teste/AttachmentCardLista.test.d.ts +1 -0
- package/dist/teste/AttachmentCardLista.test.js +49 -0
- package/dist/teste/AttachmentCardSm.test.d.ts +1 -0
- package/dist/teste/AttachmentCardSm.test.js +26 -0
- package/dist/teste/AvatarGroupOverlap.test.d.ts +1 -0
- package/dist/teste/AvatarGroupOverlap.test.js +56 -0
- package/dist/teste/BadgeNeutroColado.test.d.ts +1 -0
- package/dist/teste/BadgeNeutroColado.test.js +11 -0
- package/dist/teste/BadgeTag.test.d.ts +1 -0
- package/dist/teste/BadgeTag.test.js +55 -0
- package/dist/teste/BoxItemFlex.test.d.ts +1 -0
- package/dist/teste/BoxItemFlex.test.js +54 -0
- package/dist/teste/BoxLayout.test.d.ts +1 -0
- package/dist/teste/BoxLayout.test.js +35 -0
- package/dist/teste/Button.test.d.ts +1 -0
- package/dist/teste/Button.test.js +27 -0
- package/dist/teste/Calendar.test.d.ts +1 -0
- package/dist/teste/Calendar.test.js +221 -0
- package/dist/teste/CalendarCabecalho.test.d.ts +1 -0
- package/dist/teste/CalendarCabecalho.test.js +11 -0
- package/dist/teste/ChipsXs.test.d.ts +1 -0
- package/dist/teste/ChipsXs.test.js +31 -0
- package/dist/teste/Coachmark.test.d.ts +1 -0
- package/dist/teste/Coachmark.test.js +149 -0
- package/dist/teste/CoachmarkSemVeu.test.d.ts +1 -0
- package/dist/teste/CoachmarkSemVeu.test.js +85 -0
- package/dist/teste/ColorPicker.test.d.ts +1 -0
- package/dist/teste/ColorPicker.test.js +132 -0
- package/dist/teste/ColorPickerXs.test.d.ts +1 -0
- package/dist/teste/ColorPickerXs.test.js +21 -0
- package/dist/teste/DataTableArvoreEVariantes.test.d.ts +1 -0
- package/dist/teste/DataTableArvoreEVariantes.test.js +190 -0
- package/dist/teste/DataTableCelulaLivre.test.d.ts +1 -0
- package/dist/teste/DataTableCelulaLivre.test.js +76 -0
- package/dist/teste/DataTableDocumento.test.d.ts +1 -0
- package/dist/teste/DataTableDocumento.test.js +92 -0
- package/dist/teste/DatePicker.test.js +23 -0
- package/dist/teste/DescriptionListCompacta.test.d.ts +1 -0
- package/dist/teste/DescriptionListCompacta.test.js +22 -0
- package/dist/teste/EmptyStateTituloRico.test.d.ts +1 -0
- package/dist/teste/EmptyStateTituloRico.test.js +23 -0
- package/dist/teste/FileInputTrigger.test.d.ts +1 -0
- package/dist/teste/FileInputTrigger.test.js +53 -0
- package/dist/teste/IconPicker.test.d.ts +1 -0
- package/dist/teste/IconPicker.test.js +130 -0
- package/dist/teste/InputAgrupado.test.d.ts +1 -0
- package/dist/teste/InputAgrupado.test.js +24 -0
- package/dist/teste/InputMascaraEAfins.test.d.ts +1 -0
- package/dist/teste/InputMascaraEAfins.test.js +99 -0
- package/dist/teste/KbdCodeBlock.test.d.ts +1 -0
- package/dist/teste/KbdCodeBlock.test.js +95 -0
- package/dist/teste/List.test.d.ts +1 -0
- package/dist/teste/List.test.js +153 -0
- package/dist/teste/ListItemTooltipStandalone.test.d.ts +1 -0
- package/dist/teste/ListItemTooltipStandalone.test.js +39 -0
- package/dist/teste/ModalVariantes.test.d.ts +1 -0
- package/dist/teste/ModalVariantes.test.js +151 -0
- package/dist/teste/NomeAcessivelSsr.test.d.ts +1 -0
- package/dist/teste/NomeAcessivelSsr.test.js +88 -0
- package/dist/teste/OrgChart.test.d.ts +1 -0
- package/dist/teste/OrgChart.test.js +162 -0
- package/dist/teste/OtpInput.test.d.ts +1 -0
- package/dist/teste/OtpInput.test.js +143 -0
- package/dist/teste/PopoverMaxHeight.test.d.ts +1 -0
- package/dist/teste/PopoverMaxHeight.test.js +38 -0
- package/dist/teste/RichTextEditor.test.d.ts +1 -0
- package/dist/teste/RichTextEditor.test.js +287 -0
- package/dist/teste/RichTextEditorAlinhaImagemTabela.test.d.ts +1 -0
- package/dist/teste/RichTextEditorAlinhaImagemTabela.test.js +212 -0
- package/dist/teste/RichTextEditorEstiloDeTexto.test.d.ts +1 -0
- package/dist/teste/RichTextEditorEstiloDeTexto.test.js +120 -0
- package/dist/teste/SegmentedControlContador.test.d.ts +1 -0
- package/dist/teste/SegmentedControlContador.test.js +39 -0
- package/dist/teste/SelectAbertoControladoEFlutuante.test.d.ts +1 -0
- package/dist/teste/SelectAbertoControladoEFlutuante.test.js +145 -0
- package/dist/teste/SelectFiltroCorETamanho.test.d.ts +1 -0
- package/dist/teste/SelectFiltroCorETamanho.test.js +77 -0
- package/dist/teste/SelectPlacementFiltro.test.d.ts +1 -0
- package/dist/teste/SelectPlacementFiltro.test.js +88 -0
- package/dist/teste/Stack.test.d.ts +1 -0
- package/dist/teste/Stack.test.js +57 -0
- package/dist/teste/StatCardRotuloTopo.test.d.ts +1 -0
- package/dist/teste/StatCardRotuloTopo.test.js +34 -0
- package/dist/teste/StatCardSecundariaETom.test.d.ts +1 -0
- package/dist/teste/StatCardSecundariaETom.test.js +45 -0
- package/dist/teste/TabsContadorFechavel.test.d.ts +1 -0
- package/dist/teste/TabsContadorFechavel.test.js +79 -0
- package/dist/teste/ToastAcaoEDetalhes.test.d.ts +1 -0
- package/dist/teste/ToastAcaoEDetalhes.test.js +94 -0
- package/dist/teste/TooltipDark.test.d.ts +1 -0
- package/dist/teste/TooltipDark.test.js +31 -0
- package/dist/utils/calendario.d.ts +28 -0
- package/dist/utils/calendario.js +73 -0
- package/dist/utils/html-seguro.d.ts +45 -0
- package/dist/utils/html-seguro.js +208 -0
- package/dist/utils/paleta-de-cores.d.ts +26 -0
- package/dist/utils/paleta-de-cores.js +10 -0
- package/dist/utils/texto.d.ts +5 -0
- package/dist/utils/texto.js +5 -0
- package/dist/utils/toast.d.ts +10 -1
- package/dist/utils/toast.js +2 -1
- package/package.json +3 -3
- package/src/index.ts +26 -0
- package/src/teste/AILabel.test.tsx +41 -0
- package/src/teste/AccordionConteudoLivre.test.tsx +39 -0
- package/src/teste/AccordionTituloNeutro.test.tsx +25 -0
- package/src/teste/AppSubheaderRegiao.test.tsx +17 -0
- package/src/teste/AtributosRepassados.test.tsx +73 -0
- package/src/teste/AttachmentCardIA.test.tsx +126 -0
- package/src/teste/AttachmentCardLista.test.tsx +53 -0
- package/src/teste/AttachmentCardSm.test.tsx +29 -0
- package/src/teste/AvatarGroupOverlap.test.tsx +74 -0
- package/src/teste/BadgeNeutroColado.test.tsx +15 -0
- package/src/teste/BadgeTag.test.tsx +85 -0
- package/src/teste/BoxItemFlex.test.tsx +81 -0
- package/src/teste/BoxLayout.test.tsx +50 -0
- package/src/teste/Button.test.tsx +39 -0
- package/src/teste/Calendar.test.tsx +282 -0
- package/src/teste/CalendarCabecalho.test.tsx +11 -0
- package/src/teste/ChipsXs.test.tsx +41 -0
- package/src/teste/Coachmark.test.tsx +198 -0
- package/src/teste/CoachmarkSemVeu.test.tsx +101 -0
- package/src/teste/ColorPicker.test.tsx +153 -0
- package/src/teste/ColorPickerXs.test.tsx +22 -0
- package/src/teste/DataTableArvoreEVariantes.test.tsx +240 -0
- package/src/teste/DataTableCelulaLivre.test.tsx +103 -0
- package/src/teste/DataTableDocumento.test.tsx +102 -0
- package/src/teste/DatePicker.test.tsx +38 -0
- package/src/teste/DescriptionListCompacta.test.tsx +24 -0
- package/src/teste/EmptyStateTituloRico.test.tsx +34 -0
- package/src/teste/FileInputTrigger.test.tsx +89 -0
- package/src/teste/IconPicker.test.tsx +145 -0
- package/src/teste/InputAgrupado.test.tsx +26 -0
- package/src/teste/InputMascaraEAfins.test.tsx +124 -0
- package/src/teste/KbdCodeBlock.test.tsx +106 -0
- package/src/teste/List.test.tsx +269 -0
- package/src/teste/ListItemTooltipStandalone.test.tsx +64 -0
- package/src/teste/ModalVariantes.test.tsx +173 -0
- package/src/teste/NomeAcessivelSsr.test.tsx +110 -0
- package/src/teste/OrgChart.test.tsx +183 -0
- package/src/teste/OtpInput.test.tsx +163 -0
- package/src/teste/PopoverMaxHeight.test.tsx +47 -0
- package/src/teste/RichTextEditor.test.tsx +329 -0
- package/src/teste/RichTextEditorAlinhaImagemTabela.test.tsx +238 -0
- package/src/teste/RichTextEditorEstiloDeTexto.test.tsx +137 -0
- package/src/teste/SegmentedControlContador.test.tsx +43 -0
- package/src/teste/SelectAbertoControladoEFlutuante.test.tsx +180 -0
- package/src/teste/SelectFiltroCorETamanho.test.tsx +90 -0
- package/src/teste/SelectPlacementFiltro.test.tsx +110 -0
- package/src/teste/Stack.test.tsx +80 -0
- package/src/teste/StatCardRotuloTopo.test.tsx +44 -0
- package/src/teste/StatCardSecundariaETom.test.tsx +51 -0
- package/src/teste/TabsContadorFechavel.test.tsx +144 -0
- package/src/teste/ToastAcaoEDetalhes.test.tsx +109 -0
- package/src/teste/TooltipDark.test.tsx +51 -0
- package/src/utils/calendario.ts +78 -0
- package/src/utils/html-seguro.ts +197 -0
- package/src/utils/paleta-de-cores.ts +34 -0
- package/src/utils/texto.ts +5 -0
- package/src/utils/toast.ts +12 -2
|
@@ -154,6 +154,26 @@
|
|
|
154
154
|
outline-offset: -2px;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
/* ── Linha de grupo (prop rowGroup) ──
|
|
158
|
+
Um <th scope="rowgroup"> que atravessa a tabela. Não é clicável nem
|
|
159
|
+
selecionável, então o hover da linha comum não se aplica. */
|
|
160
|
+
.umds-datatable__row--group,
|
|
161
|
+
.umds-datatable__row--group:hover {
|
|
162
|
+
background: var(--umds-semantic-color-background-light); /* #F4F6F9 */
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.umds-datatable__group {
|
|
166
|
+
padding: var(--umds-primitive-spacing-nano) var(--umds-primitive-spacing-xxxs); /* 8px 16px */
|
|
167
|
+
font-size: var(--umds-primitive-font-size-xxxs); /* 12px */
|
|
168
|
+
font-weight: 700;
|
|
169
|
+
text-align: left;
|
|
170
|
+
color: var(--umds-semantic-color-neutral-dark-down); /* #565656 */
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.umds-datatable--compact .umds-datatable__group {
|
|
174
|
+
padding: var(--umds-primitive-spacing-quarck) var(--umds-primitive-spacing-nano); /* 4px 8px */
|
|
175
|
+
}
|
|
176
|
+
|
|
157
177
|
/* ── Células ── */
|
|
158
178
|
.umds-datatable__td {
|
|
159
179
|
padding: var(--umds-primitive-spacing-mini) var(--umds-primitive-spacing-xxxs); /* protótipo --space-3 (12px): candidato a novo token; 16px */
|
|
@@ -192,6 +212,73 @@
|
|
|
192
212
|
padding: var(--umds-primitive-spacing-nano) var(--umds-primitive-spacing-quarck) var(--umds-primitive-spacing-nano) var(--umds-primitive-spacing-nano); /* 6px: candidato a novo token; 4px; 8px */
|
|
193
213
|
}
|
|
194
214
|
|
|
215
|
+
/* ── Cabeçalho escuro (headerVariant="dark") ──
|
|
216
|
+
O navy do CrisDoc, com o texto claro do par `background-dark` / `neutral-light-pure`
|
|
217
|
+
(os dois viram juntos com o tema). Ordenação e foco no cabeçalho escuro usam o
|
|
218
|
+
texto claro, não o azul de ação, que não tem contraste sobre o navy. */
|
|
219
|
+
.umds-datatable--header-dark .umds-datatable__thead {
|
|
220
|
+
background: var(--umds-semantic-color-background-dark);
|
|
221
|
+
border-bottom-color: var(--umds-semantic-color-background-dark);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.umds-datatable--header-dark .umds-datatable__th,
|
|
225
|
+
.umds-datatable--header-dark .umds-datatable__th--sortable:hover,
|
|
226
|
+
.umds-datatable--header-dark .umds-datatable__th--sorted {
|
|
227
|
+
color: var(--umds-semantic-color-neutral-light-pure);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.umds-datatable--header-dark .umds-datatable__sort-icon {
|
|
231
|
+
color: var(--umds-semantic-color-neutral-light-down);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.umds-datatable--header-dark .umds-datatable__sort-icon--active {
|
|
235
|
+
color: inherit;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.umds-datatable--header-dark .umds-datatable__sort-button:focus-visible {
|
|
239
|
+
outline-color: var(--umds-semantic-color-neutral-light-pure);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/* ── Caixa alta no cabeçalho (headerUppercase) ── */
|
|
243
|
+
.umds-datatable--header-uppercase .umds-datatable__th {
|
|
244
|
+
text-transform: uppercase;
|
|
245
|
+
letter-spacing: var(--umds-primitive-font-letter-spacing-wide);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/* ── Cabeçalho só para o leitor de tela (hideHeader) ──
|
|
249
|
+
Visualmente oculto, não removido: as colunas continuam nomeadas. */
|
|
250
|
+
.umds-datatable--header-hidden .umds-datatable__thead {
|
|
251
|
+
position: absolute;
|
|
252
|
+
width: var(--umds-primitive-border-width-hairline);
|
|
253
|
+
height: var(--umds-primitive-border-width-hairline);
|
|
254
|
+
margin: calc(-1 * var(--umds-primitive-border-width-hairline));
|
|
255
|
+
padding: 0;
|
|
256
|
+
overflow: hidden;
|
|
257
|
+
clip-path: inset(50%);
|
|
258
|
+
white-space: nowrap;
|
|
259
|
+
border: 0;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/* ── Zebra (striped) ── */
|
|
263
|
+
.umds-datatable__row--striped,
|
|
264
|
+
.umds-datatable__row--striped.umds-datatable__row--group {
|
|
265
|
+
background: var(--umds-semantic-color-background-light);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.umds-datatable__row--striped:hover {
|
|
269
|
+
background: var(--umds-semantic-color-neutral-light-medium);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.umds-datatable__row--striped.umds-datatable__row--selected {
|
|
273
|
+
background: var(--umds-semantic-color-primary-light);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/* ── Linha destacada (selectedRowKeys / isRowSelected) ──
|
|
277
|
+
Além do fundo, uma barra de 4px à esquerda: o destaque não depende só da cor. */
|
|
278
|
+
.umds-datatable__row--highlighted > :first-child {
|
|
279
|
+
box-shadow: inset var(--umds-primitive-border-width-thick) 0 0 var(--umds-semantic-color-primary-pure);
|
|
280
|
+
}
|
|
281
|
+
|
|
195
282
|
/* ── Estado vazio ── */
|
|
196
283
|
.umds-datatable__td--empty {
|
|
197
284
|
padding: var(--umds-primitive-spacing-md) var(--umds-primitive-spacing-xxxs); /* 48px 16px */
|
|
@@ -213,6 +300,106 @@
|
|
|
213
300
|
color: var(--umds-semantic-color-neutral-light-down); /* #D5D5D5 */
|
|
214
301
|
}
|
|
215
302
|
|
|
303
|
+
.umds-datatable__empty-desc {
|
|
304
|
+
font-size: var(--umds-primitive-font-size-xxxs); /* 12px */
|
|
305
|
+
color: var(--umds-semantic-color-neutral-dark-down);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/* ── Linhas hierárquicas (treeData) ──
|
|
309
|
+
`role="treegrid"`. A primeira coluna de dados leva o recuo por nível, os fios e o
|
|
310
|
+
botão de expandir/recolher. Os fios são colunas de 24px (o passo do recuo) desenhadas
|
|
311
|
+
por trás do conteúdo, de ponta a ponta da célula, então atravessam o padding e se
|
|
312
|
+
emendam de uma linha à outra. */
|
|
313
|
+
.umds-datatable__td--tree {
|
|
314
|
+
position: relative;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.umds-datatable__tree-guides {
|
|
318
|
+
position: absolute;
|
|
319
|
+
top: 0;
|
|
320
|
+
bottom: 0;
|
|
321
|
+
left: var(--umds-primitive-spacing-xxxs);
|
|
322
|
+
display: flex;
|
|
323
|
+
pointer-events: none;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.umds-datatable__guide {
|
|
327
|
+
position: relative;
|
|
328
|
+
flex: 0 0 var(--umds-primitive-spacing-xxs);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.umds-datatable__guide--line::before,
|
|
332
|
+
.umds-datatable__guide--tee::before,
|
|
333
|
+
.umds-datatable__guide--elbow::before {
|
|
334
|
+
content: "";
|
|
335
|
+
position: absolute;
|
|
336
|
+
top: 0;
|
|
337
|
+
bottom: 0;
|
|
338
|
+
left: 50%;
|
|
339
|
+
border-left: var(--umds-primitive-border-width-hairline) solid var(--umds-semantic-color-neutral-light-down);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.umds-datatable__guide--elbow::before {
|
|
343
|
+
bottom: 50%;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.umds-datatable__guide--tee::after,
|
|
347
|
+
.umds-datatable__guide--elbow::after {
|
|
348
|
+
content: "";
|
|
349
|
+
position: absolute;
|
|
350
|
+
top: 50%;
|
|
351
|
+
left: 50%;
|
|
352
|
+
right: 0;
|
|
353
|
+
border-top: var(--umds-primitive-border-width-hairline) solid var(--umds-semantic-color-neutral-light-down);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.umds-datatable__tree-content {
|
|
357
|
+
position: relative;
|
|
358
|
+
display: flex;
|
|
359
|
+
align-items: center;
|
|
360
|
+
gap: var(--umds-primitive-spacing-quarck);
|
|
361
|
+
min-width: 0;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.umds-datatable__tree-text {
|
|
365
|
+
min-width: 0;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.umds-datatable__tree-toggle,
|
|
369
|
+
.umds-datatable__tree-spacer {
|
|
370
|
+
flex: 0 0 var(--umds-primitive-spacing-xxs);
|
|
371
|
+
width: var(--umds-primitive-spacing-xxs);
|
|
372
|
+
height: var(--umds-primitive-spacing-xxs);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.umds-datatable__tree-toggle {
|
|
376
|
+
display: inline-flex;
|
|
377
|
+
align-items: center;
|
|
378
|
+
justify-content: center;
|
|
379
|
+
margin: 0;
|
|
380
|
+
padding: 0;
|
|
381
|
+
border: none;
|
|
382
|
+
border-radius: var(--umds-primitive-border-radius-sm);
|
|
383
|
+
background: none;
|
|
384
|
+
color: var(--umds-semantic-color-neutral-dark-down);
|
|
385
|
+
cursor: pointer;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.umds-datatable__tree-toggle:hover {
|
|
389
|
+
background: var(--umds-semantic-color-neutral-light-medium);
|
|
390
|
+
color: var(--umds-semantic-color-neutral-dark-pure);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.umds-datatable__tree-toggle:focus-visible {
|
|
394
|
+
outline: 2px solid var(--umds-semantic-color-primary-pure);
|
|
395
|
+
outline-offset: 2px;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.umds-datatable--tree .umds-datatable__row:focus-visible {
|
|
399
|
+
outline: 2px solid var(--umds-semantic-color-primary-pure);
|
|
400
|
+
outline-offset: -2px;
|
|
401
|
+
}
|
|
402
|
+
|
|
216
403
|
/* ── Skeleton ── */
|
|
217
404
|
.umds-datatable__skeleton {
|
|
218
405
|
height: 16px;
|
|
@@ -237,3 +424,70 @@
|
|
|
237
424
|
0% { background-position: 200% 0; }
|
|
238
425
|
100% { background-position: -200% 0; }
|
|
239
426
|
}
|
|
427
|
+
|
|
428
|
+
/* ── Variante document (variant="document") ──
|
|
429
|
+
Tabela de CONTEÚDO de documento (itens de nota, cotações): lê-se e imprime-se,
|
|
430
|
+
não se opera. Sem hover, sem cursor, sem cabeçalho grudado; grade de bordas
|
|
431
|
+
finas em todas as células, como no papel. Na impressão o cabeçalho se repete
|
|
432
|
+
a cada página e uma linha nunca é cortada ao meio. */
|
|
433
|
+
.umds-datatable--document {
|
|
434
|
+
border: none;
|
|
435
|
+
border-radius: var(--umds-primitive-border-radius-none);
|
|
436
|
+
background: transparent;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
.umds-datatable--document .umds-datatable__table {
|
|
440
|
+
border: var(--umds-primitive-border-width-hairline) solid var(--umds-semantic-color-neutral-light-medium);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.umds-datatable--document .umds-datatable__thead {
|
|
444
|
+
position: static;
|
|
445
|
+
border-bottom: none;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.umds-datatable--document .umds-datatable__th,
|
|
449
|
+
.umds-datatable--document .umds-datatable__td {
|
|
450
|
+
border: var(--umds-primitive-border-width-hairline) solid var(--umds-semantic-color-neutral-light-medium);
|
|
451
|
+
vertical-align: top;
|
|
452
|
+
user-select: auto;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.umds-datatable--document .umds-datatable__th {
|
|
456
|
+
font-size: var(--umds-primitive-font-size-xxs); /* 14px: no papel o cabeçalho é lido, não escaneado */
|
|
457
|
+
white-space: normal;
|
|
458
|
+
color: var(--umds-semantic-color-neutral-dark-pure);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.umds-datatable--document .umds-datatable__row,
|
|
462
|
+
.umds-datatable--document .umds-datatable__row:hover {
|
|
463
|
+
background: transparent;
|
|
464
|
+
border-bottom: none;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.umds-datatable--document .umds-datatable__td {
|
|
468
|
+
overflow-wrap: anywhere;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/* Compacto na tabela de documento: fonte de 12px (a menor da escala) e célula de 4px × 8px. */
|
|
472
|
+
.umds-datatable--document.umds-datatable--compact .umds-datatable__th,
|
|
473
|
+
.umds-datatable--document.umds-datatable--compact .umds-datatable__td {
|
|
474
|
+
padding: var(--umds-primitive-spacing-quarck) var(--umds-primitive-spacing-nano);
|
|
475
|
+
font-size: var(--umds-primitive-font-size-xxxs);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
@media print {
|
|
479
|
+
.umds-datatable--document {
|
|
480
|
+
overflow-x: visible;
|
|
481
|
+
-webkit-print-color-adjust: exact;
|
|
482
|
+
print-color-adjust: exact;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
.umds-datatable--document .umds-datatable__thead {
|
|
486
|
+
display: table-header-group;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.umds-datatable--document .umds-datatable__row {
|
|
490
|
+
break-inside: avoid;
|
|
491
|
+
page-break-inside: avoid;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
@@ -7,8 +7,10 @@ import './DataTable.css';
|
|
|
7
7
|
* @property {string} width - Largura fixa da coluna (ex.: "120px")
|
|
8
8
|
* @property {string} align - Alinhamento do conteúdo: 'left' | 'center' | 'right'
|
|
9
9
|
* @property {function} render - Renderização customizada da célula: recebe a linha e o
|
|
10
|
-
* índice e retorna o conteúdo
|
|
11
|
-
*
|
|
10
|
+
* índice e retorna o conteúdo. No React devolve qualquer nó (badge, avatar, botão).
|
|
11
|
+
* No Vue o retorno é tratado como TEXTO: para célula com markup use o slot
|
|
12
|
+
* `#cell-<key>` (recebe `{ row, value, rowIndex }`), que vale sobre o `render`.
|
|
13
|
+
* Sem `render` nem slot, a célula exibe `row[key]`.
|
|
12
14
|
*/
|
|
13
15
|
export interface DataTableColumn {
|
|
14
16
|
key: string;
|
|
@@ -32,7 +34,36 @@ export interface DataTableColumn {
|
|
|
32
34
|
* (selectedKeys/onSelectKeys) em vez de índice — sobrevive a paginação e ordenação.
|
|
33
35
|
* @property {Array<string|number>} selectedKeys - Chaves das linhas selecionadas (controlado;
|
|
34
36
|
* requer rowKey)
|
|
35
|
-
* @property {string}
|
|
37
|
+
* @property {string} variant - 'default' (tabela de interface) | 'document' (tabela de CONTEÚDO de documento: sem ordenação, seleção nem clique de linha, bordas finas, cabeçalho repetido e linha inteira por página na impressão)
|
|
38
|
+
* @property {string} density - Densidade das células: 'default' | 'compact'. Com `variant="document"`,
|
|
39
|
+
* o compacto também leva a fonte a 12px (a escala do DS não tem 13px).
|
|
40
|
+
* @property {string} headerVariant - Cabeçalho: 'default' (claro) | 'dark' (navy, texto claro; o cabeçalho
|
|
41
|
+
* escuro do CrisDoc). Cores pelos tokens `background-dark` e `neutral-light-pure`, então o tema acompanha.
|
|
42
|
+
* @property {boolean} headerUppercase - Rótulos do cabeçalho em caixa alta. Opt-in; vale para qualquer
|
|
43
|
+
* `headerVariant`.
|
|
44
|
+
* @property {boolean} striped - Zebra: as linhas ímpares (a segunda, a quarta…) ganham o fundo claro.
|
|
45
|
+
* @property {Array<string|number>} selectedRowKeys - Chaves das linhas DESTACADAS (requer rowKey). Só
|
|
46
|
+
* destaque visual (fundo, barra à esquerda e `aria-selected`), sem checkbox: serve à linha "aberta" de
|
|
47
|
+
* uma lista mestre-detalhe. Não confunda com `selectedKeys`, que é a seleção por checkbox.
|
|
48
|
+
* @property {function} isRowSelected - Destaque por função `(row, rowIndex) => boolean`, com o mesmo
|
|
49
|
+
* efeito de `selectedRowKeys`. Use quando a regra não cabe numa lista de chaves.
|
|
50
|
+
* @property {IconProp} emptyIcon - Ícone do estado vazio (objeto Font Awesome importado). Padrão: `faInbox`.
|
|
51
|
+
* @property {string} emptyDescription - Texto de apoio abaixo da `emptyMessage` do estado vazio
|
|
52
|
+
* @property {boolean} hideHeader - Esconde o cabeçalho SÓ NA TELA: as colunas continuam nomeadas para o
|
|
53
|
+
* leitor de tela (a linha de cabeçalho fica visualmente oculta, não removida)
|
|
54
|
+
* @property {boolean} treeData - Linhas hierárquicas: cada linha pode ter filhas em `row[childrenKey]`.
|
|
55
|
+
* A tabela vira `role="treegrid"` (`aria-level`, `aria-posinset`, `aria-setsize`, `aria-expanded` nas
|
|
56
|
+
* linhas), a primeira coluna ganha recuo por nível, fios e o botão de expandir/recolher. Teclado: ↓ ↑ andam
|
|
57
|
+
* entre as linhas visíveis, → expande (ou desce à primeira filha), ← recolhe (ou sobe ao pai), Home e End.
|
|
58
|
+
* Com `treeData`, `onRowClick`, `onSelect` e os índices dos callbacks contam as linhas VISÍVEIS.
|
|
59
|
+
* @property {string} childrenKey - Campo com as linhas filhas. Padrão: 'children'
|
|
60
|
+
* @property {Array<string|number>} expandedKeys - Chaves das linhas expandidas (controlado). A chave é o
|
|
61
|
+
* `rowKey` da linha; sem `rowKey`, o caminho de índices ("0", "0.1")
|
|
62
|
+
* @property {Array<string|number>} defaultExpandedKeys - Chaves expandidas na abertura (não controlado)
|
|
63
|
+
* @property {boolean} defaultExpandAll - Abre a árvore toda na primeira renderização (não controlado)
|
|
64
|
+
* @property {function} onExpand - Callback ao expandir ou recolher: `(chavesExpandidas, linha, expandida)`
|
|
65
|
+
* @property {string} expandLabel - Nome acessível do botão de expandir. Troque para traduzir.
|
|
66
|
+
* @property {string} collapseLabel - Nome acessível do botão de recolher. Troque para traduzir.
|
|
36
67
|
* @property {string} sortKey - Chave da coluna atualmente ordenada
|
|
37
68
|
* @property {string} sortDirection - Direção da ordenação: 'asc' | 'desc'
|
|
38
69
|
* @property {number} skeletonRows - Número de linhas skeleton exibidas no loading
|
|
@@ -42,8 +73,16 @@ export interface DataTableColumn {
|
|
|
42
73
|
* @property {function} onSelectKeys - Callback ao alterar a seleção por chave (requer rowKey)
|
|
43
74
|
* @property {function} onRowClick - Callback ao clicar numa linha (recebe índice e a linha);
|
|
44
75
|
* cliques no checkbox de seleção não disparam
|
|
45
|
-
* @
|
|
46
|
-
*
|
|
76
|
+
* @property {string|function} rowGroup - Agrupa linhas consecutivas: nome do campo ou função
|
|
77
|
+
* (row, rowIndex) => rótulo. Antes da primeira linha de cada grupo entra uma linha de
|
|
78
|
+
* grupo (`<th scope="rowgroup">` ocupando a largura toda). Linha sem rótulo não abre grupo.
|
|
79
|
+
* A tabela não reordena: ordene `data` por grupo antes de passar.
|
|
80
|
+
* @property {function} renderRowGroup - Conteúdo da linha de grupo: (label, row, rowIndex) => nó.
|
|
81
|
+
* Só no React. No Vue use o slot `#row-group` (recebe `{ label, row, rowIndex }`).
|
|
82
|
+
* @slot cell-<key> - Só no Vue. Célula livre da coluna `<key>`: `<template #cell-nome="{ row, value, rowIndex }">`.
|
|
83
|
+
* @slot row-group - Só no Vue. Conteúdo da linha de grupo: `{ label, row, rowIndex }`.
|
|
84
|
+
* @quandoUsar Dados TABULARES que se comparam coluna a coluna, com ordenação, seleção e paginação. Semântica de tabela para leitor de tela. Com `variant="document"`, a tabela que faz parte do TEXTO de um documento que se imprime (itens de nota, cotações): sem interação, com bordas finas e quebra de página que não corta linha.
|
|
85
|
+
* @quandoNaoUsar Para hierarquia pai-filho SEM colunas (navegação, seleção de pastas) — use `Tree`; com colunas de dado por linha, use `treeData`. Para cards em grade sem comparação coluna a coluna, use `Grid` com `Card`. Para pares rótulo/valor de um documento (sem cabeçalho de coluna), use `DescriptionList`.
|
|
47
86
|
*/
|
|
48
87
|
export interface DataTableProps {
|
|
49
88
|
columns: DataTableColumn[];
|
|
@@ -53,8 +92,44 @@ export interface DataTableProps {
|
|
|
53
92
|
selectable?: boolean;
|
|
54
93
|
selectedRows?: number[];
|
|
55
94
|
rowKey?: string | ((row: Record<string, any>) => string | number);
|
|
95
|
+
rowGroup?: string | ((row: Record<string, any>, rowIndex: number) => string | undefined);
|
|
96
|
+
renderRowGroup?: (label: string, row: Record<string, any>, rowIndex: number) => any;
|
|
56
97
|
selectedKeys?: Array<string | number>;
|
|
98
|
+
/** `document`: tabela de conteúdo de documento, imprimível e sem interação. @default 'default' */
|
|
99
|
+
variant?: "default" | "document";
|
|
57
100
|
density?: "default" | "compact";
|
|
101
|
+
/** `dark`: cabeçalho navy com texto claro (o do CrisDoc). @default 'default' */
|
|
102
|
+
headerVariant?: "default" | "dark";
|
|
103
|
+
/** Rótulos do cabeçalho em caixa alta. @default false */
|
|
104
|
+
headerUppercase?: boolean;
|
|
105
|
+
/** Zebra nas linhas ímpares. @default false */
|
|
106
|
+
striped?: boolean;
|
|
107
|
+
/** Chaves das linhas destacadas (só visual, sem checkbox; requer `rowKey`). */
|
|
108
|
+
selectedRowKeys?: Array<string | number>;
|
|
109
|
+
/** Destaque de linha por função `(row, rowIndex) => boolean`. */
|
|
110
|
+
isRowSelected?: (row: Record<string, any>, rowIndex: number) => boolean;
|
|
111
|
+
/** Ícone do estado vazio (objeto Font Awesome importado). @default faInbox */
|
|
112
|
+
emptyIcon?: IconProp;
|
|
113
|
+
/** Texto de apoio abaixo de `emptyMessage`. */
|
|
114
|
+
emptyDescription?: string;
|
|
115
|
+
/** Esconde o cabeçalho só na tela; o leitor de tela continua lendo as colunas. @default false */
|
|
116
|
+
hideHeader?: boolean;
|
|
117
|
+
/** Linhas hierárquicas (`role="treegrid"`), com filhas em `row[childrenKey]`. @default false */
|
|
118
|
+
treeData?: boolean;
|
|
119
|
+
/** Campo das linhas filhas. @default 'children' */
|
|
120
|
+
childrenKey?: string;
|
|
121
|
+
/** Chaves das linhas expandidas (controlado). */
|
|
122
|
+
expandedKeys?: Array<string | number>;
|
|
123
|
+
/** Chaves expandidas na abertura (não controlado). */
|
|
124
|
+
defaultExpandedKeys?: Array<string | number>;
|
|
125
|
+
/** Abre a árvore toda na abertura (não controlado). @default false */
|
|
126
|
+
defaultExpandAll?: boolean;
|
|
127
|
+
/** Ao expandir ou recolher: `(chavesExpandidas, linha, expandida)`. */
|
|
128
|
+
onExpand?: (expandedKeys: Array<string | number>, row: Record<string, any>, expanded: boolean) => void;
|
|
129
|
+
/** Nome acessível do botão de expandir. Troque para traduzir. @default 'Expandir' */
|
|
130
|
+
expandLabel?: string;
|
|
131
|
+
/** Nome acessível do botão de recolher. Troque para traduzir. @default 'Recolher' */
|
|
132
|
+
collapseLabel?: string;
|
|
58
133
|
sortKey?: string;
|
|
59
134
|
sortDirection?: "asc" | "desc";
|
|
60
135
|
skeletonRows?: number;
|
|
@@ -68,5 +143,6 @@ export interface DataTableProps {
|
|
|
68
143
|
/** Nome acessível do checkbox de cada linha. Recebe o número da linha (a partir de 1). Troque para traduzir. @default (rowNumber) => 'Selecionar linha ' + rowNumber */
|
|
69
144
|
selectRowLabel?: (rowNumber: number) => string;
|
|
70
145
|
}
|
|
146
|
+
import { IconProp } from "../Icon/Icon";
|
|
71
147
|
declare function DataTable(props: DataTableProps): import("react/jsx-runtime").JSX.Element;
|
|
72
148
|
export default DataTable;
|