@urbicon-ui/blocks 6.33.0 → 6.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,15 @@
1
1
  import type { mintRegistry } from './registry.js';
2
- import type { MicroInteractionConfig, Mint } from './types.js';
3
2
  /**
4
- * Generic micro-interaction factory
3
+ * Built-in micro-interaction registrations.
4
+ *
5
+ * The generic engine (`createMicroInteraction`) and the statically-shipped
6
+ * default (`scaleMint`) live in `./engine.ts` — this module must contain ONLY
7
+ * registration code, because it is reachable exclusively through the
8
+ * demand-loaded `./presets.ts` chunk. Anything defined here would otherwise
9
+ * be dragged back into every component's initial bundle once a statically
10
+ * imported module shared it (Rollup assigns a shared module's whole
11
+ * used-export-set to the chunk that statically owns it).
5
12
  */
6
- export declare function createMicroInteraction(className: string, defaultConfig?: MicroInteractionConfig): Mint<MicroInteractionConfig>;
7
13
  /**
8
14
  * Register all default micro-interaction mints.
9
15
  * Called by registerDefaultMints() - not at module level.
@@ -1,111 +1,42 @@
1
+ import { createMicroInteraction, prefersReducedMotion, scaleMint } from './engine.js';
1
2
  /**
2
- * Check if user prefers reduced motion
3
+ * Built-in micro-interaction registrations.
4
+ *
5
+ * The generic engine (`createMicroInteraction`) and the statically-shipped
6
+ * default (`scaleMint`) live in `./engine.ts` — this module must contain ONLY
7
+ * registration code, because it is reachable exclusively through the
8
+ * demand-loaded `./presets.ts` chunk. Anything defined here would otherwise
9
+ * be dragged back into every component's initial bundle once a statically
10
+ * imported module shared it (Rollup assigns a shared module's whole
11
+ * used-export-set to the chunk that statically owns it).
3
12
  */
4
- function prefersReducedMotion() {
5
- return window.matchMedia('(prefers-reduced-motion: reduce)').matches;
6
- }
7
- /**
8
- * Generic micro-interaction factory
9
- */
10
- export function createMicroInteraction(className, defaultConfig = {}) {
11
- return {
12
- init(el, config = {}) {
13
- // Merge default config with provided config
14
- const finalConfig = { ...defaultConfig, ...config };
15
- // Skip if disabled or prefers reduced motion
16
- if (finalConfig.disabled || prefersReducedMotion())
17
- return;
18
- const trigger = finalConfig.trigger || 'hover';
19
- const duration = finalConfig.duration || 200;
20
- const delay = finalConfig.delay || 0;
21
- // Determine event based on trigger
22
- const eventMap = {
23
- hover: 'mouseenter',
24
- click: 'click',
25
- focus: 'focus',
26
- load: 'load'
27
- };
28
- const event = eventMap[trigger] || 'mouseenter';
29
- const handler = () => {
30
- // Skip if this specific animation is already running
31
- const animatingAttr = `data-animating-${className}`;
32
- if (el.getAttribute(animatingAttr) === 'true')
33
- return;
34
- // Apply delay if specified
35
- const applyAnimation = () => {
36
- el.setAttribute(animatingAttr, 'true');
37
- // Add dynamic styles if intensity is specified
38
- if (finalConfig.intensity && className.includes('scale')) {
39
- el.style.setProperty('--scale-intensity', finalConfig.intensity.toString());
40
- }
41
- el.classList.add(className);
42
- const cleanup = () => {
43
- el.classList.remove(className);
44
- el.removeAttribute(animatingAttr);
45
- el.style.removeProperty('--scale-intensity');
46
- el.removeEventListener('animationend', cleanup);
47
- el.removeEventListener('transitionend', cleanup);
48
- };
49
- el.addEventListener('animationend', cleanup, { once: true });
50
- el.addEventListener('transitionend', cleanup, { once: true });
51
- // Fallback timeout
52
- setTimeout(cleanup, duration + 50);
53
- };
54
- if (delay > 0) {
55
- setTimeout(applyAnimation, delay);
56
- }
57
- else {
58
- applyAnimation();
59
- }
60
- };
61
- // Special handling for load trigger
62
- if (trigger === 'load') {
63
- // Execute immediately if element is already loaded
64
- requestAnimationFrame(() => handler());
65
- }
66
- else {
67
- el.addEventListener(event, handler, { passive: true });
68
- }
69
- // Store cleanup function
70
- this.destroy = () => {
71
- if (event !== 'load') {
72
- el.removeEventListener(event, handler);
73
- }
74
- };
75
- }
76
- };
77
- }
78
13
  /**
79
14
  * Register all default micro-interaction mints.
80
15
  * Called by registerDefaultMints() - not at module level.
81
16
  */
82
17
  export function registerMicroInteractions(registry) {
83
- registry.register('scale', (config) => createMicroInteraction('blocks-mint-scale', {
84
- trigger: 'hover',
85
- duration: 200,
86
- ...config
87
- }));
88
- registry.register('translate', (config) => createMicroInteraction('blocks-mint-translate', {
18
+ registry.registerBuiltin('scale', scaleMint);
19
+ registry.registerBuiltin('translate', (config) => createMicroInteraction('blocks-mint-translate', {
89
20
  trigger: 'hover',
90
21
  duration: 200,
91
22
  ...config
92
23
  }));
93
- registry.register('rotate', (config) => createMicroInteraction('blocks-mint-rotate', {
24
+ registry.registerBuiltin('rotate', (config) => createMicroInteraction('blocks-mint-rotate', {
94
25
  trigger: 'hover',
95
26
  duration: 200,
96
27
  ...config
97
28
  }));
98
- registry.register('glow', (config) => createMicroInteraction('blocks-mint-glow', {
29
+ registry.registerBuiltin('glow', (config) => createMicroInteraction('blocks-mint-glow', {
99
30
  trigger: 'hover',
100
31
  duration: 300,
101
32
  ...config
102
33
  }));
103
- registry.register('bounce', (config) => createMicroInteraction('blocks-mint-bounce', {
34
+ registry.registerBuiltin('bounce', (config) => createMicroInteraction('blocks-mint-bounce', {
104
35
  trigger: 'click',
105
36
  duration: 600,
106
37
  ...config
107
38
  }));
108
- registry.register('pulse', (config) => ({
39
+ registry.registerBuiltin('pulse', (config) => ({
109
40
  init(el, inputConfig = {}) {
110
41
  const finalConfig = { trigger: 'hover', ...config, ...inputConfig };
111
42
  if (finalConfig.disabled || prefersReducedMotion())
@@ -143,12 +74,12 @@ export function registerMicroInteractions(registry) {
143
74
  }
144
75
  }
145
76
  }));
146
- registry.register('shake', (config) => createMicroInteraction('blocks-mint-shake', {
77
+ registry.registerBuiltin('shake', (config) => createMicroInteraction('blocks-mint-shake', {
147
78
  trigger: 'click',
148
79
  duration: 500,
149
80
  ...config
150
81
  }));
151
- registry.register('wiggle', (config) => createMicroInteraction('blocks-mint-wiggle', {
82
+ registry.registerBuiltin('wiggle', (config) => createMicroInteraction('blocks-mint-wiggle', {
152
83
  trigger: 'hover',
153
84
  duration: 500,
154
85
  ...config
@@ -1,6 +1,11 @@
1
1
  /**
2
2
  * Register all default mints (scale, translate, rotate, glow, bounce, pulse, shake, ripple, composite).
3
3
  * Safe to call multiple times – subsequent calls are no-ops.
4
+ *
5
+ * All registrations go through `registerBuiltin` (register-if-absent), so a
6
+ * consumer `register()` override for a built-in name ALWAYS survives — no
7
+ * matter whether the override ran before this call or while the demand-load
8
+ * that triggers it was still in flight.
4
9
  */
5
10
  export declare function registerDefaultMints(): void;
6
11
  /**
@@ -12,7 +17,8 @@ export declare function registerDefaultMints(): void;
12
17
  */
13
18
  export declare function registerPlayfulMints(): void;
14
19
  /**
15
- * Register business mints bundle
20
+ * Register business mints bundle.
21
+ * Registered via `registerBuiltin`: a consumer override for these names wins.
16
22
  */
17
23
  export declare function registerBusinessMints(): void;
18
24
  export declare const mintPresets: {
@@ -6,6 +6,11 @@ let defaultMintsRegistered = false;
6
6
  /**
7
7
  * Register all default mints (scale, translate, rotate, glow, bounce, pulse, shake, ripple, composite).
8
8
  * Safe to call multiple times – subsequent calls are no-ops.
9
+ *
10
+ * All registrations go through `registerBuiltin` (register-if-absent), so a
11
+ * consumer `register()` override for a built-in name ALWAYS survives — no
12
+ * matter whether the override ran before this call or while the demand-load
13
+ * that triggers it was still in flight.
9
14
  */
10
15
  export function registerDefaultMints() {
11
16
  if (defaultMintsRegistered)
@@ -26,16 +31,17 @@ export function registerPlayfulMints() {
26
31
  // Reserved for future playful-only mints.
27
32
  }
28
33
  /**
29
- * Register business mints bundle
34
+ * Register business mints bundle.
35
+ * Registered via `registerBuiltin`: a consumer override for these names wins.
30
36
  */
31
37
  export function registerBusinessMints() {
32
38
  // Subtle mints for professional UIs
33
- mintRegistry.register('fade', () => ({
39
+ mintRegistry.registerBuiltin('fade', () => ({
34
40
  init(el) {
35
41
  el.classList.add('blocks-mint-fade');
36
42
  }
37
43
  }));
38
- mintRegistry.register('slide', () => ({
44
+ mintRegistry.registerBuiltin('slide', () => ({
39
45
  init(el) {
40
46
  el.classList.add('blocks-mint-slide');
41
47
  }
@@ -1,15 +1,54 @@
1
1
  import type { MintConfig, MintFactory, MintProp } from './types.js';
2
+ /**
3
+ * Statically-imported fallback factories, keyed by mint name.
4
+ *
5
+ * Components pass their *default* mint's factory here — Button imports
6
+ * `scaleMint` directly and calls `mintRegistry.apply(el, mint, { scale:
7
+ * scaleMint })` — so the default effect ships tree-shaken with the component
8
+ * instead of dragging the whole built-in set (micro-interactions, the ripple
9
+ * engine, compose, presets — ~3.9 KB min) into every consumer bundle. Same
10
+ * precedence as `resolveIcon(name, fallback)`: a registry entry (consumer
11
+ * override / loaded built-in) wins, the direct import is only the fallback.
12
+ * See docs/ICON-DESIGN.md → "Icon resolution & tree-shaking".
13
+ */
14
+ export type MintFallbacks = Readonly<Partial<Record<string, MintFactory>>>;
15
+ /**
16
+ * @internal Shared with ./compose.ts so composite string members resolve
17
+ * through the same demand-load; not part of the public API.
18
+ */
19
+ export declare function loadBuiltinMints(): Promise<void>;
2
20
  declare class MintRegistry {
3
21
  private mints;
4
22
  private instances;
5
23
  /** Register a mint globally */
6
24
  register<TConfig extends MintConfig = MintConfig>(name: string, factory: MintFactory<TConfig>): void;
25
+ /**
26
+ * Register a built-in mint — only if the name is still free. Used by the
27
+ * built-in set (`registerDefaultMints()` and the opt-in bundles) so the
28
+ * demand-load NEVER clobbers a consumer override: a `register()` entry
29
+ * survives regardless of whether it ran before or during the load. A later
30
+ * explicit `register()` call still overrides as before.
31
+ */
32
+ registerBuiltin<TConfig extends MintConfig = MintConfig>(name: string, factory: MintFactory<TConfig>): void;
7
33
  /** Get a mint factory by name */
8
34
  get(name: string): MintFactory | undefined;
9
35
  /** Check if a mint is registered */
10
36
  has(name: string): boolean;
11
- /** Apply mints to an element using polymorphic input */
12
- apply(el: HTMLElement, mint: MintProp): () => void;
37
+ /**
38
+ * Apply mints to an element using polymorphic input.
39
+ *
40
+ * Resolution order per name: registry entry (consumer `register()` override
41
+ * or an already-loaded built-in) → `fallbacks` (statically imported by the
42
+ * caller) → lazy-loaded built-in set. Names that resolve synchronously are
43
+ * applied synchronously; unresolved names wait for the built-ins chunk
44
+ * (one-time microtask + fetch). Events firing inside that fetch window are
45
+ * NOT replayed — on a slow network, a click landing before a demand-loaded
46
+ * click-triggered mint (ripple, shake) finished loading is lost for that
47
+ * effect. Acceptable for decorative effects (documented contract, see
48
+ * mint/README.md); consumers who need first-interaction guarantees register
49
+ * the effect statically up front (`registerDefaultMints()`).
50
+ */
51
+ apply(el: HTMLElement, mint: MintProp, fallbacks?: MintFallbacks): () => void;
13
52
  /** Normalize polymorphic mint prop to consistent format */
14
53
  private normalizeMintProp;
15
54
  /** Update mint config for an element */
@@ -1,4 +1,24 @@
1
- import { registerDefaultMints } from './presets.js';
1
+ // Lazily loads + registers the built-in mints (scale, glow, ripple, …) the
2
+ // first time a name resolves neither from the registry nor from the caller's
3
+ // fallbacks. The dynamic import() keeps the built-in set out of the static
4
+ // module graph of every mint-consuming component — an app that only ever uses
5
+ // component defaults never loads it at all; an app that passes a dynamic mint
6
+ // name (mint="ripple", presets, composite) fetches it once on first use.
7
+ //
8
+ // The registry ↔ presets import is cyclic but inert: presets dereferences the
9
+ // registry binding only at call time, and this side is a dynamic import, so
10
+ // module initialisation completes cleanly regardless of load order.
11
+ let builtinsLoading;
12
+ /**
13
+ * @internal Shared with ./compose.ts so composite string members resolve
14
+ * through the same demand-load; not part of the public API.
15
+ */
16
+ export function loadBuiltinMints() {
17
+ builtinsLoading ??= import('./presets.js').then((presets) => {
18
+ presets.registerDefaultMints();
19
+ });
20
+ return builtinsLoading;
21
+ }
2
22
  class MintRegistry {
3
23
  mints = new Map();
4
24
  instances = new WeakMap();
@@ -6,6 +26,18 @@ class MintRegistry {
6
26
  register(name, factory) {
7
27
  this.mints.set(name, factory);
8
28
  }
29
+ /**
30
+ * Register a built-in mint — only if the name is still free. Used by the
31
+ * built-in set (`registerDefaultMints()` and the opt-in bundles) so the
32
+ * demand-load NEVER clobbers a consumer override: a `register()` entry
33
+ * survives regardless of whether it ran before or during the load. A later
34
+ * explicit `register()` call still overrides as before.
35
+ */
36
+ registerBuiltin(name, factory) {
37
+ if (!this.mints.has(name)) {
38
+ this.mints.set(name, factory);
39
+ }
40
+ }
9
41
  /** Get a mint factory by name */
10
42
  get(name) {
11
43
  return this.mints.get(name);
@@ -14,43 +46,64 @@ class MintRegistry {
14
46
  has(name) {
15
47
  return this.mints.has(name);
16
48
  }
17
- /** Apply mints to an element using polymorphic input */
18
- apply(el, mint) {
19
- // Ensure the built-in mints (scale, glow, ripple, …) are registered before
20
- // the first application. Components declare mint defaults Button defaults
21
- // to 'scale' so a consumer that never called registerDefaultMints() would
22
- // otherwise hit "Unknown mint: scale" on every button (and get no hover
23
- // animation). registerDefaultMints() short-circuits on a module-level flag,
24
- // so the recurring cost is a single boolean check.
25
- //
26
- // The registry presets import is cyclic but inert: both sides dereference
27
- // the cyclic binding only at call time, never at module top level, so module
28
- // initialisation completes cleanly regardless of load order.
29
- registerDefaultMints();
49
+ /**
50
+ * Apply mints to an element using polymorphic input.
51
+ *
52
+ * Resolution order per name: registry entry (consumer `register()` override
53
+ * or an already-loaded built-in) `fallbacks` (statically imported by the
54
+ * caller) lazy-loaded built-in set. Names that resolve synchronously are
55
+ * applied synchronously; unresolved names wait for the built-ins chunk
56
+ * (one-time microtask + fetch). Events firing inside that fetch window are
57
+ * NOT replayed — on a slow network, a click landing before a demand-loaded
58
+ * click-triggered mint (ripple, shake) finished loading is lost for that
59
+ * effect. Acceptable for decorative effects (documented contract, see
60
+ * mint/README.md); consumers who need first-interaction guarantees register
61
+ * the effect statically up front (`registerDefaultMints()`).
62
+ */
63
+ apply(el, mint, fallbacks) {
30
64
  const mintDefinitions = this.normalizeMintProp(mint);
31
65
  const elementMints = new Map();
32
66
  const cleanupFunctions = [];
33
- mintDefinitions.forEach((mintDef) => {
34
- const name = typeof mintDef === 'string' ? mintDef : mintDef.name;
35
- const config = typeof mintDef === 'object' ? mintDef.config : undefined;
36
- const factory = this.get(name);
37
- if (!factory) {
38
- console.warn(`[MintRegistry] Unknown mint: ${name}`);
39
- return;
40
- }
67
+ let disposed = false;
68
+ const applyOne = (name, config, factory) => {
41
69
  const mintInstance = factory(config);
42
70
  mintInstance.init(el, config);
43
71
  elementMints.set(name, mintInstance);
44
- // Create cleanup function
45
- const cleanup = () => {
72
+ cleanupFunctions.push(() => {
46
73
  mintInstance.destroy?.(el);
47
74
  elementMints.delete(name);
48
- };
49
- cleanupFunctions.push(cleanup);
75
+ });
76
+ };
77
+ const unresolved = [];
78
+ mintDefinitions.forEach((mintDef) => {
79
+ const name = typeof mintDef === 'string' ? mintDef : mintDef.name;
80
+ const config = typeof mintDef === 'object' ? mintDef.config : undefined;
81
+ const factory = this.get(name) ?? fallbacks?.[name];
82
+ if (factory) {
83
+ applyOne(name, config, factory);
84
+ }
85
+ else {
86
+ unresolved.push({ name, config });
87
+ }
50
88
  });
89
+ if (unresolved.length > 0) {
90
+ void loadBuiltinMints().then(() => {
91
+ if (disposed)
92
+ return;
93
+ unresolved.forEach(({ name, config }) => {
94
+ const factory = this.get(name) ?? fallbacks?.[name];
95
+ if (!factory) {
96
+ console.warn(`[MintRegistry] Unknown mint: ${name}`);
97
+ return;
98
+ }
99
+ applyOne(name, config, factory);
100
+ });
101
+ });
102
+ }
51
103
  this.instances.set(el, elementMints);
52
104
  // Return combined cleanup function
53
105
  return () => {
106
+ disposed = true;
54
107
  cleanupFunctions.forEach((fn) => {
55
108
  fn();
56
109
  });
@@ -68,5 +68,5 @@ export function createRippleMint(defaultConfig = {}) {
68
68
  * Called by registerDefaultMints() - not at module level.
69
69
  */
70
70
  export function registerRipple(registry) {
71
- registry.register('ripple', createRippleMint);
71
+ registry.registerBuiltin('ripple', createRippleMint);
72
72
  }
@@ -1,53 +1,53 @@
1
1
  import { type SlotNames, type VariantProps } from '../../utils/variants.js';
2
2
  export declare const alertVariants: ((props?: {
3
- intent?: "primary" | "info" | "success" | "warning" | "danger" | "neutral" | undefined;
3
+ intent?: "info" | "primary" | "success" | "warning" | "danger" | "neutral" | undefined;
4
4
  variant?: "inline" | "filled" | "soft" | undefined;
5
5
  size?: "sm" | "md" | "lg" | undefined;
6
6
  } | undefined) => {
7
7
  base: (props?: ({
8
- intent?: "primary" | "info" | "success" | "warning" | "danger" | "neutral" | undefined;
8
+ intent?: "info" | "primary" | "success" | "warning" | "danger" | "neutral" | undefined;
9
9
  variant?: "inline" | "filled" | "soft" | undefined;
10
10
  size?: "sm" | "md" | "lg" | undefined;
11
11
  } & {
12
12
  class?: string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | /*elided*/ any | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined;
13
13
  }) | undefined) => string;
14
14
  icon: (props?: ({
15
- intent?: "primary" | "info" | "success" | "warning" | "danger" | "neutral" | undefined;
15
+ intent?: "info" | "primary" | "success" | "warning" | "danger" | "neutral" | undefined;
16
16
  variant?: "inline" | "filled" | "soft" | undefined;
17
17
  size?: "sm" | "md" | "lg" | undefined;
18
18
  } & {
19
19
  class?: string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | /*elided*/ any | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined;
20
20
  }) | undefined) => string;
21
21
  content: (props?: ({
22
- intent?: "primary" | "info" | "success" | "warning" | "danger" | "neutral" | undefined;
22
+ intent?: "info" | "primary" | "success" | "warning" | "danger" | "neutral" | undefined;
23
23
  variant?: "inline" | "filled" | "soft" | undefined;
24
24
  size?: "sm" | "md" | "lg" | undefined;
25
25
  } & {
26
26
  class?: string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | /*elided*/ any | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined;
27
27
  }) | undefined) => string;
28
28
  title: (props?: ({
29
- intent?: "primary" | "info" | "success" | "warning" | "danger" | "neutral" | undefined;
29
+ intent?: "info" | "primary" | "success" | "warning" | "danger" | "neutral" | undefined;
30
30
  variant?: "inline" | "filled" | "soft" | undefined;
31
31
  size?: "sm" | "md" | "lg" | undefined;
32
32
  } & {
33
33
  class?: string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | /*elided*/ any | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined;
34
34
  }) | undefined) => string;
35
35
  description: (props?: ({
36
- intent?: "primary" | "info" | "success" | "warning" | "danger" | "neutral" | undefined;
36
+ intent?: "info" | "primary" | "success" | "warning" | "danger" | "neutral" | undefined;
37
37
  variant?: "inline" | "filled" | "soft" | undefined;
38
38
  size?: "sm" | "md" | "lg" | undefined;
39
39
  } & {
40
40
  class?: string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | /*elided*/ any | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined;
41
41
  }) | undefined) => string;
42
42
  actions: (props?: ({
43
- intent?: "primary" | "info" | "success" | "warning" | "danger" | "neutral" | undefined;
43
+ intent?: "info" | "primary" | "success" | "warning" | "danger" | "neutral" | undefined;
44
44
  variant?: "inline" | "filled" | "soft" | undefined;
45
45
  size?: "sm" | "md" | "lg" | undefined;
46
46
  } & {
47
47
  class?: string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | (string | number | false | /*elided*/ any | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined)[] | Record<string, boolean | null | undefined> | null | undefined;
48
48
  }) | undefined) => string;
49
49
  dismissButton: (props?: ({
50
- intent?: "primary" | "info" | "success" | "warning" | "danger" | "neutral" | undefined;
50
+ intent?: "info" | "primary" | "success" | "warning" | "danger" | "neutral" | undefined;
51
51
  variant?: "inline" | "filled" | "soft" | undefined;
52
52
  size?: "sm" | "md" | "lg" | undefined;
53
53
  } & {
@@ -1,5 +1,9 @@
1
1
  <script lang="ts">
2
2
  import { mintRegistry, Spinner } from '../..';
3
+ // Direct import (not the barrel): the resolveIcon tree-shaking pattern.
4
+ // Button's mint default is 'scale', so the scale factory ships statically
5
+ // as the apply() fallback; every other mint name stays demand-loaded.
6
+ import { scaleMint } from '../../mint/engine';
3
7
  import { getBlocksConfig, resolveSlotClasses } from '../../provider';
4
8
  import { getButtonGroupContext } from '../ButtonGroup/buttonGroup.context';
5
9
  import { buttonVariants, type ButtonVariants } from '..';
@@ -80,7 +84,7 @@
80
84
  !effectiveDisabled &&
81
85
  !loading
82
86
  ) {
83
- return mintRegistry.apply(buttonElement, effectiveMint);
87
+ return mintRegistry.apply(buttonElement, effectiveMint, { scale: scaleMint });
84
88
  }
85
89
  });
86
90