@kong-ui-public/misc-widgets 2.2.6 → 2.2.7-pr.2575.724dc2194.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.
- package/dist/misc-widgets.es.js +54 -30
- package/dist/misc-widgets.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/NewBadge.vue.d.ts +24 -0
- package/dist/types/components/NewBadge.vue.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/misc-widgets.es.js
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { createI18n as
|
|
1
|
+
import { defineComponent as l, computed as h, ref as m, onMounted as _, resolveComponent as f, createElementBlock as c, createCommentVNode as v, openBlock as u, createVNode as S, withCtx as w, createElementVNode as s, unref as i, toDisplayString as d, normalizeClass as x } from "vue";
|
|
2
|
+
import { createI18n as y, i18nTComponent as B } from "@kong-ui-public/i18n";
|
|
3
3
|
const k = {
|
|
4
4
|
title: "Star",
|
|
5
5
|
ariaLabel: "Star buttons/github-buttons on GitHub",
|
|
6
6
|
tooltipLabel: "Star this repository on Github"
|
|
7
|
-
},
|
|
8
|
-
|
|
7
|
+
}, C = {
|
|
8
|
+
label: "New"
|
|
9
|
+
}, L = {
|
|
10
|
+
githubStar: k,
|
|
11
|
+
newBadge: C
|
|
9
12
|
};
|
|
10
|
-
function
|
|
11
|
-
const t =
|
|
13
|
+
function I() {
|
|
14
|
+
const t = y("en-us", L);
|
|
12
15
|
return {
|
|
13
16
|
i18n: t,
|
|
14
|
-
i18nT:
|
|
17
|
+
i18nT: B(t)
|
|
15
18
|
// Translation component <i18n-t>
|
|
16
19
|
};
|
|
17
20
|
}
|
|
18
|
-
const
|
|
19
|
-
useI18n:
|
|
20
|
-
},
|
|
21
|
+
const p = {
|
|
22
|
+
useI18n: I
|
|
23
|
+
}, N = {
|
|
21
24
|
key: 0,
|
|
22
25
|
class: "kong-ui-public-misc-widgets-github-star",
|
|
23
26
|
"data-testid": "github-star"
|
|
24
|
-
},
|
|
27
|
+
}, T = ["aria-label", "href"], E = /* @__PURE__ */ l({
|
|
25
28
|
__name: "GithubStar",
|
|
26
29
|
props: {
|
|
27
30
|
url: {
|
|
@@ -35,39 +38,60 @@ const C = {
|
|
|
35
38
|
}
|
|
36
39
|
},
|
|
37
40
|
setup(t) {
|
|
38
|
-
const { i18n: e } =
|
|
39
|
-
return
|
|
41
|
+
const { i18n: e } = p.useI18n(), a = t, o = h(() => a.tooltipText || e.t("githubStar.tooltipLabel")), n = m(!1);
|
|
42
|
+
return _(async () => {
|
|
40
43
|
const r = document.createElement("script");
|
|
41
44
|
r.addEventListener("load", () => {
|
|
42
45
|
n.value = !0;
|
|
43
46
|
}), r.setAttribute("src", "https://buttons.github.io/buttons.js"), document.head.appendChild(r);
|
|
44
|
-
}), (r,
|
|
45
|
-
const
|
|
46
|
-
return t.url && n.value ? (
|
|
47
|
-
|
|
48
|
-
default:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"aria-label":
|
|
47
|
+
}), (r, q) => {
|
|
48
|
+
const g = f("KTooltip");
|
|
49
|
+
return t.url && n.value ? (u(), c("div", N, [
|
|
50
|
+
S(g, { text: o.value }, {
|
|
51
|
+
default: w(() => [
|
|
52
|
+
s("span", null, [
|
|
53
|
+
s("a", {
|
|
54
|
+
"aria-label": i(e).t("githubStar.ariaLabel"),
|
|
52
55
|
class: "github-button",
|
|
53
56
|
"data-color-scheme": "no-preference: light; light: light; dark: light;",
|
|
54
57
|
"data-show-count": "true",
|
|
55
58
|
href: t.url,
|
|
56
59
|
target: "_blank"
|
|
57
|
-
},
|
|
60
|
+
}, d(i(e).t("githubStar.title")), 9, T)
|
|
58
61
|
])
|
|
59
62
|
]),
|
|
60
63
|
_: 1
|
|
61
64
|
}, 8, ["text"])
|
|
62
|
-
])) :
|
|
65
|
+
])) : v("", !0);
|
|
63
66
|
};
|
|
64
67
|
}
|
|
65
|
-
}),
|
|
66
|
-
const
|
|
67
|
-
for (const [
|
|
68
|
-
o
|
|
69
|
-
return
|
|
70
|
-
},
|
|
68
|
+
}), b = (t, e) => {
|
|
69
|
+
const a = t.__vccOpts || t;
|
|
70
|
+
for (const [o, n] of e)
|
|
71
|
+
a[o] = n;
|
|
72
|
+
return a;
|
|
73
|
+
}, j = /* @__PURE__ */ b(E, [["__scopeId", "data-v-235436ca"]]), G = { class: "new-badge-wrapper" }, V = /* @__PURE__ */ l({
|
|
74
|
+
__name: "NewBadge",
|
|
75
|
+
props: {
|
|
76
|
+
large: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: !1
|
|
79
|
+
},
|
|
80
|
+
inverse: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: !1
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
setup(t) {
|
|
86
|
+
const { i18n: { t: e } } = p.useI18n();
|
|
87
|
+
return (a, o) => (u(), c("div", G, [
|
|
88
|
+
s("div", {
|
|
89
|
+
class: x(["new-badge", { large: t.large, inverse: t.inverse }])
|
|
90
|
+
}, d(i(e)("newBadge.label")), 3)
|
|
91
|
+
]));
|
|
92
|
+
}
|
|
93
|
+
}), z = /* @__PURE__ */ b(V, [["__scopeId", "data-v-55723a91"]]);
|
|
71
94
|
export {
|
|
72
|
-
|
|
95
|
+
j as GithubStar,
|
|
96
|
+
z as NewBadge
|
|
73
97
|
};
|
package/dist/misc-widgets.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n"],t):(n=typeof globalThis<"u"?globalThis:n||self,t(n["kong-ui-public-misc-widgets"]={},n.Vue,n["kong-ui-public-i18n"]))})(this,function(n,t,c){"use strict";const
|
|
1
|
+
(function(n,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n"],t):(n=typeof globalThis<"u"?globalThis:n||self,t(n["kong-ui-public-misc-widgets"]={},n.Vue,n["kong-ui-public-i18n"]))})(this,function(n,t,c){"use strict";const d={githubStar:{title:"Star",ariaLabel:"Star buttons/github-buttons on GitHub",tooltipLabel:"Star this repository on Github"},newBadge:{label:"New"}};function p(){const e=c.createI18n("en-us",d);return{i18n:e,i18nT:c.i18nTComponent(e)}}const l={useI18n:p},b={key:0,class:"kong-ui-public-misc-widgets-github-star","data-testid":"github-star"},g=["aria-label","href"],h=t.defineComponent({__name:"GithubStar",props:{url:{type:String,required:!0},tooltipText:{type:String,required:!1,default:""}},setup(e){const{i18n:o}=l.useI18n(),i=e,a=t.computed(()=>i.tooltipText||o.t("githubStar.tooltipLabel")),r=t.ref(!1);return t.onMounted(async()=>{const s=document.createElement("script");s.addEventListener("load",()=>{r.value=!0}),s.setAttribute("src","https://buttons.github.io/buttons.js"),document.head.appendChild(s)}),(s,B)=>{const S=t.resolveComponent("KTooltip");return e.url&&r.value?(t.openBlock(),t.createElementBlock("div",b,[t.createVNode(S,{text:a.value},{default:t.withCtx(()=>[t.createElementVNode("span",null,[t.createElementVNode("a",{"aria-label":t.unref(o).t("githubStar.ariaLabel"),class:"github-button","data-color-scheme":"no-preference: light; light: light; dark: light;","data-show-count":"true",href:e.url,target:"_blank"},t.toDisplayString(t.unref(o).t("githubStar.title")),9,g)])]),_:1},8,["text"])])):t.createCommentVNode("",!0)}}}),u=(e,o)=>{const i=e.__vccOpts||e;for(const[a,r]of o)i[a]=r;return i},f=u(h,[["__scopeId","data-v-235436ca"]]),m={class:"new-badge-wrapper"},_=u(t.defineComponent({__name:"NewBadge",props:{large:{type:Boolean,default:!1},inverse:{type:Boolean,default:!1}},setup(e){const{i18n:{t:o}}=l.useI18n();return(i,a)=>(t.openBlock(),t.createElementBlock("div",m,[t.createElementVNode("div",{class:t.normalizeClass(["new-badge",{large:e.large,inverse:e.inverse}])},t.toDisplayString(t.unref(o)("newBadge.label")),3)]))}}),[["__scopeId","data-v-55723a91"]]);n.GithubStar=f,n.NewBadge=_,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.kong-ui-public-misc-widgets-github-star[data-v-235436ca]{max-height:20px}.kong-ui-public-misc-widgets-github-star .github-button[data-v-235436ca]{font-style:normal}
|
|
1
|
+
.kong-ui-public-misc-widgets-github-star[data-v-235436ca]{max-height:20px}.kong-ui-public-misc-widgets-github-star .github-button[data-v-235436ca]{font-style:normal}.new-badge-wrapper[data-v-55723a91]{background:linear-gradient(90deg,#000933 2.68%,#000933e6) padding-box,linear-gradient(219.69deg,#00d6a4,#0044f4 74.54%) border-box;border:1px solid transparent;border-radius:4px}.new-badge-wrapper .new-badge[data-v-55723a91]{border-radius:4px;color:#fff;font-size:12px;font-weight:600;line-height:16px;padding:2px 4px;position:relative}.new-badge-wrapper .new-badge[data-v-55723a91]:not(.inverse){background:linear-gradient(219.69deg,#00d6a433 7.34%,#0044f433 83.28%)}.new-badge-wrapper .new-badge.large[data-v-55723a91]{padding:4px 8px}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
large: {
|
|
3
|
+
type: BooleanConstructor;
|
|
4
|
+
default: boolean;
|
|
5
|
+
};
|
|
6
|
+
inverse: {
|
|
7
|
+
type: BooleanConstructor;
|
|
8
|
+
default: boolean;
|
|
9
|
+
};
|
|
10
|
+
}>, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
|
+
large: {
|
|
12
|
+
type: BooleanConstructor;
|
|
13
|
+
default: boolean;
|
|
14
|
+
};
|
|
15
|
+
inverse: {
|
|
16
|
+
type: BooleanConstructor;
|
|
17
|
+
default: boolean;
|
|
18
|
+
};
|
|
19
|
+
}>> & Readonly<{}>, {
|
|
20
|
+
large: boolean;
|
|
21
|
+
inverse: boolean;
|
|
22
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
23
|
+
export default _default;
|
|
24
|
+
//# sourceMappingURL=NewBadge.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NewBadge.vue.d.ts","sourceRoot":"","sources":["../../../src/components/NewBadge.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8HA,wBAaG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,8BAA8B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAA"}
|