@sula-tech/webcomponents 0.19.3 → 0.20.1

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 (207) hide show
  1. package/dist/cjs/{index-i5WGQEGK.js → index-BjAGuSPl.js} +30 -5
  2. package/dist/cjs/index-BjAGuSPl.js.map +1 -0
  3. package/dist/cjs/index.cjs.js +17 -11
  4. package/dist/cjs/index.cjs.js.map +1 -1
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/sula-avatar_31.cjs.entry.js +59 -49
  7. package/dist/cjs/sula-avatar_31.cjs.entry.js.map +1 -1
  8. package/dist/cjs/sula-menu.model-BDxbWyPG.js +16 -0
  9. package/dist/cjs/sula-menu.model-BDxbWyPG.js.map +1 -0
  10. package/dist/cjs/sula-toast-stack.cjs.entry.js +314 -0
  11. package/dist/cjs/sula-toast-stack.cjs.entry.js.map +1 -0
  12. package/dist/cjs/sula-toast-stack.entry.cjs.js.map +1 -0
  13. package/dist/cjs/sula-toast.cjs.entry.js +195 -0
  14. package/dist/cjs/sula-toast.cjs.entry.js.map +1 -0
  15. package/dist/cjs/sula-toast.entry.cjs.js.map +1 -0
  16. package/dist/cjs/sula-toast.model-frnF9yhp.js +14 -0
  17. package/dist/cjs/sula-toast.model-frnF9yhp.js.map +1 -0
  18. package/dist/cjs/webcomponents.cjs.js +2 -2
  19. package/dist/collection/collection-manifest.json +2 -0
  20. package/dist/collection/components/sula-avatar/sula-avatar.css +1 -1
  21. package/dist/collection/components/sula-badge/sula-badge.css +1 -1
  22. package/dist/collection/components/sula-breadcrumb/sula-breadcrumb.css +1 -1
  23. package/dist/collection/components/sula-button/sula-button.css +1 -1
  24. package/dist/collection/components/sula-checkbox/sula-checkbox.css +1 -1
  25. package/dist/collection/components/sula-chip/sula-chip.css +1 -1
  26. package/dist/collection/components/sula-dropdown/sula-dropdown.css +1 -1
  27. package/dist/collection/components/sula-icon/sula-icon.css +1 -1
  28. package/dist/collection/components/sula-icon-picker/model/sula-icon-picker.model.js.map +1 -1
  29. package/dist/collection/components/sula-icon-picker/sula-icon-picker.css +1 -1
  30. package/dist/collection/components/sula-icon-picker/sula-icon-picker.js +18 -8
  31. package/dist/collection/components/sula-icon-picker/sula-icon-picker.js.map +1 -1
  32. package/dist/collection/components/sula-loader/sula-loader.css +1 -1
  33. package/dist/collection/components/sula-menu/sula-menu.css +1 -1
  34. package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.css +1 -1
  35. package/dist/collection/components/sula-modal/sula-modal.css +1 -1
  36. package/dist/collection/components/sula-progress-bar/sula-progress-bar.css +1 -1
  37. package/dist/collection/components/sula-radio-button/sula-radio-button.css +1 -1
  38. package/dist/collection/components/sula-search-bar/sula-search-bar.css +1 -1
  39. package/dist/collection/components/sula-segmented-control/sula-segmented-control.css +1 -1
  40. package/dist/collection/components/sula-switch/sula-switch.css +1 -1
  41. package/dist/collection/components/sula-table/sula-table.css +1 -1
  42. package/dist/collection/components/sula-table-body/sula-table-body.css +1 -1
  43. package/dist/collection/components/sula-table-cell/sula-table-cell.css +1 -1
  44. package/dist/collection/components/sula-table-head-cell/sula-table-head-cell.css +1 -1
  45. package/dist/collection/components/sula-table-header/sula-table-header.css +1 -1
  46. package/dist/collection/components/sula-table-row/sula-table-row.css +1 -1
  47. package/dist/collection/components/sula-tag/sula-tag.css +1 -1
  48. package/dist/collection/components/sula-textarea/sula-textarea.css +1 -1
  49. package/dist/collection/components/sula-textfield/sula-textfield.css +1 -1
  50. package/dist/collection/components/sula-tiles/sula-tiles.css +1 -1
  51. package/dist/collection/components/sula-timeline-list/sula-timeline-list.css +1 -1
  52. package/dist/collection/components/sula-toast/model/sula-toast.model.js +10 -0
  53. package/dist/collection/components/sula-toast/model/sula-toast.model.js.map +1 -0
  54. package/dist/collection/components/sula-toast/sula-toast.css +1 -0
  55. package/dist/collection/components/sula-toast/sula-toast.js +501 -0
  56. package/dist/collection/components/sula-toast/sula-toast.js.map +1 -0
  57. package/dist/collection/components/sula-toast/sula-toast.stories.js +101 -0
  58. package/dist/collection/components/sula-toast/sula-toast.stories.js.map +1 -0
  59. package/dist/collection/components/sula-toast-stack/model/sula-toast-stack.model.js +2 -0
  60. package/dist/collection/components/sula-toast-stack/model/sula-toast-stack.model.js.map +1 -0
  61. package/dist/collection/components/sula-toast-stack/sula-toast-stack.css +1 -0
  62. package/dist/collection/components/sula-toast-stack/sula-toast-stack.js +333 -0
  63. package/dist/collection/components/sula-toast-stack/sula-toast-stack.js.map +1 -0
  64. package/dist/collection/components/sula-toast-stack/sula-toast-stack.motion.js +67 -0
  65. package/dist/collection/components/sula-toast-stack/sula-toast-stack.motion.js.map +1 -0
  66. package/dist/collection/components/sula-toast-stack/sula-toast-stack.stories.js +87 -0
  67. package/dist/collection/components/sula-toast-stack/sula-toast-stack.stories.js.map +1 -0
  68. package/dist/collection/components/sula-toggle/sula-toggle.css +1 -1
  69. package/dist/collection/components/sula-toggle/sula-toggle.js +1 -1
  70. package/dist/collection/components/sula-tooltip/sula-tooltip.css +1 -1
  71. package/dist/collection/components/sula-tooltip/sula-tooltip.js +1 -1
  72. package/dist/collection/index.js +1 -0
  73. package/dist/collection/index.js.map +1 -1
  74. package/dist/components/index.js +3 -15
  75. package/dist/components/index.js.map +1 -1
  76. package/dist/components/{p-CelSwSJG.js → p-CJ2i2jVV.js} +5 -5
  77. package/dist/components/{p-CelSwSJG.js.map → p-CJ2i2jVV.js.map} +1 -1
  78. package/dist/components/p-Cs9RR1ZV.js +16 -0
  79. package/dist/components/p-Cs9RR1ZV.js.map +1 -0
  80. package/dist/components/{p-Bqd5Y-Ir.js → p-D0ZAC0yK.js} +6 -6
  81. package/dist/components/p-D0ZAC0yK.js.map +1 -0
  82. package/dist/components/{p-BJQZqrGi.js → p-DGfvh6dZ.js} +5 -5
  83. package/dist/components/{p-BJQZqrGi.js.map → p-DGfvh6dZ.js.map} +1 -1
  84. package/dist/components/{p-Cy4ZswbA.js → p-DYfmicjp.js} +31 -6
  85. package/dist/components/p-DYfmicjp.js.map +1 -0
  86. package/dist/components/{p-f7rEWsEo.js → p-DmCNhtp_.js} +4 -4
  87. package/dist/components/{p-f7rEWsEo.js.map → p-DmCNhtp_.js.map} +1 -1
  88. package/dist/components/p-DmQoJS86.js +235 -0
  89. package/dist/components/p-DmQoJS86.js.map +1 -0
  90. package/dist/components/{p-bHiC51v2.js → p-DqRqPukj.js} +4 -4
  91. package/dist/components/{p-bHiC51v2.js.map → p-DqRqPukj.js.map} +1 -1
  92. package/dist/components/{p-D1tWu3qb.js → p-b7t6bSNa.js} +6 -6
  93. package/dist/components/{p-D1tWu3qb.js.map → p-b7t6bSNa.js.map} +1 -1
  94. package/dist/components/p-t0X4JATS.js +14 -0
  95. package/dist/components/p-t0X4JATS.js.map +1 -0
  96. package/dist/components/sula-avatar.js +3 -3
  97. package/dist/components/sula-avatar.js.map +1 -1
  98. package/dist/components/sula-badge.js +3 -3
  99. package/dist/components/sula-badge.js.map +1 -1
  100. package/dist/components/sula-breadcrumb.js +3 -3
  101. package/dist/components/sula-breadcrumb.js.map +1 -1
  102. package/dist/components/sula-button.js +1 -1
  103. package/dist/components/sula-checkbox.js +3 -3
  104. package/dist/components/sula-checkbox.js.map +1 -1
  105. package/dist/components/sula-chip.js +4 -4
  106. package/dist/components/sula-chip.js.map +1 -1
  107. package/dist/components/sula-dropdown.js +1 -1
  108. package/dist/components/sula-icon-picker.js +24 -14
  109. package/dist/components/sula-icon-picker.js.map +1 -1
  110. package/dist/components/sula-icon.js +1 -1
  111. package/dist/components/sula-loader.js +1 -1
  112. package/dist/components/sula-menu-select-list.js +1 -1
  113. package/dist/components/sula-menu.js +4 -4
  114. package/dist/components/sula-menu.js.map +1 -1
  115. package/dist/components/sula-modal.js +5 -5
  116. package/dist/components/sula-modal.js.map +1 -1
  117. package/dist/components/sula-progress-bar.js +3 -3
  118. package/dist/components/sula-progress-bar.js.map +1 -1
  119. package/dist/components/sula-radio-button.js +2 -2
  120. package/dist/components/sula-radio-button.js.map +1 -1
  121. package/dist/components/sula-search-bar.js +1 -1
  122. package/dist/components/sula-segmented-control.js +3 -3
  123. package/dist/components/sula-segmented-control.js.map +1 -1
  124. package/dist/components/sula-switch.js +2 -2
  125. package/dist/components/sula-switch.js.map +1 -1
  126. package/dist/components/sula-table-body.js +2 -2
  127. package/dist/components/sula-table-body.js.map +1 -1
  128. package/dist/components/sula-table-cell.js +2 -2
  129. package/dist/components/sula-table-cell.js.map +1 -1
  130. package/dist/components/sula-table-head-cell.js +2 -2
  131. package/dist/components/sula-table-head-cell.js.map +1 -1
  132. package/dist/components/sula-table-header.js +2 -2
  133. package/dist/components/sula-table-header.js.map +1 -1
  134. package/dist/components/sula-table-row.js +2 -2
  135. package/dist/components/sula-table-row.js.map +1 -1
  136. package/dist/components/sula-table.js +2 -2
  137. package/dist/components/sula-table.js.map +1 -1
  138. package/dist/components/sula-tag.js +3 -3
  139. package/dist/components/sula-tag.js.map +1 -1
  140. package/dist/components/sula-textarea.js +2 -2
  141. package/dist/components/sula-textarea.js.map +1 -1
  142. package/dist/components/sula-textfield.js +3 -3
  143. package/dist/components/sula-textfield.js.map +1 -1
  144. package/dist/components/sula-tiles.js +3 -3
  145. package/dist/components/sula-tiles.js.map +1 -1
  146. package/dist/components/sula-timeline-list.js +3 -3
  147. package/dist/components/sula-timeline-list.js.map +1 -1
  148. package/dist/components/sula-toast-stack.d.ts +11 -0
  149. package/dist/components/sula-toast-stack.js +352 -0
  150. package/dist/components/sula-toast-stack.js.map +1 -0
  151. package/dist/components/sula-toast.d.ts +11 -0
  152. package/dist/components/sula-toast.js +9 -0
  153. package/dist/components/sula-toast.js.map +1 -0
  154. package/dist/components/sula-toggle.js +4 -4
  155. package/dist/components/sula-toggle.js.map +1 -1
  156. package/dist/components/sula-tooltip.js +4 -4
  157. package/dist/components/sula-tooltip.js.map +1 -1
  158. package/dist/esm/{index-lrQT_q8m.js → index-BL15Tt3m.js} +30 -5
  159. package/dist/esm/index-BL15Tt3m.js.map +1 -0
  160. package/dist/esm/index.js +2 -13
  161. package/dist/esm/index.js.map +1 -1
  162. package/dist/esm/loader.js +3 -3
  163. package/dist/esm/sula-avatar_31.entry.js +53 -43
  164. package/dist/esm/sula-avatar_31.entry.js.map +1 -1
  165. package/dist/esm/sula-menu.model-Cs9RR1ZV.js +16 -0
  166. package/dist/esm/sula-menu.model-Cs9RR1ZV.js.map +1 -0
  167. package/dist/esm/sula-toast-stack.entry.js +312 -0
  168. package/dist/esm/sula-toast-stack.entry.js.map +1 -0
  169. package/dist/esm/sula-toast.entry.js +193 -0
  170. package/dist/esm/sula-toast.entry.js.map +1 -0
  171. package/dist/esm/sula-toast.model-t0X4JATS.js +14 -0
  172. package/dist/esm/sula-toast.model-t0X4JATS.js.map +1 -0
  173. package/dist/esm/webcomponents.js +3 -3
  174. package/dist/types/components/sula-icon-picker/model/sula-icon-picker.model.d.ts +4 -0
  175. package/dist/types/components/sula-toast/model/sula-toast.model.d.ts +31 -0
  176. package/dist/types/components/sula-toast/sula-toast.d.ts +64 -0
  177. package/dist/types/components/sula-toast/sula-toast.stories.d.ts +188 -0
  178. package/dist/types/components/sula-toast-stack/model/sula-toast-stack.model.d.ts +8 -0
  179. package/dist/types/components/sula-toast-stack/sula-toast-stack.d.ts +51 -0
  180. package/dist/types/components/sula-toast-stack/sula-toast-stack.motion.d.ts +9 -0
  181. package/dist/types/components/sula-toast-stack/sula-toast-stack.stories.d.ts +64 -0
  182. package/dist/types/components.d.ts +204 -0
  183. package/dist/types/index.d.ts +2 -0
  184. package/dist/webcomponents/index.esm.js +2 -15
  185. package/dist/webcomponents/index.esm.js.map +1 -1
  186. package/dist/webcomponents/p-170854a5.entry.js +270 -0
  187. package/dist/webcomponents/p-170854a5.entry.js.map +1 -0
  188. package/dist/webcomponents/{p-lrQT_q8m.js → p-BL15Tt3m.js} +240 -215
  189. package/dist/webcomponents/p-BL15Tt3m.js.map +1 -0
  190. package/dist/webcomponents/p-Cs9RR1ZV.js +18 -0
  191. package/dist/webcomponents/p-Cs9RR1ZV.js.map +1 -0
  192. package/dist/webcomponents/p-c58125e1.entry.js +376 -0
  193. package/dist/webcomponents/p-c58125e1.entry.js.map +1 -0
  194. package/dist/webcomponents/{p-95ca03c9.entry.js → p-f4ef50ea.entry.js} +63 -55
  195. package/dist/webcomponents/p-f4ef50ea.entry.js.map +1 -0
  196. package/dist/webcomponents/p-t0X4JATS.js +14 -0
  197. package/dist/webcomponents/p-t0X4JATS.js.map +1 -0
  198. package/dist/webcomponents/sula-toast-stack.entry.esm.js.map +1 -0
  199. package/dist/webcomponents/sula-toast.entry.esm.js.map +1 -0
  200. package/dist/webcomponents/webcomponents.esm.js +35 -6
  201. package/package.json +2 -2
  202. package/dist/cjs/index-i5WGQEGK.js.map +0 -1
  203. package/dist/components/p-Bqd5Y-Ir.js.map +0 -1
  204. package/dist/components/p-Cy4ZswbA.js.map +0 -1
  205. package/dist/esm/index-lrQT_q8m.js.map +0 -1
  206. package/dist/webcomponents/p-95ca03c9.entry.js.map +0 -1
  207. package/dist/webcomponents/p-lrQT_q8m.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sula-toast.stories.js","sourceRoot":"","sources":["../../../src/components/sula-toast/sula-toast.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,eAAe;IACb,KAAK,EAAE,uBAAuB;IAC9B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,SAAS,EACP,6UAA6U;aAChV;SACF;KACF;IACD,QAAQ,EAAE;QACR,UAAU,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,wBAAwB,EAAE;QACtE,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,2DAA2D,EAAE;QACtG,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OA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AC;YACvC,KAAK,CAAC,OAAO,GAAG,+CAA+C,CAAC;YAChE,KAAK,CAAC,gBAAgB,CAAC,uBAAuB,EAAE,GAAG,EAAE;gBACnD,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;gBAClD,KAAK,CAAC,MAAM,EAAE,CAAC;gBACf,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;gBACpB,IAAI,UAAU;oBAAE,IAAI,CAAC,KAAK,EAAE,CAAC;YAC/B,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;YACnB,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC;QAEF,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAC1C,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC/B,SAAS,EAAE,CAAC;QACZ,OAAO,SAAS,CAAC;IACnB,CAAC;CACF,CAAC","sourcesContent":["import { SulaToastType } from './model/sula-toast.model';\n\nexport default {\n title: 'Components/sula-toast',\n tags: ['autodocs'],\n parameters: {\n docs: {\n description: {\n component:\n 'Notificação controlada com seis intenções. Ao entrar, surge suavemente enquanto a borda percorre o perímetro. A aplicação remove o elemento ao receber toastDismissRequested e implementa a ação em toastAction. Sem duração explícita, mensagens sem ação duram 5 segundos; com ação permanecem. As demonstrações visuais usam duration=0.',\n },\n },\n },\n argTypes: {\n toastTitle: { control: 'text', description: 'Título da notificação.' },\n message: { control: 'text', description: 'Descrição opcional, limitada visualmente a quatro linhas.' },\n type: { control: 'select', options: Object.values(SulaToastType) },\n icon: { control: 'text', description: 'Classe Phosphor completa; omitida ou vazia não exibe ícone.' },\n actionText: { control: 'text', description: 'Ação opcional de uma linha, com reticências quando necessário.' },\n closable: { control: 'boolean' },\n duration: { control: 'number', description: 'Milissegundos; 0 mantém a mensagem visível.' },\n paused: { control: 'boolean' },\n animated: { control: 'boolean', description: 'Controla a animação de entrada (fade e traçado da borda).' },\n announcement: { control: 'select', options: ['polite', 'assertive', 'off'] },\n closeLabel: { control: 'text' },\n toastAction: { action: 'toastAction' },\n toastDismissRequested: { action: 'toastDismissRequested' },\n },\n};\n\nconst Template = args => {\n const surface = document.createElement('div');\n surface.className = 'bg-surface-on-body rounded-sm p-32';\n const toast = document.createElement('sula-toast');\n const { toastAction, toastDismissRequested, ...props } = args;\n Object.assign(toast, props);\n toast.addEventListener('toastAction', event => toastAction?.(event));\n toast.addEventListener('toastDismissRequested', event => toastDismissRequested?.(event));\n surface.append(toast);\n return surface;\n};\n\nconst defaults = {\n toastTitle: 'Toast title',\n message: 'This is a description with supporting details.',\n actionText: 'Desfazer',\n duration: 0,\n icon: 'ph ph-circle-dashed',\n closable: true,\n announcement: 'polite',\n closeLabel: 'Fechar notificação',\n};\nexport const Neutral = { render: Template, args: { ...defaults, type: SulaToastType.Neutral } };\nexport const Brand = { render: Template, args: { ...defaults, type: SulaToastType.Brand } };\nexport const Info = { render: Template, args: { ...defaults, type: SulaToastType.Info, icon: 'ph ph-info' } };\nexport const Success = { render: Template, args: { ...defaults, type: SulaToastType.Success, icon: 'ph ph-check-circle' } };\nexport const Warning = { render: Template, args: { ...defaults, type: SulaToastType.Warning, icon: 'ph ph-warning' } };\nexport const Danger = { render: Template, args: { ...defaults, type: SulaToastType.Danger, icon: 'ph ph-warning-circle' } };\nexport const WithoutAction = { render: Template, args: { ...defaults, actionText: '' } };\nexport const WithoutIconOrClose = { render: Template, args: { ...defaults, icon: '', closable: false } };\nexport const LongContent = {\n render: Template,\n args: {\n ...defaults,\n toastTitle: 'Um título que pode ocupar mais de uma linha',\n message:\n 'A descrição ocupa até quatro linhas e termina com reticências quando o conteúdo ultrapassa o espaço disponível: abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz.',\n actionText: 'Uma ação extensa também permanece em uma única linha',\n },\n};\nexport const ControlledDismissal = {\n render: () => {\n const container = document.createElement('div');\n const show = document.createElement('button');\n show.type = 'button';\n show.textContent = 'Mostrar notificação novamente';\n show.className = 'text-text-link underline mb-24';\n const output = document.createElement('div');\n\n const showToast = () => {\n const toast = document.createElement('sula-toast');\n toast.toastTitle = 'Alterações salvas';\n toast.message = 'Passe o mouse ou use Tab para pausar o tempo.';\n toast.addEventListener('toastDismissRequested', () => {\n const wasFocused = toast.matches(':focus-within');\n toast.remove();\n show.hidden = false;\n if (wasFocused) show.focus();\n });\n show.hidden = true;\n output.replaceChildren(toast);\n };\n\n show.addEventListener('click', showToast);\n container.append(show, output);\n showToast();\n return container;\n },\n};\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=sula-toast-stack.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sula-toast-stack.model.js","sourceRoot":"","sources":["../../../../src/components/sula-toast-stack/model/sula-toast-stack.model.ts"],"names":[],"mappings":"","sourcesContent":["import type { SulaToastAnnouncement } from '../../sula-toast/model/sula-toast.model';\n\nexport type AnnouncementPriority = Exclude<SulaToastAnnouncement, 'off'>;\n\nexport interface Announcement {\n id: string;\n version: number;\n text: string;\n priority: AnnouncementPriority;\n}\n"]}
@@ -0,0 +1 @@
1
+ *,:after,:before{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: ;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{font-family:Figtree;line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.absolute{position:absolute}.block{display:block}.hidden{display:none}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}:host,:host button,:host input,:host option,:host select,:host textarea{font-family:Figtree,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}:host{background-color:transparent;display:block;max-width:400px;width:100%}.toast-region{background-color:transparent}.toast-list--collapsed{padding-top:var(--toast-layer-offset)}.toast-layer--entering{animation:sula-toast-stack-enter .2s cubic-bezier(.2,.8,.2,1)}@keyframes sula-toast-stack-enter{0%{scale:.98;translate:0 -8px}to{scale:1;translate:0}}@media (prefers-reduced-motion:reduce){.toast-layer--entering{animation:none}}.toast-layer.toast-layer--covered{bottom:0;clip-path:inset(0 0 calc(100% - 12px) 0);position:absolute;top:var(--toast-layer-offset);inset-inline:0;margin-inline:auto;pointer-events:none;transform:translateY(calc(var(--toast-depth)*-12px));width:var(--toast-width)}.toast-layer.toast-layer--covered sula-toast,.toast-layer.toast-layer--covered sula-toast::part(container){height:100%}.toast-layer.toast-layer--covered sula-toast::part(container){box-shadow:none;isolation:auto;overflow:hidden}.toast-layer.toast-layer--covered sula-toast::part(close-button),.toast-layer.toast-layer--covered sula-toast::part(content),.toast-layer.toast-layer--covered sula-toast::part(icon){visibility:hidden}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:300;src:local("Figtree"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-Light.ttf) format("truetype")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:300;src:local("Figtree"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-LightItalic.ttf) format("truetype")}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:400;src:local("Figtree"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-Regular.ttf) format("truetype")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:400;src:local("Figtree"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-Italic.ttf) format("truetype")}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:500;src:local("Figtree"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-Medium.ttf) format("truetype")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:500;src:local("Figtree"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-MediumItalic.ttf) format("truetype")}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:600;src:local("Figtree"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-SemiBold.ttf) format("truetype")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:600;src:local("Figtree"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-SemiBoldItalic.ttf) format("truetype")}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:700;src:local("Figtree"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-Bold.ttf) format("truetype")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:700;src:local("Figtree"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-BoldItalic.ttf) format("truetype")}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:800;src:local("Figtree"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-ExtraBold.ttf) format("truetype")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:800;src:local("Figtree"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-ExtraBoldItalic.ttf) format("truetype")}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:900;src:local("Figtree"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-Black.ttf) format("truetype")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:900;src:local("Figtree"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-BlackItalic.ttf) format("truetype")}:root{--color-green-50:#f1f9f4;--color-green-100:#e6f4ed;--color-green-200:#cae7d8;--color-green-300:#a0d4b8;--color-green-400:#68bb8e;--color-green-500:#04843f;--color-green-600:#037236;--color-green-700:#03632f;--color-green-800:#035428;--color-green-900:#024521;--color-green-950:#012b15;--color-red-50:#fef6f6;--color-red-100:#fde8e8;--color-red-200:#fad1d1;--color-red-300:#f7abab;--color-red-400:#f17474;--color-red-500:#c80505;--color-red-600:#b30404;--color-red-700:#9f0404;--color-red-800:#860303;--color-red-900:#6d0303;--color-red-950:#330d00;--color-yellow-50:#fdf4e7;--color-yellow-100:#fcedd9;--color-yellow-200:#fae0bd;--color-yellow-300:#f6c788;--color-yellow-400:#f3b159;--color-yellow-500:#ef9928;--color-yellow-600:#e49226;--color-yellow-700:#d17e10;--color-yellow-800:#b46d0e;--color-yellow-900:#93590b;--color-yellow-950:#402705;--color-orange-50:#fef4f1;--color-orange-100:#fde8e2;--color-orange-200:#fbd2c6;--color-orange-300:#f8b4a0;--color-orange-400:#f58e70;--color-orange-500:#f05223;--color-orange-600:#ea4210;--color-orange-700:#d23b0e;--color-orange-800:#b5330c;--color-orange-900:#942a0a;--color-orange-950:#401204;--color-blue-50:#ecf0f9;--color-blue-100:#dde3f4;--color-blue-200:#b2c2e5;--color-blue-300:#7994d2;--color-blue-400:#4066bf;--color-blue-500:#001e64;--color-blue-600:#001c5c;--color-blue-700:#00174c;--color-blue-800:#00123d;--color-blue-900:#000f33;--color-blue-950:#000d2b;--color-ambar-50:#fff6eb;--color-ambar-100:#ffefdc;--color-ambar-200:#fedfb9;--color-ambar-300:#fdca8b;--color-ambar-400:#fdb359;--color-ambar-500:#fc9c26;--color-ambar-600:#ec8403;--color-ambar-700:#d87803;--color-ambar-800:#ba6803;--color-ambar-900:#975402;--color-ambar-950:#402301;--color-gray-50:#fff;--color-gray-100:#f3f4f4;--color-gray-200:#e5e6e6;--color-gray-300:#bfc0c0;--color-gray-400:#acaeae;--color-gray-500:#949595;--color-gray-600:#737575;--color-gray-700:#6c6e6e;--color-gray-800:#313333;--color-gray-900:#272929;--color-gray-950:#191d1d;--color-white-opacity-50:#ffffff0d;--color-white-opacity-100:#ffffff1a;--color-white-opacity-200:#ffffff26;--color-white-opacity-300:#ffffff45;--color-white-opacity-400:#ffffff5c;--color-white-opacity-500:#ffffff80;--color-white-opacity-600:#ffffff8c;--color-white-opacity-700:#ffffffa3;--color-white-opacity-800:#ffffffba;--color-white-opacity-900:#fffc;--color-white-opacity-950:#ffffffe8;--color-ciano-50:#f1f6fe;--color-ciano-100:#dfeafc;--color-ciano-200:#c3d9f9;--color-ciano-300:#90b9f4;--color-ciano-400:#5d98ee;--color-ciano-500:#1769e0;--color-ciano-600:#155fcb;--color-ciano-700:#1355b4;--color-ciano-800:#104899;--color-ciano-900:#0d3b7d;--color-ciano-950:#071e40;--color-extra-color-blue-light:#e7f0f4;--color-extra-color-blue-dark:#162931;--color-black-opacity-50:rgba(25,29,29,.02);--color-black-opacity-100:rgba(25,29,29,.05);--color-black-opacity-200:rgba(25,29,29,.11);--color-black-opacity-300:rgba(25,29,29,.28);--color-black-opacity-400:rgba(25,29,29,.36);--color-black-opacity-500:rgba(25,29,29,.44);--color-black-opacity-600:rgba(25,29,29,.62);--color-black-opacity-700:rgba(25,29,29,.64);--color-black-opacity-800:rgba(25,29,29,.72);--color-black-opacity-900:rgba(25,29,29,.8);--color-black-opacity-950:rgba(25,29,29,.96);--color-shadow-opacity-50:rgba(0,0,0,.04);--color-shadow-opacity-100:rgba(0,0,0,.06);--color-shadow-opacity-200:rgba(0,0,0,.12);--color-shadow-opacity-300:rgba(0,0,0,.2);--color-shadow-opacity-400:rgba(0,0,0,.32);--color-shadow-opacity-500:rgba(0,0,0,.5);--color-shadow-opacity-600:rgba(0,0,0,.55);--color-shadow-opacity-700:rgba(0,0,0,.64);--color-shadow-opacity-800:rgba(0,0,0,.73);--color-shadow-opacity-900:rgba(0,0,0,.8);--color-shadow-opacity-950:rgba(0,0,0,.91);--color-feedback-success:#04843f;--color-feedback-error:#c80505;--color-feedback-informational:#1355b4;--color-feedback-alert:#ef9928;--color-brand-primary:#f05223;--color-brand-secondary:#001c5c;--color-brand-tertiary-1:#1769e0;--color-brand-tertiary-2:#fc9c26;--color-surface-body:#fff;--color-surface-on-body:#f3f4f4;--color-surface-on-body-blue:#e7f0f4;--color-surface-on-body-brand:#fff6eb;--color-surface-on-body-feedback-success:#e6f4ed;--color-surface-on-body-feedback-error:#fde8e8;--color-surface-on-body-feedback-alert:#fdf4e7;--color-surface-on-body-feedback-info:#dfeafc;--color-text-brand:#f05223;--color-text-primary:#313333;--color-text-secondary:#6c6e6e;--color-text-disabled:#949595;--color-text-link:#1355b4;--color-states-empty-bg-hover:rgba(25,29,29,.05);--color-states-empty-bg-pressed:rgba(25,29,29,.11);--color-states-bg-disabled:rgba(25,29,29,.02);--color-states-bg-focus:#1355b4;--color-states-primary-hover:#ea4210;--color-states-primary-pressed:#d23b0e;--color-states-danger-hover:#b30404;--color-states-danger-pressed:#9f0404;--color-states-negative-hover:#e5e6e6;--color-states-negative-pressed:#bfc0c0;--color-icon-primary:#6c6e6e;--color-icon-secondary:#fff;--color-icon-tertiary:#b30404;--color-icon-disabled:#acaeae;--color-neutral-neutral-1:#fff;--color-neutral-neutral-2:#f3f4f4;--color-neutral-neutral-3:#acaeae;--color-neutral-neutral-4:#949595;--color-neutral-neutral-5:#737575;--color-neutral-neutral-6:#6c6e6e;--color-neutral-neutral-7:#313333;--color-neutral-neutral-8:#272929;--color-negative-negative-1:#fff;--color-negative-negative-2:#313333;--color-opacity-body:#fffc;--color-opacity-on-body:rgba(25,29,29,.02);--color-opacity-overlay:rgba(25,29,29,.62);--color-opacity-on-overlay:#ffffff1a;--color-opacity-toast:#ffffff45;--color-line-input:#949595;--color-line-general-strong:#bfc0c0;--color-line-general:#e5e6e6;--color-line-hair:rgba(25,29,29,.05);--color-box-shadow-body:#fff;--color-box-shadow-shadow-color-1:rgba(0,0,0,.04);--color-box-shadow-shadow-color-2:rgba(0,0,0,.06)}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.static{position:static}.relative{position:relative}.flex{display:flex}.w-full{width:100%}.min-w-0{min-width:0}.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.gap-12{gap:.75rem}.rounded-sm{border-radius:.75rem}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.blur{--tw-blur:blur(8px)}.blur,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus-visible\:outline:focus-visible{outline-style:solid}.focus-visible\:outline-2:focus-visible{outline-width:2px}.focus-visible\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\:outline-feedback-informational:focus-visible{outline-color:var(--color-feedback-informational)}
@@ -0,0 +1,333 @@
1
+ import { Host, h } from "@stencil/core";
2
+ import { SulaToastStackMotion } from "./sula-toast-stack.motion";
3
+ const MAX_VISIBLE_LAYERS = 3;
4
+ const LAYER_OFFSET = 12;
5
+ const LAYER_WIDTH_STEP = 5;
6
+ export class SulaToastStack {
7
+ constructor() {
8
+ /** Notifications in chronological order, oldest first. Only the latest three are rendered. Replace the array to update it. IDs must be unique. */
9
+ this.items = [];
10
+ this.hovering = false;
11
+ this.focused = false;
12
+ this.noHover = false;
13
+ this.retainingPointerExpansion = false;
14
+ this.announcements = [];
15
+ this.announcementVersions = 0;
16
+ this.announcementSignatures = new Map();
17
+ this.enteringIds = new Set();
18
+ this.keyboardInteraction = false;
19
+ this.releaseFocusAfterRender = false;
20
+ this.ready = false;
21
+ this.connected = false;
22
+ this.motion = new SulaToastStackMotion();
23
+ this.handleMediaChange = (event) => {
24
+ this.noHover = event.matches;
25
+ this.hovering = false;
26
+ this.stopRetainingPointerExpansion();
27
+ };
28
+ this.handlePointerMove = (event) => {
29
+ var _a;
30
+ const bounds = (_a = this.region) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
31
+ this.hovering = !!bounds && event.clientX >= bounds.left && event.clientX <= bounds.right && event.clientY >= bounds.top && event.clientY <= bounds.bottom;
32
+ this.stopRetainingPointerExpansion();
33
+ };
34
+ this.handleFocusOut = () => {
35
+ if (this.focusFrame !== undefined)
36
+ cancelAnimationFrame(this.focusFrame);
37
+ this.focusFrame = requestAnimationFrame(() => {
38
+ var _a;
39
+ this.focusFrame = undefined;
40
+ this.focused = !!((_a = this.hostElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement);
41
+ });
42
+ };
43
+ this.dismiss = (event, id) => {
44
+ event.stopPropagation();
45
+ this.toastDismissRequested.emit({ id, reason: event.detail.reason });
46
+ };
47
+ this.action = (event, id) => {
48
+ event.stopPropagation();
49
+ this.toastAction.emit({ id });
50
+ };
51
+ }
52
+ get expanded() {
53
+ return this.noHover || this.hovering || this.focused || this.retainingPointerExpansion;
54
+ }
55
+ get visibleItems() {
56
+ return this.items.slice(-MAX_VISIBLE_LAYERS);
57
+ }
58
+ get motionTargets() {
59
+ var _a, _b, _c;
60
+ const reduceMotion = (_b = (_a = window.matchMedia) === null || _a === void 0 ? void 0 : _a.call(window, '(prefers-reduced-motion: reduce)').matches) !== null && _b !== void 0 ? _b : false;
61
+ if (!this.ready || this.noHover || reduceMotion || !((_c = this.region) === null || _c === void 0 ? void 0 : _c.animate) || !this.list)
62
+ return;
63
+ return { region: this.region, list: this.list };
64
+ }
65
+ connectedCallback() {
66
+ this.connected = true;
67
+ if (this.ready)
68
+ this.connectListeners();
69
+ }
70
+ componentDidLoad() {
71
+ this.ready = true;
72
+ this.connectListeners();
73
+ Promise.resolve().then(() => {
74
+ if (this.connected)
75
+ this.updateAnnouncements();
76
+ });
77
+ }
78
+ componentWillRender() {
79
+ if (this.renderedExpanded === this.expanded)
80
+ return;
81
+ this.renderedExpanded = this.expanded;
82
+ const targets = this.motionTargets;
83
+ if (!targets) {
84
+ this.motion.cancel();
85
+ return;
86
+ }
87
+ this.motion.capture(targets.region, targets.list);
88
+ }
89
+ componentDidRender() {
90
+ this.restoreFocus();
91
+ this.releasePointerFocus();
92
+ if (this.region && this.list)
93
+ this.motion.play(this.region, this.list);
94
+ }
95
+ disconnectedCallback() {
96
+ var _a;
97
+ this.connected = false;
98
+ this.motion.cancel();
99
+ (_a = this.media) === null || _a === void 0 ? void 0 : _a.removeEventListener('change', this.handleMediaChange);
100
+ window.removeEventListener('pointermove', this.handlePointerMove);
101
+ if (this.focusFrame !== undefined)
102
+ cancelAnimationFrame(this.focusFrame);
103
+ this.focusFrame = undefined;
104
+ this.keyboardInteraction = false;
105
+ this.retainingPointerExpansion = false;
106
+ this.hovering = false;
107
+ this.focused = false;
108
+ }
109
+ handleItemsChange(next, previous = []) {
110
+ var _a, _b, _c, _d, _e, _f;
111
+ const targets = this.motionTargets;
112
+ if (targets)
113
+ this.motion.capture(targets.region, targets.list);
114
+ else
115
+ this.motion.cancel();
116
+ const active = (_a = this.hostElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement;
117
+ const focusedId = (_b = active === null || active === void 0 ? void 0 : active.closest('[data-toast-id]')) === null || _b === void 0 ? void 0 : _b.dataset.toastId;
118
+ const nextVisible = next.slice(-MAX_VISIBLE_LAYERS);
119
+ const previousVisibleIds = new Set(previous.slice(-MAX_VISIBLE_LAYERS).map(item => item.id));
120
+ this.enteringIds = this.ready ? new Set(nextVisible.filter(item => !previousVisibleIds.has(item.id)).map(item => item.id)) : new Set();
121
+ if (focusedId !== undefined && !nextVisible.some(item => item.id === focusedId)) {
122
+ if (this.keyboardInteraction) {
123
+ const visibleIds = new Set(nextVisible.map(item => item.id));
124
+ const index = previous.findIndex(item => item.id === focusedId);
125
+ const following = previous.slice(index + 1).find(item => visibleIds.has(item.id));
126
+ const preceding = previous
127
+ .slice(0, index)
128
+ .reverse()
129
+ .find(item => visibleIds.has(item.id));
130
+ this.focusTarget = (_f = (_d = (_c = following === null || following === void 0 ? void 0 : following.id) !== null && _c !== void 0 ? _c : preceding === null || preceding === void 0 ? void 0 : preceding.id) !== null && _d !== void 0 ? _d : (_e = nextVisible[0]) === null || _e === void 0 ? void 0 : _e.id) !== null && _f !== void 0 ? _f : '';
131
+ }
132
+ else {
133
+ this.focusTarget = undefined;
134
+ this.releaseFocusAfterRender = true;
135
+ if (nextVisible.length && !this.noHover) {
136
+ this.retainingPointerExpansion = true;
137
+ window.addEventListener('pointermove', this.handlePointerMove, { once: true });
138
+ }
139
+ this.focused = false;
140
+ }
141
+ }
142
+ if (this.ready)
143
+ this.updateAnnouncements();
144
+ }
145
+ updateAnnouncements() {
146
+ const records = [];
147
+ const signatures = new Map();
148
+ for (const item of this.visibleItems) {
149
+ const priority = item.announcement || 'polite';
150
+ const text = [item.title, item.message].filter(Boolean).join('. ');
151
+ const signature = JSON.stringify([text, priority]);
152
+ signatures.set(item.id, signature);
153
+ if (priority === 'off' || !text)
154
+ continue;
155
+ const previous = this.announcements.find(record => record.id === item.id);
156
+ records.push(this.announcementSignatures.get(item.id) === signature && previous
157
+ ? previous
158
+ : {
159
+ id: item.id,
160
+ text,
161
+ priority,
162
+ version: ++this.announcementVersions,
163
+ });
164
+ }
165
+ this.announcementSignatures = signatures;
166
+ this.announcements = records;
167
+ }
168
+ connectListeners() {
169
+ var _a, _b, _c, _d;
170
+ this.media = (_a = window.matchMedia) === null || _a === void 0 ? void 0 : _a.call(window, '(hover: none)');
171
+ this.noHover = (_c = (_b = this.media) === null || _b === void 0 ? void 0 : _b.matches) !== null && _c !== void 0 ? _c : false;
172
+ (_d = this.media) === null || _d === void 0 ? void 0 : _d.addEventListener('change', this.handleMediaChange);
173
+ }
174
+ stopRetainingPointerExpansion() {
175
+ window.removeEventListener('pointermove', this.handlePointerMove);
176
+ this.retainingPointerExpansion = false;
177
+ }
178
+ restoreFocus() {
179
+ var _a, _b;
180
+ if (this.focusTarget === undefined)
181
+ return;
182
+ const targetId = this.focusTarget;
183
+ this.focusTarget = undefined;
184
+ const target = Array.from(((_a = this.list) === null || _a === void 0 ? void 0 : _a.querySelectorAll('[data-toast-id]')) || []).find(element => element.dataset.toastId === targetId);
185
+ (_b = (target || this.region)) === null || _b === void 0 ? void 0 : _b.focus();
186
+ }
187
+ releasePointerFocus() {
188
+ var _a, _b;
189
+ if (!this.releaseFocusAfterRender)
190
+ return;
191
+ this.releaseFocusAfterRender = false;
192
+ let active = (_a = this.hostElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement;
193
+ while ((_b = active === null || active === void 0 ? void 0 : active.shadowRoot) === null || _b === void 0 ? void 0 : _b.activeElement)
194
+ active = active.shadowRoot.activeElement;
195
+ active === null || active === void 0 ? void 0 : active.blur();
196
+ this.focused = false;
197
+ }
198
+ render() {
199
+ const expanded = this.expanded;
200
+ const visibleItems = this.visibleItems;
201
+ return (h(Host, { key: 'e52aeb1dd9f0d54498a4c7a0ad2300cdc5d24484' }, h("section", { key: '7c829968e841616450c308571cd1b60341b3c38b', ref: el => (this.region = el), role: "region", "aria-label": "Notifica\u00E7\u00F5es", tabIndex: 0, class: "toast-region w-full rounded-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-feedback-informational focus-visible:outline-offset-2", onMouseEnter: () => {
202
+ if (!this.noHover)
203
+ this.hovering = true;
204
+ }, onMouseLeave: () => (this.hovering = false), onPointerDown: () => {
205
+ this.keyboardInteraction = false;
206
+ this.stopRetainingPointerExpansion();
207
+ }, onKeyDown: () => {
208
+ this.keyboardInteraction = true;
209
+ this.stopRetainingPointerExpansion();
210
+ }, onFocusin: () => (this.focused = true), onFocusout: this.handleFocusOut }, h("div", { key: '2327880499750943034cf47d8f2ea2dfd13d0e5a', ref: el => (this.list = el), class: { 'toast-list relative flex flex-col gap-12': true, 'toast-list--collapsed': !expanded }, style: {
211
+ '--toast-layer-offset': `${Math.max(0, visibleItems.length - 1) * LAYER_OFFSET}px`,
212
+ } }, visibleItems.map((item, index) => {
213
+ var _a, _b, _c, _d;
214
+ const depth = visibleItems.length - 1 - index;
215
+ const covered = !expanded && depth > 0;
216
+ return (h("div", { key: item.id, "data-toast-id": item.id, tabIndex: -1, "aria-hidden": covered ? 'true' : undefined, inert: covered, class: {
217
+ 'toast-layer relative w-full min-w-0 shrink-0': true,
218
+ 'toast-layer--covered': covered,
219
+ 'toast-layer--entering': this.enteringIds.has(item.id),
220
+ }, style: {
221
+ '--toast-depth': String(depth),
222
+ '--toast-width': `${100 - Math.min(depth, MAX_VISIBLE_LAYERS - 1) * LAYER_WIDTH_STEP}%`,
223
+ } }, h("sula-toast", { toastTitle: item.title, message: (_a = item.message) !== null && _a !== void 0 ? _a : '', type: item.type, icon: item.icon, actionText: (_b = item.actionText) !== null && _b !== void 0 ? _b : '', closable: (_c = item.closable) !== null && _c !== void 0 ? _c : true, duration: item.duration, closeLabel: (_d = item.closeLabel) !== null && _d !== void 0 ? _d : 'Fechar notificação', paused: covered || this.hovering || this.focused || this.retainingPointerExpansion, announcement: "off", animated: depth === 0, onToastDismissRequested: event => this.dismiss(event, item.id), onToastAction: event => this.action(event, item.id) })));
224
+ }))), h("div", { key: 'be446beb46594f14b6079a5a0649c9bf3a17b0cb', class: "sr-only", role: "status", "aria-live": "polite", "aria-atomic": "false", "aria-relevant": "additions text" }, this.announcements
225
+ .filter(record => record.priority === 'polite')
226
+ .map(record => (h("p", { key: record.version }, record.text)))), h("div", { key: '5d9e871c11e91fb293f22c92ddd5a590517576f1', class: "sr-only", role: "alert", "aria-live": "assertive", "aria-atomic": "false", "aria-relevant": "additions text" }, this.announcements
227
+ .filter(record => record.priority === 'assertive')
228
+ .map(record => (h("p", { key: record.version }, record.text))))));
229
+ }
230
+ static get is() { return "sula-toast-stack"; }
231
+ static get encapsulation() { return "shadow"; }
232
+ static get originalStyleUrls() {
233
+ return {
234
+ "$": ["sula-toast-stack.scss"]
235
+ };
236
+ }
237
+ static get styleUrls() {
238
+ return {
239
+ "$": ["sula-toast-stack.css"]
240
+ };
241
+ }
242
+ static get properties() {
243
+ return {
244
+ "items": {
245
+ "type": "unknown",
246
+ "attribute": "items",
247
+ "mutable": false,
248
+ "complexType": {
249
+ "original": "SulaToastItem[]",
250
+ "resolved": "SulaToastItem[]",
251
+ "references": {
252
+ "SulaToastItem": {
253
+ "location": "import",
254
+ "path": "../sula-toast/model/sula-toast.model",
255
+ "id": "src/components/sula-toast/model/sula-toast.model.ts::SulaToastItem"
256
+ }
257
+ }
258
+ },
259
+ "required": false,
260
+ "optional": false,
261
+ "docs": {
262
+ "tags": [],
263
+ "text": "Notifications in chronological order, oldest first. Only the latest three are rendered. Replace the array to update it. IDs must be unique."
264
+ },
265
+ "getter": false,
266
+ "setter": false,
267
+ "defaultValue": "[]"
268
+ }
269
+ };
270
+ }
271
+ static get states() {
272
+ return {
273
+ "hovering": {},
274
+ "focused": {},
275
+ "noHover": {},
276
+ "retainingPointerExpansion": {},
277
+ "announcements": {}
278
+ };
279
+ }
280
+ static get events() {
281
+ return [{
282
+ "method": "toastDismissRequested",
283
+ "name": "toastDismissRequested",
284
+ "bubbles": true,
285
+ "cancelable": true,
286
+ "composed": true,
287
+ "docs": {
288
+ "tags": [],
289
+ "text": "Requests removal of the identified notification by the consumer."
290
+ },
291
+ "complexType": {
292
+ "original": "SulaToastStackDismissEvent",
293
+ "resolved": "SulaToastStackDismissEvent",
294
+ "references": {
295
+ "SulaToastStackDismissEvent": {
296
+ "location": "import",
297
+ "path": "../sula-toast/model/sula-toast.model",
298
+ "id": "src/components/sula-toast/model/sula-toast.model.ts::SulaToastStackDismissEvent"
299
+ }
300
+ }
301
+ }
302
+ }, {
303
+ "method": "toastAction",
304
+ "name": "toastAction",
305
+ "bubbles": true,
306
+ "cancelable": true,
307
+ "composed": true,
308
+ "docs": {
309
+ "tags": [],
310
+ "text": "Requests the identified notification's action without removing it."
311
+ },
312
+ "complexType": {
313
+ "original": "SulaToastStackActionEvent",
314
+ "resolved": "SulaToastStackActionEvent",
315
+ "references": {
316
+ "SulaToastStackActionEvent": {
317
+ "location": "import",
318
+ "path": "../sula-toast/model/sula-toast.model",
319
+ "id": "src/components/sula-toast/model/sula-toast.model.ts::SulaToastStackActionEvent"
320
+ }
321
+ }
322
+ }
323
+ }];
324
+ }
325
+ static get elementRef() { return "hostElement"; }
326
+ static get watchers() {
327
+ return [{
328
+ "propName": "items",
329
+ "methodName": "handleItemsChange"
330
+ }];
331
+ }
332
+ }
333
+ //# sourceMappingURL=sula-toast-stack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sula-toast-stack.js","sourceRoot":"","sources":["../../../src/components/sula-toast-stack/sula-toast-stack.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAGrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAG3B,MAAM,OAAO,cAAc;IAD3B;QAIE,kJAAkJ;QAC1I,UAAK,GAAoB,EAAE,CAAC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I,CAAK,CAC1C,CAAC,CACA;YACN,4DAAK,KAAK,EAAC,SAAS,EAAC,IAAI,EAAC,OAAO,eAAW,WAAW,iBAAa,OAAO,mBAAe,gBAAgB,IACvG,IAAI,CAAC,aAAa;iBAChB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,KAAK,WAAW,CAAC;iBACjD,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CACb,SAAG,GAAG,EAAE,MAAM,CAAC,OAAO,IAAG,MAAM,CAAC,IAAI,CAAK,CAC1C,CAAC,CACA,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { SulaToastDismissEvent, SulaToastItem, SulaToastStackActionEvent, SulaToastStackDismissEvent } from '../sula-toast/model/sula-toast.model';\nimport type { Announcement } from './model/sula-toast-stack.model';\nimport { SulaToastStackMotion } from './sula-toast-stack.motion';\n\nconst MAX_VISIBLE_LAYERS = 3;\nconst LAYER_OFFSET = 12;\nconst LAYER_WIDTH_STEP = 5;\n\n@Component({ tag: 'sula-toast-stack', styleUrl: 'sula-toast-stack.scss', shadow: true })\nexport class SulaToastStack {\n @Element() hostElement: HTMLElement;\n\n /** Notifications in chronological order, oldest first. Only the latest three are rendered. Replace the array to update it. IDs must be unique. */\n @Prop() items: SulaToastItem[] = [];\n\n /** Requests removal of the identified notification by the consumer. */\n @Event() toastDismissRequested: EventEmitter<SulaToastStackDismissEvent>;\n\n /** Requests the identified notification's action without removing it. */\n @Event() toastAction: EventEmitter<SulaToastStackActionEvent>;\n\n @State() hovering = false;\n @State() focused = false;\n @State() noHover = false;\n @State() retainingPointerExpansion = false;\n @State() announcements: Announcement[] = [];\n\n private region?: HTMLElement;\n private list?: HTMLElement;\n private media?: MediaQueryList;\n private announcementVersions = 0;\n private announcementSignatures = new Map<string, string>();\n private enteringIds = new Set<string>();\n private focusTarget?: string;\n private focusFrame?: number;\n private keyboardInteraction = false;\n private releaseFocusAfterRender = false;\n private ready = false;\n private connected = false;\n private renderedExpanded?: boolean;\n private motion = new SulaToastStackMotion();\n\n private get expanded() {\n return this.noHover || this.hovering || this.focused || this.retainingPointerExpansion;\n }\n\n private get visibleItems() {\n return this.items.slice(-MAX_VISIBLE_LAYERS);\n }\n\n private get motionTargets() {\n const reduceMotion = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ?? false;\n if (!this.ready || this.noHover || reduceMotion || !this.region?.animate || !this.list) return;\n return { region: this.region, list: this.list };\n }\n\n connectedCallback() {\n this.connected = true;\n if (this.ready) this.connectListeners();\n }\n\n componentDidLoad() {\n this.ready = true;\n this.connectListeners();\n Promise.resolve().then(() => {\n if (this.connected) this.updateAnnouncements();\n });\n }\n\n componentWillRender() {\n if (this.renderedExpanded === this.expanded) return;\n this.renderedExpanded = this.expanded;\n const targets = this.motionTargets;\n if (!targets) {\n this.motion.cancel();\n return;\n }\n this.motion.capture(targets.region, targets.list);\n }\n\n componentDidRender() {\n this.restoreFocus();\n this.releasePointerFocus();\n if (this.region && this.list) this.motion.play(this.region, this.list);\n }\n\n disconnectedCallback() {\n this.connected = false;\n this.motion.cancel();\n this.media?.removeEventListener('change', this.handleMediaChange);\n window.removeEventListener('pointermove', this.handlePointerMove);\n if (this.focusFrame !== undefined) cancelAnimationFrame(this.focusFrame);\n this.focusFrame = undefined;\n this.keyboardInteraction = false;\n this.retainingPointerExpansion = false;\n this.hovering = false;\n this.focused = false;\n }\n\n @Watch('items')\n handleItemsChange(next: SulaToastItem[], previous: SulaToastItem[] = []) {\n const targets = this.motionTargets;\n if (targets) this.motion.capture(targets.region, targets.list);\n else this.motion.cancel();\n const active = this.hostElement.shadowRoot?.activeElement as HTMLElement | null;\n const focusedId = active?.closest<HTMLElement>('[data-toast-id]')?.dataset.toastId;\n const nextVisible = next.slice(-MAX_VISIBLE_LAYERS);\n const previousVisibleIds = new Set(previous.slice(-MAX_VISIBLE_LAYERS).map(item => item.id));\n this.enteringIds = this.ready ? new Set(nextVisible.filter(item => !previousVisibleIds.has(item.id)).map(item => item.id)) : new Set();\n if (focusedId !== undefined && !nextVisible.some(item => item.id === focusedId)) {\n if (this.keyboardInteraction) {\n const visibleIds = new Set(nextVisible.map(item => item.id));\n const index = previous.findIndex(item => item.id === focusedId);\n const following = previous.slice(index + 1).find(item => visibleIds.has(item.id));\n const preceding = previous\n .slice(0, index)\n .reverse()\n .find(item => visibleIds.has(item.id));\n this.focusTarget = following?.id ?? preceding?.id ?? nextVisible[0]?.id ?? '';\n } else {\n this.focusTarget = undefined;\n this.releaseFocusAfterRender = true;\n if (nextVisible.length && !this.noHover) {\n this.retainingPointerExpansion = true;\n window.addEventListener('pointermove', this.handlePointerMove, { once: true });\n }\n this.focused = false;\n }\n }\n if (this.ready) this.updateAnnouncements();\n }\n\n private updateAnnouncements() {\n const records: Announcement[] = [];\n const signatures = new Map<string, string>();\n for (const item of this.visibleItems) {\n const priority = item.announcement || 'polite';\n const text = [item.title, item.message].filter(Boolean).join('. ');\n const signature = JSON.stringify([text, priority]);\n signatures.set(item.id, signature);\n if (priority === 'off' || !text) continue;\n const previous = this.announcements.find(record => record.id === item.id);\n records.push(\n this.announcementSignatures.get(item.id) === signature && previous\n ? previous\n : {\n id: item.id,\n text,\n priority,\n version: ++this.announcementVersions,\n },\n );\n }\n this.announcementSignatures = signatures;\n this.announcements = records;\n }\n\n private connectListeners() {\n this.media = window.matchMedia?.('(hover: none)');\n this.noHover = this.media?.matches ?? false;\n this.media?.addEventListener('change', this.handleMediaChange);\n }\n\n private handleMediaChange = (event: MediaQueryListEvent) => {\n this.noHover = event.matches;\n this.hovering = false;\n this.stopRetainingPointerExpansion();\n };\n\n private handlePointerMove = (event: PointerEvent) => {\n const bounds = this.region?.getBoundingClientRect();\n this.hovering = !!bounds && event.clientX >= bounds.left && event.clientX <= bounds.right && event.clientY >= bounds.top && event.clientY <= bounds.bottom;\n this.stopRetainingPointerExpansion();\n };\n\n private stopRetainingPointerExpansion() {\n window.removeEventListener('pointermove', this.handlePointerMove);\n this.retainingPointerExpansion = false;\n }\n\n private restoreFocus() {\n if (this.focusTarget === undefined) return;\n const targetId = this.focusTarget;\n this.focusTarget = undefined;\n const target = Array.from(this.list?.querySelectorAll<HTMLElement>('[data-toast-id]') || []).find(element => element.dataset.toastId === targetId);\n (target || this.region)?.focus();\n }\n\n private releasePointerFocus() {\n if (!this.releaseFocusAfterRender) return;\n this.releaseFocusAfterRender = false;\n let active = this.hostElement.shadowRoot?.activeElement as HTMLElement | null;\n while (active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement as HTMLElement;\n active?.blur();\n this.focused = false;\n }\n\n private handleFocusOut = () => {\n if (this.focusFrame !== undefined) cancelAnimationFrame(this.focusFrame);\n this.focusFrame = requestAnimationFrame(() => {\n this.focusFrame = undefined;\n this.focused = !!this.hostElement.shadowRoot?.activeElement;\n });\n };\n\n private dismiss = (event: CustomEvent<SulaToastDismissEvent>, id: string) => {\n event.stopPropagation();\n this.toastDismissRequested.emit({ id, reason: event.detail.reason });\n };\n\n private action = (event: CustomEvent<void>, id: string) => {\n event.stopPropagation();\n this.toastAction.emit({ id });\n };\n\n render() {\n const expanded = this.expanded;\n const visibleItems = this.visibleItems;\n return (\n <Host>\n <section\n ref={el => (this.region = el)}\n role=\"region\"\n aria-label=\"Notificações\"\n tabIndex={0}\n class=\"toast-region w-full rounded-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-feedback-informational focus-visible:outline-offset-2\"\n onMouseEnter={() => {\n if (!this.noHover) this.hovering = true;\n }}\n onMouseLeave={() => (this.hovering = false)}\n onPointerDown={() => {\n this.keyboardInteraction = false;\n this.stopRetainingPointerExpansion();\n }}\n onKeyDown={() => {\n this.keyboardInteraction = true;\n this.stopRetainingPointerExpansion();\n }}\n onFocusin={() => (this.focused = true)}\n onFocusout={this.handleFocusOut}\n >\n <div\n ref={el => (this.list = el)}\n class={{ 'toast-list relative flex flex-col gap-12': true, 'toast-list--collapsed': !expanded }}\n style={{\n '--toast-layer-offset': `${Math.max(0, visibleItems.length - 1) * LAYER_OFFSET}px`,\n }}\n >\n {visibleItems.map((item, index) => {\n const depth = visibleItems.length - 1 - index;\n const covered = !expanded && depth > 0;\n return (\n <div\n key={item.id}\n data-toast-id={item.id}\n tabIndex={-1}\n aria-hidden={covered ? 'true' : undefined}\n inert={covered}\n class={{\n 'toast-layer relative w-full min-w-0 shrink-0': true,\n 'toast-layer--covered': covered,\n 'toast-layer--entering': this.enteringIds.has(item.id),\n }}\n style={{\n '--toast-depth': String(depth),\n '--toast-width': `${100 - Math.min(depth, MAX_VISIBLE_LAYERS - 1) * LAYER_WIDTH_STEP}%`,\n }}\n >\n <sula-toast\n toastTitle={item.title}\n message={item.message ?? ''}\n type={item.type}\n icon={item.icon}\n actionText={item.actionText ?? ''}\n closable={item.closable ?? true}\n duration={item.duration}\n closeLabel={item.closeLabel ?? 'Fechar notificação'}\n paused={covered || this.hovering || this.focused || this.retainingPointerExpansion}\n announcement=\"off\"\n animated={depth === 0}\n onToastDismissRequested={event => this.dismiss(event, item.id)}\n onToastAction={event => this.action(event, item.id)}\n />\n </div>\n );\n })}\n </div>\n </section>\n <div class=\"sr-only\" role=\"status\" aria-live=\"polite\" aria-atomic=\"false\" aria-relevant=\"additions text\">\n {this.announcements\n .filter(record => record.priority === 'polite')\n .map(record => (\n <p key={record.version}>{record.text}</p>\n ))}\n </div>\n <div class=\"sr-only\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"false\" aria-relevant=\"additions text\">\n {this.announcements\n .filter(record => record.priority === 'assertive')\n .map(record => (\n <p key={record.version}>{record.text}</p>\n ))}\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -0,0 +1,67 @@
1
+ const MOTION_DURATION = 260;
2
+ const MOTION_EASING = 'cubic-bezier(0.2, 0.8, 0.2, 1)';
3
+ export class SulaToastStackMotion {
4
+ constructor() {
5
+ this.animations = new Set();
6
+ }
7
+ capture(region, list) {
8
+ const cards = new Map();
9
+ list.querySelectorAll('[data-toast-id]').forEach(element => {
10
+ const rect = element.getBoundingClientRect();
11
+ if (element.dataset.toastId && rect.width && rect.height) {
12
+ cards.set(element.dataset.toastId, { rect, opacity: Number(getComputedStyle(element).opacity) });
13
+ }
14
+ });
15
+ const previous = { height: region.getBoundingClientRect().height, cards };
16
+ this.cancelAnimations();
17
+ this.previous = previous;
18
+ }
19
+ play(region, list) {
20
+ const previous = this.previous;
21
+ this.previous = undefined;
22
+ if (!previous)
23
+ return;
24
+ list.querySelectorAll('[data-toast-id]').forEach(element => {
25
+ const rect = element.getBoundingClientRect();
26
+ const transform = getComputedStyle(element).transform;
27
+ const restingTransform = transform === 'none' ? '' : transform;
28
+ const origin = previous.cards.get(element.dataset.toastId);
29
+ if (!rect.width || !rect.height)
30
+ return;
31
+ if (!origin)
32
+ return;
33
+ const deltaX = origin.rect.left - rect.left;
34
+ const deltaY = origin.rect.top - rect.top;
35
+ const scaleX = origin.rect.width / rect.width;
36
+ const scaleY = origin.rect.height / rect.height;
37
+ const moved = Math.abs(deltaX) > 0.5 || Math.abs(deltaY) > 0.5 || Math.abs(scaleX - 1) > 0.005 || Math.abs(scaleY - 1) > 0.005;
38
+ if (!moved && origin.opacity > 0.995)
39
+ return;
40
+ this.animate(element, [
41
+ {
42
+ opacity: origin.opacity,
43
+ transformOrigin: 'top left',
44
+ transform: `translate(${deltaX}px, ${deltaY}px) ${restingTransform} scale(${scaleX}, ${scaleY})`,
45
+ },
46
+ { opacity: 1, transformOrigin: 'top left', transform },
47
+ ]);
48
+ });
49
+ const height = region.getBoundingClientRect().height;
50
+ if (previous.height !== height)
51
+ this.animate(region, [{ height: `${previous.height}px` }, { height: `${height}px` }]);
52
+ }
53
+ cancel() {
54
+ this.previous = undefined;
55
+ this.cancelAnimations();
56
+ }
57
+ animate(element, frames) {
58
+ const animation = element.animate(frames, { duration: MOTION_DURATION, easing: MOTION_EASING });
59
+ this.animations.add(animation);
60
+ animation.onfinish = animation.oncancel = () => this.animations.delete(animation);
61
+ }
62
+ cancelAnimations() {
63
+ this.animations.forEach(animation => animation.cancel());
64
+ this.animations.clear();
65
+ }
66
+ }
67
+ //# sourceMappingURL=sula-toast-stack.motion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sula-toast-stack.motion.js","sourceRoot":"","sources":["../../../src/components/sula-toast-stack/sula-toast-stack.motion.ts"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,aAAa,GAAG,gCAAgC,CAAC;AAYvD,MAAM,OAAO,oBAAoB;IAAjC;QAEU,eAAU,GAAG,IAAI,GAAG,EAAa,CAAC;IAiE5C,CAAC;IA/DC,OAAO,CAAC,MAAmB,EAAE,IAAiB;QAC5C,MAAM,KAAK,GAAG,IAAI,GAAG,EAAsB,CAAC;QAC5C,IAAI,CAAC,gBAAgB,CAAc,iBAAiB,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YACtE,MAAM,IAAI,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;YAC7C,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBACzD,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACnG,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,qBAAqB,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;QAC1E,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC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U,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACpF,CAAC;IAEO,gBAAgB;QACtB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;QACzD,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;CACF","sourcesContent":["const MOTION_DURATION = 260;\nconst MOTION_EASING = 'cubic-bezier(0.2, 0.8, 0.2, 1)';\n\ninterface CardLayout {\n rect: DOMRect;\n opacity: number;\n}\n\ninterface StackLayout {\n height: number;\n cards: Map<string, CardLayout>;\n}\n\nexport class SulaToastStackMotion {\n private previous?: StackLayout;\n private animations = new Set<Animation>();\n\n capture(region: HTMLElement, list: HTMLElement) {\n const cards = new Map<string, CardLayout>();\n list.querySelectorAll<HTMLElement>('[data-toast-id]').forEach(element => {\n const rect = element.getBoundingClientRect();\n if (element.dataset.toastId && rect.width && rect.height) {\n cards.set(element.dataset.toastId, { rect, opacity: Number(getComputedStyle(element).opacity) });\n }\n });\n\n const previous = { height: region.getBoundingClientRect().height, cards };\n this.cancelAnimations();\n this.previous = previous;\n }\n\n play(region: HTMLElement, list: HTMLElement) {\n const previous = this.previous;\n this.previous = undefined;\n if (!previous) return;\n\n list.querySelectorAll<HTMLElement>('[data-toast-id]').forEach(element => {\n const rect = element.getBoundingClientRect();\n const transform = getComputedStyle(element).transform;\n const restingTransform = transform === 'none' ? '' : transform;\n const origin = previous.cards.get(element.dataset.toastId);\n if (!rect.width || !rect.height) return;\n if (!origin) return;\n\n const deltaX = origin.rect.left - rect.left;\n const deltaY = origin.rect.top - rect.top;\n const scaleX = origin.rect.width / rect.width;\n const scaleY = origin.rect.height / rect.height;\n const moved = Math.abs(deltaX) > 0.5 || Math.abs(deltaY) > 0.5 || Math.abs(scaleX - 1) > 0.005 || Math.abs(scaleY - 1) > 0.005;\n if (!moved && origin.opacity > 0.995) return;\n\n this.animate(element, [\n {\n opacity: origin.opacity,\n transformOrigin: 'top left',\n transform: `translate(${deltaX}px, ${deltaY}px) ${restingTransform} scale(${scaleX}, ${scaleY})`,\n },\n { opacity: 1, transformOrigin: 'top left', transform },\n ]);\n });\n\n const height = region.getBoundingClientRect().height;\n if (previous.height !== height) this.animate(region, [{ height: `${previous.height}px` }, { height: `${height}px` }]);\n }\n\n cancel() {\n this.previous = undefined;\n this.cancelAnimations();\n }\n\n private animate(element: HTMLElement, frames: Keyframe[]) {\n const animation = element.animate(frames, { duration: MOTION_DURATION, easing: MOTION_EASING });\n this.animations.add(animation);\n animation.onfinish = animation.oncancel = () => this.animations.delete(animation);\n }\n\n private cancelAnimations() {\n this.animations.forEach(animation => animation.cancel());\n this.animations.clear();\n }\n}\n"]}
@@ -0,0 +1,87 @@
1
+ import { SulaToastType } from "../sula-toast/model/sula-toast.model";
2
+ export default {
3
+ title: 'Components/sula-toast-stack',
4
+ tags: ['autodocs'],
5
+ parameters: {
6
+ docs: {
7
+ description: {
8
+ component: 'Pilha no fluxo normal: a aplicação controla posição e items. A ordem é cronológica e somente as três mensagens mais recentes são renderizadas. Hover ou foco expandem essas mensagens; quando uma delas sai, a anterior passa a ser exibida. Os temporizadores pausam durante a interação e enquanto a mensagem está encoberta.',
9
+ },
10
+ },
11
+ },
12
+ argTypes: {
13
+ items: { control: 'object', description: 'Lista cronológica com IDs únicos. Substitua o array para atualizar a pilha.' },
14
+ toastDismissRequested: { action: 'toastDismissRequested', description: 'Detalhe: { id, reason: "close" | "timeout" }. Remova o item em resposta.' },
15
+ toastAction: { action: 'toastAction', description: 'Detalhe: { id }. A aplicação implementa a ação.' },
16
+ },
17
+ };
18
+ const examples = [
19
+ { id: '1', title: 'Documento enviado', message: 'O envio foi concluído.', type: SulaToastType.Success, icon: 'ph ph-check-circle', duration: 0 },
20
+ { id: '2', title: 'Dados atualizados', message: 'Confira as informações cadastradas.', type: SulaToastType.Info, icon: 'ph ph-info', duration: 0 },
21
+ { id: '3', icon: 'ph ph-circle-dashed', title: 'Item removido', message: 'Você pode desfazer esta alteração.', actionText: 'Desfazer' },
22
+ ];
23
+ const Template = args => {
24
+ const surface = document.createElement('div');
25
+ surface.className = 'p-32';
26
+ surface.style.minHeight = '480px';
27
+ const stack = document.createElement('sula-toast-stack');
28
+ stack.items = args.items.map(item => (Object.assign({}, item)));
29
+ stack.addEventListener('toastDismissRequested', event => {
30
+ var _a;
31
+ (_a = args.toastDismissRequested) === null || _a === void 0 ? void 0 : _a.call(args, event);
32
+ stack.items = stack.items.filter(item => item.id !== event.detail.id);
33
+ });
34
+ stack.addEventListener('toastAction', event => { var _a; return (_a = args.toastAction) === null || _a === void 0 ? void 0 : _a.call(args, event); });
35
+ surface.append(stack);
36
+ return surface;
37
+ };
38
+ export const Default = { render: Template, args: { items: examples } };
39
+ export const MoreThanThreeMessages = {
40
+ render: Template,
41
+ args: {
42
+ items: Array.from({ length: 10 }, (_, index) => ({
43
+ id: String(index),
44
+ title: `Notificação ${index + 1}`,
45
+ message: 'A pilha renderiza somente as três notificações mais recentes.',
46
+ duration: 0,
47
+ })),
48
+ },
49
+ };
50
+ export const DifferentHeights = {
51
+ render: Template,
52
+ args: {
53
+ items: examples.map((item, index) => (Object.assign(Object.assign({}, item), { message: index === 1
54
+ ? 'Uma mensagem mais longa, com informações adicionais que ocupam várias linhas. A pilha deve acomodar o conteúdo sem sobreposição quando expandida.'
55
+ : item.message }))),
56
+ },
57
+ };
58
+ export const ApplicationIntegration = {
59
+ render: () => {
60
+ const container = document.createElement('div');
61
+ container.className = 'p-24';
62
+ const add = document.createElement('button');
63
+ add.type = 'button';
64
+ add.className = 'text-text-link underline mb-24';
65
+ add.textContent = 'Adicionar notificação';
66
+ const status = document.createElement('p');
67
+ status.className = 'text-label-medium-regular text-text-primary mb-24';
68
+ status.setAttribute('role', 'status');
69
+ const stack = document.createElement('sula-toast-stack');
70
+ stack.items = examples.map(item => (Object.assign({}, item)));
71
+ let sequence = 3;
72
+ add.addEventListener('click', () => {
73
+ const id = String(++sequence);
74
+ stack.items = [...stack.items, { id, title: `Notificação ${id}`, message: 'Esta mensagem dura 5 segundos de exposição sem interação.' }];
75
+ });
76
+ stack.addEventListener('toastDismissRequested', (event) => {
77
+ stack.items = stack.items.filter(item => item.id !== event.detail.id);
78
+ });
79
+ stack.addEventListener('toastAction', (event) => {
80
+ status.textContent = `A aplicação desfez a alteração da notificação ${event.detail.id}.`;
81
+ stack.items = stack.items.filter(item => item.id !== event.detail.id);
82
+ });
83
+ container.append(add, status, stack);
84
+ return container;
85
+ },
86
+ };
87
+ //# sourceMappingURL=sula-toast-stack.stories.js.map