@kong-ui-public/misc-widgets 2.6.0 → 2.6.1-pr.3771.ec0697170.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/misc-widgets",
3
- "version": "2.6.0",
3
+ "version": "2.6.1-pr.3771.ec0697170.0",
4
4
  "type": "module",
5
5
  "main": "./dist/misc-widgets.umd.js",
6
6
  "module": "./dist/misc-widgets.es.js",
@@ -1,153 +0,0 @@
1
- import { defineComponent as I, computed as u, ref as K, onMounted as z, resolveComponent as f, openBlock as c, createElementBlock as O, createVNode as $, withCtx as d, createElementVNode as k, unref as n, toDisplayString as D, createCommentVNode as _, useModel as y, useSlots as G, createBlock as m, mergeProps as N, createSlots as j, renderList as H, renderSlot as C, normalizeProps as P, guardReactiveProps as q, resolveDynamicComponent as A, mergeModels as U } from "vue";
2
- import { createI18n as R, i18nTComponent as Z } from "@kong-ui-public/i18n";
3
- import { VisibilityIcon as F, VisibilityOffIcon as J } from "@kong/icons";
4
- const Q = { title: "Star", ariaLabel: "Star buttons/github-buttons on GitHub", tooltipLabel: "Star this repository on Github" }, W = { show: "Show secret", hide: "Hide secret" }, X = {
5
- githubStar: Q,
6
- secretInput: W
7
- };
8
- function Y() {
9
- const e = R("en-us", X);
10
- return {
11
- i18n: e,
12
- i18nT: Z(e)
13
- // Translation component <i18n-t>
14
- };
15
- }
16
- const w = {
17
- useI18n: Y
18
- }, ee = {
19
- key: 0,
20
- class: "kong-ui-public-misc-widgets-github-star",
21
- "data-testid": "github-star"
22
- }, te = ["aria-label", "href"], oe = /* @__PURE__ */ I({
23
- __name: "GithubStar",
24
- props: {
25
- url: {
26
- type: String,
27
- required: !0
28
- },
29
- tooltipText: {
30
- type: String,
31
- required: !1,
32
- default: ""
33
- }
34
- },
35
- setup(e) {
36
- const { i18n: a } = w.useI18n(), r = e, t = u(() => r.tooltipText || a.t("githubStar.tooltipLabel")), s = K(!1);
37
- return z(async () => {
38
- const l = document.createElement("script");
39
- l.addEventListener("load", () => {
40
- s.value = !0;
41
- }), l.setAttribute("src", "https://buttons.github.io/buttons.js"), document.head.appendChild(l);
42
- }), (l, b) => {
43
- const i = f("KTooltip");
44
- return e.url && s.value ? (c(), O("div", ee, [
45
- $(i, { text: t.value }, {
46
- default: d(() => [
47
- k("span", null, [
48
- k("a", {
49
- "aria-label": n(a).t("githubStar.ariaLabel"),
50
- class: "github-button",
51
- "data-color-scheme": "no-preference: light; light: light; dark: light;",
52
- "data-show-count": "true",
53
- href: e.url,
54
- target: "_blank"
55
- }, D(n(a).t("githubStar.title")), 9, te)
56
- ])
57
- ]),
58
- _: 1
59
- }, 8, ["text"])
60
- ])) : _("", !0);
61
- };
62
- }
63
- }), L = (e, a) => {
64
- const r = e.__vccOpts || e;
65
- for (const [t, s] of a)
66
- r[t] = s;
67
- return r;
68
- }, ie = /* @__PURE__ */ L(oe, [["__scopeId", "data-v-235436ca"]]), ae = "20px", se = /* @__PURE__ */ I({
69
- inheritAttrs: !1,
70
- __name: "SecretInput",
71
- props: /* @__PURE__ */ U({
72
- autocomplete: { default: "off" },
73
- showLabel: {},
74
- hideLabel: {},
75
- showMaskToggle: { type: Boolean, default: !0 }
76
- }, {
77
- modelValue: {
78
- default: ""
79
- },
80
- modelModifiers: {},
81
- masked: { type: Boolean, default: !0 },
82
- maskedModifiers: {}
83
- }),
84
- emits: ["update:modelValue", "update:masked"],
85
- setup(e) {
86
- const [a, r] = y(e, "modelValue", {
87
- set: (o) => r.trim ? o.trim() : o
88
- }), t = y(e, "masked"), { i18n: { t: s } } = w.useI18n(), l = u(() => e.showLabel ?? s("secretInput.show")), b = u(() => e.hideLabel ?? s("secretInput.hide")), i = G(), M = () => Object.fromEntries(
89
- Object.entries(i).filter(([o]) => o !== "after")
90
- ), x = typeof CSS < "u" && typeof CSS.supports == "function" && CSS.supports("-webkit-text-security", "disc"), T = u(() => t.value && !x ? "password" : "text"), h = () => {
91
- t.value = !t.value;
92
- }, p = (o) => {
93
- t.value && o.preventDefault();
94
- };
95
- return (o, g) => {
96
- const V = f("KButton"), B = f("KInput");
97
- return c(), m(B, N(o.$attrs, {
98
- autocapitalize: "off",
99
- autocomplete: e.autocomplete,
100
- autocorrect: "off",
101
- class: { "secret-input-masked": t.value },
102
- "model-value": n(a),
103
- spellcheck: "false",
104
- type: T.value,
105
- onCopyCapture: p,
106
- onCutCapture: p,
107
- onDragstartCapture: p,
108
- "onUpdate:modelValue": g[0] || (g[0] = (v) => a.value = v)
109
- }), j({ _: 2 }, [
110
- H(M(), (v, S) => ({
111
- name: S,
112
- fn: d((E) => [
113
- C(o.$slots, S, P(q(E)), void 0, !0)
114
- ])
115
- })),
116
- e.showMaskToggle || n(i).after ? {
117
- name: "after",
118
- fn: d(() => [
119
- C(o.$slots, "after", {
120
- masked: t.value,
121
- toggle: h
122
- }, void 0, !0),
123
- e.showMaskToggle ? (c(), m(V, {
124
- key: 0,
125
- appearance: "none",
126
- "aria-label": t.value ? l.value : b.value,
127
- "aria-pressed": !t.value,
128
- class: "secret-input-toggle mask-value-toggle-button",
129
- "data-testid": "secret-input-toggle",
130
- icon: "",
131
- type: "button",
132
- onClick: h
133
- }, {
134
- default: d(() => [
135
- (c(), m(A(t.value ? n(F) : n(J)), {
136
- color: "currentColor",
137
- decorative: "",
138
- size: `var(--kui-icon-size-40, ${n(ae)})`
139
- }, null, 8, ["size"]))
140
- ]),
141
- _: 1
142
- }, 8, ["aria-label", "aria-pressed"])) : _("", !0)
143
- ]),
144
- key: "0"
145
- } : void 0
146
- ]), 1040, ["autocomplete", "class", "model-value", "type"]);
147
- };
148
- }
149
- }), ue = /* @__PURE__ */ L(se, [["__scopeId", "data-v-f3196a23"]]);
150
- export {
151
- ie as GithubStar,
152
- ue as SecretInput
153
- };
@@ -1 +0,0 @@
1
- (function(n,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons"],t):(n=typeof globalThis<"u"?globalThis:n||self,t(n["kong-ui-public-misc-widgets"]={},n.Vue,n["kong-ui-public-i18n"],n.KongIcons))})(this,(function(n,t,d,p){"use strict";const y={githubStar:{title:"Star",ariaLabel:"Star buttons/github-buttons on GitHub",tooltipLabel:"Star this repository on Github"},secretInput:{show:"Show secret",hide:"Hide secret"}};function C(){const e=d.createI18n("en-us",y);return{i18n:e,i18nT:d.i18nTComponent(e)}}const f={useI18n:C},I={key:0,class:"kong-ui-public-misc-widgets-github-star","data-testid":"github-star"},w=["aria-label","href"],_=t.defineComponent({__name:"GithubStar",props:{url:{type:String,required:!0},tooltipText:{type:String,required:!1,default:""}},setup(e){const{i18n:a}=f.useI18n(),i=e,o=t.computed(()=>i.tooltipText||a.t("githubStar.tooltipLabel")),r=t.ref(!1);return t.onMounted(async()=>{const l=document.createElement("script");l.addEventListener("load",()=>{r.value=!0}),l.setAttribute("src","https://buttons.github.io/buttons.js"),document.head.appendChild(l)}),(l,b)=>{const c=t.resolveComponent("KTooltip");return e.url&&r.value?(t.openBlock(),t.createElementBlock("div",I,[t.createVNode(c,{text:o.value},{default:t.withCtx(()=>[t.createElementVNode("span",null,[t.createElementVNode("a",{"aria-label":t.unref(a).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(a).t("githubStar.title")),9,w)])]),_:1},8,["text"])])):t.createCommentVNode("",!0)}}}),m=(e,a)=>{const i=e.__vccOpts||e;for(const[o,r]of a)i[o]=r;return i},x=m(_,[["__scopeId","data-v-235436ca"]]),L="20px",M=m(t.defineComponent({inheritAttrs:!1,__name:"SecretInput",props:t.mergeModels({autocomplete:{default:"off"},showLabel:{},hideLabel:{},showMaskToggle:{type:Boolean,default:!0}},{modelValue:{default:""},modelModifiers:{},masked:{type:Boolean,default:!0},maskedModifiers:{}}),emits:["update:modelValue","update:masked"],setup(e){const[a,i]=t.useModel(e,"modelValue",{set:s=>i.trim?s.trim():s}),o=t.useModel(e,"masked"),{i18n:{t:r}}=f.useI18n(),l=t.computed(()=>e.showLabel??r("secretInput.show")),b=t.computed(()=>e.hideLabel??r("secretInput.hide")),c=t.useSlots(),T=()=>Object.fromEntries(Object.entries(c).filter(([s])=>s!=="after")),B=typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("-webkit-text-security","disc"),V=t.computed(()=>o.value&&!B?"password":"text"),h=()=>{o.value=!o.value},u=s=>{o.value&&s.preventDefault()};return(s,g)=>{const E=t.resolveComponent("KButton"),K=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(K,t.mergeProps(s.$attrs,{autocapitalize:"off",autocomplete:e.autocomplete,autocorrect:"off",class:{"secret-input-masked":o.value},"model-value":t.unref(a),spellcheck:"false",type:V.value,onCopyCapture:u,onCutCapture:u,onDragstartCapture:u,"onUpdate:modelValue":g[0]||(g[0]=k=>a.value=k)}),t.createSlots({_:2},[t.renderList(T(),(k,S)=>({name:S,fn:t.withCtx(N=>[t.renderSlot(s.$slots,S,t.normalizeProps(t.guardReactiveProps(N)),void 0,!0)])})),e.showMaskToggle||t.unref(c).after?{name:"after",fn:t.withCtx(()=>[t.renderSlot(s.$slots,"after",{masked:o.value,toggle:h},void 0,!0),e.showMaskToggle?(t.openBlock(),t.createBlock(E,{key:0,appearance:"none","aria-label":o.value?l.value:b.value,"aria-pressed":!o.value,class:"secret-input-toggle mask-value-toggle-button","data-testid":"secret-input-toggle",icon:"",type:"button",onClick:h},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.value?t.unref(p.VisibilityIcon):t.unref(p.VisibilityOffIcon)),{color:"currentColor",decorative:"",size:`var(--kui-icon-size-40, ${t.unref(L)})`},null,8,["size"]))]),_:1},8,["aria-label","aria-pressed"])):t.createCommentVNode("",!0)]),key:"0"}:void 0]),1040,["autocomplete","class","model-value","type"])}}}),[["__scopeId","data-v-f3196a23"]]);n.GithubStar=x,n.SecretInput=M,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}));
package/dist/style.css DELETED
@@ -1 +0,0 @@
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}.secret-input-masked[data-v-f3196a23] input{-webkit-text-security:disc}.secret-input-masked[data-v-f3196a23] input[type=password]::-ms-reveal{display:none}.secret-input-toggle[data-v-f3196a23]{color:#6c7489;color:var(--kui-color-text-neutral, #6c7489);cursor:pointer}
@@ -1,26 +0,0 @@
1
- declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
- url: {
3
- type: StringConstructor;
4
- required: true;
5
- };
6
- tooltipText: {
7
- type: StringConstructor;
8
- required: false;
9
- default: string;
10
- };
11
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
12
- url: {
13
- type: StringConstructor;
14
- required: true;
15
- };
16
- tooltipText: {
17
- type: StringConstructor;
18
- required: false;
19
- default: string;
20
- };
21
- }>> & Readonly<{}>, {
22
- tooltipText: string;
23
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
24
- declare const _default: typeof __VLS_export;
25
- export default _default;
26
- //# sourceMappingURL=GithubStar.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GithubStar.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/github-star/GithubStar.vue"],"names":[],"mappings":"AA+JA,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;4EAYhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,3 +0,0 @@
1
- export { default as GithubStar } from './github-star/GithubStar.vue';
2
- export { default as SecretInput } from './secret-input/SecretInput.vue';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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,WAAW,EAAE,MAAM,gCAAgC,CAAA"}
@@ -1,36 +0,0 @@
1
- type __VLS_Props = {
2
- autocomplete?: string;
3
- showLabel?: string;
4
- hideLabel?: string;
5
- showMaskToggle?: boolean;
6
- };
7
- type __VLS_ModelProps = {
8
- modelValue?: string;
9
- 'masked'?: boolean;
10
- };
11
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
12
- declare var __VLS_15: string, __VLS_16: any, __VLS_19: {
13
- masked: boolean;
14
- toggle: () => void;
15
- };
16
- type __VLS_Slots = {} & {
17
- [K in NonNullable<typeof __VLS_15>]?: (props: typeof __VLS_16) => any;
18
- } & {
19
- after?: (props: typeof __VLS_19) => any;
20
- };
21
- declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
22
- "update:modelValue": (value: string) => any;
23
- "update:masked": (value: boolean) => any;
24
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
25
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
26
- "onUpdate:masked"?: ((value: boolean) => any) | undefined;
27
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
29
- declare const _default: typeof __VLS_export;
30
- export default _default;
31
- type __VLS_WithSlots<T, S> = T & {
32
- new (): {
33
- $slots: S;
34
- };
35
- };
36
- //# sourceMappingURL=SecretInput.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SecretInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/secret-input/SecretInput.vue"],"names":[],"mappings":"AA4HA,KAAK,WAAW,GAAG;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,CAAC;AAqCF,KAAK,gBAAgB,GAAG;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAMF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAwKxD,QAAA,IAAI,QAAQ,QAAW,EAAE,QAAQ,KAAW,EAAE,QAAQ;;;CAAY,CAAE;AACpE,KAAK,WAAW,GAAG,EAAE,GACnB;KAAG,CAAC,IAAI,WAAW,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG;CAAE,GACzE;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAK9C,QAAA,MAAM,UAAU;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1,6 +0,0 @@
1
- import useI18n from './useI18n';
2
- declare const _default: {
3
- useI18n: typeof useI18n;
4
- };
5
- export default _default;
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAA;;;;AAG/B,wBAEC"}
@@ -1,9 +0,0 @@
1
- import { createI18n, i18nTComponent } from '@kong-ui-public/i18n';
2
- import english from '../locales/en.json';
3
- interface UseI18nReturn {
4
- i18n: ReturnType<typeof createI18n<typeof english>>;
5
- i18nT: ReturnType<typeof i18nTComponent<typeof english>>;
6
- }
7
- export default function useI18n(): UseI18nReturn;
8
- export {};
9
- //# sourceMappingURL=useI18n.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useI18n.d.ts","sourceRoot":"","sources":["../../../src/composables/useI18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,OAAO,MAAM,oBAAoB,CAAA;AAExC,UAAU,aAAa;IACrB,IAAI,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC,CAAA;IACnD,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC,CAAA;CACzD;AAED,MAAM,CAAC,OAAO,UAAU,OAAO,IAAI,aAAa,CAO/C"}
@@ -1,3 +0,0 @@
1
- export * from './components';
2
- export * from './types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAA"}