@kong-ui-public/misc-widgets 2.2.6 → 2.2.7-pr.2575.0daaae41f.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 +57 -31
- 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 c, computed as
|
|
2
|
-
import { createI18n as
|
|
1
|
+
import { defineComponent as c, computed as m, ref as _, onMounted as f, resolveComponent as v, createElementBlock as u, createCommentVNode as S, openBlock as d, createVNode as w, withCtx as x, createElementVNode as s, unref as i, toDisplayString as p, normalizeClass as l } 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 b = {
|
|
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__ */ c({
|
|
25
28
|
__name: "GithubStar",
|
|
26
29
|
props: {
|
|
27
30
|
url: {
|
|
@@ -35,39 +38,62 @@ const C = {
|
|
|
35
38
|
}
|
|
36
39
|
},
|
|
37
40
|
setup(t) {
|
|
38
|
-
const { i18n: e } =
|
|
39
|
-
return
|
|
41
|
+
const { i18n: e } = b.useI18n(), a = t, n = m(() => a.tooltipText || e.t("githubStar.tooltipLabel")), o = _(!1);
|
|
42
|
+
return f(async () => {
|
|
40
43
|
const r = document.createElement("script");
|
|
41
44
|
r.addEventListener("load", () => {
|
|
42
|
-
|
|
45
|
+
o.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 &&
|
|
47
|
-
|
|
48
|
-
default:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"aria-label":
|
|
47
|
+
}), (r, V) => {
|
|
48
|
+
const h = v("KTooltip");
|
|
49
|
+
return t.url && o.value ? (d(), u("div", N, [
|
|
50
|
+
w(h, { text: n.value }, {
|
|
51
|
+
default: x(() => [
|
|
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
|
+
}, p(i(e).t("githubStar.title")), 9, T)
|
|
58
61
|
])
|
|
59
62
|
]),
|
|
60
63
|
_: 1
|
|
61
64
|
}, 8, ["text"])
|
|
62
|
-
])) :
|
|
65
|
+
])) : S("", !0);
|
|
63
66
|
};
|
|
64
67
|
}
|
|
65
|
-
}),
|
|
66
|
-
const
|
|
67
|
-
for (const [
|
|
68
|
-
|
|
69
|
-
return
|
|
70
|
-
},
|
|
68
|
+
}), g = (t, e) => {
|
|
69
|
+
const a = t.__vccOpts || t;
|
|
70
|
+
for (const [n, o] of e)
|
|
71
|
+
a[n] = o;
|
|
72
|
+
return a;
|
|
73
|
+
}, j = /* @__PURE__ */ g(E, [["__scopeId", "data-v-235436ca"]]), G = /* @__PURE__ */ c({
|
|
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 } } = b.useI18n();
|
|
87
|
+
return (a, n) => (d(), u("div", {
|
|
88
|
+
class: l(["new-badge-wrapper", { inverse: t.inverse }])
|
|
89
|
+
}, [
|
|
90
|
+
s("div", {
|
|
91
|
+
class: l(["new-badge", { large: t.large }])
|
|
92
|
+
}, p(i(e)("newBadge.label")), 3)
|
|
93
|
+
], 2));
|
|
94
|
+
}
|
|
95
|
+
}), z = /* @__PURE__ */ g(G, [["__scopeId", "data-v-18ea255a"]]);
|
|
71
96
|
export {
|
|
72
|
-
|
|
97
|
+
j as GithubStar,
|
|
98
|
+
z as NewBadge
|
|
73
99
|
};
|
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,
|
|
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,l){"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=l.createI18n("en-us",d);return{i18n:e,i18nT:l.i18nTComponent(e)}}const c={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}=c.useI18n(),a=e,i=t.computed(()=>a.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,k)=>{const _=t.resolveComponent("KTooltip");return e.url&&r.value?(t.openBlock(),t.createElementBlock("div",b,[t.createVNode(_,{text:i.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 a=e.__vccOpts||e;for(const[i,r]of o)a[i]=r;return a},f=u(h,[["__scopeId","data-v-235436ca"]]),m=u(t.defineComponent({__name:"NewBadge",props:{large:{type:Boolean,default:!1},inverse:{type:Boolean,default:!1}},setup(e){const{i18n:{t:o}}=c.useI18n();return(a,i)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["new-badge-wrapper",{inverse:e.inverse}])},[t.createElementVNode("div",{class:t.normalizeClass(["new-badge",{large:e.large}])},t.toDisplayString(t.unref(o)("newBadge.label")),3)],2))}}),[["__scopeId","data-v-18ea255a"]]);n.GithubStar=f,n.NewBadge=m,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-18ea255a]{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-18ea255a]{background:linear-gradient(219.69deg,#00d6a433 7.34%,#0044f433 83.28%);border-radius:4px;color:#fff;font-size:12px;font-weight:600;line-height:16px;padding:2px 4px;position:relative}.new-badge-wrapper .new-badge.large[data-v-18ea255a]{padding:4px 8px}.new-badge-wrapper.inverse[data-v-18ea255a]{background:linear-gradient(221.99deg,#00e3c0 26.67%,#1257ca 128%);border:none}.new-badge-wrapper.inverse .new-badge[data-v-18ea255a]{background:none;color:#000933}
|
|
@@ -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":";;;;;;;;;;;;;;;;;;;;;;AA4IA,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"}
|