@antcde/component-library 0.1.29 → 0.1.30

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.
@@ -0,0 +1,7 @@
1
+ export declare const antAutoImportOptions: {
2
+ imports: ("vue" | "@vueuse/core" | "@vueuse/math" | {
3
+ vuetify: string[];
4
+ })[];
5
+ dirs: string[];
6
+ exclude: RegExp[];
7
+ };
@@ -0,0 +1,12 @@
1
+ // One AutoImport surface for build and test. scripts/lib/auto-imports.mjs strips
2
+ // every import this covers, so a test run without it fails on a gated file.
3
+ export const antAutoImportOptions = {
4
+ imports: [
5
+ 'vue',
6
+ '@vueuse/core',
7
+ '@vueuse/math',
8
+ { vuetify: ['useDisplay'] },
9
+ ],
10
+ dirs: ['src/composables', 'src/stores', 'src/plugins'],
11
+ exclude: [/dist/, /src\/plugins\/vuetify\.ts$/, /\bnode_modules\b/],
12
+ };
package/dist/build/uno.js CHANGED
@@ -2,8 +2,8 @@ import presetRemToPx from '@unocss/preset-rem-to-px';
2
2
  import presetTypography from '@unocss/preset-typography';
3
3
  import presetWind4 from '@unocss/preset-wind4';
4
4
  import { defineConfig, transformerDirectives, transformerVariantGroup } from 'unocss';
5
- import { libraryClassSafelist } from './uno.safelist';
6
- import { antShortcuts } from './uno.shortcuts';
5
+ import { libraryClassSafelist } from './uno.safelist.js';
6
+ import { antShortcuts } from './uno.shortcuts.js';
7
7
  const antColors = {
8
8
  primary: '#125CFF',
9
9
  secondary: '#64748B',
@@ -4,7 +4,7 @@
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
- * 244 classes, from 949 candidates, filtered by asking Uno
7
+ * 265 classes, from 974 candidates, filtered by asking Uno
8
8
  * which ones actually resolve.
9
9
  */
10
10
  export declare const libraryClassSafelist: string[];
@@ -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
- * 244 classes, from 949 candidates, filtered by asking Uno
7
+ * 265 classes, from 974 candidates, filtered by asking Uno
8
8
  * which ones actually resolve.
9
9
  */
10
10
  export const libraryClassSafelist = [
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',
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', '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',
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 = [
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,14 +35,14 @@ export const antShortcuts = [
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-colors'],
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
  // The bare input that goes INSIDE `ant-pill-input`. The wrapper owns the border
38
41
  // and the focus treatment, so the field itself must contribute no chrome at all —
39
42
  // this is the second half of the design system's own worked example.
40
43
  ['ant-bare-input', 'flex-1 min-w-0 w-full bg-transparent border-0 outline-none text-sm text-heading placeholder:text-muted'],
41
44
  ['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)]'],
42
- ['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'],
45
+ ['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'],
43
46
  ['ant-pill-menu__item--active', 'bg-primary/8 hover:bg-primary/12'],
44
47
  // ── The documented ANT-OS semantic vocabulary, added in AAD-980 ─────────
45
48
  //
@@ -64,7 +67,7 @@ export const antShortcuts = [
64
67
  // consequence — a dropdown hides exactly the copy the user needs. A selected
65
68
  // row BORDERS AND WASHES at 5%; it is never a filled row (a filled pill means
66
69
  // a selected filter chip, which is a different thing).
67
- ['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'],
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 ant-hover-transition hover:bg-ant-hover'],
68
71
  ['ant-option-row--on', '!border-primary bg-primary/5 hover:bg-primary/8'],
69
72
  // Always-on guidance at the top of a complex section. The system's first form
70
73
  // rule is that every one of them opens with one: "Titles alone don't teach."
@@ -129,7 +132,7 @@ export const antShortcuts = [
129
132
  // Bespoke check-square — contrasty unchecked state BY DEFAULT (inset fill +
130
133
  // visible border) so it never goes white-on-white. Put an mdi-check inside and
131
134
  // add `ant-check--on` (primary) or `ant-check--danger` (error) when checked.
132
- ['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'],
135
+ ['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'],
133
136
  ['ant-check--on', '!bg-primary !border-primary text-white'],
134
137
  ['ant-check--danger', '!bg-error !border-error text-white'],
135
138
  // ── Page, section and tab vocabulary (AAD-980 detail redesign) ──────────
@@ -170,7 +173,7 @@ export const antShortcuts = [
170
173
  // order the classes appear in the attribute. Without `!` an active tab is muted
171
174
  // grey exactly as often as the generator happens to sort the other way.
172
175
  ['ant-tab-tray', 'inline-flex items-center p-1 rounded-[10px] bg-ant-inset border border-ant'],
173
- ['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'],
176
+ ['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'],
174
177
  ['ant-tab-pill--active', 'bg-ant-surface !text-heading font-medium shadow-[0_1px_2px_rgba(0,0,0,0.05)]'],
175
178
  ['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'],
176
179
  // Two more CTA variants. Neutral is the secondary action that makes no colour
@@ -189,7 +192,7 @@ export const antShortcuts = [
189
192
  //
190
193
  // 13px type, not 14: a rail is scanned down, not read across, and the system's
191
194
  // scale is off the Tailwind ramp on purpose.
192
- ['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'],
195
+ ['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'],
193
196
  ['ant-rail-item--active', 'bg-primary/10 !text-primary font-medium'],
194
197
  // Count beside a rail label. Mono, because these are quantities you compare
195
198
  // between rows rather than read as words.
@@ -8,9 +8,7 @@ import Icons from 'unplugin-icons/rolldown';
8
8
  import Components from 'unplugin-vue-components/rolldown';
9
9
  import { defineConfig, mergeConfig } from 'vite';
10
10
  import vuetify from 'vite-plugin-vuetify';
11
- const RE_DIST = /dist/;
12
- const RE_VUETIFY_PLUGIN = /src\/plugins\/vuetify\.ts$/;
13
- const RE_NODE_MODULES = /\bnode_modules\b/;
11
+ import { antAutoImportOptions } from './autoImport.js';
14
12
  /** Canonical CSS layer order declaration — single source of truth for Vuetify 4 + UnoCSS cascade. */
15
13
  export const CSS_LAYER_ORDER = '@layer uno-base, uno-theme, vuetify-core, vuetify-components, vuetify-overrides, vuetify-utilities, uno-shortcuts, uno-default, vuetify-final;';
16
14
  /**
@@ -56,16 +54,9 @@ export function createAntViteConfig(appRoot, overrides = {}) {
56
54
  vuetify({ autoImport: { labs: true } }),
57
55
  Icons({ autoInstall: true }),
58
56
  AutoImport({
59
- imports: [
60
- 'vue',
61
- '@vueuse/core',
62
- '@vueuse/math',
63
- { vuetify: ['useDisplay'] },
64
- ],
65
- dirs: ['src/composables', 'src/stores', 'src/plugins'],
57
+ ...antAutoImportOptions,
66
58
  dts: true,
67
59
  eslintrc: { enabled: true },
68
- exclude: [RE_DIST, RE_VUETIFY_PLUGIN, RE_NODE_MODULES],
69
60
  }),
70
61
  Components({
71
62
  dirs: ['src/components'],