@ptlm-azulejo/button 2.1.2-alpha.138 → 2.1.2-alpha.141
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/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(o,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(o=typeof globalThis!="undefined"?globalThis:o||self,t(o.button={},o.Vue))})(this,function(o,t){"use strict";const a=["disabled","type","aria-busy"],l={key:0,"data-testid":"button-icon",class:"btn__icon"},d={key:1,"data-testid":"button-loader",class:"btn__loader","aria-hidden":"true"},c={key:2,"data-testid":"button-icon",class:"btn__icon"},r={key:4,"data-testid":"button-icon",class:"btn__icon"},b=t.defineComponent({__name:"index",props:{appearance:{default:"standard"},size:{default:"m"},disabled:{type:Boolean},ghost:{type:Boolean},outlined:{type:Boolean},iconPosition:{},type:{default:"button"},isLoading:{type:Boolean}},setup(e){const n=e,y=t.computed(()=>({[`btn--${n.appearance}`]:n.appearance&&n.appearance!=="standard",[`btn--${n.size}`]:n.size&&n.size!=="m","btn--ghost":n.ghost,"btn--outlined":n.outlined,"btn--icon-only":n.iconPosition==="only"}));return(i,s)=>(t.openBlock(),t.createElementBlock("button",{"data-testid":"button",class:t.normalizeClass(["btn",y.value]),disabled:e.disabled,type:e.type,"aria-busy":e.isLoading||void 0},[i.$slots.icon&&e.iconPosition==="left"&&!e.isLoading?(t.openBlock(),t.createElementBlock("span",l,[t.renderSlot(i.$slots,"icon")])):t.createCommentVNode("",!0),e.isLoading?(t.openBlock(),t.createElementBlock("span",d,[...s[0]||(s[0]=[t.createElementVNode("span",{"data-testid":"button-spinner",class:"btn__spinner"},null,-1)])])):t.createCommentVNode("",!0),i.$slots.icon&&e.iconPosition==="only"&&!e.isLoading?(t.openBlock(),t.createElementBlock("span",c,[t.renderSlot(i.$slots,"icon")])):(t.openBlock(),t.createElementBlock("span",{key:3,"data-testid":"button-label",class:"btn__label",style:t.normalizeStyle({visibility:e.isLoading?"hidden":"visible"})},[t.renderSlot(i.$slots,"default",{},()=>[s[1]||(s[1]=t.createTextVNode("Button Label",-1))])],4)),i.$slots.icon&&e.iconPosition==="right"&&!e.isLoading?(t.openBlock(),t.createElementBlock("span",r,[t.renderSlot(i.$slots,"icon")])):t.createCommentVNode("",!0)],10,a))}});o.AzButton=b,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(o,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(o=typeof globalThis!="undefined"?globalThis:o||self,t(o.button={},o.Vue))})(this,(function(o,t){"use strict";const a=["disabled","type","aria-busy"],l={key:0,"data-testid":"button-icon",class:"btn__icon"},d={key:1,"data-testid":"button-loader",class:"btn__loader","aria-hidden":"true"},c={key:2,"data-testid":"button-icon",class:"btn__icon"},r={key:4,"data-testid":"button-icon",class:"btn__icon"},b=t.defineComponent({__name:"index",props:{appearance:{default:"standard"},size:{default:"m"},disabled:{type:Boolean},ghost:{type:Boolean},outlined:{type:Boolean},iconPosition:{},type:{default:"button"},isLoading:{type:Boolean}},setup(e){const n=e,y=t.computed(()=>({[`btn--${n.appearance}`]:n.appearance&&n.appearance!=="standard",[`btn--${n.size}`]:n.size&&n.size!=="m","btn--ghost":n.ghost,"btn--outlined":n.outlined,"btn--icon-only":n.iconPosition==="only"}));return(i,s)=>(t.openBlock(),t.createElementBlock("button",{"data-testid":"button",class:t.normalizeClass(["btn",y.value]),disabled:e.disabled,type:e.type,"aria-busy":e.isLoading||void 0},[i.$slots.icon&&e.iconPosition==="left"&&!e.isLoading?(t.openBlock(),t.createElementBlock("span",l,[t.renderSlot(i.$slots,"icon")])):t.createCommentVNode("",!0),e.isLoading?(t.openBlock(),t.createElementBlock("span",d,[...s[0]||(s[0]=[t.createElementVNode("span",{"data-testid":"button-spinner",class:"btn__spinner"},null,-1)])])):t.createCommentVNode("",!0),i.$slots.icon&&e.iconPosition==="only"&&!e.isLoading?(t.openBlock(),t.createElementBlock("span",c,[t.renderSlot(i.$slots,"icon")])):(t.openBlock(),t.createElementBlock("span",{key:3,"data-testid":"button-label",class:"btn__label",style:t.normalizeStyle({visibility:e.isLoading?"hidden":"visible"})},[t.renderSlot(i.$slots,"default",{},()=>[s[1]||(s[1]=t.createTextVNode("Button Label",-1))])],4)),i.$slots.icon&&e.iconPosition==="right"&&!e.isLoading?(t.openBlock(),t.createElementBlock("span",r,[t.renderSlot(i.$slots,"icon")])):t.createCommentVNode("",!0)],10,a))}});o.AzButton=b,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.stories.d.ts","sourceRoot":"","sources":["../../src/index.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.stories.d.ts","sourceRoot":"","sources":["../../src/index.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,MAAM,MAAM,aAAa,CAAA;AAEhC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAyK7B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,QAAQ,EAAE,KAItB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAKpB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAKpB,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAKtB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAKtB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAKpB,CAAA"}
|
package/dist/src/index.vue.d.ts
CHANGED
|
@@ -1,33 +1,18 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Use this slot to insert an icon for the Button.
|
|
10
|
-
*/
|
|
11
|
-
icon?: () => VNode[];
|
|
12
|
-
}> & {
|
|
13
|
-
/**
|
|
14
|
-
* The content displayed in the button.
|
|
15
|
-
*/
|
|
16
|
-
default: string;
|
|
17
|
-
/**
|
|
18
|
-
* Use this slot to insert an icon for the Button.
|
|
19
|
-
*/
|
|
20
|
-
icon?: () => VNode[];
|
|
21
|
-
};
|
|
22
|
-
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
/**
|
|
3
|
+
* Buttons are key interactive elements used to perform actions and can be used as standalone element,
|
|
4
|
+
* or as part of another component. Their appearance depends on the type of action required from the user
|
|
5
|
+
* and the context in which they are used.
|
|
6
|
+
*/
|
|
7
|
+
type __VLS_Props = {
|
|
23
8
|
/**
|
|
24
9
|
* Defines the visual style of the button.
|
|
25
10
|
*/
|
|
26
|
-
appearance?:
|
|
11
|
+
appearance?: 'standard' | 'accent' | 'danger' | 'inverse';
|
|
27
12
|
/**
|
|
28
13
|
* Determines the size of the button.
|
|
29
14
|
*/
|
|
30
|
-
size?:
|
|
15
|
+
size?: 's' | 'm' | 'l';
|
|
31
16
|
/**
|
|
32
17
|
* If `true`, disables the button, making it non-interactive.
|
|
33
18
|
*/
|
|
@@ -43,81 +28,35 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
43
28
|
/**
|
|
44
29
|
* Controls the positioning of an icon in the button.
|
|
45
30
|
*/
|
|
46
|
-
iconPosition?:
|
|
31
|
+
iconPosition?: 'left' | 'right' | 'only';
|
|
47
32
|
/**
|
|
48
33
|
* Specifies the button's HTML `type` attribute.
|
|
49
34
|
*/
|
|
50
|
-
type?:
|
|
35
|
+
type?: 'button' | 'reset' | 'submit';
|
|
51
36
|
/**
|
|
52
37
|
* If `true`, a loading state is displayed.
|
|
53
38
|
*/
|
|
54
39
|
isLoading?: boolean;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
size: string;
|
|
58
|
-
type: string;
|
|
59
|
-
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
60
|
-
/**
|
|
61
|
-
* Defines the visual style of the button.
|
|
62
|
-
*/
|
|
63
|
-
appearance?: "standard" | "accent" | "danger" | "inverse";
|
|
64
|
-
/**
|
|
65
|
-
* Determines the size of the button.
|
|
66
|
-
*/
|
|
67
|
-
size?: "s" | "m" | "l";
|
|
68
|
-
/**
|
|
69
|
-
* If `true`, disables the button, making it non-interactive.
|
|
70
|
-
*/
|
|
71
|
-
disabled?: boolean;
|
|
72
|
-
/**
|
|
73
|
-
* If `true`, applies a "ghost" style to the button, typically a transparent background with a border.
|
|
74
|
-
*/
|
|
75
|
-
ghost?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* If `true`, the button gets an outlined style, usually with just the border and no solid background.
|
|
78
|
-
*/
|
|
79
|
-
outlined?: boolean;
|
|
80
|
-
/**
|
|
81
|
-
* Controls the positioning of an icon in the button.
|
|
82
|
-
*/
|
|
83
|
-
iconPosition?: "left" | "right" | "only";
|
|
40
|
+
};
|
|
41
|
+
type __VLS_Slots = {
|
|
84
42
|
/**
|
|
85
|
-
*
|
|
43
|
+
* The content displayed in the button.
|
|
86
44
|
*/
|
|
87
|
-
|
|
45
|
+
default: string;
|
|
88
46
|
/**
|
|
89
|
-
*
|
|
47
|
+
* Use this slot to insert an icon for the Button.
|
|
90
48
|
*/
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
size: string;
|
|
95
|
-
type: string;
|
|
96
|
-
}>>> & Readonly<{}>, {
|
|
49
|
+
icon?: () => VNode[];
|
|
50
|
+
};
|
|
51
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
97
52
|
appearance: "standard" | "accent" | "danger" | "inverse";
|
|
98
53
|
size: "s" | "m" | "l";
|
|
99
54
|
type: "button" | "reset" | "submit";
|
|
100
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions,
|
|
101
|
-
declare const
|
|
55
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
56
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
57
|
+
declare const _default: typeof __VLS_export;
|
|
102
58
|
export default _default;
|
|
103
|
-
type
|
|
104
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
105
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
106
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
107
|
-
} : {
|
|
108
|
-
type: import('vue').PropType<T[K]>;
|
|
109
|
-
required: true;
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
type __VLS_WithDefaults<P, D> = {
|
|
113
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
114
|
-
default: D[K];
|
|
115
|
-
}> : P[K];
|
|
116
|
-
};
|
|
117
|
-
type __VLS_Prettify<T> = {
|
|
118
|
-
[K in keyof T]: T[K];
|
|
119
|
-
} & {};
|
|
120
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
59
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
121
60
|
new (): {
|
|
122
61
|
$slots: S;
|
|
123
62
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../src/index.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../src/index.vue"],"names":[],"mappings":"AA8MA,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,KAAK,CAAA;AAE1C;;;;GAIG;AACH,KAAK,WAAW,GAAG;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;IACzD;;OAEG;IACH,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;IACxC;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAA;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAC;AAUJ,KAAK,WAAW,GAAG;IACjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,KAAK,EAAE,CAAA;CACrB,CAAC;AAkGF,QAAA,MAAM,UAAU;gBAlJC,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS;UAIlD,GAAG,GAAG,GAAG,GAAG,GAAG;UAoBf,QAAQ,GAAG,OAAO,GAAG,QAAQ;6EA6HtC,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-duration:initial}}}.btn{min-height:calc(var(--spacing,.25rem) * 12);cursor:pointer;justify-content:center;align-items:center;gap:calc(var(--spacing,.25rem) * 2);border-radius:var(--border-radius-l);border-style:var(--tw-border-style);padding-inline:calc(var(--spacing,.25rem) * 6);font-family:var(--font-family,ui-sans-serif, system-ui, sans-serif);font-size:var(--font-size-05);line-height:var(--tw-leading,var(--text-base--line-height, 1.5 ));--tw-leading:var(--leading-tight,1.25);line-height:var(--leading-tight,1.25);--tw-font-weight:var(--font-weight-semi-bold);font-weight:var(--font-weight-semi-bold);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s));--tw-duration:.2s;background-color:var(--color-background-accent-inverse);color:var(--color-text-on-accent-inverse);border-width:1px;border-color:#0000;padding-block:.6875rem;transition-duration:.2s;display:inline-flex;position:relative}@media(hover:hover){.btn:enabled:hover{background-color:var(--color-background-accent-inverse)}@supports (color:color-mix(in lab,red,red)){.btn:enabled:hover{background-color:color-mix(in srgb,var(--color-background-accent-inverse) 85%,#000)}}}.btn:focus-visible{outline:var(--border-m) solid var(--color-text-accent);outline-offset:var(--border-m)}.btn:disabled{background-color:var(--color-background-secondary);color:var(--color-text-tertiary);cursor:not-allowed;border-color:#0000}.btn--s{min-height:calc(var(--spacing,.25rem) * 8);padding-inline:calc(var(--spacing,.25rem) * 4);font-size:var(--font-size-04);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)));padding-block:.3125rem}.btn--l{min-height:calc(var(--spacing,.25rem) * 14);padding-inline:calc(var(--spacing,.25rem) * 6);font-size:var(--font-size-06);line-height:var(--tw-leading,var(--text-lg--line-height,calc(1.75 / 1.125)));padding-block:.875rem}.btn--accent{background-color:var(--color-brand);color:var(--color-white,#fff);border-color:#0000}@media(hover:hover){.btn--accent:enabled:hover{background-color:var(--color-brand)}@supports (color:color-mix(in lab,red,red)){.btn--accent:enabled:hover{background-color:color-mix(in srgb,var(--color-brand) 85%,#000)}}}.btn--danger{background-color:var(--color-danger-500);color:var(--color-white,#fff);border-color:#0000}@media(hover:hover){.btn--danger:enabled:hover{background-color:var(--color-danger-600)}}.btn--inverse{border-color:var(--color-border-primary);background-color:var(--color-background-secondary);color:var(--color-text-primary)}@media(hover:hover){.btn--inverse:enabled:hover{background-color:var(--color-background-primary)}}.btn--ghost{color:var(--color-text-accent);background-color:#0000;border-color:#0000}@media(hover:hover){.btn--ghost:enabled:hover{background-color:var(--color-background-accent)}}.btn--outlined{border-color:var(--color-border-primary);color:var(--color-text-accent);background-color:#0000}@media(hover:hover){.btn--outlined:enabled:hover{background-color:var(--color-background-accent)}}.btn--icon-only{padding-inline:calc(var(--spacing,.25rem) * 2)}.btn__icon{height:calc(var(--spacing,.25rem) * 4);width:calc(var(--spacing,.25rem) * 4);flex-shrink:0;justify-content:center;align-items:center;display:flex}.btn__loader{inset:calc(var(--spacing,.25rem) * 0);justify-content:center;align-items:center;display:flex;position:absolute}.btn__spinner{height:calc(var(--spacing,.25rem) * 4);width:calc(var(--spacing,.25rem) * 4);border-style:var(--tw-border-style);border-width:2px;border-color:#0000 currentColor currentColor;border-radius:3.40282e38px;animation:.6s linear infinite az-btn-spin;display:block}.btn__label{display:inline-block}@keyframes az-btn-spin{to{transform:rotate(360deg)}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ptlm-azulejo/button",
|
|
3
|
-
"version": "2.1.2-alpha.
|
|
3
|
+
"version": "2.1.2-alpha.141",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.umd.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -30,12 +30,9 @@
|
|
|
30
30
|
"@ptlm-azulejo/fonts-adeo": "*",
|
|
31
31
|
"@ptlm-azulejo/fonts-leroy-merlin": "*",
|
|
32
32
|
"@ptlm-azulejo/themes": "*",
|
|
33
|
-
"@storybook/
|
|
34
|
-
"@storybook/addon-interactions": "^7.0.0",
|
|
35
|
-
"@storybook/vue3": "^7.0.0",
|
|
36
|
-
"@storybook/vue3-vite": "^7.0.0",
|
|
33
|
+
"@storybook/vue3-vite": "^10.5.8",
|
|
37
34
|
"@tailwindcss/vite": "^4.0.0",
|
|
38
|
-
"storybook": "^
|
|
35
|
+
"storybook": "^10.5.8",
|
|
39
36
|
"tailwindcss": "^4.0.0",
|
|
40
37
|
"vue": "^3.3.4"
|
|
41
38
|
},
|