@phila/phila-ui-button 2.2.3-beta.2 → 2.2.3-beta.3
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.d.ts +48 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +70 -43
- package/dist/phila-ui-button.css +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,42 @@
|
|
|
1
1
|
import { BaseIconProps } from '@phila/phila-ui-core';
|
|
2
2
|
import { BaseProps } from '@phila/phila-ui-core';
|
|
3
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
4
|
+
import { ComponentProvideOptions } from 'vue';
|
|
3
5
|
import { ComponentSize } from '@phila/phila-ui-core';
|
|
6
|
+
import { DefineComponent } from 'vue';
|
|
4
7
|
import { DefineSetupFnComponent } from 'vue';
|
|
8
|
+
import { ExtractPropTypes } from 'vue';
|
|
9
|
+
import { PropType } from 'vue';
|
|
5
10
|
import { PublicProps } from 'vue';
|
|
6
11
|
import { RouteLocationRaw } from '@phila/phila-ui-core';
|
|
7
12
|
|
|
8
13
|
declare const __VLS_component: DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, PublicProps>;
|
|
9
14
|
|
|
15
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
16
|
+
|
|
17
|
+
declare type __VLS_Prettify<T> = {
|
|
18
|
+
[K in keyof T]: T[K];
|
|
19
|
+
} & {};
|
|
20
|
+
|
|
10
21
|
declare function __VLS_template(): {
|
|
11
22
|
default?(_: {}): any;
|
|
12
23
|
};
|
|
13
24
|
|
|
25
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
26
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
27
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
28
|
+
} : {
|
|
29
|
+
type: PropType<T[K]>;
|
|
30
|
+
required: true;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
35
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
36
|
+
default: D[K];
|
|
37
|
+
}> : P[K];
|
|
38
|
+
};
|
|
39
|
+
|
|
14
40
|
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
15
41
|
new (): {
|
|
16
42
|
$slots: S;
|
|
@@ -34,6 +60,28 @@ export declare type ButtonProps = EventButtonProps | LinkButtonProps;
|
|
|
34
60
|
|
|
35
61
|
export declare type ButtonVariant = "primary" | "secondary" | "destructive" | "standard";
|
|
36
62
|
|
|
63
|
+
export declare const CloseButton: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<BaseProps & {
|
|
64
|
+
disabled?: boolean;
|
|
65
|
+
size?: ComponentSize;
|
|
66
|
+
ariaLabel?: string;
|
|
67
|
+
}>, {
|
|
68
|
+
disabled: boolean;
|
|
69
|
+
size: string;
|
|
70
|
+
ariaLabel: string;
|
|
71
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<BaseProps & {
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
size?: ComponentSize;
|
|
74
|
+
ariaLabel?: string;
|
|
75
|
+
}>, {
|
|
76
|
+
disabled: boolean;
|
|
77
|
+
size: string;
|
|
78
|
+
ariaLabel: string;
|
|
79
|
+
}>>> & Readonly<{}>, {
|
|
80
|
+
size: ComponentSize;
|
|
81
|
+
disabled: boolean;
|
|
82
|
+
ariaLabel: string;
|
|
83
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
84
|
+
|
|
37
85
|
export declare interface EventButtonProps extends BaseButtonProps {
|
|
38
86
|
/** No href or to - renders as <button> */
|
|
39
87
|
href?: never;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("@phila/phila-ui-core"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("@phila/phila-ui-core"),d=["disabled"],r=e.defineComponent({inheritAttrs:!1,__name:"PhlButton",props:{href:{},to:{},target:{},rel:{},disabled:{type:Boolean,default:!1},clickTarget:{},variant:{default:"primary"},size:{default:"medium"},iconOnly:{type:Boolean,default:!1},iconRight:{type:Boolean},text:{},className:{},iconDefinition:{},iconClass:{},src:{},svgRaw:{}},setup(n){const t=n,i=a=>"href"in a&&a.href!==void 0||"to"in a&&a.to!==void 0,s=e.computed(()=>o.cn("phila-button",`phila-button--${t.variant}`,t.size&&`is-${t.size}`,t.iconOnly&&"icon-button",t.iconOnly&&t.variant==="standard"&&"icon-button--standard",t.className)),c=e.computed(()=>i(t)?"to"in t&&t.to!==void 0?{to:t.to,disabled:t.disabled,className:s.value}:{href:t.href,target:t.target,rel:t.rel,disabled:t.disabled,className:s.value}:{}),l=e.computed(()=>({iconDefinition:t.iconDefinition,iconClass:t.iconClass,src:t.src,iconRight:t.iconRight,iconOnly:t.iconOnly,text:t.text,size:t.size}));return(a,m)=>i(t)?(e.openBlock(),e.createBlock(e.unref(o.BaseLink),e.mergeProps({key:0},{...c.value,...a.$attrs},{role:"button"}),{default:e.withCtx(()=>[e.createVNode(e.unref(o.ActionContent),e.normalizeProps(e.guardReactiveProps(l.value)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.text),1)])]),_:3},16)]),_:3},16)):(e.openBlock(),e.createElementBlock("button",e.mergeProps({key:1,type:"button",disabled:t.disabled,class:s.value},a.$attrs),[e.createVNode(e.unref(o.ActionContent),e.normalizeProps(e.guardReactiveProps(l.value)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.text),1)])]),_:3},16)],16,d))}});var u={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]};const f=e.defineComponent({inheritAttrs:!1,__name:"CloseButton",props:{className:{},disabled:{type:Boolean,default:!1},size:{default:"small"},ariaLabel:{default:"Close"}},setup(n){return(t,i)=>(e.openBlock(),e.createBlock(r,e.mergeProps({variant:"standard","icon-definition":e.unref(u),"icon-only":"",disabled:n.disabled,size:n.size,"class-name":e.unref(o.cn)("phila-close-button",n.className),"aria-label":n.ariaLabel},t.$attrs),null,16,["icon-definition","disabled","size","class-name","aria-label"]))}});exports.CloseButton=f;exports.PhilaButton=r;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { cn as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as y, computed as o, createBlock as B, createElementBlock as z, openBlock as r, unref as n, mergeProps as c, withCtx as l, createVNode as u, normalizeProps as f, guardReactiveProps as m, renderSlot as b, createTextVNode as h, toDisplayString as p } from "vue";
|
|
2
|
+
import { cn as g, BaseLink as C, ActionContent as v } from "@phila/phila-ui-core";
|
|
3
|
+
const L = ["disabled"], N = /* @__PURE__ */ y({
|
|
4
4
|
inheritAttrs: !1,
|
|
5
5
|
__name: "PhlButton",
|
|
6
6
|
props: {
|
|
@@ -21,64 +21,91 @@ const _ = ["disabled"], x = /* @__PURE__ */ g({
|
|
|
21
21
|
src: {},
|
|
22
22
|
svgRaw: {}
|
|
23
23
|
},
|
|
24
|
-
setup(
|
|
25
|
-
const
|
|
24
|
+
setup(a) {
|
|
25
|
+
const e = a, i = (t) => "href" in t && t.href !== void 0 || "to" in t && t.to !== void 0, s = o(() => g(
|
|
26
26
|
"phila-button",
|
|
27
|
-
`phila-button--${
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
)),
|
|
33
|
-
to:
|
|
34
|
-
disabled:
|
|
35
|
-
className:
|
|
27
|
+
`phila-button--${e.variant}`,
|
|
28
|
+
e.size && `is-${e.size}`,
|
|
29
|
+
e.iconOnly && "icon-button",
|
|
30
|
+
e.iconOnly && e.variant === "standard" && "icon-button--standard",
|
|
31
|
+
e.className
|
|
32
|
+
)), k = o(() => i(e) ? "to" in e && e.to !== void 0 ? {
|
|
33
|
+
to: e.to,
|
|
34
|
+
disabled: e.disabled,
|
|
35
|
+
className: s.value
|
|
36
36
|
} : {
|
|
37
|
-
href:
|
|
38
|
-
target:
|
|
39
|
-
rel:
|
|
40
|
-
disabled:
|
|
41
|
-
className:
|
|
42
|
-
} : {}),
|
|
37
|
+
href: e.href,
|
|
38
|
+
target: e.target,
|
|
39
|
+
rel: e.rel,
|
|
40
|
+
disabled: e.disabled,
|
|
41
|
+
className: s.value
|
|
42
|
+
} : {}), d = o(
|
|
43
43
|
() => ({
|
|
44
|
-
iconDefinition:
|
|
45
|
-
iconClass:
|
|
46
|
-
src:
|
|
47
|
-
iconRight:
|
|
48
|
-
iconOnly:
|
|
49
|
-
text:
|
|
50
|
-
size:
|
|
44
|
+
iconDefinition: e.iconDefinition,
|
|
45
|
+
iconClass: e.iconClass,
|
|
46
|
+
src: e.src,
|
|
47
|
+
iconRight: e.iconRight,
|
|
48
|
+
iconOnly: e.iconOnly,
|
|
49
|
+
text: e.text,
|
|
50
|
+
size: e.size
|
|
51
51
|
})
|
|
52
52
|
);
|
|
53
|
-
return (
|
|
54
|
-
default:
|
|
55
|
-
|
|
56
|
-
default:
|
|
57
|
-
|
|
58
|
-
p(
|
|
53
|
+
return (t, x) => i(e) ? (r(), B(n(C), c({ key: 0 }, { ...k.value, ...t.$attrs }, { role: "button" }), {
|
|
54
|
+
default: l(() => [
|
|
55
|
+
u(n(v), f(m(d.value)), {
|
|
56
|
+
default: l(() => [
|
|
57
|
+
b(t.$slots, "default", {}, () => [
|
|
58
|
+
h(p(e.text), 1)
|
|
59
59
|
])
|
|
60
60
|
]),
|
|
61
61
|
_: 3
|
|
62
62
|
}, 16)
|
|
63
63
|
]),
|
|
64
64
|
_: 3
|
|
65
|
-
}, 16)) : (r(),
|
|
65
|
+
}, 16)) : (r(), z("button", c({
|
|
66
66
|
key: 1,
|
|
67
67
|
type: "button",
|
|
68
|
-
disabled:
|
|
69
|
-
class:
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
default:
|
|
73
|
-
|
|
74
|
-
p(
|
|
68
|
+
disabled: e.disabled,
|
|
69
|
+
class: s.value
|
|
70
|
+
}, t.$attrs), [
|
|
71
|
+
u(n(v), f(m(d.value)), {
|
|
72
|
+
default: l(() => [
|
|
73
|
+
b(t.$slots, "default", {}, () => [
|
|
74
|
+
h(p(e.text), 1)
|
|
75
75
|
])
|
|
76
76
|
]),
|
|
77
77
|
_: 3
|
|
78
78
|
}, 16)
|
|
79
|
-
], 16,
|
|
79
|
+
], 16, L));
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
var $ = {
|
|
83
|
+
prefix: "fas",
|
|
84
|
+
iconName: "xmark",
|
|
85
|
+
icon: [384, 512, [128473, 10005, 10006, 10060, 215, "close", "multiply", "remove", "times"], "f00d", "M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]
|
|
86
|
+
};
|
|
87
|
+
const O = /* @__PURE__ */ y({
|
|
88
|
+
inheritAttrs: !1,
|
|
89
|
+
__name: "CloseButton",
|
|
90
|
+
props: {
|
|
91
|
+
className: {},
|
|
92
|
+
disabled: { type: Boolean, default: !1 },
|
|
93
|
+
size: { default: "small" },
|
|
94
|
+
ariaLabel: { default: "Close" }
|
|
95
|
+
},
|
|
96
|
+
setup(a) {
|
|
97
|
+
return (e, i) => (r(), B(N, c({
|
|
98
|
+
variant: "standard",
|
|
99
|
+
"icon-definition": n($),
|
|
100
|
+
"icon-only": "",
|
|
101
|
+
disabled: a.disabled,
|
|
102
|
+
size: a.size,
|
|
103
|
+
"class-name": n(g)("phila-close-button", a.className),
|
|
104
|
+
"aria-label": a.ariaLabel
|
|
105
|
+
}, e.$attrs), null, 16, ["icon-definition", "disabled", "size", "class-name", "aria-label"]));
|
|
80
106
|
}
|
|
81
107
|
});
|
|
82
108
|
export {
|
|
83
|
-
|
|
109
|
+
O as CloseButton,
|
|
110
|
+
N as PhilaButton
|
|
84
111
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.phila-button.icon-button.phila-close-button.icon-button--standard:not(:disabled),.phila-button.icon-button.phila-close-button.icon-button--standard:not(:disabled):hover,.phila-button.icon-button.phila-close-button.icon-button--standard:not(:disabled):focus{color:var(--Schemes-On-Primary-Container)}
|