@antcde/component-library 0.1.25 → 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.
- package/README.md +2 -1
- package/dist/build/uno.js +40 -1
- package/dist/build/uno.safelist.d.ts +10 -0
- package/dist/build/uno.safelist.js +52 -0
- package/dist/build/uno.shortcuts.d.ts +27 -0
- package/dist/build/uno.shortcuts.js +209 -0
- package/dist/index.js +9020 -7853
- package/dist/test/vitest.js +3 -0
- package/dist/types/{src/components → components}/AntTourZone/_TourInfoCard.vue.d.ts +3 -2
- package/dist/types/components/AntTourZone/_TourRing.vue.d.ts +16 -0
- package/dist/types/{src/components → components}/AntTourZone/index.vue.d.ts +8 -16
- package/dist/types/components/BaseAntButton.vue.d.ts +9 -0
- package/dist/types/components/BaseAntCard.vue.d.ts +28 -0
- package/dist/types/components/BaseAntCreateCard.vue.d.ts +7 -0
- package/dist/types/{src/components → components}/BaseAntDatePicker.vue.d.ts +3 -2
- package/dist/types/{src/components → components}/BaseAntInput.vue.d.ts +13 -15
- package/dist/types/components/BaseAntLoading.vue.d.ts +3 -0
- package/dist/types/{src/components → components}/BaseAppCard/_BaseAppCardHint.vue.d.ts +2 -1
- package/dist/types/components/BaseAppCard/_BaseAppCardMedia.vue.d.ts +23 -0
- package/dist/types/components/BaseAppCard/_BaseAppCardTitle.vue.d.ts +6 -0
- package/dist/types/{src/components → components}/BaseAppCard/_BaseAppCardToolbar.vue.d.ts +3 -2
- package/dist/types/components/BaseAppCard/_BaseAppCardUpdate.vue.d.ts +9 -0
- package/dist/types/{src/components → components}/BaseAppCard/index.vue.d.ts +9 -13
- package/dist/types/{src/components → components}/BaseAppCardSkeleton.vue.d.ts +3 -2
- package/dist/types/{src/components → components}/BaseClickableIcon.vue.d.ts +2 -1
- package/dist/types/{src/components → components}/BaseConfirmDialog.vue.d.ts +7 -11
- package/dist/types/components/BaseDeleteDialog.vue.d.ts +43 -0
- package/dist/types/{src/components → components}/BaseDialog.vue.d.ts +7 -11
- package/dist/types/{src/components → components}/BaseLimitedButton.vue.d.ts +8 -12
- package/dist/types/{src/components → components}/BaseResizePanel.vue.d.ts +8 -12
- package/dist/types/{src/components → components}/BulkLabelsMenu.vue.d.ts +10 -14
- package/dist/types/{src/components → components}/DmsFilePicker/index.vue.d.ts +6 -7
- package/dist/types/{src/components → components}/FilePreviewContent/_PreviewDetails.vue.d.ts +3 -2
- package/dist/types/{src/components → components}/FilePreviewContent/_PreviewMeta.vue.d.ts +2 -1
- package/dist/types/{src/components → components}/FilePreviewContent/_PreviewUsages.vue.d.ts +2 -1
- package/dist/types/{src/components → components}/FilePreviewContent/index.vue.d.ts +11 -15
- package/dist/types/components/FilePreviewWindow/index.vue.d.ts +40 -0
- package/dist/types/components/FlowWindow/index.vue.d.ts +28 -0
- package/dist/types/components/FlowWindowContent/index.vue.d.ts +26 -0
- package/dist/types/components/GlobalLabelBadge.vue.d.ts +12 -0
- package/dist/types/{src/components → components}/RBAC/Permissions/PermissionCard.vue.d.ts +2 -1
- package/dist/types/components/RBAC/Permissions/PermissionsGroups.vue.d.ts +14 -0
- package/dist/types/{src/components → components}/RichTextEditor/_MentionPanel.vue.d.ts +3 -2
- package/dist/types/components/RichTextEditor/_Toolbar.vue.d.ts +7 -0
- package/dist/types/{src/components → components}/RichTextEditor/index.vue.d.ts +6 -6
- package/dist/types/{src/components → components}/StackedLabels/_LabelsMenuCard.vue.d.ts +3 -2
- package/dist/types/{src/components → components}/StackedLabels/index.vue.d.ts +3 -2
- package/dist/types/{src/components → components}/TasksFlow/components/_FlowBreadcrumb.vue.d.ts +2 -1
- package/dist/types/components/TasksFlow/components/_FlowEdgeConditionBooleanMode.vue.d.ts +10 -0
- package/dist/types/components/TasksFlow/components/_FlowEdgeConditionForm.vue.d.ts +27 -0
- package/dist/types/components/TasksFlow/components/_FlowEdgeConditionRow.vue.d.ts +13 -0
- package/dist/types/components/TasksFlow/components/_FlowEdgeConditionsDialog.vue.d.ts +14 -0
- package/dist/types/{src/components → components}/TasksFlow/components/_FlowEdgeDeleteDialog.vue.d.ts +4 -3
- package/dist/types/{src/components → components}/TasksFlow/components/_FlowEdgeLagMenu.vue.d.ts +5 -3
- package/dist/types/{src/components → components}/TasksFlow/components/_FlowLifecycleBar.vue.d.ts +3 -2
- package/dist/types/components/TasksFlow/components/_FlowSearch.vue.d.ts +6 -0
- package/dist/types/components/TasksFlow/components/_FlowStats.vue.d.ts +6 -0
- package/dist/types/{src/components → components}/TasksFlow/components/_FlowStructureTree.vue.d.ts +6 -6
- package/dist/types/{src/components → components}/TasksFlow/components/_FlowToolbar.vue.d.ts +3 -2
- package/dist/types/{src/components → components}/TasksFlow/components/_FlowTriggerMenu.vue.d.ts +2 -1
- package/dist/types/{src/components → components}/TasksFlow/components/_FlowVersionBar.vue.d.ts +2 -1
- package/dist/types/{src/components → components}/TasksFlow/components/_InsertTemplateDialog.vue.d.ts +7 -5
- package/dist/types/{src/components → components}/TasksFlow/components/_SubflowPanel.vue.d.ts +3 -2
- package/dist/types/{src/components → components}/TasksFlow/components/_VersionDiffView.vue.d.ts +5 -3
- package/dist/types/{src/components → components}/TasksFlow/components/_VersionPublishDialog.vue.d.ts +5 -3
- package/dist/types/components/TasksFlow/components/_dropzoneBackground.vue.d.ts +13 -0
- package/dist/types/components/TasksFlow/components/_flowEdge.vue.d.ts +7 -0
- package/dist/types/{src/components → components}/TasksFlow/components/_flowEditor.vue.d.ts +3 -2
- package/dist/types/components/TasksFlow/components/nodes/_DurationEditor.vue.d.ts +30 -0
- package/dist/types/{src/components → components}/TasksFlow/components/nodes/_NodeContextMenu.vue.d.ts +5 -3
- package/dist/types/components/TasksFlow/components/nodes/_NodeMeta.vue.d.ts +15 -0
- package/dist/types/components/TasksFlow/components/nodes/_UserPicker.vue.d.ts +29 -0
- package/dist/types/{src/components → components}/TasksFlow/components/nodes/_endpointNode.vue.d.ts +2 -1
- package/dist/types/components/TasksFlow/components/nodes/_swimlaneNode.vue.d.ts +7 -0
- package/dist/types/{src/components → components}/TasksFlow/components/nodes/_taskNode.vue.d.ts +2 -1
- package/dist/types/{src/components → components}/TasksFlow/components/nodes/_triggerNode.vue.d.ts +2 -1
- package/dist/types/components/TasksFlow/composables/__tests__/useTaskFlowDragDrop.spec.d.ts +1 -0
- package/dist/types/components/TasksFlow/composables/useEdgeConditionTables.d.ts +228 -0
- package/dist/types/components/TasksFlow/composables/useFlowEdgeConditionState.d.ts +21 -0
- package/dist/types/{src/components → components}/TasksFlow/composables/useTaskFlow.d.ts +3 -3
- package/dist/types/{src/components → components}/TasksFlow/composables/useTaskFlowEdgeConditions.d.ts +2 -2
- package/dist/types/{src/components → components}/TasksFlow/composables/useTaskFlowEdges.d.ts +3 -3
- package/dist/types/{src/components → components}/TasksFlow/index.vue.d.ts +3 -2
- package/dist/types/components/TasksFlow/utils/conditionOperators.d.ts +3 -0
- package/dist/types/{src/components → components}/UnifiedWindow/_WindowPresetMenu.vue.d.ts +2 -1
- package/dist/types/{src/components → components}/UnifiedWindow/_WindowTabs.vue.d.ts +2 -1
- package/dist/types/{src/components → components}/UnifiedWindow/index.vue.d.ts +12 -19
- package/dist/types/{src/components → components}/VersionPublishDialog.vue.d.ts +5 -3
- package/dist/types/{src/components → components}/_BaseAntInputField.vue.d.ts +11 -14
- package/dist/types/{src/components → components}/_BaseAntInputLabel.vue.d.ts +7 -11
- package/dist/types/components/form/AntActionMenu.vue.d.ts +30 -0
- package/dist/types/components/form/AntCheckboxCards.vue.d.ts +47 -0
- package/dist/types/components/form/AntDialogShell.vue.d.ts +66 -0
- package/dist/types/components/form/AntField.vue.d.ts +57 -0
- package/dist/types/components/form/AntFilterChips.types.d.ts +12 -0
- package/dist/types/components/form/AntFilterChips.vue.d.ts +31 -0
- package/dist/types/components/form/AntFilterSelect.types.d.ts +13 -0
- package/dist/types/components/form/AntFilterSelect.vue.d.ts +26 -0
- package/dist/types/components/form/AntHintBanner.vue.d.ts +36 -0
- package/dist/types/components/form/AntHintTip.vue.d.ts +24 -0
- package/dist/types/components/form/AntInput.vue.d.ts +98 -0
- package/dist/types/components/form/AntNumberField.vue.d.ts +32 -0
- package/dist/types/components/form/AntOptionPicker.types.d.ts +19 -0
- package/dist/types/components/form/AntOptionPicker.vue.d.ts +46 -0
- package/dist/types/components/form/AntPanelSection.vue.d.ts +34 -0
- package/dist/types/components/form/AntRadioCards.vue.d.ts +54 -0
- package/dist/types/components/form/AntSaveBar.vue.d.ts +70 -0
- package/dist/types/components/form/AntSearchField.vue.d.ts +32 -0
- package/dist/types/components/form/AntSectionCard.vue.d.ts +47 -0
- package/dist/types/components/form/AntSelect.vue.d.ts +79 -0
- package/dist/types/components/form/AntStatusPill.vue.d.ts +38 -0
- package/dist/types/components/form/AntToggle.vue.d.ts +30 -0
- package/dist/types/index.d.ts +79 -0
- package/lib/build/genSafelist.mjs +135 -0
- package/lib/build/qualifyIcon.ts +28 -0
- package/lib/build/uno.safelist.ts +52 -0
- package/lib/build/uno.shortcuts.ts +235 -0
- package/lib/build/uno.ts +41 -1
- package/lib/build/vuetify.ts +3 -1
- package/lib/test/mockVueRouter.ts +41 -1
- package/lib/test/vitest.ts +3 -0
- package/package.json +33 -30
- package/dist/types/src/components/AntTourZone/_TourRing.vue.d.ts +0 -15
- package/dist/types/src/components/BaseAntButton.vue.d.ts +0 -8
- package/dist/types/src/components/BaseAntCard.vue.d.ts +0 -30
- package/dist/types/src/components/BaseAntCreateCard.vue.d.ts +0 -6
- package/dist/types/src/components/BaseAntLoading.vue.d.ts +0 -2
- package/dist/types/src/components/BaseAppCard/_BaseAppCardMedia.vue.d.ts +0 -27
- package/dist/types/src/components/BaseAppCard/_BaseAppCardTitle.vue.d.ts +0 -5
- package/dist/types/src/components/BaseAppCard/_BaseAppCardUpdate.vue.d.ts +0 -8
- package/dist/types/src/components/BaseDeleteDialog.vue.d.ts +0 -48
- package/dist/types/src/components/FlowWindowContent/index.vue.d.ts +0 -55
- package/dist/types/src/components/GlobalLabelBadge.vue.d.ts +0 -11
- package/dist/types/src/components/RichTextEditor/_Toolbar.vue.d.ts +0 -6
- package/dist/types/src/components/TasksFlow/components/_FlowEdgeConditionsDialog.vue.d.ts +0 -10
- package/dist/types/src/components/TasksFlow/components/_FlowSearch.vue.d.ts +0 -7
- package/dist/types/src/components/TasksFlow/components/_FlowStats.vue.d.ts +0 -5
- package/dist/types/src/components/TasksFlow/components/_dropzoneBackground.vue.d.ts +0 -17
- package/dist/types/src/components/TasksFlow/components/_flowEdge.vue.d.ts +0 -9
- package/dist/types/src/components/TasksFlow/components/nodes/_DurationEditor.vue.d.ts +0 -33
- package/dist/types/src/components/TasksFlow/components/nodes/_NodeMeta.vue.d.ts +0 -14
- package/dist/types/src/components/TasksFlow/components/nodes/_UserPicker.vue.d.ts +0 -32
- package/dist/types/src/components/TasksFlow/components/nodes/_swimlaneNode.vue.d.ts +0 -6
- package/dist/types/src/index.d.ts +0 -39
- /package/dist/types/{src/components → components}/BaseAntInput.types.d.ts +0 -0
- /package/dist/types/{src/components → components}/DmsFilePicker/composables/usePickerNavigation.d.ts +0 -0
- /package/dist/types/{src/components → components}/DmsFilePicker/composables/usePickerUpload.d.ts +0 -0
- /package/dist/types/{src/components → components}/DmsFilePicker/utils/fileFormatting.d.ts +0 -0
- /package/dist/types/{src/components → components}/FilePreviewContent/fileFormat.d.ts +0 -0
- /package/dist/types/{src/components → components}/FilePreviewContent/types.d.ts +0 -0
- /package/dist/types/{src/components → components}/FilePreviewContent/usePreviewDetails.d.ts +0 -0
- /package/dist/types/{src/components → components}/RichTextEditor/_useInlineEdit.d.ts +0 -0
- /package/dist/types/{src/components → components}/RichTextEditor/_useMentionPicker.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/components/nodes/useTaskNodeState.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/_layoutEngine.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useAutoLayout.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useCriticalPath.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowAutoLayout.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowCache.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowCrud.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowDisplayElements.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowEditor.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowEndpoints.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowFetch.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowKeyboard.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowLifecycle.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowNotifications.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowOperations.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowRealtime.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowSearch.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowStructureTree.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowSubflows.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowToolbarDrag.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowUsers.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useFlowViewport.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useSwimlaneLayout.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useTaskFlowDragDrop.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useTaskFlowMappers.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useTaskFlowTypes.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useTemplateVersioning.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useTemplateVersioningState.d.ts +0 -0
- /package/dist/types/{src/components → components}/TasksFlow/composables/useTriggerExecution.d.ts +0 -0
- /package/dist/types/{src/components → components}/UnifiedWindow/types.d.ts +0 -0
- /package/dist/types/{src/components → components}/UnifiedWindow/useNativeFullscreen.d.ts +0 -0
- /package/dist/types/{src/components → components}/UnifiedWindow/useWindowDrag.d.ts +0 -0
- /package/dist/types/{src/components → components}/useResizePanel.d.ts +0 -0
|
@@ -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 ?? [
|
package/lib/build/vuetify.ts
CHANGED
|
@@ -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
|
-
|
|
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'] = {
|
|
@@ -84,9 +84,49 @@ export function mockVueRouter(overrides: MockVueRouterOverrides = {}) {
|
|
|
84
84
|
return { ...baseRoute, ...r }
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* A router instance shaped enough for `app.use(router)` and for a module that
|
|
89
|
+
* builds one at import time.
|
|
90
|
+
*
|
|
91
|
+
* ⚠️ Needed because a mock must present the WHOLE `vue-router` module shape, not
|
|
92
|
+
* just the two composables a test happens to call. Any module anywhere in the
|
|
93
|
+
* graph that calls `createRouter()` at module scope — ant-os builds its router
|
|
94
|
+
* that way — throws "No createRouter export is defined on the vue-router mock",
|
|
95
|
+
* and the graph widens as soon as a component imports a barrel. Omitting these
|
|
96
|
+
* made the mock's completeness depend on which imports a test transitively
|
|
97
|
+
* reached, which is not something a test author can reason about.
|
|
98
|
+
*/
|
|
99
|
+
const routerInstance = {
|
|
100
|
+
...routerMethods,
|
|
101
|
+
install: () => {},
|
|
102
|
+
// A GETTER, not a value. `vi.mock` factories are hoisted, so anything
|
|
103
|
+
// evaluated here runs before the test file's top-level variables exist — an
|
|
104
|
+
// eager `resolveRoute()` throws "Cannot access X before initialization" for
|
|
105
|
+
// every test whose `useRoute` override closes over one.
|
|
106
|
+
get currentRoute() { return { value: resolveRoute() } },
|
|
107
|
+
resolve: (to: unknown) => ({ href: typeof to === 'string' ? to : '/', ...baseRoute }),
|
|
108
|
+
getRoutes: () => [],
|
|
109
|
+
addRoute: vi.fn(),
|
|
110
|
+
removeRoute: vi.fn(),
|
|
111
|
+
hasRoute: () => false,
|
|
112
|
+
isReady: () => Promise.resolve(),
|
|
113
|
+
onError: vi.fn(),
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const history = () => ({ location: '/', state: {}, base: '' })
|
|
117
|
+
|
|
87
118
|
return {
|
|
88
|
-
|
|
119
|
+
// `routerInstance`, not `routerMethods`: the bare method bag has no
|
|
120
|
+
// `currentRoute`, so any component reading `router.currentRoute.value` —
|
|
121
|
+
// ant-os's signal watchers do — threw under this mock. `useRouter()` and
|
|
122
|
+
// `createRouter()` now hand back the same object, which is also what
|
|
123
|
+
// vue-router itself does.
|
|
124
|
+
useRouter: () => routerInstance,
|
|
89
125
|
useRoute: () => resolveRoute(),
|
|
126
|
+
createRouter: () => routerInstance,
|
|
127
|
+
createWebHistory: history,
|
|
128
|
+
createWebHashHistory: history,
|
|
129
|
+
createMemoryHistory: history,
|
|
90
130
|
RouterLink: { name: 'RouterLink', template: '<a><slot /></a>' },
|
|
91
131
|
RouterView: { name: 'RouterView', template: '<div><slot /></div>' },
|
|
92
132
|
}
|
package/lib/test/vitest.ts
CHANGED
|
@@ -33,6 +33,9 @@ export function createAntVitestConfig(appRoot: string | URL, overrides: Record<s
|
|
|
33
33
|
alias: {
|
|
34
34
|
'@': fileURLToPath(new URL('./src', appRoot)),
|
|
35
35
|
},
|
|
36
|
+
// Vuetify and pinia both break if two copies end up in one test run —
|
|
37
|
+
// pinia especially, since consumers span pinia 3 and 4.
|
|
38
|
+
dedupe: ['vue', 'pinia', 'vuetify'],
|
|
36
39
|
},
|
|
37
40
|
test: {
|
|
38
41
|
globals: true,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antcde/component-library",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.26-rc.1",
|
|
5
5
|
"description": "Helper to use ant components in Vue 3",
|
|
6
6
|
"author": "CollaborAll",
|
|
7
7
|
"exports": {
|
|
@@ -95,17 +95,19 @@
|
|
|
95
95
|
],
|
|
96
96
|
"scripts": {
|
|
97
97
|
"dev": "vite",
|
|
98
|
-
"build": "vite build && tsc -p tsconfig.factories.json",
|
|
98
|
+
"build": "pnpm build:safelist && vite build && tsc -p tsconfig.factories.json",
|
|
99
99
|
"build:factories": "tsc -p tsconfig.factories.json",
|
|
100
100
|
"preview": "vite preview",
|
|
101
|
-
"test
|
|
101
|
+
"test": "vitest --run",
|
|
102
|
+
"test:watch": "vitest",
|
|
102
103
|
"build-only": "rm -rf ./dist && vite build && tsc -p tsconfig.factories.json",
|
|
103
104
|
"build-watch": "vite build --watch",
|
|
104
105
|
"prepublishOnly": "rm -rf ./dist && vite build && tsc -p tsconfig.factories.json",
|
|
105
106
|
"clear": "pnpm dlx shx rm -rf dist",
|
|
106
107
|
"type-check": "vue-tsc --build --force",
|
|
107
108
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
108
|
-
"format": "prettier --write src/"
|
|
109
|
+
"format": "prettier --write src/",
|
|
110
|
+
"build:safelist": "vite-node lib/build/genSafelist.mjs"
|
|
109
111
|
},
|
|
110
112
|
"peerDependencies": {
|
|
111
113
|
"@antcde/connect-ts": ">=0.4.0",
|
|
@@ -138,6 +140,9 @@
|
|
|
138
140
|
"@intlify/unplugin-vue-i18n": {
|
|
139
141
|
"optional": true
|
|
140
142
|
},
|
|
143
|
+
"@pinia/testing": {
|
|
144
|
+
"optional": true
|
|
145
|
+
},
|
|
141
146
|
"@unocss/preset-rem-to-px": {
|
|
142
147
|
"optional": true
|
|
143
148
|
},
|
|
@@ -150,6 +155,15 @@
|
|
|
150
155
|
"@vitejs/plugin-vue": {
|
|
151
156
|
"optional": true
|
|
152
157
|
},
|
|
158
|
+
"@vue/test-utils": {
|
|
159
|
+
"optional": true
|
|
160
|
+
},
|
|
161
|
+
"happy-dom": {
|
|
162
|
+
"optional": true
|
|
163
|
+
},
|
|
164
|
+
"pinia": {
|
|
165
|
+
"optional": true
|
|
166
|
+
},
|
|
153
167
|
"unocss": {
|
|
154
168
|
"optional": true
|
|
155
169
|
},
|
|
@@ -168,21 +182,9 @@
|
|
|
168
182
|
"vite-plugin-vuetify": {
|
|
169
183
|
"optional": true
|
|
170
184
|
},
|
|
171
|
-
"@vue/test-utils": {
|
|
172
|
-
"optional": true
|
|
173
|
-
},
|
|
174
185
|
"vitest": {
|
|
175
186
|
"optional": true
|
|
176
187
|
},
|
|
177
|
-
"happy-dom": {
|
|
178
|
-
"optional": true
|
|
179
|
-
},
|
|
180
|
-
"pinia": {
|
|
181
|
-
"optional": true
|
|
182
|
-
},
|
|
183
|
-
"@pinia/testing": {
|
|
184
|
-
"optional": true
|
|
185
|
-
},
|
|
186
188
|
"vue-router": {
|
|
187
189
|
"optional": true
|
|
188
190
|
}
|
|
@@ -190,12 +192,12 @@
|
|
|
190
192
|
"dependencies": {
|
|
191
193
|
"@arcgis/core": "^4.34.8",
|
|
192
194
|
"@mdi/font": "^7.4.47",
|
|
193
|
-
"@tiptap/extension-link": "^3.31.
|
|
194
|
-
"@tiptap/extension-mention": "^3.31.
|
|
195
|
-
"@tiptap/extension-placeholder": "^3.31.
|
|
196
|
-
"@tiptap/starter-kit": "^3.31.
|
|
197
|
-
"@tiptap/suggestion": "^3.31.
|
|
198
|
-
"@tiptap/vue-3": "^3.
|
|
195
|
+
"@tiptap/extension-link": "^3.31.3",
|
|
196
|
+
"@tiptap/extension-mention": "^3.31.3",
|
|
197
|
+
"@tiptap/extension-placeholder": "^3.31.3",
|
|
198
|
+
"@tiptap/starter-kit": "^3.31.3",
|
|
199
|
+
"@tiptap/suggestion": "^3.31.3",
|
|
200
|
+
"@tiptap/vue-3": "^3.31.3",
|
|
199
201
|
"@vue-flow/background": "^1.3.2",
|
|
200
202
|
"@vue-flow/core": "^1.48.2",
|
|
201
203
|
"@vue-flow/minimap": "^1.5.4",
|
|
@@ -206,29 +208,30 @@
|
|
|
206
208
|
"vue-i18n": "^11.4.10"
|
|
207
209
|
},
|
|
208
210
|
"devDependencies": {
|
|
209
|
-
"@antcde/connect-ts": "0.4.
|
|
210
|
-
"@antcde/vue-utils": "0.2.
|
|
211
|
-
"@arcgis/core": "^4.30.9",
|
|
211
|
+
"@antcde/connect-ts": "0.4.28-rc.1",
|
|
212
|
+
"@antcde/vue-utils": "0.2.23-rc.1",
|
|
212
213
|
"@iconify-json/mdi": "^1.2.3",
|
|
213
214
|
"@iconify/vue": "^5.0.1",
|
|
214
215
|
"@intlify/unplugin-vue-i18n": "^11.2.5",
|
|
215
216
|
"@mdi/font": "^7.2.96",
|
|
216
217
|
"@tsconfig/node22": "^22.0.6",
|
|
217
|
-
"@types/node": "^
|
|
218
|
+
"@types/node": "^22.20.1",
|
|
218
219
|
"@types/qs": "^6.15.1",
|
|
219
220
|
"@vitejs/plugin-vue": "^6.0.8",
|
|
221
|
+
"@vue/language-core": "^3.3.11",
|
|
220
222
|
"@vue/test-utils": "^2.5.0",
|
|
221
223
|
"@vue/tsconfig": "^0.9.1",
|
|
222
|
-
"happy-dom": "^20.
|
|
224
|
+
"happy-dom": "^20.14.0",
|
|
223
225
|
"pinia": "^3.0.4",
|
|
224
|
-
"sass": "^1.
|
|
226
|
+
"sass": "^1.104.0",
|
|
225
227
|
"typescript": "~6.0.3",
|
|
226
228
|
"unplugin-icons": "^23.0.1",
|
|
227
229
|
"vite": "^8.2.2",
|
|
230
|
+
"vite-node": "^6.0.0",
|
|
228
231
|
"vite-plugin-css-injected-by-js": "^5.0.2",
|
|
229
|
-
"vite-plugin-dts": "^
|
|
232
|
+
"vite-plugin-dts": "^5.1.0",
|
|
230
233
|
"vite-plugin-vuetify": "^2.1.3",
|
|
231
|
-
"vitest": "^
|
|
234
|
+
"vitest": "^5.0.0",
|
|
232
235
|
"vue": "^3.5.42",
|
|
233
236
|
"vue-tsc": "^3.3.11"
|
|
234
237
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
top: number;
|
|
3
|
-
left: number;
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
/** Numeric border-radius string (e.g. "12" or "24px") */
|
|
7
|
-
radius: string;
|
|
8
|
-
/** z-index for this ring — caller sets per stacking layer */
|
|
9
|
-
z: number;
|
|
10
|
-
near: boolean;
|
|
11
|
-
hovered: boolean;
|
|
12
|
-
dimmed: boolean;
|
|
13
|
-
};
|
|
14
|
-
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
15
|
-
export default _default;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
text: string;
|
|
3
|
-
size?: string;
|
|
4
|
-
};
|
|
5
|
-
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
6
|
-
size: string;
|
|
7
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
8
|
-
export default _default;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
width?: number;
|
|
3
|
-
transparent?: boolean;
|
|
4
|
-
header?: boolean;
|
|
5
|
-
footer?: boolean;
|
|
6
|
-
};
|
|
7
|
-
declare function __VLS_template(): {
|
|
8
|
-
attrs: Partial<{}>;
|
|
9
|
-
slots: {
|
|
10
|
-
title?(_: {}): any;
|
|
11
|
-
content?(_: {}): any;
|
|
12
|
-
actions?(_: {}): any;
|
|
13
|
-
};
|
|
14
|
-
refs: {};
|
|
15
|
-
rootEl: HTMLDivElement;
|
|
16
|
-
};
|
|
17
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
18
|
-
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
19
|
-
width: number;
|
|
20
|
-
transparent: boolean;
|
|
21
|
-
header: boolean;
|
|
22
|
-
footer: boolean;
|
|
23
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
24
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
25
|
-
export default _default;
|
|
26
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
27
|
-
new (): {
|
|
28
|
-
$slots: S;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
width?: string;
|
|
3
|
-
height?: string;
|
|
4
|
-
};
|
|
5
|
-
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
6
|
-
export default _default;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
-
export default _default;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
icon?: string | null;
|
|
3
|
-
color?: string | null;
|
|
4
|
-
image?: string | null;
|
|
5
|
-
iconSize: number;
|
|
6
|
-
showLoadingIndicator?: boolean;
|
|
7
|
-
isLoading?: boolean;
|
|
8
|
-
};
|
|
9
|
-
declare function __VLS_template(): {
|
|
10
|
-
attrs: Partial<{}>;
|
|
11
|
-
slots: {
|
|
12
|
-
'bottom-right'?(_: {
|
|
13
|
-
foregroundColor: string;
|
|
14
|
-
}): any;
|
|
15
|
-
};
|
|
16
|
-
refs: {};
|
|
17
|
-
rootEl: HTMLDivElement;
|
|
18
|
-
};
|
|
19
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
20
|
-
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
21
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
22
|
-
export default _default;
|
|
23
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
24
|
-
new (): {
|
|
25
|
-
$slots: S;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
title: string;
|
|
3
|
-
};
|
|
4
|
-
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
|
-
export default _default;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export type UpdateState = 'idle' | 'updating' | 'done' | 'failed' | 'cleared';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
state?: UpdateState;
|
|
4
|
-
updateAvailable?: boolean;
|
|
5
|
-
nextVersion?: string;
|
|
6
|
-
};
|
|
7
|
-
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
8
|
-
export default _default;
|