@scalar/components 0.0.4 → 0.1.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/index.cjs +55 -17
- package/dist/index.d.ts +526 -14
- package/dist/index.js +297 -248
- package/dist/index.umd.cjs +40 -2
- package/dist/style.css +1 -1
- package/package.json +5 -5
- package/dist/components/ScalarButton/ScalarButton.spec.d.ts +0 -2
- package/dist/components/ScalarButton/ScalarButton.spec.d.ts.map +0 -1
- package/dist/components/ScalarButton/ScalarButton.stories.d.ts +0 -889
- package/dist/components/ScalarButton/ScalarButton.stories.d.ts.map +0 -1
- package/dist/components/ScalarButton/ScalarButton.vue.d.ts +0 -55
- package/dist/components/ScalarButton/ScalarButton.vue.d.ts.map +0 -1
- package/dist/components/ScalarButton/index.d.ts +0 -2
- package/dist/components/ScalarButton/index.d.ts.map +0 -1
- package/dist/components/ScalarIcon/ScalarIcon.spec.d.ts +0 -2
- package/dist/components/ScalarIcon/ScalarIcon.spec.d.ts.map +0 -1
- package/dist/components/ScalarIcon/ScalarIcon.stories.d.ts +0 -71
- package/dist/components/ScalarIcon/ScalarIcon.stories.d.ts.map +0 -1
- package/dist/components/ScalarIcon/ScalarIcon.vue.d.ts +0 -17
- package/dist/components/ScalarIcon/ScalarIcon.vue.d.ts.map +0 -1
- package/dist/components/ScalarIcon/SvgRenderer.d.ts +0 -7
- package/dist/components/ScalarIcon/SvgRenderer.d.ts.map +0 -1
- package/dist/components/ScalarIcon/icons/iconNames.d.ts +0 -2
- package/dist/components/ScalarIcon/icons/iconNames.d.ts.map +0 -1
- package/dist/components/ScalarIcon/icons/index.d.ts +0 -4
- package/dist/components/ScalarIcon/icons/index.d.ts.map +0 -1
- package/dist/components/ScalarIcon/index.d.ts +0 -3
- package/dist/components/ScalarIcon/index.d.ts.map +0 -1
- package/dist/components/ScalarIconButton/ScalarIconButton.spec.d.ts +0 -2
- package/dist/components/ScalarIconButton/ScalarIconButton.spec.d.ts.map +0 -1
- package/dist/components/ScalarIconButton/ScalarIconButton.stories.d.ts +0 -57
- package/dist/components/ScalarIconButton/ScalarIconButton.stories.d.ts.map +0 -1
- package/dist/components/ScalarIconButton/ScalarIconButton.vue.d.ts +0 -35
- package/dist/components/ScalarIconButton/ScalarIconButton.vue.d.ts.map +0 -1
- package/dist/components/ScalarIconButton/index.d.ts +0 -2
- package/dist/components/ScalarIconButton/index.d.ts.map +0 -1
- package/dist/components/ScalarLoading/ScalarLoading.spec.d.ts +0 -2
- package/dist/components/ScalarLoading/ScalarLoading.spec.d.ts.map +0 -1
- package/dist/components/ScalarLoading/ScalarLoading.stories.d.ts +0 -326
- package/dist/components/ScalarLoading/ScalarLoading.stories.d.ts.map +0 -1
- package/dist/components/ScalarLoading/ScalarLoading.vue.d.ts +0 -48
- package/dist/components/ScalarLoading/ScalarLoading.vue.d.ts.map +0 -1
- package/dist/components/ScalarLoading/index.d.ts +0 -2
- package/dist/components/ScalarLoading/index.d.ts.map +0 -1
- package/dist/components/ScalarModal/ScalarModal.spec.d.ts +0 -2
- package/dist/components/ScalarModal/ScalarModal.spec.d.ts.map +0 -1
- package/dist/components/ScalarModal/ScalarModal.stories.d.ts +0 -202
- package/dist/components/ScalarModal/ScalarModal.stories.d.ts.map +0 -1
- package/dist/components/ScalarModal/ScalarModal.vue.d.ts +0 -52
- package/dist/components/ScalarModal/ScalarModal.vue.d.ts.map +0 -1
- package/dist/components/ScalarModal/index.d.ts +0 -2
- package/dist/components/ScalarModal/index.d.ts.map +0 -1
- package/dist/components/ScalarTextField/ScalarTextField.spec.d.ts +0 -2
- package/dist/components/ScalarTextField/ScalarTextField.spec.d.ts.map +0 -1
- package/dist/components/ScalarTextField/ScalarTextField.stories.d.ts +0 -992
- package/dist/components/ScalarTextField/ScalarTextField.stories.d.ts.map +0 -1
- package/dist/components/ScalarTextField/ScalarTextField.vue.d.ts +0 -73
- package/dist/components/ScalarTextField/ScalarTextField.vue.d.ts.map +0 -1
- package/dist/components/ScalarTextField/index.d.ts +0 -2
- package/dist/components/ScalarTextField/index.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/tailwind/index.d.ts +0 -2
- package/dist/tailwind/index.d.ts.map +0 -1
- package/dist/tailwind/tailwind.theme.d.ts +0 -59
- package/dist/tailwind/tailwind.theme.d.ts.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,25 +1,38 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var L=Object.create;var _=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var N=(r,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of $(o))!T.call(r,l)&&l!==t&&_(r,l,{get:()=>o[l],enumerable:!(n=V(o,l))||n.enumerable});return r};var D=(r,o,t)=>(t=r!=null?L(A(r)):{},N(o||!r||!r.__esModule?_(t,"default",{value:r,enumerable:!0}):t,r));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),E=require("cva"),Z=require("tailwind-merge"),m=require("@headlessui/vue"),F=require("@vueuse/core"),j=require("nanoid"),I=Z.extendTailwindMerge({}),{cva:c,cx:i,compose:De}=E.defineConfig({hooks:{onComplete:r=>`${I(r)} scalar-reset`}}),P={key:0,class:"loader-wrapper"},H=e.createStaticVNode('<path class="svg-path svg-check-mark" d="m 0 60 l 30 30 l 70 -80" data-v-9483a281></path><path class="svg-path svg-x-mark" d="m 50 50 l 40 -40" data-v-9483a281></path><path class="svg-path svg-x-mark" d="m 50 50 l 40 40" data-v-9483a281></path><path class="svg-path svg-x-mark" d="m 50 50 l -40 -40" data-v-9483a281></path><path class="svg-path svg-x-mark" d="m 50 50 l -40 40" data-v-9483a281></path>',5),O={key:0,class:"circular-loader"};function W(){return e.reactive({isValid:!1,isInvalid:!1,isLoading:!1,startLoading(){this.isLoading=!0},stopLoading(){this.isLoading=!1},validate(r=800){this.isValid=!0;const o=r-300;return new Promise(t=>setTimeout(()=>this.clear().then(()=>t(!0)),o))},invalidate(r=1100){this.isInvalid=!0;const o=r-300;return new Promise(t=>setTimeout(()=>this.clear().then(()=>t(!0)),o))},clear(r=300){return this.isValid=!1,this.isInvalid=!1,this.isLoading=!1,new Promise(o=>{setTimeout(()=>{o(!0)},r)})}})}const q=e.defineComponent({__name:"ScalarLoading",props:{loadingState:{},size:{default:"24px"}},setup(r){return e.useCssVars(o=>({"68e6c412":o.size})),(o,t)=>o.loadingState?(e.openBlock(),e.createElementBlock("div",P,[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-loader",{"icon-is-valid":o.loadingState.isValid,"icon-is-invalid":o.loadingState.isInvalid}]),viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[H,o.loadingState.isLoading?(e.openBlock(),e.createElementBlock("g",O,[e.createElementVNode("circle",{class:e.normalizeClass(["loader-path",{"loader-path-off":o.loadingState.isValid||o.loadingState.isInvalid}]),cx:"50",cy:"50",fill:"none",r:"20","stroke-width":"2"},null,2)])):e.createCommentVNode("",!0)],2))])):e.createCommentVNode("",!0)}});const g=(r,o)=>{const t=r.__vccOpts||r;for(const[n,l]of o)t[n]=l;return t},f=g(q,[["__scopeId","data-v-9483a281"]]),x={solid:["scalar-button-solid","bg-back-btn-1 text-fore-btn-1 shadow-sm active:bg-back-btn-1 active:shadow-none hocus:bg-hover-btn-1"],outlined:["scalar-button-outlined","active:bg-btn-1 border border-solid border-border bg-transparent text-fore-1 hocus:bg-back-2"],ghost:["scalar-button-ghost","bg-transparent text-fore-3 active:text-fore-2 hocus:text-fore-2"],danger:["scalar-button-danger","bg-error text-white active:brightness-90 hocus:brightness-90"]},R=c({base:"scalar-button row cursor-pointer items-center justify-center rounded font-medium",variants:{disabled:{true:"bg-background-2 text-color-3 cursor-not-allowed shadow-none"},fullWidth:{true:"w-full"},size:{md:"h-10 px-6 text-sm"},variant:x},compoundVariants:[{disabled:!0,variant:"ghost",class:"bg-transparent text-ghost"}]}),K=["ariaDisabled"],U={key:0,class:"mr-2 h-4 w-4"},G={key:1,class:"ml-2"},C=e.defineComponent({inheritAttrs:!1,__name:"ScalarButton",props:{disabled:{type:Boolean},fullWidth:{type:Boolean,default:!1},loading:{},size:{default:"md"},variant:{default:"solid"}},setup(r){const o=e.computed(()=>{const{class:t,...n}=e.useAttrs();return{className:t||"",rest:n}});return(t,n)=>(e.openBlock(),e.createElementBlock("button",e.mergeProps(o.value.rest,{ariaDisabled:t.disabled||void 0,class:e.unref(i)(e.unref(R)({fullWidth:t.fullWidth,disabled:t.disabled,size:t.size,variant:t.variant}),{"pl-9 pr-3":t.loading},`${o.value.className}`),type:"button"}),[t.$slots.icon?(e.openBlock(),e.createElementBlock("div",U,[e.renderSlot(t.$slots,"icon")])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"default"),t.loading?(e.openBlock(),e.createElementBlock("div",G,[e.createVNode(e.unref(f),{loadingState:t.loading,size:"20px"},null,8,["loadingState"])])):e.createCommentVNode("",!0)],16,K))}}),J=r=>Object.fromEntries(Array.from(r).map(o=>[o.name,o.value])),Q=r=>({raw:o})=>{const n=new r().parseFromString(o,"image/svg+xml");if(n.getElementsByTagName("parsererror").length)return;const l=n.documentElement,d=J(l.attributes),{width:u,height:v,...h}=d;return e.h("svg",{...h,innerHTML:l.innerHTML})},X=e.defineAsyncComponent(async()=>{const r=typeof DOMParser>"u"?(await import("@xmldom/xmldom")).DOMParser:DOMParser,o=Q(r);return o.props={raw:{type:String,required:!0}},o}),Y=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
|
|
2
2
|
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.429"
|
|
3
3
|
d="M24 1.714v44.572M1.714 24h44.572" />
|
|
4
|
-
</svg>`,
|
|
4
|
+
</svg>`,ee=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32.5 23.5" fill="currentColor">
|
|
5
5
|
<path d="M11.2 23.5 0 12.3l2.15-2.15 9.05 9.05L30.4 0l2.15 2.15z" />
|
|
6
|
-
</svg>`,
|
|
6
|
+
</svg>`,te=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
7
7
|
<path d="m19.5 8.25-7.5 7.5-7.5-7.5" />
|
|
8
|
-
</svg>`,
|
|
8
|
+
</svg>`,oe=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
9
9
|
<path d="M15.75 19.5 8.25 12l7.5-7.5" />
|
|
10
|
-
</svg>`,
|
|
10
|
+
</svg>`,re=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
11
11
|
<path d="m8.25 4.5 7.5 7.5-7.5 7.5" />
|
|
12
12
|
</svg>`,ae=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
13
13
|
<path d="m4.5 15.75 7.5-7.5 7.5 7.5" />
|
|
14
|
-
</svg>`,
|
|
14
|
+
</svg>`,ne=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 16 16">
|
|
15
|
+
<path d="M6,5h4c1.7,0,2-1.3,2-3c1.1,0,2,0.9,2,2v10c0,1.1-0.9,2-2,2H4c-1.1,0-2-0.9-2-2V4c0-1.1,0.9-2,2-2C4,3.7,4.3,5,6,5z M6,2V1
|
|
16
|
+
c0-0.6,0.5-1,1-1h2c0.5,0,1,0.4,1,1v1.3C10,2.9,9.6,3,9,3H7C6.4,3,6,2.6,6,2z" />
|
|
17
|
+
</svg>`,le=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
|
|
15
18
|
<path stroke="currentColor" d="m12.5 1.5-11 11m0-11 11 11" />
|
|
16
|
-
</svg>`,
|
|
19
|
+
</svg>`,se=`<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
|
|
20
|
+
<path
|
|
21
|
+
d="M9.557,7.243A.456.456,0,0,0,9.1,6.991C9.023,7,8.951,7,8.877,7A4,4,0,0,1,5.546.781.5.5,0,0,0,5.564.256.476.476,0,0,0,5.1,0,5,5,0,1,0,9.539,7.767.5.5,0,0,0,9.557,7.243Z"
|
|
22
|
+
fill="currentColor" stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
23
|
+
</svg>`,ie=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
17
24
|
<path
|
|
18
25
|
d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" />
|
|
19
|
-
</svg>`,
|
|
26
|
+
</svg>`,de=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9 9">
|
|
27
|
+
<g fill="none" fill-rule="evenodd" transform="translate(.67 .67)">
|
|
28
|
+
<rect transform="rotate(180 4 4)" />
|
|
29
|
+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width=".5"
|
|
30
|
+
d="M2.85 1.73h3.4v3.4m0-3.4L1.74 6.24" />
|
|
31
|
+
</g>
|
|
32
|
+
</svg>`,ce=`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 1024 1024">
|
|
20
33
|
<path
|
|
21
34
|
d="M512 0a512 512 0 0 0-162 998c26 4 35-11 35-25l-1-95c-128 23-161-32-172-60-6-15-31-61-52-73-18-10-44-33-1-33 40-1 69 37 78 52 46 78 120 56 149 43 5-33 18-56 33-69-114-13-234-56-234-253 0-56 20-101 53-137-5-13-23-65 5-136 0 0 43-13 141 53a487 487 0 0 1 256 0c98-66 141-53 141-53 28 71 10 123 5 136 33 36 53 81 53 137 0 197-120 240-234 253 18 16 35 47 35 95l-1 140c0 14 9 30 35 25A512 512 0 0 0 512 0z" />
|
|
22
|
-
</svg>`,
|
|
35
|
+
</svg>`,ue=`<svg
|
|
23
36
|
height="24"
|
|
24
37
|
viewBox="0 0 24 24"
|
|
25
38
|
width="24"
|
|
@@ -28,24 +41,49 @@
|
|
|
28
41
|
d="M24 12a1 1 0 0 0 -1 -1h-3.91a0.51 0.51 0 0 1 -0.49 -0.4 6.83 6.83 0 0 0 -0.94 -2.28 0.5 0.5 0 0 1 0.06 -0.63l2.77 -2.76a1 1 0 1 0 -1.42 -1.42l-2.76 2.77a0.5 0.5 0 0 1 -0.63 0.06 6.83 6.83 0 0 0 -2.28 -0.94 0.5 0.5 0 0 1 -0.4 -0.49V1a1 1 0 0 0 -2 0v3.91a0.51 0.51 0 0 1 -0.4 0.49 6.83 6.83 0 0 0 -2.28 0.94 0.5 0.5 0 0 1 -0.63 -0.06L4.93 3.51a1 1 0 0 0 -1.42 1.42l2.77 2.76a0.5 0.5 0 0 1 0.06 0.63 6.83 6.83 0 0 0 -0.94 2.28 0.5 0.5 0 0 1 -0.49 0.4H1a1 1 0 0 0 0 2h3.91a0.51 0.51 0 0 1 0.49 0.4 6.83 6.83 0 0 0 0.94 2.28 0.5 0.5 0 0 1 -0.06 0.63l-2.77 2.76a1 1 0 1 0 1.42 1.42l2.76 -2.77a0.5 0.5 0 0 1 0.63 -0.06 6.83 6.83 0 0 0 2.28 0.94 0.5 0.5 0 0 1 0.4 0.49V23a1 1 0 0 0 2 0v-3.91a0.51 0.51 0 0 1 0.4 -0.49 6.83 6.83 0 0 0 2.28 -0.94 0.5 0.5 0 0 1 0.63 0.06l2.76 2.77a1 1 0 1 0 1.42 -1.42l-2.77 -2.76a0.5 0.5 0 0 1 -0.06 -0.63 6.83 6.83 0 0 0 0.94 -2.28 0.5 0.5 0 0 1 0.49 -0.4H23a1 1 0 0 0 1 -1Zm-8.74 2.5A5.76 5.76 0 0 1 9.5 8.74a5.66 5.66 0 0 1 0.16 -1.31 0.49 0.49 0 0 1 0.34 -0.36 5.36 5.36 0 0 1 1.8 -0.31 5.47 5.47 0 0 1 5.46 5.46 5.36 5.36 0 0 1 -0.31 1.8 0.49 0.49 0 0 1 -0.35 0.32 5.53 5.53 0 0 1 -1.34 0.16Z"
|
|
29
42
|
fill="currentColor"
|
|
30
43
|
stroke-width="1"></path>
|
|
31
|
-
</svg>`,
|
|
44
|
+
</svg>`,ve=`<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
|
|
45
|
+
<path d="M3.500 5.000 A1.500 1.500 0 1 0 6.500 5.000 A1.500 1.500 0 1 0 3.500 5.000 Z" fill="currentColor"
|
|
46
|
+
stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
47
|
+
<path d="M5,2.25a.625.625,0,0,1-.625-.625v-1a.625.625,0,0,1,1.25,0v1A.625.625,0,0,1,5,2.25Z" fill="currentColor"
|
|
48
|
+
stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
49
|
+
<path d="M6.945,3.055a.623.623,0,0,1,0-.883l.707-.708a.625.625,0,0,1,.884.884l-.708.707A.623.623,0,0,1,6.945,3.055Z"
|
|
50
|
+
fill="currentColor" stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
51
|
+
<path d="M7.75,5a.625.625,0,0,1,.625-.625h1a.625.625,0,0,1,0,1.25h-1A.625.625,0,0,1,7.75,5Z" fill="currentColor"
|
|
52
|
+
stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
53
|
+
<path d="M6.945,6.945a.623.623,0,0,1,.883,0l.708.707a.625.625,0,0,1-.884.884l-.707-.708A.623.623,0,0,1,6.945,6.945Z"
|
|
54
|
+
fill="currentColor" stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
55
|
+
<path d="M5,7.75a.625.625,0,0,1,.625.625v1a.625.625,0,0,1-1.25,0v-1A.625.625,0,0,1,5,7.75Z" fill="currentColor"
|
|
56
|
+
stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
57
|
+
<path
|
|
58
|
+
d="M3.055,6.945a.623.623,0,0,1,0,.883l-.707.708a.625.625,0,0,1-.884-.884l.708-.707A.623.623,0,0,1,3.055,6.945Z"
|
|
59
|
+
fill="currentColor" stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
60
|
+
<path d="M2.25,5a.625.625,0,0,1-.625.625h-1a.625.625,0,0,1,0-1.25h1A.625.625,0,0,1,2.25,5Z" fill="currentColor"
|
|
61
|
+
stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
62
|
+
<path
|
|
63
|
+
d="M3.055,3.055a.623.623,0,0,1-.883,0l-.708-.707a.625.625,0,0,1,.884-.884l.707.708A.623.623,0,0,1,3.055,3.055Z"
|
|
64
|
+
fill="currentColor" stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
65
|
+
</svg>`,he=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 593 593">
|
|
32
66
|
<path fill="currentColor" fill-rule="evenodd"
|
|
33
67
|
d="M347 0c6 0 12 5 12 12v134l94-95c5-5 13-5 17 0l72 72c4 4 5 12 0 16v1l-95 94h134c7 0 12 5 12 12v101c0 7-5 12-12 12H447l95 94c4 5 5 13 0 17l-72 72c-4 4-12 5-16 0h-1l-94-95v134c0 7-5 12-12 12H246c-7 0-12-5-12-12v-70c0-22 9-43 24-59l130-130c14-14 14-37 0-51L259 142a84 84 0 0 1-25-59V12c0-7 5-12 12-12h101ZM138 52h1l219 219c14 14 14 37 0 51L139 542c-4 5-12 5-17 0l-71-70c-4-5-5-12 0-17l95-96H12c-7 0-12-5-12-12V246c0-7 5-12 12-12h134l-95-94c-4-5-4-12 0-17l71-71c4-5 12-5 16 0Z" />
|
|
34
|
-
</svg>`,
|
|
68
|
+
</svg>`,me=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 662 662">
|
|
35
69
|
<path fill-rule="evenodd" fill="currentColor"
|
|
36
70
|
d="M331 0a331 331 0 1 1 0 662 331 331 0 0 1 0-662Zm148.5 109 .6.9a187 187 0 1 1-297.6-.9 267 267 0 1 0 297 0Z" />
|
|
37
|
-
</svg>`,
|
|
71
|
+
</svg>`,pe=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 620">
|
|
38
72
|
<path fill="currentColor"
|
|
39
73
|
d="M-.653 309.29c-.078 82.272 31.848 159.735 89.739 218.178l.283.283c122.379 121.247 319.824 121.184 440.16-.283 119.967-121.1 119.409-316.933-.998-437.339l-.99-.99C468.681 30.845 390.716-1.017 307.893-.67c-82.83.354-160.443 32.994-218.814 91.79C31.209 149.555-.724 227.025-.653 309.29Zm469.271-160.789.778.778c87.9 87.9 88.325 231.005.707 319.33-77.753 78.46-199.786 87.412-288.959 26.862l198.513-198.513-.007 166.361 83.68-.07v-306.22H157.11l-.008 83.6h160.584L121.994 436.323c-59.347-87.689-50.536-208.59 26.51-286.343C236.34 61.294 379.94 60.67 468.61 148.494Z" />
|
|
40
|
-
</svg>`,
|
|
74
|
+
</svg>`,ge=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 642 642" fill="currentColor">
|
|
41
75
|
<path
|
|
42
76
|
d="M321 0a321 321 0 1 1 0 642 321 321 0 0 1 0-642Zm51.3 63L321 189.5 269.7 63l1 136.5-95.8-97.2L228 228l-125.7-53.1 97.2 95.8-136.5-1L189.5 321 63 372.3l136.5-1-97.2 95.8 125.7-53-53.1 125.6 95.8-97.2-1 136.5L321 452.5 372.3 579l-1-136.5 95.8 97.2-53-125.7 125.6 53.1-97.2-95.8 136.5 1L452.5 321 579 269.7l-136.5 1 97.2-95.8L414 228l53.1-125.7-95.8 97.2 1-136.5Z" />
|
|
43
|
-
</svg>`,
|
|
77
|
+
</svg>`,fe=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 620" fill="currentColor">
|
|
44
78
|
<path
|
|
45
79
|
d="M529.2 90.8A310 310 0 1 0 90.8 529.2 310 310 0 0 0 529.2 90.8M122.4 498.2c-54.9-55-15.4-183.5 88.2-287 103.6-103.7 232.1-143.2 287-88.3 54.9 54.8 15.4 183.4-88.3 287-103.5 103.6-232 143.1-286.9 88.3m261.8-262.7A104.7 104.7 0 1 1 236 383.7a104.7 104.7 0 0 1 148.2-148.2" />
|
|
46
|
-
</svg>`,
|
|
80
|
+
</svg>`,we=`<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 14 14">
|
|
47
81
|
<path fill="none" stroke="currentColor" d="M14 3.4H0m14 7.2H0" />
|
|
48
|
-
</svg>`,
|
|
82
|
+
</svg>`,be=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
|
|
83
|
+
<path fill="currentColor" fill-rule="evenodd"
|
|
84
|
+
d="M11.8214 0.0977942C12.1097 -0.00745677 12.4219 -0.0286524 12.7219 0.0367783C13.0248 0.102864 13.3024 0.254542 13.5216 0.47378C13.7408 0.693018 13.8925 0.970598 13.9586 1.27352C14.024 1.57344 14.0028 1.88572 13.8976 2.17395L10.3236 12.8859L10.3234 12.8866C10.2363 13.1501 10.083 13.3868 9.8781 13.574C9.6738 13.7606 9.42509 13.8918 9.15572 13.9549C8.8863 14.0206 8.60441 14.0151 8.33774 13.9389C8.07131 13.8628 7.82926 13.7187 7.63529 13.5209L5.71795 11.6124L3.70389 12.6538C3.54684 12.7351 3.35857 12.7273 3.20874 12.6334C3.05892 12.5395 2.96981 12.3735 2.9744 12.1967L3.05697 9.013L10.1019 3.8956C10.3812 3.69273 10.4432 3.30188 10.2403 3.02261C10.0374 2.74333 9.64659 2.68139 9.36731 2.88425L2.20283 8.08846L0.473125 6.35875L0.473067 6.3587L0.472941 6.35857C0.285618 6.17138 0.147716 5.9406 0.0716193 5.68694C-0.00393616 5.43509 -0.0162115 5.16853 0.0358379 4.91085C0.0879545 4.62934 0.213796 4.36664 0.400577 4.14957C0.588637 3.93101 0.83165 3.76664 1.1045 3.67345L1.10787 3.6723L1.10787 3.67231L11.8214 0.0977942Z"
|
|
85
|
+
clip-rule="evenodd"></path>
|
|
86
|
+
</svg>`,_e=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor">
|
|
49
87
|
<path fill-rule="evenodd"
|
|
50
88
|
d="M12.6 11.2h.1l3 3a1 1 0 1 1-1.4 1.5l-3-3a1 1 0 0 1-.1-.1 7 7 0 1 1 1.4-1.4zM7 12A5 5 0 1 0 7 2a5 5 0 0 0 0 10z" />
|
|
51
|
-
</svg>`,k=Object.assign({"./Add.svg":
|
|
89
|
+
</svg>`,k=Object.assign({"./Add.svg":Y,"./CheckMark.svg":ee,"./ChevronDown.svg":te,"./ChevronLeft.svg":oe,"./ChevronRight.svg":re,"./ChevronUp.svg":ae,"./Clipboard.svg":ne,"./Close.svg":le,"./DarkMode.svg":se,"./Ellipses.svg":ie,"./ExternalLink.svg":de,"./GitHub.svg":ce,"./LightDarkModeToggle.svg":ue,"./LightMode.svg":ve,"./Logo.svg":he,"./LogoAPI.svg":me,"./LogoClient.svg":pe,"./LogoMarket.svg":ge,"./LogoSwagger.svg":fe,"./Menu.svg":we,"./PaperAirplane.svg":be,"./Search.svg":_e}),ke=r=>{const o=`./${r}.svg`;return k[o]===void 0?(console.warn(`Could not find icon: ${r}`),""):k[o]},w=e.defineComponent({__name:"ScalarIcon",props:{icon:{},size:{}},setup(r){const o=r,t=c({variants:{size:{xs:"h-3 w-3",sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5",xl:"h-6 w-6"}}}),n=e.computed(()=>ke(o.icon));return(l,d)=>n.value?(e.openBlock(),e.createBlock(e.unref(X),{key:0,class:e.normalizeClass(e.unref(i)("scalar-icon",e.unref(t)({size:l.size}))),height:"100%",raw:n.value,width:"100%"},null,8,["class","raw"])):e.createCommentVNode("",!0)}}),xe=["ariaDisabled"],Ce={class:"sr-only"},y=e.defineComponent({__name:"ScalarIconButton",props:{label:{},icon:{},disabled:{type:Boolean},variant:{default:"ghost"},size:{default:"md"}},setup(r){const o=c({base:"scalar-icon-button grid aspect-square cursor-pointer rounded",variants:{size:{xs:"h-3.5 w-3.5 p-0.5",sm:"h-5 w-5 p-1",md:"h-10 w-10 p-3"},disabled:{true:"cursor-not-allowed shadow-none"},variant:x}});return(t,n)=>(e.openBlock(),e.createElementBlock("button",{ariaDisabled:t.disabled||void 0,class:e.normalizeClass(e.unref(i)(e.unref(o)({size:t.size,variant:t.variant,disabled:t.disabled}))),type:"button"},[e.createVNode(e.unref(w),{icon:t.icon},null,8,["icon"]),e.createElementVNode("span",Ce,e.toDisplayString(t.label),1)],10,xe))}}),ye={class:"scalar-modal-layout fixed left-0 top-0 z-[1001] h-[100dvh] w-[100dvw] bg-backdrop p-5 opacity-0"},Be=()=>e.reactive({open:!1,show(){this.open=!0},hide(){this.open=!1}}),Se=e.defineComponent({__name:"ScalarModal",props:{state:{},title:{},bodyClass:{},maxWidth:{},size:{default:"md"},variant:{}},setup(r){const o=c({base:["scalar-modal","col relative mx-auto mb-0 mt-20 w-full rounded-lg bg-back-2 text-left leading-snug text-fore-1 opacity-0"].join(" "),variants:{size:{xs:"max-w-screen-xs",sm:"max-w-screen-sm",md:"max-w-screen-md",lg:"max-w-screen-lg"},variant:{history:"scalar-modal-history bg-back-1",search:"scalar-modal-search"}}});return(t,n)=>(e.openBlock(),e.createBlock(e.unref(m.Dialog),{open:t.state.open,onClose:n[0]||(n[0]=l=>t.state.hide())},{default:e.withCtx(()=>[e.createElementVNode("div",ye,[e.createVNode(e.unref(m.DialogPanel),{class:e.normalizeClass(e.unref(o)({size:t.size,variant:t.variant})),style:e.normalizeStyle({maxWidth:t.maxWidth})},{default:e.withCtx(()=>[t.title?(e.openBlock(),e.createBlock(e.unref(m.DialogTitle),{key:0,class:e.normalizeClass(["scalar-modal-header font-semiBold m-0 rounded-lg px-6 py-3 text-left text-xs text-fore-1",{"pb-0 pt-6":t.variant==="history"}])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1},8,["class"])):e.createCommentVNode("",!0),e.createVNode(e.unref(m.DialogDescription),{class:e.normalizeClass(["scalar-modal-body relative max-h-[calc(100dvh-240px)] overflow-y-auto rounded-lg bg-back-1 px-6 pb-4 pt-6",e.unref(i)(t.bodyClass,t.variant==="history"&&"pt-3",t.variant==="search"&&"col max-h-[440px] overflow-hidden p-0")])},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},void 0,!0)]),_:3},8,["class"])]),_:3},8,["class","style"])])]),_:3},8,["open"]))}});const B=g(Se,[["__scopeId","data-v-eaa2e0c9"]]),Me={class:"scalar-input-container relative"},ze=["for"],Le={class:"icon-slot cursor-pointer text-ghost hover:text-fore-1 !empty:flex !empty:w-7 !empty:items-center !empty:pr-3"},Ve=e.defineComponent({__name:"ScalarTextField",props:{modelValue:{},placeholder:{},label:{},labelShadowColor:{default:"var(--theme-background-2, var(--default-theme-background-2))"},error:{type:Boolean},isMultiline:{type:Boolean},helperText:{},emitOnBlur:{type:Boolean,default:!0},handleFieldSubmit:{},handleFieldChange:{},disableTrim:{type:Boolean,default:!1}},emits:["submit","update:modelValue"],setup(r,{emit:o}){const t=r,n=c({base:"scalar-input-wrapper relative flex items-center rounded border border-solid border-border",variants:{focus:{true:"scalar-input-wrapper-focus border-fore-3 has-actv-btn:border has-actv-btn:border-border"},error:{true:"scalar-input-wrapper-error border-error"}}}),l=e.useAttrs(),d=l.id||`id-${j.nanoid()}`,u=e.ref(),v=e.ref(!1);let h;if(t.isMultiline){const{triggerResize:a}=F.useTextareaAutosize({element:u,input:t.modelValue});h=a}function M(a){const s=a.target.value;t.isMultiline&&h(),t.handleFieldChange?t.handleFieldChange(s):o("update:modelValue",s)}function b(a){const s=a.target,p=t.disableTrim||t.isMultiline?s.value:s.value.trim();t.handleFieldSubmit?t.handleFieldSubmit(p):o("submit",p)}function z(a){v.value=!1,t.emitOnBlur&&t.modelValue&&b(a)}return e.onMounted(()=>{var a;Object.prototype.hasOwnProperty.call(l,"autofocus")&&((a=u.value)==null||a.focus())}),(a,s)=>(e.openBlock(),e.createElementBlock("div",Me,[e.createElementVNode("div",{class:e.normalizeClass(e.unref(n)({error:a.error,focus:v.value}))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.isMultiline?"textarea":"input"),e.mergeProps({id:e.unref(d)},a.$attrs,{ref_key:"input",ref:u,class:["scalar-input",e.unref(i)({"min-h-[77px]":a.isMultiline},"z-10 w-full resize-none appearance-none border-0 bg-transparent p-3 text-sm text-fore-1","outline-none transition-opacity")],placeholder:a.placeholder,value:a.modelValue,onBlur:z,onFocus:s[0]||(s[0]=p=>v.value=!0),onInput:M,onKeyup:e.withKeys(b,["enter"])}),null,16,["id","class","placeholder","value","onKeyup"])),a.label?(e.openBlock(),e.createElementBlock("label",{key:0,class:e.normalizeClass(e.unref(i)("scalar-input-label pointer-events-none absolute left-0 top-0 mx-2 my-3 px-1 text-xs","shadow-current z-10 origin-top-left rounded text-fore-3 transition-transform")),for:e.unref(d),style:e.normalizeStyle({"box-shadow":`0 0 4px 4px ${a.labelShadowColor}`,"background-color":a.labelShadowColor})},e.toDisplayString(a.label),15,ze)):e.createCommentVNode("",!0),e.createElementVNode("div",Le,[e.renderSlot(a.$slots,"default",{},void 0,!0)])],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(i)("helper-text mt-1.5 flex items-center text-xs text-error before:rounded-full before:font-black","before:mr-1.5 before:block before:h-4 before:w-4 before:text-center before:text-xxs before:leading-4","before:bg-error before:text-white before:content-['!'] empty:hidden"))},e.toDisplayString(a.helperText),3)]))}});const S=g(Ve,[["__scopeId","data-v-c047336e"]]);const $e={boxShadow:{DEFAULT:"var(--theme-shadow-1, var(--default-theme-shadow-1))",md:"var(--theme-shadow-2, var(--default-theme-shadow-2))",sm:"rgba(0, 0, 0, 0.09) 0px 1px 4px",none:"0 0 #0000"},colors:{"fore-1":"var(--theme-color-1, var(--default-theme-color-1))","fore-2":"var(--theme-color-2, var(--default-theme-color-2))","fore-3":"var(--theme-color-3, var(--default-theme-color-3))",accent:"var(--theme-color-accent, var(--default-theme-color-accent))","back-1":"var(--theme-background-1, var(--default-theme-background-1))","back-2":"var(--theme-background-2, var(--default-theme-background-2))","back-3":"var(--theme-background-3, var(--default-theme-background-3))","back-accent":"var(--theme-background-accent, var(--default-theme-background-accent))",backdrop:"rgba(0, 0, 0, 0.44)",border:"var(--theme-border-color, var(--default-theme-border-color))","back-btn-1":"var(--theme-button-1, var(--default-theme-button-1))","fore-btn-1":"var(--theme-button-1-color, var(--default-theme-button-1-color))","hover-btn-1":"var(--theme-button-1-hover, var(--default-theme-button-1-hover))",white:"#FFF",green:"var(--theme-color-green, var(--default-theme-color-green))",red:"var(--theme-color-red, var(--default-theme-color-red))",yellow:"var(--theme-color-yellow, var(--default-theme-color-yellow))",blue:"var(--theme-color-blue, var(--default-theme-color-blue))",orange:"var(--theme-color-orange, var(--default-theme-color-orange))",purple:"var(--theme-color-purple, var(--default-theme-color-purple))",error:"var(--theme-error-color, var(--default-theme-color-red))",ghost:"var(--theme-color-ghost, var(--default-theme-color-ghost))",transparent:"transparent"}},Ae={borderRadius:{DEFAULT:"var(--theme-radius, var(--default-theme-radius))",md:"var(--theme-radius, var(--default-theme-radius))",lg:"var(--theme-radius-lg, var(--default-theme-radius-lg))",xl:"var(--theme-radius-xl, var(--default-theme-radius-xl))"},fontSize:{xxs:"var(--theme-micro, var(--default-theme-micro, var(--theme-font-size-5, var(--default-theme-font-size-5))))",xs:"var(--theme-mini, var(--default-theme-mini, var(--theme-font-size-4, var(--default-theme-font-size-4))))",sm:"var(--theme-small, var(--default-theme-small, var(--theme-font-size-3, var(--default-theme-font-size-3))))",base:"var(--theme-paragraph, var(--default-theme-paragraph, var(--theme-font-size-2, var(--default-theme-font-size-2))))",lg:"var(--theme-font-size-1, var(--default-theme-font-size-1))"},fontWeight:{medium:"var(--theme-font-medium, var(--default-theme-font-medium))",bold:"var(--theme-font-bold, var(--default-theme-font-bold))"},maxWidth:{"screen-xs":"480px","screen-sm":"540px","screen-md":"640px","screen-lg":"800px"}},Te={install:r=>{r.component("ScalarButton",C),r.component("ScalarIcon",w),r.component("ScalarIconButton",y),r.component("ScalarLoading",f),r.component("ScalarModal",B),r.component("ScalarTextField",S)}};exports.ScalarButton=C;exports.ScalarIcon=w;exports.ScalarIconButton=y;exports.ScalarLoading=f;exports.ScalarModal=B;exports.ScalarTextField=S;exports.default=Te;exports.extend=Ae;exports.theme=$e;exports.useLoadingState=W;exports.useModal=Be;
|