@4sh/ui-kit 0.16.0 → 0.17.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 (219) hide show
  1. package/README.fr.md +10 -10
  2. package/README.md +10 -10
  3. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +542 -150
  4. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
  5. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +622 -248
  6. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
  7. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs +385 -152
  8. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
  9. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +748 -433
  10. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -1
  11. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs +227 -135
  12. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs.map +1 -1
  13. package/fesm2022/4sh-ui-kit-base-ui-image.mjs +1200 -633
  14. package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
  15. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +1675 -1000
  16. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
  17. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs +243 -117
  18. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
  19. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +2294 -2048
  20. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
  21. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +1058 -1113
  22. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -1
  23. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs +1108 -0
  24. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs.map +1 -0
  25. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +397 -141
  26. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
  27. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +1529 -583
  28. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
  29. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs +383 -224
  30. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs.map +1 -1
  31. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs +345 -177
  32. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
  33. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +280 -138
  34. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
  35. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +507 -257
  36. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
  37. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs +401 -312
  38. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
  39. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +1277 -697
  40. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
  41. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +467 -199
  42. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
  43. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs +394 -270
  44. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs.map +1 -1
  45. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs +140 -60
  46. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs.map +1 -1
  47. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +386 -167
  48. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
  49. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs +150 -87
  50. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
  51. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs +345 -180
  52. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
  53. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +582 -392
  54. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
  55. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +1552 -888
  56. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
  57. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs +485 -338
  58. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
  59. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +503 -311
  60. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -1
  61. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +271 -137
  62. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
  63. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs +457 -214
  64. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs.map +1 -1
  65. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +711 -371
  66. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -1
  67. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs +235 -121
  68. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
  69. package/fesm2022/4sh-ui-kit-forms.mjs +721 -638
  70. package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
  71. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs +546 -242
  72. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
  73. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs +335 -157
  74. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
  75. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs +53 -33
  76. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs.map +1 -1
  77. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs +218 -121
  78. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs.map +1 -1
  79. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +192 -100
  80. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
  81. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +456 -204
  82. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
  83. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs +314 -147
  84. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs.map +1 -1
  85. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs +179 -82
  86. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs.map +1 -1
  87. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs +268 -123
  88. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
  89. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs +391 -146
  90. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs.map +1 -1
  91. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs +158 -76
  92. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs.map +1 -1
  93. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs +159 -80
  94. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs.map +1 -1
  95. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs +295 -131
  96. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs.map +1 -1
  97. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs +211 -83
  98. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs.map +1 -1
  99. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs +784 -414
  100. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
  101. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +822 -476
  102. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
  103. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs +1014 -599
  104. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs.map +1 -1
  105. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs +403 -189
  106. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs.map +1 -1
  107. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs +707 -272
  108. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
  109. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +1146 -568
  110. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
  111. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs +519 -308
  112. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs.map +1 -1
  113. package/fesm2022/4sh-ui-kit-motion.mjs +252 -150
  114. package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -1
  115. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs +793 -341
  116. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs.map +1 -1
  117. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +351 -194
  118. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
  119. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs +511 -220
  120. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs.map +1 -1
  121. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +910 -548
  122. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
  123. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +1128 -555
  124. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
  125. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +915 -470
  126. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
  127. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +931 -474
  128. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
  129. package/fesm2022/4sh-ui-kit-overlay.mjs +26 -109
  130. package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -1
  131. package/fesm2022/4sh-ui-kit-ripple.mjs +329 -290
  132. package/fesm2022/4sh-ui-kit-ripple.mjs.map +1 -1
  133. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +709 -248
  134. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
  135. package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2633 -1370
  136. package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
  137. package/fesm2022/4sh-ui-kit-theming.mjs +112 -113
  138. package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -1
  139. package/fesm2022/4sh-ui-kit-types.mjs +0 -12
  140. package/fesm2022/4sh-ui-kit.mjs +3 -15
  141. package/fesm2022/4sh-ui-kit.mjs.map +1 -1
  142. package/mcp/data/component-api.json +299 -2
  143. package/mcp/data/text-search-docs.json +149 -9
  144. package/mcp/data/ui-config.json +378 -1
  145. package/mcp/index.js +8190 -2876
  146. package/mcp/package.json +1 -1
  147. package/package.json +5 -1
  148. package/styles/component-vars.scss +22 -1
  149. package/types/4sh-ui-kit-actions-ui-button-split.d.ts +198 -87
  150. package/types/4sh-ui-kit-actions-ui-button.d.ts +240 -116
  151. package/types/4sh-ui-kit-actions-ui-link.d.ts +136 -67
  152. package/types/4sh-ui-kit-actions-ui-speed-dial.d.ts +287 -180
  153. package/types/4sh-ui-kit-base-ui-icon.d.ts +92 -58
  154. package/types/4sh-ui-kit-base-ui-image.d.ts +406 -205
  155. package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +573 -376
  156. package/types/4sh-ui-kit-forms-ui-checkbox.d.ts +77 -42
  157. package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +953 -700
  158. package/types/4sh-ui-kit-forms-ui-editor.d.ts +374 -340
  159. package/types/4sh-ui-kit-forms-ui-field-sign.d.ts +325 -0
  160. package/types/4sh-ui-kit-forms-ui-field.d.ts +150 -64
  161. package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +583 -241
  162. package/types/4sh-ui-kit-forms-ui-input-date.d.ts +152 -103
  163. package/types/4sh-ui-kit-forms-ui-input-group.d.ts +109 -63
  164. package/types/4sh-ui-kit-forms-ui-input-mask.d.ts +93 -59
  165. package/types/4sh-ui-kit-forms-ui-input-number.d.ts +171 -96
  166. package/types/4sh-ui-kit-forms-ui-input-otp.d.ts +137 -104
  167. package/types/4sh-ui-kit-forms-ui-input-tags.d.ts +469 -309
  168. package/types/4sh-ui-kit-forms-ui-input.d.ts +198 -118
  169. package/types/4sh-ui-kit-forms-ui-knob.d.ts +132 -80
  170. package/types/4sh-ui-kit-forms-ui-label.d.ts +47 -22
  171. package/types/4sh-ui-kit-forms-ui-nudger.d.ts +134 -67
  172. package/types/4sh-ui-kit-forms-ui-radio.d.ts +48 -33
  173. package/types/4sh-ui-kit-forms-ui-rating.d.ts +120 -86
  174. package/types/4sh-ui-kit-forms-ui-segment-control.d.ts +221 -147
  175. package/types/4sh-ui-kit-forms-ui-select.d.ts +561 -357
  176. package/types/4sh-ui-kit-forms-ui-slider.d.ts +156 -105
  177. package/types/4sh-ui-kit-forms-ui-swatch-picker.d.ts +133 -97
  178. package/types/4sh-ui-kit-forms-ui-textarea.d.ts +90 -56
  179. package/types/4sh-ui-kit-forms-ui-toggle-block.d.ts +158 -94
  180. package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +314 -178
  181. package/types/4sh-ui-kit-forms-ui-toggle.d.ts +88 -54
  182. package/types/4sh-ui-kit-forms.d.ts +275 -194
  183. package/types/4sh-ui-kit-informative-ui-accordion.d.ts +162 -92
  184. package/types/4sh-ui-kit-informative-ui-alert.d.ts +128 -62
  185. package/types/4sh-ui-kit-informative-ui-avatar-group.d.ts +8 -8
  186. package/types/4sh-ui-kit-informative-ui-avatar.d.ts +81 -44
  187. package/types/4sh-ui-kit-informative-ui-badge.d.ts +71 -41
  188. package/types/4sh-ui-kit-informative-ui-chip.d.ts +194 -99
  189. package/types/4sh-ui-kit-informative-ui-empty-state.d.ts +105 -65
  190. package/types/4sh-ui-kit-informative-ui-helper.d.ts +64 -34
  191. package/types/4sh-ui-kit-informative-ui-progress-bar.d.ts +120 -65
  192. package/types/4sh-ui-kit-informative-ui-read-only.d.ts +147 -67
  193. package/types/4sh-ui-kit-informative-ui-separator.d.ts +65 -35
  194. package/types/4sh-ui-kit-informative-ui-skeleton.d.ts +62 -32
  195. package/types/4sh-ui-kit-informative-ui-spinner.d.ts +111 -50
  196. package/types/4sh-ui-kit-informative-ui-tag.d.ts +77 -37
  197. package/types/4sh-ui-kit-informative-ui-toast.d.ts +300 -180
  198. package/types/4sh-ui-kit-informative-ui-tooltip.d.ts +269 -141
  199. package/types/4sh-ui-kit-layout-ui-bottom-sheet.d.ts +360 -221
  200. package/types/4sh-ui-kit-layout-ui-card.d.ts +119 -79
  201. package/types/4sh-ui-kit-layout-ui-drawer.d.ts +244 -120
  202. package/types/4sh-ui-kit-layout-ui-modal.d.ts +409 -222
  203. package/types/4sh-ui-kit-layout-ui-popover.d.ts +149 -91
  204. package/types/4sh-ui-kit-motion.d.ts +117 -67
  205. package/types/4sh-ui-kit-navigation-ui-bottom-tab-bar.d.ts +279 -145
  206. package/types/4sh-ui-kit-navigation-ui-breadcrumb.d.ts +134 -96
  207. package/types/4sh-ui-kit-navigation-ui-context-menu.d.ts +148 -89
  208. package/types/4sh-ui-kit-navigation-ui-menu.d.ts +282 -201
  209. package/types/4sh-ui-kit-navigation-ui-sidebar.d.ts +425 -261
  210. package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +279 -183
  211. package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +275 -173
  212. package/types/4sh-ui-kit-overlay.d.ts +6 -6
  213. package/types/4sh-ui-kit-ripple.d.ts +99 -74
  214. package/types/4sh-ui-kit-table-ui-paginator.d.ts +237 -133
  215. package/types/4sh-ui-kit-table-ui-table.d.ts +769 -470
  216. package/types/4sh-ui-kit-theming.d.ts +27 -29
  217. package/types/4sh-ui-kit-types.d.ts +6 -5
  218. package/types/4sh-ui-kit.d.ts +4 -3
  219. package/fesm2022/4sh-ui-kit-types.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"4sh-ui-kit-informative-ui-chip.mjs","sources":["../../../projects/ui-kit/informative/ui-chip/src/lib/ui-chip.ts","../../../projects/ui-kit/informative/ui-chip/src/lib/ui-chip.html","../../../projects/ui-kit/informative/ui-chip/src/public-api.ts","../../../projects/ui-kit/informative/ui-chip/src/4sh-ui-kit-informative-ui-chip.ts"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n effect,\n input,\n isDevMode,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { UiIcon, UiIconSize } from '@4sh/ui-kit/base/ui-icon';\nimport { UiFeedbackLevel, UiSubLevel } from '@4sh/ui-kit/types';\n\nexport type ChipSize = 'default' | 'small';\n\n/**\n * ui-chip — compact, interactive entity token.\n *\n * A close relative of `ui-tag`, but interactive: it can carry a leading icon or\n * image (avatar-like), an optional remove action, and arbitrary projected content.\n * Typical uses: selected values in a multi-select, filter/entity chips, keyword lists.\n *\n * Categorised by `level` × `subLevel` (informative color families) and fully\n * token-driven. Interactive states (hover/focus on the remove action) are handled in\n * CSS via the same `informative.*` tokens — never through Angular props.\n *\n * Accessible: `label` is exposed as the default `aria-label` (overridable via\n * `ariaLabel` / `ariaLabelledBy`); the remove action is a native `<button>`, focusable\n * with Tab and removable with Enter/Space (native) plus Backspace/Delete.\n */\n@Component({\n selector: 'ui-chip',\n imports: [UiIcon, NgTemplateOutlet],\n templateUrl: './ui-chip.html',\n styleUrl: './ui-chip.scss',\n})\nexport class UiChip {\n /** Text content of the chip. */\n label = input<string>();\n /** Color family. */\n level = input<UiFeedbackLevel>('default');\n /** Intensity: high (solid) or low (subtle). Chips default to the discreet `low`. */\n subLevel = input<UiSubLevel>('low');\n /** Size. */\n size = input<ChipSize>('default');\n /** FontAwesome name of the leading icon (ignored when `image` is set). */\n icon = input<string>();\n /** Leading image source (avatar-like). Takes priority over `icon`. */\n image = input<string>();\n /** Alternative text for the image (leave empty for a decorative image next to a label). */\n alt = input<string>();\n /** Pill shape when true (default); rounded-rectangle when false. */\n rounded = input(true, { transform: booleanAttribute });\n /** Displays a remove action at the end of the chip. */\n removable = input(false, { transform: booleanAttribute });\n /** FontAwesome name of the remove icon. */\n removeIcon = input<string>('xmark');\n /** Disables the chip (the remove action / selection becomes non-interactive). */\n disabled = input(false, { transform: booleanAttribute });\n /**\n * Turns the whole chip into a selectable toggle (choice/filter chip). The root\n * becomes a native `<button aria-pressed>`; clicking toggles `selected`.\n * Mutually exclusive with `removable` (nesting interactive elements is invalid).\n */\n selectable = input(false, { transform: booleanAttribute });\n /** Two-way selection state (only meaningful when `selectable`). */\n selected = model(false);\n /** FontAwesome name shown in the leading slot while selected (selectable mode). */\n selectedIcon = input<string>('check');\n /** Explicit accessible name (overrides the `label` default). */\n ariaLabel = input<string>();\n /** Id of the element labelling the chip (overrides `ariaLabel`/`label`). */\n ariaLabelledBy = input<string>();\n /** Accessible name of the remove action. */\n removeAriaLabel = input<string>('Supprimer');\n /**\n * `tabindex` of the remove action. Leave unset for the natural tab order;\n * set `-1` when the chip lives inside a roving-focus container (e.g.\n * `ui-input-tags`) so the button is not a separate tab stop.\n */\n removeTabindex = input<number>();\n\n /** Emitted when the chip is removed (click or keyboard on the remove action). */\n remove = output<Event>();\n /** Emitted when a selectable chip is toggled (click or keyboard on the chip). */\n chipClick = output<Event>();\n /** Emitted when the image fails to load (the chip then falls back to icon/label). */\n imageError = output<Event>();\n\n /** @ignore Set once the current image source failed to load. */\n private readonly imageFailed = signal(false);\n\n constructor() {\n // Reset the load-error flag whenever the source changes.\n effect(() => {\n this.image();\n this.imageFailed.set(false);\n });\n\n // A11y safeguard: a chip with only a visual (icon/image) needs an accessible name.\n if (isDevMode()) {\n effect(() => {\n if (this.isVisualOnly() && !this.accessibleName()) {\n console.warn(\n '[ui-chip] Chip has no text: provide `label`, `ariaLabel` or `ariaLabelledBy`.',\n );\n }\n });\n\n // `selectable` and `removable` can't coexist (nested interactive elements).\n effect(() => {\n if (this.selectable() && this.removable()) {\n console.warn(\n '[ui-chip] `selectable` and `removable` are mutually exclusive: the remove action is ignored.',\n );\n }\n });\n }\n }\n\n /** @ignore There is a textual label. */\n protected readonly hasLabel = computed(() => !!this.label()?.length);\n\n /** @ignore The leading image is shown (source set and not failed). */\n protected readonly showImage = computed(() => !!this.image() && !this.imageFailed());\n\n /** @ignore Selectable + selected: the leading slot shows the selected icon. */\n protected readonly showSelectedIcon = computed(\n () => this.selectable() && this.selected() && !!this.selectedIcon(),\n );\n\n /** @ignore The leading image is shown (not overridden by the selected icon). */\n protected readonly showLeadingImage = computed(\n () => !this.showSelectedIcon() && this.showImage(),\n );\n\n /** @ignore The leading font icon is shown (no image / selected icon taking its place). */\n protected readonly showIcon = computed(() => !this.showImage() && !!this.icon());\n\n /** @ignore The leading font icon is shown (not overridden by the selected icon). */\n protected readonly showLeadingIcon = computed(() => !this.showSelectedIcon() && this.showIcon());\n\n /** @ignore The remove action is rendered (never inside a selectable button). */\n protected readonly showRemove = computed(() => this.removable() && !this.selectable());\n\n /** @ignore A visual (icon/image) with no textual label. */\n protected readonly isVisualOnly = computed(\n () => (this.showImage() || this.showIcon()) && !this.hasLabel(),\n );\n\n /** @ignore Resolved accessible name from the explicit label / ariaLabel. */\n protected readonly accessibleName = computed<string | null>(\n () => this.ariaLabel() ?? this.label() ?? null,\n );\n\n /** @ignore Root `aria-label`: explicit name, suppressed when `ariaLabelledBy` wins. */\n protected readonly rootAriaLabel = computed<string | null>(() =>\n this.ariaLabelledBy() ? null : this.accessibleName(),\n );\n\n /** @ignore Leading icon size derived from the chip size. */\n protected readonly iconSize = computed<UiIconSize>(() => (this.size() === 'small' ? 'sm' : 'md'));\n\n /** @ignore Remove icon is compact regardless of chip size. */\n protected readonly removeIconSize: UiIconSize = 'sm';\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const c = ['ui-chip', `_${this.level()}`, `_${this.subLevel()}`];\n if (this.size() !== 'default') c.push(`_${this.size()}`);\n if (!this.rounded()) c.push('_square');\n if (this.showRemove()) c.push('_removable');\n if (this.disabled()) c.push('_disabled');\n if (this.selectable()) c.push('_selectable');\n if (this.selectable() && this.selected()) c.push('_selected');\n return c.join(' ');\n });\n\n /** @ignore */\n protected onImageError(event: Event): void {\n this.imageFailed.set(true);\n this.imageError.emit(event);\n }\n\n /** @ignore */\n protected onRemove(event: Event): void {\n if (this.disabled()) return;\n this.remove.emit(event);\n }\n\n /** @ignore Backspace/Delete on the remove button also removes (Enter/Space are native). */\n protected onRemoveKeydown(event: KeyboardEvent): void {\n if (event.key === 'Backspace' || event.key === 'Delete') {\n event.preventDefault();\n this.onRemove(event);\n }\n }\n\n /** @ignore Toggle the selection (selectable mode). Enter/Space fire this via native click. */\n protected onToggle(event: Event): void {\n if (this.disabled()) return;\n this.selected.set(!this.selected());\n this.chipClick.emit(event);\n }\n}\n","@if (selectable()) {\n <button\n type=\"button\"\n [class]=\"classes()\"\n [disabled]=\"disabled()\"\n [attr.aria-pressed]=\"selected()\"\n [attr.aria-label]=\"rootAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n (click)=\"onToggle($event)\"\n >\n <ng-container [ngTemplateOutlet]=\"inner\" />\n </button>\n} @else {\n <span\n [class]=\"classes()\"\n [attr.role]=\"rootAriaLabel() || ariaLabelledBy() ? (showRemove() ? 'group' : 'img') : null\"\n [attr.aria-label]=\"rootAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n >\n <ng-container [ngTemplateOutlet]=\"inner\" />\n </span>\n}\n\n<ng-template #inner>\n @if (showSelectedIcon()) {\n <ui-icon class=\"ui-chip-icon\" [name]=\"selectedIcon()!\" [size]=\"iconSize()\" />\n } @else if (showLeadingImage()) {\n <img\n class=\"ui-chip-image\"\n [src]=\"image()\"\n [attr.alt]=\"alt() ?? ''\"\n (error)=\"onImageError($event)\"\n />\n } @else if (showLeadingIcon()) {\n <ui-icon class=\"ui-chip-icon\" [name]=\"icon()!\" [size]=\"iconSize()\" />\n }\n\n @if (hasLabel()) {\n <span class=\"ui-chip-label\">{{ label() }}</span>\n }\n\n <!-- Custom / templated content -->\n <ng-content />\n\n @if (showRemove()) {\n <button\n type=\"button\"\n class=\"ui-chip-remove\"\n [disabled]=\"disabled()\"\n [attr.tabindex]=\"removeTabindex()\"\n [attr.aria-label]=\"removeAriaLabel()\"\n (click)=\"onRemove($event)\"\n (keydown)=\"onRemoveKeydown($event)\"\n >\n <ui-icon [name]=\"removeIcon()\" [size]=\"removeIconSize\" />\n </button>\n }\n</ng-template>\n","/*\n * Public API Surface of ui-kit/ui-chip\n */\n\nexport * from './lib/ui-chip';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAiBA;;;;;;;;;;;;;;AAcG;MAOU,MAAM,CAAA;AAwDjB,IAAA,WAAA,GAAA;;AAtDA,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK;6FAAU;;QAEvB,IAAA,CAAA,KAAK,GAAG,KAAK,CAAkB,SAAS;kFAAC;;QAEzC,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAa,KAAK;qFAAC;;QAEnC,IAAA,CAAA,IAAI,GAAG,KAAK,CAAW,SAAS;iFAAC;;AAEjC,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK;4FAAU;;AAEtB,QAAA,IAAA,CAAA,KAAK,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A,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,eAAA,EAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,EAAA,iBAAA,EAAA,gBAAA,EAAA,UAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,QAAA,EAAA,SAAA,EAAA,WAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECtCnB,8oDA0DA,EAAA,MAAA,EAAA,CAAA,8riBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDxBY,MAAM,2HAAE,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAIvB,MAAM,EAAA,UAAA,EAAA,CAAA;kBANlB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,SAAS,EAAA,OAAA,EACV,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAAA,QAAA,EAAA,8oDAAA,EAAA,MAAA,EAAA,CAAA,8riBAAA,CAAA,EAAA;;;AElCrC;;AAEG;;ACFH;;AAEG;;"}
1
+ {"version":3,"file":"4sh-ui-kit-informative-ui-chip.mjs","names":[],"sources":["../../../projects/ui-kit/informative/ui-chip/src/lib/ui-chip.ts","../../../projects/ui-kit/informative/ui-chip/src/lib/ui-chip.html"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n effect,\n input,\n isDevMode,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { UiIcon, UiIconSize } from '@4sh/ui-kit/base/ui-icon';\nimport { UiFeedbackLevel, UiSubLevel } from '@4sh/ui-kit/types';\n\nexport type ChipSize = 'default' | 'small';\n\n/**\n * ui-chip — compact, interactive entity token.\n *\n * A close relative of `ui-tag`, but interactive: it can carry a leading icon or\n * image (avatar-like), an optional remove action, and arbitrary projected content.\n * Typical uses: selected values in a multi-select, filter/entity chips, keyword lists.\n *\n * Categorised by `level` × `subLevel` (informative color families) and fully\n * token-driven. Interactive states (hover/focus on the remove action) are handled in\n * CSS via the same `informative.*` tokens — never through Angular props.\n *\n * Accessible: `label` is exposed as the default `aria-label` (overridable via\n * `ariaLabel` / `ariaLabelledBy`); the remove action is a native `<button>`, focusable\n * with Tab and removable with Enter/Space (native) plus Backspace/Delete.\n */\n@Component({\n selector: 'ui-chip',\n imports: [UiIcon, NgTemplateOutlet],\n templateUrl: './ui-chip.html',\n styleUrl: './ui-chip.scss',\n})\nexport class UiChip {\n /** Text content of the chip. */\n label = input<string>();\n /** Color family. */\n level = input<UiFeedbackLevel>('default');\n /** Intensity: high (solid) or low (subtle). Chips default to the discreet `low`. */\n subLevel = input<UiSubLevel>('low');\n /** Size. */\n size = input<ChipSize>('default');\n /** FontAwesome name of the leading icon (ignored when `image` is set). */\n icon = input<string>();\n /** Leading image source (avatar-like). Takes priority over `icon`. */\n image = input<string>();\n /** Alternative text for the image (leave empty for a decorative image next to a label). */\n alt = input<string>();\n /** Pill shape when true (default); rounded-rectangle when false. */\n rounded = input(true, { transform: booleanAttribute });\n /** Displays a remove action at the end of the chip. */\n removable = input(false, { transform: booleanAttribute });\n /** FontAwesome name of the remove icon. */\n removeIcon = input<string>('xmark');\n /** Disables the chip (the remove action / selection becomes non-interactive). */\n disabled = input(false, { transform: booleanAttribute });\n /**\n * Turns the whole chip into a selectable toggle (choice/filter chip). The root\n * becomes a native `<button aria-pressed>`; clicking toggles `selected`.\n * Mutually exclusive with `removable` (nesting interactive elements is invalid).\n */\n selectable = input(false, { transform: booleanAttribute });\n /** Two-way selection state (only meaningful when `selectable`). */\n selected = model(false);\n /** FontAwesome name shown in the leading slot while selected (selectable mode). */\n selectedIcon = input<string>('check');\n /** Explicit accessible name (overrides the `label` default). */\n ariaLabel = input<string>();\n /** Id of the element labelling the chip (overrides `ariaLabel`/`label`). */\n ariaLabelledBy = input<string>();\n /** Accessible name of the remove action. */\n removeAriaLabel = input<string>('Supprimer');\n /**\n * `tabindex` of the remove action. Leave unset for the natural tab order;\n * set `-1` when the chip lives inside a roving-focus container (e.g.\n * `ui-input-tags`) so the button is not a separate tab stop.\n */\n removeTabindex = input<number>();\n\n /** Emitted when the chip is removed (click or keyboard on the remove action). */\n remove = output<Event>();\n /** Emitted when a selectable chip is toggled (click or keyboard on the chip). */\n chipClick = output<Event>();\n /** Emitted when the image fails to load (the chip then falls back to icon/label). */\n imageError = output<Event>();\n\n /** @ignore Set once the current image source failed to load. */\n private readonly imageFailed = signal(false);\n\n constructor() {\n // Reset the load-error flag whenever the source changes.\n effect(() => {\n this.image();\n this.imageFailed.set(false);\n });\n\n // A11y safeguard: a chip with only a visual (icon/image) needs an accessible name.\n if (isDevMode()) {\n effect(() => {\n if (this.isVisualOnly() && !this.accessibleName()) {\n console.warn(\n '[ui-chip] Chip has no text: provide `label`, `ariaLabel` or `ariaLabelledBy`.',\n );\n }\n });\n\n // `selectable` and `removable` can't coexist (nested interactive elements).\n effect(() => {\n if (this.selectable() && this.removable()) {\n console.warn(\n '[ui-chip] `selectable` and `removable` are mutually exclusive: the remove action is ignored.',\n );\n }\n });\n }\n }\n\n /** @ignore There is a textual label. */\n protected readonly hasLabel = computed(() => !!this.label()?.length);\n\n /** @ignore The leading image is shown (source set and not failed). */\n protected readonly showImage = computed(() => !!this.image() && !this.imageFailed());\n\n /** @ignore Selectable + selected: the leading slot shows the selected icon. */\n protected readonly showSelectedIcon = computed(\n () => this.selectable() && this.selected() && !!this.selectedIcon(),\n );\n\n /** @ignore The leading image is shown (not overridden by the selected icon). */\n protected readonly showLeadingImage = computed(\n () => !this.showSelectedIcon() && this.showImage(),\n );\n\n /** @ignore The leading font icon is shown (no image / selected icon taking its place). */\n protected readonly showIcon = computed(() => !this.showImage() && !!this.icon());\n\n /** @ignore The leading font icon is shown (not overridden by the selected icon). */\n protected readonly showLeadingIcon = computed(() => !this.showSelectedIcon() && this.showIcon());\n\n /** @ignore The remove action is rendered (never inside a selectable button). */\n protected readonly showRemove = computed(() => this.removable() && !this.selectable());\n\n /** @ignore A visual (icon/image) with no textual label. */\n protected readonly isVisualOnly = computed(\n () => (this.showImage() || this.showIcon()) && !this.hasLabel(),\n );\n\n /** @ignore Resolved accessible name from the explicit label / ariaLabel. */\n protected readonly accessibleName = computed<string | null>(\n () => this.ariaLabel() ?? this.label() ?? null,\n );\n\n /** @ignore Root `aria-label`: explicit name, suppressed when `ariaLabelledBy` wins. */\n protected readonly rootAriaLabel = computed<string | null>(() =>\n this.ariaLabelledBy() ? null : this.accessibleName(),\n );\n\n /** @ignore Leading icon size derived from the chip size. */\n protected readonly iconSize = computed<UiIconSize>(() => (this.size() === 'small' ? 'sm' : 'md'));\n\n /** @ignore Remove icon is compact regardless of chip size. */\n protected readonly removeIconSize: UiIconSize = 'sm';\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const c = ['ui-chip', `_${this.level()}`, `_${this.subLevel()}`];\n if (this.size() !== 'default') c.push(`_${this.size()}`);\n if (!this.rounded()) c.push('_square');\n if (this.showRemove()) c.push('_removable');\n if (this.disabled()) c.push('_disabled');\n if (this.selectable()) c.push('_selectable');\n if (this.selectable() && this.selected()) c.push('_selected');\n return c.join(' ');\n });\n\n /** @ignore */\n protected onImageError(event: Event): void {\n this.imageFailed.set(true);\n this.imageError.emit(event);\n }\n\n /** @ignore */\n protected onRemove(event: Event): void {\n if (this.disabled()) return;\n this.remove.emit(event);\n }\n\n /** @ignore Backspace/Delete on the remove button also removes (Enter/Space are native). */\n protected onRemoveKeydown(event: KeyboardEvent): void {\n if (event.key === 'Backspace' || event.key === 'Delete') {\n event.preventDefault();\n this.onRemove(event);\n }\n }\n\n /** @ignore Toggle the selection (selectable mode). Enter/Space fire this via native click. */\n protected onToggle(event: Event): void {\n if (this.disabled()) return;\n this.selected.set(!this.selected());\n this.chipClick.emit(event);\n }\n}\n","@if (selectable()) {\n <button\n type=\"button\"\n [class]=\"classes()\"\n [disabled]=\"disabled()\"\n [attr.aria-pressed]=\"selected()\"\n [attr.aria-label]=\"rootAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n (click)=\"onToggle($event)\"\n >\n <ng-container [ngTemplateOutlet]=\"inner\" />\n </button>\n} @else {\n <span\n [class]=\"classes()\"\n [attr.role]=\"rootAriaLabel() || ariaLabelledBy() ? (showRemove() ? 'group' : 'img') : null\"\n [attr.aria-label]=\"rootAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n >\n <ng-container [ngTemplateOutlet]=\"inner\" />\n </span>\n}\n\n<ng-template #inner>\n @if (showSelectedIcon()) {\n <ui-icon class=\"ui-chip-icon\" [name]=\"selectedIcon()!\" [size]=\"iconSize()\" />\n } @else if (showLeadingImage()) {\n <img\n class=\"ui-chip-image\"\n [src]=\"image()\"\n [attr.alt]=\"alt() ?? ''\"\n (error)=\"onImageError($event)\"\n />\n } @else if (showLeadingIcon()) {\n <ui-icon class=\"ui-chip-icon\" [name]=\"icon()!\" [size]=\"iconSize()\" />\n }\n\n @if (hasLabel()) {\n <span class=\"ui-chip-label\">{{ label() }}</span>\n }\n\n <!-- Custom / templated content -->\n <ng-content />\n\n @if (showRemove()) {\n <button\n type=\"button\"\n class=\"ui-chip-remove\"\n [disabled]=\"disabled()\"\n [attr.tabindex]=\"removeTabindex()\"\n [attr.aria-label]=\"removeAriaLabel()\"\n (click)=\"onRemove($event)\"\n (keydown)=\"onRemoveKeydown($event)\"\n >\n <ui-icon [name]=\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AAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,WAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,gBAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,iBAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,gBAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;GAAA;GAAA,SAAA;IAAA,UAAA;IAAA,QAAA;IAAA,WAAA;IAAA,YAAA;GAAA;GAAA,UAAA;GAAA,UCtCnB;GA0DA,QAAA,CAAA,8riBAAA;GAAA,cAAA,CAAA;IAAA,MAAA;IAAA,MDxBY;IAAM,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;GAAA,GAAA;IAAA,MAAA;IAAA,MAAE;IAAgB,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;IAAA;GAAA,CAAA;EAAA,CAAA;CAAA;;AAIvB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAM,YAAA,CAAA;EANlB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAS,SACV,CAAC,QAAQ,gBAAgB;GAAC,UAAA;GAAA,QAAA,CAAA,8riBAAA;EAAA,CAAA"}
@@ -1,148 +1,315 @@
1
- import * as i0 from '@angular/core';
2
- import { Directive, input, booleanAttribute, contentChild, viewChild, signal, computed, afterNextRender, Component } from '@angular/core';
3
- import { UiIcon } from '@4sh/ui-kit/base/ui-icon';
4
-
5
- /**
6
- * Slot markers — apply them (attribute or element form) on the content you project
7
- * into a `<ui-empty-state>` to route it to the matching region. They carry no
8
- * behaviour; the component queries their presence to render the surrounding structure.
9
- *
10
- * <ui-empty-state title="Aucun résultat" description="Essayez d'élargir vos filtres.">
11
- * <img uiEmptyStateMedia src="/illustrations/empty.svg" alt="" />
12
- * <div uiEmptyStateActions>
13
- * <ui-button label="Réinitialiser les filtres" level="low" />
14
- * </div>
15
- * </ui-empty-state>
16
- */
17
- /** Visual region (illustration, image, custom SVG…). Overrides the `icon` shortcut. */
18
- class UiEmptyStateMedia {
19
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiEmptyStateMedia, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
20
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: UiEmptyStateMedia, isStandalone: true, selector: "[uiEmptyStateMedia], ui-empty-state-media", ngImport: i0 }); }
21
- }
22
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiEmptyStateMedia, decorators: [{
23
- type: Directive,
24
- args: [{ selector: '[uiEmptyStateMedia], ui-empty-state-media' }]
25
- }] });
26
- /** Actions region (buttons, links…), rendered below the text. */
27
- class UiEmptyStateActions {
28
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiEmptyStateActions, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
29
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: UiEmptyStateActions, isStandalone: true, selector: "[uiEmptyStateActions], ui-empty-state-actions", ngImport: i0 }); }
30
- }
31
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiEmptyStateActions, decorators: [{
32
- type: Directive,
33
- args: [{ selector: '[uiEmptyStateActions], ui-empty-state-actions' }]
34
- }] });
35
- /**
36
- * ui-empty-state — communicates the absence of content (empty list, no search
37
- * result, cleared inbox…) and offers a way forward.
38
- *
39
- * Headless: a centered vertical stack composing an optional visual (illustration
40
- * slot or `icon` shortcut), a title, a description, an optional free body slot and
41
- * an actions slot. Every region renders only when it holds content, so no empty
42
- * wrapper (and no phantom gap) is emitted. All values come from design tokens.
43
- *
44
- * The most common case needs no imports — pass `title`/`description`/`icon` and drop
45
- * actions into the default flow via the `uiEmptyStateActions` marker.
46
- */
47
- class UiEmptyState {
48
- constructor() {
49
- /** Main line — what is empty / why (recommended). */
50
- this.title = input(/* @ts-ignore */
51
- ...(ngDevMode ? [undefined, { debugName: "title" }] : /* istanbul ignore next */ []));
52
- /** Supporting line under the title (guidance, next step). */
53
- this.description = input(/* @ts-ignore */
54
- ...(ngDevMode ? [undefined, { debugName: "description" }] : /* istanbul ignore next */ []));
55
- /** FontAwesome icon name — shortcut for the visual (ignored if a media slot is projected). */
56
- this.icon = input(/* @ts-ignore */
57
- ...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
58
- /** Icon variant, forwarded to `ui-icon`. */
59
- this.iconType = input('solid', /* @ts-ignore */
60
- ...(ngDevMode ? [{ debugName: "iconType" }] : /* istanbul ignore next */ []));
61
- /** Density. */
62
- this.size = input('default', /* @ts-ignore */
63
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
64
- /**
65
- * Whether the visual region is shown. `true` by default; set `false` to keep a
66
- * text-only empty state without removing the projected media / `icon` from markup.
67
- */
68
- this.showMedia = input(true, { ...(ngDevMode ? { debugName: "showMedia" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
69
- /** Accessible name for the region landmark (adds `role="region"`). */
70
- this.ariaLabel = input(/* @ts-ignore */
71
- ...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
72
- /** Id of the element labelling the region landmark (adds `role="region"`). */
73
- this.ariaLabelledBy = input(/* @ts-ignore */
74
- ...(ngDevMode ? [undefined, { debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []));
75
- /** @ignore */
76
- this.mediaSlot = contentChild(UiEmptyStateMedia, /* @ts-ignore */
77
- ...(ngDevMode ? [{ debugName: "mediaSlot" }] : /* istanbul ignore next */ []));
78
- /** @ignore */
79
- this.actionsSlot = contentChild(UiEmptyStateActions, /* @ts-ignore */
80
- ...(ngDevMode ? [{ debugName: "actionsSlot" }] : /* istanbul ignore next */ []));
81
- /** @ignore */
82
- this.bodyWrap = viewChild('bodyWrap', /* @ts-ignore */
83
- ...(ngDevMode ? [{ debugName: "bodyWrap" }] : /* istanbul ignore next */ []));
84
- /** @ignore Default (body) content actually projected (detected after rendering). */
85
- this.hasProjectedBody = signal(false, /* @ts-ignore */
86
- ...(ngDevMode ? [{ debugName: "hasProjectedBody" }] : /* istanbul ignore next */ []));
87
- /** @ignore An icon shortcut is provided. */
88
- this.hasIcon = computed(() => !!this.icon(), /* @ts-ignore */
89
- ...(ngDevMode ? [{ debugName: "hasIcon" }] : /* istanbul ignore next */ []));
90
- /** @ignore A media slot is projected. */
91
- this.hasMedia = computed(() => !!this.mediaSlot(), /* @ts-ignore */
92
- ...(ngDevMode ? [{ debugName: "hasMedia" }] : /* istanbul ignore next */ []));
93
- /** @ignore The visual region is shown and has something to render. */
94
- this.showVisual = computed(() => this.showMedia() && (this.hasMedia() || this.hasIcon()), /* @ts-ignore */
95
- ...(ngDevMode ? [{ debugName: "showVisual" }] : /* istanbul ignore next */ []));
96
- /** @ignore */
97
- this.hasTitle = computed(() => !!this.title(), /* @ts-ignore */
98
- ...(ngDevMode ? [{ debugName: "hasTitle" }] : /* istanbul ignore next */ []));
99
- /** @ignore */
100
- this.hasDescription = computed(() => !!this.description(), /* @ts-ignore */
101
- ...(ngDevMode ? [{ debugName: "hasDescription" }] : /* istanbul ignore next */ []));
102
- /** @ignore Free body content projected between the description and the actions. */
103
- this.hasBody = computed(() => this.hasProjectedBody(), /* @ts-ignore */
104
- ...(ngDevMode ? [{ debugName: "hasBody" }] : /* istanbul ignore next */ []));
105
- /** @ignore The text region (title / description / body) has content. */
106
- this.hasText = computed(() => this.hasTitle() || this.hasDescription() || this.hasBody(), /* @ts-ignore */
107
- ...(ngDevMode ? [{ debugName: "hasText" }] : /* istanbul ignore next */ []));
108
- /** @ignore An actions slot is projected. */
109
- this.hasActions = computed(() => !!this.actionsSlot(), /* @ts-ignore */
110
- ...(ngDevMode ? [{ debugName: "hasActions" }] : /* istanbul ignore next */ []));
111
- /** @ignore Landmark role only when the region carries an accessible name. */
112
- this.role = computed(() => this.ariaLabel() || this.ariaLabelledBy() ? 'region' : null, /* @ts-ignore */
113
- ...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
114
- /** @ignore */
115
- this.classes = computed(() => {
116
- const c = ['ui-empty-state'];
117
- if (this.size() !== 'default')
118
- c.push(`_${this.size()}`);
119
- return c.join(' ');
120
- }, /* @ts-ignore */
121
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
122
- // Detect projected default content (<ng-content>) — SSR-safe (browser only).
123
- afterNextRender(() => {
124
- const el = this.bodyWrap()?.nativeElement;
125
- const has = !!el &&
126
- Array.from(el.childNodes).some((n) => n.nodeType === Node.ELEMENT_NODE ||
127
- (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim()));
128
- this.hasProjectedBody.set(has);
129
- });
130
- }
131
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiEmptyState, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
132
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: UiEmptyState, isStandalone: true, selector: "ui-empty-state", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconType: { classPropertyName: "iconType", publicName: "iconType", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, showMedia: { classPropertyName: "showMedia", publicName: "showMedia", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "mediaSlot", first: true, predicate: UiEmptyStateMedia, descendants: true, isSignal: true }, { propertyName: "actionsSlot", first: true, predicate: UiEmptyStateActions, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "bodyWrap", first: true, predicate: ["bodyWrap"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n [class]=\"classes()\"\n [attr.role]=\"role()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n>\n @if (showVisual()) {\n <div class=\"ui-empty-state-media\">\n @if (hasMedia()) {\n <ng-content select=\"[uiEmptyStateMedia], ui-empty-state-media\" />\n } @else {\n <ui-icon [name]=\"icon()!\" [type]=\"iconType()\" size=\"xl\" />\n }\n </div>\n }\n\n <!-- Always mounted so the default slot can be detected; hidden when the whole\n text region is empty (no title, no description, no projected body). -->\n <div class=\"ui-empty-state-text\" [class._empty]=\"!hasText()\">\n @if (hasTitle()) {\n <p class=\"ui-empty-state-title\">{{ title() }}</p>\n }\n @if (hasDescription()) {\n <p class=\"ui-empty-state-description\">{{ description() }}</p>\n }\n <div class=\"ui-empty-state-body\" #bodyWrap [class._empty]=\"!hasBody()\">\n <ng-content />\n </div>\n </div>\n\n @if (hasActions()) {\n <div class=\"ui-empty-state-actions\">\n <ng-content select=\"[uiEmptyStateActions], ui-empty-state-actions\" />\n </div>\n }\n</div>\n", styles: [":host{display:block}.ui-empty-state{--_media-color: var(--ui-empty-state-media-color, var(--global-text-muted));display:flex;flex-direction:column;align-items:center;text-align:center;font-family:var(--ui-empty-state-font-family, var(--fontfamily-base));--_media-size: var(--ui-empty-state-media-size, var(--units-4xl));gap:var(--ui-empty-state-gap, var(--units-lg))}.ui-empty-state .ui-empty-state-title{font-size:var(--ui-empty-state-title-font-size, var(--size-typography-title-default))}.ui-empty-state .ui-empty-state-description{font-size:var(--ui-empty-state-desc-font-size, var(--size-typography-text-default))}.ui-empty-state-media{display:flex;align-items:center;justify-content:center;max-width:100%;color:var(--_media-color);--ui-icon-size: var(--_media-size)}.ui-empty-state-text{display:flex;flex-direction:column;gap:var(--ui-empty-state-text-gap, var(--units-xs));max-width:var(--ui-empty-state-max-width, 40ch)}.ui-empty-state-text._empty{display:none}.ui-empty-state-title{margin:0;font-family:var(--ui-empty-state-title-font-family, var(--fontfamily-title));font-weight:var(--ui-empty-state-title-weight, var(--weight-bold));line-height:1.2;color:var(--ui-empty-state-title-color, var(--global-text-default))}.ui-empty-state-description{margin:0;font-weight:var(--ui-empty-state-description-weight, var(--weight-regular));line-height:1.5;color:var(--ui-empty-state-description-color, var(--global-text-muted))}.ui-empty-state-body._empty{display:none}.ui-empty-state-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:var(--ui-empty-state-actions-gap, var(--units-sm))}.ui-empty-state._small{--_media-size: var(--ui-empty-state-media-size-small, var(--units-2xl));gap:var(--ui-empty-state-gap-small, var(--units-default))}.ui-empty-state._small .ui-empty-state-title{font-size:var(--ui-empty-state-title-font-size-small, var(--size-typography-title-md))}.ui-empty-state._small .ui-empty-state-description{font-size:var(--ui-empty-state-desc-font-size-small, var(--size-typography-text-md))}\n"], dependencies: [{ kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }] }); }
133
- }
134
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiEmptyState, decorators: [{
135
- type: Component,
136
- args: [{ selector: 'ui-empty-state', imports: [UiIcon], template: "<div\n [class]=\"classes()\"\n [attr.role]=\"role()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n>\n @if (showVisual()) {\n <div class=\"ui-empty-state-media\">\n @if (hasMedia()) {\n <ng-content select=\"[uiEmptyStateMedia], ui-empty-state-media\" />\n } @else {\n <ui-icon [name]=\"icon()!\" [type]=\"iconType()\" size=\"xl\" />\n }\n </div>\n }\n\n <!-- Always mounted so the default slot can be detected; hidden when the whole\n text region is empty (no title, no description, no projected body). -->\n <div class=\"ui-empty-state-text\" [class._empty]=\"!hasText()\">\n @if (hasTitle()) {\n <p class=\"ui-empty-state-title\">{{ title() }}</p>\n }\n @if (hasDescription()) {\n <p class=\"ui-empty-state-description\">{{ description() }}</p>\n }\n <div class=\"ui-empty-state-body\" #bodyWrap [class._empty]=\"!hasBody()\">\n <ng-content />\n </div>\n </div>\n\n @if (hasActions()) {\n <div class=\"ui-empty-state-actions\">\n <ng-content select=\"[uiEmptyStateActions], ui-empty-state-actions\" />\n </div>\n }\n</div>\n", styles: [":host{display:block}.ui-empty-state{--_media-color: var(--ui-empty-state-media-color, var(--global-text-muted));display:flex;flex-direction:column;align-items:center;text-align:center;font-family:var(--ui-empty-state-font-family, var(--fontfamily-base));--_media-size: var(--ui-empty-state-media-size, var(--units-4xl));gap:var(--ui-empty-state-gap, var(--units-lg))}.ui-empty-state .ui-empty-state-title{font-size:var(--ui-empty-state-title-font-size, var(--size-typography-title-default))}.ui-empty-state .ui-empty-state-description{font-size:var(--ui-empty-state-desc-font-size, var(--size-typography-text-default))}.ui-empty-state-media{display:flex;align-items:center;justify-content:center;max-width:100%;color:var(--_media-color);--ui-icon-size: var(--_media-size)}.ui-empty-state-text{display:flex;flex-direction:column;gap:var(--ui-empty-state-text-gap, var(--units-xs));max-width:var(--ui-empty-state-max-width, 40ch)}.ui-empty-state-text._empty{display:none}.ui-empty-state-title{margin:0;font-family:var(--ui-empty-state-title-font-family, var(--fontfamily-title));font-weight:var(--ui-empty-state-title-weight, var(--weight-bold));line-height:1.2;color:var(--ui-empty-state-title-color, var(--global-text-default))}.ui-empty-state-description{margin:0;font-weight:var(--ui-empty-state-description-weight, var(--weight-regular));line-height:1.5;color:var(--ui-empty-state-description-color, var(--global-text-muted))}.ui-empty-state-body._empty{display:none}.ui-empty-state-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:var(--ui-empty-state-actions-gap, var(--units-sm))}.ui-empty-state._small{--_media-size: var(--ui-empty-state-media-size-small, var(--units-2xl));gap:var(--ui-empty-state-gap-small, var(--units-default))}.ui-empty-state._small .ui-empty-state-title{font-size:var(--ui-empty-state-title-font-size-small, var(--size-typography-title-md))}.ui-empty-state._small .ui-empty-state-description{font-size:var(--ui-empty-state-desc-font-size-small, var(--size-typography-text-md))}\n"] }]
137
- }], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconType: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconType", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], showMedia: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMedia", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledBy", required: false }] }], mediaSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => UiEmptyStateMedia), { isSignal: true }] }], actionsSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => UiEmptyStateActions), { isSignal: true }] }], bodyWrap: [{ type: i0.ViewChild, args: ['bodyWrap', { isSignal: true }] }] } });
138
-
139
- /*
140
- * Public API Surface of ui-kit/ui-empty-state
141
- */
142
-
143
- /**
144
- * Generated bundle index. Do not edit.
145
- */
146
-
1
+ import * as i0 from "@angular/core";
2
+ import { Component, Directive, afterNextRender, booleanAttribute, computed, contentChild, input, signal, viewChild } from "@angular/core";
3
+ import { UiIcon } from "@4sh/ui-kit/base/ui-icon";
4
+ var UiEmptyStateMedia = class UiEmptyStateMedia {
5
+ static {
6
+ this.ɵfac = i0.ɵɵngDeclareFactory({
7
+ minVersion: "12.0.0",
8
+ version: "22.3.0",
9
+ ngImport: i0,
10
+ type: UiEmptyStateMedia,
11
+ deps: [],
12
+ target: i0.ɵɵFactoryTarget.Directive
13
+ });
14
+ }
15
+ static {
16
+ this.ɵdir = i0.ɵɵngDeclareDirective({
17
+ minVersion: "14.0.0",
18
+ version: "22.3.0",
19
+ type: UiEmptyStateMedia,
20
+ isStandalone: true,
21
+ selector: "[uiEmptyStateMedia], ui-empty-state-media",
22
+ ngImport: i0
23
+ });
24
+ }
25
+ };
26
+ i0.ɵɵngDeclareClassMetadata({
27
+ minVersion: "12.0.0",
28
+ version: "22.3.0",
29
+ ngImport: i0,
30
+ type: UiEmptyStateMedia,
31
+ decorators: [{
32
+ type: Directive,
33
+ args: [{ selector: "[uiEmptyStateMedia], ui-empty-state-media" }]
34
+ }]
35
+ });
36
+ var UiEmptyStateActions = class UiEmptyStateActions {
37
+ static {
38
+ this.ɵfac = i0.ɵɵngDeclareFactory({
39
+ minVersion: "12.0.0",
40
+ version: "22.3.0",
41
+ ngImport: i0,
42
+ type: UiEmptyStateActions,
43
+ deps: [],
44
+ target: i0.ɵɵFactoryTarget.Directive
45
+ });
46
+ }
47
+ static {
48
+ this.ɵdir = i0.ɵɵngDeclareDirective({
49
+ minVersion: "14.0.0",
50
+ version: "22.3.0",
51
+ type: UiEmptyStateActions,
52
+ isStandalone: true,
53
+ selector: "[uiEmptyStateActions], ui-empty-state-actions",
54
+ ngImport: i0
55
+ });
56
+ }
57
+ };
58
+ i0.ɵɵngDeclareClassMetadata({
59
+ minVersion: "12.0.0",
60
+ version: "22.3.0",
61
+ ngImport: i0,
62
+ type: UiEmptyStateActions,
63
+ decorators: [{
64
+ type: Directive,
65
+ args: [{ selector: "[uiEmptyStateActions], ui-empty-state-actions" }]
66
+ }]
67
+ });
68
+ var UiEmptyState = class UiEmptyState {
69
+ constructor() {
70
+ this.title = input(...ngDevMode ? [void 0, { debugName: "title" }] : /* istanbul ignore next */ []);
71
+ this.description = input(...ngDevMode ? [void 0, { debugName: "description" }] : /* istanbul ignore next */ []);
72
+ this.icon = input(...ngDevMode ? [void 0, { debugName: "icon" }] : /* istanbul ignore next */ []);
73
+ this.iconType = input("solid", ...ngDevMode ? [{ debugName: "iconType" }] : /* istanbul ignore next */ []);
74
+ this.size = input("default", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
75
+ this.showMedia = input(true, {
76
+ ...ngDevMode ? { debugName: "showMedia" } : /* istanbul ignore next */ {},
77
+ transform: booleanAttribute
78
+ });
79
+ this.ariaLabel = input(...ngDevMode ? [void 0, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
80
+ this.ariaLabelledBy = input(...ngDevMode ? [void 0, { debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []);
81
+ this.mediaSlot = contentChild(UiEmptyStateMedia, ...ngDevMode ? [{ debugName: "mediaSlot" }] : /* istanbul ignore next */ []);
82
+ this.actionsSlot = contentChild(UiEmptyStateActions, ...ngDevMode ? [{ debugName: "actionsSlot" }] : /* istanbul ignore next */ []);
83
+ this.bodyWrap = viewChild("bodyWrap", ...ngDevMode ? [{ debugName: "bodyWrap" }] : /* istanbul ignore next */ []);
84
+ this.hasProjectedBody = signal(false, ...ngDevMode ? [{ debugName: "hasProjectedBody" }] : /* istanbul ignore next */ []);
85
+ this.hasIcon = computed(() => !!this.icon(), ...ngDevMode ? [{ debugName: "hasIcon" }] : /* istanbul ignore next */ []);
86
+ this.hasMedia = computed(() => !!this.mediaSlot(), ...ngDevMode ? [{ debugName: "hasMedia" }] : /* istanbul ignore next */ []);
87
+ this.showVisual = computed(() => this.showMedia() && (this.hasMedia() || this.hasIcon()), ...ngDevMode ? [{ debugName: "showVisual" }] : /* istanbul ignore next */ []);
88
+ this.hasTitle = computed(() => !!this.title(), ...ngDevMode ? [{ debugName: "hasTitle" }] : /* istanbul ignore next */ []);
89
+ this.hasDescription = computed(() => !!this.description(), ...ngDevMode ? [{ debugName: "hasDescription" }] : /* istanbul ignore next */ []);
90
+ this.hasBody = computed(() => this.hasProjectedBody(), ...ngDevMode ? [{ debugName: "hasBody" }] : /* istanbul ignore next */ []);
91
+ this.hasText = computed(() => this.hasTitle() || this.hasDescription() || this.hasBody(), ...ngDevMode ? [{ debugName: "hasText" }] : /* istanbul ignore next */ []);
92
+ this.hasActions = computed(() => !!this.actionsSlot(), ...ngDevMode ? [{ debugName: "hasActions" }] : /* istanbul ignore next */ []);
93
+ this.role = computed(() => this.ariaLabel() || this.ariaLabelledBy() ? "region" : null, ...ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []);
94
+ this.classes = computed(() => {
95
+ const c = ["ui-empty-state"];
96
+ if (this.size() !== "default") c.push(`_${this.size()}`);
97
+ return c.join(" ");
98
+ }, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
99
+ afterNextRender(() => {
100
+ const el = this.bodyWrap()?.nativeElement;
101
+ const has = !!el && Array.from(el.childNodes).some((n) => n.nodeType === Node.ELEMENT_NODE || n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim());
102
+ this.hasProjectedBody.set(has);
103
+ });
104
+ }
105
+ static {
106
+ this.ɵfac = i0.ɵɵngDeclareFactory({
107
+ minVersion: "12.0.0",
108
+ version: "22.3.0",
109
+ ngImport: i0,
110
+ type: UiEmptyState,
111
+ deps: [],
112
+ target: i0.ɵɵFactoryTarget.Component
113
+ });
114
+ }
115
+ static {
116
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
117
+ minVersion: "17.0.0",
118
+ version: "22.3.0",
119
+ type: UiEmptyState,
120
+ isStandalone: true,
121
+ selector: "ui-empty-state",
122
+ inputs: {
123
+ title: {
124
+ classPropertyName: "title",
125
+ publicName: "title",
126
+ isSignal: true,
127
+ isRequired: false,
128
+ transformFunction: null
129
+ },
130
+ description: {
131
+ classPropertyName: "description",
132
+ publicName: "description",
133
+ isSignal: true,
134
+ isRequired: false,
135
+ transformFunction: null
136
+ },
137
+ icon: {
138
+ classPropertyName: "icon",
139
+ publicName: "icon",
140
+ isSignal: true,
141
+ isRequired: false,
142
+ transformFunction: null
143
+ },
144
+ iconType: {
145
+ classPropertyName: "iconType",
146
+ publicName: "iconType",
147
+ isSignal: true,
148
+ isRequired: false,
149
+ transformFunction: null
150
+ },
151
+ size: {
152
+ classPropertyName: "size",
153
+ publicName: "size",
154
+ isSignal: true,
155
+ isRequired: false,
156
+ transformFunction: null
157
+ },
158
+ showMedia: {
159
+ classPropertyName: "showMedia",
160
+ publicName: "showMedia",
161
+ isSignal: true,
162
+ isRequired: false,
163
+ transformFunction: null
164
+ },
165
+ ariaLabel: {
166
+ classPropertyName: "ariaLabel",
167
+ publicName: "ariaLabel",
168
+ isSignal: true,
169
+ isRequired: false,
170
+ transformFunction: null
171
+ },
172
+ ariaLabelledBy: {
173
+ classPropertyName: "ariaLabelledBy",
174
+ publicName: "ariaLabelledBy",
175
+ isSignal: true,
176
+ isRequired: false,
177
+ transformFunction: null
178
+ }
179
+ },
180
+ queries: [{
181
+ propertyName: "mediaSlot",
182
+ first: true,
183
+ predicate: UiEmptyStateMedia,
184
+ descendants: true,
185
+ isSignal: true
186
+ }, {
187
+ propertyName: "actionsSlot",
188
+ first: true,
189
+ predicate: UiEmptyStateActions,
190
+ descendants: true,
191
+ isSignal: true
192
+ }],
193
+ viewQueries: [{
194
+ propertyName: "bodyWrap",
195
+ first: true,
196
+ predicate: ["bodyWrap"],
197
+ descendants: true,
198
+ isSignal: true
199
+ }],
200
+ ngImport: i0,
201
+ template: "<div\n [class]=\"classes()\"\n [attr.role]=\"role()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n>\n @if (showVisual()) {\n <div class=\"ui-empty-state-media\">\n @if (hasMedia()) {\n <ng-content select=\"[uiEmptyStateMedia], ui-empty-state-media\" />\n } @else {\n <ui-icon [name]=\"icon()!\" [type]=\"iconType()\" size=\"xl\" />\n }\n </div>\n }\n\n <!-- Always mounted so the default slot can be detected; hidden when the whole\n text region is empty (no title, no description, no projected body). -->\n <div class=\"ui-empty-state-text\" [class._empty]=\"!hasText()\">\n @if (hasTitle()) {\n <p class=\"ui-empty-state-title\">{{ title() }}</p>\n }\n @if (hasDescription()) {\n <p class=\"ui-empty-state-description\">{{ description() }}</p>\n }\n <div class=\"ui-empty-state-body\" #bodyWrap [class._empty]=\"!hasBody()\">\n <ng-content />\n </div>\n </div>\n\n @if (hasActions()) {\n <div class=\"ui-empty-state-actions\">\n <ng-content select=\"[uiEmptyStateActions], ui-empty-state-actions\" />\n </div>\n }\n</div>\n",
202
+ styles: [":host{display:block}.ui-empty-state{--_media-color: var(--ui-empty-state-media-color, var(--global-text-muted));display:flex;flex-direction:column;align-items:center;text-align:center;font-family:var(--ui-empty-state-font-family, var(--fontfamily-base));--_media-size: var(--ui-empty-state-media-size, var(--units-4xl));gap:var(--ui-empty-state-gap, var(--units-lg))}.ui-empty-state .ui-empty-state-title{font-size:var(--ui-empty-state-title-font-size, var(--size-typography-title-default))}.ui-empty-state .ui-empty-state-description{font-size:var(--ui-empty-state-desc-font-size, var(--size-typography-text-default))}.ui-empty-state-media{display:flex;align-items:center;justify-content:center;max-width:100%;color:var(--_media-color);--ui-icon-size: var(--_media-size)}.ui-empty-state-text{display:flex;flex-direction:column;gap:var(--ui-empty-state-text-gap, var(--units-xs));max-width:var(--ui-empty-state-max-width, 40ch)}.ui-empty-state-text._empty{display:none}.ui-empty-state-title{margin:0;font-family:var(--ui-empty-state-title-font-family, var(--fontfamily-title));font-weight:var(--ui-empty-state-title-weight, var(--weight-bold));line-height:1.2;color:var(--ui-empty-state-title-color, var(--global-text-default))}.ui-empty-state-description{margin:0;font-weight:var(--ui-empty-state-description-weight, var(--weight-regular));line-height:1.5;color:var(--ui-empty-state-description-color, var(--global-text-muted))}.ui-empty-state-body._empty{display:none}.ui-empty-state-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:var(--ui-empty-state-actions-gap, var(--units-sm))}.ui-empty-state._small{--_media-size: var(--ui-empty-state-media-size-small, var(--units-2xl));gap:var(--ui-empty-state-gap-small, var(--units-default))}.ui-empty-state._small .ui-empty-state-title{font-size:var(--ui-empty-state-title-font-size-small, var(--size-typography-title-md))}.ui-empty-state._small .ui-empty-state-description{font-size:var(--ui-empty-state-desc-font-size-small, var(--size-typography-text-md))}\n"],
203
+ dependencies: [{
204
+ kind: "component",
205
+ type: UiIcon,
206
+ selector: "ui-icon",
207
+ inputs: [
208
+ "name",
209
+ "size",
210
+ "type",
211
+ "family",
212
+ "decorative",
213
+ "ariaLabel"
214
+ ]
215
+ }]
216
+ });
217
+ }
218
+ };
219
+ i0.ɵɵngDeclareClassMetadata({
220
+ minVersion: "12.0.0",
221
+ version: "22.3.0",
222
+ ngImport: i0,
223
+ type: UiEmptyState,
224
+ decorators: [{
225
+ type: Component,
226
+ args: [{
227
+ selector: "ui-empty-state",
228
+ imports: [UiIcon],
229
+ template: "<div\n [class]=\"classes()\"\n [attr.role]=\"role()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n>\n @if (showVisual()) {\n <div class=\"ui-empty-state-media\">\n @if (hasMedia()) {\n <ng-content select=\"[uiEmptyStateMedia], ui-empty-state-media\" />\n } @else {\n <ui-icon [name]=\"icon()!\" [type]=\"iconType()\" size=\"xl\" />\n }\n </div>\n }\n\n <!-- Always mounted so the default slot can be detected; hidden when the whole\n text region is empty (no title, no description, no projected body). -->\n <div class=\"ui-empty-state-text\" [class._empty]=\"!hasText()\">\n @if (hasTitle()) {\n <p class=\"ui-empty-state-title\">{{ title() }}</p>\n }\n @if (hasDescription()) {\n <p class=\"ui-empty-state-description\">{{ description() }}</p>\n }\n <div class=\"ui-empty-state-body\" #bodyWrap [class._empty]=\"!hasBody()\">\n <ng-content />\n </div>\n </div>\n\n @if (hasActions()) {\n <div class=\"ui-empty-state-actions\">\n <ng-content select=\"[uiEmptyStateActions], ui-empty-state-actions\" />\n </div>\n }\n</div>\n",
230
+ styles: [":host{display:block}.ui-empty-state{--_media-color: var(--ui-empty-state-media-color, var(--global-text-muted));display:flex;flex-direction:column;align-items:center;text-align:center;font-family:var(--ui-empty-state-font-family, var(--fontfamily-base));--_media-size: var(--ui-empty-state-media-size, var(--units-4xl));gap:var(--ui-empty-state-gap, var(--units-lg))}.ui-empty-state .ui-empty-state-title{font-size:var(--ui-empty-state-title-font-size, var(--size-typography-title-default))}.ui-empty-state .ui-empty-state-description{font-size:var(--ui-empty-state-desc-font-size, var(--size-typography-text-default))}.ui-empty-state-media{display:flex;align-items:center;justify-content:center;max-width:100%;color:var(--_media-color);--ui-icon-size: var(--_media-size)}.ui-empty-state-text{display:flex;flex-direction:column;gap:var(--ui-empty-state-text-gap, var(--units-xs));max-width:var(--ui-empty-state-max-width, 40ch)}.ui-empty-state-text._empty{display:none}.ui-empty-state-title{margin:0;font-family:var(--ui-empty-state-title-font-family, var(--fontfamily-title));font-weight:var(--ui-empty-state-title-weight, var(--weight-bold));line-height:1.2;color:var(--ui-empty-state-title-color, var(--global-text-default))}.ui-empty-state-description{margin:0;font-weight:var(--ui-empty-state-description-weight, var(--weight-regular));line-height:1.5;color:var(--ui-empty-state-description-color, var(--global-text-muted))}.ui-empty-state-body._empty{display:none}.ui-empty-state-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:var(--ui-empty-state-actions-gap, var(--units-sm))}.ui-empty-state._small{--_media-size: var(--ui-empty-state-media-size-small, var(--units-2xl));gap:var(--ui-empty-state-gap-small, var(--units-default))}.ui-empty-state._small .ui-empty-state-title{font-size:var(--ui-empty-state-title-font-size-small, var(--size-typography-title-md))}.ui-empty-state._small .ui-empty-state-description{font-size:var(--ui-empty-state-desc-font-size-small, var(--size-typography-text-md))}\n"]
231
+ }]
232
+ }],
233
+ ctorParameters: () => [],
234
+ propDecorators: {
235
+ title: [{
236
+ type: i0.Input,
237
+ args: [{
238
+ isSignal: true,
239
+ alias: "title",
240
+ required: false
241
+ }]
242
+ }],
243
+ description: [{
244
+ type: i0.Input,
245
+ args: [{
246
+ isSignal: true,
247
+ alias: "description",
248
+ required: false
249
+ }]
250
+ }],
251
+ icon: [{
252
+ type: i0.Input,
253
+ args: [{
254
+ isSignal: true,
255
+ alias: "icon",
256
+ required: false
257
+ }]
258
+ }],
259
+ iconType: [{
260
+ type: i0.Input,
261
+ args: [{
262
+ isSignal: true,
263
+ alias: "iconType",
264
+ required: false
265
+ }]
266
+ }],
267
+ size: [{
268
+ type: i0.Input,
269
+ args: [{
270
+ isSignal: true,
271
+ alias: "size",
272
+ required: false
273
+ }]
274
+ }],
275
+ showMedia: [{
276
+ type: i0.Input,
277
+ args: [{
278
+ isSignal: true,
279
+ alias: "showMedia",
280
+ required: false
281
+ }]
282
+ }],
283
+ ariaLabel: [{
284
+ type: i0.Input,
285
+ args: [{
286
+ isSignal: true,
287
+ alias: "ariaLabel",
288
+ required: false
289
+ }]
290
+ }],
291
+ ariaLabelledBy: [{
292
+ type: i0.Input,
293
+ args: [{
294
+ isSignal: true,
295
+ alias: "ariaLabelledBy",
296
+ required: false
297
+ }]
298
+ }],
299
+ mediaSlot: [{
300
+ type: i0.ContentChild,
301
+ args: [i0.forwardRef(() => UiEmptyStateMedia), { isSignal: true }]
302
+ }],
303
+ actionsSlot: [{
304
+ type: i0.ContentChild,
305
+ args: [i0.forwardRef(() => UiEmptyStateActions), { isSignal: true }]
306
+ }],
307
+ bodyWrap: [{
308
+ type: i0.ViewChild,
309
+ args: ["bodyWrap", { isSignal: true }]
310
+ }]
311
+ }
312
+ });
147
313
  export { UiEmptyState, UiEmptyStateActions, UiEmptyStateMedia };
148
- //# sourceMappingURL=4sh-ui-kit-informative-ui-empty-state.mjs.map
314
+
315
+ //# sourceMappingURL=4sh-ui-kit-informative-ui-empty-state.mjs.map