@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './Tag.css';
|
|
2
2
|
/**
|
|
3
3
|
* Componente Tag para exibir rótulos, categorias e seleções.
|
|
4
|
-
* Suporta aparências outlined/solid,
|
|
4
|
+
* Suporta aparências outlined/solid/soft, 4 tamanhos, formato pílula e ícones opcionais.
|
|
5
5
|
* Ideal para uso em multi-select, filtros e categorização.
|
|
6
6
|
* @quandoUsar Rótulo ESTÁTICO que classifica ou dá status a um item: categoria de um processo, estado ("Em andamento"), prioridade. É leitura, não controle.
|
|
7
7
|
* @quandoNaoUsar Quando o usuário pode remover o item ou alternar a seleção — use `Chips`. Para contagem numérica sobreposta a um ícone, use `Badge`.
|
|
@@ -16,22 +16,29 @@ export interface TagProps {
|
|
|
16
16
|
*/
|
|
17
17
|
label?: string;
|
|
18
18
|
/**
|
|
19
|
-
* Estilo visual da tag.
|
|
19
|
+
* Estilo visual da tag. `soft` é o fundo claro da cor da variante, sem
|
|
20
|
+
* contorno (setores, perfil, "Publicado", "Dado simulado").
|
|
20
21
|
* @default 'outlined'
|
|
21
22
|
*/
|
|
22
|
-
appearance?: "outlined" | "solid";
|
|
23
|
+
appearance?: "outlined" | "solid" | "soft";
|
|
24
|
+
/**
|
|
25
|
+
* Formato de pílula (cantos totalmente arredondados).
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
pill?: boolean;
|
|
23
29
|
/**
|
|
24
30
|
* Variante semântica de cor (paridade com o Badge) — para tag de STATUS
|
|
25
31
|
* (achado mobile/prefeitura: sem isso, status exigia trocar para Badge).
|
|
26
32
|
* 'neutral' mantém o visual atual.
|
|
27
33
|
* @default 'neutral'
|
|
28
34
|
*/
|
|
29
|
-
variant?: "neutral" | "primary" | "positive" | "negative" | "info";
|
|
35
|
+
variant?: "neutral" | "primary" | "positive" | "negative" | "info" | "new";
|
|
30
36
|
/**
|
|
31
|
-
* Tamanho da tag.
|
|
37
|
+
* Tamanho da tag. `xs` é a compacta de 18px (`line-height: 1`), para linha
|
|
38
|
+
* de lista e card; `sm` continua com 27px.
|
|
32
39
|
* @default 'md'
|
|
33
40
|
*/
|
|
34
|
-
size?: "sm" | "md" | "lg";
|
|
41
|
+
size?: "xs" | "sm" | "md" | "lg";
|
|
35
42
|
/**
|
|
36
43
|
* Ícone Font Awesome exibido à esquerda do label.
|
|
37
44
|
*/
|
|
@@ -77,7 +77,7 @@ function Text(props) {
|
|
|
77
77
|
.filter(Boolean)
|
|
78
78
|
.join(" ");
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function estiloInline() {
|
|
81
81
|
const styles = {};
|
|
82
82
|
if (props.maxLines) {
|
|
83
83
|
styles["--umds-text-max-lines"] = String(props.maxLines);
|
|
@@ -98,6 +98,6 @@ function Text(props) {
|
|
|
98
98
|
}
|
|
99
99
|
return out;
|
|
100
100
|
}
|
|
101
|
-
return (_jsxs(_Fragment, { children: [elementTag() === "h1" ? (_jsx("h1", { id: props.id, style:
|
|
101
|
+
return (_jsxs(_Fragment, { children: [elementTag() === "h1" ? (_jsx("h1", { id: props.id, style: estiloInline(), ...htmlAttrs(), className: classes(), children: props.children })) : null, elementTag() === "h2" ? (_jsx("h2", { id: props.id, style: estiloInline(), ...htmlAttrs(), className: classes(), children: props.children })) : null, elementTag() === "h3" ? (_jsx("h3", { id: props.id, style: estiloInline(), ...htmlAttrs(), className: classes(), children: props.children })) : null, elementTag() === "h4" ? (_jsx("h4", { id: props.id, style: estiloInline(), ...htmlAttrs(), className: classes(), children: props.children })) : null, elementTag() === "h5" ? (_jsx("h5", { id: props.id, style: estiloInline(), ...htmlAttrs(), className: classes(), children: props.children })) : null, elementTag() === "h6" ? (_jsx("h6", { id: props.id, style: estiloInline(), ...htmlAttrs(), className: classes(), children: props.children })) : null, elementTag() === "p" ? (_jsx("p", { id: props.id, style: estiloInline(), ...htmlAttrs(), className: classes(), children: props.children })) : null, elementTag() === "span" ? (_jsx("span", { id: props.id, style: estiloInline(), ...htmlAttrs(), className: classes(), children: props.children })) : null, elementTag() === "label" ? (_jsx("label", { htmlFor: props.forId, id: props.id, style: estiloInline(), ...htmlAttrs(), className: classes(), children: props.children })) : null, elementTag() === "div" ? (_jsx("div", { id: props.id, style: estiloInline(), ...htmlAttrs(), className: classes(), children: props.children })) : null] }));
|
|
102
102
|
}
|
|
103
103
|
export default Text;
|
|
@@ -128,6 +128,14 @@
|
|
|
128
128
|
resize: none;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
/* Somente leitura não é desabilitado: o texto segue lido e a WCAG 1.4.3 vale
|
|
132
|
+
sem isenção. O placeholder padrão foi calibrado para fundo branco e cai para
|
|
133
|
+
~4,2:1 sobre o fundo de somente leitura; neutral-dark-down passa 4,5:1 em
|
|
134
|
+
todos os temas (1doc 6,78:1 · 1doc-dark 10,83:1 · alto contraste 16,48:1). */
|
|
135
|
+
.umds-textarea--readonly .umds-textarea__control::placeholder {
|
|
136
|
+
color: var(--umds-semantic-color-neutral-dark-down);
|
|
137
|
+
}
|
|
138
|
+
|
|
131
139
|
/* Footer (Helper/Error + Counter) */
|
|
132
140
|
.umds-textarea__footer {
|
|
133
141
|
display: flex;
|
|
@@ -297,6 +297,14 @@
|
|
|
297
297
|
border-color: var(--umds-semantic-field-border-default);
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
+
/* Somente leitura não é desabilitado: o texto segue lido e a WCAG 1.4.3 vale
|
|
301
|
+
sem isenção. O placeholder padrão foi calibrado para fundo branco e cai para
|
|
302
|
+
~4,2:1 sobre o fundo de somente leitura; neutral-dark-down passa 4,5:1 em
|
|
303
|
+
todos os temas (1doc 6,78:1 · 1doc-dark 10,83:1 · alto contraste 16,48:1). */
|
|
304
|
+
.umds-timepicker--readonly .umds-timepicker__placeholder {
|
|
305
|
+
color: var(--umds-semantic-color-neutral-dark-down);
|
|
306
|
+
}
|
|
307
|
+
|
|
300
308
|
/* ── Alto contraste ──
|
|
301
309
|
O traço do painel é neutral-light-medium — #5A5A5A neste tema, 3:1 sobre o
|
|
302
310
|
preto. As superfícies flutuantes do tema usam a borda branca
|
|
@@ -123,6 +123,38 @@
|
|
|
123
123
|
line-height: 1.5;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
/* ── Detalhes (details) e ação (actionLabel) ── */
|
|
127
|
+
.umds-toast__details {
|
|
128
|
+
margin: 0;
|
|
129
|
+
padding-left: var(--umds-primitive-spacing-xxxs); /* 16px */
|
|
130
|
+
font-size: var(--umds-primitive-font-size-xxxs); /* 12px */
|
|
131
|
+
line-height: 1.5;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.umds-toast__action {
|
|
135
|
+
align-self: flex-start;
|
|
136
|
+
display: inline-flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
/* Alvo mínimo de 24px (WCAG 2.5.8). */
|
|
139
|
+
min-height: var(--umds-primitive-spacing-xxs);
|
|
140
|
+
margin: 0;
|
|
141
|
+
padding: 0;
|
|
142
|
+
border: none;
|
|
143
|
+
background: none;
|
|
144
|
+
color: inherit;
|
|
145
|
+
font-family: inherit;
|
|
146
|
+
font-size: var(--umds-primitive-font-size-xxxs); /* 12px */
|
|
147
|
+
font-weight: var(--umds-primitive-font-weight-bold);
|
|
148
|
+
text-decoration: underline;
|
|
149
|
+
cursor: pointer;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.umds-toast__action:focus-visible {
|
|
153
|
+
outline: 2px solid currentColor;
|
|
154
|
+
outline-offset: 2px;
|
|
155
|
+
border-radius: var(--umds-primitive-border-radius-xs);
|
|
156
|
+
}
|
|
157
|
+
|
|
126
158
|
/* ── Fechar ── */
|
|
127
159
|
.umds-toast__close {
|
|
128
160
|
display: flex;
|
|
@@ -4,6 +4,12 @@ import './Toast.css';
|
|
|
4
4
|
* na raiz do documento (não fica presa ao overflow do elemento pai).
|
|
5
5
|
* Comunica o resultado de uma ação (sucesso, erro, aviso ou informação) e pode
|
|
6
6
|
* fechar automaticamente após um tempo.
|
|
7
|
+
*
|
|
8
|
+
* Com `actionLabel` e `onAction`, o toast ganha uma ação ("Desfazer", "Ver * processo"): um botão depois do texto. Acioná-la chama `onAction` e fecha o
|
|
9
|
+
* toast. Toast com ação não deve sumir sozinho antes de dar tempo de agir
|
|
10
|
+
* (WCAG 2.2.1): no `toast()` imperativo o padrão passa a ser `duration: 0`, e no
|
|
11
|
+
* declarativo vale o que você passar. `details` é uma lista de linhas
|
|
12
|
+
* curtas abaixo da descrição (o que deu errado, item a item).
|
|
7
13
|
* @quandoUsar Retorno TRANSITÓRIO e não-bloqueante de uma ação recém-executada: "Processo salvo", "Link copiado". Aparece sobreposto e some sozinho.
|
|
8
14
|
* @quandoNaoUsar Para mensagem que precisa continuar visível ou ser relida — use `Alert`. Para erro que impede o usuário de prosseguir, use `Alert` junto ao campo.
|
|
9
15
|
*/
|
|
@@ -28,6 +34,18 @@ export interface ToastProps {
|
|
|
28
34
|
* Descrição adicional exibida abaixo da mensagem.
|
|
29
35
|
*/
|
|
30
36
|
description?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Lista de detalhes, uma linha por item, abaixo da descrição ("Anexo 3 acima * de 10 MB", "Despacho sem assunto").
|
|
39
|
+
*/
|
|
40
|
+
details?: string[];
|
|
41
|
+
/**
|
|
42
|
+
* Rótulo do botão de ação ("Desfazer"). O botão só aparece com `onAction`.
|
|
43
|
+
*/
|
|
44
|
+
actionLabel?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Chamado ao acionar o botão de ação. Depois dele o toast fecha (`onClose`).
|
|
47
|
+
*/
|
|
48
|
+
onAction?: (event?: any) => void;
|
|
31
49
|
/**
|
|
32
50
|
* Posição na tela onde o toast é fixado.
|
|
33
51
|
* @default 'top-right'
|
|
@@ -31,6 +31,19 @@ function Toast(props) {
|
|
|
31
31
|
return faCircleXmark;
|
|
32
32
|
return faCircleInfo;
|
|
33
33
|
}
|
|
34
|
+
function detailList() {
|
|
35
|
+
return props.details || [];
|
|
36
|
+
}
|
|
37
|
+
function hasAction() {
|
|
38
|
+
return !!(props.actionLabel && props.onAction);
|
|
39
|
+
}
|
|
40
|
+
function handleAction(event) {
|
|
41
|
+
if (event)
|
|
42
|
+
event.stopPropagation();
|
|
43
|
+
if (props.onAction)
|
|
44
|
+
props.onAction(event);
|
|
45
|
+
handleClose(event);
|
|
46
|
+
}
|
|
34
47
|
function handleClose(event) {
|
|
35
48
|
if (event)
|
|
36
49
|
event.stopPropagation();
|
|
@@ -58,6 +71,6 @@ function Toast(props) {
|
|
|
58
71
|
}
|
|
59
72
|
};
|
|
60
73
|
}, []);
|
|
61
|
-
return (_jsx(Portal, { container: props.portalContainer, children: _jsx("div", { role: liveRole(), "aria-live": ariaLive(), children: props.open ? (_jsxs("div", { className: toastClasses(), children: [_jsx("div", { className: "umds-toast__icon-wrap", children: _jsx("span", { "aria-hidden": "true", className: "umds-toast__icon", children: _jsx(Icon, { variant: "inherit", customSize: "14px", icon: iconName() }) }) }), _jsxs("div", { className: "umds-toast__body", children: [_jsx("span", { className: "umds-toast__message", children: props.message }), props.description ? (_jsx("span", { className: "umds-toast__description", children: props.description })) : null] }), props.closable !== false ? (_jsx("button", { type: "button", className: "umds-toast__close", onClick: (event) => handleClose(event), "aria-label": props.closeLabel || "Fechar notificação", children: _jsx(Icon, { variant: "inherit", customSize: "18px", icon: faXmark }) })) : null] })) : null }) }));
|
|
74
|
+
return (_jsx(Portal, { container: props.portalContainer, children: _jsx("div", { role: liveRole(), "aria-live": ariaLive(), children: props.open ? (_jsxs("div", { className: toastClasses(), children: [_jsx("div", { className: "umds-toast__icon-wrap", children: _jsx("span", { "aria-hidden": "true", className: "umds-toast__icon", children: _jsx(Icon, { variant: "inherit", customSize: "14px", icon: iconName() }) }) }), _jsxs("div", { className: "umds-toast__body", children: [_jsx("span", { className: "umds-toast__message", children: props.message }), props.description ? (_jsx("span", { className: "umds-toast__description", children: props.description })) : null, detailList().length > 0 ? (_jsx("ul", { className: "umds-toast__details", children: detailList()?.map((detalhe) => (_jsx("li", { children: detalhe }, detalhe))) })) : null, hasAction() ? (_jsx("button", { type: "button", className: "umds-toast__action", onClick: (event) => handleAction(event), children: props.actionLabel })) : null] }), props.closable !== false ? (_jsx("button", { type: "button", className: "umds-toast__close", onClick: (event) => handleClose(event), "aria-label": props.closeLabel || "Fechar notificação", children: _jsx(Icon, { variant: "inherit", customSize: "18px", icon: faXmark }) })) : null] })) : null }) }));
|
|
62
75
|
}
|
|
63
76
|
export default Toast;
|
|
@@ -17,6 +17,13 @@ function ToastStack(props) {
|
|
|
17
17
|
.filter(Boolean)
|
|
18
18
|
.join(" ");
|
|
19
19
|
}
|
|
20
|
+
function actionLabelOf(item) {
|
|
21
|
+
return item.onAction ? item.actionLabel : undefined;
|
|
22
|
+
}
|
|
23
|
+
function handleItemAction(item) {
|
|
24
|
+
if (item.onAction)
|
|
25
|
+
item.onAction();
|
|
26
|
+
}
|
|
20
27
|
function handleItemClose(id) {
|
|
21
28
|
dismissToast(id);
|
|
22
29
|
}
|
|
@@ -33,6 +40,6 @@ function ToastStack(props) {
|
|
|
33
40
|
}
|
|
34
41
|
};
|
|
35
42
|
}, []);
|
|
36
|
-
return (_jsx("div", { ref: stackRef, className: stackClasses(), children: items?.map((item) => (_jsx(Toast, { open: true, message: item.message, description: item.description, variant: item.variant, duration: item.duration, closable: item.closable, portalContainer: stackRef.current, onClose: (event) => handleItemClose(item.id) }, item.id))) }));
|
|
43
|
+
return (_jsx("div", { ref: stackRef, className: stackClasses(), children: items?.map((item) => (_jsx(Toast, { open: true, message: item.message, description: item.description, details: item.details, actionLabel: actionLabelOf(item), onAction: (event) => handleItemAction(item), variant: item.variant, duration: item.duration, closable: item.closable, portalContainer: stackRef.current, onClose: (event) => handleItemClose(item.id) }, item.id))) }));
|
|
37
44
|
}
|
|
38
45
|
export default ToastStack;
|
|
@@ -153,6 +153,31 @@
|
|
|
153
153
|
bottom: 12px;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
/* ── variant="dark": balão compacto escuro ──
|
|
157
|
+
background-dark é a superfície invertida do tema (azul-marinho no claro, claro
|
|
158
|
+
no escuro, branco no alto contraste) e neutral-light-pure o texto sobre ela.
|
|
159
|
+
Fonte de 12px (a escala do DS não tem o 11px do CrisDoc). */
|
|
160
|
+
.umds-tooltip__floating--dark {
|
|
161
|
+
max-width: 220px; /* quebra do CrisDoc; maxWidth sobrescreve */
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.umds-tooltip__bubble--dark {
|
|
165
|
+
padding: var(--umds-primitive-spacing-quarck) var(--umds-primitive-spacing-nano);
|
|
166
|
+
border-radius: var(--umds-primitive-border-radius-xs); /* 4px */
|
|
167
|
+
background-color: var(--umds-semantic-color-background-dark);
|
|
168
|
+
color: var(--umds-semantic-color-neutral-light-pure);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.umds-tooltip__bubble--dark .umds-tooltip__title,
|
|
172
|
+
.umds-tooltip__bubble--dark .umds-tooltip__content {
|
|
173
|
+
color: var(--umds-semantic-color-neutral-light-pure);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.umds-tooltip__bubble--dark .umds-tooltip__arrow {
|
|
177
|
+
background-color: var(--umds-semantic-color-background-dark);
|
|
178
|
+
border-color: var(--umds-semantic-color-background-dark);
|
|
179
|
+
}
|
|
180
|
+
|
|
156
181
|
/* ── Alto contraste ──
|
|
157
182
|
O balão usa neutral-light-pure, que neste tema é preto como a página, e a
|
|
158
183
|
sombra não aparece: sem traço o balão some. Outline para dentro (não
|
|
@@ -13,6 +13,17 @@ export interface TooltipProps {
|
|
|
13
13
|
side?: "top" | "bottom" | "left" | "right";
|
|
14
14
|
/** Alinhamento no eixo cruzado: "center" usa só o `side`; "start"/"end" viram placements compostos (`top-start`, `right-end`…). */
|
|
15
15
|
align?: "start" | "center" | "end";
|
|
16
|
+
/**
|
|
17
|
+
* Aparência do balão. `dark` é o compacto escuro (fundo `background-dark`,
|
|
18
|
+
* texto `neutral-light-pure`, padding 4/8, raio 4, no máximo 220px de
|
|
19
|
+
* largura): o balão de ícone, sigla e botão de barra de ferramentas. Os dois
|
|
20
|
+
* tokens são o par invertido do tema, então o contraste vale nos claros,
|
|
21
|
+
* escuro e alto contraste.
|
|
22
|
+
* @default 'default'
|
|
23
|
+
*/
|
|
24
|
+
variant?: "default" | "dark";
|
|
25
|
+
/** Largura máxima do balão, qualquer valor CSS (`"220px"`, `"20rem"`). Vence o teto de cada variante (280px no padrão, 220px no dark). */
|
|
26
|
+
maxWidth?: string;
|
|
16
27
|
sideOffset?: number;
|
|
17
28
|
delayDuration?: number;
|
|
18
29
|
disabled?: boolean;
|
|
@@ -241,13 +241,28 @@ function Tooltip(props) {
|
|
|
241
241
|
closeNow();
|
|
242
242
|
}
|
|
243
243
|
function floatingStyle() {
|
|
244
|
-
|
|
244
|
+
const estilo = {
|
|
245
245
|
transform: "translate(" + posX + "px, " + posY + "px)",
|
|
246
246
|
visibility: positioned ? "visible" : "hidden",
|
|
247
247
|
};
|
|
248
|
+
if (props.maxWidth)
|
|
249
|
+
estilo.maxWidth = props.maxWidth;
|
|
250
|
+
return estilo;
|
|
251
|
+
}
|
|
252
|
+
function floatingClasses() {
|
|
253
|
+
return [
|
|
254
|
+
"umds-tooltip__floating",
|
|
255
|
+
props.variant === "dark" ? "umds-tooltip__floating--dark" : "",
|
|
256
|
+
]
|
|
257
|
+
.filter(Boolean)
|
|
258
|
+
.join(" ");
|
|
248
259
|
}
|
|
249
260
|
function bubbleClasses() {
|
|
250
|
-
return [
|
|
261
|
+
return [
|
|
262
|
+
"umds-tooltip__bubble",
|
|
263
|
+
props.variant === "dark" ? "umds-tooltip__bubble--dark" : "",
|
|
264
|
+
open ? "umds-tooltip__bubble--open" : "",
|
|
265
|
+
]
|
|
251
266
|
.filter(Boolean)
|
|
252
267
|
.join(" ");
|
|
253
268
|
}
|
|
@@ -300,6 +315,6 @@ function Tooltip(props) {
|
|
|
300
315
|
stopKeydownWatch();
|
|
301
316
|
};
|
|
302
317
|
}, []);
|
|
303
|
-
return (_jsxs("span", { ref: triggerRef, className: ["umds-tooltip", props.className].filter(Boolean).join(" "), onMouseEnter: (event) => handleOpen(), onMouseLeave: (event) => handleClose(event), children: [_jsx(_Fragment, { children: props.children }), _jsxs("span", { className: "umds-tooltip__descricao", "aria-hidden": "true", id: descIdText(), children: [props.title ? _jsx(_Fragment, { children: tituloDescrito() }) : null, props.content ? _jsx(_Fragment, { children: props.content }) : null] }), _jsx(Portal, { children: mounted ? (_jsx("span", {
|
|
318
|
+
return (_jsxs("span", { ref: triggerRef, className: ["umds-tooltip", props.className].filter(Boolean).join(" "), onMouseEnter: (event) => handleOpen(), onMouseLeave: (event) => handleClose(event), children: [_jsx(_Fragment, { children: props.children }), _jsxs("span", { className: "umds-tooltip__descricao", "aria-hidden": "true", id: descIdText(), children: [props.title ? _jsx(_Fragment, { children: tituloDescrito() }) : null, props.content ? _jsx(_Fragment, { children: props.content }) : null] }), _jsx(Portal, { children: mounted ? (_jsx("span", { ref: floatingRef, className: floatingClasses(), style: floatingStyle(), children: _jsxs("span", { role: "tooltip", className: bubbleClasses(), id: bubbleIdText(), "aria-hidden": !open, children: [_jsxs("span", { className: "umds-tooltip__row", children: [props.icon ? (_jsx(Icon, { size: "sm", variant: "inherit", icon: props.icon })) : null, _jsxs("span", { className: "umds-tooltip__text", children: [props.title ? (_jsx("span", { className: "umds-tooltip__title", children: props.title })) : null, props.content ? (_jsx("span", { className: "umds-tooltip__content", children: _jsx(_Fragment, { children: props.content }) })) : null] })] }), _jsx("span", { ref: arrowRef, className: arrowClasses() })] }) })) : null })] }));
|
|
304
319
|
}
|
|
305
320
|
export default Tooltip;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
export * from "./utils/theme";
|
|
2
2
|
export * from "./utils/toast";
|
|
3
3
|
export * from "./utils/density";
|
|
4
|
+
export * from "./utils/paleta-de-cores";
|
|
4
5
|
export { library } from "@fortawesome/fontawesome-svg-core";
|
|
5
6
|
export { default as Accordion } from "./components/Accordion/Accordion";
|
|
6
7
|
export { default as AILabel } from "./components/AILabel/AILabel";
|
|
7
8
|
export { default as AIContent } from "./components/AIContent/AIContent";
|
|
9
|
+
export { default as Calendar } from "./components/Calendar/Calendar";
|
|
10
|
+
export { default as Coachmark } from "./components/Coachmark/Coachmark";
|
|
11
|
+
export { default as CodeBlock } from "./components/CodeBlock/CodeBlock";
|
|
8
12
|
export { default as ConfirmAIAction } from "./components/ConfirmAIAction/ConfirmAIAction";
|
|
9
13
|
export { default as Alert } from "./components/Alert/Alert";
|
|
10
14
|
export { default as AppHeader } from "./components/AppHeader/AppHeader";
|
|
@@ -26,11 +30,13 @@ export { default as Button } from "./components/Button/Button";
|
|
|
26
30
|
export { default as Card } from "./components/Card/Card";
|
|
27
31
|
export { default as Checkbox } from "./components/Checkbox/Checkbox";
|
|
28
32
|
export { default as Chips } from "./components/Chips/Chips";
|
|
33
|
+
export { default as ColorPicker } from "./components/ColorPicker/ColorPicker";
|
|
29
34
|
export { default as Combobox } from "./components/Combobox/Combobox";
|
|
30
35
|
export { default as ConfirmDialog } from "./components/ConfirmDialog/ConfirmDialog";
|
|
31
36
|
export { default as Container } from "./components/Container/Container";
|
|
32
37
|
export { default as DataTable } from "./components/DataTable/DataTable";
|
|
33
38
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
39
|
+
export { default as DescriptionList } from "./components/DescriptionList/DescriptionList";
|
|
34
40
|
export { default as Divider } from "./components/Divider/Divider";
|
|
35
41
|
export { default as DonutChart } from "./components/Chart/DonutChart";
|
|
36
42
|
export { default as Drawer } from "./components/Drawer/Drawer";
|
|
@@ -39,15 +45,21 @@ export { default as EmptyState } from "./components/EmptyState/EmptyState";
|
|
|
39
45
|
export { default as FileInput } from "./components/FileInput/FileInput";
|
|
40
46
|
export { default as Grid } from "./components/Grid/Grid";
|
|
41
47
|
export { default as Icon } from "./components/Icon/Icon";
|
|
48
|
+
export { default as IconPicker } from "./components/IconPicker/IconPicker";
|
|
42
49
|
export { default as Input } from "./components/Input/Input";
|
|
43
50
|
export { default as Kanban } from "./components/Kanban/Kanban";
|
|
44
51
|
export { default as KanbanCard } from "./components/Kanban/KanbanCard";
|
|
45
52
|
export { default as KanbanColumn } from "./components/Kanban/KanbanColumn";
|
|
53
|
+
export { default as Kbd } from "./components/Kbd/Kbd";
|
|
46
54
|
export { default as Link } from "./components/Link/Link";
|
|
47
55
|
export { default as LineChart } from "./components/Chart/LineChart";
|
|
56
|
+
export { default as List } from "./components/List/List";
|
|
57
|
+
export { default as ListItem } from "./components/List/ListItem";
|
|
48
58
|
export { default as Logo } from "./components/Logo/Logo";
|
|
49
59
|
export { default as Modal } from "./components/Modal/Modal";
|
|
50
60
|
export { default as MultiSelect } from "./components/MultiSelect/MultiSelect";
|
|
61
|
+
export { default as OrgChart } from "./components/OrgChart/OrgChart";
|
|
62
|
+
export { default as OtpInput } from "./components/OtpInput/OtpInput";
|
|
51
63
|
export { default as PageHeader } from "./components/PageHeader/PageHeader";
|
|
52
64
|
export { default as Pagination } from "./components/Pagination/Pagination";
|
|
53
65
|
export { default as PhoneInput } from "./components/PhoneInput/PhoneInput";
|
|
@@ -55,6 +67,7 @@ export { default as Podium } from "./components/Podium/Podium";
|
|
|
55
67
|
export { default as ProgressBar } from "./components/ProgressBar/ProgressBar";
|
|
56
68
|
export { default as Radio } from "./components/Radio/Radio";
|
|
57
69
|
export { default as RadioGroup } from "./components/Radio/RadioGroup";
|
|
70
|
+
export { default as RichTextEditor } from "./components/RichTextEditor/RichTextEditor";
|
|
58
71
|
export { default as SegmentedControl } from "./components/SegmentedControl/SegmentedControl";
|
|
59
72
|
export { default as Select } from "./components/Select/Select";
|
|
60
73
|
export { default as SidePanel } from "./components/SidePanel/SidePanel";
|
|
@@ -85,6 +98,9 @@ export { default as Tree } from "./components/Tree/Tree";
|
|
|
85
98
|
export type * from "./components/Accordion/Accordion";
|
|
86
99
|
export type * from "./components/AILabel/AILabel";
|
|
87
100
|
export type * from "./components/AIContent/AIContent";
|
|
101
|
+
export type * from "./components/Calendar/Calendar";
|
|
102
|
+
export type * from "./components/Coachmark/Coachmark";
|
|
103
|
+
export type * from "./components/CodeBlock/CodeBlock";
|
|
88
104
|
export type * from "./components/ConfirmAIAction/ConfirmAIAction";
|
|
89
105
|
export type * from "./components/Alert/Alert";
|
|
90
106
|
export type * from "./components/AppHeader/AppHeader";
|
|
@@ -106,11 +122,13 @@ export type * from "./components/Button/Button";
|
|
|
106
122
|
export type * from "./components/Card/Card";
|
|
107
123
|
export type * from "./components/Checkbox/Checkbox";
|
|
108
124
|
export type * from "./components/Chips/Chips";
|
|
125
|
+
export type * from "./components/ColorPicker/ColorPicker";
|
|
109
126
|
export type * from "./components/Combobox/Combobox";
|
|
110
127
|
export type * from "./components/ConfirmDialog/ConfirmDialog";
|
|
111
128
|
export type * from "./components/Container/Container";
|
|
112
129
|
export type * from "./components/DataTable/DataTable";
|
|
113
130
|
export type * from "./components/DatePicker/DatePicker";
|
|
131
|
+
export type * from "./components/DescriptionList/DescriptionList";
|
|
114
132
|
export type * from "./components/Divider/Divider";
|
|
115
133
|
export type * from "./components/Chart/DonutChart";
|
|
116
134
|
export type * from "./components/Drawer/Drawer";
|
|
@@ -119,15 +137,21 @@ export type * from "./components/EmptyState/EmptyState";
|
|
|
119
137
|
export type * from "./components/FileInput/FileInput";
|
|
120
138
|
export type * from "./components/Grid/Grid";
|
|
121
139
|
export type * from "./components/Icon/Icon";
|
|
140
|
+
export type * from "./components/IconPicker/IconPicker";
|
|
122
141
|
export type * from "./components/Input/Input";
|
|
123
142
|
export type * from "./components/Kanban/Kanban";
|
|
124
143
|
export type * from "./components/Kanban/KanbanCard";
|
|
125
144
|
export type * from "./components/Kanban/KanbanColumn";
|
|
145
|
+
export type * from "./components/Kbd/Kbd";
|
|
126
146
|
export type * from "./components/Link/Link";
|
|
127
147
|
export type * from "./components/Chart/LineChart";
|
|
148
|
+
export type * from "./components/List/List";
|
|
149
|
+
export type * from "./components/List/ListItem";
|
|
128
150
|
export type * from "./components/Logo/Logo";
|
|
129
151
|
export type * from "./components/Modal/Modal";
|
|
130
152
|
export type * from "./components/MultiSelect/MultiSelect";
|
|
153
|
+
export type * from "./components/OrgChart/OrgChart";
|
|
154
|
+
export type * from "./components/OtpInput/OtpInput";
|
|
131
155
|
export type * from "./components/PageHeader/PageHeader";
|
|
132
156
|
export type * from "./components/Pagination/Pagination";
|
|
133
157
|
export type * from "./components/PhoneInput/PhoneInput";
|
|
@@ -135,6 +159,7 @@ export type * from "./components/Podium/Podium";
|
|
|
135
159
|
export type * from "./components/ProgressBar/ProgressBar";
|
|
136
160
|
export type * from "./components/Radio/Radio";
|
|
137
161
|
export type * from "./components/Radio/RadioGroup";
|
|
162
|
+
export type * from "./components/RichTextEditor/RichTextEditor";
|
|
138
163
|
export type * from "./components/SegmentedControl/SegmentedControl";
|
|
139
164
|
export type * from "./components/Select/Select";
|
|
140
165
|
export type * from "./components/SidePanel/SidePanel";
|
package/dist/index.js
CHANGED
|
@@ -4,12 +4,17 @@ export * from "./utils/theme";
|
|
|
4
4
|
export * from "./utils/toast";
|
|
5
5
|
// Densidade global (modo touch ≥44px via data-density)
|
|
6
6
|
export * from "./utils/density";
|
|
7
|
+
// Paleta de cor categórica (primitivos) do ColorPicker
|
|
8
|
+
export * from "./utils/paleta-de-cores";
|
|
7
9
|
// FontAwesome
|
|
8
10
|
export { library } from "@fortawesome/fontawesome-svg-core";
|
|
9
11
|
// Components
|
|
10
12
|
export { default as Accordion } from "./components/Accordion/Accordion";
|
|
11
13
|
export { default as AILabel } from "./components/AILabel/AILabel";
|
|
12
14
|
export { default as AIContent } from "./components/AIContent/AIContent";
|
|
15
|
+
export { default as Calendar } from "./components/Calendar/Calendar";
|
|
16
|
+
export { default as Coachmark } from "./components/Coachmark/Coachmark";
|
|
17
|
+
export { default as CodeBlock } from "./components/CodeBlock/CodeBlock";
|
|
13
18
|
export { default as ConfirmAIAction } from "./components/ConfirmAIAction/ConfirmAIAction";
|
|
14
19
|
export { default as Alert } from "./components/Alert/Alert";
|
|
15
20
|
export { default as AppHeader } from "./components/AppHeader/AppHeader";
|
|
@@ -31,11 +36,13 @@ export { default as Button } from "./components/Button/Button";
|
|
|
31
36
|
export { default as Card } from "./components/Card/Card";
|
|
32
37
|
export { default as Checkbox } from "./components/Checkbox/Checkbox";
|
|
33
38
|
export { default as Chips } from "./components/Chips/Chips";
|
|
39
|
+
export { default as ColorPicker } from "./components/ColorPicker/ColorPicker";
|
|
34
40
|
export { default as Combobox } from "./components/Combobox/Combobox";
|
|
35
41
|
export { default as ConfirmDialog } from "./components/ConfirmDialog/ConfirmDialog";
|
|
36
42
|
export { default as Container } from "./components/Container/Container";
|
|
37
43
|
export { default as DataTable } from "./components/DataTable/DataTable";
|
|
38
44
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
45
|
+
export { default as DescriptionList } from "./components/DescriptionList/DescriptionList";
|
|
39
46
|
export { default as Divider } from "./components/Divider/Divider";
|
|
40
47
|
export { default as DonutChart } from "./components/Chart/DonutChart";
|
|
41
48
|
export { default as Drawer } from "./components/Drawer/Drawer";
|
|
@@ -44,15 +51,21 @@ export { default as EmptyState } from "./components/EmptyState/EmptyState";
|
|
|
44
51
|
export { default as FileInput } from "./components/FileInput/FileInput";
|
|
45
52
|
export { default as Grid } from "./components/Grid/Grid";
|
|
46
53
|
export { default as Icon } from "./components/Icon/Icon";
|
|
54
|
+
export { default as IconPicker } from "./components/IconPicker/IconPicker";
|
|
47
55
|
export { default as Input } from "./components/Input/Input";
|
|
48
56
|
export { default as Kanban } from "./components/Kanban/Kanban";
|
|
49
57
|
export { default as KanbanCard } from "./components/Kanban/KanbanCard";
|
|
50
58
|
export { default as KanbanColumn } from "./components/Kanban/KanbanColumn";
|
|
59
|
+
export { default as Kbd } from "./components/Kbd/Kbd";
|
|
51
60
|
export { default as Link } from "./components/Link/Link";
|
|
52
61
|
export { default as LineChart } from "./components/Chart/LineChart";
|
|
62
|
+
export { default as List } from "./components/List/List";
|
|
63
|
+
export { default as ListItem } from "./components/List/ListItem";
|
|
53
64
|
export { default as Logo } from "./components/Logo/Logo";
|
|
54
65
|
export { default as Modal } from "./components/Modal/Modal";
|
|
55
66
|
export { default as MultiSelect } from "./components/MultiSelect/MultiSelect";
|
|
67
|
+
export { default as OrgChart } from "./components/OrgChart/OrgChart";
|
|
68
|
+
export { default as OtpInput } from "./components/OtpInput/OtpInput";
|
|
56
69
|
export { default as PageHeader } from "./components/PageHeader/PageHeader";
|
|
57
70
|
export { default as Pagination } from "./components/Pagination/Pagination";
|
|
58
71
|
export { default as PhoneInput } from "./components/PhoneInput/PhoneInput";
|
|
@@ -60,6 +73,7 @@ export { default as Podium } from "./components/Podium/Podium";
|
|
|
60
73
|
export { default as ProgressBar } from "./components/ProgressBar/ProgressBar";
|
|
61
74
|
export { default as Radio } from "./components/Radio/Radio";
|
|
62
75
|
export { default as RadioGroup } from "./components/Radio/RadioGroup";
|
|
76
|
+
export { default as RichTextEditor } from "./components/RichTextEditor/RichTextEditor";
|
|
63
77
|
export { default as SegmentedControl } from "./components/SegmentedControl/SegmentedControl";
|
|
64
78
|
export { default as Select } from "./components/Select/Select";
|
|
65
79
|
export { default as SidePanel } from "./components/SidePanel/SidePanel";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { describe, expect, it, vi } from "vitest";
|
|
3
|
+
import { render, screen } from "@testing-library/react";
|
|
4
|
+
import userEvent from "@testing-library/user-event";
|
|
5
|
+
import AILabel from "../components/AILabel/AILabel";
|
|
6
|
+
/**
|
|
7
|
+
* `defaultOpen` era declarado e documentado, mas nunca lido: o painel nascia
|
|
8
|
+
* fechado de qualquer jeito, e a story "Em inglês" usava `open` (controlado)
|
|
9
|
+
* para contornar — o que travava o clique.
|
|
10
|
+
*/
|
|
11
|
+
describe("AILabel · defaultOpen", () => {
|
|
12
|
+
it("abre o painel na montagem", () => {
|
|
13
|
+
render(_jsx(AILabel, { explanation: "Resumo dos despachos.", defaultOpen: true }));
|
|
14
|
+
expect(screen.getByRole("region")).toHaveTextContent("Resumo dos despachos.");
|
|
15
|
+
expect(screen.getByRole("button", { name: "Conteúdo gerado por IA" })).toHaveAttribute("aria-expanded", "true");
|
|
16
|
+
});
|
|
17
|
+
it("continua não-controlado: o clique fecha e avisa", async () => {
|
|
18
|
+
const usuario = userEvent.setup();
|
|
19
|
+
const onOpenChange = vi.fn();
|
|
20
|
+
render(_jsx(AILabel, { explanation: "Resumo.", defaultOpen: true, onOpenChange: onOpenChange }));
|
|
21
|
+
await usuario.click(screen.getByRole("button", { name: "Conteúdo gerado por IA" }));
|
|
22
|
+
expect(screen.queryByRole("region")).not.toBeInTheDocument();
|
|
23
|
+
expect(onOpenChange).toHaveBeenCalledWith(false);
|
|
24
|
+
});
|
|
25
|
+
it("sem defaultOpen nasce fechado", () => {
|
|
26
|
+
render(_jsx(AILabel, { explanation: "Resumo." }));
|
|
27
|
+
expect(screen.queryByRole("region")).not.toBeInTheDocument();
|
|
28
|
+
});
|
|
29
|
+
it("`open` controlado vence o defaultOpen", () => {
|
|
30
|
+
render(_jsx(AILabel, { explanation: "Resumo.", defaultOpen: true, open: false }));
|
|
31
|
+
expect(screen.queryByRole("region")).not.toBeInTheDocument();
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import { render, screen } from "@testing-library/react";
|
|
4
|
+
import Accordion from "../components/Accordion/Accordion";
|
|
5
|
+
describe("Accordion · conteúdo livre por item (React)", () => {
|
|
6
|
+
it("o content do item aceita qualquer nó (campos, botões)", () => {
|
|
7
|
+
render(_jsx(Accordion, { items: [
|
|
8
|
+
{
|
|
9
|
+
id: "s1",
|
|
10
|
+
title: "Seção 01",
|
|
11
|
+
defaultOpen: true,
|
|
12
|
+
content: (_jsxs("label", { children: ["Nome ", _jsx("input", { defaultValue: "Maria" })] })),
|
|
13
|
+
},
|
|
14
|
+
{ id: "s2", title: "Seção 02", content: _jsx("button", { type: "button", children: "Anexar arquivo" }) },
|
|
15
|
+
] }));
|
|
16
|
+
expect(screen.getByDisplayValue("Maria")).toBeInTheDocument();
|
|
17
|
+
expect(screen.getByRole("button", { name: "Anexar arquivo", hidden: true })).toBeInTheDocument();
|
|
18
|
+
});
|
|
19
|
+
it("o título do item é o botão do painel, sem cor própria (herda a neutra do gatilho)", () => {
|
|
20
|
+
const { container } = render(_jsx(Accordion, { items: [{ id: "a", title: "Seção", content: "x" }] }));
|
|
21
|
+
const titulo = container.querySelector(".umds-accordion__title");
|
|
22
|
+
expect(titulo.closest("button")).toHaveClass("umds-accordion__trigger");
|
|
23
|
+
expect(titulo.getAttribute("style")).toBeNull();
|
|
24
|
+
});
|
|
25
|
+
it("o texto simples continua funcionando", () => {
|
|
26
|
+
render(_jsx(Accordion, { items: [{ id: "a", title: "Seção", content: "Texto do painel", defaultOpen: true }] }));
|
|
27
|
+
expect(screen.getByText("Texto do painel")).toBeInTheDocument();
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import { render } from "@testing-library/react";
|
|
4
|
+
import Accordion from "../components/Accordion/Accordion";
|
|
5
|
+
const ITENS = [
|
|
6
|
+
{ id: "a", title: "Prazos", content: "Dez dias úteis." },
|
|
7
|
+
{ id: "b", title: "Anexos", content: "Até 10 MB." },
|
|
8
|
+
];
|
|
9
|
+
describe("Accordion · titleVariant", () => {
|
|
10
|
+
it("neutral liga a classe do título neutro; o padrão e default não", () => {
|
|
11
|
+
const { container, rerender } = render(_jsx(Accordion, { items: ITENS, titleVariant: "neutral" }));
|
|
12
|
+
const raiz = () => container.firstElementChild;
|
|
13
|
+
expect(raiz()).toHaveClass("umds-accordion--title-neutral");
|
|
14
|
+
rerender(_jsx(Accordion, { items: ITENS, titleVariant: "default" }));
|
|
15
|
+
expect(raiz()).not.toHaveClass("umds-accordion--title-neutral");
|
|
16
|
+
rerender(_jsx(Accordion, { items: ITENS }));
|
|
17
|
+
expect(raiz()).not.toHaveClass("umds-accordion--title-neutral");
|
|
18
|
+
});
|
|
19
|
+
it("combina com a variant do accordion", () => {
|
|
20
|
+
const { container } = render(_jsx(Accordion, { items: ITENS, variant: "separated", titleVariant: "neutral" }));
|
|
21
|
+
expect(container.firstElementChild).toHaveClass("umds-accordion--separated", "umds-accordion--title-neutral");
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import { render } from "@testing-library/react";
|
|
4
|
+
import AppSubheader from "../components/AppSubheader/AppSubheader";
|
|
5
|
+
import Breadcrumb from "../components/Breadcrumb/Breadcrumb";
|
|
6
|
+
/** O jsdom não tem layout: a geometria real é conferida pela story "Só a página atual" (play, no navegador); a regra de CSS, pelo teste do Vue. */
|
|
7
|
+
describe("AppSubheader · região do contexto", () => {
|
|
8
|
+
it("a trilha só com a página atual não tem nada focável dentro da região", () => {
|
|
9
|
+
const { container } = render(_jsx(AppSubheader, { children: _jsx(Breadcrumb, { items: [{ label: "Painel" }] }) }));
|
|
10
|
+
const contexto = container.querySelector(".umds-app-subheader__contexto");
|
|
11
|
+
expect(contexto.querySelector("a, button, [tabindex]")).toBeNull();
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|