@antcde/component-library 0.1.25-rc.9 → 0.1.26-rc.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 (190) hide show
  1. package/README.md +2 -1
  2. package/dist/build/uno.js +40 -1
  3. package/dist/build/uno.safelist.d.ts +10 -0
  4. package/dist/build/uno.safelist.js +52 -0
  5. package/dist/build/uno.shortcuts.d.ts +27 -0
  6. package/dist/build/uno.shortcuts.js +209 -0
  7. package/dist/index.js +10695 -9459
  8. package/dist/test/vitest.js +3 -0
  9. package/dist/types/{src/components → components}/AntTourZone/_TourInfoCard.vue.d.ts +3 -2
  10. package/dist/types/components/AntTourZone/_TourRing.vue.d.ts +16 -0
  11. package/dist/types/{src/components → components}/AntTourZone/index.vue.d.ts +8 -16
  12. package/dist/types/components/BaseAntButton.vue.d.ts +9 -0
  13. package/dist/types/components/BaseAntCard.vue.d.ts +28 -0
  14. package/dist/types/components/BaseAntCreateCard.vue.d.ts +7 -0
  15. package/dist/types/{src/components → components}/BaseAntDatePicker.vue.d.ts +3 -2
  16. package/dist/types/components/BaseAntInput.types.d.ts +111 -0
  17. package/dist/types/components/BaseAntInput.vue.d.ts +44 -0
  18. package/dist/types/components/BaseAntLoading.vue.d.ts +3 -0
  19. package/dist/types/{src/components → components}/BaseAppCard/_BaseAppCardHint.vue.d.ts +2 -1
  20. package/dist/types/components/BaseAppCard/_BaseAppCardMedia.vue.d.ts +23 -0
  21. package/dist/types/components/BaseAppCard/_BaseAppCardTitle.vue.d.ts +6 -0
  22. package/dist/types/{src/components → components}/BaseAppCard/_BaseAppCardToolbar.vue.d.ts +3 -2
  23. package/dist/types/components/BaseAppCard/_BaseAppCardUpdate.vue.d.ts +9 -0
  24. package/dist/types/{src/components → components}/BaseAppCard/index.vue.d.ts +9 -13
  25. package/dist/types/components/BaseAppCardSkeleton.vue.d.ts +14 -0
  26. package/dist/types/{src/components → components}/BaseClickableIcon.vue.d.ts +2 -1
  27. package/dist/types/{src/components → components}/BaseConfirmDialog.vue.d.ts +7 -11
  28. package/dist/types/components/BaseDeleteDialog.vue.d.ts +43 -0
  29. package/dist/types/{src/components → components}/BaseDialog.vue.d.ts +7 -11
  30. package/dist/types/{src/components → components}/BaseLimitedButton.vue.d.ts +8 -12
  31. package/dist/types/{src/components → components}/BaseResizePanel.vue.d.ts +16 -19
  32. package/dist/types/{src/components → components}/BulkLabelsMenu.vue.d.ts +10 -14
  33. package/dist/types/{src/components → components}/DmsFilePicker/index.vue.d.ts +6 -7
  34. package/dist/types/{src/components → components}/FilePreviewContent/_PreviewDetails.vue.d.ts +3 -2
  35. package/dist/types/{src/components → components}/FilePreviewContent/_PreviewMeta.vue.d.ts +2 -1
  36. package/dist/types/{src/components → components}/FilePreviewContent/_PreviewUsages.vue.d.ts +2 -1
  37. package/dist/types/{src/components → components}/FilePreviewContent/index.vue.d.ts +11 -15
  38. package/dist/types/components/FilePreviewWindow/index.vue.d.ts +40 -0
  39. package/dist/types/components/FlowWindow/index.vue.d.ts +28 -0
  40. package/dist/types/components/FlowWindowContent/index.vue.d.ts +26 -0
  41. package/dist/types/components/GlobalLabelBadge.vue.d.ts +12 -0
  42. package/dist/types/{src/components → components}/RBAC/Permissions/PermissionCard.vue.d.ts +2 -1
  43. package/dist/types/components/RBAC/Permissions/PermissionsGroups.vue.d.ts +14 -0
  44. package/dist/types/{src/components → components}/RichTextEditor/_MentionPanel.vue.d.ts +3 -2
  45. package/dist/types/components/RichTextEditor/_Toolbar.vue.d.ts +7 -0
  46. package/dist/types/{src/components → components}/RichTextEditor/index.vue.d.ts +6 -6
  47. package/dist/types/{src/components → components}/StackedLabels/_LabelsMenuCard.vue.d.ts +3 -2
  48. package/dist/types/{src/components → components}/StackedLabels/index.vue.d.ts +3 -2
  49. package/dist/types/{src/components → components}/TasksFlow/components/_FlowBreadcrumb.vue.d.ts +2 -1
  50. package/dist/types/components/TasksFlow/components/_FlowEdgeConditionBooleanMode.vue.d.ts +10 -0
  51. package/dist/types/components/TasksFlow/components/_FlowEdgeConditionForm.vue.d.ts +27 -0
  52. package/dist/types/components/TasksFlow/components/_FlowEdgeConditionRow.vue.d.ts +13 -0
  53. package/dist/types/components/TasksFlow/components/_FlowEdgeConditionsDialog.vue.d.ts +14 -0
  54. package/dist/types/{src/components → components}/TasksFlow/components/_FlowEdgeDeleteDialog.vue.d.ts +4 -3
  55. package/dist/types/{src/components → components}/TasksFlow/components/_FlowEdgeLagMenu.vue.d.ts +5 -3
  56. package/dist/types/{src/components → components}/TasksFlow/components/_FlowLifecycleBar.vue.d.ts +3 -2
  57. package/dist/types/components/TasksFlow/components/_FlowSearch.vue.d.ts +6 -0
  58. package/dist/types/components/TasksFlow/components/_FlowStats.vue.d.ts +6 -0
  59. package/dist/types/{src/components → components}/TasksFlow/components/_FlowStructureTree.vue.d.ts +6 -6
  60. package/dist/types/{src/components → components}/TasksFlow/components/_FlowToolbar.vue.d.ts +3 -2
  61. package/dist/types/{src/components → components}/TasksFlow/components/_FlowTriggerMenu.vue.d.ts +2 -1
  62. package/dist/types/{src/components → components}/TasksFlow/components/_FlowVersionBar.vue.d.ts +2 -1
  63. package/dist/types/{src/components → components}/TasksFlow/components/_InsertTemplateDialog.vue.d.ts +7 -5
  64. package/dist/types/{src/components → components}/TasksFlow/components/_SubflowPanel.vue.d.ts +3 -2
  65. package/dist/types/{src/components → components}/TasksFlow/components/_VersionDiffView.vue.d.ts +5 -3
  66. package/dist/types/{src/components → components}/TasksFlow/components/_VersionPublishDialog.vue.d.ts +5 -3
  67. package/dist/types/components/TasksFlow/components/_dropzoneBackground.vue.d.ts +13 -0
  68. package/dist/types/components/TasksFlow/components/_flowEdge.vue.d.ts +7 -0
  69. package/dist/types/{src/components → components}/TasksFlow/components/_flowEditor.vue.d.ts +3 -2
  70. package/dist/types/components/TasksFlow/components/nodes/_DurationEditor.vue.d.ts +30 -0
  71. package/dist/types/{src/components → components}/TasksFlow/components/nodes/_NodeContextMenu.vue.d.ts +5 -3
  72. package/dist/types/components/TasksFlow/components/nodes/_NodeMeta.vue.d.ts +15 -0
  73. package/dist/types/components/TasksFlow/components/nodes/_UserPicker.vue.d.ts +29 -0
  74. package/dist/types/{src/components → components}/TasksFlow/components/nodes/_endpointNode.vue.d.ts +2 -1
  75. package/dist/types/components/TasksFlow/components/nodes/_swimlaneNode.vue.d.ts +7 -0
  76. package/dist/types/{src/components → components}/TasksFlow/components/nodes/_taskNode.vue.d.ts +2 -1
  77. package/dist/types/{src/components → components}/TasksFlow/components/nodes/_triggerNode.vue.d.ts +2 -1
  78. package/dist/types/components/TasksFlow/composables/__tests__/useTaskFlowDragDrop.spec.d.ts +1 -0
  79. package/dist/types/components/TasksFlow/composables/useEdgeConditionTables.d.ts +228 -0
  80. package/dist/types/components/TasksFlow/composables/useFlowEdgeConditionState.d.ts +21 -0
  81. package/dist/types/{src/components → components}/TasksFlow/composables/useTaskFlow.d.ts +3 -3
  82. package/dist/types/{src/components → components}/TasksFlow/composables/useTaskFlowEdgeConditions.d.ts +2 -2
  83. package/dist/types/{src/components → components}/TasksFlow/composables/useTaskFlowEdges.d.ts +3 -3
  84. package/dist/types/{src/components → components}/TasksFlow/index.vue.d.ts +3 -2
  85. package/dist/types/components/TasksFlow/utils/conditionOperators.d.ts +3 -0
  86. package/dist/types/{src/components → components}/UnifiedWindow/_WindowPresetMenu.vue.d.ts +2 -1
  87. package/dist/types/{src/components → components}/UnifiedWindow/_WindowTabs.vue.d.ts +2 -1
  88. package/dist/types/{src/components → components}/UnifiedWindow/index.vue.d.ts +12 -19
  89. package/dist/types/{src/components → components}/VersionPublishDialog.vue.d.ts +5 -3
  90. package/dist/types/components/_BaseAntInputField.vue.d.ts +33 -0
  91. package/dist/types/components/_BaseAntInputLabel.vue.d.ts +29 -0
  92. package/dist/types/components/form/AntActionMenu.vue.d.ts +30 -0
  93. package/dist/types/components/form/AntCheckboxCards.vue.d.ts +47 -0
  94. package/dist/types/components/form/AntDialogShell.vue.d.ts +66 -0
  95. package/dist/types/components/form/AntField.vue.d.ts +57 -0
  96. package/dist/types/components/form/AntFilterChips.types.d.ts +12 -0
  97. package/dist/types/components/form/AntFilterChips.vue.d.ts +31 -0
  98. package/dist/types/components/form/AntFilterSelect.types.d.ts +13 -0
  99. package/dist/types/components/form/AntFilterSelect.vue.d.ts +26 -0
  100. package/dist/types/components/form/AntHintBanner.vue.d.ts +36 -0
  101. package/dist/types/components/form/AntHintTip.vue.d.ts +24 -0
  102. package/dist/types/components/form/AntInput.vue.d.ts +98 -0
  103. package/dist/types/components/form/AntNumberField.vue.d.ts +32 -0
  104. package/dist/types/components/form/AntOptionPicker.types.d.ts +19 -0
  105. package/dist/types/components/form/AntOptionPicker.vue.d.ts +46 -0
  106. package/dist/types/components/form/AntPanelSection.vue.d.ts +34 -0
  107. package/dist/types/components/form/AntRadioCards.vue.d.ts +54 -0
  108. package/dist/types/components/form/AntSaveBar.vue.d.ts +70 -0
  109. package/dist/types/components/form/AntSearchField.vue.d.ts +32 -0
  110. package/dist/types/components/form/AntSectionCard.vue.d.ts +47 -0
  111. package/dist/types/components/form/AntSelect.vue.d.ts +79 -0
  112. package/dist/types/components/form/AntStatusPill.vue.d.ts +38 -0
  113. package/dist/types/components/form/AntToggle.vue.d.ts +30 -0
  114. package/dist/types/components/useResizePanel.d.ts +38 -0
  115. package/dist/types/index.d.ts +79 -0
  116. package/lib/PdfViewer/usePdfDocument.ts +49 -5
  117. package/lib/build/genSafelist.mjs +135 -0
  118. package/lib/build/qualifyIcon.ts +28 -0
  119. package/lib/build/uno.safelist.ts +52 -0
  120. package/lib/build/uno.shortcuts.ts +235 -0
  121. package/lib/build/uno.ts +41 -1
  122. package/lib/build/vuetify.ts +3 -1
  123. package/lib/test/mockVueRouter.ts +41 -1
  124. package/lib/test/vitest.ts +3 -0
  125. package/package.json +38 -35
  126. package/dist/types/src/components/AntTourZone/_TourRing.vue.d.ts +0 -15
  127. package/dist/types/src/components/BaseAntButton.vue.d.ts +0 -8
  128. package/dist/types/src/components/BaseAntCard.vue.d.ts +0 -30
  129. package/dist/types/src/components/BaseAntCreateCard.vue.d.ts +0 -6
  130. package/dist/types/src/components/BaseAntInput.vue.d.ts +0 -124
  131. package/dist/types/src/components/BaseAntLoading.vue.d.ts +0 -2
  132. package/dist/types/src/components/BaseAppCard/_BaseAppCardMedia.vue.d.ts +0 -27
  133. package/dist/types/src/components/BaseAppCard/_BaseAppCardTitle.vue.d.ts +0 -5
  134. package/dist/types/src/components/BaseAppCard/_BaseAppCardUpdate.vue.d.ts +0 -8
  135. package/dist/types/src/components/BaseAppCardSkeleton.vue.d.ts +0 -7
  136. package/dist/types/src/components/BaseDeleteDialog.vue.d.ts +0 -48
  137. package/dist/types/src/components/FlowWindowContent/index.vue.d.ts +0 -55
  138. package/dist/types/src/components/GlobalLabelBadge.vue.d.ts +0 -11
  139. package/dist/types/src/components/RichTextEditor/_Toolbar.vue.d.ts +0 -6
  140. package/dist/types/src/components/TasksFlow/components/_FlowEdgeConditionsDialog.vue.d.ts +0 -10
  141. package/dist/types/src/components/TasksFlow/components/_FlowSearch.vue.d.ts +0 -7
  142. package/dist/types/src/components/TasksFlow/components/_FlowStats.vue.d.ts +0 -5
  143. package/dist/types/src/components/TasksFlow/components/_dropzoneBackground.vue.d.ts +0 -17
  144. package/dist/types/src/components/TasksFlow/components/_flowEdge.vue.d.ts +0 -9
  145. package/dist/types/src/components/TasksFlow/components/nodes/_DurationEditor.vue.d.ts +0 -33
  146. package/dist/types/src/components/TasksFlow/components/nodes/_NodeMeta.vue.d.ts +0 -14
  147. package/dist/types/src/components/TasksFlow/components/nodes/_UserPicker.vue.d.ts +0 -32
  148. package/dist/types/src/components/TasksFlow/components/nodes/_swimlaneNode.vue.d.ts +0 -6
  149. package/dist/types/src/components/_BaseAntInputLabel.vue.d.ts +0 -27
  150. package/dist/types/src/index.d.ts +0 -39
  151. /package/dist/types/{src/components → components}/DmsFilePicker/composables/usePickerNavigation.d.ts +0 -0
  152. /package/dist/types/{src/components → components}/DmsFilePicker/composables/usePickerUpload.d.ts +0 -0
  153. /package/dist/types/{src/components → components}/DmsFilePicker/utils/fileFormatting.d.ts +0 -0
  154. /package/dist/types/{src/components → components}/FilePreviewContent/fileFormat.d.ts +0 -0
  155. /package/dist/types/{src/components → components}/FilePreviewContent/types.d.ts +0 -0
  156. /package/dist/types/{src/components → components}/FilePreviewContent/usePreviewDetails.d.ts +0 -0
  157. /package/dist/types/{src/components → components}/RichTextEditor/_useInlineEdit.d.ts +0 -0
  158. /package/dist/types/{src/components → components}/RichTextEditor/_useMentionPicker.d.ts +0 -0
  159. /package/dist/types/{src/components → components}/TasksFlow/components/nodes/useTaskNodeState.d.ts +0 -0
  160. /package/dist/types/{src/components → components}/TasksFlow/composables/_layoutEngine.d.ts +0 -0
  161. /package/dist/types/{src/components → components}/TasksFlow/composables/useAutoLayout.d.ts +0 -0
  162. /package/dist/types/{src/components → components}/TasksFlow/composables/useCriticalPath.d.ts +0 -0
  163. /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowAutoLayout.d.ts +0 -0
  164. /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowCache.d.ts +0 -0
  165. /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowCrud.d.ts +0 -0
  166. /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowDisplayElements.d.ts +0 -0
  167. /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowEditor.d.ts +0 -0
  168. /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowEndpoints.d.ts +0 -0
  169. /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowFetch.d.ts +0 -0
  170. /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowKeyboard.d.ts +0 -0
  171. /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowLifecycle.d.ts +0 -0
  172. /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowNotifications.d.ts +0 -0
  173. /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowOperations.d.ts +0 -0
  174. /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowRealtime.d.ts +0 -0
  175. /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowSearch.d.ts +0 -0
  176. /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowStructureTree.d.ts +0 -0
  177. /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowSubflows.d.ts +0 -0
  178. /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowToolbarDrag.d.ts +0 -0
  179. /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowUsers.d.ts +0 -0
  180. /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowViewport.d.ts +0 -0
  181. /package/dist/types/{src/components → components}/TasksFlow/composables/useSwimlaneLayout.d.ts +0 -0
  182. /package/dist/types/{src/components → components}/TasksFlow/composables/useTaskFlowDragDrop.d.ts +0 -0
  183. /package/dist/types/{src/components → components}/TasksFlow/composables/useTaskFlowMappers.d.ts +0 -0
  184. /package/dist/types/{src/components → components}/TasksFlow/composables/useTaskFlowTypes.d.ts +0 -0
  185. /package/dist/types/{src/components → components}/TasksFlow/composables/useTemplateVersioning.d.ts +0 -0
  186. /package/dist/types/{src/components → components}/TasksFlow/composables/useTemplateVersioningState.d.ts +0 -0
  187. /package/dist/types/{src/components → components}/TasksFlow/composables/useTriggerExecution.d.ts +0 -0
  188. /package/dist/types/{src/components → components}/UnifiedWindow/types.d.ts +0 -0
  189. /package/dist/types/{src/components → components}/UnifiedWindow/useNativeFullscreen.d.ts +0 -0
  190. /package/dist/types/{src/components → components}/UnifiedWindow/useWindowDrag.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import type { PDFDocumentProxy, PDFPageProxy, RenderTask } from 'pdfjs-dist'
1
+ import type { PDFDocumentLoadingTask, PDFDocumentProxy, PDFPageProxy, RenderTask } from 'pdfjs-dist'
2
2
  import type { Ref } from 'vue'
3
3
  // The worker is a static asset reference, not a module import — it costs a URL
4
4
  // string here and is fetched only once pdf.js actually starts. Resolving it in
@@ -43,6 +43,17 @@ export function usePdfDocument(source: Ref<string | null | undefined>) {
43
43
  const error = ref<PdfLoadError | null>(null)
44
44
 
45
45
  let renderTask: RenderTask | null = null
46
+ /**
47
+ * Teardown happens through the loading task, not the document.
48
+ *
49
+ * pdf.js 6 removed `PDFDocumentProxy.destroy()`, which was only ever
50
+ * `return this.loadingTask.destroy()` — so this is the same call one level up,
51
+ * not a change of behaviour. Optional chaining does not save the old form:
52
+ * `doc.value?.destroy()` guards the document being null, not the method being
53
+ * gone, so on v6 it threw a TypeError out of an un-awaited path and left the
54
+ * viewer on a spinner from the second document onwards.
55
+ */
56
+ let loadingTask: PDFDocumentLoadingTask | null = null
46
57
  /** Guards against a slow load resolving after the source has moved on. */
47
58
  let loadToken = 0
48
59
 
@@ -53,10 +64,34 @@ export function usePdfDocument(source: Ref<string | null | undefined>) {
53
64
 
54
65
  async function destroyDoc() {
55
66
  cancelRender()
56
- const current = doc.value
67
+ const task = loadingTask
68
+ loadingTask = null
57
69
  doc.value = null
58
70
  page.value = null
59
- await current?.destroy().catch(() => { /* teardown is best-effort */ })
71
+ await task?.destroy().catch(() => { /* teardown is best-effort */ })
72
+ }
73
+
74
+ /**
75
+ * The source went empty, so nothing should end up on screen.
76
+ *
77
+ * Bumping `loadToken` is the whole point and is not optional: it is the only
78
+ * thing that stops a load still inside `await loadPdfJs()` from carrying on
79
+ * to fetch a URL that is no longer selected. Tearing down alone did not do
80
+ * it — at that moment `loadingTask` has not been assigned yet, so there is
81
+ * nothing to destroy, and the pending load went on to commit a document over
82
+ * an empty source. `onBeforeUnmount` has always bumped the token for exactly
83
+ * this reason; this path simply did not.
84
+ *
85
+ * The increment cannot live in destroyDoc(): `load()` calls that immediately
86
+ * after taking its own token, so incrementing there would invalidate every
87
+ * load the moment it started.
88
+ */
89
+ async function clear() {
90
+ loadToken++
91
+ isLoading.value = false
92
+ // An empty viewer must not keep the previous document's failure on screen.
93
+ error.value = null
94
+ await destroyDoc()
60
95
  }
61
96
 
62
97
  async function load(url: string) {
@@ -67,14 +102,23 @@ export function usePdfDocument(source: Ref<string | null | undefined>) {
67
102
 
68
103
  try {
69
104
  const pdfjs = await loadPdfJs()
105
+ // Checked before getDocument, not after: the first load pays a dynamic
106
+ // import for a ~500 kB chunk, which is a wide enough window for the
107
+ // source to change underneath. Re-checking here means a superseded load
108
+ // never opens a request, rather than opening one and discarding it.
109
+ if (token !== loadToken)
110
+ return
70
111
  // Range and streaming are switched off on purpose. The DMS stream endpoint
71
112
  // is a Laravel StreamedResponse, which does not serve HTTP 206 — leaving
72
113
  // partial loading on means pdf.js probes for it on every document and then
73
114
  // has to unwind. One plain GET is both faster here and predictable.
74
115
  const task = pdfjs.getDocument({ url, disableRange: true, disableStream: true })
116
+ loadingTask = task
75
117
  const loaded = await task.promise
76
118
  if (token !== loadToken) {
77
- await loaded.destroy().catch(() => {})
119
+ await task.destroy().catch(() => {})
120
+ if (loadingTask === task)
121
+ loadingTask = null
78
122
  return
79
123
  }
80
124
  doc.value = loaded
@@ -169,7 +213,7 @@ export function usePdfDocument(source: Ref<string | null | undefined>) {
169
213
  if (url)
170
214
  void load(url)
171
215
  else
172
- void destroyDoc()
216
+ void clear()
173
217
  }, { immediate: true })
174
218
 
175
219
  onBeforeUnmount(() => {
@@ -0,0 +1,135 @@
1
+ /**
2
+ * Generate the safelist of every utility class this library's own components use.
3
+ *
4
+ * ⚠️ WHY THIS EXISTS. UnoCSS's Vite plugin extracts class names only from files its
5
+ * pipeline includes — `.vue`, `.svelte`, `.jsx/.tsx`, `.md`, `.html`. A consuming
6
+ * app therefore never sees the classes written INSIDE this library, because by the
7
+ * time the app builds they live only in `dist/index.js`. The class is defined, the
8
+ * rule is never emitted, and there is NO build error: the element just renders
9
+ * naked. That is how `ant-cta` shipped invisible to the triggers app and how
10
+ * `ant-save-bar` broke the store's own save bar.
11
+ *
12
+ * A safelist fixes the whole class of failure rather than one instance, and it must
13
+ * be GENERATED rather than hand-kept: hand-listing the shortcut names covers only 9
14
+ * of the 57 classes actually at risk, leaving focus rings, transitions and toggle
15
+ * geometry silently missing.
16
+ *
17
+ * ⚠️ UNO IS THE ORACLE, not a regex. Candidates are scraped from templates and then
18
+ * run through the real generator; only those that actually produce a rule survive.
19
+ * That keeps prop names, computed identifiers and truncated fragments out of the
20
+ * list without maintaining a denylist that would rot.
21
+ *
22
+ * ⚠️ RUNS AS THE FIRST STEP OF `pnpm build`, so the list cannot go stale. An
23
+ * unenforced safelist is the same failure mode as the bug it replaces: correct today,
24
+ * silently wrong later, with nothing to tell you. `vite-node` is a devDependency for
25
+ * exactly this (the script imports the TypeScript factory).
26
+ *
27
+ * The committed output is what a consuming app compiles against, so it is checked in
28
+ * rather than generated at the consumer's build time.
29
+ */
30
+ import { readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs'
31
+ import { join } from 'node:path'
32
+ import { createGenerator } from 'unocss'
33
+ import { createAntUnoConfig } from './uno.ts'
34
+
35
+ const SRC = new URL('../../src', import.meta.url).pathname
36
+
37
+ function vueFiles(dir) {
38
+ return readdirSync(dir).flatMap((entry) => {
39
+ const p = join(dir, entry)
40
+ return statSync(p).isDirectory() ? vueFiles(p) : p.endsWith('.vue') ? [p] : []
41
+ })
42
+ }
43
+
44
+ /**
45
+ * Split a class attribute's value into candidate tokens.
46
+ *
47
+ * ⚠️ BRACKET-AWARE ON PURPOSE. The previous `split(/[\s'`[\]{}(),:?]+/)` cut on
48
+ * `[`, `]`, `:` and `.`-free assumptions, so every arbitrary value (`h-[22px]`,
49
+ * `w-[38px]`, `font-[inherit]`) and every variant (`focus-visible:outline-2`,
50
+ * `hover:bg-ant-hover`) fell apart into fragments Uno does not recognise. They were
51
+ * dropped from the list, and AntToggle rendered at 0×0 in every consuming app while
52
+ * looking fine inside this library, where the source is scanned directly.
53
+ *
54
+ * Boundaries are whitespace, quotes, braces, parens, commas, `?` and Vue's array
55
+ * brackets — but not inside an arbitrary value, so `w-[calc(100vh-16px)]` survives
56
+ * intact. A `:` never splits:
57
+ * inside a token it is a variant separator; the JS ternary and object-key colons are
58
+ * whitespace- or quote-adjacent and end up as empty or non-letter tokens, which the
59
+ * `/^[a-z]/` test below removes anyway.
60
+ */
61
+ function tokenize(value) {
62
+ const out = []
63
+ let cur = ''
64
+ let depth = 0
65
+ for (const ch of value) {
66
+ // A bracket ATTACHED to a token opens an arbitrary value (`w-[38px]`); one at a
67
+ // token boundary is Vue's array syntax (`:class="[cond && 'x']"`) and splits.
68
+ if (ch === '[' && (cur || depth > 0)) {
69
+ depth++
70
+ cur += ch
71
+ continue
72
+ }
73
+ if (ch === ']' && depth > 0) {
74
+ depth--
75
+ cur += ch
76
+ continue
77
+ }
78
+ if (depth === 0 && /[\s'"`{}(),?[\]]/.test(ch)) {
79
+ if (cur)
80
+ out.push(cur)
81
+ cur = ''
82
+ continue
83
+ }
84
+ cur += ch
85
+ }
86
+ if (cur)
87
+ out.push(cur)
88
+ return out
89
+ }
90
+
91
+ const candidates = new Set()
92
+ for (const f of vueFiles(SRC)) {
93
+ const src = readFileSync(f, 'utf8')
94
+ for (const m of src.matchAll(/(?:class|:class)\s*=\s*"([^"]*)"/g)) {
95
+ for (const tok of tokenize(m[1])) {
96
+ const t = tok.replace(/^!/, '')
97
+ // ⚠️ A DOT IS NOT A DISQUALIFIER. This used to drop every token containing
98
+ // one, which silently excluded every fractional utility — `h-1.5`, `w-1.5`,
99
+ // `mt-0.5`, `gap-1.5`. Those only reach a consuming app through this list, so
100
+ // any that appear ONLY in a library component were never emitted and the
101
+ // element rendered without them. Uno's own `matched` set below is already the
102
+ // filter that keeps prop names out; this test was doing damage the oracle
103
+ // does not need.
104
+ if (t && /^[a-z]/.test(t))
105
+ candidates.add(t)
106
+ }
107
+ }
108
+ }
109
+
110
+ const uno = await createGenerator(createAntUnoConfig())
111
+
112
+ // `matched` is the generator's own report of which tokens it recognised. Testing
113
+ // `css.trim()` instead is wrong — the result carries @layer boilerplate even when
114
+ // nothing matched, so every candidate "passes" and prop names end up in the list.
115
+ const { matched } = await uno.generate([...candidates].join(' '), { preflights: false })
116
+ const keep = [...candidates].filter(c => matched.has(c)).sort()
117
+
118
+ const packed = []
119
+ for (let i = 0; i < keep.length; i += 6)
120
+ packed.push(' ' + keep.slice(i, i + 6).map(c => `'${c}'`).join(', ') + ',')
121
+
122
+ writeFileSync(new URL('./uno.safelist.ts', import.meta.url), `/**
123
+ * GENERATED by lib/build/genSafelist.mjs — do not edit by hand.
124
+ *
125
+ * Every utility class this library's own components use, so a consuming app emits
126
+ * them even though UnoCSS never scans \`dist/index.js\`. See the generator for why.
127
+ *
128
+ * ${keep.length} classes, from ${candidates.size} candidates, filtered by asking Uno
129
+ * which ones actually resolve.
130
+ */
131
+ export const libraryClassSafelist: string[] = [
132
+ ${packed.join('\n')}
133
+ ]
134
+ `)
135
+ console.log(`safelist: ${keep.length} classes kept of ${candidates.size} candidates`)
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Give Iconify the COLLECTION it needs, because Vuetify has already taken it away.
3
+ *
4
+ * ⚠️ **VUETIFY STRIPS THE SET PREFIX BEFORE CALLING A SET'S COMPONENT.** `<v-icon
5
+ * icon="mdi-table" />` matches the registered set named `mdi` and this adapter is
6
+ * handed `table` — not `mdi-table`. Passing that straight to `<Icon>` gives Iconify
7
+ * a name with no collection, and Iconify then falls back to reading everything
8
+ * before the FIRST HYPHEN as the collection. So:
9
+ *
10
+ * | Vuetify prop | adapter receives | Iconify looked up |
11
+ * | ----------------------- | --------------------- | ---------------------------- |
12
+ * | `mdi-table` | `table` | nothing — no collection |
13
+ * | `mdi-file-delimited-outline` | `file-delimited-outline` | `file:delimited-outline` — 404 |
14
+ *
15
+ * That is why single-word icons rendered nothing and hyphenated ones fetched a
16
+ * nonexistent collection. Every icon in every app on this factory was affected, and
17
+ * nothing errored — the request 200s with an empty icon set.
18
+ *
19
+ * Defensive on both ends: a value that already names a collection is passed
20
+ * through, and a stray `mdi-` that survived is stripped rather than doubled.
21
+ */
22
+ export function qualifyIcon(raw: string): string {
23
+ if (!raw)
24
+ return ''
25
+ if (raw.includes(':'))
26
+ return raw
27
+ return `mdi:${raw.startsWith('mdi-') ? raw.slice(4) : raw}`
28
+ }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * GENERATED by lib/build/genSafelist.mjs — do not edit by hand.
3
+ *
4
+ * Every utility class this library's own components use, so a consuming app emits
5
+ * them even though UnoCSS never scans `dist/index.js`. See the generator for why.
6
+ *
7
+ * 244 classes, from 947 candidates, filtered by asking Uno
8
+ * which ones actually resolve.
9
+ */
10
+ export const libraryClassSafelist: string[] = [
11
+ 'absolute', 'align-middle', 'align-start', 'ant-check', 'ant-check--on', 'ant-field-label',
12
+ 'ant-hint-banner', 'ant-icon-button', 'ant-option-row', 'ant-option-row--on', 'ant-pill', 'ant-pill--sm',
13
+ 'ant-pill-input', 'ant-pill-input--button', 'ant-pill-menu', 'ant-pill-menu__item', 'ant-pill-menu__item--active', 'ant-radio',
14
+ 'ant-radio--on', 'ant-radio__dot', 'ant-save-bar', 'ant-section__header', 'basis-full', 'bg-ant-inset',
15
+ 'bg-ant-panel', 'bg-ant-surface', 'bg-error', 'bg-primary', 'bg-primary/4', 'bg-primary/5',
16
+ 'bg-success', 'bg-transparent', 'bg-warning', 'bg-white', 'bg-white/12', 'block',
17
+ 'border', 'border-0', 'border-2', 'border-ant', 'border-b', 'border-error',
18
+ 'border-none', 'border-opacity-50', 'border-primary', 'border-t', 'border-white/20', 'bottom-0',
19
+ 'capitalize', 'cursor-help', 'cursor-not-allowed', 'cursor-pointer', 'disabled:cursor-not-allowed', 'disabled:hover:bg-transparent',
20
+ 'disabled:opacity-50', 'duration-150', 'duration-200', 'ease-in', 'ease-out', 'flex',
21
+ 'flex-1', 'flex-col', 'flex-grow-1', 'flex-shrink-0', 'flex-wrap', 'focus-visible:border-primary',
22
+ 'focus-visible:opacity-100', 'focus-visible:outline-2', 'focus-visible:outline-offset-2', 'focus-visible:outline-primary', 'focus-within:border-primary', 'focus:border-error',
23
+ 'focus:border-primary', 'focus:outline-none', 'focus:ring-error/10', 'focus:ring-primary/10', 'font-[inherit]', 'font-medium',
24
+ 'font-mono', 'font-normal', 'font-semibold', 'gap-0.5', 'gap-1', 'gap-1.5',
25
+ 'gap-2', 'gap-3', 'gap-8', 'gap-[5px]', 'gap-[6px]', 'grid',
26
+ 'h-11', 'h-2', 'h-4', 'h-7', 'h-8', 'h-[18px]',
27
+ 'h-[22px]', 'h-full', 'hover:bg-ant-hover', 'hover:bg-primary/6', 'hover:bg-primary/8', 'hover:bg-white/10',
28
+ 'hover:opacity-100', 'inline-block', 'inline-flex', 'items-center', 'items-start', 'justify-between',
29
+ 'justify-center', 'justify-end', 'justify-start', 'leading-none', 'leading-relaxed', 'leading-snug',
30
+ 'leading-tight', 'left-0.5', 'lg:flex-initial', 'lg:min-w-[220px]', 'm-0', 'max-h-[88vh]',
31
+ 'max-w-[180px]', 'max-w-[240px]', 'mb-1', 'mb-2', 'mb-2.5', 'mb-3',
32
+ 'mb-4', 'md:basis-auto', 'md:flex-1', 'md:max-w-[420px]', 'md:min-w-[260px]', 'min-w-0',
33
+ 'min-w-[168px]', 'min-w-[180px]', 'min-w-[200px]', 'ml-1', 'ml-2', 'mr-1',
34
+ 'mr-2', 'ms-auto', 'mt-0.5', 'mt-1', 'mt-2', 'mt-3',
35
+ 'mt-px', 'my-1', 'opacity-0', 'opacity-20', 'opacity-30', 'opacity-40',
36
+ 'opacity-50', 'opacity-55', 'opacity-60', 'opacity-70', 'outline-none', 'overflow-hidden',
37
+ 'overflow-y-auto', 'p-0', 'p-3.5', 'pa-2', 'pa-3', 'pb-0',
38
+ 'pb-1', 'pb-2', 'pb-5', 'pl-1', 'pointer-events-none', 'position-relative',
39
+ 'pr-1', 'pr-1.5', 'pt-1', 'pt-2', 'pt-3', 'pt-5',
40
+ 'px-0', 'px-15', 'px-2', 'px-3', 'px-3.5', 'px-4',
41
+ 'px-5', 'px-5.5', 'py-0', 'py-1', 'py-2', 'py-2.5',
42
+ 'py-3', 'py-4', 'py-5', 'py-6', 'relative', 'resize-y',
43
+ 'right-0', 'rounded', 'rounded-2xl', 'rounded-[12px]', 'rounded-[20px]', 'rounded-full',
44
+ 'rounded-xl', 'shadow', 'shadow-sm', 'shrink-0', 'tabular-nums', 'text-[10px]',
45
+ 'text-[11.5px]', 'text-[11px]', 'text-[12.5px]', 'text-[13.5px]', 'text-[13px]', 'text-black',
46
+ 'text-body', 'text-center', 'text-error', 'text-heading', 'text-left', 'text-lg',
47
+ 'text-muted', 'text-primary', 'text-sm', 'text-truncate', 'text-warning', 'text-white',
48
+ 'text-white/45', 'text-wrap', 'text-xs', 'top-0.5', 'tracking-[0.16em]', 'transition-[border-color]',
49
+ 'transition-all', 'transition-colors', 'transition-opacity', 'transition-transform', 'translate-x-0', 'translate-x-4',
50
+ 'translate-y-4', 'truncate', 'uppercase', 'w-2', 'w-4', 'w-[18px]',
51
+ 'w-[38px]', 'w-full', 'whitespace-normal', 'whitespace-nowrap',
52
+ ]
@@ -0,0 +1,235 @@
1
+ /**
2
+ * The ANT semantic class vocabulary.
3
+ *
4
+ * Its own module because `uno.ts` outgrew the 250-line cap once the documented
5
+ * classes from the design system's `tokens/utilities.css` were added in AAD-980 —
6
+ * and because this list is the thing people come here to read or extend, while the
7
+ * presets and breakpoints around it change roughly never.
8
+ *
9
+ * ⚠️ A MISSING SHORTCUT FAILS SILENTLY. No rule is emitted, no error is raised, and
10
+ * the element renders naked. That is how `ant-cta` and three of its variants shipped
11
+ * to an app that could not see them: they were defined only in ant-os's own
12
+ * `uno.storefront.ts`, which no other app's Uno config loads. Anything used outside
13
+ * ant-os belongs HERE, and the way to prove it works is to generate CSS from the
14
+ * consuming app's own `uno.config.ts` — never to assume.
15
+ *
16
+ * ⚠️ COPY EXACT VALUES from the design system. It has TWO radius scales: Vuetify
17
+ * components keep their configured defaults (`v-card` 24px, form fields 8px), while
18
+ * bespoke chrome is smaller and more varied — section card 16, app card 18, inner
19
+ * card and pill input 12, option row and tab tray 10, sidebar row and CTA 8. The
20
+ * system says it outright: "Do NOT round 18px to 16px or 10px to 12px."
21
+ *
22
+ * ⚠️ **NEVER `rounded-xl` FOR THE 12px STEP.** `createAntUnoConfig` overrides
23
+ * `theme.radius.xl` to **24px**, so `rounded-xl` is the Vuetify card step, not the
24
+ * 12px one — a 44px-tall `ant-pill-input` written that way renders as a full
25
+ * stadium. Write the 12px step as `rounded-[12px]`.
26
+ */
27
+ export const antShortcuts: [string, string][] = [
28
+ // Pill input / trigger (44px) and its floating menu.
29
+ //
30
+ // Promoted from `uno.storefront.ts` in AAD-980: these are the geometry behind the
31
+ // store's hand-rolled select and search — a native button or input plus `v-menu`
32
+ // for anchoring only — which is the idiom the whole platform is standardising on.
33
+ // They have to live here before any component using them is shared, because a
34
+ // missing shortcut emits NO rule and NO error: the element simply renders naked.
35
+ ['ant-pill-input', 'h-11 px-3.5 flex items-center gap-3 rounded-[12px] bg-ant-surface border border-ant text-heading transition-colors'],
36
+ ['ant-pill-input--button', 'ant-pill-input w-full whitespace-nowrap cursor-pointer hover:bg-ant-hover'],
37
+
38
+ // The bare input that goes INSIDE `ant-pill-input`. The wrapper owns the border
39
+ // and the focus treatment, so the field itself must contribute no chrome at all —
40
+ // this is the second half of the design system's own worked example.
41
+ ['ant-bare-input', 'flex-1 min-w-0 w-full bg-transparent border-0 outline-none text-sm text-heading placeholder:text-muted'],
42
+ ['ant-pill-menu', 'flex flex-col gap-1 p-2 rounded-[12px] bg-ant-surface border-[0.5px] border-ant shadow-[0_8px_32px_rgba(0,0,0,0.12)]'],
43
+ ['ant-pill-menu__item', 'flex items-center gap-2 w-full px-3 py-2.5 rounded-[12px] bg-transparent border-0 text-heading text-sm text-left cursor-pointer hover:bg-ant-hover'],
44
+ ['ant-pill-menu__item--active', 'bg-primary/8 hover:bg-primary/12'],
45
+
46
+ // ── The documented ANT-OS semantic vocabulary, added in AAD-980 ─────────
47
+ //
48
+ // These class names are transcribed from the ANT-OS design system's own
49
+ // `tokens/utilities.css`, which describes itself as "the EXACT class names
50
+ // ANT-OS production writes, so markup copied out of the repo renders
51
+ // correctly". They existed in the system and in the design kit but NOWHERE in
52
+ // this repo, so every screen re-derived the geometry by eye off the store —
53
+ // and the store itself diverges from the system (its `SectionCard` is a 24px
54
+ // radius with a 16px/500 title; the system says 16px and 14px/600).
55
+ //
56
+ // ⚠️ COPY THE EXACT VALUES. The system is explicit: "Do NOT round 18px to 16px
57
+ // or 10px to 12px." There are two radius scales — Vuetify components keep
58
+ // their configured defaults (v-card 24px, v-field 8px), and bespoke chrome is
59
+ // smaller and more varied. `rounded-lg` on a CTA is correct at 8px; the same
60
+ // class on a bespoke text input is wrong, because those are 12px.
61
+ ['ant-section', 'rounded-2xl overflow-hidden bg-ant-surface border border-ant'],
62
+ ['ant-section__header', 'px-5 py-4 border-b border-ant'],
63
+ ['ant-section__row', 'px-5 py-3 flex items-center gap-3'],
64
+
65
+ // The bespoke select: a stack of full-width rows, each explaining itself.
66
+ // Reach for this instead of a dropdown whenever the choice carries a
67
+ // consequence — a dropdown hides exactly the copy the user needs. A selected
68
+ // row BORDERS AND WASHES at 5%; it is never a filled row (a filled pill means
69
+ // a selected filter chip, which is a different thing).
70
+ ['ant-option-row', 'px-3 py-2.5 text-left rounded-[10px] flex items-center gap-2.5 font-[inherit] cursor-pointer bg-ant-surface border border-ant transition-[border-color,background-color] duration-150 hover:bg-ant-hover'],
71
+ ['ant-option-row--on', '!border-primary bg-primary/5 hover:bg-primary/8'],
72
+
73
+ // Always-on guidance at the top of a complex section. The system's first form
74
+ // rule is that every one of them opens with one: "Titles alone don't teach."
75
+ ['ant-hint-banner', 'flex items-start gap-2 px-3.5 py-2.5 rounded-[12px] bg-primary/6 text-[12.5px] leading-[1.6] text-body'],
76
+
77
+ // Field label — ABOVE the control at 12px/600 in body tone, never Vuetify's
78
+ // floating outlined label.
79
+ ['ant-field-label', 'text-xs font-semibold inline-flex items-center gap-1 text-body'],
80
+
81
+ // Status token. TONAL ONLY — saturated text on a 10% wash of the same channel.
82
+ //
83
+ // ⚠️ There is no flat or outlined status variant in this system. A FILLED pill
84
+ // means a selected FILTER CHIP, which is a different thing; using one for status
85
+ // makes the two read as the same control.
86
+ ['ant-pill', 'inline-flex items-center gap-1.5 h-6 px-2.5 rounded-full text-xs font-semibold whitespace-nowrap'],
87
+ ['ant-pill--sm', 'h-5 px-2 gap-1 text-[11px]'],
88
+
89
+ // Floating commit bar — dark glass pill, bottom centre. One of only two places
90
+ // glassmorphism is used (the other is popover panels).
91
+ ['ant-save-bar', 'fixed bottom-5 left-1/2 -translate-x-1/2 z-60 flex items-center gap-3.5 py-2.5 pl-4.5 pr-3 rounded-full text-white bg-[rgba(20,20,20,0.94)] backdrop-blur-[20px] shadow-[0_8px_32px_rgba(0,0,0,0.22)]'],
92
+
93
+ // ── Buttons and chips, promoted in AAD-980 ──────────────────────────────
94
+ //
95
+ // ⚠️ PROMOTED BECAUSE THEY WERE ALREADY BEING USED OUTSIDE ant-os AND SILENTLY
96
+ // RENDERING NOTHING. `ant-cta` and its variants are the platform's hand-rolled
97
+ // button — the triggers app's own Cancel/Save row, its dialogs and its empty-state
98
+ // actions all reach for them — but they were defined only in
99
+ // `ant-os/src/utils/uno.storefront.ts`, which no other app's Uno config loads. A
100
+ // missing shortcut emits NO rule and NO error, so those buttons rendered as bare
101
+ // text and nothing failed. The comment on `ant-empty-icon` below even points at
102
+ // `ant-cta` while it lived somewhere unreachable.
103
+ //
104
+ // The whole `--*` family moves together on purpose: promoting three of four
105
+ // variants leaves the fourth as exactly the same trap for the next caller.
106
+ //
107
+ // ⚠️ The text colours are `!important` ON PURPOSE. These are used on both
108
+ // <button> and <a> (an action carrying `:to` renders an anchor), and something in
109
+ // the global cascade sets `color` on anchors with enough weight to beat a plain
110
+ // utility — verified in-browser: the same classes give white on <span>/<button>
111
+ // and rgba(0,0,0,0.87) on <a>, i.e. black on blue. Without the `!` the flat
112
+ // variant is unreadable everywhere it links.
113
+ ['ant-cta', 'h-[34px] px-3.5 inline-flex items-center gap-1.5 rounded-lg text-[14px] font-medium whitespace-nowrap cursor-pointer border-0 no-underline [font-family:inherit]'],
114
+ ['ant-cta--flat', 'bg-primary !text-white hover:brightness-[0.96]'],
115
+ ['ant-cta--outlined', 'bg-transparent !text-primary border border-[rgba(18,92,255,0.5)] hover:bg-[rgba(18,92,255,0.06)]'],
116
+ ['ant-cta--tonal', 'bg-[rgba(18,92,255,0.10)] !text-primary hover:bg-[rgba(18,92,255,0.14)]'],
117
+ ['ant-cta--ghost', 'bg-transparent !text-primary hover:bg-[rgba(18,92,255,0.08)]'],
118
+
119
+ // Neutral secondary button — same 34px geometry as a CTA, no colour claim.
120
+ ['ant-view-btn', 'h-[34px] px-3.5 inline-flex items-center gap-1.5 rounded-lg border border-ant bg-transparent text-heading text-[14px] font-medium whitespace-nowrap cursor-pointer hover:bg-ant-hover'],
121
+
122
+ // Full-width dashed "add another row" affordance for editable lists.
123
+ ['ant-install-another-btn', 'w-full mt-1.5 mb-1 h-[30px] bg-transparent border border-dashed border-ant text-muted [font-family:inherit] text-[12px] font-medium rounded-lg cursor-pointer inline-flex items-center justify-center gap-1 hover:bg-ant-hover'],
124
+
125
+ // Small metadata chip.
126
+ ['ant-cat-chip', 'h-[22px] px-2 inline-flex items-center rounded-md bg-ant-inset text-[11px] font-medium text-muted whitespace-nowrap cursor-pointer hover:bg-ant-hover'],
127
+
128
+ ['ant-icon-button', 'inline-flex items-center justify-center w-7 h-7 rounded-lg bg-transparent border-0 text-muted cursor-pointer hover:bg-ant-hover hover:text-body'],
129
+
130
+ // 64x64 icon container for empty states.
131
+ //
132
+ // ⚠️ Do NOT pair this with `v-btn color="primary" variant="flat"` carrying
133
+ // `:to`. A `v-btn` with `:to` renders an <a>, and on an anchor Vuetify's
134
+ // colour class does not set the text colour — it inherits the page's, giving
135
+ // BLACK TEXT ON BLUE. Verified in-browser: identical classes give
136
+ // rgb(255,255,255) on <button> and rgba(0,0,0,0.87) on <a>. Use a CTA class
137
+ // that states its own text colour (ant-os has `ant-cta ant-cta--flat`).
138
+ ['ant-empty-icon', 'w-16 h-16 inline-flex items-center justify-center rounded-2xl bg-ant-panel border border-ant text-muted'],
139
+
140
+ ['ant-info-box', 'text-[12px] px-3 py-2.5 border border-info/16 rounded-[10px] bg-info/6 flex gap-2 items-start text-body'],
141
+ ['ant-warning-box', 'text-[12px] px-3 py-2.5 border border-warning/16 rounded-[10px] bg-warning/6 flex gap-2 items-start text-body'],
142
+ ['ant-section-label', 'text-[10px] tracking-[0.14em] font-semibold mb-2 uppercase text-muted'],
143
+
144
+ // Bespoke check-square — contrasty unchecked state BY DEFAULT (inset fill +
145
+ // visible border) so it never goes white-on-white. Put an mdi-check inside and
146
+ // add `ant-check--on` (primary) or `ant-check--danger` (error) when checked.
147
+ ['ant-check', 'inline-flex items-center justify-center flex-shrink-0 w-[18px] h-[18px] rounded-[5px] border-[1.5px] border-solid border-[rgba(var(--v-theme-on-surface),0.4)] bg-ant-inset transition-colors'],
148
+ ['ant-check--on', '!bg-primary !border-primary text-white'],
149
+ ['ant-check--danger', '!bg-error !border-error text-white'],
150
+
151
+ // ── Page, section and tab vocabulary (AAD-980 detail redesign) ──────────
152
+ //
153
+ // ⚠️ ADDED BECAUSE THEY WERE ALREADY IN USE AND RENDERING NAKED. `ant-page-title`,
154
+ // `ant-page-sub`, `ant-fine`, `ant-overline` and `ant-section-title` are written by
155
+ // the triggers app's index, its route shells and its history cards, and NONE of
156
+ // them emitted a rule — the exact silent failure the header of this file warns
157
+ // about, found by generating CSS from the consuming app's own config rather than
158
+ // by reading either file. The tab classes are new for the trigger detail.
159
+ //
160
+ // The type scale is the design system's and is deliberately OFF the Tailwind
161
+ // ramp — 11.5px, 10px, 12.5px. Snapping them to 12/14/16 is what made an earlier
162
+ // pass "look like the store instead of the system".
163
+
164
+ // Page heading — 24px/500 with optical tracking, and no margin of its own so the
165
+ // surrounding stack owns the rhythm.
166
+ ['ant-page-title', 'text-2xl font-medium leading-[1.2] tracking-[-0.015em] m-0 text-heading'],
167
+ ['ant-page-sub', 'text-sm mt-1 mb-0 text-body'],
168
+
169
+ // Fine print — the smallest type in the system. Consequences, counts and caveats
170
+ // that must be readable but must not compete with the thing they qualify.
171
+ ['ant-fine', 'text-[11.5px] text-muted'],
172
+
173
+ // Uppercase eyebrow above a block. Same type as `ant-section-label` without its
174
+ // bottom margin: that one labels a form section and always has a control under it,
175
+ // this one labels an arbitrary block and the caller owns the spacing.
176
+ ['ant-overline', 'text-[10px] font-semibold tracking-[0.14em] uppercase text-muted'],
177
+
178
+ // Titles inside `ant-section__header` (and the same type for a row-level card
179
+ // title). 14px/600 — NOT the store's 16px/500, which is where the store diverges
180
+ // from the system.
181
+ ['ant-section-title', 'text-sm font-semibold text-heading'],
182
+ ['ant-section-sub', 'text-xs mt-0.5 text-body'],
183
+ ['ant-card-title', 'text-sm font-semibold text-heading'],
184
+
185
+ // Segmented tab tray — an inset track holding pills, 10px radius on the tray and
186
+ // 8px on the pill (the system says outright: do not round 10px to 12px).
187
+ //
188
+ // ⚠️ The active pill's overrides are `!` ON PURPOSE, matching `ant-option-row--on`
189
+ // and `ant-check--on` above. A shortcut expands to ordinary utilities, so which of
190
+ // `text-muted` and `text-heading` wins is decided by CSS source order, not by the
191
+ // order the classes appear in the attribute. Without `!` an active tab is muted
192
+ // grey exactly as often as the generator happens to sort the other way.
193
+ ['ant-tab-tray', 'inline-flex items-center p-1 rounded-[10px] bg-ant-inset border border-ant'],
194
+ ['ant-tab-pill', 'h-9 px-3.5 mx-0.5 inline-flex items-center gap-2 rounded-lg bg-transparent border-0 [font-family:inherit] text-sm text-muted cursor-pointer transition-[color,background-color] duration-150 hover:text-body'],
195
+ ['ant-tab-pill--active', 'bg-ant-surface !text-heading font-medium shadow-[0_1px_2px_rgba(0,0,0,0.05)]'],
196
+ ['ant-tab-badge', 'min-w-5 h-5 px-1.5 rounded-[10px] bg-[rgba(var(--v-theme-on-surface),0.10)] text-body font-mono text-xs font-semibold leading-none inline-flex items-center justify-center'],
197
+
198
+ // Two more CTA variants. Neutral is the secondary action that makes no colour
199
+ // claim; danger states its consequence without filling, because a filled red
200
+ // button reads as the primary path.
201
+ //
202
+ // ⚠️ `!border-solid` and the explicit width beat `ant-cta`'s own `border-0` for the
203
+ // same source-order reason as the active tab pill.
204
+ ['ant-cta--neutral', 'bg-transparent !text-heading !border-1 !border-solid border-ant hover:bg-ant-hover'],
205
+ ['ant-cta--danger', 'bg-transparent !text-error !border-1 !border-solid !border-error/40 hover:bg-error/6'],
206
+
207
+ // ── The lens rail (AAD-980) ─────────────────────────────────────────────
208
+ //
209
+ // A persistent left rail of destinations, each with a count. 32px tall on an 8px
210
+ // radius — the design system's "sidebar row" step, which is the same 8 as a CTA
211
+ // and deliberately NOT the 10 of a tab tray or the 12 of a pill input.
212
+ //
213
+ // 13px type, not 14: a rail is scanned down, not read across, and the system's
214
+ // scale is off the Tailwind ramp on purpose.
215
+ ['ant-rail-item', 'h-8 px-2.5 w-full flex items-center gap-2.5 rounded-lg border-0 bg-transparent [font-family:inherit] text-[13px] text-left cursor-pointer text-body transition-colors duration-150 hover:bg-ant-hover'],
216
+ ['ant-rail-item--active', 'bg-primary/10 !text-primary font-medium'],
217
+
218
+ // Count beside a rail label. Mono, because these are quantities you compare
219
+ // between rows rather than read as words.
220
+ ['ant-rail-badge', 'font-mono text-[11px] font-semibold px-1.5 h-[18px] min-w-5 rounded-full inline-flex items-center justify-center bg-ant-inset text-body'],
221
+ ['ant-rail-badge--active', '!bg-primary !text-white'],
222
+
223
+ // Tiny uppercase tag for a fact about a row — "CUSTOM PATH", "TABLE". Inset
224
+ // rather than tinted: it qualifies the row it sits in, it does not report a state,
225
+ // so it must not read as a status pill.
226
+ ['ant-tag-inset', 'text-[10px] font-semibold tracking-[0.03em] uppercase px-1.5 py-0.5 rounded bg-ant-inset text-muted'],
227
+
228
+ // The chooser's radio. 18px, and the SELECTED one is FILLED with a white dot in
229
+ // it — not an outline with a coloured dot, which is the weaker treatment this
230
+ // shipped with and the most visible difference on the create screen. Unselected
231
+ // carries an inset fill so it never disappears against the row.
232
+ ['ant-radio', 'w-[18px] h-[18px] rounded-full inline-flex items-center justify-center flex-shrink-0 border border-solid border-[rgba(var(--v-border-color),0.28)] bg-ant-inset'],
233
+ ['ant-radio--on', '!bg-primary !border-primary'],
234
+ ['ant-radio__dot', 'w-1.5 h-1.5 rounded-full bg-white inline-block'],
235
+ ]
package/lib/build/uno.ts CHANGED
@@ -3,6 +3,8 @@ import presetRemToPx from '@unocss/preset-rem-to-px'
3
3
  import presetTypography from '@unocss/preset-typography'
4
4
  import presetWind4 from '@unocss/preset-wind4'
5
5
  import { defineConfig, transformerDirectives, transformerVariantGroup } from 'unocss'
6
+ import { libraryClassSafelist } from './uno.safelist'
7
+ import { antShortcuts } from './uno.shortcuts'
6
8
 
7
9
  const antColors = {
8
10
  primary: '#125CFF',
@@ -45,6 +47,17 @@ const antPreflights: NonNullable<UserConfig['preflights']> = [
45
47
  { getCSS: () => ':root { --ant-warning-text-emphasis: #9b5b00; }' },
46
48
  ]
47
49
 
50
+ /**
51
+ * Composite shortcuts every ANT surface needs, not only the storefront.
52
+ *
53
+ * These lived in `ant-os/src/utils/uno.storefront.ts` until AAD-980 needed them
54
+ * in an app that is a different repo (`ant-apps/ant-app-triggers-management`).
55
+ * They sit here rather than being copied because a missing shortcut fails
56
+ * SILENTLY: UnoCSS emits no rule, the element renders unstyled, and there is no
57
+ * build error to notice. Anything genuinely store-specific stays behind in
58
+ * `uno.storefront.ts`.
59
+ */
60
+
48
61
  /**
49
62
  * Normalizes shortcuts from either array or object form to array form.
50
63
  *
@@ -87,7 +100,7 @@ function normalizeShortcuts(shortcuts: any): [string, string][] {
87
100
  * ```
88
101
  */
89
102
  export function createAntUnoConfig(overrides: Partial<UserConfig> = {}): UserConfig {
90
- const { rules, presets, transformers, theme, shortcuts, preflights, ...rest } = overrides
103
+ const { rules, presets, transformers, theme, shortcuts, preflights, safelist, content, ...rest } = overrides
91
104
  // UnoCSS types `theme` as `object` on `UserConfig`, so destructured fields
92
105
  // lose their shape. Cast to a loose record to access `colors`/`breakpoints`/`radius`.
93
106
  const overrideTheme = theme as Record<string, any> | undefined
@@ -98,6 +111,31 @@ export function createAntUnoConfig(overrides: Partial<UserConfig> = {}): UserCon
98
111
  cssLayerName: (layer: string) => layer === 'properties' ? null : `uno-${layer}`,
99
112
  },
100
113
  preflights: [...antPreflights, ...(preflights ?? [])],
114
+ /**
115
+ * ⚠️ REQUIRED, not an optimisation. UnoCSS extracts class names only from files
116
+ * its pipeline includes (`.vue`, `.jsx`, `.html`, …). Every class written INSIDE
117
+ * this library reaches a consuming app only as `dist/index.js`, which is never
118
+ * scanned — so the rule is never emitted and the element renders naked, with no
119
+ * build error. `ant-cta` shipped invisible to the triggers app that way, and
120
+ * `ant-save-bar` broke the store's own save bar.
121
+ *
122
+ * The list is GENERATED from this library's components (see `genSafelist.mjs`),
123
+ * because hand-listing the shortcut names covers 9 of the 57 classes actually at
124
+ * risk and silently drops focus rings, transitions and toggle geometry.
125
+ */
126
+ safelist: [...libraryClassSafelist, ...(safelist ?? [])],
127
+ /**
128
+ * ⚠️ DEV FIRST LOAD. The Vite plugin only knows the classes of modules Vite has
129
+ * already transformed, and `__uno.css` is requested before a lazy route's
130
+ * components are. In an iframe app the stylesheet then arrives without them and
131
+ * the page renders naked until the second reload, when the module graph is warm.
132
+ * Scanning the source tree from disk as well makes the first stylesheet complete.
133
+ * Same files as the pipeline would find, so the built CSS does not change.
134
+ */
135
+ content: {
136
+ ...content,
137
+ filesystem: ['src/**/*.{vue,ts,tsx}', ...(content?.filesystem ?? [])],
138
+ },
101
139
  rules: [
102
140
  ...antDesignTokens,
103
141
  ...overrideRules,
@@ -115,6 +153,8 @@ export function createAntUnoConfig(overrides: Partial<UserConfig> = {}): UserCon
115
153
  presetTypography(),
116
154
  ],
117
155
  shortcuts: [
156
+ ...antShortcuts,
157
+ // App overrides come last so an app can redefine a shared shortcut.
118
158
  ...normalizeShortcuts(shortcuts),
119
159
  ],
120
160
  transformers: transformers ?? [
@@ -3,6 +3,7 @@ import type { IconProps, VuetifyOptions } from 'vuetify'
3
3
  import { Icon } from '@iconify/vue'
4
4
  import { h } from 'vue'
5
5
  import { createVuetify } from 'vuetify'
6
+ import { qualifyIcon } from './qualifyIcon'
6
7
  import 'vuetify/styles'
7
8
  import 'virtual:uno.css'
8
9
  // CSS patches for Vuetify quirks not expressible via theme/defaults.
@@ -154,7 +155,8 @@ export const ANT_DEFAULTS: VuetifyOptions['defaults'] = {
154
155
  * `IconComponent` type (= `JSXComponent<IconProps>`) with no type assertions.
155
156
  */
156
157
  const IconifyAdapter: FunctionalComponent<IconProps> = (props) => {
157
- return h(Icon, { icon: typeof props.icon === 'string' ? props.icon : '' })
158
+ const raw = typeof props.icon === 'string' ? props.icon : ''
159
+ return h(Icon, { icon: qualifyIcon(raw) })
158
160
  }
159
161
 
160
162
  const DEFAULT_ICONS: VuetifyOptions['icons'] = {