@solibo/solibo-ui 0.5.7 → 0.5.8
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/assets/index15.css +1 -1
- package/dist/assets/index18.css +1 -1
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index29.css +1 -1
- package/dist/assets/index38.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/components/_avatar/index.cjs +1 -1
- package/dist/components/_avatar/index.js +7 -7
- package/dist/components/_croppable/index.cjs +1 -1
- package/dist/components/_croppable/index.js +110 -110
- package/dist/components/badge/index.cjs +1 -1
- package/dist/components/badge/index.js +9 -9
- package/dist/components/loading/index.cjs +1 -1
- package/dist/components/loading/index.js +7 -7
- package/dist/components/message/index.cjs +1 -1
- package/dist/components/message/index.js +6 -6
- package/dist/components/toggle/index.cjs +1 -1
- package/dist/components/toggle/index.js +8 -8
- package/dist/tokens.json +1 -1
- package/package.json +1 -1
package/dist/assets/index15.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--size: calc(var(--utils-tokens-unit) * 2)}.
|
|
1
|
+
:root{--size: calc(var(--utils-tokens-unit) * 2)}._avatar_3vtid_5{background-color:var(--colors-semantic-interactive-disabled);border-radius:var(--size);display:inline-block;margin:0 var(--scale-4);overflow:hidden;height:var(--size);width:var(--size)}._avatar_3vtid_5 span{margin:var(--scale-4)}
|
package/dist/assets/index18.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._croppable_2wdo8_1{align-items:center;background-color:var(--colors-semantic-bg-overlay);display:flex;justify-content:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}._croppable_2wdo8_1 input[type=file]{display:none}._empty_2wdo8_14{align-items:center;display:flex;flex-direction:column;gap:var(--utils-tokens-unit);text-align:center}._media_2wdo8_22{align-items:center;display:flex;height:100%;top:0;right:0;bottom:0;left:0;justify-content:center;position:absolute;transform:translate(var(--croppable-x, 0),var(--croppable-y, 0));width:100%}._overlay_2wdo8_33{align-items:center;display:flex;top:0;right:0;bottom:0;left:0;justify-content:center;position:absolute}._viewport_2wdo8_41{align-items:center;display:flex;height:var(--croppable-height, calc(12 * var(--utils-tokens-unit)));justify-content:center;overflow:hidden;overscroll-behavior:none;position:relative;touch-action:none;width:100%}._draggable_2wdo8_53{cursor:move}._inner_2wdo8_61{height:var(--croppable-image-height, 100%);transform:scale(var(--croppable-zoom, 1));transform-origin:center;width:var(--croppable-image-width, 100%)}._inner_2wdo8_61 img,._inner_2wdo8_61 picture,._inner_2wdo8_61 video{height:100%;user-drag:none;width:100%;-webkit-user-drag:none}._standalone_2wdo8_77{border-radius:var(--shape-border-radius-radius-md)}
|
package/dist/assets/index2.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._toggle_7uv10_1{--w: calc(var(--utils-tokens-unit) * 3);--h: calc(var(--utils-tokens-unit) * 1.5);align-items:center;cursor:pointer;display:flex;gap:var(--utils-tokens-unit)}._toggle_7uv10_1 input{position:absolute;clip:rect(0 0 0 0)}._toggle_7uv10_1 ._thumb_7uv10_15{background:var(--colors-semantic-bg-surface);border-radius:50%;inline-size:calc(var(--h) - 6px);top:3px;right:3px;bottom:3px;left:3px;position:absolute;translate:0 0;transition:translate var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function)}._toggle_7uv10_1 ._track_7uv10_26{background-color:var(--colors-semantic-interactive-neutral);block-size:var(--h);border-radius:var(--h);inline-size:var(--w);position:relative;transition:background-color var(--utils-tokens-transition-duration) var(--utils-tokens-transition-timing-function)}._toggle_7uv10_1 input:checked+._track_7uv10_26{background:var(--colors-purple-500)}._toggle_7uv10_1 input:checked+._track_7uv10_26 ._thumb_7uv10_15{translate:calc(var(--w) - var(--h)) 0}._toggle_7uv10_1 input:focus-visible+._track_7uv10_26{outline:var(--scale-2) solid var(--colors-purple-500);outline-offset:var(--scale-4)}._toggle_7uv10_1 input:disabled+._track_7uv10_26{cursor:not-allowed;opacity:var(--utils-tokens-opacity-minimal)}
|
package/dist/assets/index29.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._badge_j10be_1{background-color:var(--colors-semantic-interactive-neutral);border-radius:var(--scale-32);display:inline-block;padding:var(--shape-spacing-2xs) var(--shape-spacing-xs);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}._badge_j10be_1._primary_j10be_8{background-color:var(--colors-semantic-primary-primary-subtle);color:var(--colors-semantic-primary-primary)}._badge_j10be_1._info_j10be_13{background-color:var(--colors-green-100);color:var(--colors-green-800)}._badge_j10be_1 button{padding:var(--scale-8)}
|
package/dist/assets/index38.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@keyframes
|
|
1
|
+
@keyframes _ping_2k531_39{0%{opacity:1;transform:scale(0)}to{opacity:0;transform:scale(1)}}@keyframes _spin_2k531_1{0%{transform:rotate(0)}to{transform:rotate(360deg)}}._loading_2k531_23{display:inline-block;overflow:hidden}._default_2k531_28{animation:_spin_2k531_1 1s linear infinite;border:var(--border-size, var(--scale-4)) solid var(--colors-semantic-primary-primary-subtle);border-bottom-color:var(--colors-semantic-primary-primary);border-radius:50%;box-sizing:border-box;display:inline-block;height:var(--size, calc(var(--utils-tokens-unit) * 2));width:var(--size, calc(var(--utils-tokens-unit) * 2))}._ping_2k531_39{display:inline-block;height:var(--size, calc(var(--utils-tokens-unit) * 2));position:relative;width:var(--size, calc(var(--utils-tokens-unit) * 2))}._ping_2k531_39:after,._ping_2k531_39:before{animation:_ping_2k531_39 2s linear infinite;border-radius:50%;border:var(--border-size, var(--scale-4)) solid var(--colors-semantic-primary-primary);box-sizing:border-box;content:"";height:var(--size, calc(var(--utils-tokens-unit) * 2));left:0;position:absolute;top:0;width:var(--size, calc(var(--utils-tokens-unit) * 2))}._ping_2k531_39:after{animation-delay:1s;opacity:0}._sticky_2k531_65{position:absolute;top:0}
|
package/dist/assets/index39.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._message_1whow_1{background-color:var(--colors-semantic-bg-page);box-shadow:var(--shape-box-shadow-xs-position-x) var(--shape-box-shadow-xs-position-y) var(--shape-box-shadow-xs-blur) var(--shape-box-shadow-xs-spread) var(--shape-box-shadow-xs-color);overflow:hidden;padding:var(--utils-tokens-unit);white-space:pre-wrap;word-break:break-word}._message_1whow_1[data-type=default]{border-radius:0 var(--utils-tokens-unit) var(--utils-tokens-unit) 0;margin-right:auto;max-width:90%;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}._message_1whow_1[data-type=minimal]{background-color:transparent;box-shadow:none;margin:var(--scale-8) 0 0 0;padding:0}._message_1whow_1[data-type=user]{background-color:var(--colors-semantic-primary-primary-subtle);border-radius:var(--utils-tokens-unit) 0 0 var(--utils-tokens-unit);margin-left:auto;max-width:90%;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}._message_1whow_1[data-type=system]{background-color:var(--colors-semantic-bg-overlay);border-radius:var(--shape-border-radius-radius-md);color:var(--colors-semantic-content-secondary)}._preview_1whow_40{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index15.css');const a=require("react/jsx-runtime"),c=require("../figure/index.cjs"),o=require("../icon/index.cjs"),i=require("../link/index.cjs"),u="
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index15.css');const a=require("react/jsx-runtime"),c=require("../figure/index.cjs"),o=require("../icon/index.cjs"),i=require("../link/index.cjs"),u="_avatar_3vtid_5",v={avatar:u},d=({accessibleLabel:s,imageUrl:t,link:e})=>{const r=s||"User Avatar",n=a.jsx("span",{className:v.avatar,children:a.jsx(c.Figure,{accessibleLabel:r,children:t?a.jsx("img",{src:t,alt:r}):a.jsx(o.Icon,{name:"user",variant:e?"white":"default"})})});return e?a.jsx(i.Link,{to:e,"data-component":"avatar",children:n}):n};exports.Avatar=d;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { Figure as
|
|
3
|
-
import { Icon as
|
|
2
|
+
import { Figure as c } from "../figure/index.js";
|
|
3
|
+
import { Icon as n } from "../icon/index.js";
|
|
4
4
|
import { Link as i } from "../link/index.js";
|
|
5
|
-
import '../../assets/index15.css';const m = "
|
|
5
|
+
import '../../assets/index15.css';const m = "_avatar_3vtid_5", v = {
|
|
6
6
|
avatar: m
|
|
7
7
|
}, u = ({
|
|
8
8
|
accessibleLabel: s,
|
|
9
|
-
imageUrl:
|
|
10
|
-
link:
|
|
9
|
+
imageUrl: r,
|
|
10
|
+
link: t
|
|
11
11
|
}) => {
|
|
12
|
-
const e = s || "User Avatar", o = /* @__PURE__ */ a("span", { className: v.avatar, children: /* @__PURE__ */ a(
|
|
13
|
-
return
|
|
12
|
+
const e = s || "User Avatar", o = /* @__PURE__ */ a("span", { className: v.avatar, children: /* @__PURE__ */ a(c, { accessibleLabel: e, children: r ? /* @__PURE__ */ a("img", { src: r, alt: e }) : /* @__PURE__ */ a(n, { name: "user", variant: t ? "white" : "default" }) }) });
|
|
13
|
+
return t ? /* @__PURE__ */ a(i, { to: t, "data-component": "avatar", children: o }) : o;
|
|
14
14
|
};
|
|
15
15
|
export {
|
|
16
16
|
u as Avatar
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index18.css');const d=require("react/jsx-runtime"),tt=require("../../classix-5H4IWnMA.cjs"),c=require("react"),mt=require("../button/index.cjs"),pt=require("../figure/index.cjs"),gt=require("../icon/index.cjs"),Ot="
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index18.css');const d=require("react/jsx-runtime"),tt=require("../../classix-5H4IWnMA.cjs"),c=require("react"),mt=require("../button/index.cjs"),pt=require("../figure/index.cjs"),gt=require("../icon/index.cjs"),Ot="_croppable_2wdo8_1",St="_empty_2wdo8_14",Ut="_media_2wdo8_22",It="_overlay_2wdo8_33",Pt="_viewport_2wdo8_41",Yt="_draggable_2wdo8_53",Xt="_dragging_2wdo8_57",At="_inner_2wdo8_61",Dt="_standalone_2wdo8_77",z={croppable:Ot,empty:St,media:Ut,overlay:It,viewport:Pt,draggable:Yt,dragging:Xt,inner:At,standalone:Dt},Wt=192,B={offset:{x:0,y:0},zoom:1},wt="Select image",S=10,W=.1,Ht=.92,m=(h,w,R)=>Math.min(R,Math.max(w,h)),Zt=h=>new Promise((w,R)=>{const f=URL.createObjectURL(h),a=new globalThis.Image;a.onload=()=>{URL.revokeObjectURL(f),w(a)},a.onerror=()=>{URL.revokeObjectURL(f),R(new Error("croppable-image-load-failed"))},a.src=f}),kt=async({file:h,fill:w,transform:R,viewport:f})=>{const a=await Zt(h),U=f.width/a.naturalWidth,M=f.height/a.naturalHeight,y=Math.max(U,M),H=a.naturalWidth*y,E=a.naturalHeight*y,Q=w==="width"?Math.max(W,U/y):w==="height"?Math.max(W,M/y):W,j=m(R.zoom,Q,S),x=y*j,b=H*j,N=E*j,p=(f.width-b)/2+R.offset.x,L=(f.height-N)/2+R.offset.y,I=m((0-p)/x,0,a.naturalWidth),T=m((0-L)/x,0,a.naturalHeight),v=m(f.width/x,1,Math.max(1,a.naturalWidth-I)),s=m(f.height/x,1,Math.max(1,a.naturalHeight-T)),_=document.createElement("canvas"),u=_.getContext("2d");if(!u)throw new Error("croppable-image-context-missing");_.width=Math.max(1,Math.round(v)),_.height=Math.max(1,Math.round(s)),u.drawImage(a,I,T,v,s,0,0,_.width,_.height);const P=h.type.startsWith("image/")?h.type:"image/jpeg",Y=await new Promise(q=>{_.toBlob(q,P,Ht)});if(!Y)throw new Error("croppable-image-export-failed");return new globalThis.File([Y],h.name,{lastModified:Date.now(),type:Y.type||P})},Bt=({children:h,fill:w="none",height:R,image:f,label:a,onCroppableChange:U,onFileChange:M,onImageChange:y,onTransformChange:H,transform:E,standalone:Q})=>{const j=c.useRef(null),x=c.useRef(null),b=c.useRef(null),N=c.useRef(null),p=c.useRef(y),L=c.useRef(null),I=c.useRef(null),T=c.useRef(null),v=c.useRef(new Map),s=c.useRef(B),_=c.useRef(null),[u,P]=c.useState(null),[Y,q]=c.useState(null),[et,V]=c.useState(!1),[xt,nt]=c.useState(B),[F,ot]=c.useState(null),[g,yt]=c.useState({width:0,height:0}),Z=(()=>{const t=g.width,n=g.height;if(!t||!n)return{width:0,height:0,minZoom:W};if(!u)return{width:t,height:n,minZoom:W};const o=t/u.width,e=n/u.height,r=Math.max(o,e),i=w==="width"?o/r:w==="height"?e/r:0;return{width:u.width*r,height:u.height*r,minZoom:Math.max(W,i)}})(),X=Z.minZoom,k=E??xt,A=m(k.zoom,X,S),$=Y??f??null,rt=!h&&!!f&&!Y&&!F,G=!rt,ct=h??($?d.jsx("img",{alt:"",draggable:!1,onLoad:t=>{const n=t.currentTarget;n.naturalWidth&&n.naturalHeight&&P({width:n.naturalWidth,height:n.naturalHeight})},src:$}):null),D=ct==null,J=(t,n)=>{const{maxX:o,maxY:e}=it(n);return{x:m(t.x,-o,o),y:m(t.y,-e,e)}},st=(t,n)=>{const o=_.current;if(!o)return null;const e=o.getBoundingClientRect(),r=t-e.left-e.width/2,i=n-e.top-e.height/2;return{x:r,y:i}},bt=(t,n,o,e)=>{const r=m(n,X,S),i=m(o,X,S);if(r===0)return t;const l=i/r;return{x:(1-l)*e.x+l*t.x,y:(1-l)*e.y+l*t.y}},_t=(t,n,o)=>{const e=s.current.zoom,r=m(t,X,S),i=s.current.offset,l=o?bt(i,e,r,o):n,O=J(l,r);s.current={zoom:r,offset:O},E||nt({zoom:r,offset:O}),H==null||H({zoom:r,offset:O})},K=(t,n,o)=>{I.current={zoom:t,offset:n,anchor:o??null},x.current==null&&(x.current=window.requestAnimationFrame(()=>{x.current=null;const e=I.current;I.current=null;const r=(e==null?void 0:e.zoom)??s.current.zoom,i=(e==null?void 0:e.offset)??s.current.offset,l=(e==null?void 0:e.anchor)??null;_t(r,i,l)}))},zt=t=>{if(D||!G)return;const n=t.ctrlKey?.001:25e-5,o=s.current.zoom*Math.exp(-t.deltaY*n),e=st(t.clientX,t.clientY);K(o,s.current.offset,e)},it=t=>{const n=g.width,o=g.height;if(!n||!o)return{maxX:0,maxY:0};const e=m(t,X,S),r=Z.width*e,i=Z.height*e,l=Math.max(0,(r-n)/2),O=Math.max(0,(i-o)/2);return{maxX:l,maxY:O}},Rt=t=>{var r;const n=t.target,o=((r=n.files)==null?void 0:r[0])??null;if(L.current&&(URL.revokeObjectURL(L.current),L.current=null),!o){q(null),ot(null),M==null||M(null),n.value="";return}const e=URL.createObjectURL(o);L.current=e,q(e),P(null),ot(o),K(B.zoom,B.offset),s.current=B,M==null||M(o),n.value=""},Mt=t=>{if(!(D||!G||t.pointerType==="mouse"&&t.button!==0)){if(t.currentTarget.setPointerCapture(t.pointerId),t.pointerType==="touch"){const n=v.current;if(n.set(t.pointerId,{x:t.clientX,y:t.clientY}),n.size===2){b.current=null,j.current=null,V(!1);const[o,e]=Array.from(n.values());T.current=Math.hypot(o.x-e.x,o.y-e.y);return}}j.current=t.pointerId,b.current={x:t.clientX,y:t.clientY,originX:s.current.offset.x,originY:s.current.offset.y}}},Et=t=>{if(D||!G)return;if(t.pointerType==="touch"){const r=v.current;if(!r.has(t.pointerId))return;if(r.set(t.pointerId,{x:t.clientX,y:t.clientY}),r.size===2){const[i,l]=Array.from(r.values()),O=i.x-l.x,jt=i.y-l.y,ht=Math.hypot(O,jt),ft={x:(i.x+l.x)/2,y:(i.y+l.y)/2};if(T.current){const Lt=ht/T.current,Tt=s.current.zoom*Lt,vt=st(ft.x,ft.y);K(Tt,s.current.offset,vt)}T.current=ht;return}}if(j.current!==t.pointerId||!b.current||!C)return;const n=t.clientX-b.current.x,o=t.clientY-b.current.y,e=Math.abs(n)+Math.abs(o);!et&&e>2&&V(!0),!(e<=1)&&K(s.current.zoom,{x:b.current.originX+n,y:b.current.originY+o})},at=t=>{t.pointerType==="touch"&&(v.current.delete(t.pointerId),v.current.size<2&&(T.current=null)),j.current===t.pointerId&&(j.current=null,b.current=null,V(!1))};c.useEffect(()=>{if(!E)return;const t=m(E.zoom,X,S);s.current={zoom:t,offset:J(E.offset,t)}},[E,g.width,g.height,u==null?void 0:u.width,u==null?void 0:u.height]),c.useEffect(()=>()=>{L.current&&URL.revokeObjectURL(L.current)},[]),c.useEffect(()=>{const t=_.current;if(!t)return;const n=()=>{const r=t.getBoundingClientRect();yt(i=>i.width===r.width&&i.height===r.height?i:{width:r.width,height:r.height}),U&&U(r)};n();const o=()=>n();if(window.addEventListener("scroll",o,!0),typeof ResizeObserver>"u"){const r=()=>n();return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r),window.removeEventListener("scroll",o,!0)}}const e=new ResizeObserver(()=>n());return e.observe(t),()=>{e.disconnect(),window.removeEventListener("scroll",o,!0)}},[U]),c.useEffect(()=>{if(E)return;const t=s.current.offset,n=J(t,A);t.x===n.x&&t.y===n.y||(s.current={zoom:s.current.zoom,offset:n},nt(o=>({...o,offset:n})))},[A,u,g.width,g.height]),c.useEffect(()=>{$||P(null)},[$]),c.useEffect(()=>{p.current=y},[y]),c.useEffect(()=>{var o;if(!y)return;if(!F||!g.width||!g.height||h){(o=p.current)==null||o.call(p,null);return}let t=!0;const n=window.setTimeout(()=>{kt({file:F,fill:w,transform:{zoom:A,offset:k.offset},viewport:g}).then(e=>{var r;t&&((r=p.current)==null||r.call(p,e))}).catch(()=>{var e;t&&((e=p.current)==null||e.call(p,null))})},75);return()=>{t=!1,window.clearTimeout(n)}},[h,A,k.offset,w,F,g]),c.useEffect(()=>()=>{x.current!=null&&(window.cancelAnimationFrame(x.current),x.current=null)},[]);const ut=it(A),C=!D&&G&&(ut.maxX>0||ut.maxY>0),lt=()=>{var t;return(t=N.current)==null?void 0:t.click()},dt=t=>{t.preventDefault(),t.stopPropagation(),lt()};return d.jsxs("div",{className:tt.t(z.croppable,Q&&z.standalone),onClick:()=>{D&<()},"data-component":"croppable",children:[d.jsx("input",{accept:"image/*",onChange:Rt,ref:N,type:"file"}),d.jsx("div",{className:z.viewport,ref:_,onDragStart:t=>t.preventDefault(),onPointerDown:Mt,onPointerMove:Et,onPointerUp:at,onPointerCancel:at,onWheel:zt,style:{"--croppable-height":`${R??Wt}px`,"--croppable-zoom":A,"--croppable-x":`${k.offset.x}px`,"--croppable-y":`${k.offset.y}px`,...u?{"--croppable-image-width":`${Z.width}px`,"--croppable-image-height":`${Z.height}px`}:null},children:D?d.jsxs("div",{className:z.empty,children:[d.jsx(pt.Figure,{children:d.jsx(gt.Icon,{name:"image",size:"large"})}),d.jsx(mt.Button,{onClick:dt,children:a??wt})]}):d.jsxs("div",{className:tt.t(z.media,C&&z.draggable,C&&et&&z.dragging),children:[d.jsx("div",{className:tt.t(z.inner),children:ct}),rt&&d.jsx("div",{className:z.overlay,children:d.jsxs("div",{className:z.empty,children:[d.jsx(pt.Figure,{children:d.jsx(gt.Icon,{name:"image",size:"large"})}),d.jsx(mt.Button,{onClick:dt,children:a??wt})]})})]})})]})};exports.Croppable=Bt;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as J, jsx as
|
|
2
|
-
import { t as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Figure as
|
|
6
|
-
import { Icon as
|
|
7
|
-
import '../../assets/index18.css';const Yt = "
|
|
1
|
+
import { jsxs as J, jsx as w } from "react/jsx-runtime";
|
|
2
|
+
import { t as ot } from "../../classix-DG18itHa.js";
|
|
3
|
+
import { useRef as x, useState as Z, useEffect as U } from "react";
|
|
4
|
+
import { Button as wt } from "../button/index.js";
|
|
5
|
+
import { Figure as xt } from "../figure/index.js";
|
|
6
|
+
import { Icon as yt } from "../icon/index.js";
|
|
7
|
+
import '../../assets/index18.css';const Yt = "_croppable_2wdo8_1", Xt = "_empty_2wdo8_14", At = "_media_2wdo8_22", Dt = "_overlay_2wdo8_33", Wt = "_viewport_2wdo8_41", Ht = "_draggable_2wdo8_53", St = "_dragging_2wdo8_57", Zt = "_inner_2wdo8_61", jt = "_standalone_2wdo8_77", M = {
|
|
8
8
|
croppable: Yt,
|
|
9
9
|
empty: Xt,
|
|
10
10
|
media: At,
|
|
@@ -20,20 +20,20 @@ import '../../assets/index18.css';const Yt = "_croppable_1yvyu_1", Xt = "_empty_
|
|
|
20
20
|
y: 0
|
|
21
21
|
},
|
|
22
22
|
zoom: 1
|
|
23
|
-
}, bt = "Select image", P = 10, j = 0.1, Bt = 0.92,
|
|
24
|
-
const
|
|
23
|
+
}, bt = "Select image", P = 10, j = 0.1, Bt = 0.92, h = (u, p, _) => Math.min(_, Math.max(p, u)), Nt = (u) => new Promise((p, _) => {
|
|
24
|
+
const d = URL.createObjectURL(u), s = new globalThis.Image();
|
|
25
25
|
s.onload = () => {
|
|
26
|
-
URL.revokeObjectURL(
|
|
26
|
+
URL.revokeObjectURL(d), p(s);
|
|
27
27
|
}, s.onerror = () => {
|
|
28
|
-
URL.revokeObjectURL(
|
|
29
|
-
}, s.src =
|
|
28
|
+
URL.revokeObjectURL(d), _(new Error("croppable-image-load-failed"));
|
|
29
|
+
}, s.src = d;
|
|
30
30
|
}), $t = async ({
|
|
31
31
|
file: u,
|
|
32
32
|
fill: p,
|
|
33
33
|
transform: _,
|
|
34
|
-
viewport:
|
|
34
|
+
viewport: d
|
|
35
35
|
}) => {
|
|
36
|
-
const s = await Nt(u), Y =
|
|
36
|
+
const s = await Nt(u), Y = d.width / s.naturalWidth, R = d.height / s.naturalHeight, y = Math.max(Y, R), k = s.naturalWidth * y, L = s.naturalHeight * y, C = p === "width" ? Math.max(j, Y / y) : p === "height" ? Math.max(j, R / y) : j, T = h(_.zoom, C, P), g = y * T, b = k * T, F = L * T, m = (d.width - b) / 2 + _.offset.x, v = (d.height - F) / 2 + _.offset.y, X = h((0 - m) / g, 0, s.naturalWidth), E = h((0 - v) / g, 0, s.naturalHeight), O = h(d.width / g, 1, Math.max(1, s.naturalWidth - X)), c = h(d.height / g, 1, Math.max(1, s.naturalHeight - E)), z = document.createElement("canvas"), a = z.getContext("2d");
|
|
37
37
|
if (!a)
|
|
38
38
|
throw new Error("croppable-image-context-missing");
|
|
39
39
|
z.width = Math.max(1, Math.round(O)), z.height = Math.max(1, Math.round(c)), a.drawImage(s, X, E, O, c, 0, 0, z.width, z.height);
|
|
@@ -50,16 +50,16 @@ import '../../assets/index18.css';const Yt = "_croppable_1yvyu_1", Xt = "_empty_
|
|
|
50
50
|
children: u,
|
|
51
51
|
fill: p = "none",
|
|
52
52
|
height: _,
|
|
53
|
-
image:
|
|
53
|
+
image: d,
|
|
54
54
|
label: s,
|
|
55
55
|
onCroppableChange: Y,
|
|
56
|
-
onFileChange:
|
|
57
|
-
onImageChange:
|
|
56
|
+
onFileChange: R,
|
|
57
|
+
onImageChange: y,
|
|
58
58
|
onTransformChange: k,
|
|
59
|
-
transform:
|
|
59
|
+
transform: L,
|
|
60
60
|
standalone: C
|
|
61
61
|
}) => {
|
|
62
|
-
const
|
|
62
|
+
const T = x(null), g = x(null), b = x(null), F = x(null), m = x(y), v = x(null), X = x(null), E = x(null), O = x(/* @__PURE__ */ new Map()), c = x($), z = x(null), [a, A] = Z(null), [D, G] = Z(null), [rt, tt] = Z(!1), [zt, ct] = Z($), [q, it] = Z(null), [f, Mt] = Z({
|
|
63
63
|
width: 0,
|
|
64
64
|
height: 0
|
|
65
65
|
}), B = (() => {
|
|
@@ -74,13 +74,13 @@ import '../../assets/index18.css';const Yt = "_croppable_1yvyu_1", Xt = "_empty_
|
|
|
74
74
|
height: n,
|
|
75
75
|
minZoom: j
|
|
76
76
|
};
|
|
77
|
-
const
|
|
77
|
+
const o = t / a.width, e = n / a.height, r = Math.max(o, e), i = p === "width" ? o / r : p === "height" ? e / r : 0;
|
|
78
78
|
return {
|
|
79
|
-
width: a.width *
|
|
80
|
-
height: a.height *
|
|
79
|
+
width: a.width * r,
|
|
80
|
+
height: a.height * r,
|
|
81
81
|
minZoom: Math.max(j, i)
|
|
82
82
|
};
|
|
83
|
-
})(), W = B.minZoom, N =
|
|
83
|
+
})(), W = B.minZoom, N = L ?? zt, H = h(N.zoom, W, P), K = D ?? d ?? null, st = !u && !!d && !D && !q, Q = !st, at = u ?? (K ? /* @__PURE__ */ w("img", { alt: "", draggable: !1, onLoad: (t) => {
|
|
84
84
|
const n = t.currentTarget;
|
|
85
85
|
n.naturalWidth && n.naturalHeight && A({
|
|
86
86
|
width: n.naturalWidth,
|
|
@@ -88,78 +88,78 @@ import '../../assets/index18.css';const Yt = "_croppable_1yvyu_1", Xt = "_empty_
|
|
|
88
88
|
});
|
|
89
89
|
}, src: K }) : null), S = at == null, et = (t, n) => {
|
|
90
90
|
const {
|
|
91
|
-
maxX:
|
|
91
|
+
maxX: o,
|
|
92
92
|
maxY: e
|
|
93
93
|
} = ut(n);
|
|
94
94
|
return {
|
|
95
|
-
x:
|
|
96
|
-
y:
|
|
95
|
+
x: h(t.x, -o, o),
|
|
96
|
+
y: h(t.y, -e, e)
|
|
97
97
|
};
|
|
98
98
|
}, lt = (t, n) => {
|
|
99
|
-
const
|
|
100
|
-
if (!
|
|
101
|
-
const e =
|
|
99
|
+
const o = z.current;
|
|
100
|
+
if (!o) return null;
|
|
101
|
+
const e = o.getBoundingClientRect(), r = t - e.left - e.width / 2, i = n - e.top - e.height / 2;
|
|
102
102
|
return {
|
|
103
|
-
x:
|
|
103
|
+
x: r,
|
|
104
104
|
y: i
|
|
105
105
|
};
|
|
106
|
-
}, _t = (t, n,
|
|
107
|
-
const
|
|
108
|
-
if (
|
|
109
|
-
const l = i /
|
|
106
|
+
}, _t = (t, n, o, e) => {
|
|
107
|
+
const r = h(n, W, P), i = h(o, W, P);
|
|
108
|
+
if (r === 0) return t;
|
|
109
|
+
const l = i / r;
|
|
110
110
|
return {
|
|
111
111
|
x: (1 - l) * e.x + l * t.x,
|
|
112
112
|
y: (1 - l) * e.y + l * t.y
|
|
113
113
|
};
|
|
114
|
-
},
|
|
115
|
-
const e = c.current.zoom,
|
|
114
|
+
}, Rt = (t, n, o) => {
|
|
115
|
+
const e = c.current.zoom, r = h(t, W, P), i = c.current.offset, l = o ? _t(i, e, r, o) : n, I = et(l, r);
|
|
116
116
|
c.current = {
|
|
117
|
-
zoom:
|
|
117
|
+
zoom: r,
|
|
118
118
|
offset: I
|
|
119
|
-
},
|
|
120
|
-
zoom:
|
|
119
|
+
}, L || ct({
|
|
120
|
+
zoom: r,
|
|
121
121
|
offset: I
|
|
122
122
|
}), k == null || k({
|
|
123
|
-
zoom:
|
|
123
|
+
zoom: r,
|
|
124
124
|
offset: I
|
|
125
125
|
});
|
|
126
|
-
}, V = (t, n,
|
|
126
|
+
}, V = (t, n, o) => {
|
|
127
127
|
X.current = {
|
|
128
128
|
zoom: t,
|
|
129
129
|
offset: n,
|
|
130
|
-
anchor:
|
|
130
|
+
anchor: o ?? null
|
|
131
131
|
}, g.current == null && (g.current = window.requestAnimationFrame(() => {
|
|
132
132
|
g.current = null;
|
|
133
133
|
const e = X.current;
|
|
134
134
|
X.current = null;
|
|
135
|
-
const
|
|
136
|
-
|
|
135
|
+
const r = (e == null ? void 0 : e.zoom) ?? c.current.zoom, i = (e == null ? void 0 : e.offset) ?? c.current.offset, l = (e == null ? void 0 : e.anchor) ?? null;
|
|
136
|
+
Rt(r, i, l);
|
|
137
137
|
}));
|
|
138
|
-
},
|
|
138
|
+
}, Lt = (t) => {
|
|
139
139
|
if (S || !Q) return;
|
|
140
|
-
const n = t.ctrlKey ? 1e-3 : 25e-5,
|
|
141
|
-
V(
|
|
140
|
+
const n = t.ctrlKey ? 1e-3 : 25e-5, o = c.current.zoom * Math.exp(-t.deltaY * n), e = lt(t.clientX, t.clientY);
|
|
141
|
+
V(o, c.current.offset, e);
|
|
142
142
|
}, ut = (t) => {
|
|
143
|
-
const n = f.width,
|
|
144
|
-
if (!n || !
|
|
143
|
+
const n = f.width, o = f.height;
|
|
144
|
+
if (!n || !o) return {
|
|
145
145
|
maxX: 0,
|
|
146
146
|
maxY: 0
|
|
147
147
|
};
|
|
148
|
-
const e =
|
|
148
|
+
const e = h(t, W, P), r = B.width * e, i = B.height * e, l = Math.max(0, (r - n) / 2), I = Math.max(0, (i - o) / 2);
|
|
149
149
|
return {
|
|
150
150
|
maxX: l,
|
|
151
151
|
maxY: I
|
|
152
152
|
};
|
|
153
|
-
},
|
|
154
|
-
var
|
|
155
|
-
const n = t.target,
|
|
156
|
-
if (
|
|
157
|
-
G(null), it(null),
|
|
153
|
+
}, Tt = (t) => {
|
|
154
|
+
var r;
|
|
155
|
+
const n = t.target, o = ((r = n.files) == null ? void 0 : r[0]) ?? null;
|
|
156
|
+
if (v.current && (URL.revokeObjectURL(v.current), v.current = null), !o) {
|
|
157
|
+
G(null), it(null), R == null || R(null), n.value = "";
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
|
-
const e = URL.createObjectURL(
|
|
161
|
-
|
|
162
|
-
},
|
|
160
|
+
const e = URL.createObjectURL(o);
|
|
161
|
+
v.current = e, G(e), A(null), it(o), V($.zoom, $.offset), c.current = $, R == null || R(o), n.value = "";
|
|
162
|
+
}, vt = (t) => {
|
|
163
163
|
if (!(S || !Q || t.pointerType === "mouse" && t.button !== 0)) {
|
|
164
164
|
if (t.currentTarget.setPointerCapture(t.pointerId), t.pointerType === "touch") {
|
|
165
165
|
const n = O.current;
|
|
@@ -167,13 +167,13 @@ import '../../assets/index18.css';const Yt = "_croppable_1yvyu_1", Xt = "_empty_
|
|
|
167
167
|
x: t.clientX,
|
|
168
168
|
y: t.clientY
|
|
169
169
|
}), n.size === 2) {
|
|
170
|
-
b.current = null,
|
|
171
|
-
const [
|
|
172
|
-
E.current = Math.hypot(
|
|
170
|
+
b.current = null, T.current = null, tt(!1);
|
|
171
|
+
const [o, e] = Array.from(n.values());
|
|
172
|
+
E.current = Math.hypot(o.x - e.x, o.y - e.y);
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
|
|
176
|
+
T.current = t.pointerId, b.current = {
|
|
177
177
|
x: t.clientX,
|
|
178
178
|
y: t.clientY,
|
|
179
179
|
originX: c.current.offset.x,
|
|
@@ -183,13 +183,13 @@ import '../../assets/index18.css';const Yt = "_croppable_1yvyu_1", Xt = "_empty_
|
|
|
183
183
|
}, Et = (t) => {
|
|
184
184
|
if (S || !Q) return;
|
|
185
185
|
if (t.pointerType === "touch") {
|
|
186
|
-
const
|
|
187
|
-
if (!
|
|
188
|
-
if (
|
|
186
|
+
const r = O.current;
|
|
187
|
+
if (!r.has(t.pointerId)) return;
|
|
188
|
+
if (r.set(t.pointerId, {
|
|
189
189
|
x: t.clientX,
|
|
190
190
|
y: t.clientY
|
|
191
|
-
}),
|
|
192
|
-
const [i, l] = Array.from(
|
|
191
|
+
}), r.size === 2) {
|
|
192
|
+
const [i, l] = Array.from(r.values()), I = i.x - l.x, Ut = i.y - l.y, pt = Math.hypot(I, Ut), gt = {
|
|
193
193
|
x: (i.x + l.x) / 2,
|
|
194
194
|
y: (i.y + l.y) / 2
|
|
195
195
|
};
|
|
@@ -201,65 +201,65 @@ import '../../assets/index18.css';const Yt = "_croppable_1yvyu_1", Xt = "_empty_
|
|
|
201
201
|
return;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
if (
|
|
205
|
-
const n = t.clientX - b.current.x,
|
|
206
|
-
!
|
|
204
|
+
if (T.current !== t.pointerId || !b.current || !nt) return;
|
|
205
|
+
const n = t.clientX - b.current.x, o = t.clientY - b.current.y, e = Math.abs(n) + Math.abs(o);
|
|
206
|
+
!rt && e > 2 && tt(!0), !(e <= 1) && V(c.current.zoom, {
|
|
207
207
|
x: b.current.originX + n,
|
|
208
|
-
y: b.current.originY +
|
|
208
|
+
y: b.current.originY + o
|
|
209
209
|
});
|
|
210
|
-
},
|
|
211
|
-
t.pointerType === "touch" && (O.current.delete(t.pointerId), O.current.size < 2 && (E.current = null)),
|
|
210
|
+
}, dt = (t) => {
|
|
211
|
+
t.pointerType === "touch" && (O.current.delete(t.pointerId), O.current.size < 2 && (E.current = null)), T.current === t.pointerId && (T.current = null, b.current = null, tt(!1));
|
|
212
212
|
};
|
|
213
213
|
U(() => {
|
|
214
|
-
if (!
|
|
215
|
-
const t =
|
|
214
|
+
if (!L) return;
|
|
215
|
+
const t = h(L.zoom, W, P);
|
|
216
216
|
c.current = {
|
|
217
217
|
zoom: t,
|
|
218
|
-
offset: et(
|
|
218
|
+
offset: et(L.offset, t)
|
|
219
219
|
};
|
|
220
|
-
}, [
|
|
221
|
-
|
|
220
|
+
}, [L, f.width, f.height, a == null ? void 0 : a.width, a == null ? void 0 : a.height]), U(() => () => {
|
|
221
|
+
v.current && URL.revokeObjectURL(v.current);
|
|
222
222
|
}, []), U(() => {
|
|
223
223
|
const t = z.current;
|
|
224
224
|
if (!t) return;
|
|
225
225
|
const n = () => {
|
|
226
|
-
const
|
|
227
|
-
Mt((i) => i.width ===
|
|
228
|
-
width:
|
|
229
|
-
height:
|
|
230
|
-
}), Y && Y(
|
|
226
|
+
const r = t.getBoundingClientRect();
|
|
227
|
+
Mt((i) => i.width === r.width && i.height === r.height ? i : {
|
|
228
|
+
width: r.width,
|
|
229
|
+
height: r.height
|
|
230
|
+
}), Y && Y(r);
|
|
231
231
|
};
|
|
232
232
|
n();
|
|
233
|
-
const
|
|
234
|
-
if (window.addEventListener("scroll",
|
|
235
|
-
const
|
|
236
|
-
return window.addEventListener("resize",
|
|
237
|
-
window.removeEventListener("resize",
|
|
233
|
+
const o = () => n();
|
|
234
|
+
if (window.addEventListener("scroll", o, !0), typeof ResizeObserver > "u") {
|
|
235
|
+
const r = () => n();
|
|
236
|
+
return window.addEventListener("resize", r), () => {
|
|
237
|
+
window.removeEventListener("resize", r), window.removeEventListener("scroll", o, !0);
|
|
238
238
|
};
|
|
239
239
|
}
|
|
240
240
|
const e = new ResizeObserver(() => n());
|
|
241
241
|
return e.observe(t), () => {
|
|
242
|
-
e.disconnect(), window.removeEventListener("scroll",
|
|
242
|
+
e.disconnect(), window.removeEventListener("scroll", o, !0);
|
|
243
243
|
};
|
|
244
244
|
}, [Y]), U(() => {
|
|
245
|
-
if (
|
|
245
|
+
if (L) return;
|
|
246
246
|
const t = c.current.offset, n = et(t, H);
|
|
247
247
|
t.x === n.x && t.y === n.y || (c.current = {
|
|
248
248
|
zoom: c.current.zoom,
|
|
249
249
|
offset: n
|
|
250
|
-
}, ct((
|
|
251
|
-
...
|
|
250
|
+
}, ct((o) => ({
|
|
251
|
+
...o,
|
|
252
252
|
offset: n
|
|
253
253
|
})));
|
|
254
254
|
}, [H, a, f.width, f.height]), U(() => {
|
|
255
255
|
K || A(null);
|
|
256
256
|
}, [K]), U(() => {
|
|
257
|
-
m.current =
|
|
258
|
-
}, [
|
|
259
|
-
var
|
|
260
|
-
if (!
|
|
257
|
+
m.current = y;
|
|
258
|
+
}, [y]), U(() => {
|
|
259
|
+
var o;
|
|
260
|
+
if (!y) return;
|
|
261
261
|
if (!q || !f.width || !f.height || u) {
|
|
262
|
-
(
|
|
262
|
+
(o = m.current) == null || o.call(m, null);
|
|
263
263
|
return;
|
|
264
264
|
}
|
|
265
265
|
let t = !0;
|
|
@@ -273,8 +273,8 @@ import '../../assets/index18.css';const Yt = "_croppable_1yvyu_1", Xt = "_empty_
|
|
|
273
273
|
},
|
|
274
274
|
viewport: f
|
|
275
275
|
}).then((e) => {
|
|
276
|
-
var
|
|
277
|
-
t && ((
|
|
276
|
+
var r;
|
|
277
|
+
t && ((r = m.current) == null || r.call(m, e));
|
|
278
278
|
}).catch(() => {
|
|
279
279
|
var e;
|
|
280
280
|
t && ((e = m.current) == null || e.call(m, null));
|
|
@@ -286,17 +286,17 @@ import '../../assets/index18.css';const Yt = "_croppable_1yvyu_1", Xt = "_empty_
|
|
|
286
286
|
}, [u, H, N.offset, p, q, f]), U(() => () => {
|
|
287
287
|
g.current != null && (window.cancelAnimationFrame(g.current), g.current = null);
|
|
288
288
|
}, []);
|
|
289
|
-
const
|
|
289
|
+
const ht = ut(H), nt = !S && Q && (ht.maxX > 0 || ht.maxY > 0), mt = () => {
|
|
290
290
|
var t;
|
|
291
291
|
return (t = F.current) == null ? void 0 : t.click();
|
|
292
292
|
}, ft = (t) => {
|
|
293
293
|
t.preventDefault(), t.stopPropagation(), mt();
|
|
294
294
|
};
|
|
295
|
-
return /* @__PURE__ */ J("div", { className:
|
|
295
|
+
return /* @__PURE__ */ J("div", { className: ot(M.croppable, C && M.standalone), onClick: () => {
|
|
296
296
|
S && mt();
|
|
297
297
|
}, "data-component": "croppable", children: [
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
/* @__PURE__ */
|
|
298
|
+
/* @__PURE__ */ w("input", { accept: "image/*", onChange: Tt, ref: F, type: "file" }),
|
|
299
|
+
/* @__PURE__ */ w("div", { className: M.viewport, ref: z, onDragStart: (t) => t.preventDefault(), onPointerDown: vt, onPointerMove: Et, onPointerUp: dt, onPointerCancel: dt, onWheel: Lt, style: {
|
|
300
300
|
"--croppable-height": `${_ ?? kt}px`,
|
|
301
301
|
"--croppable-zoom": H,
|
|
302
302
|
"--croppable-x": `${N.offset.x}px`,
|
|
@@ -306,13 +306,13 @@ import '../../assets/index18.css';const Yt = "_croppable_1yvyu_1", Xt = "_empty_
|
|
|
306
306
|
"--croppable-image-height": `${B.height}px`
|
|
307
307
|
} : null
|
|
308
308
|
}, children: S ? /* @__PURE__ */ J("div", { className: M.empty, children: [
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
] }) : /* @__PURE__ */ J("div", { className:
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
st && /* @__PURE__ */
|
|
314
|
-
/* @__PURE__ */
|
|
315
|
-
/* @__PURE__ */
|
|
309
|
+
/* @__PURE__ */ w(xt, { children: /* @__PURE__ */ w(yt, { name: "image", size: "large" }) }),
|
|
310
|
+
/* @__PURE__ */ w(wt, { onClick: ft, children: s ?? bt })
|
|
311
|
+
] }) : /* @__PURE__ */ J("div", { className: ot(M.media, nt && M.draggable, nt && rt && M.dragging), children: [
|
|
312
|
+
/* @__PURE__ */ w("div", { className: ot(M.inner), children: at }),
|
|
313
|
+
st && /* @__PURE__ */ w("div", { className: M.overlay, children: /* @__PURE__ */ J("div", { className: M.empty, children: [
|
|
314
|
+
/* @__PURE__ */ w(xt, { children: /* @__PURE__ */ w(yt, { name: "image", size: "large" }) }),
|
|
315
|
+
/* @__PURE__ */ w(wt, { onClick: ft, children: s ?? bt })
|
|
316
316
|
] }) })
|
|
317
317
|
] }) })
|
|
318
318
|
] });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index29.css');const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index29.css');const n=require("react/jsx-runtime"),r=require("../../classix-5H4IWnMA.cjs"),s=require("../button/index.cjs"),c=require("../icon/index.cjs"),d="_badge_j10be_1",m="_primary_j10be_8",l="_info_j10be_13",e={badge:d,primary:m,info:l},u={default:e.default,info:e.info,primary:e.primary},_=({children:t,deleteAccessibleLabel:i="Remove",onDelete:a,variant:o="default"})=>n.jsxs("span",{className:r.t(e.badge,u[o]),"data-component":"badge",children:[t,a&&n.jsx(s.Button,{"aria-label":i,onClick:a,variant:"minimal",children:n.jsx(c.Icon,{name:"x"})})]});exports.Badge=_;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { t as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import '../../assets/index29.css';const
|
|
6
|
-
badge:
|
|
7
|
-
primary:
|
|
1
|
+
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { t as m } from "../../classix-DG18itHa.js";
|
|
3
|
+
import { Button as s } from "../button/index.js";
|
|
4
|
+
import { Icon as c } from "../icon/index.js";
|
|
5
|
+
import '../../assets/index29.css';const d = "_badge_j10be_1", f = "_primary_j10be_8", p = "_info_j10be_13", a = {
|
|
6
|
+
badge: d,
|
|
7
|
+
primary: f,
|
|
8
8
|
info: p
|
|
9
9
|
}, l = {
|
|
10
10
|
default: a.default,
|
|
@@ -15,9 +15,9 @@ import '../../assets/index29.css';const c = "_badge_17jf9_1", d = "_primary_17jf
|
|
|
15
15
|
deleteAccessibleLabel: i = "Remove",
|
|
16
16
|
onDelete: r,
|
|
17
17
|
variant: t = "default"
|
|
18
|
-
}) => /* @__PURE__ */
|
|
18
|
+
}) => /* @__PURE__ */ e("span", { className: m(a.badge, l[t]), "data-component": "badge", children: [
|
|
19
19
|
n,
|
|
20
|
-
r && /* @__PURE__ */ o(
|
|
20
|
+
r && /* @__PURE__ */ o(s, { "aria-label": i, onClick: r, variant: "minimal", children: /* @__PURE__ */ o(c, { name: "x" }) })
|
|
21
21
|
] });
|
|
22
22
|
export {
|
|
23
23
|
j as Badge
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index38.css');const t=require("react/jsx-runtime"),i=require("../../classix-5H4IWnMA.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index38.css');const t=require("react/jsx-runtime"),i=require("../../classix-5H4IWnMA.cjs"),d="_loading_2k531_23",l="_spin_2k531_1",_="_ping_2k531_39",r="_sticky_2k531_65",n={loading:d,default:"_default_2k531_28",spin:l,ping:_,sticky:r},g=({variant:o="default",size:s,sticky:a=!1,...e})=>{const c={"--border-size":s?s/8+"px":void 0,"--size":s?s+"px":void 0};return t.jsx("div",{className:i.t(n.loading,a&&n.sticky),"data-component":"loading",children:t.jsx("span",{className:i.t(n.loading,n[o]),style:c,...e})})};exports.Loading=g;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { t } from "../../classix-DG18itHa.js";
|
|
3
|
-
import '../../assets/index38.css';const l = "
|
|
3
|
+
import '../../assets/index38.css';const l = "_loading_2k531_23", _ = "_spin_2k531_1", p = "_ping_2k531_39", e = "_sticky_2k531_65", o = {
|
|
4
4
|
loading: l,
|
|
5
|
-
default: "
|
|
5
|
+
default: "_default_2k531_28",
|
|
6
6
|
spin: _,
|
|
7
7
|
ping: p,
|
|
8
8
|
sticky: e
|
|
9
|
-
},
|
|
9
|
+
}, k = ({
|
|
10
10
|
variant: i = "default",
|
|
11
11
|
size: n,
|
|
12
|
-
sticky:
|
|
13
|
-
...
|
|
12
|
+
sticky: a = !1,
|
|
13
|
+
...d
|
|
14
14
|
}) => {
|
|
15
15
|
const c = {
|
|
16
16
|
"--border-size": n ? n / 8 + "px" : void 0,
|
|
17
17
|
"--size": n ? n + "px" : void 0
|
|
18
18
|
};
|
|
19
|
-
return /* @__PURE__ */ s("div", { className: t(o.loading,
|
|
19
|
+
return /* @__PURE__ */ s("div", { className: t(o.loading, a && o.sticky), "data-component": "loading", children: /* @__PURE__ */ s("span", { className: t(o.loading, o[i]), style: c, ...d }) });
|
|
20
20
|
};
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
k as Loading
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index39.css');const s=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index39.css');const s=require("react/jsx-runtime"),i=require("../../classix-5H4IWnMA.cjs"),r=require("../icon/index.cjs"),c="_message_1whow_1",m="_preview_1whow_40",t={message:c,preview:m},g=({content:a,id:n,preview:o,type:e="default"})=>s.jsxs("div",{className:i.t(t.message,o&&t.preview),"data-id":n,"data-type":e,"data-component":"message",children:[e=="system"&&s.jsx(r.Icon,{gap:"right",name:"info"}),a]});exports.Message=g;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { t as i } from "../../classix-DG18itHa.js";
|
|
3
3
|
import { Icon as n } from "../icon/index.js";
|
|
4
|
-
import '../../assets/index39.css';const p = "
|
|
4
|
+
import '../../assets/index39.css';const p = "_message_1whow_1", c = "_preview_1whow_40", s = {
|
|
5
5
|
message: p,
|
|
6
6
|
preview: c
|
|
7
|
-
},
|
|
7
|
+
}, _ = ({
|
|
8
8
|
content: t,
|
|
9
9
|
id: a,
|
|
10
|
-
preview:
|
|
10
|
+
preview: o,
|
|
11
11
|
type: e = "default"
|
|
12
|
-
}) => /* @__PURE__ */
|
|
12
|
+
}) => /* @__PURE__ */ m("div", { className: i(s.message, o && s.preview), "data-id": a, "data-type": e, "data-component": "message", children: [
|
|
13
13
|
e == "system" && /* @__PURE__ */ r(n, { gap: "right", name: "info" }),
|
|
14
14
|
t
|
|
15
15
|
] });
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
_ as Message
|
|
18
18
|
};
|
|
19
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index2.css');const t=require("react/jsx-runtime"),i=require("../loading/index.cjs"),g="
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index2.css');const t=require("react/jsx-runtime"),i=require("../loading/index.cjs"),g="_toggle_7uv10_1",u="_thumb_7uv10_15",d="_track_7uv10_26",e={toggle:g,thumb:u,track:d},m=({checked:s,disabled:c,isLoading:o,label:n,onChange:a})=>{const l=s!==void 0&&a===void 0;return t.jsxs("label",{className:e.toggle,onClick:r=>r.stopPropagation(),"data-component":"toggle",children:[t.jsx("input",{checked:s,disabled:c||o,onChange:a,readOnly:l,type:"checkbox"}),t.jsx("span",{"aria-hidden":"true",className:e.track,children:o?t.jsx(i.Loading,{size:24}):t.jsx("span",{className:e.thumb})}),n&&t.jsx("span",{className:"toggle",children:n})]})};exports.Toggle=m;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { jsxs as g, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { Loading as i } from "../loading/index.js";
|
|
3
|
-
import '../../assets/index2.css';const m = "
|
|
3
|
+
import '../../assets/index2.css';const m = "_toggle_7uv10_1", d = "_thumb_7uv10_15", p = "_track_7uv10_26", o = {
|
|
4
4
|
toggle: m,
|
|
5
5
|
thumb: d,
|
|
6
6
|
track: p
|
|
7
|
-
},
|
|
7
|
+
}, h = ({
|
|
8
8
|
checked: s,
|
|
9
|
-
disabled:
|
|
9
|
+
disabled: l,
|
|
10
10
|
isLoading: a,
|
|
11
11
|
label: e,
|
|
12
|
-
onChange:
|
|
12
|
+
onChange: c
|
|
13
13
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
return /* @__PURE__ */ g("label", { className: o.toggle, onClick: (
|
|
16
|
-
/* @__PURE__ */ t("input", { checked: s, disabled:
|
|
14
|
+
const n = s !== void 0 && c === void 0;
|
|
15
|
+
return /* @__PURE__ */ g("label", { className: o.toggle, onClick: (r) => r.stopPropagation(), "data-component": "toggle", children: [
|
|
16
|
+
/* @__PURE__ */ t("input", { checked: s, disabled: l || a, onChange: c, readOnly: n, type: "checkbox" }),
|
|
17
17
|
/* @__PURE__ */ t("span", { "aria-hidden": "true", className: o.track, children: a ? /* @__PURE__ */ t(i, { size: 24 }) : /* @__PURE__ */ t("span", { className: o.thumb }) }),
|
|
18
18
|
e && /* @__PURE__ */ t("span", { className: "toggle", children: e })
|
|
19
19
|
] });
|
|
20
20
|
};
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
h as Toggle
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=index.js.map
|
package/dist/tokens.json
CHANGED