@joniguerini/lume 0.0.0-stage → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/LICENSE +25 -0
  2. package/README.md +62 -2
  3. package/base.css +165 -0
  4. package/bin/lumeui.mjs +163 -0
  5. package/components/alert.css +156 -0
  6. package/components/banner.css +98 -0
  7. package/components/button.css +291 -0
  8. package/components/calendar.css +532 -0
  9. package/components/carousel.css +175 -0
  10. package/components/chart.css +813 -0
  11. package/components/chat.css +670 -0
  12. package/components/checkbox.css +212 -0
  13. package/components/chip.css +224 -0
  14. package/components/code.css +36 -0
  15. package/components/color-picker.css +192 -0
  16. package/components/command.css +148 -0
  17. package/components/content.css +211 -0
  18. package/components/editor.css +174 -0
  19. package/components/feedback.css +320 -0
  20. package/components/filters.css +103 -0
  21. package/components/form.css +455 -0
  22. package/components/image-viewer.css +237 -0
  23. package/components/layers.css +138 -0
  24. package/components/link.css +87 -0
  25. package/components/loading.css +260 -0
  26. package/components/menu.css +180 -0
  27. package/components/modal.css +209 -0
  28. package/components/navigation.css +507 -0
  29. package/components/notifications.css +186 -0
  30. package/components/number-field.css +52 -0
  31. package/components/otp.css +119 -0
  32. package/components/panel.css +208 -0
  33. package/components/picker.css +207 -0
  34. package/components/rating.css +143 -0
  35. package/components/resizable.css +173 -0
  36. package/components/scrollbar.css +110 -0
  37. package/components/select.css +477 -0
  38. package/components/shell.css +837 -0
  39. package/components/slider.css +189 -0
  40. package/components/sortable.css +287 -0
  41. package/components/surfaces.css +182 -0
  42. package/components/switch.css +115 -0
  43. package/components/table.css +228 -0
  44. package/components/tabs.css +190 -0
  45. package/components/tags.css +83 -0
  46. package/components/toast.css +164 -0
  47. package/components/toolbar.css +80 -0
  48. package/components/upload.css +181 -0
  49. package/ds.css +48 -0
  50. package/fonts/Geist-LICENSE.txt +92 -0
  51. package/fonts/Geist-Variable.woff2 +0 -0
  52. package/fonts/GeistSerif-Regular.woff2 +0 -0
  53. package/fonts/JetBrainsMono-LICENSE.txt +93 -0
  54. package/fonts/JetBrainsMono-Variable.woff2 +0 -0
  55. package/fonts.css +29 -0
  56. package/icons/icons.d.ts +5 -0
  57. package/icons/icons.js +266 -0
  58. package/js/back-to-top.d.ts +2 -0
  59. package/js/back-to-top.js +62 -0
  60. package/js/banner.js +87 -0
  61. package/js/calendar.d.ts +3 -0
  62. package/js/calendar.js +472 -0
  63. package/js/carousel.d.ts +2 -0
  64. package/js/carousel.js +258 -0
  65. package/js/charts/bar.js +361 -0
  66. package/js/charts/core.js +604 -0
  67. package/js/charts/donut.js +206 -0
  68. package/js/charts/figures.js +97 -0
  69. package/js/charts/heatmap.js +410 -0
  70. package/js/charts/line.js +268 -0
  71. package/js/charts/scatter.js +211 -0
  72. package/js/charts.d.ts +12 -0
  73. package/js/charts.js +27 -0
  74. package/js/code-block.d.ts +3 -0
  75. package/js/code-block.js +32 -0
  76. package/js/color-picker.d.ts +4 -0
  77. package/js/color-picker.js +448 -0
  78. package/js/command-palette.js +233 -0
  79. package/js/composer.js +573 -0
  80. package/js/context-menu.d.ts +2 -0
  81. package/js/context-menu.js +154 -0
  82. package/js/date-picker.d.ts +2 -0
  83. package/js/date-picker.js +430 -0
  84. package/js/drawer.js +48 -0
  85. package/js/editor.d.ts +5 -0
  86. package/js/editor.js +615 -0
  87. package/js/field-support.js +77 -0
  88. package/js/file-upload.d.ts +2 -0
  89. package/js/file-upload.js +230 -0
  90. package/js/filters.js +266 -0
  91. package/js/form.d.ts +2 -0
  92. package/js/form.js +409 -0
  93. package/js/i18n.d.ts +14 -0
  94. package/js/i18n.js +83 -0
  95. package/js/image-viewer.d.ts +4 -0
  96. package/js/image-viewer.js +275 -0
  97. package/js/menu.d.ts +4 -0
  98. package/js/menu.js +237 -0
  99. package/js/messages.js +908 -0
  100. package/js/modal.d.ts +7 -0
  101. package/js/modal.js +183 -0
  102. package/js/notifications.d.ts +4 -0
  103. package/js/notifications.js +204 -0
  104. package/js/number-field.d.ts +2 -0
  105. package/js/number-field.js +175 -0
  106. package/js/otp-field.d.ts +2 -0
  107. package/js/otp-field.js +107 -0
  108. package/js/pagination.d.ts +3 -0
  109. package/js/pagination.js +143 -0
  110. package/js/popover.d.ts +2 -0
  111. package/js/popover.js +155 -0
  112. package/js/progress-ring.js +48 -0
  113. package/js/rating.d.ts +3 -0
  114. package/js/rating.js +130 -0
  115. package/js/resizable.d.ts +2 -0
  116. package/js/resizable.js +311 -0
  117. package/js/scrollbar.d.ts +2 -0
  118. package/js/scrollbar.js +273 -0
  119. package/js/segmented.js +60 -0
  120. package/js/select.d.ts +3 -0
  121. package/js/select.js +784 -0
  122. package/js/shell.d.ts +6 -0
  123. package/js/shell.js +373 -0
  124. package/js/slider.d.ts +2 -0
  125. package/js/slider.js +89 -0
  126. package/js/sortable.d.ts +5 -0
  127. package/js/sortable.js +463 -0
  128. package/js/stepper.d.ts +2 -0
  129. package/js/stepper.js +72 -0
  130. package/js/tabs.js +99 -0
  131. package/js/tag-field.d.ts +2 -0
  132. package/js/tag-field.js +177 -0
  133. package/js/theme.d.ts +9 -0
  134. package/js/theme.js +114 -0
  135. package/js/time-picker.d.ts +2 -0
  136. package/js/time-picker.js +279 -0
  137. package/js/toast.d.ts +17 -0
  138. package/js/toast.js +171 -0
  139. package/js/toolbar.d.ts +2 -0
  140. package/js/toolbar.js +107 -0
  141. package/js/tooltip.d.ts +2 -0
  142. package/js/tooltip.js +208 -0
  143. package/js/tree.d.ts +2 -0
  144. package/js/tree.js +168 -0
  145. package/lume.css +11574 -0
  146. package/lume.d.ts +104 -0
  147. package/lume.js +67 -0
  148. package/package.json +66 -4
  149. package/react/Alert.d.ts +24 -0
  150. package/react/Alert.js +21 -0
  151. package/react/AppShell.d.ts +67 -0
  152. package/react/AppShell.js +94 -0
  153. package/react/Avatar.d.ts +39 -0
  154. package/react/Avatar.js +40 -0
  155. package/react/Badge.d.ts +17 -0
  156. package/react/Badge.js +10 -0
  157. package/react/Button.d.ts +32 -0
  158. package/react/Button.js +17 -0
  159. package/react/Calendar.d.ts +48 -0
  160. package/react/Calendar.js +67 -0
  161. package/react/Carousel.d.ts +30 -0
  162. package/react/Carousel.js +38 -0
  163. package/react/Charts.d.ts +186 -0
  164. package/react/Charts.js +58 -0
  165. package/react/Chip.d.ts +34 -0
  166. package/react/Chip.js +26 -0
  167. package/react/Choice.d.ts +72 -0
  168. package/react/Choice.js +51 -0
  169. package/react/ColorPicker.d.ts +43 -0
  170. package/react/ColorPicker.js +73 -0
  171. package/react/Content.d.ts +58 -0
  172. package/react/Content.js +42 -0
  173. package/react/Controls.d.ts +97 -0
  174. package/react/Controls.js +118 -0
  175. package/react/Editor.d.ts +28 -0
  176. package/react/Editor.js +57 -0
  177. package/react/Field.d.ts +90 -0
  178. package/react/Field.js +65 -0
  179. package/react/Form.d.ts +36 -0
  180. package/react/Form.js +45 -0
  181. package/react/Icon.d.ts +13 -0
  182. package/react/Icon.js +8 -0
  183. package/react/IconButton.d.ts +19 -0
  184. package/react/IconButton.js +12 -0
  185. package/react/ImageViewer.d.ts +20 -0
  186. package/react/ImageViewer.js +22 -0
  187. package/react/InlineAction.d.ts +15 -0
  188. package/react/InlineAction.js +12 -0
  189. package/react/Layers.d.ts +118 -0
  190. package/react/Layers.js +115 -0
  191. package/react/Link.d.ts +32 -0
  192. package/react/Link.js +26 -0
  193. package/react/Loading.d.ts +67 -0
  194. package/react/Loading.js +49 -0
  195. package/react/Navigation.d.ts +181 -0
  196. package/react/Navigation.js +197 -0
  197. package/react/Notices.d.ts +43 -0
  198. package/react/Notices.js +89 -0
  199. package/react/Panel.d.ts +57 -0
  200. package/react/Panel.js +33 -0
  201. package/react/Pickers.d.ts +83 -0
  202. package/react/Pickers.js +70 -0
  203. package/react/Rating.d.ts +39 -0
  204. package/react/Rating.js +41 -0
  205. package/react/Resizable.d.ts +44 -0
  206. package/react/Resizable.js +30 -0
  207. package/react/Select.d.ts +53 -0
  208. package/react/Select.js +79 -0
  209. package/react/Sortable.d.ts +52 -0
  210. package/react/Sortable.js +113 -0
  211. package/react/Table.d.ts +60 -0
  212. package/react/Table.js +34 -0
  213. package/react/Toolbar.d.ts +45 -0
  214. package/react/Toolbar.js +45 -0
  215. package/react/cx.d.ts +2 -0
  216. package/react/cx.js +5 -0
  217. package/react/icon-names.d.ts +1 -0
  218. package/react/icon-names.js +2 -0
  219. package/react/index.d.ts +42 -0
  220. package/react/index.js +52 -0
  221. package/react/useController.d.ts +8 -0
  222. package/react/useController.js +16 -0
  223. package/react/useLocale.d.ts +5 -0
  224. package/react/useLocale.js +15 -0
  225. package/tokens.css +739 -0
  226. package/tokens.js +4911 -0
@@ -0,0 +1,5 @@
1
+ // Gerado por scripts/build-react.mjs. Não edite.
2
+ export declare const icons: Record<string, { name: string; category: string; keywords: string[]; body: string }>;
3
+ export declare const iconList: Array<{ name: string; category: string; keywords: string[]; body: string }>;
4
+ export declare const icon: (name: string, options?: { size?: number; strokeWidth?: number; label?: string; className?: string }) => string;
5
+ export declare const iconCategories: Record<string, string>;
package/icons/icons.js ADDED
@@ -0,0 +1,266 @@
1
+ /**
2
+ * Lume — biblioteca de ícones
3
+ *
4
+ * Grid de 24×24, traço 1,5 (1,75 em tamanhos ≤ 16 px), pontas e junções arredondadas,
5
+ * área útil de 2 px de respiro. Todos usam currentColor.
6
+ *
7
+ * Uso em JS: icon('home', { size: 20 }) → string <svg>
8
+ * Uso em HTML: <ds-icon name="home" size="20"></ds-icon>
9
+ */
10
+
11
+ const path = (d) => `<path d="${d}"/>`;
12
+ const circle = (cx, cy, r) => `<circle cx="${cx}" cy="${cy}" r="${r}"/>`;
13
+ const rect = (x, y, w, h, rx = 0) => `<rect x="${x}" y="${y}" width="${w}" height="${h}" rx="${rx}"/>`;
14
+ const dot = (cx, cy) => `<path d="M${cx} ${cy}h.01"/>`;
15
+ const fillDot = (cx, cy, r = 1.1) => `<circle cx="${cx}" cy="${cy}" r="${r}" fill="currentColor" stroke="none"/>`;
16
+
17
+ /** Engrenagem gerada por geometria polar, para dentes perfeitamente simétricos. */
18
+ function gear({ teeth = 8, rOut = 9.5, rIn = 7.4, half = 9, base = 15 } = {}) {
19
+ const pt = (r, deg) => {
20
+ const a = (deg * Math.PI) / 180;
21
+ return `${(12 + r * Math.cos(a)).toFixed(2)} ${(12 + r * Math.sin(a)).toFixed(2)}`;
22
+ };
23
+ const step = 360 / teeth;
24
+ let d = '';
25
+ for (let i = 0; i < teeth; i++) {
26
+ const a = i * step - 90;
27
+ d += `${i === 0 ? 'M' : 'L'}${pt(rIn, a - base)} L${pt(rOut, a - half)} A${rOut} ${rOut} 0 0 1 ${pt(rOut, a + half)} L${pt(rIn, a + base)} A${rIn} ${rIn} 0 0 1 ${pt(rIn, a + step - base)} `;
28
+ }
29
+ return `${path(`${d.trim()}Z`)}${circle(12, 12, 3)}`;
30
+ }
31
+
32
+ // [nome, categoria, palavras-chave, conteúdo SVG]
33
+ const DEFINITIONS = [
34
+ // Navegação
35
+ ['home', 'navegacao', 'casa início inicial', path('M3.5 10.5 12 3.5l8.5 7') + path('M5.5 9v10.5a1 1 0 0 0 1 1H10v-6h4v6h3.5a1 1 0 0 0 1-1V9')],
36
+ ['menu', 'navegacao', 'hambúrguer navegação lista', path('M4 7h16M4 12h16M4 17h16')],
37
+ ['panel-left', 'navegacao', 'sidebar barra lateral recolher', rect(3.5, 4.5, 17, 15, 3) + path('M9.5 4.5v15')],
38
+ ['panel-top', 'navegacao', 'navbar barra superior topo layout', rect(3.5, 4.5, 17, 15, 3) + path('M3.5 10h17')],
39
+ ['chevron-down', 'navegacao', 'seta baixo expandir', path('m6 9 6 6 6-6')],
40
+ ['chevron-up', 'navegacao', 'seta cima recolher', path('m6 15 6-6 6 6')],
41
+ ['chevron-left', 'navegacao', 'seta esquerda voltar', path('m15 6-6 6 6 6')],
42
+ ['chevron-right', 'navegacao', 'seta direita avançar', path('m9 6 6 6-6 6')],
43
+ ['chevrons-up-down', 'navegacao', 'select seletor ordenar', path('m8 9 4-4 4 4M8 15l4 4 4-4')],
44
+ ['arrow-right', 'navegacao', 'seta próximo', path('M5 12h14M13 6l6 6-6 6')],
45
+ ['arrow-left', 'navegacao', 'seta anterior voltar', path('M19 12H5M11 6l-6 6 6 6')],
46
+ ['arrow-up', 'navegacao', 'seta enviar topo', path('M12 19V5M6 11l6-6 6 6')],
47
+ ['arrow-up-right', 'navegacao', 'diagonal abrir link', path('M7 17 17 7M8 7h9v9')],
48
+ ['arrow-down', 'navegacao', 'seta baixo descer', path('M12 5v14M18 13l-6 6-6-6')],
49
+ ['external-link', 'navegacao', 'link externo abrir nova aba', path('M14 4h6v6M20 4l-9 9') + path('M18 14v4.5a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 4 18.5v-11A1.5 1.5 0 0 1 5.5 6H10')],
50
+ ['corner-down-left', 'navegacao', 'enter confirmar retornar', path('M20 5v7a3 3 0 0 1-3 3H5M9 11l-4 4 4 4')],
51
+ ['log-out', 'navegacao', 'sair desconectar', path('M9.5 20.5H6a2 2 0 0 1-2-2v-13a2 2 0 0 1 2-2h3.5M15.5 16.5 20 12l-4.5-4.5M20 12H9.5')],
52
+ ['compass', 'navegacao', 'explorar bússola descobrir', circle(12, 12, 8.5) + path('m15.5 8.5-2 5-5 2 2-5z')],
53
+
54
+ // Ações
55
+ ['zoom-in', 'acoes', 'aproximar zoom ampliar lupa mais', circle(11, 11, 6.5) + path('m20 20-4.2-4.2M11 8.5v5M8.5 11h5')],
56
+ ['zoom-out', 'acoes', 'afastar zoom reduzir lupa menos', circle(11, 11, 6.5) + path('m20 20-4.2-4.2M8.5 11h5')],
57
+ ['maximize', 'acoes', 'ampliar tela cheia expandir ajustar', path('M8.5 3.5H5a1.5 1.5 0 0 0-1.5 1.5v3.5M15.5 3.5H19a1.5 1.5 0 0 1 1.5 1.5v3.5M8.5 20.5H5A1.5 1.5 0 0 1 3.5 19v-3.5M15.5 20.5H19a1.5 1.5 0 0 0 1.5-1.5v-3.5')],
58
+ ['search', 'acoes', 'buscar procurar lupa', circle(11, 11, 6.5) + path('m20 20-4.2-4.2')],
59
+ ['search-x', 'acoes', 'sem resultados busca vazia nada encontrado', circle(11, 11, 6.5) + path('m20 20-4.2-4.2M8.8 8.8l4.4 4.4M13.2 8.8l-4.4 4.4')],
60
+ ['send', 'acoes', 'enviar mensagem avião', path('M20.5 3.5 10 14M20.5 3.5 14 20.5l-4-6.5-6.5-4z')],
61
+ ['paperclip', 'acoes', 'anexar arquivo clipe anexo', path('m20 11.5-7.8 7.8a5 5 0 0 1-7-7l8.4-8.4a3.3 3.3 0 0 1 4.7 4.7l-8.4 8.4a1.7 1.7 0 0 1-2.4-2.4l7.6-7.6')],
62
+ ['stop-circle', 'acoes', 'parar interromper gerar', circle(12, 12, 8.5) + rect(9, 9, 6, 6, 1.5)],
63
+ ['thumbs-up', 'acoes', 'gostei útil positivo avaliar', path('M7.5 10.5v9.5H5a1.5 1.5 0 0 1-1.5-1.5V12A1.5 1.5 0 0 1 5 10.5zM7.5 10.5 11 3.5a2.5 2.5 0 0 1 2.5 2.5v3.5h5a2 2 0 0 1 2 2.3l-1.2 6.5a2 2 0 0 1-2 1.7H7.5')],
64
+ ['thumbs-down', 'acoes', 'não gostei negativo avaliar', path('M16.5 13.5V4H19a1.5 1.5 0 0 1 1.5 1.5V12a1.5 1.5 0 0 1-1.5 1.5zM16.5 13.5 13 20.5a2.5 2.5 0 0 1-2.5-2.5v-3.5h-5a2 2 0 0 1-2-2.3l1.2-6.5a2 2 0 0 1 2-1.7h9.8')],
65
+ ['at-sign', 'acoes', 'arroba mencionar email', circle(12, 12, 3.5) + path('M15.5 8.5v4.5a2.5 2.5 0 0 0 5 0V12a8.5 8.5 0 1 0-3.4 6.8')],
66
+ ['plus', 'acoes', 'adicionar novo criar mais', path('M12 5v14M5 12h14')],
67
+ ['minus', 'acoes', 'remover menos', path('M5 12h14')],
68
+ ['x', 'acoes', 'fechar cancelar remover', path('M6 6l12 12M18 6 6 18')],
69
+ ['check', 'acoes', 'confirmar ok concluído', path('m5 12.5 4.5 4.5L19 7.5')],
70
+ ['pencil', 'acoes', 'editar criar escrever lápis', path('M16 4.5a2.12 2.12 0 0 1 3 3L8 18.5l-4 1 1-4z') + path('m14 6.5 3 3')],
71
+ ['copy', 'acoes', 'copiar duplicar', rect(8.5, 8.5, 12, 12, 2) + path('M15.5 8.5v-3a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h3')],
72
+ ['trash', 'acoes', 'excluir apagar lixeira', path('M4 6.5h16M9 6.5V5a1.5 1.5 0 0 1 1.5-1.5h3A1.5 1.5 0 0 1 15 5v1.5M6 6.5l1 13a1.5 1.5 0 0 0 1.5 1.5h7a1.5 1.5 0 0 0 1.5-1.5l1-13M10 11v6M14 11v6')],
73
+ ['download', 'acoes', 'baixar exportar', path('M12 4v11M7 10.5l5 5 5-5M4.5 20h15')],
74
+ ['upload', 'acoes', 'enviar importar subir', path('M12 15.5v-11M7 9l5-5 5 5M4.5 20h15')],
75
+ ['link', 'acoes', 'link url corrente', path('M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7') + path('M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7')],
76
+ ['filter', 'acoes', 'filtrar funil', path('M4 5h16l-6 7.5V19l-4 1.5v-8z')],
77
+ ['refresh', 'acoes', 'atualizar recarregar sincronizar', path('M20 11a8 8 0 0 0-14.3-4.6L4 8.5M4 4v4.5h4.5M4 13a8 8 0 0 0 14.3 4.6l1.7-2.1M20 20v-4.5h-4.5')],
78
+ ['more-horizontal', 'acoes', 'mais opções reticências', `<g fill="currentColor">${circle(6, 12, 0.75)}${circle(12, 12, 0.75)}${circle(18, 12, 0.75)}</g>`],
79
+ ['more-vertical', 'acoes', 'mais opções menu', `<g fill="currentColor">${circle(12, 6, 0.75)}${circle(12, 12, 0.75)}${circle(12, 18, 0.75)}</g>`],
80
+ ['grip-vertical', 'acoes', 'arrastar alça mover reordenar', `<g fill="currentColor">${circle(9, 6, 0.75)}${circle(15, 6, 0.75)}${circle(9, 12, 0.75)}${circle(15, 12, 0.75)}${circle(9, 18, 0.75)}${circle(15, 18, 0.75)}</g>`],
81
+ ['zap', 'acoes', 'raio rápido começar', path('M13 2.5 4.5 13.5H12l-1 8 8.5-11H12z')],
82
+ ['play', 'acoes', 'tocar reproduzir iniciar animação', path('M7.5 4.8v14.4a1 1 0 0 0 1.5.86l11.2-7.2a1 1 0 0 0 0-1.72L9 3.94a1 1 0 0 0-1.5.86z')],
83
+ ['pause', 'acoes', 'pausar parar carrossel animação', rect(6.5, 4.75, 3.75, 14.5, 1.25) + rect(13.75, 4.75, 3.75, 14.5, 1.25)],
84
+ ['megaphone', 'acoes', 'novidades anúncio comunicado changelog', path('M4 10v4a1 1 0 0 0 1 1h2l6 4V5L7 9H5a1 1 0 0 0-1 1z') + path('M17 9a3.5 3.5 0 0 1 0 6M8 15.67V19a1.5 1.5 0 0 0 3 0v-1.33')],
85
+ ['slash', 'acoes', 'atalho comando barra', path('M15 4 9 20')],
86
+ ['mic', 'acoes', 'microfone áudio voz', rect(9, 3, 6, 11, 3) + path('M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21')],
87
+ ['video', 'acoes', 'vídeo câmera gravar cena', rect(2.5, 6, 13.5, 12, 2.5) + path('m16 10.5 5.5-3v9l-5.5-3')],
88
+
89
+ // Status e feedback
90
+ ['info', 'status', 'informação ajuda', circle(12, 12, 8.5) + path('M12 11v5.5') + dot(12, 7.75)],
91
+ ['alert-circle', 'status', 'alerta erro atenção', circle(12, 12, 8.5) + path('M12 7.5V13') + dot(12, 16.5)],
92
+ ['alert-triangle', 'status', 'aviso perigo atenção', path('M10.3 4.2 2.9 17.5A2 2 0 0 0 4.6 20.5h14.8a2 2 0 0 0 1.7-3L13.7 4.2a2 2 0 0 0-3.4 0z') + path('M12 9.5v4') + dot(12, 17)],
93
+ ['check-circle', 'status', 'sucesso concluído ok', circle(12, 12, 8.5) + path('m8.5 12 2.5 2.5 4.5-5')],
94
+ ['x-circle', 'status', 'erro falha cancelar', circle(12, 12, 8.5) + path('m9 9 6 6M15 9l-6 6')],
95
+ ['help-circle', 'status', 'ajuda dúvida pergunta', circle(12, 12, 8.5) + path('M9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.6v.3') + dot(12, 17)],
96
+ ['bell', 'status', 'notificação sino alerta', path('M6 16.5V11a6 6 0 1 1 12 0v5.5l1.5 2h-15z') + path('M10 20.5a2.2 2.2 0 0 0 4 0')],
97
+ ['loader', 'status', 'carregando spinner progresso', path('M12 3.5a8.5 8.5 0 1 0 8.5 8.5')],
98
+ ['clock', 'status', 'tempo hora relógio', circle(12, 12, 8.5) + path('M12 7.5V12l3 2')],
99
+ ['history', 'status', 'histórico changelog versões', path('M3.5 12a8.5 8.5 0 1 0 2.6-6.1L3.5 8.5M3.5 4v4.5H8M12 7.5V12l3 2')],
100
+ ['shield', 'status', 'segurança proteção', path('M12 3.5l7.5 2.8v5.4c0 4.4-3.1 7.9-7.5 8.8-4.4-.9-7.5-4.4-7.5-8.8V6.3z')],
101
+ ['lock', 'status', 'bloqueado privado senha', rect(4.5, 10.5, 15, 10, 2.5) + path('M8 10.5v-3a4 4 0 0 1 8 0v3')],
102
+ ['wifi-off', 'status', 'sem conexão offline internet rede', path('M3 3l18 18M8.5 16.4a5 5 0 0 1 3.37-1.42M5 12.9a10 10 0 0 1 2.84-1.95M19 12.9A10 10 0 0 0 13.22 10.11M2 9.4a15 15 0 0 1 2.49-1.8M22 9.4A15 15 0 0 0 9 5.88') + dot(12, 20)],
103
+ ['star', 'status', 'favorito destaque exemplo', path('M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8-4.3-4.1 5.9-.9z')],
104
+ ['heart', 'status', 'curtir favorito amor', path('M12 19.5C6 15.6 3.5 12.6 3.5 9.3A4.5 4.5 0 0 1 12 7a4.5 4.5 0 0 1 8.5 2.3c0 3.3-2.5 6.3-8.5 10.2z')],
105
+ ['flag', 'status', 'bandeira marco denunciar', path('M5 21V4.5h11l-2 4 2 4H5')],
106
+
107
+ // Interface e componentes
108
+ ['settings', 'interface', 'configurações engrenagem ajustes', gear()],
109
+ ['sliders', 'interface', 'ajustes controles preferências', path('M4 7h9M17 7h3M4 17h3M11 17h9') + circle(15, 7, 2) + circle(9, 17, 2)],
110
+ ['sun', 'interface', 'tema claro dia', circle(12, 12, 4) + path('M12 2.5v2M12 19.5v2M4.6 4.6 6 6M18 18l1.4 1.4M2.5 12h2M19.5 12h2M4.6 19.4 6 18M18 6l1.4-1.4')],
111
+ ['moon', 'interface', 'tema escuro noite', path('M10.5 3.5a7.5 7.5 0 0 0 10 10A8.5 8.5 0 1 1 10.5 3.5z')],
112
+ // desenho próprio: base que passa dos picos, neve em zigue-zague no pico maior e um pico atrás
113
+ // desenho próprio: cabana em A (telhado até o chão), porta em arco e chaminé — diferente da casa de “home”
114
+ ['cabin', 'interface', 'cabana abrigo refúgio tema casa', path('M2.5 19.5h19M3.5 19.5 12 4.5l8.5 15M10 19.5v-3.5a2 2 0 0 1 4 0v3.5M16 11.6V7.5h2v7.6')],
115
+ ['mountain', 'interface', 'montanha natureza', path('M2.5 19.5h19M3.5 19.5 10.5 6l7 13.5M14.39 13.5l2.41-4 4.2 10M8.17 10.5l1.6 1.5 1.7-1.4 2 1.2')],
116
+ ['monitor', 'interface', 'sistema tela desktop', rect(3, 4, 18, 12.5, 2.5) + path('M8.5 20.5h7M12 16.5v4')],
117
+ ['scrollbar', 'interface', 'barra de rolagem rolar scroll', rect(4, 3.5, 16, 17, 3) + path('M16 7.5v5')],
118
+ ['eye', 'interface', 'visualizar mostrar ver', path('M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12z') + circle(12, 12, 3)],
119
+ ['eye-off', 'interface', 'ocultar esconder senha', path('M10 5.7a9.6 9.6 0 0 1 2-.2c6 0 9.5 6.5 9.5 6.5a17 17 0 0 1-2.6 3.4M6.6 6.6C4 8.3 2.5 12 2.5 12S6 18.5 12 18.5a9.4 9.4 0 0 0 5.2-1.3M9.9 9.9a3 3 0 0 0 4.2 4.2M3.5 3.5l17 17')],
120
+ ['keyboard', 'interface', 'teclado atalhos teclas', rect(2.5, 6, 19, 12, 2.5) + path('M6 10h.01M9.3 10h.01M12.6 10h.01M15.9 10h.01M18 10h.01M7 14h10')],
121
+ ['command', 'interface', 'comando cmd atalho mac', path('M9 9V6.5A2.5 2.5 0 1 0 6.5 9H9zm0 0h6m-6 0v6m6-6V6.5A2.5 2.5 0 1 1 17.5 9H15zm0 0v6m0 0h-6m6 0v2.5a2.5 2.5 0 1 0 2.5-2.5H15zm-6 0v2.5A2.5 2.5 0 1 1 6.5 15H9z')],
122
+ ['app-shell', 'interface', 'layout estrutura janela sidebar', rect(3, 4, 18, 16, 3) + path('M9 4v16M9 9h12')],
123
+ ['layout', 'interface', 'dashboard grade blocos', rect(3.5, 3.5, 7, 9, 2) + rect(13.5, 3.5, 7, 5, 2) + rect(13.5, 11.5, 7, 9, 2) + rect(3.5, 15.5, 7, 5, 2)],
124
+ ['button', 'interface', 'botão ação cta', rect(3, 7, 18, 10, 3.5) + path('M8.5 12h7')],
125
+ ['input', 'interface', 'campo texto formulário', rect(2.5, 6.5, 19, 11, 3) + path('M7 9.5v5')],
126
+ ['check-square', 'interface', 'checkbox seleção marcar', rect(3.5, 3.5, 17, 17, 4) + path('m8 12 3 3 5-6')],
127
+ ['radio', 'interface', 'opção única radio', circle(12, 12, 8.5) + fillDot(12, 12, 3.5)],
128
+ ['toggle', 'interface', 'switch alternar ligar', rect(2.5, 6.5, 19, 11, 5.5) + circle(16, 12, 2.75)],
129
+ ['tag', 'interface', 'badge etiqueta rótulo', path('M3.5 5v6.2a1.5 1.5 0 0 0 .44 1.06l8 8a1.5 1.5 0 0 0 2.12 0l6.2-6.2a1.5 1.5 0 0 0 0-2.12l-8-8A1.5 1.5 0 0 0 11.2 3.5H5A1.5 1.5 0 0 0 3.5 5z') + dot(8, 8)],
130
+ ['card', 'interface', 'cartão bloco conteúdo', rect(3, 4.5, 18, 15, 3) + path('M3 10h18')],
131
+ ['dialog', 'interface', 'modal janela diálogo', rect(2.5, 4.5, 19, 15, 3) + path('M2.5 9h19') + dot(6, 6.8) + dot(8.5, 6.8)],
132
+ ['tabs', 'interface', 'abas guias navegação', rect(3, 4, 18, 16, 3) + path('M3 9h18M9.5 4v5')],
133
+ ['carousel', 'interface', 'carrossel galeria destaques slides', rect(6.5, 5, 11, 14, 2.5) + path('M3 7.5v9M21 7.5v9')],
134
+ ['resizable', 'interface', 'painéis redimensionáveis dividir arrastar divisória split', rect(3.5, 4, 17, 16, 2.5) + path('M12 4v16M7.5 10l-2 2 2 2M16.5 10l2 2-2 2')],
135
+ ['kanban', 'interface', 'kanban quadro colunas cartões tarefas', rect(3.5, 4, 17, 16, 2.5) + path('M8 8v7M12 8v10M16 8v4')],
136
+ ['tooltip', 'interface', 'dica balão ajuda', path('M5 4.5h14a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-4.5L12 19.5l-2.5-3H5a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2z')],
137
+ ['table', 'interface', 'tabela dados grade', rect(3.5, 4, 17, 16, 2.5) + path('M3.5 9.5h17M3.5 15h17M9.5 9.5V20')],
138
+ ['list', 'interface', 'lista itens', path('M9 6h11M9 12h11M9 18h11') + dot(4.5, 6) + dot(4.5, 12) + dot(4.5, 18)],
139
+ ['bold', 'interface', 'negrito texto editor formatação', path('M7 4.5h5.5a3.75 3.75 0 0 1 0 7.5H7zM7 12h6.5a3.75 3.75 0 0 1 0 7.5H7z')],
140
+ ['italic', 'interface', 'itálico texto editor formatação', path('M10 4.5h8M6 19.5h8M14 4.5l-4 15')],
141
+ ['underline', 'interface', 'sublinhado texto editor formatação', path('M7 4v7a5 5 0 0 0 10 0V4M5 20h14')],
142
+ ['strikethrough', 'interface', 'tachado riscado texto editor formatação', path('M4 12h16M16.5 7.5c-.5-1.8-2.2-3-4.5-3-2.6 0-4.5 1.4-4.5 3.5 0 1.4.9 2.4 2.7 3.1M7.8 16.4c.6 1.9 2.3 3.1 4.4 3.1 2.6 0 4.5-1.4 4.5-3.5 0-.7-.2-1.3-.6-1.9')],
143
+ ['align-left', 'interface', 'alinhar esquerda texto parágrafo', path('M4 6h16M4 12h10M4 18h13')],
144
+ ['align-center', 'interface', 'centralizar alinhar centro texto parágrafo', path('M4 6h16M7 12h10M5.5 18h13')],
145
+ ['align-right', 'interface', 'alinhar direita texto parágrafo', path('M4 6h16M10 12h10M7 18h13')],
146
+ ['list-ordered', 'interface', 'lista numerada ordenada itens', path('M10 6h10M10 12h10M10 18h10M4 4.5l1.5-1V9M3.5 14c.2-.6.8-1 1.5-1 .8 0 1.5.6 1.5 1.4 0 1.4-3 2.1-3 3.6h3')],
147
+ ['heading', 'interface', 'título cabeçalho texto editor formatação', path('M6 5v14M18 5v14M6 12h12')],
148
+ ['quote', 'interface', 'citação aspas texto editor formatação', path('M5 18.5c2.5-1 4-3 4-6V7H5v5h4M15 18.5c2.5-1 4-3 4-6V7h-4v5h4')],
149
+ ['undo', 'acoes', 'desfazer voltar', path('M9 13.5 4.5 9 9 4.5M4.5 9h10a5 5 0 0 1 0 10H11')],
150
+ ['redo', 'acoes', 'refazer avançar', path('M15 13.5 19.5 9 15 4.5M19.5 9h-10a5 5 0 0 0 0 10H13')],
151
+ ['divider', 'interface', 'divisor separador linha entre blocos', rect(4.5, 3.5, 15, 5, 1.5) + path('M3 12h18') + rect(4.5, 15.5, 15, 5, 1.5)],
152
+ ['progress-ring', 'status', 'progresso circular anel porcentagem', path('M12 3.5a8.5 8.5 0 1 1-8.5 8.5') + path('M9.5 14.5l5-5') + dot(9.5, 9.5) + dot(14.5, 14.5)],
153
+ ['banner', 'interface', 'banner anúncio faixa topo aviso', rect(3, 4, 18, 16, 3) + path('M3 9.5h18M6.5 6.75h7')+ dot(17.5, 6.75)],
154
+ ['toolbar', 'interface', 'barra de ferramentas ações agrupadas', rect(3, 7, 18, 10, 3) + path('M12 9.5v5') + dot(7.5, 12) + dot(16.5, 12)],
155
+ ['message-square', 'interface', 'mensagem toast chat comentário', path('M20.5 15a2 2 0 0 1-2 2H8l-4.5 3.5V5.5a2 2 0 0 1 2-2h13a2 2 0 0 1 2 2z')],
156
+ ['stack', 'interface', 'conteúdos coleção pilha', rect(3.5, 8.5, 17, 12, 2.5) + path('M5.5 5.5h13M7.5 3h9')],
157
+
158
+ // Objetos
159
+ ['calendar', 'objetos', 'calendário data agenda evento', rect(3.5, 5, 17, 15.5, 3) + path('M3.5 10h17M8 3v4M16 3v4') + dot(8, 14) + dot(12, 14) + dot(16, 14) + dot(8, 17.2) + dot(12, 17.2)],
160
+ ['file-text', 'objetos', 'documento arquivo página', path('M14 3.5H7a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8.5z') + path('M14 3.5v5h5M9 13h6M9 16.5h4')],
161
+ ['folder', 'objetos', 'pasta diretório', path('M3.5 7a2 2 0 0 1 2-2h4l2 2.5h7a2 2 0 0 1 2 2V17a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2z')],
162
+ ['inbox', 'objetos', 'caixa entrada vazio', path('M3.5 13h5l1.5 2.5h4l1.5-2.5h5') + path('M6 4.5h12l2.5 8.5v5.5a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2V13z')],
163
+ ['image', 'objetos', 'imagem foto mídia', rect(3.5, 3.5, 17, 17, 3) + circle(9, 9, 1.5) + path('m20.5 14.5-4-4L6.5 20.5')],
164
+ ['package', 'objetos', 'pacote versão release', path('M12 3 20 7.5v9L12 21l-8-4.5v-9z') + path('M4 7.5 12 12l8-4.5M12 12v9')],
165
+ ['book-open', 'objetos', 'documentação guia livro', path('M12 7c-1.8-1.6-4.5-2.5-8.5-2.5v13c4 0 6.7.9 8.5 2.5 1.8-1.6 4.5-2.5 8.5-2.5v-13c-4 0-6.7.9-8.5 2.5zM12 7v13')],
166
+ ['code', 'objetos', 'código desenvolvimento', path('m8.5 7-5 5 5 5M15.5 7l5 5-5 5')],
167
+ ['terminal', 'objetos', 'linha de comando console', path('m5 7.5 4.5 4.5L5 16.5M12 17h7')],
168
+ ['git-branch', 'objetos', 'branch versão ramificação', circle(6.5, 5.5, 2) + circle(6.5, 18.5, 2) + circle(17.5, 7.5, 2) + path('M6.5 7.5v9M17.5 9.5a6 6 0 0 1-6 6h-3')],
169
+ ['git-pull-request', 'objetos', 'contribuir pull request revisão', circle(6, 6, 2) + circle(6, 18, 2) + circle(18, 18, 2) + path('M6 8v8M18 16V9a2 2 0 0 0-2-2h-4M14 4.5 11.5 7 14 9.5')],
170
+ ['mail', 'objetos', 'email mensagem carta', rect(3, 5, 18, 14, 3) + path('m3.5 7.5 8.5 6 8.5-6')],
171
+ ['globe', 'objetos', 'mundo idioma web', circle(12, 12, 8.5) + path('M3.5 12h17M12 3.5c2.3 2.3 3.5 5.2 3.5 8.5s-1.2 6.2-3.5 8.5c-2.3-2.3-3.5-5.2-3.5-8.5s1.2-6.2 3.5-8.5z')],
172
+ ['target', 'objetos', 'alvo objetivo foco', circle(12, 12, 8.5) + circle(12, 12, 5) + circle(12, 12, 1.5)],
173
+ ['hash', 'objetos', 'número tag canal', path('M5 9h14M5 15h14M10 4 8 20M16 4l-2 16')],
174
+
175
+ // Gráficos
176
+ ['dashboard', 'graficos', 'painel visão geral indicadores gráficos', rect(3.5, 3.5, 17, 17, 3) + path('M3.5 9h17M8 16.5v-3M12 16.5v-4.5M16 16.5v-2')],
177
+ ['bar-chart', 'graficos', 'gráfico barras colunas resultados métricas', path('M5 20v-5M9.7 20V9M14.3 20v-7.5M19 20V4.5')],
178
+ ['line-chart', 'graficos', 'gráfico linha tendência série temporal', path('M3.5 4v14.5a1.5 1.5 0 0 0 1.5 1.5h15.5') + path('m7.5 15 3.5-4.5 3 3 5.5-7')],
179
+ ['area-chart', 'graficos', 'gráfico área volume acumulado', path('M3.5 4v14.5a1.5 1.5 0 0 0 1.5 1.5h15.5') + path('M7.5 16.5V14l3.5-4 3 2.5 5-5.5v9.5z')],
180
+ ['donut', 'graficos', 'gráfico rosca pizza proporção parte do todo', circle(12, 12, 8.5) + circle(12, 12, 3.5) + path('M12 3.5v5M20.5 12h-5')],
181
+ ['heatmap', 'graficos', 'mapa de calor matriz intensidade calendário', `<rect x="3.5" y="3.5" width="4.5" height="4.5" rx="1.25" fill="currentColor" stroke="none"/><rect x="9.75" y="3.5" width="4.5" height="4.5" rx="1.25" fill="currentColor" stroke="none" fill-opacity="0.35"/><rect x="16" y="3.5" width="4.5" height="4.5" rx="1.25" fill="currentColor" stroke="none" fill-opacity="0.7"/><rect x="3.5" y="9.75" width="4.5" height="4.5" rx="1.25" fill="currentColor" stroke="none" fill-opacity="0.35"/><rect x="9.75" y="9.75" width="4.5" height="4.5" rx="1.25" fill="currentColor" stroke="none"/><rect x="16" y="9.75" width="4.5" height="4.5" rx="1.25" fill="currentColor" stroke="none" fill-opacity="0.35"/><rect x="3.5" y="16" width="4.5" height="4.5" rx="1.25" fill="currentColor" stroke="none" fill-opacity="0.7"/><rect x="9.75" y="16" width="4.5" height="4.5" rx="1.25" fill="currentColor" stroke="none" fill-opacity="0.35"/><rect x="16" y="16" width="4.5" height="4.5" rx="1.25" fill="currentColor" stroke="none"/>`],
182
+ ['scatter', 'graficos', 'dispersão pontos correlação bolhas', path('M3.5 4v14.5a1.5 1.5 0 0 0 1.5 1.5h15.5') + fillDot(8.5, 14.5, 1.5) + fillDot(11.5, 9.5, 1.5) + fillDot(15, 12.5, 1.5) + fillDot(18, 6.5, 1.5)],
183
+ ['gauge', 'graficos', 'indicador medidor progresso kpi', path('M4.2 17.5a8.5 8.5 0 1 1 15.6 0') + path('m12 14 3.5-5') + fillDot(12, 14, 1.6)],
184
+ ['trending-up', 'graficos', 'alta subir crescimento variação', path('m3.5 16.5 5.5-5.5 4 4 7.5-7.5') + path('M14.5 7.5h6v6')],
185
+ ['trending-down', 'graficos', 'baixa cair queda variação', path('m3.5 7.5 5.5 5.5 4-4 7.5 7.5') + path('M14.5 16.5h6v-6')],
186
+
187
+ // Design
188
+ ['palette', 'design', 'cores paleta tinta', path('M12 3.5a8.5 8.5 0 0 0 0 17c1.1 0 1.8-.8 1.8-1.8 0-.5-.2-.9-.5-1.2-.3-.3-.5-.7-.5-1.2 0-1 .8-1.8 1.8-1.8h2.1a3.8 3.8 0 0 0 3.8-3.8C20.5 6.9 16.7 3.5 12 3.5z') + fillDot(7.8, 11.2) + fillDot(9.6, 7.3) + fillDot(14.2, 6.9) + fillDot(17.2, 9.6)],
189
+ ['droplet', 'design', 'cor gota preenchimento', path('M12 3.5c3 3.5 5.5 6.6 5.5 10a5.5 5.5 0 0 1-11 0c0-3.4 2.5-6.5 5.5-10z')],
190
+ ['type', 'design', 'tipografia texto fonte', path('M5 7V5h14v2M12 5v14M9 19h6')],
191
+ ['shapes', 'design', 'ícones formas geometria', path('M7.5 3.5 11.5 10.5h-8z') + rect(13, 3.5, 7.5, 7, 2) + circle(12, 17, 3.5)],
192
+ ['grid', 'design', 'grade layout colunas', rect(4, 4, 6.5, 6.5, 2) + rect(13.5, 4, 6.5, 6.5, 2) + rect(4, 13.5, 6.5, 6.5, 2) + rect(13.5, 13.5, 6.5, 6.5, 2)],
193
+ ['layers', 'design', 'camadas componentes contexto', path('m12 3.5 8.5 4.5-8.5 4.5L3.5 8z') + path('m3.5 12 8.5 4.5 8.5-4.5') + path('m3.5 16 8.5 4.5 8.5-4.5')],
194
+ ['component', 'design', 'componente biblioteca símbolo', path('M12 2.5 15 5.5 12 8.5 9 5.5zM5.5 9 8.5 12 5.5 15 2.5 12zM18.5 9l3 3-3 3-3-3zM12 15.5l3 3-3 3-3-3z')],
195
+ ['spacing', 'design', 'espaçamento distância medida', path('M3.5 4v16M20.5 4v16M7.5 12h9M10 9.5 7.5 12l2.5 2.5M14 9.5l2.5 2.5-2.5 2.5')],
196
+ ['radius', 'design', 'raio canto arredondado borda', path('M4 20v-8a8 8 0 0 1 8-8h8')],
197
+ ['elevation', 'design', 'elevação sombra profundidade', rect(3.5, 3.5, 13, 13, 3) + path('M20.5 8v10.5a2 2 0 0 1-2 2H8')],
198
+ ['motion', 'design', 'movimento animação onda', path('M3 12h4l2.5-6 5 12L17 12h4')],
199
+ ['accessibility', 'design', 'acessibilidade a11y inclusão', circle(12, 4.5, 1.5) + path('M5 8.5l7 1.5 7-1.5M12 10v4.5M9.5 20.5l2.5-6 2.5 6')],
200
+
201
+ // Pessoas
202
+ ['user', 'pessoas', 'usuário pessoa perfil', circle(12, 8, 4) + path('M4.5 20.5a7.5 7.5 0 0 1 15 0')],
203
+ ['user-circle', 'pessoas', 'avatar conta perfil', circle(12, 12, 8.5) + circle(12, 10, 3) + path('M6.7 18.4a6.5 6.5 0 0 1 10.6 0')],
204
+ ['users', 'pessoas', 'equipe grupo pessoas', circle(9, 8, 3.5) + path('M2.5 20a6.5 6.5 0 0 1 13 0') + path('M15.5 4.7a3.5 3.5 0 0 1 0 6.6M18 14.2a6.5 6.5 0 0 1 3.5 5.8')],
205
+ ];
206
+
207
+ export const iconCategories = {
208
+ navegacao: 'Navegação',
209
+ acoes: 'Ações',
210
+ status: 'Status e feedback',
211
+ interface: 'Interface',
212
+ objetos: 'Objetos',
213
+ design: 'Design',
214
+ graficos: 'Gráficos',
215
+ pessoas: 'Pessoas',
216
+ };
217
+
218
+ export const icons = Object.fromEntries(
219
+ DEFINITIONS.map(([name, category, keywords, body]) => [name, { name, category, keywords: keywords.split(' '), body }]),
220
+ );
221
+
222
+ export const iconList = Object.values(icons);
223
+
224
+ const FALLBACK = rect(4, 4, 16, 16, 3).replace('/>', ' stroke-dasharray="2 2"/>');
225
+ const escapeAttr = (s) => String(s).replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/</g, '&lt;');
226
+
227
+ /** Retorna o SVG de um ícone como string. */
228
+ export function icon(name, { size = 20, strokeWidth, label, className = '' } = {}) {
229
+ const def = icons[name];
230
+ if (!def) console.warn(`[Lume] ícone "${name}" não existe.`);
231
+ const px = Number(size);
232
+ const sw = strokeWidth ?? (px <= 16 ? 1.75 : 1.5);
233
+ const a11y = label ? `role="img" aria-label="${escapeAttr(label)}"` : 'aria-hidden="true"';
234
+ return `<svg class="ds-icon${className ? ` ${className}` : ''}" width="${px}" height="${px}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round" focusable="false" ${a11y}>${def?.body ?? FALLBACK}</svg>`;
235
+ }
236
+
237
+ /**
238
+ * <ds-icon name="home" size="20" label="Início"></ds-icon>
239
+ * Só se registra onde há navegador: no servidor (Next.js, renderização no servidor) o import não quebra, e icon() continua valendo.
240
+ */
241
+ if (typeof HTMLElement !== 'undefined' && typeof customElements !== 'undefined' && !customElements.get('ds-icon')) {
242
+ class DsIcon extends HTMLElement {
243
+ static observedAttributes = ['name', 'size', 'stroke', 'label'];
244
+
245
+ connectedCallback() {
246
+ this.render();
247
+ }
248
+
249
+ attributeChangedCallback() {
250
+ if (this.isConnected) this.render();
251
+ }
252
+
253
+ render() {
254
+ const size = this.getAttribute('size') ?? 20;
255
+ const stroke = this.getAttribute('stroke');
256
+ this.style.width = this.style.height = `${size}px`;
257
+ this.innerHTML = icon(this.getAttribute('name'), {
258
+ size,
259
+ strokeWidth: stroke ? Number(stroke) : undefined,
260
+ label: this.getAttribute('label') ?? undefined,
261
+ });
262
+ }
263
+ }
264
+
265
+ customElements.define('ds-icon', DsIcon);
266
+ }
@@ -0,0 +1,2 @@
1
+ // Gerado por scripts/build-react.mjs. Não edite.
2
+ export declare function createBackToTop(scroller: HTMLElement, options?: Record<string, unknown>): { el: HTMLButtonElement; update(): void; destroy(): void };
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Voltar ao topo — botão que aparece quando a área já rolou bastante e leva de volta ao começo.
3
+ *
4
+ * const back = createBackToTop(document.querySelector('.painel__rolagem'), {
5
+ * parent: document.querySelector('.painel'), // onde o botão entra (padrão: o pai da área); precisa ter position
6
+ * threshold: 600, // px rolados para aparecer (padrão: uma tela da própria área)
7
+ * focusTarget: document.querySelector('main'), // recebe o foco ao voltar (padrão: a própria área)
8
+ * });
9
+ * back.el; back.update(); back.destroy();
10
+ *
11
+ * O botão fica ancorado no canto inferior do contêiner, não da janela: funciona igual em qualquer layout.
12
+ * Quem pede menos movimento no sistema volta ao topo sem animação.
13
+ */
14
+ import { icon } from '../icons/icons.js';
15
+ import { msg } from './i18n.js';
16
+
17
+ export function createBackToTop(scroller, options = {}) {
18
+ const parent = options.parent ?? scroller.parentElement;
19
+ const focusTarget = options.focusTarget ?? scroller;
20
+
21
+ const button = document.createElement('button');
22
+ button.type = 'button';
23
+ button.className = 'ds-back-to-top';
24
+ button.innerHTML = icon('arrow-up', { size: 20 });
25
+ button.dataset.dsTooltipPlacement = 'left';
26
+
27
+ const applyLabel = () => {
28
+ const label = options.label ?? msg('backToTop.label');
29
+ button.setAttribute('aria-label', label);
30
+ button.dataset.dsTooltip = label;
31
+ };
32
+
33
+ const update = () => {
34
+ const limit = options.threshold ?? scroller.clientHeight;
35
+ button.toggleAttribute('data-visible', scroller.scrollTop > limit);
36
+ };
37
+
38
+ const onClick = () => {
39
+ const calm = matchMedia('(prefers-reduced-motion: reduce)').matches;
40
+ // o botão some ao chegar no topo: o foco vai para o conteúdo, para não se perder
41
+ if (!focusTarget.hasAttribute('tabindex')) focusTarget.setAttribute('tabindex', '-1');
42
+ focusTarget.focus({ preventScroll: true });
43
+ scroller.scrollTo({ top: 0, behavior: calm ? 'auto' : 'smooth' });
44
+ };
45
+
46
+ applyLabel();
47
+ update();
48
+ parent.append(button);
49
+ button.addEventListener('click', onClick);
50
+ scroller.addEventListener('scroll', update, { passive: true });
51
+ document.documentElement.addEventListener('ds:localechange', applyLabel);
52
+
53
+ return {
54
+ el: button,
55
+ update,
56
+ destroy() {
57
+ scroller.removeEventListener('scroll', update);
58
+ document.documentElement.removeEventListener('ds:localechange', applyLabel);
59
+ button.remove();
60
+ },
61
+ };
62
+ }
package/js/banner.js ADDED
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Banner de anúncio — fechar e lembrar que a pessoa fechou.
3
+ *
4
+ * const banner = createBanner(document.querySelector('.ds-banner'), {
5
+ * id: 'lume-0.35', // muda o id a cada anúncio novo: quem fechou o anterior vê o novo
6
+ * remember: true, // guarda no navegador que este id foi fechado (padrão: sim, quando há id)
7
+ * onClose: () => {},
8
+ * });
9
+ * banner.close(); banner.show(); banner.reset(); banner.destroy();
10
+ *
11
+ * O botão de fechar é o .ds-banner__close que já está na marcação; o nome dele (“Fechar anúncio”)
12
+ * vem no idioma do Lume se a marcação não trouxer um. Ao fechar com o foco dentro do banner,
13
+ * o foco vai para focusAfterClose (um elemento) ou para o começo do conteúdo seguinte.
14
+ */
15
+ import { msg } from './i18n.js';
16
+
17
+ const KEY = 'ds-banner:';
18
+ const read = (key) => {
19
+ try {
20
+ return localStorage.getItem(key);
21
+ } catch {
22
+ return null;
23
+ }
24
+ };
25
+ const write = (key, value) => {
26
+ try {
27
+ if (value === null) localStorage.removeItem(key);
28
+ else localStorage.setItem(key, value);
29
+ } catch {
30
+ /* sem armazenamento: o banner só fica fechado até recarregar */
31
+ }
32
+ };
33
+
34
+ export function createBanner(root, options = {}) {
35
+ const o = { id: root.dataset.bannerId || '', remember: true, focusAfterClose: null, onClose: null, ...options };
36
+ const key = o.id && o.remember ? KEY + o.id : '';
37
+ const button = root.querySelector('.ds-banner__close');
38
+ const named = button?.hasAttribute('aria-label');
39
+ if (button && !named) button.setAttribute('aria-label', msg('banner.close'));
40
+ if (!root.hasAttribute('role')) root.setAttribute('role', 'region');
41
+ if (!root.hasAttribute('aria-label') && !root.hasAttribute('aria-labelledby')) root.setAttribute('aria-label', msg('banner.label'));
42
+
43
+ if (key && read(key)) root.hidden = true;
44
+
45
+ function close() {
46
+ if (root.hidden) return;
47
+ const hadFocus = root.contains(document.activeElement);
48
+ root.hidden = true;
49
+ if (key) write(key, '1');
50
+ if (hadFocus) {
51
+ const next = o.focusAfterClose ?? root.nextElementSibling;
52
+ if (next) {
53
+ if (!next.matches('a[href], button, input, select, textarea, [tabindex]')) next.setAttribute('tabindex', '-1');
54
+ next.focus({ preventScroll: true });
55
+ }
56
+ }
57
+ o.onClose?.();
58
+ }
59
+
60
+ const onClick = (event) => {
61
+ if (event.target.closest('.ds-banner__close')) close();
62
+ };
63
+ const onLocale = () => {
64
+ if (button && !named) button.setAttribute('aria-label', msg('banner.close'));
65
+ };
66
+
67
+ root.addEventListener('click', onClick);
68
+ document.documentElement.addEventListener('ds:localechange', onLocale);
69
+
70
+ return {
71
+ get isOpen() {
72
+ return !root.hidden;
73
+ },
74
+ close,
75
+ /** Mostra de novo, sem esquecer que foi fechado (no próximo carregamento, continua fechado). */
76
+ show: () => (root.hidden = false),
77
+ /** Esquece que foi fechado e mostra. */
78
+ reset() {
79
+ if (key) write(key, null);
80
+ root.hidden = false;
81
+ },
82
+ destroy() {
83
+ root.removeEventListener('click', onClick);
84
+ document.documentElement.removeEventListener('ds:localechange', onLocale);
85
+ },
86
+ };
87
+ }
@@ -0,0 +1,3 @@
1
+ // Gerado por scripts/build-react.mjs. Não edite.
2
+ export declare function localeWeekStart(tag?: string): number;
3
+ export declare function createCalendar(root: HTMLElement, options?: Record<string, unknown>): { view: 'month' | 'week' | 'day'; date: Date; setView(view: string): void; setDate(date: Date): void; today(): void; prev(): void; next(): void; setEvents(events: any[]): void; destroy(): void };