@phila/phila-ui-callout 0.0.25 → 1.0.0-beta.10
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/Callout.vue.d.ts +10 -6
- package/dist/Callout.vue.d.ts.map +1 -1
- package/dist/index.css +1 -0
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +64 -116
- package/package.json +4 -6
package/dist/Callout.vue.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { CalloutProps } from './index';
|
|
2
|
+
type __VLS_Props = CalloutProps;
|
|
3
|
+
type __VLS_PublicProps = {
|
|
4
|
+
"open"?: boolean;
|
|
5
|
+
} & __VLS_Props;
|
|
2
6
|
declare function __VLS_template(): {
|
|
3
7
|
attrs: Partial<{}>;
|
|
4
8
|
slots: {
|
|
@@ -8,14 +12,14 @@ declare function __VLS_template(): {
|
|
|
8
12
|
rootEl: HTMLDivElement;
|
|
9
13
|
};
|
|
10
14
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
-
declare const __VLS_component: import('vue').DefineComponent<
|
|
12
|
-
|
|
13
|
-
}, string, import('vue').PublicProps, Readonly<
|
|
14
|
-
|
|
15
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
16
|
+
"update:open": (value: boolean) => any;
|
|
17
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
18
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
15
19
|
}>, {
|
|
20
|
+
title: string;
|
|
16
21
|
message: string;
|
|
17
|
-
type: "info" | "warning" | "error";
|
|
18
|
-
dismissible: boolean;
|
|
22
|
+
type: "info" | "warning" | "error" | "success";
|
|
19
23
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
20
24
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
21
25
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Callout.vue.d.ts","sourceRoot":"","sources":["../src/Callout.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Callout.vue.d.ts","sourceRoot":"","sources":["../src/Callout.vue"],"names":[],"mappings":"AA0IA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAU5C,KAAK,WAAW,GAAG,YAAY,CAAC;AA2ChC,KAAK,iBAAiB,GAAG;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;CAChB,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WA4FT,OAAO,IAA6B;;yBAVpB,GAAG;;;;EAehC;AAkBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;wFASnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
package/dist/index.css
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.callout[data-v-391366fe]{font-family:var(--Body-Default-font-body-default-family);line-height:var(--Body-Default-font-body-default-lineheight);border-radius:var(--border-radius-l)}.callout--success[data-v-391366fe]{background:var(--Schemes-Success-Container)}.callout--success .callout-icon[data-v-391366fe]{color:var(--Schemes-On-Success-Container)}.callout--warning[data-v-391366fe]{background:var(--Schemes-Alert-Container)}.callout--info[data-v-391366fe]{background:var(--Schemes-Info-Container)}.callout--error[data-v-391366fe]{background:var(--Schemes-Error-Container)}.callout--error .callout-icon[data-v-391366fe]{color:var(--Schemes-On-Error-Container)}.callout-header[data-v-391366fe]{cursor:pointer;width:100%;display:flex;justify-content:space-between;text-align:left;padding:var(--spacing-m);background:none;border:none}.callout-header-left[data-v-391366fe]{display:flex;gap:var(--spacing-xs)}.callout-title[data-v-391366fe]{font-weight:600;font-size:var(--Heading-H5-font-heading-5-size)}.callout--chevron[data-v-391366fe]{position:relative;float:right}.callout--content[data-v-391366fe]{font-size:var(--Body-Default-font-body-default-size);padding:0 var(--spacing-m) var(--spacing-m)}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { BaseProps } from '@phila/phila-ui-core';
|
|
2
2
|
export { default as Callout } from './Callout.vue';
|
|
3
3
|
export interface CalloutProps extends BaseProps {
|
|
4
|
+
title?: string;
|
|
4
5
|
message?: string;
|
|
5
|
-
type?: "info" | "warning" | "error";
|
|
6
|
-
icon?: string;
|
|
7
|
-
dismissible?: boolean;
|
|
6
|
+
type?: "info" | "warning" | "error" | "success";
|
|
8
7
|
}
|
|
9
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,eAAe,CAAC;AAInD,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,eAAe,CAAC;AAInD,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;CACjD"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("vue"),s=require("@phila/phila-ui-core"),n=require("@phila/phila-ui-core/icons"),d={class:"callout-header-left"},p={class:"callout-title"},m={key:0,class:"callout--content"},f=e.defineComponent({__name:"Callout",props:e.mergeModels({title:{default:""},message:{default:""},type:{default:"info"},className:{}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:["update:open"],setup(l){const c=e.useSlots(),t=l,o=e.useModel(l,"open"),a=()=>{o.value=!o.value},r=e.computed(()=>s.cn("callout",`callout--${t.type}`,t.className)),u=e.computed(()=>{switch(t.type){case"success":return n.IconCircleCheck;case"warning":return n.IconTriangleExclamation;case"error":return n.IconCircleExclamation;default:return n.IconCircleInfo}});return(i,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(r.value)},[e.createElementVNode("button",{type:"button",class:"callout-header",onClick:a},[e.createElementVNode("div",d,[e.createVNode(e.unref(s.Icon),{icon:u.value,decorative:"",inline:"",size:"small",class:"callout-icon"},null,8,["icon"]),e.createElementVNode("span",p,e.toDisplayString(t.title),1)]),e.createVNode(e.unref(s.Icon),{icon:o.value?e.unref(n.IconChevronUp):e.unref(n.IconChevronDown),decorative:"",inline:"",size:"small"},null,8,["icon"])]),o.value?(e.openBlock(),e.createElementBlock("div",m,[e.unref(c).default?e.renderSlot(i.$slots,"default",{key:0},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.message),1)],64))])):e.createCommentVNode("",!0)],2))}}),v=(l,c)=>{const t=l.__vccOpts||l;for(const[o,a]of c)t[o]=a;return t},_=v(f,[["__scopeId","data-v-391366fe"]]);exports.Callout=_;
|
package/dist/index.mjs
CHANGED
|
@@ -1,126 +1,74 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { cn as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
to: {},
|
|
9
|
-
target: {},
|
|
10
|
-
rel: {},
|
|
11
|
-
disabled: { type: Boolean, default: !1 },
|
|
12
|
-
clickTarget: {},
|
|
13
|
-
variant: { default: "primary" },
|
|
14
|
-
size: { default: "medium" },
|
|
15
|
-
iconOnly: { type: Boolean, default: !1 },
|
|
16
|
-
iconRight: { type: Boolean },
|
|
17
|
-
text: {},
|
|
18
|
-
className: {},
|
|
19
|
-
iconDefinition: {},
|
|
20
|
-
iconClass: {},
|
|
21
|
-
src: {},
|
|
22
|
-
svgRaw: {}
|
|
23
|
-
},
|
|
24
|
-
setup(o) {
|
|
25
|
-
const e = o, a = (t) => "href" in t && t.href !== void 0 || "to" in t && t.to !== void 0, s = c(() => N(
|
|
26
|
-
"phila-button",
|
|
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
|
-
)), n = c(() => a(e) ? "to" in e && e.to !== void 0 ? {
|
|
33
|
-
to: e.to,
|
|
34
|
-
disabled: e.disabled,
|
|
35
|
-
className: s.value
|
|
36
|
-
} : {
|
|
37
|
-
href: e.href,
|
|
38
|
-
target: e.target,
|
|
39
|
-
rel: e.rel,
|
|
40
|
-
disabled: e.disabled,
|
|
41
|
-
className: s.value
|
|
42
|
-
} : {}), r = c(
|
|
43
|
-
() => ({
|
|
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
|
-
})
|
|
52
|
-
);
|
|
53
|
-
return (t, d) => a(e) ? (l(), x(i(D), y({ key: 0 }, { ...n.value, ...t.$attrs }, { role: "button" }), {
|
|
54
|
-
default: u(() => [
|
|
55
|
-
b(i(k), _(g(r.value)), {
|
|
56
|
-
default: u(() => [
|
|
57
|
-
f(t.$slots, "default", {}, () => [
|
|
58
|
-
p(v(e.text), 1)
|
|
59
|
-
])
|
|
60
|
-
]),
|
|
61
|
-
_: 3
|
|
62
|
-
}, 16)
|
|
63
|
-
]),
|
|
64
|
-
_: 3
|
|
65
|
-
}, 16)) : (l(), m("button", y({
|
|
66
|
-
key: 1,
|
|
67
|
-
type: "button",
|
|
68
|
-
disabled: e.disabled,
|
|
69
|
-
class: s.value
|
|
70
|
-
}, t.$attrs), [
|
|
71
|
-
b(i(k), _(g(r.value)), {
|
|
72
|
-
default: u(() => [
|
|
73
|
-
f(t.$slots, "default", {}, () => [
|
|
74
|
-
p(v(e.text), 1)
|
|
75
|
-
])
|
|
76
|
-
]),
|
|
77
|
-
_: 3
|
|
78
|
-
}, 16)
|
|
79
|
-
], 16, R));
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
var V = {
|
|
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
|
-
}, w = V;
|
|
87
|
-
const S = { class: "content" }, T = /* @__PURE__ */ h({
|
|
1
|
+
import { defineComponent as _, mergeModels as C, useSlots as g, useModel as h, computed as i, createElementBlock as s, openBlock as a, normalizeClass as y, createElementVNode as r, createCommentVNode as I, createVNode as u, unref as n, toDisplayString as d, renderSlot as k, Fragment as N, createTextVNode as x } from "vue";
|
|
2
|
+
import { cn as E, Icon as p } from "@phila/phila-ui-core";
|
|
3
|
+
import { IconCircleInfo as V, IconCircleExclamation as w, IconTriangleExclamation as z, IconCircleCheck as B, IconChevronUp as M, IconChevronDown as S } from "@phila/phila-ui-core/icons";
|
|
4
|
+
import './index.css';const b = { class: "callout-header-left" }, D = { class: "callout-title" }, O = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "callout--content"
|
|
7
|
+
}, T = /* @__PURE__ */ _({
|
|
88
8
|
__name: "Callout",
|
|
89
|
-
props: {
|
|
9
|
+
props: /* @__PURE__ */ C({
|
|
10
|
+
title: { default: "" },
|
|
90
11
|
message: { default: "" },
|
|
91
12
|
type: { default: "info" },
|
|
92
|
-
icon: {},
|
|
93
|
-
dismissible: { type: Boolean, default: !1 },
|
|
94
13
|
className: {}
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
14
|
+
}, {
|
|
15
|
+
open: { type: Boolean, default: !1 },
|
|
16
|
+
openModifiers: {}
|
|
17
|
+
}),
|
|
18
|
+
emits: ["update:open"],
|
|
19
|
+
setup(o) {
|
|
20
|
+
const l = g(), e = o, t = h(o, "open"), c = () => {
|
|
21
|
+
t.value = !t.value;
|
|
22
|
+
}, m = i(() => E("callout", `callout--${e.type}`, e.className)), f = i(() => {
|
|
23
|
+
switch (e.type) {
|
|
24
|
+
case "success":
|
|
25
|
+
return B;
|
|
26
|
+
case "warning":
|
|
27
|
+
return z;
|
|
28
|
+
case "error":
|
|
29
|
+
return w;
|
|
30
|
+
default:
|
|
31
|
+
return V;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return (v, F) => (a(), s("div", {
|
|
35
|
+
class: y(m.value)
|
|
101
36
|
}, [
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
37
|
+
r("button", {
|
|
38
|
+
type: "button",
|
|
39
|
+
class: "callout-header",
|
|
40
|
+
onClick: c
|
|
41
|
+
}, [
|
|
42
|
+
r("div", b, [
|
|
43
|
+
u(n(p), {
|
|
44
|
+
icon: f.value,
|
|
45
|
+
decorative: "",
|
|
46
|
+
inline: "",
|
|
47
|
+
size: "small",
|
|
48
|
+
class: "callout-icon"
|
|
49
|
+
}, null, 8, ["icon"]),
|
|
50
|
+
r("span", D, d(e.title), 1)
|
|
51
|
+
]),
|
|
52
|
+
u(n(p), {
|
|
53
|
+
icon: t.value ? n(M) : n(S),
|
|
54
|
+
decorative: "",
|
|
55
|
+
inline: "",
|
|
56
|
+
size: "small"
|
|
57
|
+
}, null, 8, ["icon"])
|
|
106
58
|
]),
|
|
107
|
-
|
|
108
|
-
key: 0,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
icon: i(w),
|
|
113
|
-
"aria-label": "Dismiss",
|
|
114
|
-
onClick: d[0] || (d[0] = O(() => n("dismiss"), ["prevent"]))
|
|
115
|
-
}, null, 8, ["icon"])) : $("", !0)
|
|
59
|
+
t.value ? (a(), s("div", O, [
|
|
60
|
+
n(l).default ? k(v.$slots, "default", { key: 0 }, void 0, !0) : (a(), s(N, { key: 1 }, [
|
|
61
|
+
x(d(e.message), 1)
|
|
62
|
+
], 64))
|
|
63
|
+
])) : I("", !0)
|
|
116
64
|
], 2));
|
|
117
65
|
}
|
|
118
|
-
}),
|
|
119
|
-
const
|
|
120
|
-
for (const [
|
|
121
|
-
|
|
122
|
-
return
|
|
123
|
-
},
|
|
66
|
+
}), $ = (o, l) => {
|
|
67
|
+
const e = o.__vccOpts || o;
|
|
68
|
+
for (const [t, c] of l)
|
|
69
|
+
e[t] = c;
|
|
70
|
+
return e;
|
|
71
|
+
}, A = /* @__PURE__ */ $(T, [["__scopeId", "data-v-391366fe"]]);
|
|
124
72
|
export {
|
|
125
|
-
|
|
73
|
+
A as Callout
|
|
126
74
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phila/phila-ui-callout",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "1.0.0-beta.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A vue component for displaying important messages and warnings.",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -25,13 +25,11 @@
|
|
|
25
25
|
"author": "",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"vue": "^3.0.0"
|
|
29
|
-
"@fortawesome/fontawesome-svg-core": "^7.1.0",
|
|
30
|
-
"@fortawesome/pro-solid-svg-icons": "^7.1.0"
|
|
28
|
+
"vue": "^3.0.0"
|
|
31
29
|
},
|
|
32
30
|
"dependencies": {
|
|
33
|
-
"@phila/phila-ui-core": "
|
|
34
|
-
"@phila/phila-ui-button": "2.
|
|
31
|
+
"@phila/phila-ui-core": "3.0.0-beta.9",
|
|
32
|
+
"@phila/phila-ui-button": "2.3.0-beta.10"
|
|
35
33
|
},
|
|
36
34
|
"devDependencies": {
|
|
37
35
|
"@types/node": "^24.0.0",
|