@vuecs/button 1.0.4 → 1.1.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 CHANGED
@@ -1,16 +1,45 @@
1
1
  # @vuecs/button
2
2
 
3
- [![npm version](https://badge.fury.io/js/@vuecs%2Fbutton.svg)](https://badge.fury.io/js/@vuecs%2Fbutton)
4
- [![main](https://github.com/Tada5hi/vuecs/actions/workflows/main.yml/badge.svg)](https://github.com/Tada5hi/vuecs/actions/workflows/main.yml)
3
+ [![npm version](https://img.shields.io/npm/v/@vuecs/button)](https://www.npmjs.com/package/@vuecs/button)
4
+ [![CI](https://github.com/Tada5hi/vuecs/actions/workflows/main.yml/badge.svg)](https://github.com/Tada5hi/vuecs/actions/workflows/main.yml)
5
+ [![license](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](./LICENSE)
5
6
 
6
- General-purpose button component for Vue 3 with semantic color/variant/size variants, loading state, and leading/trailing icon slots.
7
+ **`<VCButton>` — the general-purpose button of [vuecs](https://github.com/tada5hi/vuecs).** A full `variant` × `color` × `size` matrix, loading state, and icon slots — visually defined entirely by whichever theme you install (Tailwind, Bootstrap, Bulma, or your own).
7
8
 
8
- Full documentation: **[vuecs.dev/components/button](https://vuecs.dev/components/button)**
9
+ ## What's inside
10
+
11
+ - 🎛️ **Variant matrix** — `variant` (`solid` / `outline` / `soft` / `ghost` / `link`) × `color` (`primary` / `neutral` / `success` / `warning` / `error` / `info`) × `size` (`sm` / `md` / `lg`), resolved through the vuecs variant system.
12
+ - ⏳ **Loading state** — `:loading` disables interaction and exposes `{ loading, disabled }` to the default slot for spinners or custom feedback.
13
+ - 🖼️ **Icon support** — `icon-left` / `icon-right` Iconify-name props (rendered via `<VCIcon>`) plus leading/trailing slots for full control.
14
+ - 🔗 **Polymorphic** — render as `button`, `a`, any tag, or a component (`RouterLink` / `NuxtLink`) via `:as`; native `type` forwarding for forms, `aria-disabled` for non-button targets.
15
+ - 📝 **`useSubmitButton()` companion** — `@vuecs/forms` ships an experimental composable that drives create/update submit buttons (text, icon, color) from global behavioral defaults.
16
+
17
+ ## 📦 Installation
9
18
 
10
19
  ```bash
11
20
  npm install @vuecs/button
12
21
  ```
13
22
 
23
+ ## ⚡ Usage
24
+
25
+ ```vue
26
+ <VCButton color="primary" icon-left="lucide:plus" :loading="busy" @click="create">
27
+ Create
28
+ </VCButton>
29
+
30
+ <VCButton variant="outline" color="error" size="sm">Delete</VCButton>
31
+ <VCButton variant="ghost" as="a" href="/docs">Docs</VCButton>
32
+
33
+ <!-- button-styled router link -->
34
+ <VCButton :as="RouterLink" :to="`/clients/${id}`" color="primary" variant="outline" size="sm">
35
+ Edit
36
+ </VCButton>
37
+ ```
38
+
39
+ ## 📚 Documentation
40
+
41
+ Full reference, live demos, and per-theme variant tables: **[vuecs.dev/components/button](https://vuecs.dev/components/button)**
42
+
14
43
  ## License
15
44
 
16
45
  Made with 💚
@@ -1,5 +1,5 @@
1
1
  import type { ComponentThemeDefinition, ThemeClassesOverride, ThemeElementDefinition, VariantValues } from '@vuecs/core';
2
- import type { ExtractPublicPropTypes, PropType, SlotsType } from 'vue';
2
+ import type { Component, ExtractPublicPropTypes, PropType, SlotsType } from 'vue';
3
3
  import type { ButtonColor, ButtonSize, ButtonSlotProps, ButtonThemeClasses, ButtonVariant } from './type';
4
4
  declare module '@vuecs/core' {
5
5
  interface ThemeElements {
@@ -10,35 +10,51 @@ export declare const buttonThemeDefaults: ComponentThemeDefinition<ButtonThemeCl
10
10
  declare const buttonProps: {
11
11
  color: {
12
12
  type: PropType<ButtonColor>;
13
- default: any;
13
+ default: undefined;
14
14
  };
15
15
  variant: {
16
16
  type: PropType<ButtonVariant>;
17
- default: any;
17
+ default: undefined;
18
18
  };
19
19
  size: {
20
20
  type: PropType<ButtonSize>;
21
- default: any;
21
+ default: undefined;
22
22
  };
23
23
  type: {
24
24
  type: StringConstructor;
25
25
  default: string;
26
26
  };
27
- tag: {
28
- type: StringConstructor;
27
+ /**
28
+ * Element or component to render as. Pass a string tag (`'a'`, `'div'`)
29
+ * or a component (`RouterLink` / `NuxtLink`) to render a button-styled
30
+ * link / arbitrary element. Native `type` / `disabled` semantics apply
31
+ * only when this resolves to `'button'`; every other target receives
32
+ * `aria-disabled` instead. Extra attrs (`to`, `href`, `target`, …)
33
+ * forward to the rendered element.
34
+ */
35
+ as: {
36
+ type: PropType<string | Component>;
29
37
  default: string;
30
38
  };
39
+ /**
40
+ * @deprecated Use `as` instead. Retained as a non-breaking alias — when
41
+ * set it takes precedence over `as`.
42
+ */
43
+ tag: {
44
+ type: PropType<string | Component>;
45
+ default: undefined;
46
+ };
31
47
  label: {
32
48
  type: StringConstructor;
33
- default: any;
49
+ default: undefined;
34
50
  };
35
51
  iconLeft: {
36
52
  type: StringConstructor;
37
- default: any;
53
+ default: undefined;
38
54
  };
39
55
  iconRight: {
40
56
  type: StringConstructor;
41
- default: any;
57
+ default: undefined;
42
58
  };
43
59
  loading: {
44
60
  type: BooleanConstructor;
@@ -50,46 +66,62 @@ declare const buttonProps: {
50
66
  };
51
67
  themeClass: {
52
68
  type: PropType<ThemeClassesOverride<ButtonThemeClasses>>;
53
- default: any;
69
+ default: undefined;
54
70
  };
55
71
  themeVariant: {
56
72
  type: PropType<VariantValues>;
57
- default: any;
73
+ default: undefined;
58
74
  };
59
75
  };
60
76
  export type ButtonProps = ExtractPublicPropTypes<typeof buttonProps>;
61
77
  export declare const VCButton: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
62
78
  color: {
63
79
  type: PropType<ButtonColor>;
64
- default: any;
80
+ default: undefined;
65
81
  };
66
82
  variant: {
67
83
  type: PropType<ButtonVariant>;
68
- default: any;
84
+ default: undefined;
69
85
  };
70
86
  size: {
71
87
  type: PropType<ButtonSize>;
72
- default: any;
88
+ default: undefined;
73
89
  };
74
90
  type: {
75
91
  type: StringConstructor;
76
92
  default: string;
77
93
  };
78
- tag: {
79
- type: StringConstructor;
94
+ /**
95
+ * Element or component to render as. Pass a string tag (`'a'`, `'div'`)
96
+ * or a component (`RouterLink` / `NuxtLink`) to render a button-styled
97
+ * link / arbitrary element. Native `type` / `disabled` semantics apply
98
+ * only when this resolves to `'button'`; every other target receives
99
+ * `aria-disabled` instead. Extra attrs (`to`, `href`, `target`, …)
100
+ * forward to the rendered element.
101
+ */
102
+ as: {
103
+ type: PropType<string | Component>;
80
104
  default: string;
81
105
  };
106
+ /**
107
+ * @deprecated Use `as` instead. Retained as a non-breaking alias — when
108
+ * set it takes precedence over `as`.
109
+ */
110
+ tag: {
111
+ type: PropType<string | Component>;
112
+ default: undefined;
113
+ };
82
114
  label: {
83
115
  type: StringConstructor;
84
- default: any;
116
+ default: undefined;
85
117
  };
86
118
  iconLeft: {
87
119
  type: StringConstructor;
88
- default: any;
120
+ default: undefined;
89
121
  };
90
122
  iconRight: {
91
123
  type: StringConstructor;
92
- default: any;
124
+ default: undefined;
93
125
  };
94
126
  loading: {
95
127
  type: BooleanConstructor;
@@ -101,46 +133,62 @@ export declare const VCButton: import("vue").DefineComponent<import("vue").Extra
101
133
  };
102
134
  themeClass: {
103
135
  type: PropType<ThemeClassesOverride<ButtonThemeClasses>>;
104
- default: any;
136
+ default: undefined;
105
137
  };
106
138
  themeVariant: {
107
139
  type: PropType<VariantValues>;
108
- default: any;
140
+ default: undefined;
109
141
  };
110
142
  }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
111
143
  [key: string]: any;
112
144
  }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
113
145
  color: {
114
146
  type: PropType<ButtonColor>;
115
- default: any;
147
+ default: undefined;
116
148
  };
117
149
  variant: {
118
150
  type: PropType<ButtonVariant>;
119
- default: any;
151
+ default: undefined;
120
152
  };
121
153
  size: {
122
154
  type: PropType<ButtonSize>;
123
- default: any;
155
+ default: undefined;
124
156
  };
125
157
  type: {
126
158
  type: StringConstructor;
127
159
  default: string;
128
160
  };
129
- tag: {
130
- type: StringConstructor;
161
+ /**
162
+ * Element or component to render as. Pass a string tag (`'a'`, `'div'`)
163
+ * or a component (`RouterLink` / `NuxtLink`) to render a button-styled
164
+ * link / arbitrary element. Native `type` / `disabled` semantics apply
165
+ * only when this resolves to `'button'`; every other target receives
166
+ * `aria-disabled` instead. Extra attrs (`to`, `href`, `target`, …)
167
+ * forward to the rendered element.
168
+ */
169
+ as: {
170
+ type: PropType<string | Component>;
131
171
  default: string;
132
172
  };
173
+ /**
174
+ * @deprecated Use `as` instead. Retained as a non-breaking alias — when
175
+ * set it takes precedence over `as`.
176
+ */
177
+ tag: {
178
+ type: PropType<string | Component>;
179
+ default: undefined;
180
+ };
133
181
  label: {
134
182
  type: StringConstructor;
135
- default: any;
183
+ default: undefined;
136
184
  };
137
185
  iconLeft: {
138
186
  type: StringConstructor;
139
- default: any;
187
+ default: undefined;
140
188
  };
141
189
  iconRight: {
142
190
  type: StringConstructor;
143
- default: any;
191
+ default: undefined;
144
192
  };
145
193
  loading: {
146
194
  type: BooleanConstructor;
@@ -152,19 +200,20 @@ export declare const VCButton: import("vue").DefineComponent<import("vue").Extra
152
200
  };
153
201
  themeClass: {
154
202
  type: PropType<ThemeClassesOverride<ButtonThemeClasses>>;
155
- default: any;
203
+ default: undefined;
156
204
  };
157
205
  themeVariant: {
158
206
  type: PropType<VariantValues>;
159
- default: any;
207
+ default: undefined;
160
208
  };
161
209
  }>> & Readonly<{}>, {
162
210
  label: string;
211
+ size: ButtonSize;
163
212
  color: ButtonColor;
164
213
  variant: ButtonVariant;
165
- size: ButtonSize;
166
214
  type: string;
167
- tag: string;
215
+ as: string | Component;
216
+ tag: string | Component;
168
217
  iconLeft: string;
169
218
  iconRight: string;
170
219
  loading: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACR,wBAAwB,EACxB,oBAAoB,EACpB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IAE5C;;;;;;;OAOG;;cACuC,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC;;;IACtE;;;OAGG;;cACwC,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;cAMzC,QAAQ,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;;;;cAChD,QAAQ,CAAC,aAAa,CAAC;;;;;;;cAxB9B,QAAQ,CAAC,WAAW,CAAC;;;;cACnB,QAAQ,CAAC,aAAa,CAAC;;;;cAC1B,QAAQ,CAAC,UAAU,CAAC;;;;;;;IAE5C;;;;;;;OAOG;;cACuC,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC;;;IACtE;;;OAGG;;cACwC,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;cAMzC,QAAQ,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;;;;cAChD,QAAQ,CAAC,aAAa,CAAC;;;;;;;;;;;;;;;;;;aAS1C,eAAe;aACf,eAAe;cACd,eAAe;yEA2H/B,CAAC"}
package/dist/index.mjs CHANGED
@@ -27,10 +27,34 @@ const VCButton = defineComponent({
27
27
  type: String,
28
28
  default: "button"
29
29
  },
30
- tag: {
31
- type: String,
30
+ /**
31
+ * Element or component to render as. Pass a string tag (`'a'`, `'div'`)
32
+ * or a component (`RouterLink` / `NuxtLink`) to render a button-styled
33
+ * link / arbitrary element. Native `type` / `disabled` semantics apply
34
+ * only when this resolves to `'button'`; every other target receives
35
+ * `aria-disabled` instead. Extra attrs (`to`, `href`, `target`, …)
36
+ * forward to the rendered element.
37
+ */
38
+ as: {
39
+ type: [
40
+ String,
41
+ Object,
42
+ Function
43
+ ],
32
44
  default: "button"
33
45
  },
46
+ /**
47
+ * @deprecated Use `as` instead. Retained as a non-breaking alias — when
48
+ * set it takes precedence over `as`.
49
+ */
50
+ tag: {
51
+ type: [
52
+ String,
53
+ Object,
54
+ Function
55
+ ],
56
+ default: void 0
57
+ },
34
58
  label: {
35
59
  type: String,
36
60
  default: void 0
@@ -100,8 +124,9 @@ const VCButton = defineComponent({
100
124
  const trailingOut = slots.trailing(slotProps);
101
125
  if (isNonEmptySlot(trailingOut)) children.push(h("span", { class: resolved.trailing || void 0 }, trailingOut));
102
126
  } else if (props.iconRight) children.push(h("span", { class: resolved.trailing || void 0 }, [h(VCIcon, { name: props.iconRight })]));
103
- const isNativeButton = props.tag === "button";
104
- return h(props.tag, mergeProps({
127
+ const renderAs = props.tag ?? props.as;
128
+ const isNativeButton = renderAs === "button";
129
+ return h(renderAs, mergeProps({
105
130
  class: [resolved.root || void 0, props.loading ? "vc-button--busy" : void 0],
106
131
  ...isNativeButton ? { type: props.type } : {},
107
132
  ...isNativeButton ? { disabled: isDisabled || void 0 } : {},
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/component.ts","../src/index.ts"],"sourcesContent":["import { useComponentTheme } from '@vuecs/core';\nimport type {\n ComponentThemeDefinition,\n ThemeClassesOverride,\n ThemeElementDefinition,\n UseComponentThemeProps,\n VariantValues,\n} from '@vuecs/core';\nimport { VCIcon } from '@vuecs/icon';\nimport type {\n ExtractPublicPropTypes,\n PropType,\n SlotsType,\n VNodeArrayChildren,\n} from 'vue';\nimport {\n defineComponent,\n h,\n mergeProps,\n} from 'vue';\nimport type {\n ButtonColor,\n ButtonSize,\n ButtonSlotProps,\n ButtonThemeClasses,\n ButtonVariant,\n} from './type';\n\ndeclare module '@vuecs/core' {\n interface ThemeElements {\n button?: ThemeElementDefinition<ButtonThemeClasses>;\n }\n}\n\nexport const buttonThemeDefaults: ComponentThemeDefinition<ButtonThemeClasses> = {\n classes: {\n root: 'vc-button',\n leading: 'vc-button-leading',\n trailing: 'vc-button-trailing',\n label: 'vc-button-label',\n },\n};\n\nconst buttonProps = {\n color: { type: String as PropType<ButtonColor>, default: undefined },\n variant: { type: String as PropType<ButtonVariant>, default: undefined },\n size: { type: String as PropType<ButtonSize>, default: undefined },\n type: { type: String, default: 'button' },\n tag: { type: String, default: 'button' },\n label: { type: String, default: undefined },\n iconLeft: { type: String, default: undefined },\n iconRight: { type: String, default: undefined },\n loading: { type: Boolean, default: false },\n disabled: { type: Boolean, default: false },\n themeClass: { type: Object as PropType<ThemeClassesOverride<ButtonThemeClasses>>, default: undefined },\n themeVariant: { type: Object as PropType<VariantValues>, default: undefined },\n};\n\nexport type ButtonProps = ExtractPublicPropTypes<typeof buttonProps>;\n\nexport const VCButton = defineComponent({\n name: 'VCButton',\n props: buttonProps,\n slots: Object as SlotsType<{\n default: ButtonSlotProps;\n leading: ButtonSlotProps;\n trailing: ButtonSlotProps;\n }>,\n setup(props, { attrs, slots }) {\n // The convenience props (color/variant/size/loading) are merged into\n // themeVariant before resolution so themes can drive slot classes off\n // them via the standard variant system. Getter properties keep this\n // reactive — Vue's computed() inside useComponentTheme tracks the\n // underlying prop reads.\n const themeProps: UseComponentThemeProps<ButtonThemeClasses> = {\n get themeClass() {\n return props.themeClass;\n },\n get themeVariant() {\n return {\n ...(props.themeVariant ?? {}),\n ...(props.color !== undefined ? { color: props.color } : {}),\n ...(props.variant !== undefined ? { variant: props.variant } : {}),\n ...(props.size !== undefined ? { size: props.size } : {}),\n ...(props.loading ? { loading: true } : {}),\n };\n },\n };\n\n const theme = useComponentTheme('button', themeProps, buttonThemeDefaults);\n\n return () => {\n const resolved = theme.value;\n const isDisabled = props.disabled || props.loading;\n const slotProps: ButtonSlotProps = {\n loading: props.loading,\n disabled: isDisabled,\n };\n\n const children: VNodeArrayChildren = [];\n\n // Empty slot results (`<template #leading />` returning []) used to\n // emit a wrapper <span> with no children — functionally inert but\n // dead markup. Coerce slot output to non-empty before pushing.\n const isNonEmptySlot = (out: unknown): out is VNodeArrayChildren => Array.isArray(out) && out.length > 0;\n\n // When loading, the leading slot becomes a spinner — universally\n // legible loading affordance, replaces any consumer-provided icon\n // for the duration of the in-flight work. Without this the only\n // signal was a faint opacity/cursor change that read identical to\n // the disabled state on most themes.\n //\n // Accessibility: the spinner glyph is `aria-hidden` (it's\n // decorative — the visual is the spinning ring) but we wrap it\n // alongside a visually-hidden \"Loading\" label so screen readers\n // announce the busy state. Combined with `aria-busy=\"true\"` on\n // the root (set below), AT users get a clear \"in progress\"\n // signal instead of the indistinct \"disabled\" the native\n // `disabled` attribute would otherwise convey on its own.\n if (props.loading) {\n children.push(h('span', { class: resolved.leading || undefined }, [\n h('span', { class: 'vc-button-spinner', 'aria-hidden': 'true' }),\n h('span', { class: 'vc-sr-only' }, 'Loading'),\n ]));\n } else if (slots.leading) {\n const leadingOut = slots.leading(slotProps);\n if (isNonEmptySlot(leadingOut)) {\n children.push(h('span', { class: resolved.leading || undefined }, leadingOut));\n }\n } else if (props.iconLeft) {\n // The string is treated as an Iconify name (e.g. 'lucide:plus')\n // and resolved through <VCIcon>. Consumers wanting raw class\n // strings should slot their own element via #leading instead.\n children.push(h('span', { class: resolved.leading || undefined }, [\n h(VCIcon, { name: props.iconLeft }),\n ]));\n }\n\n const slotLabel = slots.default ? slots.default(slotProps) : undefined;\n if (isNonEmptySlot(slotLabel)) {\n children.push(h('span', { class: resolved.label || undefined }, slotLabel));\n } else if (typeof props.label === 'string' && props.label !== '') {\n children.push(h('span', { class: resolved.label || undefined }, props.label));\n }\n\n if (slots.trailing) {\n const trailingOut = slots.trailing(slotProps);\n if (isNonEmptySlot(trailingOut)) {\n children.push(h('span', { class: resolved.trailing || undefined }, trailingOut));\n }\n } else if (props.iconRight) {\n children.push(h('span', { class: resolved.trailing || undefined }, [\n h(VCIcon, { name: props.iconRight }),\n ]));\n }\n\n const isNativeButton = props.tag === 'button';\n\n return h(\n props.tag,\n mergeProps({\n class: [\n resolved.root || undefined,\n // Structural busy class — themes layer their own look,\n // but every theme gets a consistent loading affordance\n // (wait cursor + opacity pulse) without redeclaring it.\n // `disabled` blocks pointer events on native buttons,\n // which would defeat `cursor: wait`; the CSS handles\n // that by scoping `cursor: wait` only when the busy\n // class is set and avoids `pointer-events: none`.\n props.loading ? 'vc-button--busy' : undefined,\n ],\n ...(isNativeButton ? { type: props.type } : {}),\n ...(isNativeButton ? { disabled: isDisabled || undefined } : {}),\n ...(!isNativeButton && isDisabled ? { 'aria-disabled': 'true' } : {}),\n // Distinguish loading from plain `disabled` for AT —\n // both still set `disabled` (loading must block clicks\n // to prevent double-submit), but `aria-busy` lets screen\n // readers announce \"busy\" rather than just \"disabled\".\n ...(props.loading ? { 'aria-busy': 'true' } : {}),\n }, attrs),\n children,\n );\n };\n },\n});\n","import { installDefaultsManager, installThemeManager } from '@vuecs/core';\nimport type { App, Plugin } from 'vue';\n\nimport '../assets/index.css';\nimport './vue';\n\nimport { VCButton } from './component';\nimport type { Options } from './type';\n\nexport * from './component';\nexport * from './type';\n\nexport function install(instance: App, options: Options = {}): void {\n installThemeManager(instance, options);\n installDefaultsManager(instance, options);\n instance.component('VCButton', VCButton);\n}\n\nexport default { install } satisfies Plugin<[Options?]>;\n"],"mappings":";;;;AAkCA,MAAa,sBAAoE,EAC7E,SAAS;CACL,MAAM;CACN,SAAS;CACT,UAAU;CACV,OAAO;AACX,EACJ;AAmBA,MAAa,WAAW,gBAAgB;CACpC,MAAM;CACN,OAAO;EAlBP,OAAO;GAAE,MAAM;GAAiC,SAAS,KAAA;EAAU;EACnE,SAAS;GAAE,MAAM;GAAmC,SAAS,KAAA;EAAU;EACvE,MAAM;GAAE,MAAM;GAAgC,SAAS,KAAA;EAAU;EACjE,MAAM;GAAE,MAAM;GAAQ,SAAS;EAAS;EACxC,KAAK;GAAE,MAAM;GAAQ,SAAS;EAAS;EACvC,OAAO;GAAE,MAAM;GAAQ,SAAS,KAAA;EAAU;EAC1C,UAAU;GAAE,MAAM;GAAQ,SAAS,KAAA;EAAU;EAC7C,WAAW;GAAE,MAAM;GAAQ,SAAS,KAAA;EAAU;EAC9C,SAAS;GAAE,MAAM;GAAS,SAAS;EAAM;EACzC,UAAU;GAAE,MAAM;GAAS,SAAS;EAAM;EAC1C,YAAY;GAAE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,UAAe,UAAmB,CAAC,GAAS;CAChE,oBAAoB,UAAU,OAAO;CACrC,uBAAuB,UAAU,OAAO;CACxC,SAAS,UAAU,YAAY,QAAQ;AAC3C;AAEA,IAAA,cAAe,EAAE,QAAQ"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/component.ts","../src/index.ts"],"sourcesContent":["import { useComponentTheme } from '@vuecs/core';\nimport type {\n ComponentThemeDefinition,\n ThemeClassesOverride,\n ThemeElementDefinition,\n UseComponentThemeProps,\n VariantValues,\n} from '@vuecs/core';\nimport { VCIcon } from '@vuecs/icon';\nimport type {\n Component,\n ExtractPublicPropTypes,\n PropType,\n SlotsType,\n VNodeArrayChildren,\n} from 'vue';\nimport {\n defineComponent,\n h,\n mergeProps,\n} from 'vue';\nimport type {\n ButtonColor,\n ButtonSize,\n ButtonSlotProps,\n ButtonThemeClasses,\n ButtonVariant,\n} from './type';\n\ndeclare module '@vuecs/core' {\n interface ThemeElements {\n button?: ThemeElementDefinition<ButtonThemeClasses>;\n }\n}\n\nexport const buttonThemeDefaults: ComponentThemeDefinition<ButtonThemeClasses> = {\n classes: {\n root: 'vc-button',\n leading: 'vc-button-leading',\n trailing: 'vc-button-trailing',\n label: 'vc-button-label',\n },\n};\n\nconst buttonProps = {\n color: { type: String as PropType<ButtonColor>, default: undefined },\n variant: { type: String as PropType<ButtonVariant>, default: undefined },\n size: { type: String as PropType<ButtonSize>, default: undefined },\n type: { type: String, default: 'button' },\n /**\n * Element or component to render as. Pass a string tag (`'a'`, `'div'`)\n * or a component (`RouterLink` / `NuxtLink`) to render a button-styled\n * link / arbitrary element. Native `type` / `disabled` semantics apply\n * only when this resolves to `'button'`; every other target receives\n * `aria-disabled` instead. Extra attrs (`to`, `href`, `target`, …)\n * forward to the rendered element.\n */\n as: { type: [String, Object, Function] as PropType<string | Component>, default: 'button' },\n /**\n * @deprecated Use `as` instead. Retained as a non-breaking alias — when\n * set it takes precedence over `as`.\n */\n tag: { type: [String, Object, Function] as PropType<string | Component>, default: undefined },\n label: { type: String, default: undefined },\n iconLeft: { type: String, default: undefined },\n iconRight: { type: String, default: undefined },\n loading: { type: Boolean, default: false },\n disabled: { type: Boolean, default: false },\n themeClass: { type: Object as PropType<ThemeClassesOverride<ButtonThemeClasses>>, default: undefined },\n themeVariant: { type: Object as PropType<VariantValues>, default: undefined },\n};\n\nexport type ButtonProps = ExtractPublicPropTypes<typeof buttonProps>;\n\nexport const VCButton = defineComponent({\n name: 'VCButton',\n props: buttonProps,\n slots: Object as SlotsType<{\n default: ButtonSlotProps;\n leading: ButtonSlotProps;\n trailing: ButtonSlotProps;\n }>,\n setup(props, { attrs, slots }) {\n // The convenience props (color/variant/size/loading) are merged into\n // themeVariant before resolution so themes can drive slot classes off\n // them via the standard variant system. Getter properties keep this\n // reactive — Vue's computed() inside useComponentTheme tracks the\n // underlying prop reads.\n const themeProps: UseComponentThemeProps<ButtonThemeClasses> = {\n get themeClass() {\n return props.themeClass;\n },\n get themeVariant() {\n return {\n ...(props.themeVariant ?? {}),\n ...(props.color !== undefined ? { color: props.color } : {}),\n ...(props.variant !== undefined ? { variant: props.variant } : {}),\n ...(props.size !== undefined ? { size: props.size } : {}),\n ...(props.loading ? { loading: true } : {}),\n };\n },\n };\n\n const theme = useComponentTheme('button', themeProps, buttonThemeDefaults);\n\n return () => {\n const resolved = theme.value;\n const isDisabled = props.disabled || props.loading;\n const slotProps: ButtonSlotProps = {\n loading: props.loading,\n disabled: isDisabled,\n };\n\n const children: VNodeArrayChildren = [];\n\n // Empty slot results (`<template #leading />` returning []) used to\n // emit a wrapper <span> with no children — functionally inert but\n // dead markup. Coerce slot output to non-empty before pushing.\n const isNonEmptySlot = (out: unknown): out is VNodeArrayChildren => Array.isArray(out) && out.length > 0;\n\n // When loading, the leading slot becomes a spinner — universally\n // legible loading affordance, replaces any consumer-provided icon\n // for the duration of the in-flight work. Without this the only\n // signal was a faint opacity/cursor change that read identical to\n // the disabled state on most themes.\n //\n // Accessibility: the spinner glyph is `aria-hidden` (it's\n // decorative — the visual is the spinning ring) but we wrap it\n // alongside a visually-hidden \"Loading\" label so screen readers\n // announce the busy state. Combined with `aria-busy=\"true\"` on\n // the root (set below), AT users get a clear \"in progress\"\n // signal instead of the indistinct \"disabled\" the native\n // `disabled` attribute would otherwise convey on its own.\n if (props.loading) {\n children.push(h('span', { class: resolved.leading || undefined }, [\n h('span', { class: 'vc-button-spinner', 'aria-hidden': 'true' }),\n h('span', { class: 'vc-sr-only' }, 'Loading'),\n ]));\n } else if (slots.leading) {\n const leadingOut = slots.leading(slotProps);\n if (isNonEmptySlot(leadingOut)) {\n children.push(h('span', { class: resolved.leading || undefined }, leadingOut));\n }\n } else if (props.iconLeft) {\n // The string is treated as an Iconify name (e.g. 'lucide:plus')\n // and resolved through <VCIcon>. Consumers wanting raw class\n // strings should slot their own element via #leading instead.\n children.push(h('span', { class: resolved.leading || undefined }, [\n h(VCIcon, { name: props.iconLeft }),\n ]));\n }\n\n const slotLabel = slots.default ? slots.default(slotProps) : undefined;\n if (isNonEmptySlot(slotLabel)) {\n children.push(h('span', { class: resolved.label || undefined }, slotLabel));\n } else if (typeof props.label === 'string' && props.label !== '') {\n children.push(h('span', { class: resolved.label || undefined }, props.label));\n }\n\n if (slots.trailing) {\n const trailingOut = slots.trailing(slotProps);\n if (isNonEmptySlot(trailingOut)) {\n children.push(h('span', { class: resolved.trailing || undefined }, trailingOut));\n }\n } else if (props.iconRight) {\n children.push(h('span', { class: resolved.trailing || undefined }, [\n h(VCIcon, { name: props.iconRight }),\n ]));\n }\n\n // `tag` is the deprecated alias — when explicitly set it wins\n // over `as`; otherwise `as` (default `'button'`) drives the\n // render target. A string tag or a component both resolve here.\n const renderAs = props.tag ?? props.as;\n const isNativeButton = renderAs === 'button';\n\n return h(\n renderAs,\n mergeProps({\n class: [\n resolved.root || undefined,\n // Structural busy class — themes layer their own look,\n // but every theme gets a consistent loading affordance\n // (wait cursor + opacity pulse) without redeclaring it.\n // `disabled` blocks pointer events on native buttons,\n // which would defeat `cursor: wait`; the CSS handles\n // that by scoping `cursor: wait` only when the busy\n // class is set and avoids `pointer-events: none`.\n props.loading ? 'vc-button--busy' : undefined,\n ],\n ...(isNativeButton ? { type: props.type } : {}),\n ...(isNativeButton ? { disabled: isDisabled || undefined } : {}),\n ...(!isNativeButton && isDisabled ? { 'aria-disabled': 'true' } : {}),\n // Distinguish loading from plain `disabled` for AT —\n // both still set `disabled` (loading must block clicks\n // to prevent double-submit), but `aria-busy` lets screen\n // readers announce \"busy\" rather than just \"disabled\".\n ...(props.loading ? { 'aria-busy': 'true' } : {}),\n }, attrs),\n children,\n );\n };\n },\n});\n","import { installDefaultsManager, installThemeManager } from '@vuecs/core';\nimport type { App, Plugin } from 'vue';\n\nimport '../assets/index.css';\nimport './vue';\n\nimport { VCButton } from './component';\nimport type { Options } from './type';\n\nexport * from './component';\nexport * from './type';\n\nexport function install(instance: App, options: Options = {}): void {\n installThemeManager(instance, options);\n installDefaultsManager(instance, options);\n instance.component('VCButton', VCButton);\n}\n\nexport default { install } satisfies Plugin<[Options?]>;\n"],"mappings":";;;;AAmCA,MAAa,sBAAoE,EAC7E,SAAS;CACL,MAAM;CACN,SAAS;CACT,UAAU;CACV,OAAO;AACX,EACJ;AAgCA,MAAa,WAAW,gBAAgB;CACpC,MAAM;CACN,OAAO;EA/BP,OAAO;GAAE,MAAM;GAAiC,SAAS,KAAA;EAAU;EACnE,SAAS;GAAE,MAAM;GAAmC,SAAS,KAAA;EAAU;EACvE,MAAM;GAAE,MAAM;GAAgC,SAAS,KAAA;EAAU;EACjE,MAAM;GAAE,MAAM;GAAQ,SAAS;EAAS;;;;;;;;;EASxC,IAAI;GAAE,MAAM;IAAC;IAAQ;IAAQ;GAAQ;GAAmC,SAAS;EAAS;;;;;EAK1F,KAAK;GAAE,MAAM;IAAC;IAAQ;IAAQ;GAAQ;GAAmC,SAAS,KAAA;EAAU;EAC5F,OAAO;GAAE,MAAM;GAAQ,SAAS,KAAA;EAAU;EAC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AAc,KAAA,EAAU,IAAI,CAAC;IAC9D,GAAI,CAAC,kBAAkB,aAAa,EAAE,iBAAiB,OAAO,IAAI,CAAC;IAKnE,GAAI,MAAM,UAAU,EAAE,aAAa,OAAO,IAAI,CAAC;GACnD,GAAG,KAAK,GACR,QACJ;EACJ;CACJ;AACJ,CAAC;;;AC/LD,SAAgB,QAAQ,UAAe,UAAmB,CAAC,GAAS;CAChE,oBAAoB,UAAU,OAAO;CACrC,uBAAuB,UAAU,OAAO;CACxC,SAAS,UAAU,YAAY,QAAQ;AAC3C;AAEA,IAAA,cAAe,EAAE,QAAQ"}
package/dist/vue.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { VCButton } from './component';
2
- declare module '@vue/runtime-core' {
2
+ declare module 'vue' {
3
3
  interface GlobalComponents {
4
4
  VCButton: typeof VCButton;
5
5
  }
package/dist/vue.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"vue.d.ts","sourceRoot":"","sources":["../src/vue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,QAAQ,mBAAmB,CAAC;IAC/B,UAAiB,gBAAgB;QAC7B,QAAQ,EAAE,OAAO,QAAQ,CAAC;KAC7B;CACJ"}
1
+ {"version":3,"file":"vue.d.ts","sourceRoot":"","sources":["../src/vue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,QAAQ,KAAK,CAAC;IACjB,UAAiB,gBAAgB;QAC7B,QAAQ,EAAE,OAAO,QAAQ,CAAC;KAC7B;CACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuecs/button",
3
- "version": "1.0.4",
3
+ "version": "1.1.1",
4
4
  "type": "module",
5
5
  "description": "A general-purpose button component for Vue 3.",
6
6
  "exports": {
@@ -40,13 +40,13 @@
40
40
  "build": "rimraf dist && npm run build:js && npm run build:types"
41
41
  },
42
42
  "devDependencies": {
43
- "@vuecs/core": "^3.2.0",
44
- "@vuecs/icon": "^1.0.1",
45
- "vue": "^3.5.35"
43
+ "@vuecs/core": "^3.2.2",
44
+ "@vuecs/icon": "^1.0.2",
45
+ "vue": "^3.5.38"
46
46
  },
47
47
  "peerDependencies": {
48
- "@vuecs/core": "^3.2.0",
49
- "@vuecs/icon": "^1.0.1",
48
+ "@vuecs/core": "^3.2.2",
49
+ "@vuecs/icon": "^1.0.2",
50
50
  "vue": "^3.x"
51
51
  },
52
52
  "engines": {