@4sh/ui-kit 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +7 -0
  3. package/README.md +229 -0
  4. package/fesm2022/4sh-ui-kit-forms.mjs +501 -0
  5. package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -0
  6. package/fesm2022/4sh-ui-kit-motion.mjs +155 -0
  7. package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -0
  8. package/fesm2022/4sh-ui-kit-overlay.mjs +61 -0
  9. package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -0
  10. package/fesm2022/4sh-ui-kit-theming.mjs +120 -0
  11. package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -0
  12. package/fesm2022/4sh-ui-kit-types.mjs +12 -0
  13. package/fesm2022/4sh-ui-kit-types.mjs.map +1 -0
  14. package/fesm2022/4sh-ui-kit-ui-accordion.mjs +244 -0
  15. package/fesm2022/4sh-ui-kit-ui-accordion.mjs.map +1 -0
  16. package/fesm2022/4sh-ui-kit-ui-alert.mjs +160 -0
  17. package/fesm2022/4sh-ui-kit-ui-alert.mjs.map +1 -0
  18. package/fesm2022/4sh-ui-kit-ui-autocomplete.mjs +926 -0
  19. package/fesm2022/4sh-ui-kit-ui-autocomplete.mjs.map +1 -0
  20. package/fesm2022/4sh-ui-kit-ui-avatar-group.mjs +34 -0
  21. package/fesm2022/4sh-ui-kit-ui-avatar-group.mjs.map +1 -0
  22. package/fesm2022/4sh-ui-kit-ui-avatar.mjs +122 -0
  23. package/fesm2022/4sh-ui-kit-ui-avatar.mjs.map +1 -0
  24. package/fesm2022/4sh-ui-kit-ui-badge.mjs +95 -0
  25. package/fesm2022/4sh-ui-kit-ui-badge.mjs.map +1 -0
  26. package/fesm2022/4sh-ui-kit-ui-breadcrumb.mjs +190 -0
  27. package/fesm2022/4sh-ui-kit-ui-breadcrumb.mjs.map +1 -0
  28. package/fesm2022/4sh-ui-kit-ui-button-split.mjs +151 -0
  29. package/fesm2022/4sh-ui-kit-ui-button-split.mjs.map +1 -0
  30. package/fesm2022/4sh-ui-kit-ui-button.mjs +222 -0
  31. package/fesm2022/4sh-ui-kit-ui-button.mjs.map +1 -0
  32. package/fesm2022/4sh-ui-kit-ui-card.mjs +164 -0
  33. package/fesm2022/4sh-ui-kit-ui-card.mjs.map +1 -0
  34. package/fesm2022/4sh-ui-kit-ui-checkbox.mjs +118 -0
  35. package/fesm2022/4sh-ui-kit-ui-checkbox.mjs.map +1 -0
  36. package/fesm2022/4sh-ui-kit-ui-chip.mjs +205 -0
  37. package/fesm2022/4sh-ui-kit-ui-chip.mjs.map +1 -0
  38. package/fesm2022/4sh-ui-kit-ui-context-menu.mjs +219 -0
  39. package/fesm2022/4sh-ui-kit-ui-context-menu.mjs.map +1 -0
  40. package/fesm2022/4sh-ui-kit-ui-datepicker.mjs +1508 -0
  41. package/fesm2022/4sh-ui-kit-ui-datepicker.mjs.map +1 -0
  42. package/fesm2022/4sh-ui-kit-ui-drawer.mjs +300 -0
  43. package/fesm2022/4sh-ui-kit-ui-drawer.mjs.map +1 -0
  44. package/fesm2022/4sh-ui-kit-ui-empty-state.mjs +148 -0
  45. package/fesm2022/4sh-ui-kit-ui-empty-state.mjs.map +1 -0
  46. package/fesm2022/4sh-ui-kit-ui-field.mjs +102 -0
  47. package/fesm2022/4sh-ui-kit-ui-field.mjs.map +1 -0
  48. package/fesm2022/4sh-ui-kit-ui-file-upload.mjs +568 -0
  49. package/fesm2022/4sh-ui-kit-ui-file-upload.mjs.map +1 -0
  50. package/fesm2022/4sh-ui-kit-ui-helper.mjs +85 -0
  51. package/fesm2022/4sh-ui-kit-ui-helper.mjs.map +1 -0
  52. package/fesm2022/4sh-ui-kit-ui-icon.mjs +98 -0
  53. package/fesm2022/4sh-ui-kit-ui-icon.mjs.map +1 -0
  54. package/fesm2022/4sh-ui-kit-ui-image.mjs +201 -0
  55. package/fesm2022/4sh-ui-kit-ui-image.mjs.map +1 -0
  56. package/fesm2022/4sh-ui-kit-ui-input-group.mjs +119 -0
  57. package/fesm2022/4sh-ui-kit-ui-input-group.mjs.map +1 -0
  58. package/fesm2022/4sh-ui-kit-ui-input-mask.mjs +125 -0
  59. package/fesm2022/4sh-ui-kit-ui-input-mask.mjs.map +1 -0
  60. package/fesm2022/4sh-ui-kit-ui-input-number.mjs +234 -0
  61. package/fesm2022/4sh-ui-kit-ui-input-number.mjs.map +1 -0
  62. package/fesm2022/4sh-ui-kit-ui-input-otp.mjs +288 -0
  63. package/fesm2022/4sh-ui-kit-ui-input-otp.mjs.map +1 -0
  64. package/fesm2022/4sh-ui-kit-ui-input-tags.mjs +679 -0
  65. package/fesm2022/4sh-ui-kit-ui-input-tags.mjs.map +1 -0
  66. package/fesm2022/4sh-ui-kit-ui-input.mjs +121 -0
  67. package/fesm2022/4sh-ui-kit-ui-input.mjs.map +1 -0
  68. package/fesm2022/4sh-ui-kit-ui-label.mjs +61 -0
  69. package/fesm2022/4sh-ui-kit-ui-label.mjs.map +1 -0
  70. package/fesm2022/4sh-ui-kit-ui-link.mjs +147 -0
  71. package/fesm2022/4sh-ui-kit-ui-link.mjs.map +1 -0
  72. package/fesm2022/4sh-ui-kit-ui-menu.mjs +484 -0
  73. package/fesm2022/4sh-ui-kit-ui-menu.mjs.map +1 -0
  74. package/fesm2022/4sh-ui-kit-ui-modal.mjs +555 -0
  75. package/fesm2022/4sh-ui-kit-ui-modal.mjs.map +1 -0
  76. package/fesm2022/4sh-ui-kit-ui-nudger.mjs +168 -0
  77. package/fesm2022/4sh-ui-kit-ui-nudger.mjs.map +1 -0
  78. package/fesm2022/4sh-ui-kit-ui-paginator.mjs +245 -0
  79. package/fesm2022/4sh-ui-kit-ui-paginator.mjs.map +1 -0
  80. package/fesm2022/4sh-ui-kit-ui-popover.mjs +296 -0
  81. package/fesm2022/4sh-ui-kit-ui-popover.mjs.map +1 -0
  82. package/fesm2022/4sh-ui-kit-ui-progress-bar.mjs +124 -0
  83. package/fesm2022/4sh-ui-kit-ui-progress-bar.mjs.map +1 -0
  84. package/fesm2022/4sh-ui-kit-ui-radio.mjs +92 -0
  85. package/fesm2022/4sh-ui-kit-ui-radio.mjs.map +1 -0
  86. package/fesm2022/4sh-ui-kit-ui-rating.mjs +185 -0
  87. package/fesm2022/4sh-ui-kit-ui-rating.mjs.map +1 -0
  88. package/fesm2022/4sh-ui-kit-ui-read-only.mjs +146 -0
  89. package/fesm2022/4sh-ui-kit-ui-read-only.mjs.map +1 -0
  90. package/fesm2022/4sh-ui-kit-ui-segment-control.mjs +386 -0
  91. package/fesm2022/4sh-ui-kit-ui-segment-control.mjs.map +1 -0
  92. package/fesm2022/4sh-ui-kit-ui-select.mjs +868 -0
  93. package/fesm2022/4sh-ui-kit-ui-select.mjs.map +1 -0
  94. package/fesm2022/4sh-ui-kit-ui-separator.mjs +77 -0
  95. package/fesm2022/4sh-ui-kit-ui-separator.mjs.map +1 -0
  96. package/fesm2022/4sh-ui-kit-ui-sidebar.mjs +577 -0
  97. package/fesm2022/4sh-ui-kit-ui-sidebar.mjs.map +1 -0
  98. package/fesm2022/4sh-ui-kit-ui-skeleton.mjs +81 -0
  99. package/fesm2022/4sh-ui-kit-ui-skeleton.mjs.map +1 -0
  100. package/fesm2022/4sh-ui-kit-ui-slider.mjs +340 -0
  101. package/fesm2022/4sh-ui-kit-ui-slider.mjs.map +1 -0
  102. package/fesm2022/4sh-ui-kit-ui-spinner.mjs +132 -0
  103. package/fesm2022/4sh-ui-kit-ui-spinner.mjs.map +1 -0
  104. package/fesm2022/4sh-ui-kit-ui-stepper.mjs +389 -0
  105. package/fesm2022/4sh-ui-kit-ui-stepper.mjs.map +1 -0
  106. package/fesm2022/4sh-ui-kit-ui-table.mjs +1406 -0
  107. package/fesm2022/4sh-ui-kit-ui-table.mjs.map +1 -0
  108. package/fesm2022/4sh-ui-kit-ui-tabs.mjs +503 -0
  109. package/fesm2022/4sh-ui-kit-ui-tabs.mjs.map +1 -0
  110. package/fesm2022/4sh-ui-kit-ui-tag.mjs +84 -0
  111. package/fesm2022/4sh-ui-kit-ui-tag.mjs.map +1 -0
  112. package/fesm2022/4sh-ui-kit-ui-textarea.mjs +119 -0
  113. package/fesm2022/4sh-ui-kit-ui-textarea.mjs.map +1 -0
  114. package/fesm2022/4sh-ui-kit-ui-toast.mjs +424 -0
  115. package/fesm2022/4sh-ui-kit-ui-toast.mjs.map +1 -0
  116. package/fesm2022/4sh-ui-kit-ui-toggle.mjs +120 -0
  117. package/fesm2022/4sh-ui-kit-ui-toggle.mjs.map +1 -0
  118. package/fesm2022/4sh-ui-kit-ui-tooltip.mjs +445 -0
  119. package/fesm2022/4sh-ui-kit-ui-tooltip.mjs.map +1 -0
  120. package/fesm2022/4sh-ui-kit.mjs +16 -0
  121. package/fesm2022/4sh-ui-kit.mjs.map +1 -0
  122. package/package.json +287 -0
  123. package/styles/base/_base.scss +19 -0
  124. package/styles/base/_motion.scss +144 -0
  125. package/styles/base/_typography.scss +99 -0
  126. package/styles/generated/_tokens-breakpoint.scss +8 -0
  127. package/styles/generated/_tokens-metrics.scss +37 -0
  128. package/styles/generated/_tokens-primitives.scss +284 -0
  129. package/styles/generated/_tokens-responsive.scss +99 -0
  130. package/styles/generated/_tokens-semantics.scss +1274 -0
  131. package/styles/generated/_tokens-styles.scss +35 -0
  132. package/styles/generated/_tokens-transitions.scss +11 -0
  133. package/styles/generated/_tokens-typography.scss +14 -0
  134. package/styles/generated/_tokens.scss +10 -0
  135. package/styles/index.scss +25 -0
  136. package/styles/settings/_ui-config.scss +67 -0
  137. package/styles/utils/_functions.scss +67 -0
  138. package/styles/utils/_helpers.scss +129 -0
  139. package/styles/utils/_mixins.scss +186 -0
  140. package/styles/utils/_motion.scss +47 -0
  141. package/styles/utils/_overlay.scss +26 -0
  142. package/styles/utils.scss +15 -0
  143. package/styles.css +1 -0
  144. package/types/4sh-ui-kit-forms.d.ts +259 -0
  145. package/types/4sh-ui-kit-motion.d.ts +111 -0
  146. package/types/4sh-ui-kit-overlay.d.ts +31 -0
  147. package/types/4sh-ui-kit-theming.d.ts +54 -0
  148. package/types/4sh-ui-kit-types.d.ts +13 -0
  149. package/types/4sh-ui-kit-ui-accordion.d.ts +140 -0
  150. package/types/4sh-ui-kit-ui-alert.d.ts +89 -0
  151. package/types/4sh-ui-kit-ui-autocomplete.d.ts +411 -0
  152. package/types/4sh-ui-kit-ui-avatar-group.d.ts +17 -0
  153. package/types/4sh-ui-kit-ui-avatar.d.ts +55 -0
  154. package/types/4sh-ui-kit-ui-badge.d.ts +38 -0
  155. package/types/4sh-ui-kit-ui-breadcrumb.d.ts +131 -0
  156. package/types/4sh-ui-kit-ui-button-split.d.ts +102 -0
  157. package/types/4sh-ui-kit-ui-button.d.ts +91 -0
  158. package/types/4sh-ui-kit-ui-card.d.ts +102 -0
  159. package/types/4sh-ui-kit-ui-checkbox.d.ts +54 -0
  160. package/types/4sh-ui-kit-ui-chip.d.ts +114 -0
  161. package/types/4sh-ui-kit-ui-context-menu.d.ts +105 -0
  162. package/types/4sh-ui-kit-ui-datepicker.d.ts +539 -0
  163. package/types/4sh-ui-kit-ui-drawer.d.ts +147 -0
  164. package/types/4sh-ui-kit-ui-empty-state.d.ts +93 -0
  165. package/types/4sh-ui-kit-ui-field.d.ts +53 -0
  166. package/types/4sh-ui-kit-ui-file-upload.d.ts +268 -0
  167. package/types/4sh-ui-kit-ui-helper.d.ts +46 -0
  168. package/types/4sh-ui-kit-ui-icon.d.ts +69 -0
  169. package/types/4sh-ui-kit-ui-image.d.ts +88 -0
  170. package/types/4sh-ui-kit-ui-input-group.d.ts +54 -0
  171. package/types/4sh-ui-kit-ui-input-mask.d.ts +63 -0
  172. package/types/4sh-ui-kit-ui-input-number.d.ts +96 -0
  173. package/types/4sh-ui-kit-ui-input-otp.d.ts +130 -0
  174. package/types/4sh-ui-kit-ui-input-tags.d.ts +350 -0
  175. package/types/4sh-ui-kit-ui-input.d.ts +78 -0
  176. package/types/4sh-ui-kit-ui-label.d.ts +36 -0
  177. package/types/4sh-ui-kit-ui-link.d.ts +72 -0
  178. package/types/4sh-ui-kit-ui-menu.d.ts +235 -0
  179. package/types/4sh-ui-kit-ui-modal.d.ts +241 -0
  180. package/types/4sh-ui-kit-ui-nudger.d.ts +79 -0
  181. package/types/4sh-ui-kit-ui-paginator.d.ts +150 -0
  182. package/types/4sh-ui-kit-ui-popover.d.ts +125 -0
  183. package/types/4sh-ui-kit-ui-progress-bar.d.ts +82 -0
  184. package/types/4sh-ui-kit-ui-radio.d.ts +44 -0
  185. package/types/4sh-ui-kit-ui-rating.d.ts +90 -0
  186. package/types/4sh-ui-kit-ui-read-only.d.ts +70 -0
  187. package/types/4sh-ui-kit-ui-segment-control.d.ts +184 -0
  188. package/types/4sh-ui-kit-ui-select.d.ts +392 -0
  189. package/types/4sh-ui-kit-ui-separator.d.ts +43 -0
  190. package/types/4sh-ui-kit-ui-sidebar.d.ts +358 -0
  191. package/types/4sh-ui-kit-ui-skeleton.d.ts +52 -0
  192. package/types/4sh-ui-kit-ui-slider.d.ts +127 -0
  193. package/types/4sh-ui-kit-ui-spinner.d.ts +67 -0
  194. package/types/4sh-ui-kit-ui-stepper.d.ts +220 -0
  195. package/types/4sh-ui-kit-ui-table.d.ts +570 -0
  196. package/types/4sh-ui-kit-ui-tabs.d.ts +225 -0
  197. package/types/4sh-ui-kit-ui-tag.d.ts +46 -0
  198. package/types/4sh-ui-kit-ui-textarea.d.ts +61 -0
  199. package/types/4sh-ui-kit-ui-toast.d.ts +247 -0
  200. package/types/4sh-ui-kit-ui-toggle.d.ts +67 -0
  201. package/types/4sh-ui-kit-ui-tooltip.d.ts +167 -0
  202. package/types/4sh-ui-kit.d.ts +4 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"4sh-ui-kit-ui-file-upload.mjs","sources":["../../../projects/ui-kit/ui-file-upload/src/lib/ui-file-upload.model.ts","../../../projects/ui-kit/ui-file-upload/src/lib/ui-file-upload-list.ts","../../../projects/ui-kit/ui-file-upload/src/lib/ui-file-upload-list.html","../../../projects/ui-kit/ui-file-upload/src/lib/ui-file-upload.ts","../../../projects/ui-kit/ui-file-upload/src/lib/ui-file-upload.html","../../../projects/ui-kit/ui-file-upload/src/public-api.ts","../../../projects/ui-kit/ui-file-upload/src/4sh-ui-kit-ui-file-upload.ts"],"sourcesContent":["// =====================================================================\n// Shared model for ui-file-upload and its file-row (ui-file-upload-list).\n// =====================================================================\n\n/** Lifecycle of a selected file. */\nexport type UiUploadStatus = 'pending' | 'uploading' | 'completed' | 'error';\n\n/** A file selected in the uploader, plus its upload/validation state. */\nexport interface UiUploadFile {\n /** Stable id for tracking (kept across re-renders). */\n readonly id: string;\n /** The underlying browser File. */\n readonly file: File;\n /** File name (from the File, exposed for template convenience). */\n readonly name: string;\n /** Size in bytes. */\n readonly size: number;\n /** MIME type reported by the browser. */\n readonly type: string;\n /** Current lifecycle state. */\n status: UiUploadStatus;\n /** Upload progress, 0–100 (meaningful while `status === 'uploading'`). */\n progress: number;\n /** Object URL for image previews — MUST be revoked when the file is removed. */\n objectUrl?: string;\n /** Validation or upload error message, when `status === 'error'`. */\n error?: string;\n}\n\n/** Payload for the custom upload handler (customUpload = true). */\nexport interface UiUploadHandlerEvent {\n /** Files awaiting upload (status `pending`). */\n files: UiUploadFile[];\n /** Marks a file as uploaded (sets status `completed`, progress 100). */\n markUploaded: (file: UiUploadFile) => void;\n /** Marks a file as failed with an optional message. */\n markError: (file: UiUploadFile, message?: string) => void;\n /** Updates a file's progress (0–100). */\n setProgress: (file: UiUploadFile, progress: number) => void;\n}\n\n/** Emitted when files finish uploading (built-in uploader). */\nexport interface UiUploadEvent {\n files: UiUploadFile[];\n /** Raw XHR of the last request (built-in uploader only). */\n xhr?: XMLHttpRequest;\n}\n\n/** Emitted on a validation or upload error. */\nexport interface UiUploadErrorEvent {\n file: UiUploadFile;\n /** 'type' | 'size' | 'limit' | 'upload'. */\n reason: 'type' | 'size' | 'limit' | 'upload';\n message: string;\n}\n\n/** Human-readable file size (e.g. \"2.5 MB\"). Base-1024. */\nexport function formatFileSize(bytes: number): string {\n if (!bytes || bytes < 0) return '0 B';\n const k = 1024;\n const units = ['B', 'KB', 'MB', 'GB', 'TB'];\n const i = Math.min(Math.floor(Math.log(bytes) / Math.log(k)), units.length - 1);\n const value = bytes / Math.pow(k, i);\n const rounded = Math.round(value * 10) / 10;\n return `${rounded} ${units[i]}`;\n}\n\n/**\n * Whether a File matches an `accept` string (e.g. \"image/*,.pdf\").\n * Empty/absent accept means everything is allowed.\n */\nexport function isFileTypeAccepted(file: File, accept: string | undefined): boolean {\n if (!accept) return true;\n const patterns = accept\n .split(',')\n .map((t) => t.trim().toLowerCase())\n .filter(Boolean);\n if (!patterns.length) return true;\n\n const name = file.name.toLowerCase();\n const mime = (file.type || '').toLowerCase();\n\n return patterns.some((pattern) => {\n if (pattern.startsWith('.')) return name.endsWith(pattern); // extension\n if (pattern.endsWith('/*')) return mime.startsWith(pattern.slice(0, -1)); // \"image/\"\n return mime === pattern; // exact mime\n });\n}\n\n/** Whether a File is a previewable image. */\nexport function isImageFile(file: File): boolean {\n return /^image\\//.test(file.type);\n}\n","import { booleanAttribute, Component, computed, input, output } from '@angular/core';\nimport { UiIcon, UiIconSize } from '@4sh/ui-kit/ui-icon';\nimport { UiSpinner } from '@4sh/ui-kit/ui-spinner';\nimport { formatFileSize, UiUploadFile } from './ui-file-upload.model';\nimport { formatLabel } from '@4sh/ui-kit/forms';\n\nexport type UiFileUploadListSize = 'default' | 'small';\n\n/**\n * ui-file-upload-list — a single file row (the repeatable unit of an upload list).\n *\n * Presentational: shows a leading thumbnail (for images) or file icon, the file\n * name + size/status, and a remove button. While the file is uploading it swaps\n * the leading icon for a `ui-spinner` and reveals a slim progress bar.\n *\n * Named to mirror the Figma component; the uploader stacks one row per file.\n */\n@Component({\n selector: 'ui-file-upload-list',\n imports: [UiIcon, UiSpinner],\n templateUrl: './ui-file-upload-list.html',\n styleUrl: './ui-file-upload-list.scss',\n})\nexport class UiFileUploadList {\n /** The file to display (name/size/status/progress/preview). */\n file = input.required<UiUploadFile>();\n size = input<UiFileUploadListSize>('default');\n /** FontAwesome icon for non-image files. */\n icon = input<string>('file');\n /** Whether the remove button is shown. */\n removable = input(true, { transform: booleanAttribute });\n /** Accessible name of the remove button (raw text — the file name is appended in the template). */\n removeAriaLabel = input<string>('Supprimer le fichier');\n /** Fallback error text when the file carries no message. */\n failedLabel = input<string>('Échec');\n /** Accessible name of the upload spinner — `{0}` is the file name. */\n uploadingLabel = input<string>('Téléversement de {0}');\n /** Accessible name of the progress bar — `{0}` is the file name. */\n progressLabel = input<string>('Progression du téléversement de {0}');\n\n /** Emitted when the remove button is activated. */\n remove = output<UiUploadFile>();\n\n /** @ignore Formatted size (e.g. \"2.5 MB\"). */\n protected readonly sizeLabel = computed(() => formatFileSize(this.file().size));\n\n /** @ignore Accessible name of the upload spinner (`{0}` filled with the file name). */\n protected readonly uploadingAriaLabel = computed(() => formatLabel(this.uploadingLabel(), this.file().name));\n\n /** @ignore Accessible name of the progress bar (`{0}` filled with the file name). */\n protected readonly progressAriaLabel = computed(() => formatLabel(this.progressLabel(), this.file().name));\n\n /** @ignore Uploading in progress → show the spinner + progress bar. */\n protected readonly isUploading = computed(() => this.file().status === 'uploading');\n\n /** @ignore Error state → surface the message + error styling. */\n protected readonly isError = computed(() => this.file().status === 'error');\n\n /** @ignore Image with a usable preview URL → render a thumbnail. */\n protected readonly thumbnail = computed(() => this.file().objectUrl ?? null);\n\n /** @ignore Secondary line: error message, else size (+ status hint). */\n protected readonly infoLabel = computed(() => {\n const f = this.file();\n if (f.status === 'error') return f.error ?? this.failedLabel();\n if (f.status === 'uploading') return `${this.sizeLabel()} · ${Math.round(f.progress)} %`;\n return this.sizeLabel();\n });\n\n /** @ignore */\n protected readonly iconSize = computed<UiIconSize>(() => (this.size() === 'small' ? 'sm' : 'md'));\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const c = ['ui-file-upload-list'];\n if (this.size() !== 'default') c.push(`_${this.size()}`);\n if (this.isError()) c.push('_error');\n if (this.thumbnail()) c.push('_has-thumb');\n return c.join(' ');\n });\n\n /** @ignore */\n protected onRemove(): void {\n this.remove.emit(this.file());\n }\n}\n","<div [class]=\"classes()\">\n <div class=\"ui-file-upload-list-file\">\n <span class=\"ui-file-upload-list-media\">\n @if (isUploading()) {\n <ui-spinner size=\"small\" [ariaLabel]=\"uploadingAriaLabel()\" />\n } @else if (thumbnail(); as src) {\n <img class=\"ui-file-upload-list-thumb\" [src]=\"src\" alt=\"\" />\n } @else {\n <ui-icon [name]=\"isError() ? 'triangle-exclamation' : icon()\" [size]=\"iconSize()\" />\n }\n </span>\n\n <span class=\"ui-file-upload-list-infos\">\n <span class=\"ui-file-upload-list-name\" [title]=\"file().name\">{{ file().name }}</span>\n <span class=\"ui-file-upload-list-meta\">{{ infoLabel() }}</span>\n </span>\n </div>\n\n @if (removable()) {\n <button\n type=\"button\"\n class=\"ui-file-upload-list-remove\"\n [attr.aria-label]=\"removeAriaLabel() + ' : ' + file().name\"\n (click)=\"onRemove()\"\n >\n <ui-icon name=\"trash\" [size]=\"iconSize()\" />\n </button>\n }\n\n @if (isUploading()) {\n <div\n class=\"ui-file-upload-list-progress\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"file().progress\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-label]=\"progressAriaLabel()\"\n >\n <span class=\"ui-file-upload-list-progress-bar\" [style.width.%]=\"file().progress\"></span>\n </div>\n }\n</div>\n","import {\n booleanAttribute,\n Component,\n computed,\n DestroyRef,\n effect,\n ElementRef,\n inject,\n input,\n isDevMode,\n numberAttribute,\n output,\n signal,\n TemplateRef,\n viewChild,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { UiIcon } from '@4sh/ui-kit/ui-icon';\nimport { UiButton } from '@4sh/ui-kit/ui-button';\nimport { UiLink } from '@4sh/ui-kit/ui-link';\nimport { UiFileUploadList } from './ui-file-upload-list';\nimport { formatLabel } from '@4sh/ui-kit/forms';\nimport {\n isFileTypeAccepted,\n isImageFile,\n UiUploadErrorEvent,\n UiUploadEvent,\n UiUploadFile,\n UiUploadHandlerEvent,\n} from './ui-file-upload.model';\n\nexport type UiFileUploadMode = 'field' | 'drag';\nexport type UiFileUploadSize = 'default' | 'small';\n\nlet nextUploadId = 0;\nlet nextInstanceId = 0;\n\n/**\n * ui-file-upload — headless file uploader (field + drag-and-drop).\n *\n * A native `<input type=\"file\">` (visually hidden) drives selection, so the OS\n * picker, keyboard and screen readers work natively; the whole component is also\n * a drop target. Selection is validated client-side (type / size / count) and\n * files can be uploaded automatically (`auto`), on demand, or via a custom\n * handler (`customUpload`). Progress is tracked with `XMLHttpRequest` so no\n * global HTTP provider is required.\n *\n * Security notes: client-side validation is a UX convenience — always re-validate\n * server-side. Image previews use object URLs that are revoked on removal/clear.\n */\n@Component({\n selector: 'ui-file-upload',\n imports: [NgTemplateOutlet, UiIcon, UiButton, UiLink, UiFileUploadList],\n templateUrl: './ui-file-upload.html',\n styleUrl: './ui-file-upload.scss',\n})\nexport class UiFileUpload {\n // --- Layout ----------------------------------------------------------\n /** `field` = compact input + Browse button; `drag` = full drop zone. */\n mode = input<UiFileUploadMode>('field');\n size = input<UiFileUploadSize>('default');\n\n // --- Selection -------------------------------------------------------\n /** Native input `name` (submitted with a surrounding form). */\n name = input<string>();\n /** Allow selecting more than one file. */\n multiple = input(false, { transform: booleanAttribute });\n /** Native `accept` filter, e.g. \"image/*,.pdf\". Also enforced on drop. */\n accept = input<string>();\n /** Max size per file, in bytes. */\n maxFileSize = input<number, unknown>(undefined, { transform: numberAttribute });\n /** Max number of files kept at once. */\n fileLimit = input<number, unknown>(undefined, { transform: numberAttribute });\n disabled = input(false, { transform: booleanAttribute });\n\n // --- Upload behaviour ------------------------------------------------\n /** Upload each file as soon as it is selected. */\n auto = input(false, { transform: booleanAttribute });\n /** Delegate uploading to the `uploadHandler` output instead of the built-in XHR. */\n customUpload = input(false, { transform: booleanAttribute });\n /** Endpoint for the built-in uploader. */\n url = input<string>();\n /** HTTP method for the built-in uploader. */\n method = input<'post' | 'put'>('post');\n /** Field name used for each file in the multipart body. */\n fieldName = input<string>('files');\n /** Send credentials (cookies) with the built-in upload request. */\n withCredentials = input(false, { transform: booleanAttribute });\n\n // --- Presentation / labels ------------------------------------------\n /** Show the file list under the control. */\n showFileList = input(true, { transform: booleanAttribute });\n /** Show the Upload/Cancel toolbar buttons (drag mode). */\n showControls = input(true, { transform: booleanAttribute });\n browseLabel = input<string>('Parcourir');\n /** Placeholder shown in field mode before any selection. */\n chooseLabel = input<string>('Choisir un fichier…');\n uploadLabel = input<string>('Téléverser');\n cancelLabel = input<string>('Effacer');\n /** Drag-zone link + prompt. */\n dragLinkLabel = input<string>('Cliquer pour téléverser');\n dragPromptLabel = input<string>('ou glisser-déposer les fichiers ici');\n /** Small hint under the drag prompt (e.g. \"JPG, PNG (max 5 MB)\"). */\n hint = input<string>();\n /** Accessible name for the whole control. */\n // Composite widget (dropzone + file list), not a single-value CVA control: unlike the other\n // form components it doesn't extend BaseFieldControl, so it redeclares its own `ariaLabel`\n // here — with a non-undefined default, since the dropzone always needs an accessible name.\n ariaLabel = input<string>('Téléversement de fichiers');\n /** Multi-file summary in field mode — `{0}` is replaced by the file count. */\n filesSummaryLabel = input<string>('{0} fichiers');\n /** Rejection message: file type not accepted — `{0}` is the file name. */\n invalidTypeMessage = input<string>('Type de fichier non autorisé : {0}');\n /** Rejection message: file too large — `{0}` is the file name. */\n invalidSizeMessage = input<string>('Fichier trop volumineux : {0}');\n /** Rejection message: `fileLimit` reached — `{0}` is the limit. */\n limitReachedMessage = input<string>('Nombre maximum de fichiers atteint ({0}).');\n /** Error shown when an upload fails without a server message. */\n uploadErrorMessage = input<string>('Échec du téléversement');\n /** Error shown when the upload request fails at the network level. */\n networkErrorMessage = input<string>('Erreur réseau');\n /** Error shown on a non-2xx response — `{0}` is the HTTP status. */\n httpErrorMessage = input<string>('Erreur {0}');\n\n // --- Templates (drag/advanced) --------------------------------------\n /** Overrides a single file row (context: `{ $implicit: UiUploadFile, remove }`). */\n fileTemplate = input<TemplateRef<unknown>>();\n /** Overrides the content section (context: `{ $implicit: UiUploadFile[], remove, clear }`). */\n contentTemplate = input<TemplateRef<unknown>>();\n /** Custom toolbar content (context: `{ $implicit: UiUploadFile[], choose, upload, clear }`). */\n toolbarTemplate = input<TemplateRef<unknown>>();\n\n // --- Outputs ---------------------------------------------------------\n /** Files added to the selection (validated). */\n selected = output<UiUploadFile[]>();\n /** The full current selection changed. */\n filesChange = output<UiUploadFile[]>();\n /** A custom upload was requested (customUpload = true). */\n uploadHandler = output<UiUploadHandlerEvent>();\n /** Built-in upload completed for a batch. */\n uploaded = output<UiUploadEvent>();\n /** A file failed validation or upload. */\n uploadError = output<UiUploadErrorEvent>();\n /** A file was removed. */\n removed = output<UiUploadFile>();\n /** The selection was cleared. */\n cleared = output<void>();\n\n /** @ignore Stable id linking the visible label(s) to the native input. */\n protected readonly inputId = `ui-file-upload-${nextInstanceId++}`;\n\n private readonly host = inject(ElementRef<HTMLElement>);\n private readonly destroyRef = inject(DestroyRef);\n private readonly fileInput = viewChild.required<ElementRef<HTMLInputElement>>('fileInput');\n\n /** In-flight requests, keyed by file id, so we can abort. */\n private readonly requests = new Map<string, XMLHttpRequest>();\n\n /** @ignore Current selection. */\n private readonly selection = signal<UiUploadFile[]>([]);\n /** Read-only view of the current files. */\n readonly files = this.selection.asReadonly();\n\n /** @ignore Drop-zone highlight while dragging over. */\n protected readonly dragging = signal(false);\n /** @ignore Transient validation messages (rendered in a live region). */\n protected readonly messages = signal<string[]>([]);\n\n constructor() {\n // Revoke every object URL when the component is destroyed (no leaks).\n this.destroyRef.onDestroy(() => {\n for (const f of this.selection()) this.revoke(f);\n for (const xhr of this.requests.values()) xhr.abort();\n });\n\n // A11y safeguard: the control needs an accessible name.\n if (isDevMode()) {\n effect(() => {\n if (!this.ariaLabel()) {\n console.warn('[ui-file-upload] Provide `ariaLabel` to name the control.');\n }\n });\n }\n }\n\n /** @ignore */\n protected readonly hasFiles = computed(() => this.selection().length > 0);\n /** @ignore */\n protected readonly pending = computed(() => this.selection().filter((f) => f.status === 'pending'));\n /** @ignore Single-file summary shown in field mode. */\n protected readonly fieldSummary = computed(() => {\n const files = this.selection();\n if (!files.length) return this.chooseLabel();\n if (files.length === 1) return files[0].name;\n return formatLabel(this.filesSummaryLabel(), files.length);\n });\n /** @ignore */\n protected readonly canUpload = computed(\n () => !this.disabled() && this.pending().length > 0 && (this.customUpload() || !!this.url()),\n );\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const c = ['ui-file-upload', `_${this.mode()}`];\n if (this.size() !== 'default') c.push(`_${this.size()}`);\n if (this.dragging()) c.push('_dragging');\n if (this.disabled()) c.push('_disabled');\n return c.join(' ');\n });\n\n // --- Bound refs for custom templates (stable identities) -------------\n /** @ignore */ protected readonly removeFn = (f: UiUploadFile): void => this.remove(f);\n /** @ignore */ protected readonly clearFn = (): void => this.clear();\n /** @ignore */ protected readonly chooseFn = (): void => this.choose();\n /** @ignore */ protected readonly uploadFn = (): void => this.upload();\n\n // --- Public API ------------------------------------------------------\n\n /** Opens the native file picker. */\n choose(): void {\n if (this.disabled()) return;\n this.fileInput().nativeElement.click();\n }\n\n /** Uploads all pending files (built-in XHR, or emits `uploadHandler`). */\n upload(): void {\n const pending = this.pending();\n if (!pending.length) return;\n\n if (this.customUpload()) {\n this.emitCustomUpload(pending);\n return;\n }\n const endpoint = this.url();\n if (!endpoint) return;\n for (const f of pending) this.xhrUpload(f, endpoint);\n }\n\n /** Removes a file (aborts its upload, revokes its preview). */\n remove(target: UiUploadFile): void {\n this.requests.get(target.id)?.abort();\n this.requests.delete(target.id);\n this.revoke(target);\n this.selection.update((files) => files.filter((f) => f.id !== target.id));\n this.removed.emit(target);\n this.filesChange.emit(this.selection());\n }\n\n /** Clears the whole selection. */\n clear(): void {\n for (const xhr of this.requests.values()) xhr.abort();\n this.requests.clear();\n for (const f of this.selection()) this.revoke(f);\n this.selection.set([]);\n this.messages.set([]);\n this.resetInput();\n this.cleared.emit();\n this.filesChange.emit([]);\n }\n\n // --- Native input / drop --------------------------------------------\n\n /** @ignore */\n protected onInputChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.ingest(input.files);\n // Reset so selecting the same file again re-triggers `change`.\n this.resetInput();\n }\n\n /** @ignore */\n protected onDragOver(event: DragEvent): void {\n if (this.disabled()) return;\n event.preventDefault();\n event.stopPropagation();\n this.dragging.set(true);\n }\n\n /** @ignore */\n protected onDragLeave(event: DragEvent): void {\n if (this.disabled()) return;\n event.preventDefault();\n // Ignore leave events bubbling from children still inside the zone.\n if (this.host.nativeElement.contains(event.relatedTarget as Node)) return;\n this.dragging.set(false);\n }\n\n /** @ignore */\n protected onDrop(event: DragEvent): void {\n if (this.disabled()) return;\n event.preventDefault();\n event.stopPropagation();\n this.dragging.set(false);\n this.ingest(event.dataTransfer?.files ?? null);\n }\n\n // --- Internals -------------------------------------------------------\n\n /** Validate + add a FileList to the selection. */\n private ingest(list: FileList | null): void {\n if (!list || !list.length || this.disabled()) return;\n\n const incoming = Array.from(list);\n const added: UiUploadFile[] = [];\n const newMessages: string[] = [];\n const limit = this.fileLimit();\n const maxSize = this.maxFileSize();\n\n for (const file of incoming) {\n // Single-file mode: the new file replaces the current one, so only cap the incoming batch.\n if (!this.multiple() && added.length >= 1) break;\n\n const item = this.toUploadFile(file);\n\n if (!isFileTypeAccepted(file, this.accept())) {\n this.fail(item, 'type', formatLabel(this.invalidTypeMessage(), file.name), newMessages);\n continue;\n }\n if (maxSize != null && file.size > maxSize) {\n this.fail(item, 'size', formatLabel(this.invalidSizeMessage(), file.name), newMessages);\n continue;\n }\n if (limit != null && (this.multiple() ? this.selection().length : 0) + added.length >= limit) {\n this.fail(item, 'limit', formatLabel(this.limitReachedMessage(), limit), newMessages);\n continue;\n }\n added.push(item);\n }\n\n this.messages.set(newMessages);\n if (!added.length) return;\n\n if (!this.multiple()) {\n // Replacement: release resources held by the previous selection.\n for (const previous of this.selection()) {\n this.requests.get(previous.id)?.abort();\n this.requests.delete(previous.id);\n this.revoke(previous);\n }\n }\n this.selection.update((files) => (this.multiple() ? [...files, ...added] : added));\n this.selected.emit(added);\n this.filesChange.emit(this.selection());\n\n if (this.auto()) this.upload();\n }\n\n private toUploadFile(file: File): UiUploadFile {\n return {\n id: `uifu-${nextUploadId++}`,\n file,\n name: file.name,\n size: file.size,\n type: file.type,\n status: 'pending',\n progress: 0,\n objectUrl: isImageFile(file) ? URL.createObjectURL(file) : undefined,\n };\n }\n\n private fail(item: UiUploadFile, reason: UiUploadErrorEvent['reason'], message: string, sink: string[]): void {\n this.revoke(item);\n sink.push(message);\n this.uploadError.emit({ file: { ...item, status: 'error', error: message }, reason, message });\n }\n\n /** Mutates one file in place (immutably) and pushes a new array reference. */\n private patch(id: string, changes: Partial<UiUploadFile>): void {\n this.selection.update((files) => files.map((f) => (f.id === id ? { ...f, ...changes } : f)));\n }\n\n private emitCustomUpload(pending: UiUploadFile[]): void {\n for (const f of pending) this.patch(f.id, { status: 'uploading', progress: 0 });\n this.uploadHandler.emit({\n files: pending,\n setProgress: (file, progress) =>\n this.patch(file.id, { status: 'uploading', progress: Math.max(0, Math.min(100, progress)) }),\n markUploaded: (file) => {\n this.patch(file.id, { status: 'completed', progress: 100 });\n this.filesChange.emit(this.selection());\n },\n markError: (file, msg) => {\n this.patch(file.id, { status: 'error', error: msg ?? this.uploadErrorMessage() });\n this.uploadError.emit({\n file,\n reason: 'upload',\n message: msg ?? this.uploadErrorMessage(),\n });\n },\n });\n }\n\n private xhrUpload(item: UiUploadFile, endpoint: string): void {\n const xhr = new XMLHttpRequest();\n this.requests.set(item.id, xhr);\n this.patch(item.id, { status: 'uploading', progress: 0 });\n\n const body = new FormData();\n body.append(this.fieldName(), item.file, item.name);\n\n xhr.upload.addEventListener('progress', (e) => {\n if (e.lengthComputable) this.patch(item.id, { progress: Math.round((e.loaded / e.total) * 100) });\n });\n xhr.addEventListener('load', () => {\n this.requests.delete(item.id);\n if (xhr.status >= 200 && xhr.status < 300) {\n this.patch(item.id, { status: 'completed', progress: 100 });\n this.uploaded.emit({ files: [item], xhr });\n this.filesChange.emit(this.selection());\n } else {\n this.uploadFailed(item, formatLabel(this.httpErrorMessage(), xhr.status));\n }\n });\n xhr.addEventListener('error', () => this.uploadFailed(item, this.networkErrorMessage()));\n xhr.addEventListener('abort', () => this.requests.delete(item.id));\n\n xhr.open(this.method().toUpperCase(), endpoint, true);\n xhr.withCredentials = this.withCredentials();\n xhr.send(body);\n }\n\n private uploadFailed(item: UiUploadFile, message: string): void {\n this.requests.delete(item.id);\n this.patch(item.id, { status: 'error', error: message });\n this.uploadError.emit({ file: item, reason: 'upload', message });\n }\n\n private revoke(file: UiUploadFile): void {\n if (file.objectUrl) URL.revokeObjectURL(file.objectUrl);\n }\n\n private resetInput(): void {\n const el = this.fileInput().nativeElement;\n if (el) el.value = '';\n }\n}\n","<div\n [class]=\"classes()\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n (drop)=\"onDrop($event)\"\n>\n <!-- Real native control (visually hidden, keeps keyboard + screen-reader support) -->\n <input\n #fileInput\n class=\"ui-file-upload-input\"\n type=\"file\"\n [id]=\"inputId\"\n [attr.name]=\"name()\"\n [attr.accept]=\"accept() || null\"\n [multiple]=\"multiple()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n (change)=\"onInputChange($event)\"\n />\n\n @if (mode() === 'field') {\n <!-- Field mode: compact summary + Browse trigger (whole label opens picker) -->\n <label class=\"ui-file-upload-field\" [attr.for]=\"inputId\">\n <span class=\"ui-file-upload-field-text\" [class._placeholder]=\"!hasFiles()\">{{ fieldSummary() }}</span>\n <span class=\"ui-file-upload-browse\" aria-hidden=\"true\">{{ browseLabel() }}</span>\n </label>\n } @else {\n <!-- Drag mode: full drop zone -->\n <label class=\"ui-file-upload-zone\" [attr.for]=\"inputId\">\n <ui-icon class=\"ui-file-upload-zone-icon\" name=\"cloud-arrow-up\" size=\"lg\" />\n <span class=\"ui-file-upload-zone-content\">\n <span class=\"ui-file-upload-zone-title\">\n <span class=\"ui-file-upload-zone-link\">{{ dragLinkLabel() }}</span>\n <span class=\"ui-file-upload-zone-prompt\">{{ dragPromptLabel() }}</span>\n </span>\n @if (hint(); as h) {\n <span class=\"ui-file-upload-zone-hint\">{{ h }}</span>\n }\n </span>\n </label>\n\n <!-- Toolbar (custom, or default Upload/Clear actions) -->\n @if (toolbarTemplate(); as tpl) {\n <div class=\"ui-file-upload-toolbar\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: files(), choose: chooseFn, upload: uploadFn, clear: clearFn }\"\n />\n </div>\n } @else if (showControls() && hasFiles()) {\n <div class=\"ui-file-upload-toolbar\">\n @if (!auto()) {\n <ui-button\n [label]=\"uploadLabel()\"\n [size]=\"size() === 'small' ? 'small' : 'default'\"\n icon=\"cloud-arrow-up\"\n [disabled]=\"!canUpload()\"\n (buttonClick)=\"upload()\"\n />\n }\n <ui-button\n [label]=\"cancelLabel()\"\n level=\"low\"\n [size]=\"size() === 'small' ? 'small' : 'default'\"\n icon=\"xmark\"\n (buttonClick)=\"clear()\"\n />\n </div>\n }\n }\n\n <!-- Content section: the file list -->\n @if (contentTemplate(); as tpl) {\n <div class=\"ui-file-upload-content\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: files(), remove: removeFn, clear: clearFn }\"\n />\n </div>\n } @else if (showFileList() && hasFiles()) {\n <ul class=\"ui-file-upload-content\" role=\"list\">\n @for (f of files(); track f.id) {\n <li>\n @if (fileTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: f, remove: removeFn }\"\n />\n } @else {\n <ui-file-upload-list [file]=\"f\" [size]=\"size()\" (remove)=\"remove($event)\" />\n }\n </li>\n }\n </ul>\n }\n\n <!-- Validation messages (assertive live region) -->\n @if (messages().length) {\n <div class=\"ui-file-upload-messages\" role=\"alert\" aria-live=\"assertive\">\n @for (msg of messages(); track msg) {\n <p class=\"ui-file-upload-message\">{{ msg }}</p>\n }\n </div>\n }\n</div>\n","/*\n * Public API Surface of ui-kit/ui-file-upload\n *\n * Includes `ui-file-upload-list`: it renders the upload's own file model,\n * so the two live in one entry point (a separate one would be a cycle).\n */\n\nexport * from './lib/ui-file-upload-list';\nexport * from './lib/ui-file-upload.model';\nexport * from './lib/ui-file-upload';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAAA;AACA;AACA;AAsDA;AACM,SAAU,cAAc,CAAC,KAAa,EAAA;AAC1C,IAAA,IAAI,CAAC,KAAK,IAAI,KAAK,GAAG,CAAC;AAAE,QAAA,OAAO,KAAK;IACrC,MAAM,CAAC,GAAG,IAAI;AACd,IAAA,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;AAC3C,IAAA,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AAC/E,IAAA,MAAM,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AACpC,IAAA,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,EAAE;IAC3C,OAAO,CAAA,EAAG,OAAO,CAAA,CAAA,EAAI,KAAK,CAAC,CAAC,CAAC,EAAE;AACjC;AAEA;;;AAGG;AACG,SAAU,kBAAk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AA,EAAA,MAAA,EAAA,YAAA,EAAA,QAAA,EAAA,KAAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,EAAA,aAAA,EAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAU,gBAAgB,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,WAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,gBAAA,EAAA,eAAA,CAAA,EAAA,OAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAI3D,YAAY,EAAA,UAAA,EAAA,CAAA;kBANxB,SAAS;+BACE,gBAAgB,EAAA,OAAA,EACjB,CAAC,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAA,QAAA,EAAA,mpHAAA,EAAA,MAAA,EAAA,CAAA,0zJAAA,CAAA,EAAA;43HAqGO,WAAW,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEzJ3F;;;;;AAKG;;ACLH;;AAEG;;;;"}
@@ -0,0 +1,85 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, booleanAttribute, computed, Component } from '@angular/core';
3
+ import { UiIcon } from '@4sh/ui-kit/ui-icon';
4
+
5
+ /** Default FontAwesome icon associated with each level. */
6
+ const LEVEL_ICONS = {
7
+ default: 'question-circle',
8
+ highlight: 'info-circle',
9
+ success: 'check-circle',
10
+ warning: 'exclamation-circle',
11
+ error: 'times-circle',
12
+ };
13
+ /**
14
+ * ui-helper — contextual help/feedback text.
15
+ *
16
+ * Displays a message preceded by an icon whose meaning depends on the `level`
17
+ * (question, info, success, alert, error). Used below a form field
18
+ * (linked via `aria-describedby` on the input) or as a standalone hint.
19
+ *
20
+ * A11y: The text message conveys the information; the icon is decorative
21
+ * (`aria-hidden`). For feedback that appears or changes dynamically (field validation
22
+ *), set `ariaLive=“polite”` (or `“assertive”` for an error) so
23
+ * that screen readers announce the change.
24
+ */
25
+ class UiHelper {
26
+ constructor() {
27
+ /** Help message displayed. */
28
+ this.message = input.required(/* @ts-ignore */
29
+ ...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
30
+ /** Feedback level (controls the default color and icon). */
31
+ this.level = input('default', /* @ts-ignore */
32
+ ...(ngDevMode ? [{ debugName: "level" }] : /* istanbul ignore next */ []));
33
+ /** Text and icon size. */
34
+ this.size = input('default', /* @ts-ignore */
35
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
36
+ /** Displays the level icon. */
37
+ this.showIcon = input(true, { ...(ngDevMode ? { debugName: "showIcon" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
38
+ /** Overrides the icon name derived from `level`. */
39
+ this.icon = input(/* @ts-ignore */
40
+ ...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
41
+ /** Live region for dynamic feedback (default: `off`). */
42
+ this.ariaLive = input('off', /* @ts-ignore */
43
+ ...(ngDevMode ? [{ debugName: "ariaLive" }] : /* istanbul ignore next */ []));
44
+ /** @ignore Actual icon: explicit overlay, otherwise the icon for that level. */
45
+ this.resolvedIcon = computed(() => this.icon() ?? LEVEL_ICONS[this.level()], /* @ts-ignore */
46
+ ...(ngDevMode ? [{ debugName: "resolvedIcon" }] : /* istanbul ignore next */ []));
47
+ /** @ignore An icon is displayed. */
48
+ this.hasIcon = computed(() => this.showIcon() && !!this.resolvedIcon(), /* @ts-ignore */
49
+ ...(ngDevMode ? [{ debugName: "hasIcon" }] : /* istanbul ignore next */ []));
50
+ /** @ignore Icon size aligned with text size. */
51
+ this.iconSize = computed(() => (this.size() === 'small' ? 'sm' : 'default'), /* @ts-ignore */
52
+ ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
53
+ /** @ignore native aria-live (null when `off` to avoid polluting the DOM). */
54
+ this.liveRegion = computed(() => {
55
+ const live = this.ariaLive();
56
+ return live === 'off' ? null : live;
57
+ }, /* @ts-ignore */
58
+ ...(ngDevMode ? [{ debugName: "liveRegion" }] : /* istanbul ignore next */ []));
59
+ /** @ignore */
60
+ this.classes = computed(() => {
61
+ const c = ['ui-helper', `_${this.level()}`];
62
+ if (this.size() !== 'default')
63
+ c.push(`_${this.size()}`);
64
+ return c.join(' ');
65
+ }, /* @ts-ignore */
66
+ ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
67
+ }
68
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: UiHelper, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
69
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: UiHelper, isStandalone: true, selector: "ui-helper", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, showIcon: { classPropertyName: "showIcon", publicName: "showIcon", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, ariaLive: { classPropertyName: "ariaLive", publicName: "ariaLive", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div [class]=\"classes()\" [attr.aria-live]=\"liveRegion()\">\n @if (hasIcon()) {\n <ui-icon class=\"ui-helper-icon\" [name]=\"resolvedIcon()!\" [size]=\"iconSize()\" />\n }\n <span class=\"ui-helper-message\">{{ message() }}</span>\n</div>\n", styles: [".ui-helper{display:inline-flex;align-items:center;gap:var(--units-xs);font-family:var(--fontfamily-base);font-weight:var(--weight-regular);line-height:1.3;font-size:var(--size-typography-text-default)}.ui-helper-icon{line-height:0}.ui-helper-message{display:inline-block}.ui-helper._small{font-size:var(--size-typography-text-md)}.ui-helper._default{color:var(--form-low-content-default)}.ui-helper._highlight{color:var(--informative-highlightlow-content-default)}.ui-helper._success{color:var(--informative-successlow-content-default)}.ui-helper._warning{color:var(--informative-warninglow-content-default)}.ui-helper._error{color:var(--informative-errorlow-content-default)}\n"], dependencies: [{ kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }] }); }
70
+ }
71
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: UiHelper, decorators: [{
72
+ type: Component,
73
+ args: [{ selector: 'ui-helper', imports: [UiIcon], template: "<div [class]=\"classes()\" [attr.aria-live]=\"liveRegion()\">\n @if (hasIcon()) {\n <ui-icon class=\"ui-helper-icon\" [name]=\"resolvedIcon()!\" [size]=\"iconSize()\" />\n }\n <span class=\"ui-helper-message\">{{ message() }}</span>\n</div>\n", styles: [".ui-helper{display:inline-flex;align-items:center;gap:var(--units-xs);font-family:var(--fontfamily-base);font-weight:var(--weight-regular);line-height:1.3;font-size:var(--size-typography-text-default)}.ui-helper-icon{line-height:0}.ui-helper-message{display:inline-block}.ui-helper._small{font-size:var(--size-typography-text-md)}.ui-helper._default{color:var(--form-low-content-default)}.ui-helper._highlight{color:var(--informative-highlightlow-content-default)}.ui-helper._success{color:var(--informative-successlow-content-default)}.ui-helper._warning{color:var(--informative-warninglow-content-default)}.ui-helper._error{color:var(--informative-errorlow-content-default)}\n"] }]
74
+ }], propDecorators: { message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: true }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], showIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIcon", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], ariaLive: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLive", required: false }] }] } });
75
+
76
+ /*
77
+ * Public API Surface of ui-kit/ui-helper
78
+ */
79
+
80
+ /**
81
+ * Generated bundle index. Do not edit.
82
+ */
83
+
84
+ export { UiHelper };
85
+ //# sourceMappingURL=4sh-ui-kit-ui-helper.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"4sh-ui-kit-ui-helper.mjs","sources":["../../../projects/ui-kit/ui-helper/src/lib/ui-helper.ts","../../../projects/ui-kit/ui-helper/src/lib/ui-helper.html","../../../projects/ui-kit/ui-helper/src/public-api.ts","../../../projects/ui-kit/ui-helper/src/4sh-ui-kit-ui-helper.ts"],"sourcesContent":["import { booleanAttribute, Component, computed, input } from '@angular/core';\nimport { UiIcon } from '@4sh/ui-kit/ui-icon';\nimport { UiFeedbackLevel } from '@4sh/ui-kit/types';\n\nexport type HelperSize = 'default' | 'small';\nexport type HelperAriaLive = 'off' | 'polite' | 'assertive';\n\n/** Default FontAwesome icon associated with each level. */\nconst LEVEL_ICONS: Record<UiFeedbackLevel, string> = {\n default: 'question-circle',\n highlight: 'info-circle',\n success: 'check-circle',\n warning: 'exclamation-circle',\n error: 'times-circle',\n};\n\n/**\n * ui-helper — contextual help/feedback text.\n *\n * Displays a message preceded by an icon whose meaning depends on the `level`\n * (question, info, success, alert, error). Used below a form field\n * (linked via `aria-describedby` on the input) or as a standalone hint.\n *\n * A11y: The text message conveys the information; the icon is decorative\n * (`aria-hidden`). For feedback that appears or changes dynamically (field validation\n *), set `ariaLive=“polite”` (or `“assertive”` for an error) so\n * that screen readers announce the change.\n */\n\n@Component({\n selector: 'ui-helper',\n imports: [UiIcon],\n templateUrl: './ui-helper.html',\n styleUrl: './ui-helper.scss',\n})\nexport class UiHelper {\n /** Help message displayed. */\n message = input.required<string>();\n /** Feedback level (controls the default color and icon). */\n level = input<UiFeedbackLevel>('default');\n /** Text and icon size. */\n size = input<HelperSize>('default');\n /** Displays the level icon. */\n showIcon = input(true, { transform: booleanAttribute });\n /** Overrides the icon name derived from `level`. */\n icon = input<string>();\n /** Live region for dynamic feedback (default: `off`). */\n ariaLive = input<HelperAriaLive>('off');\n\n /** @ignore Actual icon: explicit overlay, otherwise the icon for that level. */\n protected readonly resolvedIcon = computed(() => this.icon() ?? LEVEL_ICONS[this.level()]);\n\n /** @ignore An icon is displayed. */\n protected readonly hasIcon = computed(() => this.showIcon() && !!this.resolvedIcon());\n\n /** @ignore Icon size aligned with text size. */\n protected readonly iconSize = computed(() => (this.size() === 'small' ? 'sm' : 'default'));\n\n /** @ignore native aria-live (null when `off` to avoid polluting the DOM). */\n protected readonly liveRegion = computed(() => {\n const live = this.ariaLive();\n return live === 'off' ? null : live;\n });\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const c = ['ui-helper', `_${this.level()}`];\n if (this.size() !== 'default') c.push(`_${this.size()}`);\n return c.join(' ');\n });\n}\n","<div [class]=\"classes()\" [attr.aria-live]=\"liveRegion()\">\n @if (hasIcon()) {\n <ui-icon class=\"ui-helper-icon\" [name]=\"resolvedIcon()!\" [size]=\"iconSize()\" />\n }\n <span class=\"ui-helper-message\">{{ message() }}</span>\n</div>\n","/*\n * Public API Surface of ui-kit/ui-helper\n */\n\nexport * from './lib/ui-helper';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAOA;AACA,MAAM,WAAW,GAAoC;AACnD,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,SAAS,EAAE,aAAa;AACxB,IAAA,OAAO,EAAE,cAAc;AACvB,IAAA,OAAO,EAAE,oBAAoB;AAC7B,IAAA,KAAK,EAAE,cAAc;CACtB;AAED;;;;;;;;;;;AAWG;MAQU,QAAQ,CAAA;AANrB,IAAA,WAAA,GAAA;;QAQE,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ;oFAAU;;QAElC,IAAA,CAAA,KAAK,GAAG,KAAK,CAAkB,SAAS;kFAAC;;QAEzC,IAAA,CAAA,IAAI,GAAG,KAA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AA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,QAAA,EAAA,YAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAIL,QAAQ,EAAA,UAAA,EAAA,CAAA;kBANpB,SAAS;+BACE,WAAW,EAAA,OAAA,EACZ,CAAC,MAAM,CAAC,EAAA,QAAA,EAAA,0PAAA,EAAA,MAAA,EAAA,CAAA,wqBAAA,CAAA,EAAA;;;AE/BnB;;AAEG;;ACFH;;AAEG;;;;"}
@@ -0,0 +1,98 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, makeEnvironmentProviders, input, booleanAttribute, inject, computed, isDevMode, effect, Component } from '@angular/core';
3
+
4
+ /** Built-in FontAwesome Free family (the default). */
5
+ const fontAwesomeFamily = {
6
+ classes: (name, type) => `${type === 'outline' ? 'fa-regular' : 'fa-solid'} fa-${name}`,
7
+ };
8
+ /** Families always available, keyed by name. Registered families are merged on top. */
9
+ const UI_ICON_BUILTIN_FAMILIES = {
10
+ fontawesome: fontAwesomeFamily,
11
+ };
12
+ /** Registered icon families (multi provider). Merged over the built-ins. */
13
+ const UI_ICON_FAMILIES = new InjectionToken('UI_ICON_FAMILIES');
14
+ /** Family key used when a `ui-icon` does not set `family`. */
15
+ const UI_ICON_DEFAULT_FAMILY = new InjectionToken('UI_ICON_DEFAULT_FAMILY');
16
+ function provideUiIconFamilies(families, options) {
17
+ const providers = [{ provide: UI_ICON_FAMILIES, useValue: families, multi: true }];
18
+ if (options?.default) {
19
+ providers.push({ provide: UI_ICON_DEFAULT_FAMILY, useValue: options.default });
20
+ }
21
+ return makeEnvironmentProviders(providers);
22
+ }
23
+
24
+ /**
25
+ * ui-icon — renders an icon from a configurable font family.
26
+ *
27
+ * FontAwesome is the built-in default. Register other families (Material Symbols,
28
+ * Bootstrap Icons, a custom font…) with `provideUiIconFamilies()` and pick one per
29
+ * icon via `family`, or change the app-wide default.
30
+ *
31
+ * Accessible: decorative by default (aria-hidden); pass `decorative=false` + `ariaLabel`
32
+ * when the icon conveys meaning on its own.
33
+ */
34
+ class UiIcon {
35
+ constructor() {
36
+ /** Icon name for the selected family (e.g. "circle-user"). */
37
+ this.name = input.required(/* @ts-ignore */
38
+ ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
39
+ /** Icon size. */
40
+ this.size = input('default', /* @ts-ignore */
41
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
42
+ /** Visual variant, interpreted by the family (filled vs outlined). */
43
+ this.type = input('solid', /* @ts-ignore */
44
+ ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
45
+ /** Family key (default: configured default, else "fontawesome"). */
46
+ this.family = input(/* @ts-ignore */
47
+ ...(ngDevMode ? [undefined, { debugName: "family" }] : /* istanbul ignore next */ []));
48
+ /** Purely decorative icon (hidden from screen readers). */
49
+ this.decorative = input(true, { ...(ngDevMode ? { debugName: "decorative" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
50
+ /** Accessible label (required when not decorative). */
51
+ this.ariaLabel = input(/* @ts-ignore */
52
+ ...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
53
+ this.registered = inject(UI_ICON_FAMILIES, { optional: true });
54
+ this.configuredDefault = inject(UI_ICON_DEFAULT_FAMILY, { optional: true });
55
+ /** Built-in families + registered ones (registered win on key clash). */
56
+ this.families = computed(() => Object.assign({}, UI_ICON_BUILTIN_FAMILIES, ...(this.registered ?? [])), /* @ts-ignore */
57
+ ...(ngDevMode ? [{ debugName: "families" }] : /* istanbul ignore next */ []));
58
+ /** @ignore Resolved family, falling back to FontAwesome on unknown key. */
59
+ this.resolvedFamily = computed(() => {
60
+ const key = this.family() ?? this.configuredDefault ?? 'fontawesome';
61
+ const family = this.families()[key];
62
+ if (!family && isDevMode()) {
63
+ console.warn(`[ui-icon] Unknown icon family "${key}". Falling back to "fontawesome".`);
64
+ }
65
+ return family ?? fontAwesomeFamily;
66
+ }, /* @ts-ignore */
67
+ ...(ngDevMode ? [{ debugName: "resolvedFamily" }] : /* istanbul ignore next */ []));
68
+ /** @ignore */
69
+ this.classes = computed(() => `ui-icon _${this.size()} ${this.resolvedFamily().classes(this.name(), this.type())}`, /* @ts-ignore */
70
+ ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
71
+ /** @ignore Text content for ligature fonts (null for class-based fonts like FontAwesome). */
72
+ this.content = computed(() => this.resolvedFamily().content?.(this.name(), this.type()) ?? null, /* @ts-ignore */
73
+ ...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
74
+ effect(() => {
75
+ if (!this.decorative() && !this.ariaLabel() && isDevMode()) {
76
+ console.warn(`[ui-icon] Meaningful icon "${this.name()}" (decorative=false) has no ariaLabel — ` +
77
+ `it renders role="img" with no accessible name.`);
78
+ }
79
+ });
80
+ }
81
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: UiIcon, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
82
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.8", type: UiIcon, isStandalone: true, selector: "ui-icon", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, family: { classPropertyName: "family", publicName: "family", isSignal: true, isRequired: false, transformFunction: null }, decorative: { classPropertyName: "decorative", publicName: "decorative", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<i\n [class]=\"classes()\"\n [attr.aria-hidden]=\"decorative() ? 'true' : null\"\n [attr.role]=\"decorative() ? null : 'img'\"\n [attr.aria-label]=\"decorative() ? null : ariaLabel()\"\n>{{ content() }}</i>\n", styles: [":host{display:inline-flex;line-height:0}.ui-icon{display:inline-flex;align-items:center;justify-content:center;min-width:1em;min-height:1em;aspect-ratio:1;color:inherit}.ui-icon._sm{font-size:var(--ui-icon-size, var(--size-typography-icon-sm))}.ui-icon._md{font-size:var(--ui-icon-size, var(--size-typography-icon-md))}.ui-icon._default{font-size:var(--ui-icon-size, var(--size-typography-icon-default))}.ui-icon._lg{font-size:var(--ui-icon-size, var(--size-typography-icon-lg))}.ui-icon._xl{font-size:var(--ui-icon-size, var(--size-typography-icon-xl))}\n"] }); }
83
+ }
84
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: UiIcon, decorators: [{
85
+ type: Component,
86
+ args: [{ selector: 'ui-icon', template: "<i\n [class]=\"classes()\"\n [attr.aria-hidden]=\"decorative() ? 'true' : null\"\n [attr.role]=\"decorative() ? null : 'img'\"\n [attr.aria-label]=\"decorative() ? null : ariaLabel()\"\n>{{ content() }}</i>\n", styles: [":host{display:inline-flex;line-height:0}.ui-icon{display:inline-flex;align-items:center;justify-content:center;min-width:1em;min-height:1em;aspect-ratio:1;color:inherit}.ui-icon._sm{font-size:var(--ui-icon-size, var(--size-typography-icon-sm))}.ui-icon._md{font-size:var(--ui-icon-size, var(--size-typography-icon-md))}.ui-icon._default{font-size:var(--ui-icon-size, var(--size-typography-icon-default))}.ui-icon._lg{font-size:var(--ui-icon-size, var(--size-typography-icon-lg))}.ui-icon._xl{font-size:var(--ui-icon-size, var(--size-typography-icon-xl))}\n"] }]
87
+ }], ctorParameters: () => [], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], family: [{ type: i0.Input, args: [{ isSignal: true, alias: "family", required: false }] }], decorative: [{ type: i0.Input, args: [{ isSignal: true, alias: "decorative", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
88
+
89
+ /*
90
+ * Public API Surface of ui-kit/ui-icon
91
+ */
92
+
93
+ /**
94
+ * Generated bundle index. Do not edit.
95
+ */
96
+
97
+ export { UI_ICON_BUILTIN_FAMILIES, UI_ICON_DEFAULT_FAMILY, UI_ICON_FAMILIES, UiIcon, fontAwesomeFamily, provideUiIconFamilies };
98
+ //# sourceMappingURL=4sh-ui-kit-ui-icon.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"4sh-ui-kit-ui-icon.mjs","sources":["../../../projects/ui-kit/ui-icon/src/lib/ui-icon-families.ts","../../../projects/ui-kit/ui-icon/src/lib/ui-icon.ts","../../../projects/ui-kit/ui-icon/src/lib/ui-icon.html","../../../projects/ui-kit/ui-icon/src/public-api.ts","../../../projects/ui-kit/ui-icon/src/4sh-ui-kit-ui-icon.ts"],"sourcesContent":["import { EnvironmentProviders, InjectionToken, makeEnvironmentProviders, Provider } from '@angular/core';\n\n/** Visual variant of an icon, interpreted by each family (filled vs outlined). */\nexport type UiIconType = 'solid' | 'outline';\n\n/**\n * Describes how an icon font family turns a name + variant into markup, so\n * ui-icon can render any font (FontAwesome, Material Symbols, Bootstrap Icons…).\n */\nexport interface UiIconFamily {\n /** CSS classes applied to the `<i>`. */\n classes: (name: string, type: UiIconType) => string;\n /** Text content of the `<i>` — ligature fonts (e.g. Material Symbols) put the name here. */\n content?: (name: string, type: UiIconType) => string | null;\n}\n\n/** Built-in FontAwesome Free family (the default). */\nexport const fontAwesomeFamily: UiIconFamily = {\n classes: (name, type) => `${type === 'outline' ? 'fa-regular' : 'fa-solid'} fa-${name}`,\n};\n\n/** Families always available, keyed by name. Registered families are merged on top. */\nexport const UI_ICON_BUILTIN_FAMILIES: Record<string, UiIconFamily> = {\n fontawesome: fontAwesomeFamily,\n};\n\n/** Registered icon families (multi provider). Merged over the built-ins. */\nexport const UI_ICON_FAMILIES = new InjectionToken<Record<string, UiIconFamily>[]>('UI_ICON_FAMILIES');\n\n/** Family key used when a `ui-icon` does not set `family`. */\nexport const UI_ICON_DEFAULT_FAMILY = new InjectionToken<string>('UI_ICON_DEFAULT_FAMILY');\n\nexport function provideUiIconFamilies(\n families: Record<string, UiIconFamily>,\n options?: { default?: string },\n): EnvironmentProviders {\n const providers: Provider[] = [{ provide: UI_ICON_FAMILIES, useValue: families, multi: true }];\n if (options?.default) {\n providers.push({ provide: UI_ICON_DEFAULT_FAMILY, useValue: options.default });\n }\n return makeEnvironmentProviders(providers);\n}\n","import { booleanAttribute, Component, computed, effect, inject, input, isDevMode } from '@angular/core';\nimport {\n fontAwesomeFamily,\n UI_ICON_BUILTIN_FAMILIES,\n UI_ICON_DEFAULT_FAMILY,\n UI_ICON_FAMILIES,\n UiIconFamily,\n UiIconType,\n} from './ui-icon-families';\n\nexport type UiIconSize = 'sm' | 'md' | 'default' | 'lg' | 'xl';\nexport type { UiIconType };\n\n/**\n * ui-icon — renders an icon from a configurable font family.\n *\n * FontAwesome is the built-in default. Register other families (Material Symbols,\n * Bootstrap Icons, a custom font…) with `provideUiIconFamilies()` and pick one per\n * icon via `family`, or change the app-wide default.\n *\n * Accessible: decorative by default (aria-hidden); pass `decorative=false` + `ariaLabel`\n * when the icon conveys meaning on its own.\n */\n@Component({\n selector: 'ui-icon',\n templateUrl: './ui-icon.html',\n styleUrl: './ui-icon.scss',\n})\nexport class UiIcon {\n /** Icon name for the selected family (e.g. \"circle-user\"). */\n name = input.required<string>();\n /** Icon size. */\n size = input<UiIconSize>('default');\n /** Visual variant, interpreted by the family (filled vs outlined). */\n type = input<UiIconType>('solid');\n /** Family key (default: configured default, else \"fontawesome\"). */\n family = input<string>();\n /** Purely decorative icon (hidden from screen readers). */\n decorative = input(true, { transform: booleanAttribute });\n /** Accessible label (required when not decorative). */\n ariaLabel = input<string>();\n\n private readonly registered = inject(UI_ICON_FAMILIES, { optional: true });\n private readonly configuredDefault = inject(UI_ICON_DEFAULT_FAMILY, { optional: true });\n\n /** Built-in families + registered ones (registered win on key clash). */\n private readonly families = computed<Record<string, UiIconFamily>>(() =>\n Object.assign({}, UI_ICON_BUILTIN_FAMILIES, ...(this.registered ?? [])),\n );\n\n /** @ignore Resolved family, falling back to FontAwesome on unknown key. */\n private readonly resolvedFamily = computed(() => {\n const key = this.family() ?? this.configuredDefault ?? 'fontawesome';\n const family = this.families()[key];\n if (!family && isDevMode()) {\n console.warn(`[ui-icon] Unknown icon family \"${key}\". Falling back to \"fontawesome\".`);\n }\n return family ?? fontAwesomeFamily;\n });\n\n /** @ignore */\n protected readonly classes = computed(\n () => `ui-icon _${this.size()} ${this.resolvedFamily().classes(this.name(), this.type())}`,\n );\n\n /** @ignore Text content for ligature fonts (null for class-based fonts like FontAwesome). */\n protected readonly content = computed(\n () => this.resolvedFamily().content?.(this.name(), this.type()) ?? null,\n );\n\n constructor() {\n effect(() => {\n if (!this.decorative() && !this.ariaLabel() && isDevMode()) {\n console.warn(\n `[ui-icon] Meaningful icon \"${this.name()}\" (decorative=false) has no ariaLabel — ` +\n `it renders role=\"img\" with no accessible name.`,\n );\n }\n });\n }\n}\n","<i\n [class]=\"classes()\"\n [attr.aria-hidden]=\"decorative() ? 'true' : null\"\n [attr.role]=\"decorative() ? null : 'img'\"\n [attr.aria-label]=\"decorative() ? null : ariaLabel()\"\n>{{ content() }}</i>\n","/*\n * Public API Surface of ui-kit/ui-icon\n */\n\nexport * from './lib/ui-icon';\nexport * from './lib/ui-icon-families';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAgBA;AACO,MAAM,iBAAiB,GAAiB;IAC7C,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,CAAA,EAAG,IAAI,KAAK,SAAS,GAAG,YAAY,GAAG,UAAU,CAAA,IAAA,EAAO,IAAI,CAAA,CAAE;;AAGzF;AACO,MAAM,wBAAwB,GAAiC;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A,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAN,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAM,mzBC5BnB,sNAMA,EAAA,MAAA,EAAA,CAAA,8iBAAA,CAAA,EAAA,CAAA,CAAA;;2FDsBa,MAAM,EAAA,UAAA,EAAA,CAAA;kBALlB,SAAS;+BACE,SAAS,EAAA,QAAA,EAAA,sNAAA,EAAA,MAAA,EAAA,CAAA,8iBAAA,CAAA,EAAA;;;AExBrB;;AAEG;;ACFH;;AAEG;;;;"}
@@ -0,0 +1,201 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, inject, input, output, computed, linkedSignal, effect, isDevMode, Component } from '@angular/core';
3
+ import { NgOptimizedImage } from '@angular/common';
4
+ import { httpResource } from '@angular/common/http';
5
+ import { DomSanitizer } from '@angular/platform-browser';
6
+ import { ThemeService, BrandService } from '@4sh/ui-kit/theming';
7
+ import { UiIcon } from '@4sh/ui-kit/ui-icon';
8
+
9
+ /**
10
+ * Map of the LOCAL assets available to `ui-image` (its `name` input).
11
+ *
12
+ * The kit cannot know a project's assets, so the map is injected rather than
13
+ * bundled: generate it in your app (see `npm run generate:assets` in the
14
+ * starter, which writes `src/assets/assets-map.json`) and provide it with
15
+ * `provideUiImageAssets()`. Without it, `name` resolves to nothing and the
16
+ * component falls back to its placeholder — `src` (remote URLs) still works.
17
+ */
18
+ const UI_IMAGE_ASSETS = new InjectionToken('UI_IMAGE_ASSETS');
19
+ /**
20
+ * Registers the local asset map consumed by `ui-image`.
21
+ *
22
+ * ```ts
23
+ * import assetsMap from './assets/assets-map.json';
24
+ * providers: [provideUiImageAssets(assetsMap)]
25
+ * ```
26
+ */
27
+ function provideUiImageAssets(map) {
28
+ return { provide: UI_IMAGE_ASSETS, useValue: map };
29
+ }
30
+ /** Cross-instance memoization: the same resolved URL is fetched once (logos repeated across the app). */
31
+ const SVG_CACHE = new Map();
32
+ /**
33
+ * ui-image — theme/brand-aware image.
34
+ *
35
+ * Two sources: `name` (local asset key resolved through `assets-map.json`,
36
+ * theme/brand variants) or `src` (remote/absolute URL — takes precedence).
37
+ * Local `.svg` assets are inlined (`innerHTML`) so they can inherit CSS;
38
+ * remote URLs always render through `<img [ngSrc]>` (never inlined).
39
+ * On load failure the `fallback` local asset is shown, then a token-styled
40
+ * placeholder if the fallback also fails (or none is provided).
41
+ */
42
+ class UiImage {
43
+ constructor() {
44
+ this.sanitizer = inject(DomSanitizer);
45
+ this.assetsMap = inject(UI_IMAGE_ASSETS, { optional: true }) ?? {};
46
+ this.themeService = inject(ThemeService);
47
+ this.brandService = inject(BrandService);
48
+ /** Local asset key in `assets-map.json` (theme/brand-aware resolution). */
49
+ this.name = input(/* @ts-ignore */
50
+ ...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
51
+ /** Remote/absolute URL, rendered via `NgOptimizedImage` — takes precedence over `name`. */
52
+ this.src = input(/* @ts-ignore */
53
+ ...(ngDevMode ? [undefined, { debugName: "src" }] : /* istanbul ignore next */ []));
54
+ /** Local asset name (`assets-map.json` key) displayed when the main image fails to load. */
55
+ this.fallback = input(/* @ts-ignore */
56
+ ...(ngDevMode ? [undefined, { debugName: "fallback" }] : /* istanbul ignore next */ []));
57
+ this.priority = input(false, /* @ts-ignore */
58
+ ...(ngDevMode ? [{ debugName: "priority" }] : /* istanbul ignore next */ []));
59
+ this.fill = input(false, /* @ts-ignore */
60
+ ...(ngDevMode ? [{ debugName: "fill" }] : /* istanbul ignore next */ []));
61
+ this.width = input(/* @ts-ignore */
62
+ ...(ngDevMode ? [undefined, { debugName: "width" }] : /* istanbul ignore next */ []));
63
+ this.widthUnit = input(/* @ts-ignore */
64
+ ...(ngDevMode ? [undefined, { debugName: "widthUnit" }] : /* istanbul ignore next */ []));
65
+ this.height = input(/* @ts-ignore */
66
+ ...(ngDevMode ? [undefined, { debugName: "height" }] : /* istanbul ignore next */ []));
67
+ this.heightUnit = input(/* @ts-ignore */
68
+ ...(ngDevMode ? [undefined, { debugName: "heightUnit" }] : /* istanbul ignore next */ []));
69
+ this.alt = input(/* @ts-ignore */
70
+ ...(ngDevMode ? [undefined, { debugName: "alt" }] : /* istanbul ignore next */ []));
71
+ /** Emitted with the failed URL when an image fails to load. */
72
+ this.loadFailed = output();
73
+ this.isRemote = computed(() => !!this.src(), /* @ts-ignore */
74
+ ...(ngDevMode ? [{ debugName: "isRemote" }] : /* istanbul ignore next */ []));
75
+ /** Inline SVG is reserved for LOCAL assets — a remote `.svg` renders through `<img>` (no XSS surface). */
76
+ this.isInlineSvg = computed(() => !this.isRemote() && !!this.name()?.toLowerCase().endsWith('.svg'), /* @ts-ignore */
77
+ ...(ngDevMode ? [{ debugName: "isInlineSvg" }] : /* istanbul ignore next */ []));
78
+ this.localSrc = computed(() => this.resolveLocal(this.name()), /* @ts-ignore */
79
+ ...(ngDevMode ? [{ debugName: "localSrc" }] : /* istanbul ignore next */ []));
80
+ this.fallbackSrc = computed(() => this.resolveLocal(this.fallback()), /* @ts-ignore */
81
+ ...(ngDevMode ? [{ debugName: "fallbackSrc" }] : /* istanbul ignore next */ []));
82
+ this.primarySrc = computed(() => this.src() || this.localSrc(), /* @ts-ignore */
83
+ ...(ngDevMode ? [{ debugName: "primarySrc" }] : /* istanbul ignore next */ []));
84
+ // Failure flags auto-reset when their source URL changes (theme/brand/src swap → automatic retry).
85
+ this.primaryImgFailed = linkedSignal({ ...(ngDevMode ? { debugName: "primaryImgFailed" } : /* istanbul ignore next */ {}), source: this.primarySrc, computation: () => false });
86
+ this.fallbackImgFailed = linkedSignal({ ...(ngDevMode ? { debugName: "fallbackImgFailed" } : /* istanbul ignore next */ {}), source: this.fallbackSrc, computation: () => false });
87
+ this.svgResource = httpResource.text(() => {
88
+ if (!this.isInlineSvg())
89
+ return undefined;
90
+ const url = this.localSrc();
91
+ return !url || SVG_CACHE.has(url) ? undefined : url;
92
+ }, /* @ts-ignore */
93
+ ...(ngDevMode ? [{ debugName: "svgResource" }] : /* istanbul ignore next */ []));
94
+ this.svgContent = computed(() => {
95
+ if (!this.isInlineSvg())
96
+ return null;
97
+ const url = this.localSrc();
98
+ if (!url)
99
+ return null;
100
+ const raw = SVG_CACHE.get(url) ?? (this.svgResource.hasValue() ? this.svgResource.value() : undefined);
101
+ return raw === undefined ? null : this.sanitizer.bypassSecurityTrustHtml(raw);
102
+ }, /* @ts-ignore */
103
+ ...(ngDevMode ? [{ debugName: "svgContent" }] : /* istanbul ignore next */ []));
104
+ this.primaryFailed = computed(() => this.isInlineSvg() ? this.svgResource.status() === 'error' : this.primaryImgFailed(), /* @ts-ignore */
105
+ ...(ngDevMode ? [{ debugName: "primaryFailed" }] : /* istanbul ignore next */ []));
106
+ this.showFallback = computed(() => this.primaryFailed() && !!this.fallbackSrc() && !this.fallbackImgFailed(), /* @ts-ignore */
107
+ ...(ngDevMode ? [{ debugName: "showFallback" }] : /* istanbul ignore next */ []));
108
+ this.showPlaceholder = computed(() => !this.primarySrc() || (this.primaryFailed() && (!this.fallbackSrc() || this.fallbackImgFailed())), /* @ts-ignore */
109
+ ...(ngDevMode ? [{ debugName: "showPlaceholder" }] : /* istanbul ignore next */ []));
110
+ this.displayedSrc = computed(() => (this.showFallback() ? this.fallbackSrc() : this.primarySrc()), /* @ts-ignore */
111
+ ...(ngDevMode ? [{ debugName: "displayedSrc" }] : /* istanbul ignore next */ []));
112
+ this.cssWidth = computed(() => this.width() != null ? `${this.width()}${this.widthUnit() || 'px'}` : null, /* @ts-ignore */
113
+ ...(ngDevMode ? [{ debugName: "cssWidth" }] : /* istanbul ignore next */ []));
114
+ this.cssHeight = computed(() => this.height() != null ? `${this.height()}${this.heightUnit() || 'px'}` : null, /* @ts-ignore */
115
+ ...(ngDevMode ? [{ debugName: "cssHeight" }] : /* istanbul ignore next */ []));
116
+ // Side effect only: populate the module-level SVG cache once a fetch resolves.
117
+ effect(() => {
118
+ if (!this.isInlineSvg())
119
+ return;
120
+ const url = this.localSrc();
121
+ if (url && this.svgResource.hasValue())
122
+ SVG_CACHE.set(url, this.svgResource.value());
123
+ });
124
+ if (isDevMode()) {
125
+ effect(() => {
126
+ if (this.src() && this.name()) {
127
+ console.warn('[ui-image] `src` and `name` are both set — `src` takes precedence.');
128
+ }
129
+ if (!this.src() && !this.name()) {
130
+ console.warn('[ui-image] Neither `src` nor `name` is set — the placeholder is displayed.');
131
+ }
132
+ });
133
+ }
134
+ }
135
+ onImgError() {
136
+ const failed = this.displayedSrc();
137
+ if (this.showFallback())
138
+ this.fallbackImgFailed.set(true);
139
+ else
140
+ this.primaryImgFailed.set(true);
141
+ if (failed)
142
+ this.loadFailed.emit(failed);
143
+ }
144
+ resolveLocal(filename) {
145
+ if (!filename)
146
+ return '';
147
+ const mode = this.themeService.currentMode();
148
+ const brand = this.brandService.currentBrand();
149
+ const fileEntry = this.assetsMap[filename];
150
+ if (!fileEntry)
151
+ return '';
152
+ if (fileEntry[brand]) {
153
+ const path = this.resolvePath(brand, fileEntry[brand], mode, filename);
154
+ if (path)
155
+ return path;
156
+ }
157
+ if (fileEntry['common']) {
158
+ return this.buildPath('common', fileEntry['common'], mode, filename);
159
+ }
160
+ return '';
161
+ }
162
+ resolvePath(themeFolder, variants, currentMode, filename) {
163
+ if (variants[currentMode]) {
164
+ const type = variants[currentMode];
165
+ return `assets/img/${themeFolder}/${type}/${currentMode}/${filename}`;
166
+ }
167
+ if (variants.base) {
168
+ const type = variants.base;
169
+ return `assets/img/${themeFolder}/${type}/${filename}`;
170
+ }
171
+ return null;
172
+ }
173
+ buildPath(themeName, variants, currentMode, filename) {
174
+ if (variants[currentMode]) {
175
+ const type = variants[currentMode];
176
+ return `assets/img/${themeName}/${type}/${currentMode}/${filename}`;
177
+ }
178
+ if (variants.base) {
179
+ const type = variants.base;
180
+ return `assets/img/${themeName}/${type}/${filename}`;
181
+ }
182
+ return '';
183
+ }
184
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: UiImage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
185
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: UiImage, isStandalone: true, selector: "ui-image", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, fallback: { classPropertyName: "fallback", publicName: "fallback", isSignal: true, isRequired: false, transformFunction: null }, priority: { classPropertyName: "priority", publicName: "priority", isSignal: true, isRequired: false, transformFunction: null }, fill: { classPropertyName: "fill", publicName: "fill", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, widthUnit: { classPropertyName: "widthUnit", publicName: "widthUnit", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, heightUnit: { classPropertyName: "heightUnit", publicName: "heightUnit", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { loadFailed: "loadFailed" }, ngImport: i0, template: "@if (showPlaceholder()) {\n <div\n class=\"ui-image-placeholder\"\n [style.width]=\"cssWidth()\"\n [style.height]=\"cssHeight()\"\n [attr.role]=\"alt() ? 'img' : null\"\n [attr.aria-label]=\"alt() || null\"\n [attr.aria-hidden]=\"alt() ? null : true\"\n >\n <ui-icon name=\"image\" />\n </div>\n} @else if (isInlineSvg() && !primaryFailed()) {\n <div class=\"ui-image-svg\" [style.width]=\"cssWidth()\" [style.height]=\"cssHeight()\" [innerHTML]=\"svgContent()\"></div>\n} @else {\n <img\n class=\"ui-image\"\n [ngSrc]=\"displayedSrc()!\"\n [alt]=\"alt() || ''\"\n [width]=\"!fill() ? width() : null\"\n [height]=\"!fill() ? (height() ? height() : width()) : null\"\n [fill]=\"fill()\"\n [priority]=\"priority()\"\n (error)=\"onImgError()\"\n />\n}\n", styles: ["@charset \"UTF-8\";:host{display:flex;align-items:center;justify-content:center}.ui-image{object-fit:contain}.ui-image-svg{display:flex;width:100%}.ui-image-svg ::ng-deep svg{width:100%;height:100%}.ui-image-placeholder{display:flex;align-items:center;justify-content:center;min-width:var(--units-xl);min-height:var(--units-xl);border-radius:var(--radius-default);background:var(--global-background-muted);color:var(--global-text-muted)}\n"], dependencies: [{ kind: "directive", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "decoding", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "placeholder", "placeholderConfig", "src", "srcset"] }, { kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }] }); }
186
+ }
187
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: UiImage, decorators: [{
188
+ type: Component,
189
+ args: [{ selector: 'ui-image', imports: [NgOptimizedImage, UiIcon], template: "@if (showPlaceholder()) {\n <div\n class=\"ui-image-placeholder\"\n [style.width]=\"cssWidth()\"\n [style.height]=\"cssHeight()\"\n [attr.role]=\"alt() ? 'img' : null\"\n [attr.aria-label]=\"alt() || null\"\n [attr.aria-hidden]=\"alt() ? null : true\"\n >\n <ui-icon name=\"image\" />\n </div>\n} @else if (isInlineSvg() && !primaryFailed()) {\n <div class=\"ui-image-svg\" [style.width]=\"cssWidth()\" [style.height]=\"cssHeight()\" [innerHTML]=\"svgContent()\"></div>\n} @else {\n <img\n class=\"ui-image\"\n [ngSrc]=\"displayedSrc()!\"\n [alt]=\"alt() || ''\"\n [width]=\"!fill() ? width() : null\"\n [height]=\"!fill() ? (height() ? height() : width()) : null\"\n [fill]=\"fill()\"\n [priority]=\"priority()\"\n (error)=\"onImgError()\"\n />\n}\n", styles: ["@charset \"UTF-8\";:host{display:flex;align-items:center;justify-content:center}.ui-image{object-fit:contain}.ui-image-svg{display:flex;width:100%}.ui-image-svg ::ng-deep svg{width:100%;height:100%}.ui-image-placeholder{display:flex;align-items:center;justify-content:center;min-width:var(--units-xl);min-height:var(--units-xl);border-radius:var(--radius-default);background:var(--global-background-muted);color:var(--global-text-muted)}\n"] }]
190
+ }], ctorParameters: () => [], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], fallback: [{ type: i0.Input, args: [{ isSignal: true, alias: "fallback", required: false }] }], priority: [{ type: i0.Input, args: [{ isSignal: true, alias: "priority", required: false }] }], fill: [{ type: i0.Input, args: [{ isSignal: true, alias: "fill", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], widthUnit: [{ type: i0.Input, args: [{ isSignal: true, alias: "widthUnit", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], heightUnit: [{ type: i0.Input, args: [{ isSignal: true, alias: "heightUnit", required: false }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], loadFailed: [{ type: i0.Output, args: ["loadFailed"] }] } });
191
+
192
+ /*
193
+ * Public API Surface of ui-kit/ui-image
194
+ */
195
+
196
+ /**
197
+ * Generated bundle index. Do not edit.
198
+ */
199
+
200
+ export { UI_IMAGE_ASSETS, UiImage, provideUiImageAssets };
201
+ //# sourceMappingURL=4sh-ui-kit-ui-image.mjs.map