@1doc/1ds-react 2.9.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 +434 -0
- package/dist/components/Accordion/Accordion.css +13 -0
- package/dist/components/Accordion/Accordion.d.ts +3 -0
- package/dist/components/Accordion/Accordion.js +1 -0
- package/dist/components/AppSubheader/AppSubheader.css +10 -1
- package/dist/components/AttachmentCard/AttachmentCard.css +10 -8
- package/dist/components/AttachmentCard/AttachmentCard.d.ts +3 -0
- package/dist/components/AttachmentCard/AttachmentCard.js +8 -1
- package/dist/components/Badge/Badge.css +14 -1
- package/dist/components/Badge/Badge.d.ts +11 -2
- package/dist/components/Badge/Badge.js +3 -0
- package/dist/components/Calendar/Calendar.d.ts +7 -6
- package/dist/components/Coachmark/Coachmark.css +10 -0
- package/dist/components/Coachmark/Coachmark.d.ts +12 -0
- package/dist/components/Coachmark/Coachmark.js +46 -5
- package/dist/components/ColorPicker/ColorPicker.css +8 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +2 -2
- package/dist/components/DataTable/DataTable.css +174 -0
- package/dist/components/DataTable/DataTable.d.ts +63 -2
- package/dist/components/DataTable/DataTable.js +278 -6
- package/dist/components/DescriptionList/DescriptionList.css +14 -0
- package/dist/components/DescriptionList/DescriptionList.d.ts +3 -0
- package/dist/components/DescriptionList/DescriptionList.js +1 -0
- package/dist/components/EmptyState/EmptyState.d.ts +4 -2
- package/dist/components/EmptyState/EmptyState.js +2 -2
- package/dist/components/Input/Input.css +21 -0
- package/dist/components/Input/Input.d.ts +7 -0
- package/dist/components/Input/Input.js +2 -1
- package/dist/components/List/ListItem.d.ts +14 -2
- package/dist/components/List/ListItem.js +3 -2
- package/dist/components/RichTextEditor/RichTextEditor.css +47 -0
- package/dist/components/RichTextEditor/RichTextEditor.d.ts +22 -8
- package/dist/components/RichTextEditor/RichTextEditor.js +460 -3
- package/dist/components/SegmentedControl/SegmentedControl.css +24 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +2 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +4 -1
- package/dist/components/Select/Select.css +94 -0
- package/dist/components/Select/Select.d.ts +26 -4
- package/dist/components/Select/Select.js +210 -35
- package/dist/components/StatCard/StatCard.css +65 -0
- package/dist/components/StatCard/StatCard.d.ts +9 -0
- package/dist/components/StatCard/StatCard.js +10 -1
- 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/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/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/BadgeNeutroColado.test.d.ts +1 -0
- package/dist/teste/BadgeNeutroColado.test.js +11 -0
- package/dist/teste/BadgeTag.test.js +13 -0
- package/dist/teste/CalendarCabecalho.test.d.ts +1 -0
- package/dist/teste/CalendarCabecalho.test.js +11 -0
- package/dist/teste/CoachmarkSemVeu.test.d.ts +1 -0
- package/dist/teste/CoachmarkSemVeu.test.js +85 -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/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/InputAgrupado.test.d.ts +1 -0
- package/dist/teste/InputAgrupado.test.js +24 -0
- package/dist/teste/ListItemTooltipStandalone.test.d.ts +1 -0
- package/dist/teste/ListItemTooltipStandalone.test.js +39 -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/StatCardSecundariaETom.test.d.ts +1 -0
- package/dist/teste/StatCardSecundariaETom.test.js +45 -0
- package/dist/teste/ToastAcaoEDetalhes.test.d.ts +1 -0
- package/dist/teste/ToastAcaoEDetalhes.test.js +94 -0
- package/dist/utils/html-seguro.d.ts +19 -1
- package/dist/utils/html-seguro.js +113 -2
- package/dist/utils/toast.d.ts +10 -1
- package/dist/utils/toast.js +2 -1
- package/package.json +2 -2
- package/src/teste/AccordionTituloNeutro.test.tsx +25 -0
- package/src/teste/AppSubheaderRegiao.test.tsx +17 -0
- package/src/teste/AttachmentCardLista.test.tsx +53 -0
- package/src/teste/AttachmentCardSm.test.tsx +29 -0
- package/src/teste/BadgeNeutroColado.test.tsx +15 -0
- package/src/teste/BadgeTag.test.tsx +21 -0
- package/src/teste/CalendarCabecalho.test.tsx +11 -0
- package/src/teste/CoachmarkSemVeu.test.tsx +101 -0
- package/src/teste/ColorPickerXs.test.tsx +22 -0
- package/src/teste/DataTableArvoreEVariantes.test.tsx +240 -0
- package/src/teste/DescriptionListCompacta.test.tsx +24 -0
- package/src/teste/EmptyStateTituloRico.test.tsx +34 -0
- package/src/teste/InputAgrupado.test.tsx +26 -0
- package/src/teste/ListItemTooltipStandalone.test.tsx +64 -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/StatCardSecundariaETom.test.tsx +51 -0
- package/src/teste/ToastAcaoEDetalhes.test.tsx +109 -0
- package/src/utils/html-seguro.ts +105 -2
- package/src/utils/toast.ts +12 -2
|
@@ -142,6 +142,27 @@
|
|
|
142
142
|
gap: var(--umds-primitive-spacing-nano); /* 8px */
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
.umds-rte__table-field {
|
|
146
|
+
flex: 0 1 var(--umds-primitive-spacing-xxxl); /* 120px */
|
|
147
|
+
min-width: 0;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.umds-rte__style-field {
|
|
151
|
+
flex: 0 1 auto;
|
|
152
|
+
min-width: 0;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* Barra de linha e coluna: aparece com o cursor numa célula. */
|
|
156
|
+
.umds-rte__table-bar {
|
|
157
|
+
display: flex;
|
|
158
|
+
flex-wrap: wrap;
|
|
159
|
+
align-items: center;
|
|
160
|
+
gap: var(--umds-primitive-spacing-quarck); /* 4px */
|
|
161
|
+
padding: var(--umds-primitive-spacing-quarck) var(--umds-primitive-spacing-nano); /* 4px 8px */
|
|
162
|
+
background: var(--umds-semantic-color-background-light);
|
|
163
|
+
border-bottom: var(--umds-primitive-border-width-hairline) solid var(--umds-semantic-color-neutral-light-medium);
|
|
164
|
+
}
|
|
165
|
+
|
|
145
166
|
/* ── Área de escrita ── */
|
|
146
167
|
.umds-rte__editor {
|
|
147
168
|
box-sizing: border-box;
|
|
@@ -183,6 +204,32 @@
|
|
|
183
204
|
color: var(--umds-semantic-color-neutral-dark-down);
|
|
184
205
|
}
|
|
185
206
|
|
|
207
|
+
.umds-rte__editor img {
|
|
208
|
+
max-width: 100%;
|
|
209
|
+
height: auto;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.umds-rte__editor table {
|
|
213
|
+
width: 100%;
|
|
214
|
+
margin: var(--umds-primitive-spacing-nano) 0;
|
|
215
|
+
border-collapse: collapse;
|
|
216
|
+
table-layout: fixed;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.umds-rte__editor th,
|
|
220
|
+
.umds-rte__editor td {
|
|
221
|
+
min-width: var(--umds-primitive-spacing-sm); /* 40px: a célula vazia continua alcançável */
|
|
222
|
+
padding: var(--umds-primitive-spacing-quarck) var(--umds-primitive-spacing-nano); /* 4px 8px */
|
|
223
|
+
border: var(--umds-primitive-border-width-hairline) solid var(--umds-semantic-color-neutral-light-down);
|
|
224
|
+
vertical-align: top;
|
|
225
|
+
text-align: left;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.umds-rte__editor th {
|
|
229
|
+
background: var(--umds-semantic-color-background-light);
|
|
230
|
+
font-weight: var(--umds-primitive-font-weight-semibold);
|
|
231
|
+
}
|
|
232
|
+
|
|
186
233
|
.umds-rte__editor a {
|
|
187
234
|
color: var(--umds-semantic-color-primary-pure);
|
|
188
235
|
text-decoration: underline;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './RichTextEditor.css';
|
|
2
2
|
/** Ferramentas da barra, na ordem em que aparecem em `toolbar`. `"|"` é um separador. */
|
|
3
|
-
export type RichTextTool = "bold" | "italic" | "underline" | "strike" | "ul" | "ol" | "link" | "undo" | "redo" | "clear" | "|";
|
|
3
|
+
export type RichTextTool = "bold" | "italic" | "underline" | "strike" | "ul" | "ol" | "link" | "undo" | "redo" | "clear" | "alignLeft" | "alignCenter" | "alignRight" | "alignJustify" | "image" | "table" | "fontFamily" | "fontSize" | "textColor" | "|";
|
|
4
4
|
/**
|
|
5
5
|
* RichTextEditor — editor de texto rico leve, sobre `contenteditable`, sem
|
|
6
6
|
* biblioteca: negrito, itálico, sublinhado, tachado, listas, link, desfazer e
|
|
@@ -27,19 +27,33 @@ export type RichTextTool = "bold" | "italic" | "underline" | "strike" | "ul" | "
|
|
|
27
27
|
*
|
|
28
28
|
* Todos os textos são props (`labels`, `toolbarLabel`, `placeholder`).
|
|
29
29
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
30
|
+
* Opcionais na `toolbar` (fora da barra padrão): alinhamento (`alignLeft`,
|
|
31
|
+
* `alignCenter`, `alignRight`, `alignJustify`), imagem (`image`: por endereço ou por
|
|
32
|
+
* arquivo, que entra como `data:` URL, com texto alternativo) e tabela simples
|
|
33
|
+
* (`table`: insere linhas × colunas; com o cursor numa célula aparece a barra de
|
|
34
|
+
* adicionar e remover linha e coluna). Imagem e tabela passam pela mesma
|
|
35
|
+
* higienização: só PNG, JPEG, GIF e WebP em `data:`, ou `http(s)`; sem SVG.
|
|
36
|
+
*
|
|
37
|
+
* Estilo de texto por TOKEN do DS, também opcional na `toolbar`: `fontFamily`
|
|
38
|
+
* (padrão ou monoespaçada), `fontSize` (12, 14, 16, 20 e 24px, da escala do DS) e
|
|
39
|
+
* `textColor` (a paleta do DS). Cada um abre um painel abaixo da barra e aplica ao
|
|
40
|
+
* texto selecionado (sem seleção, o painel pede que se selecione). O valor guarda
|
|
41
|
+
* `<span style="color: var(--umds-primitive-red-pure)">`: só token do DS passa na
|
|
42
|
+
* higienização, cor em hex, rgb ou nome sai. Para voltar ao padrão, use `clear`.
|
|
43
|
+
*
|
|
44
|
+
* Limites: usa `document.execCommand`, que o
|
|
45
|
+
* navegador mantém mas está marcado como obsoleto (o comportamento do desfazer
|
|
46
|
+
* varia um pouco entre navegadores; adicionar e remover linha ou coluna mexe no
|
|
47
|
+
* DOM e não entra no desfazer). Imagem de arquivo passa de 2 MB? Recusada: o HTML
|
|
48
|
+
* do valor guarda a imagem inteira.
|
|
35
49
|
* @property {string} value - HTML (controlado)
|
|
36
50
|
* @property {string} defaultValue - HTML inicial (não controlado)
|
|
37
51
|
* @property {string} label - Rótulo visível do campo
|
|
38
52
|
* @property {string} ariaLabel - Nome acessível quando não há `label` visível
|
|
39
53
|
* @property {string} placeholder - Texto de apoio com o editor vazio
|
|
40
|
-
* @property {string[]} toolbar - Ferramentas da barra, em ordem: 'bold' | 'italic' | 'underline' | 'strike' | 'ul' | 'ol' | 'link' | 'undo' | 'redo' | 'clear' | '|' (separador)
|
|
54
|
+
* @property {string[]} toolbar - Ferramentas da barra, em ordem: 'bold' | 'italic' | 'underline' | 'strike' | 'ul' | 'ol' | 'link' | 'undo' | 'redo' | 'clear' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify' | 'image' | 'table' | 'fontFamily' | 'fontSize' | 'textColor' | '|' (separador)
|
|
41
55
|
* @property {string} toolbarLabel - Nome da barra (padrão "Formatação")
|
|
42
|
-
* @property {object} labels - Nomes das ferramentas e
|
|
56
|
+
* @property {object} labels - Nomes das ferramentas e dos campos, parcial: `{ bold, italic, underline, strike, ul, ol, link, undo, redo, clear, alignLeft, alignCenter, alignRight, alignJustify, image, table, linkAddress, linkApply, linkRemove, linkCancel, linkInvalid, imageUrl, imageAlt, imageFile, imageApply, imageCancel, imageInvalid, imageType, imageTooLarge, tableRows, tableCols, tableApply, tableCancel, tableInvalid, tableActions, tableAddRow, tableRemoveRow, tableAddCol, tableRemoveCol, tableRemove, fontFamily, fontSize, textColor, fontFamilyBase, fontFamilyMono, styleClose, styleNeedsSelection }`
|
|
43
57
|
* @property {number} minHeight - Altura mínima da área de escrita, em px (padrão 120)
|
|
44
58
|
* @property {boolean} resizable - Deixa redimensionar a altura pelo canto
|
|
45
59
|
* @property {boolean} disabled - Desabilita barra e área
|