@antcde/component-library 0.1.29 → 0.1.30-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/dist/build/autoImport.d.ts +7 -0
- package/dist/build/autoImport.js +12 -0
- package/dist/build/uno.js +2 -2
- package/dist/build/uno.safelist.d.ts +1 -1
- package/dist/build/uno.safelist.js +44 -40
- package/dist/build/uno.shortcuts.js +9 -6
- package/dist/build/vite.js +2 -11
- package/dist/index.js +6925 -6596
- package/dist/test/vitest.js +3 -0
- package/dist/types/components/form/AntColumnMapRow.vue.d.ts +42 -0
- package/dist/types/components/form/AntMultiSelect.vue.d.ts +31 -0
- package/dist/types/components/form/AntOptionPicker.types.d.ts +5 -0
- package/dist/types/components/form/AntOptionPicker.vue.d.ts +11 -21
- package/dist/types/components/form/AntResourceTile.vue.d.ts +14 -0
- package/dist/types/components/form/AntScopePanel.vue.d.ts +24 -0
- package/dist/types/components/form/AntSelect.vue.d.ts +6 -1
- package/dist/types/index.d.ts +5 -1
- package/lib/build/autoImport.ts +14 -0
- package/lib/build/checkFactories.mjs +18 -0
- package/lib/build/uno.safelist.ts +44 -40
- package/lib/build/uno.shortcuts.ts +9 -6
- package/lib/build/uno.ts +2 -2
- package/lib/build/vite.ts +2 -12
- package/lib/test/vitest.ts +3 -0
- package/package.json +16 -16
package/dist/test/vitest.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { fileURLToPath, URL } from 'node:url';
|
|
2
2
|
import vue from '@vitejs/plugin-vue';
|
|
3
|
+
import AutoImport from 'unplugin-auto-import/vite';
|
|
3
4
|
import vuetify from 'vite-plugin-vuetify';
|
|
4
5
|
import { defineConfig, mergeConfig } from 'vitest/config';
|
|
6
|
+
import { antAutoImportOptions } from '../build/autoImport.js';
|
|
5
7
|
/**
|
|
6
8
|
* Creates a Vitest config pre-configured for ANT platform packages.
|
|
7
9
|
*
|
|
@@ -25,6 +27,7 @@ export function createAntVitestConfig(appRoot, overrides = {}) {
|
|
|
25
27
|
plugins: [
|
|
26
28
|
vue(),
|
|
27
29
|
vuetify({ autoImport: true }),
|
|
30
|
+
AutoImport({ ...antAutoImportOptions, dts: false, eslintrc: { enabled: false } }),
|
|
28
31
|
],
|
|
29
32
|
resolve: {
|
|
30
33
|
extensions: ['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json', '.vue'],
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One dataset column: whether it is returned, what callers see it as, and — for
|
|
3
|
+
* a file source — its type. Promoted from the triggers app (AAD-982). Owns no copy.
|
|
4
|
+
*
|
|
5
|
+
* Table vs file is expressed by CAPABILITY props, not a mode flag: `types` makes
|
|
6
|
+
* the type a choice (a file declares none), `editableSource` makes the source
|
|
7
|
+
* name a claim (a file's header is typed by the publisher). Writes leave as events.
|
|
8
|
+
*/
|
|
9
|
+
type __VLS_Props = {
|
|
10
|
+
sourceName: string;
|
|
11
|
+
selected: boolean;
|
|
12
|
+
editableSource?: boolean;
|
|
13
|
+
removable?: boolean;
|
|
14
|
+
returnedKey: string;
|
|
15
|
+
type?: string;
|
|
16
|
+
types?: readonly string[];
|
|
17
|
+
/** Resolved message, or null. The parent owns the wording. */
|
|
18
|
+
keyError?: string | null;
|
|
19
|
+
selectLabel: string;
|
|
20
|
+
/** Placeholder for the source field. Required only when `editableSource`. */
|
|
21
|
+
sourceLabel?: string;
|
|
22
|
+
/** Resolved qualifier about the source, e.g. how often it is empty. */
|
|
23
|
+
sourceHint?: string;
|
|
24
|
+
keyLabel: string;
|
|
25
|
+
typeLabel: string;
|
|
26
|
+
removeLabel?: string;
|
|
27
|
+
};
|
|
28
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
29
|
+
toggle: () => any;
|
|
30
|
+
remove: () => any;
|
|
31
|
+
"update:sourceName": (value: string) => any;
|
|
32
|
+
"update:returnedKey": (value: string) => any;
|
|
33
|
+
"update:type": (value: string) => any;
|
|
34
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
35
|
+
onToggle?: (() => any) | undefined;
|
|
36
|
+
onRemove?: (() => any) | undefined;
|
|
37
|
+
"onUpdate:sourceName"?: ((value: string) => any) | undefined;
|
|
38
|
+
"onUpdate:returnedKey"?: ((value: string) => any) | undefined;
|
|
39
|
+
"onUpdate:type"?: ((value: string) => any) | undefined;
|
|
40
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
41
|
+
declare const _default: typeof __VLS_export;
|
|
42
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SelectOption } from './AntSelect.vue';
|
|
2
|
+
declare const __VLS_export: <T extends string>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<({
|
|
4
|
+
options: SelectOption<T>[];
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
/** Names the trigger; the root is `v-menu`, so a fallthrough attribute would miss it. */
|
|
8
|
+
ariaLabel?: string;
|
|
9
|
+
error?: boolean;
|
|
10
|
+
max?: number;
|
|
11
|
+
} & {
|
|
12
|
+
modelValue: T[];
|
|
13
|
+
}) & {
|
|
14
|
+
"onUpdate:modelValue"?: ((value: T[]) => any) | undefined;
|
|
15
|
+
}> & (typeof globalThis extends {
|
|
16
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
17
|
+
} ? P : {});
|
|
18
|
+
expose: (exposed: {}) => void;
|
|
19
|
+
attrs: any;
|
|
20
|
+
slots: {};
|
|
21
|
+
emit: (event: "update:modelValue", value: T[]) => void;
|
|
22
|
+
}>) => import('vue').VNode & {
|
|
23
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
24
|
+
};
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
export default _default;
|
|
27
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
28
|
+
[K in keyof T]: T[K];
|
|
29
|
+
} : {
|
|
30
|
+
[K in keyof T as K]: T[K];
|
|
31
|
+
}) & {};
|
|
@@ -16,4 +16,9 @@ export interface OptionRow<T = string> {
|
|
|
16
16
|
/** Render `meta` in the mono face with tabular figures (versions, identifiers). */
|
|
17
17
|
mono?: boolean;
|
|
18
18
|
disabled?: boolean;
|
|
19
|
+
/** A small neutral pill beside the title: a property of the option, not its state. */
|
|
20
|
+
tag?: {
|
|
21
|
+
label: string;
|
|
22
|
+
icon?: string;
|
|
23
|
+
};
|
|
19
24
|
}
|
|
@@ -5,35 +5,25 @@ declare const __VLS_export: <T extends string | number>(__VLS_props: NonNullable
|
|
|
5
5
|
/** Checkbox semantics and an array model instead of radio semantics. */
|
|
6
6
|
multi?: boolean;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Names the group.
|
|
10
|
-
*
|
|
11
|
-
* ⚠️ REQUIRED, deliberately. The root always renders `role="group"` or
|
|
12
|
-
* `role="radiogroup"` and this is its only naming mechanism — the visible
|
|
13
|
-
* heading sits outside in the caller's `AntField`, which has no id to point
|
|
14
|
-
* `aria-labelledby` at. Omitting it produced an announced-but-unnamed control
|
|
15
|
-
* group, so the type now says so rather than the doc comment asking nicely.
|
|
16
|
-
* Every call site already passed it; nothing had to change to make it required.
|
|
17
|
-
*
|
|
18
|
-
* This is a BREAKING change for external consumers of the published package —
|
|
19
|
-
* deliberately, since the compile error is the only thing that tells them they
|
|
20
|
-
* have an unnamed control group. Documented with a migration in
|
|
21
|
-
* `.changeset/option-picker-aria-label-required.md`.
|
|
22
|
-
*/
|
|
23
|
-
ariaLabel: string;
|
|
24
|
-
} & {
|
|
8
|
+
/** Two models rather than one loose union, so no call site has to narrow. */
|
|
25
9
|
value?: T;
|
|
26
10
|
values?: T[];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
11
|
+
} & ({
|
|
12
|
+
'aria-label': string;
|
|
13
|
+
ariaLabel?: string;
|
|
14
|
+
} | {
|
|
15
|
+
ariaLabel: string;
|
|
16
|
+
'aria-label'?: string;
|
|
17
|
+
})) & {
|
|
18
|
+
"onUpdate:value"?: ((value: T) => any) | undefined;
|
|
19
|
+
"onUpdate:values"?: ((values: T[]) => any) | undefined;
|
|
30
20
|
}> & (typeof globalThis extends {
|
|
31
21
|
__VLS_PROPS_FALLBACK: infer P;
|
|
32
22
|
} ? P : {});
|
|
33
23
|
expose: (exposed: {}) => void;
|
|
34
24
|
attrs: any;
|
|
35
25
|
slots: {};
|
|
36
|
-
emit: ((
|
|
26
|
+
emit: ((evt: "update:value", value: T) => void) & ((evt: "update:values", values: T[]) => void);
|
|
37
27
|
}>) => import('vue').VNode & {
|
|
38
28
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
39
29
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
title: string;
|
|
3
|
+
/** Accessible name of the service badge, e.g. "Service". */
|
|
4
|
+
badgeLabel: string;
|
|
5
|
+
icon?: string | null;
|
|
6
|
+
/** `#rrggbb`; anything else falls back to the palette. */
|
|
7
|
+
color?: string | null;
|
|
8
|
+
image?: string | null;
|
|
9
|
+
size?: number;
|
|
10
|
+
radius?: number;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_export: 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>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** `fixed` — frozen for every caller. `caller` — the caller may narrow it. */
|
|
3
|
+
scope: 'fixed' | 'caller';
|
|
4
|
+
title: string;
|
|
5
|
+
/** Short right-aligned qualifier, e.g. "Clamped to your cap". */
|
|
6
|
+
note?: string;
|
|
7
|
+
/** No card chrome — a plain titled section, for use inside a dialog. */
|
|
8
|
+
bare?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare var __VLS_6: {}, __VLS_22: {};
|
|
11
|
+
type __VLS_Slots = {} & {
|
|
12
|
+
default?: (props: typeof __VLS_6) => any;
|
|
13
|
+
} & {
|
|
14
|
+
default?: (props: typeof __VLS_22) => any;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_base: 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>;
|
|
17
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -65,7 +65,12 @@ declare const __VLS_export: <T extends string>(__VLS_props: NonNullable<Awaited<
|
|
|
65
65
|
} ? P : {});
|
|
66
66
|
expose: (exposed: {}) => void;
|
|
67
67
|
attrs: any;
|
|
68
|
-
slots: {
|
|
68
|
+
slots: {
|
|
69
|
+
/** Media before an option's title — in the list and on the trigger — e.g. a tile or avatar. */
|
|
70
|
+
leading?: (props: {
|
|
71
|
+
option: SelectOption<T>;
|
|
72
|
+
}) => any;
|
|
73
|
+
};
|
|
69
74
|
emit: (event: "update:modelValue", value: T) => void;
|
|
70
75
|
}>) => import('vue').VNode & {
|
|
71
76
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ import { default as VersionPublishDialog } from './components/VersionPublishDial
|
|
|
28
28
|
import { default as AntTourZone } from './components/AntTourZone/index.vue';
|
|
29
29
|
import { default as AntActionMenu } from './components/form/AntActionMenu.vue';
|
|
30
30
|
import { default as AntCheckboxCards } from './components/form/AntCheckboxCards.vue';
|
|
31
|
+
import { default as AntColumnMapRow } from './components/form/AntColumnMapRow.vue';
|
|
31
32
|
import { default as AntDialogShell } from './components/form/AntDialogShell.vue';
|
|
32
33
|
import { default as AntField } from './components/form/AntField.vue';
|
|
33
34
|
import { default as AntFilterChips } from './components/form/AntFilterChips.vue';
|
|
@@ -35,11 +36,14 @@ import { default as AntFilterSelect } from './components/form/AntFilterSelect.vu
|
|
|
35
36
|
import { default as AntHintBanner } from './components/form/AntHintBanner.vue';
|
|
36
37
|
import { default as AntHintTip } from './components/form/AntHintTip.vue';
|
|
37
38
|
import { default as AntInput } from './components/form/AntInput.vue';
|
|
39
|
+
import { default as AntMultiSelect } from './components/form/AntMultiSelect.vue';
|
|
38
40
|
import { default as AntNumberField } from './components/form/AntNumberField.vue';
|
|
39
41
|
import { default as AntOptionPicker } from './components/form/AntOptionPicker.vue';
|
|
40
42
|
import { default as AntPanelSection } from './components/form/AntPanelSection.vue';
|
|
41
43
|
import { default as AntRadioCards } from './components/form/AntRadioCards.vue';
|
|
44
|
+
import { default as AntResourceTile } from './components/form/AntResourceTile.vue';
|
|
42
45
|
import { default as AntSaveBar } from './components/form/AntSaveBar.vue';
|
|
46
|
+
import { default as AntScopePanel } from './components/form/AntScopePanel.vue';
|
|
43
47
|
import { default as AntSearchField } from './components/form/AntSearchField.vue';
|
|
44
48
|
import { default as AntSectionCard } from './components/form/AntSectionCard.vue';
|
|
45
49
|
import { default as AntSelect } from './components/form/AntSelect.vue';
|
|
@@ -59,7 +63,7 @@ export type { StackedLabel } from './components/StackedLabels/index.vue';
|
|
|
59
63
|
export type { FlowChannelSubscriber } from './components/TasksFlow/composables/useTaskFlow';
|
|
60
64
|
export type { WindowSizePreset, WindowTab } from './components/UnifiedWindow/types';
|
|
61
65
|
export * from '@antcde/vue-utils';
|
|
62
|
-
export { AntActionMenu, AntCheckboxCards, AntDialogShell, AntField, AntFilterChips, AntFilterSelect, AntHintBanner, AntHintTip, AntInput, AntNumberField, AntOptionPicker, AntPanelSection, AntRadioCards, AntSaveBar, AntSearchField, AntSectionCard, AntSelect, AntStatusPill, AntToggle, AntTourZone, BaseAntButton, BaseAntCard, BaseAntCreateCard, BaseAntDatePicker, BaseAntInput, BaseAntLoading, BaseAppCard, BaseAppCardSkeleton, BaseClickableIcon, BaseConfirmDialog, BaseDeleteDialog, BaseDialog, BaseLimitedButton, BaseResizePanel, BulkLabelsMenu, DmsFilePicker, FilePreviewContent, FlowWindowContent, GlobalLabelBadge, LabelsMenuCard, PermissionCard, RichTextEditor, StackedLabels, TaskFlow, UnifiedWindow, VersionPublishDialog, };
|
|
66
|
+
export { AntActionMenu, AntCheckboxCards, AntColumnMapRow, AntDialogShell, AntField, AntFilterChips, AntFilterSelect, AntHintBanner, AntHintTip, AntInput, AntMultiSelect, AntNumberField, AntOptionPicker, AntPanelSection, AntRadioCards, AntResourceTile, AntSaveBar, AntScopePanel, AntSearchField, AntSectionCard, AntSelect, AntStatusPill, AntToggle, AntTourZone, BaseAntButton, BaseAntCard, BaseAntCreateCard, BaseAntDatePicker, BaseAntInput, BaseAntLoading, BaseAppCard, BaseAppCardSkeleton, BaseClickableIcon, BaseConfirmDialog, BaseDeleteDialog, BaseDialog, BaseLimitedButton, BaseResizePanel, BulkLabelsMenu, DmsFilePicker, FilePreviewContent, FlowWindowContent, GlobalLabelBadge, LabelsMenuCard, PermissionCard, RichTextEditor, StackedLabels, TaskFlow, UnifiedWindow, VersionPublishDialog, };
|
|
63
67
|
/**
|
|
64
68
|
* ⚠️ `BaseAntInput` and `BaseAntDatePicker` are the SUPERSEDED field idiom —
|
|
65
69
|
* wrappers around Vuetify fields, whose border weight and floating notched label
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Options } from 'unplugin-auto-import/types'
|
|
2
|
+
|
|
3
|
+
// One AutoImport surface for build and test. scripts/lib/auto-imports.mjs strips
|
|
4
|
+
// every import this covers, so a test run without it fails on a gated file.
|
|
5
|
+
export const antAutoImportOptions = {
|
|
6
|
+
imports: [
|
|
7
|
+
'vue',
|
|
8
|
+
'@vueuse/core',
|
|
9
|
+
'@vueuse/math',
|
|
10
|
+
{ vuetify: ['useDisplay'] },
|
|
11
|
+
],
|
|
12
|
+
dirs: ['src/composables', 'src/stores', 'src/plugins'],
|
|
13
|
+
exclude: [/dist/, /src\/plugins\/vuetify\.ts$/, /\bnode_modules\b/],
|
|
14
|
+
} satisfies Options
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Loads each compiled factory the way an npm consumer's plain Node does (AAD-1098).
|
|
2
|
+
// The monorepo bundles configs, so an extensionless import only fails once published.
|
|
3
|
+
const entries = ['build/uno', 'build/vite', 'test/vitest']
|
|
4
|
+
|
|
5
|
+
const failed = []
|
|
6
|
+
for (const entry of entries) {
|
|
7
|
+
try {
|
|
8
|
+
await import(new URL(`../../dist/${entry}.js`, import.meta.url).href)
|
|
9
|
+
}
|
|
10
|
+
catch (e) {
|
|
11
|
+
failed.push(`dist/${entry}.js: ${e.message.split('\n')[0]}`)
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (failed.length) {
|
|
16
|
+
console.error(`Factory entry points do not load under plain Node:\n ${failed.join('\n ')}`)
|
|
17
|
+
process.exit(1)
|
|
18
|
+
}
|
|
@@ -4,49 +4,53 @@
|
|
|
4
4
|
* Every utility class this library's own components use, so a consuming app emits
|
|
5
5
|
* them even though UnoCSS never scans `dist/index.js`. See the generator for why.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* 265 classes, from 974 candidates, filtered by asking Uno
|
|
8
8
|
* which ones actually resolve.
|
|
9
9
|
*/
|
|
10
10
|
export const libraryClassSafelist: string[] = [
|
|
11
|
-
'absolute', 'align-middle', 'align-start', 'ant-
|
|
12
|
-
'ant-hint-banner', 'ant-icon-button', 'ant-option-row', 'ant-option-row--on', 'ant-pill',
|
|
13
|
-
'ant-pill-input', 'ant-pill-input--button', 'ant-pill-menu', 'ant-pill-menu__item', 'ant-pill-menu__item--active',
|
|
14
|
-
'ant-radio--on', 'ant-radio__dot', 'ant-save-bar', 'ant-section__header', 'basis-full',
|
|
15
|
-
'bg-ant-
|
|
16
|
-
'bg-success', 'bg-transparent', 'bg-warning', 'bg-white', 'bg-white/12',
|
|
17
|
-
'border', 'border-0', 'border-2', 'border-ant', 'border-b',
|
|
18
|
-
'border-none', 'border-opacity-50', 'border-primary', 'border-t', 'border-white/20',
|
|
19
|
-
'capitalize', 'cursor-help', 'cursor-not-allowed', 'cursor-pointer', 'disabled:cursor-not-allowed',
|
|
20
|
-
'disabled:opacity-50', 'duration-150', 'duration-200', 'ease-in', 'ease-out',
|
|
21
|
-
'flex-1', 'flex-col', 'flex-grow-1', 'flex-shrink-0', 'flex-wrap',
|
|
22
|
-
'focus-visible:opacity-100', 'focus-visible:outline-2', 'focus-visible:outline-offset-2', 'focus-visible:outline-primary', 'focus-within:border-primary',
|
|
23
|
-
'focus:border-primary', 'focus:outline-none', 'focus:ring-error/10', 'focus:ring-primary/10', 'font-[inherit]',
|
|
24
|
-
'font-mono', 'font-normal', 'font-semibold', 'gap-0.5', 'gap-1',
|
|
25
|
-
'gap-2', 'gap-3', 'gap-8', 'gap-[5px]', 'gap-[6px]',
|
|
26
|
-
'
|
|
27
|
-
'h-
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'
|
|
11
|
+
'absolute', 'align-middle', 'align-start', 'ant-cat-chip', 'ant-check', 'ant-check--on',
|
|
12
|
+
'ant-field-label', 'ant-hint-banner', 'ant-icon-button', 'ant-option-row', 'ant-option-row--on', 'ant-pill',
|
|
13
|
+
'ant-pill--sm', 'ant-pill-input', 'ant-pill-input--button', 'ant-pill-menu', 'ant-pill-menu__item', 'ant-pill-menu__item--active',
|
|
14
|
+
'ant-radio', 'ant-radio--on', 'ant-radio__dot', 'ant-save-bar', 'ant-section__header', 'basis-full',
|
|
15
|
+
'bg-ant-inset', 'bg-ant-panel', 'bg-ant-surface', 'bg-error', 'bg-primary', 'bg-primary/4',
|
|
16
|
+
'bg-primary/5', 'bg-success', 'bg-transparent', 'bg-warning', 'bg-white', 'bg-white/12',
|
|
17
|
+
'block', 'border', 'border-0', 'border-2', 'border-ant', 'border-b',
|
|
18
|
+
'border-error', 'border-none', 'border-opacity-50', 'border-primary', 'border-t', 'border-white/20',
|
|
19
|
+
'bottom-0', 'capitalize', 'cursor-help', 'cursor-not-allowed', 'cursor-pointer', 'disabled:cursor-not-allowed',
|
|
20
|
+
'disabled:hover:bg-transparent', 'disabled:opacity-50', 'duration-150', 'duration-200', 'ease-in', 'ease-out',
|
|
21
|
+
'flex', 'flex-1', 'flex-col', 'flex-grow-1', 'flex-shrink-0', 'flex-wrap',
|
|
22
|
+
'focus-visible:border-primary', 'focus-visible:opacity-100', 'focus-visible:outline-2', 'focus-visible:outline-offset-2', 'focus-visible:outline-primary', 'focus-within:border-primary',
|
|
23
|
+
'focus:border-error', 'focus:border-primary', 'focus:outline-none', 'focus:ring-error/10', 'focus:ring-primary/10', 'font-[inherit]',
|
|
24
|
+
'font-medium', 'font-mono', 'font-normal', 'font-semibold', 'gap-0.5', 'gap-1',
|
|
25
|
+
'gap-1.5', 'gap-2', 'gap-3', 'gap-8', 'gap-[5px]', 'gap-[6px]',
|
|
26
|
+
'gap-x-2', 'gap-y-1', 'grid', 'group-hover:bg-primary/4', 'group-hover:border-primary/60', 'h-11',
|
|
27
|
+
'h-2', 'h-4', 'h-7', 'h-8', 'h-[18px]', 'h-[22px]',
|
|
28
|
+
'h-full', 'hover:bg-ant-hover', 'hover:bg-primary/6', 'hover:bg-primary/8', 'hover:bg-white/10', 'hover:opacity-100',
|
|
29
|
+
'inline-block', 'inline-flex', 'items-baseline', 'items-center', 'items-start', 'justify-between',
|
|
30
|
+
'justify-center', 'justify-end', 'justify-start', 'last:border-b-0', 'leading-none', 'leading-relaxed',
|
|
31
|
+
'leading-snug', 'leading-tight', 'left-0.5', 'lg:flex-initial', 'lg:min-w-[220px]', 'm-0',
|
|
32
|
+
'max-h-[88vh]', 'max-w-[180px]', 'max-w-[240px]', 'mb-1', 'mb-2', 'mb-2.5',
|
|
33
|
+
'mb-3', 'mb-4', 'md:basis-auto', 'md:flex-1', 'md:max-w-[420px]', 'md:min-w-[260px]',
|
|
34
|
+
'min-h-11', 'min-w-0', 'min-w-[140px]', 'min-w-[168px]', 'min-w-[180px]', 'min-w-[200px]',
|
|
35
|
+
'min-w-[240px]', 'ml-1', 'ml-2', 'mr-1', 'mr-2', 'mr-2.5',
|
|
36
|
+
'ms-auto', 'mt-0.5', 'mt-1', 'mt-1.5', 'mt-2', 'mt-3',
|
|
37
|
+
'mt-px', 'my-1', 'object-cover', 'opacity-0', 'opacity-20', 'opacity-30',
|
|
38
|
+
'opacity-40', 'opacity-45', 'opacity-50', 'opacity-55', 'opacity-60', 'opacity-70',
|
|
39
|
+
'outline-none', 'overflow-hidden', 'overflow-y-auto', 'p-0', 'p-3.5', 'pa-2',
|
|
40
|
+
'pa-3', 'pb-0', 'pb-1', 'pb-2', 'pb-5', 'pl-1',
|
|
41
|
+
'pointer-events-none', 'position-relative', 'pr-1', 'pr-1.5', 'pt-1', 'pt-1.5',
|
|
42
|
+
'pt-2', 'pt-3', 'pt-5', 'px-0', 'px-1.5', 'px-15',
|
|
43
|
+
'px-2', 'px-3', 'px-3.5', 'px-4', 'px-5', 'px-5.5',
|
|
44
|
+
'py-0', 'py-0.5', 'py-1', 'py-1.5', 'py-2', 'py-2.5',
|
|
42
45
|
'py-3', 'py-4', 'py-5', 'py-6', 'relative', 'resize-y',
|
|
43
46
|
'right-0', 'rounded', 'rounded-2xl', 'rounded-[12px]', 'rounded-[20px]', 'rounded-full',
|
|
44
|
-
'rounded-xl', 'shadow', 'shadow-sm', 'shrink-0', '
|
|
45
|
-
'
|
|
46
|
-
'text-
|
|
47
|
-
'text-
|
|
48
|
-
'text-
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'w-[
|
|
47
|
+
'rounded-xl', 'select-none', 'shadow', 'shadow-sm', 'shrink-0', 'sm:grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto]',
|
|
48
|
+
'tabular-nums', 'text-[10px]', 'text-[11.5px]', 'text-[11px]', 'text-[12.5px]', 'text-[13.5px]',
|
|
49
|
+
'text-[13px]', 'text-black', 'text-body', 'text-center', 'text-error', 'text-heading',
|
|
50
|
+
'text-left', 'text-lg', 'text-muted', 'text-primary', 'text-sm', 'text-truncate',
|
|
51
|
+
'text-warning', 'text-warning-emphasis', 'text-white', 'text-white/45', 'text-wrap', 'text-xs',
|
|
52
|
+
'top-0.5', 'tracking-[0.16em]', 'transition-[border-color]', 'transition-all', 'transition-colors', 'transition-opacity',
|
|
53
|
+
'transition-transform', 'translate-x-0', 'translate-x-4', 'translate-y-4', 'truncate', 'uppercase',
|
|
54
|
+
'w-2', 'w-4', 'w-[18px]', 'w-[38px]', 'w-full', 'whitespace-normal',
|
|
55
|
+
'whitespace-nowrap',
|
|
52
56
|
]
|
|
@@ -25,6 +25,9 @@
|
|
|
25
25
|
* stadium. Write the 12px step as `rounded-[12px]`.
|
|
26
26
|
*/
|
|
27
27
|
export const antShortcuts: [string, string][] = [
|
|
28
|
+
// The one hover/selection motion. A row and the control inside it (a checkbox) must share
|
|
29
|
+
// it, or they change out of step — the row snaps while the box eases.
|
|
30
|
+
['ant-hover-transition', 'transition-[color,background-color,border-color] duration-150 ease-out'],
|
|
28
31
|
// Pill input / trigger (44px) and its floating menu.
|
|
29
32
|
//
|
|
30
33
|
// Promoted from `uno.storefront.ts` in AAD-980: these are the geometry behind the
|
|
@@ -32,7 +35,7 @@ export const antShortcuts: [string, string][] = [
|
|
|
32
35
|
// for anchoring only — which is the idiom the whole platform is standardising on.
|
|
33
36
|
// They have to live here before any component using them is shared, because a
|
|
34
37
|
// 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
|
|
38
|
+
['ant-pill-input', 'h-11 px-3.5 flex items-center gap-3 rounded-[12px] bg-ant-surface border border-ant text-heading ant-hover-transition'],
|
|
36
39
|
['ant-pill-input--button', 'ant-pill-input w-full whitespace-nowrap cursor-pointer hover:bg-ant-hover'],
|
|
37
40
|
|
|
38
41
|
// The bare input that goes INSIDE `ant-pill-input`. The wrapper owns the border
|
|
@@ -40,7 +43,7 @@ export const antShortcuts: [string, string][] = [
|
|
|
40
43
|
// this is the second half of the design system's own worked example.
|
|
41
44
|
['ant-bare-input', 'flex-1 min-w-0 w-full bg-transparent border-0 outline-none text-sm text-heading placeholder:text-muted'],
|
|
42
45
|
['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'],
|
|
46
|
+
['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 ant-hover-transition hover:bg-ant-hover'],
|
|
44
47
|
['ant-pill-menu__item--active', 'bg-primary/8 hover:bg-primary/12'],
|
|
45
48
|
|
|
46
49
|
// ── The documented ANT-OS semantic vocabulary, added in AAD-980 ─────────
|
|
@@ -67,7 +70,7 @@ export const antShortcuts: [string, string][] = [
|
|
|
67
70
|
// consequence — a dropdown hides exactly the copy the user needs. A selected
|
|
68
71
|
// row BORDERS AND WASHES at 5%; it is never a filled row (a filled pill means
|
|
69
72
|
// 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
|
|
73
|
+
['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 ant-hover-transition hover:bg-ant-hover'],
|
|
71
74
|
['ant-option-row--on', '!border-primary bg-primary/5 hover:bg-primary/8'],
|
|
72
75
|
|
|
73
76
|
// Always-on guidance at the top of a complex section. The system's first form
|
|
@@ -144,7 +147,7 @@ export const antShortcuts: [string, string][] = [
|
|
|
144
147
|
// Bespoke check-square — contrasty unchecked state BY DEFAULT (inset fill +
|
|
145
148
|
// visible border) so it never goes white-on-white. Put an mdi-check inside and
|
|
146
149
|
// 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
|
|
150
|
+
['ant-check', 'inline-flex items-center justify-center flex-shrink-0 w-[18px] h-[18px] rounded-[5px] border border-solid border-[rgba(var(--v-border-color),0.32)] bg-ant-surface ant-hover-transition'],
|
|
148
151
|
['ant-check--on', '!bg-primary !border-primary text-white'],
|
|
149
152
|
['ant-check--danger', '!bg-error !border-error text-white'],
|
|
150
153
|
|
|
@@ -191,7 +194,7 @@ export const antShortcuts: [string, string][] = [
|
|
|
191
194
|
// order the classes appear in the attribute. Without `!` an active tab is muted
|
|
192
195
|
// grey exactly as often as the generator happens to sort the other way.
|
|
193
196
|
['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
|
|
197
|
+
['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 ant-hover-transition hover:text-body'],
|
|
195
198
|
['ant-tab-pill--active', 'bg-ant-surface !text-heading font-medium shadow-[0_1px_2px_rgba(0,0,0,0.05)]'],
|
|
196
199
|
['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
200
|
|
|
@@ -212,7 +215,7 @@ export const antShortcuts: [string, string][] = [
|
|
|
212
215
|
//
|
|
213
216
|
// 13px type, not 14: a rail is scanned down, not read across, and the system's
|
|
214
217
|
// 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
|
|
218
|
+
['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 ant-hover-transition hover:bg-ant-hover'],
|
|
216
219
|
['ant-rail-item--active', 'bg-primary/10 !text-primary font-medium'],
|
|
217
220
|
|
|
218
221
|
// Count beside a rail label. Mono, because these are quantities you compare
|
package/lib/build/uno.ts
CHANGED
|
@@ -3,8 +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
|
+
import { libraryClassSafelist } from './uno.safelist.js'
|
|
7
|
+
import { antShortcuts } from './uno.shortcuts.js'
|
|
8
8
|
|
|
9
9
|
const antColors = {
|
|
10
10
|
primary: '#125CFF',
|
package/lib/build/vite.ts
CHANGED
|
@@ -9,10 +9,7 @@ import Icons from 'unplugin-icons/rolldown'
|
|
|
9
9
|
import Components from 'unplugin-vue-components/rolldown'
|
|
10
10
|
import { defineConfig, mergeConfig } from 'vite'
|
|
11
11
|
import vuetify from 'vite-plugin-vuetify'
|
|
12
|
-
|
|
13
|
-
const RE_DIST = /dist/
|
|
14
|
-
const RE_VUETIFY_PLUGIN = /src\/plugins\/vuetify\.ts$/
|
|
15
|
-
const RE_NODE_MODULES = /\bnode_modules\b/
|
|
12
|
+
import { antAutoImportOptions } from './autoImport.js'
|
|
16
13
|
|
|
17
14
|
/** Canonical CSS layer order declaration — single source of truth for Vuetify 4 + UnoCSS cascade. */
|
|
18
15
|
export const CSS_LAYER_ORDER = '@layer uno-base, uno-theme, vuetify-core, vuetify-components, vuetify-overrides, vuetify-utilities, uno-shortcuts, uno-default, vuetify-final;'
|
|
@@ -61,16 +58,9 @@ export function createAntViteConfig(appRoot: string | URL, overrides: UserConfig
|
|
|
61
58
|
vuetify({ autoImport: { labs: true } }),
|
|
62
59
|
Icons({ autoInstall: true }),
|
|
63
60
|
AutoImport({
|
|
64
|
-
|
|
65
|
-
'vue',
|
|
66
|
-
'@vueuse/core',
|
|
67
|
-
'@vueuse/math',
|
|
68
|
-
{ vuetify: ['useDisplay'] },
|
|
69
|
-
],
|
|
70
|
-
dirs: ['src/composables', 'src/stores', 'src/plugins'],
|
|
61
|
+
...antAutoImportOptions,
|
|
71
62
|
dts: true,
|
|
72
63
|
eslintrc: { enabled: true },
|
|
73
|
-
exclude: [RE_DIST, RE_VUETIFY_PLUGIN, RE_NODE_MODULES],
|
|
74
64
|
}),
|
|
75
65
|
Components({
|
|
76
66
|
dirs: ['src/components'],
|
package/lib/test/vitest.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { fileURLToPath, URL } from 'node:url'
|
|
2
2
|
import vue from '@vitejs/plugin-vue'
|
|
3
|
+
import AutoImport from 'unplugin-auto-import/vite'
|
|
3
4
|
import vuetify from 'vite-plugin-vuetify'
|
|
4
5
|
import { defineConfig, mergeConfig } from 'vitest/config'
|
|
6
|
+
import { antAutoImportOptions } from '../build/autoImport.js'
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* Creates a Vitest config pre-configured for ANT platform packages.
|
|
@@ -27,6 +29,7 @@ export function createAntVitestConfig(appRoot: string | URL, overrides: Record<s
|
|
|
27
29
|
plugins: [
|
|
28
30
|
vue(),
|
|
29
31
|
vuetify({ autoImport: true }),
|
|
32
|
+
AutoImport({ ...antAutoImportOptions, dts: false, eslintrc: { enabled: false } }),
|
|
30
33
|
],
|
|
31
34
|
resolve: {
|
|
32
35
|
extensions: ['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json', '.vue'],
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antcde/component-library",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.30-rc.1",
|
|
5
5
|
"description": "Helper to use ant components in Vue 3",
|
|
6
6
|
"author": "CollaborAll",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"types": "./dist/types/
|
|
9
|
+
"types": "./dist/types/index.d.ts",
|
|
10
10
|
"import": "./dist/index.js",
|
|
11
11
|
"require": "./dist/index.cjs.js"
|
|
12
12
|
},
|
|
13
13
|
"./composables/*": {
|
|
14
|
-
"types": "./dist/types/
|
|
14
|
+
"types": "./dist/types/composables/*.d.ts"
|
|
15
15
|
},
|
|
16
16
|
"./build/uno": {
|
|
17
17
|
"types": "./dist/build/uno.d.ts",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
},
|
|
87
87
|
"main": "./dist/index.js",
|
|
88
88
|
"module": "./dist/index.js",
|
|
89
|
-
"types": "./dist/types/
|
|
89
|
+
"types": "./dist/types/index.d.ts",
|
|
90
90
|
"files": [
|
|
91
91
|
"/dist",
|
|
92
92
|
"/lib",
|
|
@@ -95,14 +95,14 @@
|
|
|
95
95
|
],
|
|
96
96
|
"scripts": {
|
|
97
97
|
"dev": "vite",
|
|
98
|
-
"build": "pnpm build:safelist && vite build &&
|
|
99
|
-
"build:factories": "tsc -p tsconfig.factories.json",
|
|
98
|
+
"build": "pnpm build:safelist && vite build && pnpm build:factories",
|
|
99
|
+
"build:factories": "tsc -p tsconfig.factories.json && node lib/build/checkFactories.mjs",
|
|
100
100
|
"preview": "vite preview",
|
|
101
101
|
"test": "vitest --run",
|
|
102
102
|
"test:watch": "vitest",
|
|
103
|
-
"build-only": "rm -rf ./dist && vite build && tsc -p tsconfig.factories.json",
|
|
103
|
+
"build-only": "rm -rf ./dist && vite build && tsc -p tsconfig.factories.json && node lib/build/checkFactories.mjs",
|
|
104
104
|
"build-watch": "vite build --watch",
|
|
105
|
-
"prepublishOnly": "rm -rf ./dist && vite build && tsc -p tsconfig.factories.json",
|
|
105
|
+
"prepublishOnly": "rm -rf ./dist && vite build && tsc -p tsconfig.factories.json && node lib/build/checkFactories.mjs",
|
|
106
106
|
"clear": "pnpm dlx shx rm -rf dist",
|
|
107
107
|
"type-check": "vue-tsc --build --force",
|
|
108
108
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
@@ -205,21 +205,21 @@
|
|
|
205
205
|
"pdfjs-dist": "^6.3.289",
|
|
206
206
|
"qs": "^6.16.0",
|
|
207
207
|
"sanitize-html": "^2.17.7",
|
|
208
|
-
"vue-i18n": "^11.4.
|
|
208
|
+
"vue-i18n": "^11.4.12"
|
|
209
209
|
},
|
|
210
210
|
"devDependencies": {
|
|
211
|
-
"@antcde/connect-ts": "0.4.
|
|
212
|
-
"@antcde/vue-utils": "0.2.
|
|
211
|
+
"@antcde/connect-ts": "0.4.32-rc.2",
|
|
212
|
+
"@antcde/vue-utils": "0.2.27-rc.2",
|
|
213
213
|
"@iconify-json/mdi": "^1.2.3",
|
|
214
|
-
"@iconify/vue": "^5.0.
|
|
214
|
+
"@iconify/vue": "^5.0.3",
|
|
215
215
|
"@intlify/unplugin-vue-i18n": "^11.2.5",
|
|
216
216
|
"@mdi/font": "^7.2.96",
|
|
217
217
|
"@tsconfig/node22": "^22.0.6",
|
|
218
|
-
"@types/node": "^22.20.
|
|
218
|
+
"@types/node": "^22.20.4",
|
|
219
219
|
"@types/qs": "^6.15.1",
|
|
220
220
|
"@vitejs/plugin-vue": "^6.0.9",
|
|
221
221
|
"@vue/language-core": "^3.3.11",
|
|
222
|
-
"@vue/test-utils": "^2.5.
|
|
222
|
+
"@vue/test-utils": "^2.5.1",
|
|
223
223
|
"@vue/tsconfig": "^0.9.1",
|
|
224
224
|
"happy-dom": "^20.14.5",
|
|
225
225
|
"pinia": "^3.0.4",
|
|
@@ -229,10 +229,10 @@
|
|
|
229
229
|
"vite": "^8.3.0",
|
|
230
230
|
"vite-node": "^6.0.0",
|
|
231
231
|
"vite-plugin-css-injected-by-js": "^5.0.2",
|
|
232
|
-
"vite-plugin-dts": "^5.1.
|
|
232
|
+
"vite-plugin-dts": "^5.1.1",
|
|
233
233
|
"vite-plugin-vuetify": "^2.1.3",
|
|
234
234
|
"vitest": "^5.0.1",
|
|
235
|
-
"vue": "^3.5.
|
|
235
|
+
"vue": "^3.5.43",
|
|
236
236
|
"vue-tsc": "^3.3.11"
|
|
237
237
|
}
|
|
238
238
|
}
|