@anoki/fse-ui 1.0.694 → 1.0.696
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.cjs244.js +1 -1
- package/dist/index.cjs251.js +1 -1
- package/dist/index.cjs261.js +1 -1
- package/dist/index.cjs267.js +1 -1
- package/dist/index.cjs294.js +1 -1
- package/dist/index.cjs33.js +1 -1
- package/dist/index.cjs33.js.map +1 -1
- package/dist/index.cjs333.js +1 -1
- package/dist/index.cjs35.js +1 -1
- package/dist/index.cjs35.js.map +1 -1
- package/dist/index.cjs372.js +1 -1
- package/dist/index.cjs373.js +1 -1
- package/dist/index.cjs383.js +1 -1
- package/dist/index.cjs384.js +1 -1
- package/dist/index.cjs385.js +1 -1
- package/dist/index.cjs386.js +1 -1
- package/dist/index.cjs387.js +1 -1
- package/dist/index.cjs387.js.map +1 -1
- package/dist/{index.cjs391.js → index.cjs388.js} +2 -2
- package/dist/{index.cjs391.js.map → index.cjs388.js.map} +1 -1
- package/dist/{index.cjs392.js → index.cjs389.js} +2 -2
- package/dist/{index.cjs392.js.map → index.cjs389.js.map} +1 -1
- package/dist/index.cjs390.js +1 -1
- package/dist/index.cjs390.js.map +1 -1
- package/dist/index.cjs393.js +1 -1
- package/dist/index.cjs393.js.map +1 -1
- package/dist/index.cjs394.js +1 -1
- package/dist/index.cjs394.js.map +1 -1
- package/dist/index.cjs395.js +1 -1
- package/dist/index.cjs395.js.map +1 -1
- package/dist/{index.cjs403.js → index.cjs396.js} +2 -2
- package/dist/{index.cjs403.js.map → index.cjs396.js.map} +1 -1
- package/dist/{index.cjs404.js → index.cjs397.js} +1 -1
- package/dist/{index.cjs404.js.map → index.cjs397.js.map} +1 -1
- package/dist/{index.cjs405.js → index.cjs398.js} +1 -1
- package/dist/{index.cjs405.js.map → index.cjs398.js.map} +1 -1
- package/dist/index.cjs399.js +2 -0
- package/dist/index.cjs399.js.map +1 -0
- package/dist/index.cjs400.js +2 -0
- package/dist/index.cjs400.js.map +1 -0
- package/dist/index.cjs406.js +1 -1
- package/dist/index.cjs406.js.map +1 -1
- package/dist/index.cjs407.js +1 -1
- package/dist/index.cjs407.js.map +1 -1
- package/dist/{index.cjs411.js → index.cjs418.js} +1 -1
- package/dist/{index.cjs411.js.map → index.cjs418.js.map} +1 -1
- package/dist/{index.cjs412.js → index.cjs419.js} +2 -2
- package/dist/{index.cjs412.js.map → index.cjs419.js.map} +1 -1
- package/dist/{index.cjs413.js → index.cjs420.js} +1 -1
- package/dist/{index.cjs413.js.map → index.cjs420.js.map} +1 -1
- package/dist/{index.cjs414.js → index.cjs421.js} +2 -2
- package/dist/{index.cjs414.js.map → index.cjs421.js.map} +1 -1
- package/dist/{index.cjs415.js → index.cjs422.js} +2 -2
- package/dist/{index.cjs415.js.map → index.cjs422.js.map} +1 -1
- package/dist/{index.cjs416.js → index.cjs423.js} +1 -1
- package/dist/{index.cjs416.js.map → index.cjs423.js.map} +1 -1
- package/dist/index.cjs424.js +1 -1
- package/dist/index.cjs432.js +1 -1
- package/dist/index.cjs434.js +1 -1
- package/dist/index.cjs439.js +38 -1
- package/dist/index.cjs439.js.map +1 -1
- package/dist/index.cjs440.js +1 -38
- package/dist/index.cjs440.js.map +1 -1
- package/dist/index.cjs441.js +1 -1
- package/dist/index.cjs441.js.map +1 -1
- package/dist/index.cjs442.js +1 -1
- package/dist/index.cjs442.js.map +1 -1
- package/dist/index.cjs443.js +1 -1
- package/dist/index.cjs443.js.map +1 -1
- package/dist/index.cjs462.js +1 -1
- package/dist/index.cjs51.js +1 -1
- package/dist/index.cjs51.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.es244.js +1 -1
- package/dist/index.es251.js +3 -3
- package/dist/index.es261.js +1 -1
- package/dist/index.es267.js +8 -8
- package/dist/index.es294.js +2 -2
- package/dist/index.es33.js +1 -0
- package/dist/index.es33.js.map +1 -1
- package/dist/index.es333.js +1 -1
- package/dist/index.es35.js +7 -7
- package/dist/index.es35.js.map +1 -1
- package/dist/index.es372.js +1 -1
- package/dist/index.es373.js +1 -1
- package/dist/index.es383.js +1 -1
- package/dist/index.es384.js +1 -1
- package/dist/index.es385.js +13 -13
- package/dist/index.es386.js +1 -1
- package/dist/index.es387.js +6 -15
- package/dist/index.es387.js.map +1 -1
- package/dist/{index.es391.js → index.es388.js} +2 -2
- package/dist/{index.es391.js.map → index.es388.js.map} +1 -1
- package/dist/{index.es392.js → index.es389.js} +2 -2
- package/dist/{index.es392.js.map → index.es389.js.map} +1 -1
- package/dist/index.es390.js +15 -6
- package/dist/index.es390.js.map +1 -1
- package/dist/index.es393.js +15 -2
- package/dist/index.es393.js.map +1 -1
- package/dist/index.es394.js +125 -2
- package/dist/index.es394.js.map +1 -1
- package/dist/index.es395.js +133 -13
- package/dist/index.es395.js.map +1 -1
- package/dist/{index.es403.js → index.es396.js} +2 -2
- package/dist/{index.es403.js.map → index.es396.js.map} +1 -1
- package/dist/{index.es404.js → index.es397.js} +1 -1
- package/dist/{index.es404.js.map → index.es397.js.map} +1 -1
- package/dist/{index.es405.js → index.es398.js} +1 -1
- package/dist/{index.es405.js.map → index.es398.js.map} +1 -1
- package/dist/index.es399.js +53 -0
- package/dist/index.es399.js.map +1 -0
- package/dist/index.es400.js +56 -0
- package/dist/index.es400.js.map +1 -0
- package/dist/index.es406.js +2 -50
- package/dist/index.es406.js.map +1 -1
- package/dist/index.es407.js +2 -53
- package/dist/index.es407.js.map +1 -1
- package/dist/{index.es411.js → index.es418.js} +1 -1
- package/dist/{index.es411.js.map → index.es418.js.map} +1 -1
- package/dist/{index.es412.js → index.es419.js} +2 -2
- package/dist/{index.es412.js.map → index.es419.js.map} +1 -1
- package/dist/{index.es413.js → index.es420.js} +1 -1
- package/dist/{index.es413.js.map → index.es420.js.map} +1 -1
- package/dist/{index.es414.js → index.es421.js} +4 -4
- package/dist/{index.es414.js.map → index.es421.js.map} +1 -1
- package/dist/{index.es415.js → index.es422.js} +4 -4
- package/dist/{index.es415.js.map → index.es422.js.map} +1 -1
- package/dist/{index.es416.js → index.es423.js} +1 -1
- package/dist/{index.es416.js.map → index.es423.js.map} +1 -1
- package/dist/index.es424.js +1 -1
- package/dist/index.es432.js +1 -1
- package/dist/index.es434.js +4 -4
- package/dist/index.es439.js +69 -65
- package/dist/index.es439.js.map +1 -1
- package/dist/index.es440.js +8 -68
- package/dist/index.es440.js.map +1 -1
- package/dist/index.es441.js +14 -9
- package/dist/index.es441.js.map +1 -1
- package/dist/index.es442.js +62 -14
- package/dist/index.es442.js.map +1 -1
- package/dist/index.es443.js +64 -61
- package/dist/index.es443.js.map +1 -1
- package/dist/index.es462.js +4 -4
- package/dist/index.es51.js +13 -12
- package/dist/index.es51.js.map +1 -1
- package/package.json +1 -1
- package/dist/index.cjs401.js +0 -2
- package/dist/index.cjs401.js.map +0 -1
- package/dist/index.cjs402.js +0 -2
- package/dist/index.cjs402.js.map +0 -1
- package/dist/index.es401.js +0 -128
- package/dist/index.es401.js.map +0 -1
- package/dist/index.es402.js +0 -138
- package/dist/index.es402.js.map +0 -1
package/dist/index.cjs443.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs443.js","sources":["../node_modules/
|
1
|
+
{"version":3,"file":"index.cjs443.js","sources":["../node_modules/use-sidecar/dist/es2015/medium.js"],"sourcesContent":["import { __assign } from \"tslib\";\nfunction ItoI(a) {\n return a;\n}\nfunction innerCreateMedium(defaults, middleware) {\n if (middleware === void 0) { middleware = ItoI; }\n var buffer = [];\n var assigned = false;\n var medium = {\n read: function () {\n if (assigned) {\n throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.');\n }\n if (buffer.length) {\n return buffer[buffer.length - 1];\n }\n return defaults;\n },\n useMedium: function (data) {\n var item = middleware(data, assigned);\n buffer.push(item);\n return function () {\n buffer = buffer.filter(function (x) { return x !== item; });\n };\n },\n assignSyncMedium: function (cb) {\n assigned = true;\n while (buffer.length) {\n var cbs = buffer;\n buffer = [];\n cbs.forEach(cb);\n }\n buffer = {\n push: function (x) { return cb(x); },\n filter: function () { return buffer; },\n };\n },\n assignMedium: function (cb) {\n assigned = true;\n var pendingQueue = [];\n if (buffer.length) {\n var cbs = buffer;\n buffer = [];\n cbs.forEach(cb);\n pendingQueue = buffer;\n }\n var executeQueue = function () {\n var cbs = pendingQueue;\n pendingQueue = [];\n cbs.forEach(cb);\n };\n var cycle = function () { return Promise.resolve().then(executeQueue); };\n cycle();\n buffer = {\n push: function (x) {\n pendingQueue.push(x);\n cycle();\n },\n filter: function (filter) {\n pendingQueue = pendingQueue.filter(filter);\n return buffer;\n },\n };\n },\n };\n return medium;\n}\nexport function createMedium(defaults, middleware) {\n if (middleware === void 0) { middleware = ItoI; }\n return innerCreateMedium(defaults, middleware);\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function createSidecarMedium(options) {\n if (options === void 0) { options = {}; }\n var medium = innerCreateMedium(null);\n medium.options = __assign({ async: true, ssr: false }, options);\n return medium;\n}\n"],"names":["ItoI","a","innerCreateMedium","defaults","middleware","buffer","assigned","medium","data","item","x","cb","cbs","pendingQueue","executeQueue","cycle","filter","createSidecarMedium","options","__assign"],"mappings":"qHACA,SAASA,EAAKC,EAAG,CACb,OAAOA,CACX,CACA,SAASC,EAAkBC,EAAUC,EAAY,CACzCA,IAAe,SAAUA,EAAaJ,GAC1C,IAAIK,EAAS,CAAE,EACXC,EAAW,GACXC,EAAS,CACT,KAAM,UAAY,CACd,GAAID,EACA,MAAM,IAAI,MAAM,kGAAkG,EAEtH,OAAID,EAAO,OACAA,EAAOA,EAAO,OAAS,CAAC,EAE5BF,CACV,EACD,UAAW,SAAUK,EAAM,CACvB,IAAIC,EAAOL,EAAWI,EAAMF,CAAQ,EACpC,OAAAD,EAAO,KAAKI,CAAI,EACT,UAAY,CACfJ,EAASA,EAAO,OAAO,SAAUK,EAAG,CAAE,OAAOA,IAAMD,EAAO,CAC7D,CACJ,EACD,iBAAkB,SAAUE,EAAI,CAE5B,IADAL,EAAW,GACJD,EAAO,QAAQ,CAClB,IAAIO,EAAMP,EACVA,EAAS,CAAE,EACXO,EAAI,QAAQD,CAAE,CAC9B,CACYN,EAAS,CACL,KAAM,SAAUK,EAAG,CAAE,OAAOC,EAAGD,CAAC,CAAI,EACpC,OAAQ,UAAY,CAAE,OAAOL,CAAS,CACzC,CACJ,EACD,aAAc,SAAUM,EAAI,CACxBL,EAAW,GACX,IAAIO,EAAe,CAAE,EACrB,GAAIR,EAAO,OAAQ,CACf,IAAIO,EAAMP,EACVA,EAAS,CAAE,EACXO,EAAI,QAAQD,CAAE,EACdE,EAAeR,CAC/B,CACY,IAAIS,EAAe,UAAY,CAC3B,IAAIF,EAAMC,EACVA,EAAe,CAAE,EACjBD,EAAI,QAAQD,CAAE,CACjB,EACGI,EAAQ,UAAY,CAAE,OAAO,QAAQ,QAAO,EAAG,KAAKD,CAAY,CAAI,EACxEC,EAAO,EACPV,EAAS,CACL,KAAM,SAAUK,EAAG,CACfG,EAAa,KAAKH,CAAC,EACnBK,EAAO,CACV,EACD,OAAQ,SAAUC,EAAQ,CACtB,OAAAH,EAAeA,EAAa,OAAOG,CAAM,EAClCX,CACV,CACJ,CACJ,CACJ,EACD,OAAOE,CACX,CAMO,SAASU,EAAoBC,EAAS,CACrCA,IAAY,SAAUA,EAAU,CAAA,GACpC,IAAIX,EAASL,EAAkB,IAAI,EACnC,OAAAK,EAAO,QAAUY,EAAAA,SAAS,CAAE,MAAO,GAAM,IAAK,EAAO,EAAED,CAAO,EACvDX,CACX","x_google_ignoreList":[0]}
|
package/dist/index.cjs462.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const le=require("react"),j=require("./index.cjs384.js"),N=require("./index.cjs392.js"),se=require("./index.cjs382.js"),A=require("./index.cjs381.js"),g=require("./index.cjs411.js"),ce=require("./index.cjs413.js"),ie=require("./index.cjs416.js"),ae=require("./index.cjs475.js"),E=require("./index.cjs380.js"),m=require("./index.cjs209.js");function ue(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const s=ue(le);function de(e,o){return s.useReducer((r,n)=>o[r][n]??r,e)}var Y="ScrollArea",[K,fe]=se.createContextScope(Y),[he,v]=K(Y),V=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,type:n="hover",dir:t,scrollHideDelay:l=600,...c}=e,[i,a]=s.useState(null),[f,u]=s.useState(null),[h,d]=s.useState(null),[b,S]=s.useState(null),[T,M]=s.useState(null),[R,_]=s.useState(0),[X,L]=s.useState(0),[D,y]=s.useState(!1),[H,O]=s.useState(!1),p=A.useComposedRefs(o,P=>a(P)),x=ce.useDirection(t);return m.jsxRuntimeExports.jsx(he,{scope:r,type:n,dir:x,scrollHideDelay:l,scrollArea:i,viewport:f,onViewportChange:u,content:h,onContentChange:d,scrollbarX:b,onScrollbarXChange:S,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:T,onScrollbarYChange:M,scrollbarYEnabled:H,onScrollbarYEnabledChange:O,onCornerWidthChange:_,onCornerHeightChange:L,children:m.jsxRuntimeExports.jsx(j.Primitive.div,{dir:x,...c,ref:p,style:{position:"relative","--radix-scroll-area-corner-width":R+"px","--radix-scroll-area-corner-height":X+"px",...e.style}})})});V.displayName=Y;var Q="ScrollAreaViewport",U=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,children:n,nonce:t,...l}=e,c=v(Q,r),i=s.useRef(null),a=A.useComposedRefs(o,i,c.onViewportChange);return m.jsxRuntimeExports.jsxs(m.jsxRuntimeExports.Fragment,{children:[m.jsxRuntimeExports.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),m.jsxRuntimeExports.jsx(j.Primitive.div,{"data-radix-scroll-area-viewport":"",...l,ref:a,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:m.jsxRuntimeExports.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});U.displayName=Q;var w="ScrollAreaScrollbar",q=s.forwardRef((e,o)=>{const{forceMount:r,...n}=e,t=v(w,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:c}=t,i=e.orientation==="horizontal";return s.useEffect(()=>(i?l(!0):c(!0),()=>{i?l(!1):c(!1)}),[i,l,c]),t.type==="hover"?m.jsxRuntimeExports.jsx(me,{...n,ref:o,forceMount:r}):t.type==="scroll"?m.jsxRuntimeExports.jsx(be,{...n,ref:o,forceMount:r}):t.type==="auto"?m.jsxRuntimeExports.jsx(Z,{...n,ref:o,forceMount:r}):t.type==="always"?m.jsxRuntimeExports.jsx(B,{...n,ref:o}):null});q.displayName=w;var me=s.forwardRef((e,o)=>{const{forceMount:r,...n}=e,t=v(w,e.__scopeScrollArea),[l,c]=s.useState(!1);return s.useEffect(()=>{const i=t.scrollArea;let a=0;if(i){const f=()=>{window.clearTimeout(a),c(!0)},u=()=>{a=window.setTimeout(()=>c(!1),t.scrollHideDelay)};return i.addEventListener("pointerenter",f),i.addEventListener("pointerleave",u),()=>{window.clearTimeout(a),i.removeEventListener("pointerenter",f),i.removeEventListener("pointerleave",u)}}},[t.scrollArea,t.scrollHideDelay]),m.jsxRuntimeExports.jsx(N.Presence,{present:r||l,children:m.jsxRuntimeExports.jsx(Z,{"data-state":l?"visible":"hidden",...n,ref:o})})}),be=s.forwardRef((e,o)=>{const{forceMount:r,...n}=e,t=v(w,e.__scopeScrollArea),l=e.orientation==="horizontal",c=I(()=>a("SCROLL_END"),100),[i,a]=de("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return s.useEffect(()=>{if(i==="idle"){const f=window.setTimeout(()=>a("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(f)}},[i,t.scrollHideDelay,a]),s.useEffect(()=>{const f=t.viewport,u=l?"scrollLeft":"scrollTop";if(f){let h=f[u];const d=()=>{const b=f[u];h!==b&&(a("SCROLL"),c()),h=b};return f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[t.viewport,l,a,c]),m.jsxRuntimeExports.jsx(N.Presence,{present:r||i!=="hidden",children:m.jsxRuntimeExports.jsx(B,{"data-state":i==="hidden"?"hidden":"visible",...n,ref:o,onPointerEnter:E.composeEventHandlers(e.onPointerEnter,()=>a("POINTER_ENTER")),onPointerLeave:E.composeEventHandlers(e.onPointerLeave,()=>a("POINTER_LEAVE"))})})}),Z=s.forwardRef((e,o)=>{const r=v(w,e.__scopeScrollArea),{forceMount:n,...t}=e,[l,c]=s.useState(!1),i=e.orientation==="horizontal",a=I(()=>{if(r.viewport){const f=r.viewport.offsetWidth<r.viewport.scrollWidth,u=r.viewport.offsetHeight<r.viewport.scrollHeight;c(i?f:u)}},10);return C(r.viewport,a),C(r.content,a),m.jsxRuntimeExports.jsx(N.Presence,{present:n||l,children:m.jsxRuntimeExports.jsx(B,{"data-state":l?"visible":"hidden",...t,ref:o})})}),B=s.forwardRef((e,o)=>{const{orientation:r="vertical",...n}=e,t=v(w,e.__scopeScrollArea),l=s.useRef(null),c=s.useRef(0),[i,a]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=te(i.viewport,i.content),u={...n,sizes:i,onSizesChange:a,hasThumb:f>0&&f<1,onThumbChange:d=>l.current=d,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:d=>c.current=d};function h(d,b){return Re(d,c.current,i,b)}return r==="horizontal"?m.jsxRuntimeExports.jsx(pe,{...u,ref:o,onThumbPositionChange:()=>{if(t.viewport&&l.current){const d=t.viewport.scrollLeft,b=J(d,i,t.dir);l.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:d=>{t.viewport&&(t.viewport.scrollLeft=d)},onDragScroll:d=>{t.viewport&&(t.viewport.scrollLeft=h(d,t.dir))}}):r==="vertical"?m.jsxRuntimeExports.jsx(Se,{...u,ref:o,onThumbPositionChange:()=>{if(t.viewport&&l.current){const d=t.viewport.scrollTop,b=J(d,i);l.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:d=>{t.viewport&&(t.viewport.scrollTop=d)},onDragScroll:d=>{t.viewport&&(t.viewport.scrollTop=h(d))}}):null}),pe=s.forwardRef((e,o)=>{const{sizes:r,onSizesChange:n,...t}=e,l=v(w,e.__scopeScrollArea),[c,i]=s.useState(),a=s.useRef(null),f=A.useComposedRefs(o,a,l.onScrollbarXChange);return s.useEffect(()=>{a.current&&i(getComputedStyle(a.current))},[a]),m.jsxRuntimeExports.jsx(re,{"data-orientation":"horizontal",...t,ref:f,sizes:r,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":k(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,h)=>{if(l.viewport){const d=l.viewport.scrollLeft+u.deltaX;e.onWheelScroll(d),ne(d,h)&&u.preventDefault()}},onResize:()=>{a.current&&l.viewport&&c&&n({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:a.current.clientWidth,paddingStart:z(c.paddingLeft),paddingEnd:z(c.paddingRight)}})}})}),Se=s.forwardRef((e,o)=>{const{sizes:r,onSizesChange:n,...t}=e,l=v(w,e.__scopeScrollArea),[c,i]=s.useState(),a=s.useRef(null),f=A.useComposedRefs(o,a,l.onScrollbarYChange);return s.useEffect(()=>{a.current&&i(getComputedStyle(a.current))},[a]),m.jsxRuntimeExports.jsx(re,{"data-orientation":"vertical",...t,ref:f,sizes:r,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":k(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,h)=>{if(l.viewport){const d=l.viewport.scrollTop+u.deltaY;e.onWheelScroll(d),ne(d,h)&&u.preventDefault()}},onResize:()=>{a.current&&l.viewport&&c&&n({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:a.current.clientHeight,paddingStart:z(c.paddingTop),paddingEnd:z(c.paddingBottom)}})}})}),[ve,ee]=K(w),re=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:t,onThumbChange:l,onThumbPointerUp:c,onThumbPointerDown:i,onThumbPositionChange:a,onDragScroll:f,onWheelScroll:u,onResize:h,...d}=e,b=v(w,r),[S,T]=s.useState(null),M=A.useComposedRefs(o,p=>T(p)),R=s.useRef(null),_=s.useRef(""),X=b.viewport,L=n.content-n.viewport,D=g.useCallbackRef(u),y=g.useCallbackRef(a),H=I(h,10);function O(p){if(R.current){const x=p.clientX-R.current.left,P=p.clientY-R.current.top;f({x,y:P})}}return s.useEffect(()=>{const p=x=>{const P=x.target;(S==null?void 0:S.contains(P))&&D(x,L)};return document.addEventListener("wheel",p,{passive:!1}),()=>document.removeEventListener("wheel",p,{passive:!1})},[X,S,L,D]),s.useEffect(y,[n,y]),C(S,H),C(b.content,H),m.jsxRuntimeExports.jsx(ve,{scope:r,scrollbar:S,hasThumb:t,onThumbChange:g.useCallbackRef(l),onThumbPointerUp:g.useCallbackRef(c),onThumbPositionChange:y,onThumbPointerDown:g.useCallbackRef(i),children:m.jsxRuntimeExports.jsx(j.Primitive.div,{...d,ref:M,style:{position:"absolute",...d.style},onPointerDown:E.composeEventHandlers(e.onPointerDown,p=>{p.button===0&&(p.target.setPointerCapture(p.pointerId),R.current=S.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),O(p))}),onPointerMove:E.composeEventHandlers(e.onPointerMove,O),onPointerUp:E.composeEventHandlers(e.onPointerUp,p=>{const x=p.target;x.hasPointerCapture(p.pointerId)&&x.releasePointerCapture(p.pointerId),document.body.style.webkitUserSelect=_.current,b.viewport&&(b.viewport.style.scrollBehavior=""),R.current=null})})})}),W="ScrollAreaThumb",F=s.forwardRef((e,o)=>{const{forceMount:r,...n}=e,t=ee(W,e.__scopeScrollArea);return m.jsxRuntimeExports.jsx(N.Presence,{present:r||t.hasThumb,children:m.jsxRuntimeExports.jsx(xe,{ref:o,...n})})}),xe=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,style:n,...t}=e,l=v(W,r),c=ee(W,r),{onThumbPositionChange:i}=c,a=A.useComposedRefs(o,h=>c.onThumbChange(h)),f=s.useRef(void 0),u=I(()=>{f.current&&(f.current(),f.current=void 0)},100);return s.useEffect(()=>{const h=l.viewport;if(h){const d=()=>{if(u(),!f.current){const b=ge(h,i);f.current=b,i()}};return i(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[l.viewport,u,i]),m.jsxRuntimeExports.jsx(j.Primitive.div,{"data-state":c.hasThumb?"visible":"hidden",...t,ref:a,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:E.composeEventHandlers(e.onPointerDownCapture,h=>{const b=h.target.getBoundingClientRect(),S=h.clientX-b.left,T=h.clientY-b.top;c.onThumbPointerDown({x:S,y:T})}),onPointerUp:E.composeEventHandlers(e.onPointerUp,c.onThumbPointerUp)})});F.displayName=W;var $="ScrollAreaCorner",G=s.forwardRef((e,o)=>{const r=v($,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?m.jsxRuntimeExports.jsx(we,{...e,ref:o}):null});G.displayName=$;var we=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,...n}=e,t=v($,r),[l,c]=s.useState(0),[i,a]=s.useState(0),f=!!(l&&i);return C(t.scrollbarX,()=>{var h;const u=((h=t.scrollbarX)==null?void 0:h.offsetHeight)||0;t.onCornerHeightChange(u),a(u)}),C(t.scrollbarY,()=>{var h;const u=((h=t.scrollbarY)==null?void 0:h.offsetWidth)||0;t.onCornerWidthChange(u),c(u)}),f?m.jsxRuntimeExports.jsx(j.Primitive.div,{...n,ref:o,style:{width:l,height:i,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function z(e){return e?parseInt(e,10):0}function te(e,o){const r=e/o;return isNaN(r)?0:r}function k(e){const o=te(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*o;return Math.max(n,18)}function Re(e,o,r,n="ltr"){const t=k(r),l=t/2,c=o||l,i=t-c,a=r.scrollbar.paddingStart+c,f=r.scrollbar.size-r.scrollbar.paddingEnd-i,u=r.content-r.viewport,h=n==="ltr"?[0,u]:[u*-1,0];return oe([a,f],h)(e)}function J(e,o,r="ltr"){const n=k(o),t=o.scrollbar.paddingStart+o.scrollbar.paddingEnd,l=o.scrollbar.size-t,c=o.content-o.viewport,i=l-n,a=r==="ltr"?[0,c]:[c*-1,0],f=ae.clamp(e,a);return oe([0,c],[0,i])(f)}function oe(e,o){return r=>{if(e[0]===e[1]||o[0]===o[1])return o[0];const n=(o[1]-o[0])/(e[1]-e[0]);return o[0]+n*(r-e[0])}}function ne(e,o){return e>0&&e<o}var ge=(e,o=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function t(){const l={left:e.scrollLeft,top:e.scrollTop},c=r.left!==l.left,i=r.top!==l.top;(c||i)&&o(),r=l,n=window.requestAnimationFrame(t)}(),()=>window.cancelAnimationFrame(n)};function I(e,o){const r=g.useCallbackRef(e),n=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(n.current),[]),s.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,o)},[r,o])}function C(e,o){const r=g.useCallbackRef(o);ie.useLayoutEffect(()=>{let n=0;if(e){const t=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return t.observe(e),()=>{window.cancelAnimationFrame(n),t.unobserve(e)}}},[e,r])}var Ee=V,Pe=U,Ce=q,Ae=F,Te=G;exports.Corner=Te;exports.Root=Ee;exports.ScrollArea=V;exports.ScrollAreaCorner=G;exports.ScrollAreaScrollbar=q;exports.ScrollAreaThumb=F;exports.ScrollAreaViewport=U;exports.Scrollbar=Ce;exports.Thumb=Ae;exports.Viewport=Pe;exports.createScrollAreaScope=fe;
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const le=require("react"),j=require("./index.cjs384.js"),N=require("./index.cjs389.js"),se=require("./index.cjs382.js"),A=require("./index.cjs381.js"),g=require("./index.cjs418.js"),ce=require("./index.cjs420.js"),ie=require("./index.cjs423.js"),ae=require("./index.cjs475.js"),E=require("./index.cjs380.js"),m=require("./index.cjs209.js");function ue(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const s=ue(le);function de(e,o){return s.useReducer((r,n)=>o[r][n]??r,e)}var Y="ScrollArea",[K,fe]=se.createContextScope(Y),[he,v]=K(Y),V=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,type:n="hover",dir:t,scrollHideDelay:l=600,...c}=e,[i,a]=s.useState(null),[f,u]=s.useState(null),[h,d]=s.useState(null),[b,S]=s.useState(null),[T,M]=s.useState(null),[R,_]=s.useState(0),[X,L]=s.useState(0),[D,y]=s.useState(!1),[H,O]=s.useState(!1),p=A.useComposedRefs(o,P=>a(P)),x=ce.useDirection(t);return m.jsxRuntimeExports.jsx(he,{scope:r,type:n,dir:x,scrollHideDelay:l,scrollArea:i,viewport:f,onViewportChange:u,content:h,onContentChange:d,scrollbarX:b,onScrollbarXChange:S,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:T,onScrollbarYChange:M,scrollbarYEnabled:H,onScrollbarYEnabledChange:O,onCornerWidthChange:_,onCornerHeightChange:L,children:m.jsxRuntimeExports.jsx(j.Primitive.div,{dir:x,...c,ref:p,style:{position:"relative","--radix-scroll-area-corner-width":R+"px","--radix-scroll-area-corner-height":X+"px",...e.style}})})});V.displayName=Y;var Q="ScrollAreaViewport",U=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,children:n,nonce:t,...l}=e,c=v(Q,r),i=s.useRef(null),a=A.useComposedRefs(o,i,c.onViewportChange);return m.jsxRuntimeExports.jsxs(m.jsxRuntimeExports.Fragment,{children:[m.jsxRuntimeExports.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),m.jsxRuntimeExports.jsx(j.Primitive.div,{"data-radix-scroll-area-viewport":"",...l,ref:a,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:m.jsxRuntimeExports.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});U.displayName=Q;var w="ScrollAreaScrollbar",q=s.forwardRef((e,o)=>{const{forceMount:r,...n}=e,t=v(w,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:c}=t,i=e.orientation==="horizontal";return s.useEffect(()=>(i?l(!0):c(!0),()=>{i?l(!1):c(!1)}),[i,l,c]),t.type==="hover"?m.jsxRuntimeExports.jsx(me,{...n,ref:o,forceMount:r}):t.type==="scroll"?m.jsxRuntimeExports.jsx(be,{...n,ref:o,forceMount:r}):t.type==="auto"?m.jsxRuntimeExports.jsx(Z,{...n,ref:o,forceMount:r}):t.type==="always"?m.jsxRuntimeExports.jsx(B,{...n,ref:o}):null});q.displayName=w;var me=s.forwardRef((e,o)=>{const{forceMount:r,...n}=e,t=v(w,e.__scopeScrollArea),[l,c]=s.useState(!1);return s.useEffect(()=>{const i=t.scrollArea;let a=0;if(i){const f=()=>{window.clearTimeout(a),c(!0)},u=()=>{a=window.setTimeout(()=>c(!1),t.scrollHideDelay)};return i.addEventListener("pointerenter",f),i.addEventListener("pointerleave",u),()=>{window.clearTimeout(a),i.removeEventListener("pointerenter",f),i.removeEventListener("pointerleave",u)}}},[t.scrollArea,t.scrollHideDelay]),m.jsxRuntimeExports.jsx(N.Presence,{present:r||l,children:m.jsxRuntimeExports.jsx(Z,{"data-state":l?"visible":"hidden",...n,ref:o})})}),be=s.forwardRef((e,o)=>{const{forceMount:r,...n}=e,t=v(w,e.__scopeScrollArea),l=e.orientation==="horizontal",c=I(()=>a("SCROLL_END"),100),[i,a]=de("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return s.useEffect(()=>{if(i==="idle"){const f=window.setTimeout(()=>a("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(f)}},[i,t.scrollHideDelay,a]),s.useEffect(()=>{const f=t.viewport,u=l?"scrollLeft":"scrollTop";if(f){let h=f[u];const d=()=>{const b=f[u];h!==b&&(a("SCROLL"),c()),h=b};return f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[t.viewport,l,a,c]),m.jsxRuntimeExports.jsx(N.Presence,{present:r||i!=="hidden",children:m.jsxRuntimeExports.jsx(B,{"data-state":i==="hidden"?"hidden":"visible",...n,ref:o,onPointerEnter:E.composeEventHandlers(e.onPointerEnter,()=>a("POINTER_ENTER")),onPointerLeave:E.composeEventHandlers(e.onPointerLeave,()=>a("POINTER_LEAVE"))})})}),Z=s.forwardRef((e,o)=>{const r=v(w,e.__scopeScrollArea),{forceMount:n,...t}=e,[l,c]=s.useState(!1),i=e.orientation==="horizontal",a=I(()=>{if(r.viewport){const f=r.viewport.offsetWidth<r.viewport.scrollWidth,u=r.viewport.offsetHeight<r.viewport.scrollHeight;c(i?f:u)}},10);return C(r.viewport,a),C(r.content,a),m.jsxRuntimeExports.jsx(N.Presence,{present:n||l,children:m.jsxRuntimeExports.jsx(B,{"data-state":l?"visible":"hidden",...t,ref:o})})}),B=s.forwardRef((e,o)=>{const{orientation:r="vertical",...n}=e,t=v(w,e.__scopeScrollArea),l=s.useRef(null),c=s.useRef(0),[i,a]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=te(i.viewport,i.content),u={...n,sizes:i,onSizesChange:a,hasThumb:f>0&&f<1,onThumbChange:d=>l.current=d,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:d=>c.current=d};function h(d,b){return Re(d,c.current,i,b)}return r==="horizontal"?m.jsxRuntimeExports.jsx(pe,{...u,ref:o,onThumbPositionChange:()=>{if(t.viewport&&l.current){const d=t.viewport.scrollLeft,b=J(d,i,t.dir);l.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:d=>{t.viewport&&(t.viewport.scrollLeft=d)},onDragScroll:d=>{t.viewport&&(t.viewport.scrollLeft=h(d,t.dir))}}):r==="vertical"?m.jsxRuntimeExports.jsx(Se,{...u,ref:o,onThumbPositionChange:()=>{if(t.viewport&&l.current){const d=t.viewport.scrollTop,b=J(d,i);l.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:d=>{t.viewport&&(t.viewport.scrollTop=d)},onDragScroll:d=>{t.viewport&&(t.viewport.scrollTop=h(d))}}):null}),pe=s.forwardRef((e,o)=>{const{sizes:r,onSizesChange:n,...t}=e,l=v(w,e.__scopeScrollArea),[c,i]=s.useState(),a=s.useRef(null),f=A.useComposedRefs(o,a,l.onScrollbarXChange);return s.useEffect(()=>{a.current&&i(getComputedStyle(a.current))},[a]),m.jsxRuntimeExports.jsx(re,{"data-orientation":"horizontal",...t,ref:f,sizes:r,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":k(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,h)=>{if(l.viewport){const d=l.viewport.scrollLeft+u.deltaX;e.onWheelScroll(d),ne(d,h)&&u.preventDefault()}},onResize:()=>{a.current&&l.viewport&&c&&n({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:a.current.clientWidth,paddingStart:z(c.paddingLeft),paddingEnd:z(c.paddingRight)}})}})}),Se=s.forwardRef((e,o)=>{const{sizes:r,onSizesChange:n,...t}=e,l=v(w,e.__scopeScrollArea),[c,i]=s.useState(),a=s.useRef(null),f=A.useComposedRefs(o,a,l.onScrollbarYChange);return s.useEffect(()=>{a.current&&i(getComputedStyle(a.current))},[a]),m.jsxRuntimeExports.jsx(re,{"data-orientation":"vertical",...t,ref:f,sizes:r,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":k(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,h)=>{if(l.viewport){const d=l.viewport.scrollTop+u.deltaY;e.onWheelScroll(d),ne(d,h)&&u.preventDefault()}},onResize:()=>{a.current&&l.viewport&&c&&n({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:a.current.clientHeight,paddingStart:z(c.paddingTop),paddingEnd:z(c.paddingBottom)}})}})}),[ve,ee]=K(w),re=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:t,onThumbChange:l,onThumbPointerUp:c,onThumbPointerDown:i,onThumbPositionChange:a,onDragScroll:f,onWheelScroll:u,onResize:h,...d}=e,b=v(w,r),[S,T]=s.useState(null),M=A.useComposedRefs(o,p=>T(p)),R=s.useRef(null),_=s.useRef(""),X=b.viewport,L=n.content-n.viewport,D=g.useCallbackRef(u),y=g.useCallbackRef(a),H=I(h,10);function O(p){if(R.current){const x=p.clientX-R.current.left,P=p.clientY-R.current.top;f({x,y:P})}}return s.useEffect(()=>{const p=x=>{const P=x.target;(S==null?void 0:S.contains(P))&&D(x,L)};return document.addEventListener("wheel",p,{passive:!1}),()=>document.removeEventListener("wheel",p,{passive:!1})},[X,S,L,D]),s.useEffect(y,[n,y]),C(S,H),C(b.content,H),m.jsxRuntimeExports.jsx(ve,{scope:r,scrollbar:S,hasThumb:t,onThumbChange:g.useCallbackRef(l),onThumbPointerUp:g.useCallbackRef(c),onThumbPositionChange:y,onThumbPointerDown:g.useCallbackRef(i),children:m.jsxRuntimeExports.jsx(j.Primitive.div,{...d,ref:M,style:{position:"absolute",...d.style},onPointerDown:E.composeEventHandlers(e.onPointerDown,p=>{p.button===0&&(p.target.setPointerCapture(p.pointerId),R.current=S.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),O(p))}),onPointerMove:E.composeEventHandlers(e.onPointerMove,O),onPointerUp:E.composeEventHandlers(e.onPointerUp,p=>{const x=p.target;x.hasPointerCapture(p.pointerId)&&x.releasePointerCapture(p.pointerId),document.body.style.webkitUserSelect=_.current,b.viewport&&(b.viewport.style.scrollBehavior=""),R.current=null})})})}),W="ScrollAreaThumb",F=s.forwardRef((e,o)=>{const{forceMount:r,...n}=e,t=ee(W,e.__scopeScrollArea);return m.jsxRuntimeExports.jsx(N.Presence,{present:r||t.hasThumb,children:m.jsxRuntimeExports.jsx(xe,{ref:o,...n})})}),xe=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,style:n,...t}=e,l=v(W,r),c=ee(W,r),{onThumbPositionChange:i}=c,a=A.useComposedRefs(o,h=>c.onThumbChange(h)),f=s.useRef(void 0),u=I(()=>{f.current&&(f.current(),f.current=void 0)},100);return s.useEffect(()=>{const h=l.viewport;if(h){const d=()=>{if(u(),!f.current){const b=ge(h,i);f.current=b,i()}};return i(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[l.viewport,u,i]),m.jsxRuntimeExports.jsx(j.Primitive.div,{"data-state":c.hasThumb?"visible":"hidden",...t,ref:a,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:E.composeEventHandlers(e.onPointerDownCapture,h=>{const b=h.target.getBoundingClientRect(),S=h.clientX-b.left,T=h.clientY-b.top;c.onThumbPointerDown({x:S,y:T})}),onPointerUp:E.composeEventHandlers(e.onPointerUp,c.onThumbPointerUp)})});F.displayName=W;var $="ScrollAreaCorner",G=s.forwardRef((e,o)=>{const r=v($,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?m.jsxRuntimeExports.jsx(we,{...e,ref:o}):null});G.displayName=$;var we=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,...n}=e,t=v($,r),[l,c]=s.useState(0),[i,a]=s.useState(0),f=!!(l&&i);return C(t.scrollbarX,()=>{var h;const u=((h=t.scrollbarX)==null?void 0:h.offsetHeight)||0;t.onCornerHeightChange(u),a(u)}),C(t.scrollbarY,()=>{var h;const u=((h=t.scrollbarY)==null?void 0:h.offsetWidth)||0;t.onCornerWidthChange(u),c(u)}),f?m.jsxRuntimeExports.jsx(j.Primitive.div,{...n,ref:o,style:{width:l,height:i,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function z(e){return e?parseInt(e,10):0}function te(e,o){const r=e/o;return isNaN(r)?0:r}function k(e){const o=te(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*o;return Math.max(n,18)}function Re(e,o,r,n="ltr"){const t=k(r),l=t/2,c=o||l,i=t-c,a=r.scrollbar.paddingStart+c,f=r.scrollbar.size-r.scrollbar.paddingEnd-i,u=r.content-r.viewport,h=n==="ltr"?[0,u]:[u*-1,0];return oe([a,f],h)(e)}function J(e,o,r="ltr"){const n=k(o),t=o.scrollbar.paddingStart+o.scrollbar.paddingEnd,l=o.scrollbar.size-t,c=o.content-o.viewport,i=l-n,a=r==="ltr"?[0,c]:[c*-1,0],f=ae.clamp(e,a);return oe([0,c],[0,i])(f)}function oe(e,o){return r=>{if(e[0]===e[1]||o[0]===o[1])return o[0];const n=(o[1]-o[0])/(e[1]-e[0]);return o[0]+n*(r-e[0])}}function ne(e,o){return e>0&&e<o}var ge=(e,o=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function t(){const l={left:e.scrollLeft,top:e.scrollTop},c=r.left!==l.left,i=r.top!==l.top;(c||i)&&o(),r=l,n=window.requestAnimationFrame(t)}(),()=>window.cancelAnimationFrame(n)};function I(e,o){const r=g.useCallbackRef(e),n=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(n.current),[]),s.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,o)},[r,o])}function C(e,o){const r=g.useCallbackRef(o);ie.useLayoutEffect(()=>{let n=0;if(e){const t=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return t.observe(e),()=>{window.cancelAnimationFrame(n),t.unobserve(e)}}},[e,r])}var Ee=V,Pe=U,Ce=q,Ae=F,Te=G;exports.Corner=Te;exports.Root=Ee;exports.ScrollArea=V;exports.ScrollAreaCorner=G;exports.ScrollAreaScrollbar=q;exports.ScrollAreaThumb=F;exports.ScrollAreaViewport=U;exports.Scrollbar=Ce;exports.Thumb=Ae;exports.Viewport=Pe;exports.createScrollAreaScope=fe;
|
2
2
|
//# sourceMappingURL=index.cjs462.js.map
|
package/dist/index.cjs51.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components/ui/filters/CategoryContent/CategoryContent.css');const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components/ui/filters/CategoryContent/CategoryContent.css');const s=require("./index.cjs209.js"),x=require("./index.cjs62.js"),a=require("./index.cjs211.js");;/* empty css */const d=require("./index.cjs10.js"),h=({className:o="",canMultiple:t=!0,items:c,selectedItems:n,onChange:i})=>{const l=e=>{let r;t?r=n.includes(e)?n.filter(u=>u!==e):[...n,e]:n.includes(e)?r=[]:r=[e],i(r)};return s.jsxRuntimeExports.jsx(d.Col,{className:a.clsx(o),children:c.map((e,r)=>s.jsxRuntimeExports.jsx("div",{className:"ui-checkbox-border border-divider py-x8",children:s.jsxRuntimeExports.jsx(x.CheckboxFilter,{id:e.id,label:e.label,checked:e.checked,onChange:()=>l(e.id),classNameText:"fs-6 fw-regular"})},r))})};exports.CategoryContent=h;
|
2
2
|
//# sourceMappingURL=index.cjs51.js.map
|
package/dist/index.cjs51.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs51.js","sources":["../src/components/ui/filters/CategoryContent/index.tsx"],"sourcesContent":["import { CheckboxFilter } from \"@/components/ui/filters/CheckboxFilter\";\nimport clsx from \"clsx\";\nimport \"./CategoryContent.scss\";\nimport { Col } from \"@/components\";\n\ntype CategoryContentProps = {\n className?: string;\n items: {\n id: string;\n label: string;\n checked: boolean;\n }[];\n selectedItems: string[];\n onChange: (selected: string[]) => void;\n};\nexport const CategoryContent = ({\n className = \"\",\n items,\n selectedItems,\n onChange,\n}: CategoryContentProps) => {\n const handleCheckboxChange = (id: string) => {\n
|
1
|
+
{"version":3,"file":"index.cjs51.js","sources":["../src/components/ui/filters/CategoryContent/index.tsx"],"sourcesContent":["import { CheckboxFilter } from \"@/components/ui/filters/CheckboxFilter\";\nimport clsx from \"clsx\";\nimport \"./CategoryContent.scss\";\nimport { Col } from \"@/components\";\n\ntype CategoryContentProps = {\n className?: string;\n canMultiple?: boolean;\n items: {\n id: string;\n label: string;\n checked: boolean;\n }[];\n selectedItems: string[];\n onChange: (selected: string[]) => void;\n};\nexport const CategoryContent = ({\n className = \"\",\n canMultiple = true,\n items,\n selectedItems,\n onChange,\n}: CategoryContentProps) => {\n const handleCheckboxChange = (id: string) => {\n let newSelected: string[];\n if (canMultiple) {\n newSelected = selectedItems.includes(id)\n ? selectedItems.filter((item) => item !== id)\n : [...selectedItems, id];\n } else {\n if (selectedItems.includes(id)) {\n newSelected = [];\n } else {\n newSelected = [id];\n }\n }\n\n onChange(newSelected);\n };\n\n return (\n <Col className={clsx(className)}>\n {items.map((item, index) => {\n return (\n <div\n key={index}\n className={\"ui-checkbox-border border-divider py-x8\"}\n >\n <CheckboxFilter\n id={item.id}\n label={item.label}\n checked={item.checked}\n onChange={() => handleCheckboxChange(item.id)}\n classNameText={\"fs-6 fw-regular\"}\n />\n </div>\n );\n })}\n </Col>\n );\n};\n"],"names":["CategoryContent","className","canMultiple","items","selectedItems","onChange","handleCheckboxChange","id","newSelected","item","jsx","Col","clsx","index","CheckboxFilter"],"mappings":"mPAgBaA,EAAkB,CAAC,CAC9B,UAAAC,EAAY,GACZ,YAAAC,EAAc,GACd,MAAAC,EACA,cAAAC,EACA,SAAAC,CACF,IAA4B,CACpB,MAAAC,EAAwBC,GAAe,CACvC,IAAAC,EACAN,EACFM,EAAcJ,EAAc,SAASG,CAAE,EACnCH,EAAc,OAAQK,GAASA,IAASF,CAAE,EAC1C,CAAC,GAAGH,EAAeG,CAAE,EAErBH,EAAc,SAASG,CAAE,EAC3BC,EAAc,CAAC,EAEfA,EAAc,CAACD,CAAE,EAIrBF,EAASG,CAAW,CACtB,EAGE,OAAAE,wBAACC,EAAAA,IAAI,CAAA,UAAWC,EAAAA,KAAKX,CAAS,EAC3B,SAAME,EAAA,IAAI,CAACM,EAAMI,IAEdH,EAAA,kBAAA,IAAC,MAAA,CAEC,UAAW,0CAEX,SAAAA,EAAA,kBAAA,IAACI,EAAA,eAAA,CACC,GAAIL,EAAK,GACT,MAAOA,EAAK,MACZ,QAASA,EAAK,QACd,SAAU,IAAMH,EAAqBG,EAAK,EAAE,EAC5C,cAAe,iBAAA,CAAA,CACjB,EATKI,CAUP,CAEH,EACH,CAEJ"}
|
package/dist/index.d.ts
CHANGED
@@ -674,10 +674,11 @@ declare type CarouselProps = {
|
|
674
674
|
children?: Array<ReactNode>;
|
675
675
|
};
|
676
676
|
|
677
|
-
export declare const CategoryContent: ({ className, items, selectedItems, onChange, }: CategoryContentProps) => JSX.Element;
|
677
|
+
export declare const CategoryContent: ({ className, canMultiple, items, selectedItems, onChange, }: CategoryContentProps) => JSX.Element;
|
678
678
|
|
679
679
|
declare type CategoryContentProps = {
|
680
680
|
className?: string;
|
681
|
+
canMultiple?: boolean;
|
681
682
|
items: {
|
682
683
|
id: string;
|
683
684
|
label: string;
|
package/dist/index.es244.js
CHANGED
@@ -3,7 +3,7 @@ import { Button as m } from "./index.es25.js";
|
|
3
3
|
import { HeaderTopBanner as y } from "./index.es21.js";
|
4
4
|
import { useState as g, useRef as w, useCallback as C, useEffect as u } from "react";
|
5
5
|
import { clsx as r } from "./index.es211.js";
|
6
|
-
import { useFocusTrap as N } from "./index.
|
6
|
+
import { useFocusTrap as N } from "./index.es390.js";
|
7
7
|
import { Container as k } from "./index.es6.js";
|
8
8
|
import './components/navigations/HeaderMobile/HeaderMobile.css';/* empty css */
|
9
9
|
import { Col as L } from "./index.es10.js";
|
package/dist/index.es251.js
CHANGED
@@ -3,9 +3,9 @@ import { useComposedRefs as N } from "./index.es381.js";
|
|
3
3
|
import { createContextScope as M } from "./index.es382.js";
|
4
4
|
import { composeEventHandlers as S } from "./index.es380.js";
|
5
5
|
import { useControllableState as O } from "./index.es383.js";
|
6
|
-
import { usePrevious as A } from "./index.
|
7
|
-
import { useSize as B } from "./index.
|
8
|
-
import { Presence as H } from "./index.
|
6
|
+
import { usePrevious as A } from "./index.es387.js";
|
7
|
+
import { useSize as B } from "./index.es388.js";
|
8
|
+
import { Presence as H } from "./index.es389.js";
|
9
9
|
import { Primitive as j } from "./index.es384.js";
|
10
10
|
import { j as f } from "./index.es209.js";
|
11
11
|
var R = "Checkbox", [K, Y] = M(R), [L, q] = K(R), I = n.forwardRef(
|
package/dist/index.es261.js
CHANGED
package/dist/index.es267.js
CHANGED
@@ -4,15 +4,15 @@ import { useComposedRefs as C } from "./index.es381.js";
|
|
4
4
|
import { createContextScope as B, createContext as H } from "./index.es382.js";
|
5
5
|
import { useId as x } from "./index.es386.js";
|
6
6
|
import { useControllableState as V } from "./index.es383.js";
|
7
|
-
import { DismissableLayer as q } from "./index.
|
8
|
-
import { FocusScope as K } from "./index.
|
9
|
-
import { Portal as U } from "./index.
|
10
|
-
import { Presence as R } from "./index.
|
7
|
+
import { DismissableLayer as q } from "./index.es394.js";
|
8
|
+
import { FocusScope as K } from "./index.es395.js";
|
9
|
+
import { Portal as U } from "./index.es396.js";
|
10
|
+
import { Presence as R } from "./index.es389.js";
|
11
11
|
import { Primitive as m } from "./index.es384.js";
|
12
|
-
import { useFocusGuards as Y } from "./index.
|
13
|
-
import Z from "./index.
|
14
|
-
import { hideOthers as z } from "./index.
|
15
|
-
import { createSlot as J } from "./index.
|
12
|
+
import { useFocusGuards as Y } from "./index.es397.js";
|
13
|
+
import Z from "./index.es398.js";
|
14
|
+
import { hideOthers as z } from "./index.es399.js";
|
15
|
+
import { createSlot as J } from "./index.es400.js";
|
16
16
|
import { j as i } from "./index.es209.js";
|
17
17
|
var _ = "Dialog", [N, he] = B(_), [Q, u] = N(_), P = (e) => {
|
18
18
|
const {
|
package/dist/index.es294.js
CHANGED
@@ -3,8 +3,8 @@ import { composeEventHandlers as T } from "./index.es380.js";
|
|
3
3
|
import { useComposedRefs as _ } from "./index.es381.js";
|
4
4
|
import { createContextScope as H } from "./index.es382.js";
|
5
5
|
import { useControllableState as I } from "./index.es383.js";
|
6
|
-
import { usePrevious as M } from "./index.
|
7
|
-
import { useSize as N } from "./index.
|
6
|
+
import { usePrevious as M } from "./index.es387.js";
|
7
|
+
import { useSize as N } from "./index.es388.js";
|
8
8
|
import { Primitive as w } from "./index.es384.js";
|
9
9
|
import { j as p } from "./index.es209.js";
|
10
10
|
var S = "Switch", [B, J] = H(S), [q, z] = B(S), C = s.forwardRef(
|
package/dist/index.es33.js
CHANGED
package/dist/index.es33.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.es33.js","sources":["../src/components/ui/TabsGlossary/index.tsx"],"sourcesContent":["import \"./TabsGlossary.scss\";\nimport clsx from \"clsx\";\nimport React, { PropsWithChildren, ReactNode, useState } from \"react\";\nimport { Loader, Row } from \"@/components\";\n\ntype TabItem = {\n label: string;\n disabled?: boolean;\n};\n\ntype ActionItem = PropsWithChildren<{\n label: string;\n icon: ReactNode;\n onClick: () => void;\n loading?: boolean;\n}>;\n\ntype TabsGlossaryProps = {\n CTA?: \"link\" | \"primary\";\n navigationItems: TabItem[];\n activeIndex: number;\n onTabChange: (index: number) => void;\n actions?: ActionItem[];\n children?: ReactNode;\n // onDownload?: () => void;\n // onAdd?: () => void;\n // downloadAllLabel?: string;\n // addDocumentLabel?: string;\n // actionType?: \"download\" | \"add\" | null;\n};\n\nexport const TabsGlossary = ({\n CTA = \"link\",\n navigationItems,\n children,\n activeIndex = 0,\n onTabChange,\n actions = [],\n // onDownload,\n // onAdd,\n // downloadAllLabel = \"Scarica tutti\",\n // addDocumentLabel = \"Aggiungi documento\",\n // actionType,\n}: TabsGlossaryProps) => {\n const [active, setActive] = useState(activeIndex);\n\n // const isDownloading = loading && actionType === \"download\";\n // const isAdding = loading && actionType === \"add\";\n\n return (\n <div>\n <div className={clsx(\"ui-document-container-tabs\")}>\n <nav\n className={\"ui-document-container-tabs-nav-new\"}\n aria-label=\"Menu di navigazione\"\n >\n <Row\n gap={\"x20\"}\n fw={\"semibold\"}\n text={\"secondary\"}\n className={clsx(\n \"ui-document-container-tabs-nav list-style-none ui-tabs\",\n )}\n >\n {navigationItems.map((item, index) => {\n return (\n <li\n key={index}\n className={clsx(\n \"ui-document-container-tabs-nav-responsive-flex\",\n !item.disabled ? \"cursor-pointer\" : \"text-muted\",\n \"ui-tab\",\n active === index && \"text-primary ui-active-tab-glossary \",\n )}\n onClick={() => {\n if (!item.disabled) {\n setActive(index);\n onTabChange(index);\n }\n }}\n >\n <a className={\"text-decoration-none\"}>{item.label}</a>\n </li>\n );\n })}\n </Row>\n </nav>\n {children}\n {CTA === \"link\" && (\n <nav className={\"ui-document-container-tabs-nav-new\"}>\n <ul className=\"list-style-none base-row gap-x20 fw-semibold text-primary fs-8 pb-x8\">\n {actions.map((action, index) => (\n <React.Fragment key={index}>\n <li\n className={clsx(\n !action.loading && \"cursor-pointer\",\n \"text-primary base-row justify-content-center align-items-center gap-x8\",\n )}\n onClick={() => !action.loading && action.onClick()}\n >\n {action.icon}\n <p>{action.label}</p>\n {action.loading && <Loader loading={action.loading} />}\n </li>\n {index < actions.length - 1 && (\n <li>\n <span className=\"ui-divider\"></span>\n </li>\n )}\n </React.Fragment>\n ))}\n </ul>\n </nav>\n )}\n </div>\n </div>\n );\n};\n"],"names":["TabsGlossary","CTA","navigationItems","children","activeIndex","onTabChange","actions","active","setActive","useState","jsxs","clsx","jsx","Row","item","index","action","React","Loader"],"mappings":";;;;;;AA+BO,MAAMA,IAAe,CAAC;AAAA,EAC3B,KAAAC,IAAM;AAAA,EACN,iBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,aAAAC;AAAA,EACA,SAAAC,IAAU,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMZ,MAAyB;AACvB,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAASL,CAAW;AAKhD,+BACG,OACC,EAAA,UAAAM,gBAAAA,EAAA,KAAC,SAAI,WAAWC,EAAK,4BAA4B,GAC/C,UAAA;AAAA,IAAAC,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW;AAAA,QACX,cAAW;AAAA,QAEX,UAAAA,gBAAAA,EAAA;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,KAAK;AAAA,YACL,IAAI;AAAA,YACJ,MAAM;AAAA,YACN,WAAWF;AAAA,cACT;AAAA,YACF;AAAA,
|
1
|
+
{"version":3,"file":"index.es33.js","sources":["../src/components/ui/TabsGlossary/index.tsx"],"sourcesContent":["import \"./TabsGlossary.scss\";\nimport clsx from \"clsx\";\nimport React, { PropsWithChildren, ReactNode, useState } from \"react\";\nimport { Loader, Row } from \"@/components\";\n\ntype TabItem = {\n label: string;\n disabled?: boolean;\n};\n\ntype ActionItem = PropsWithChildren<{\n label: string;\n icon: ReactNode;\n onClick: () => void;\n loading?: boolean;\n}>;\n\ntype TabsGlossaryProps = {\n CTA?: \"link\" | \"primary\";\n navigationItems: TabItem[];\n activeIndex: number;\n onTabChange: (index: number) => void;\n actions?: ActionItem[];\n children?: ReactNode;\n // onDownload?: () => void;\n // onAdd?: () => void;\n // downloadAllLabel?: string;\n // addDocumentLabel?: string;\n // actionType?: \"download\" | \"add\" | null;\n};\n\nexport const TabsGlossary = ({\n CTA = \"link\",\n navigationItems,\n children,\n activeIndex = 0,\n onTabChange,\n actions = [],\n // onDownload,\n // onAdd,\n // downloadAllLabel = \"Scarica tutti\",\n // addDocumentLabel = \"Aggiungi documento\",\n // actionType,\n}: TabsGlossaryProps) => {\n const [active, setActive] = useState(activeIndex);\n\n // const isDownloading = loading && actionType === \"download\";\n // const isAdding = loading && actionType === \"add\";\n\n return (\n <div>\n <div className={clsx(\"ui-document-container-tabs\")}>\n <nav\n className={\"ui-document-container-tabs-nav-new\"}\n aria-label=\"Menu di navigazione\"\n >\n <Row\n gap={\"x20\"}\n fw={\"semibold\"}\n text={\"secondary\"}\n className={clsx(\n \"ui-document-container-tabs-nav list-style-none ui-tabs\",\n )}\n as=\"ul\"\n >\n {navigationItems.map((item, index) => {\n return (\n <li\n key={index}\n className={clsx(\n \"ui-document-container-tabs-nav-responsive-flex\",\n !item.disabled ? \"cursor-pointer\" : \"text-muted\",\n \"ui-tab\",\n active === index && \"text-primary ui-active-tab-glossary \",\n )}\n onClick={() => {\n if (!item.disabled) {\n setActive(index);\n onTabChange(index);\n }\n }}\n >\n <a className={\"text-decoration-none\"}>{item.label}</a>\n </li>\n );\n })}\n </Row>\n </nav>\n {children}\n {CTA === \"link\" && (\n <nav className={\"ui-document-container-tabs-nav-new\"}>\n <ul className=\"list-style-none base-row gap-x20 fw-semibold text-primary fs-8 pb-x8\">\n {actions.map((action, index) => (\n <React.Fragment key={index}>\n <li\n className={clsx(\n !action.loading && \"cursor-pointer\",\n \"text-primary base-row justify-content-center align-items-center gap-x8\",\n )}\n onClick={() => !action.loading && action.onClick()}\n >\n {action.icon}\n <p>{action.label}</p>\n {action.loading && <Loader loading={action.loading} />}\n </li>\n {index < actions.length - 1 && (\n <li>\n <span className=\"ui-divider\"></span>\n </li>\n )}\n </React.Fragment>\n ))}\n </ul>\n </nav>\n )}\n </div>\n </div>\n );\n};\n"],"names":["TabsGlossary","CTA","navigationItems","children","activeIndex","onTabChange","actions","active","setActive","useState","jsxs","clsx","jsx","Row","item","index","action","React","Loader"],"mappings":";;;;;;AA+BO,MAAMA,IAAe,CAAC;AAAA,EAC3B,KAAAC,IAAM;AAAA,EACN,iBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,aAAAC;AAAA,EACA,SAAAC,IAAU,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMZ,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O,WAAWA,EAAO,QAAQ;AAAA,UAEhD,UAAA;AAAA,YAAOA,EAAA;AAAA,YACRJ,gBAAAA,EAAAA,IAAC,KAAG,EAAA,UAAAI,EAAO,MAAM,CAAA;AAAA,YAChBA,EAAO,WAAWJ,gBAAAA,MAACM,GAAO,EAAA,SAASF,EAAO,QAAS,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACtD;AAAA,MACCD,IAAQT,EAAQ,SAAS,KACxBM,gBAAAA,EAAA,IAAC,QACC,UAACA,gBAAAA,EAAA,IAAA,QAAA,EAAK,WAAU,aAAa,CAAA,EAC/B,CAAA;AAAA,IAAA,KAfiBG,CAiBrB,CACD,EAAA,CACH,EACF,CAAA;AAAA,EAAA,EAAA,CAEJ,EACF,CAAA;AAEJ;"}
|
package/dist/index.es333.js
CHANGED
@@ -3,7 +3,7 @@ import { createContextScope as T } from "./index.es382.js";
|
|
3
3
|
import { useComposedRefs as A } from "./index.es381.js";
|
4
4
|
import { createDialogScope as v, Root as O, Portal as j, Overlay as b, WarningProvider as w, Content as M, Title as I, Description as L, Close as f, Trigger as $ } from "./index.es267.js";
|
5
5
|
import { composeEventHandlers as F } from "./index.es380.js";
|
6
|
-
import { createSlottable as G } from "./index.
|
6
|
+
import { createSlottable as G } from "./index.es400.js";
|
7
7
|
import { j as i } from "./index.es209.js";
|
8
8
|
var D = "AlertDialog", [W, te] = T(D, [
|
9
9
|
v
|
package/dist/index.es35.js
CHANGED
@@ -48,11 +48,11 @@ const v = {
|
|
48
48
|
btnText: t = "Trascrizione",
|
49
49
|
sizeComp: l = "large",
|
50
50
|
transcription: o,
|
51
|
-
previewImageSrc:
|
52
|
-
videoSrc:
|
51
|
+
previewImageSrc: x,
|
52
|
+
videoSrc: c
|
53
53
|
}) => {
|
54
|
-
const [a, n] = r(!1), [
|
55
|
-
|
54
|
+
const [a, n] = r(!1), [d, m] = r(!1), { width: h } = v[l], { heightImg: p } = b[l], [s, u] = r(!1), g = () => {
|
55
|
+
d ? n(!a) : (m(!0), n(!0));
|
56
56
|
};
|
57
57
|
return /* @__PURE__ */ e.jsxs(
|
58
58
|
w,
|
@@ -71,9 +71,9 @@ const v = {
|
|
71
71
|
/* @__PURE__ */ e.jsx(
|
72
72
|
"div",
|
73
73
|
{
|
74
|
-
className: i("start-video-container", { "fade-out": a ||
|
74
|
+
className: i("start-video-container", { "fade-out": a || d }),
|
75
75
|
style: {
|
76
|
-
backgroundImage: `url(${
|
76
|
+
backgroundImage: `url(${x})`,
|
77
77
|
backgroundSize: "cover",
|
78
78
|
backgroundPosition: "center",
|
79
79
|
backgroundRepeat: "no-repeat",
|
@@ -95,7 +95,7 @@ const v = {
|
|
95
95
|
"video",
|
96
96
|
{
|
97
97
|
controls: !0,
|
98
|
-
src:
|
98
|
+
src: c !== "" ? c : void 0,
|
99
99
|
autoPlay: a,
|
100
100
|
onEnded: () => n(!1)
|
101
101
|
}
|
package/dist/index.es35.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.es35.js","sources":["../src/components/ui/VideoPlayer/index.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport \"./VideoPlayer.scss\";\nimport { ArrowDown } from \"@/icons/ArrowDown\";\nimport { useState } from \"react\";\nimport { Col } from \"@/components\";\nimport { PlayVideo } from \"@/icons\";\n\nexport enum VIDEO_PLAYER_SIZE {\n SMALL = \"small\",\n MEDIUM = \"medium\",\n LARGE = \"large\",\n EXTRA_LARGE = \"extra-large\",\n VERTICAL = \"vertical\",\n FULL_WIDTH = \"full-width\",\n}\n\nconst sizeStyles = {\n [VIDEO_PLAYER_SIZE.SMALL]: {\n width: \"311px\",\n },\n [VIDEO_PLAYER_SIZE.MEDIUM]: {\n width: \"388px\",\n },\n [VIDEO_PLAYER_SIZE.LARGE]: {\n width: \"666px\",\n },\n [VIDEO_PLAYER_SIZE.VERTICAL]: { \n width: \"360px\",\n },\n [VIDEO_PLAYER_SIZE.EXTRA_LARGE]: {\n width: \"100dvw\",\n },\n [VIDEO_PLAYER_SIZE.FULL_WIDTH]: {\n width: \"100%\",\n },\n};\n\nconst imgSize = {\n [VIDEO_PLAYER_SIZE.SMALL]: {\n heightImg: \"170px\",\n },\n [VIDEO_PLAYER_SIZE.MEDIUM]: {\n heightImg: \"183px\",\n },\n [VIDEO_PLAYER_SIZE.LARGE]: {\n heightImg: \"371px\",\n },\n [VIDEO_PLAYER_SIZE.EXTRA_LARGE]: {\n heightImg: \"400px\",\n },\n [VIDEO_PLAYER_SIZE.VERTICAL]: {\n heightImg: \"640px\",\n },\n [VIDEO_PLAYER_SIZE.FULL_WIDTH]: {\n heightImg: \"525px\",\n },\n};\n\ntype VideoPlayerProps = {\n btnText: string;\n sizeComp?: VIDEO_PLAYER_SIZE;\n previewImageSrc?: string;\n transcription: string;\n videoSrc: string;\n};\n\nexport const VideoPlayer = ({\n btnText = \"Trascrizione\",\n sizeComp = VIDEO_PLAYER_SIZE.LARGE,\n transcription,\n previewImageSrc,\n videoSrc,\n}: VideoPlayerProps) => {\n const [isPlaying, setIsPlaying] = useState(false);\n const [hasPlayedOnce, setHasPlayedOnce] = useState(false);\n const { width } = sizeStyles[sizeComp];\n const { heightImg } = imgSize[sizeComp];\n const [isExpanded, setExpanded] = useState(false);\n\n const handlePlay = () => {\n if (!hasPlayedOnce) {\n setHasPlayedOnce(true);\n setIsPlaying(true);\n } else {\n setIsPlaying(!isPlaying);\n }\n };\n\n return (\n <Col\n br={\"x4\"}\n style={{ width: width }}\n className={clsx(\"shadow\", isExpanded && \"ui-expanded\", \"video-section-container\")}\n >\n <div \n className=\"video-player-container\" \n style={{ height: heightImg }}\n onClick={handlePlay}\n >\n <div\n className={clsx(\"start-video-container\", { \"fade-out\": isPlaying || hasPlayedOnce })}\n style={{\n backgroundImage: `url(${previewImageSrc})`,\n backgroundSize: 'cover',\n backgroundPosition: 'center',\n backgroundRepeat: 'no-repeat',\n pointerEvents: 'none'\n }}\n >\n <div\n className={clsx(\"play-button-container\", { [\"hidden\"]: isPlaying })}\n >\n <div className=\"play-button-icon\">\n <PlayVideo />\n </div>\n <div className=\"play-button-text\">\n Riproduci\n </div>\n </div>\n </div>\n <div className=\"video-container\">\n <video\n controls\n src={videoSrc} \n autoPlay={isPlaying} \n onEnded={() => setIsPlaying(false)}\n />\n </div>\n </div>\n\n {transcription && (\n <div className=\"transcription-container\">\n <div\n className={clsx(\n \"expand-button-container\",\n \"accordion\",\n \"base-row justify-content-between align-items-center px-x24 w-full flex-1\",\n )}\n >\n <button\n className={clsx(\n \"ui-btn-accordion\",\n \"base-row justify-content-between align-items-center\",\n )}\n type=\"button\"\n onClick={() => setExpanded(!isExpanded)}\n >\n <span\n className={clsx(\n \"fw-semibold text-primary base-col justify-content-center\",\n )}\n >\n {btnText}\n </span>\n <ArrowDown\n color={\"primary\"}\n className={clsx(\"ui-arrow\", { [\"expanded\"]: isExpanded })}\n />\n </button>\n </div>\n {isExpanded && (\n <div\n className={clsx(\n \"transcription-text-container\",\n \"pt-x8 px-x24 pb-x40 fs-6 fw-regular text-grey-black\",\n )}\n >\n <p>\n {transcription}\n </p>\n </div>\n )}\n </div>\n )}\n </Col>\n );\n};"],"names":["VIDEO_PLAYER_SIZE","sizeStyles","imgSize","VideoPlayer","btnText","sizeComp","transcription","previewImageSrc","videoSrc","isPlaying","setIsPlaying","useState","hasPlayedOnce","setHasPlayedOnce","width","heightImg","isExpanded","setExpanded","handlePlay","jsxs","Col","clsx","jsx","PlayVideo","ArrowDown"],"mappings":";;;;;;;AAOY,IAAAA,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACTA,EAAA,QAAQ,SACRA,EAAA,cAAc,eACdA,EAAA,WAAW,YACXA,EAAA,aAAa,cANHA,IAAAA,KAAA,CAAA,CAAA;AASZ,MAAMC,IAAa;AAAA,EAChB,OAA0B;AAAA,IACzB,OAAO;AAAA,EACT;AAAA,EACC,QAA2B;AAAA,IAC1B,OAAO;AAAA,EACT;AAAA,EACC,OAA0B;AAAA,IACzB,OAA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QJ,EAAU;AAAA,YAC3B,SAASG;AAAA,YAET,UAAA;AAAA,cAAAI,gBAAAA,EAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAWD,EAAK,yBAAyB,EAAE,YAAYZ,KAAaG,GAAe;AAAA,kBACnF,OAAO;AAAA,oBACL,iBAAiB,OAAOL,CAAe;AAAA,oBACvC,gBAAgB;AAAA,oBAChB,oBAAoB;AAAA,oBACpB,kBAAkB;AAAA,oBAClB,eAAe;AAAA,kBACjB;AAAA,kBAEA,UAAAY,gBAAAA,EAAA;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBACC,WAAWE,EAAK,yBAAyB,EAAG,QAAWZ,GAAW;AAAA,sBAElE,UAAA;AAAA,wBAAAa,gBAAAA,MAAC,OAAI,EAAA,WAAU,oBACb,UAAAA,gBAAAA,MAACC,IAAU,CAAA,GACb;AAAA,wBACCD,gBAAAA,EAAA,IAAA,OAAA,EAAI,WAAU,oBAAmB,UAElC,YAAA,CAAA;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACF;AAAA,cACF;AAAA,cACAA,gBAAAA,EAAAA,IAAC,OAAI,EAAA,WAAU,mBACb,UAAAA,gBAAAA,EAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,UAAQ;AAAA,kBACR,KAAKd;AAAA,
|
1
|
+
{"version":3,"file":"index.es35.js","sources":["../src/components/ui/VideoPlayer/index.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport \"./VideoPlayer.scss\";\nimport { ArrowDown } from \"@/icons/ArrowDown\";\nimport { useState } from \"react\";\nimport { Col } from \"@/components\";\nimport { PlayVideo } from \"@/icons\";\n\nexport enum VIDEO_PLAYER_SIZE {\n SMALL = \"small\",\n MEDIUM = \"medium\",\n LARGE = \"large\",\n EXTRA_LARGE = \"extra-large\",\n VERTICAL = \"vertical\",\n FULL_WIDTH = \"full-width\",\n}\n\nconst sizeStyles = {\n [VIDEO_PLAYER_SIZE.SMALL]: {\n width: \"311px\",\n },\n [VIDEO_PLAYER_SIZE.MEDIUM]: {\n width: \"388px\",\n },\n [VIDEO_PLAYER_SIZE.LARGE]: {\n width: \"666px\",\n },\n [VIDEO_PLAYER_SIZE.VERTICAL]: { \n width: \"360px\",\n },\n [VIDEO_PLAYER_SIZE.EXTRA_LARGE]: {\n width: \"100dvw\",\n },\n [VIDEO_PLAYER_SIZE.FULL_WIDTH]: {\n width: \"100%\",\n },\n};\n\nconst imgSize = {\n [VIDEO_PLAYER_SIZE.SMALL]: {\n heightImg: \"170px\",\n },\n [VIDEO_PLAYER_SIZE.MEDIUM]: {\n heightImg: \"183px\",\n },\n [VIDEO_PLAYER_SIZE.LARGE]: {\n heightImg: \"371px\",\n },\n [VIDEO_PLAYER_SIZE.EXTRA_LARGE]: {\n heightImg: \"400px\",\n },\n [VIDEO_PLAYER_SIZE.VERTICAL]: {\n heightImg: \"640px\",\n },\n [VIDEO_PLAYER_SIZE.FULL_WIDTH]: {\n heightImg: \"525px\",\n },\n};\n\ntype VideoPlayerProps = {\n btnText: string;\n sizeComp?: VIDEO_PLAYER_SIZE;\n previewImageSrc?: string;\n transcription: string;\n videoSrc: string;\n};\n\nexport const VideoPlayer = ({\n btnText = \"Trascrizione\",\n sizeComp = VIDEO_PLAYER_SIZE.LARGE,\n transcription,\n previewImageSrc,\n videoSrc,\n}: VideoPlayerProps) => {\n const [isPlaying, setIsPlaying] = useState(false);\n const [hasPlayedOnce, setHasPlayedOnce] = useState(false);\n const { width } = sizeStyles[sizeComp];\n const { heightImg } = imgSize[sizeComp];\n const [isExpanded, setExpanded] = useState(false);\n\n const handlePlay = () => {\n if (!hasPlayedOnce) {\n setHasPlayedOnce(true);\n setIsPlaying(true);\n } else {\n setIsPlaying(!isPlaying);\n }\n };\n\n return (\n <Col\n br={\"x4\"}\n style={{ width: width }}\n className={clsx(\"shadow\", isExpanded && \"ui-expanded\", \"video-section-container\")}\n >\n <div \n className=\"video-player-container\" \n style={{ height: heightImg }}\n onClick={handlePlay}\n >\n <div\n className={clsx(\"start-video-container\", { \"fade-out\": isPlaying || hasPlayedOnce })}\n style={{\n backgroundImage: `url(${previewImageSrc})`,\n backgroundSize: 'cover',\n backgroundPosition: 'center',\n backgroundRepeat: 'no-repeat',\n pointerEvents: 'none'\n }}\n >\n <div\n className={clsx(\"play-button-container\", { [\"hidden\"]: isPlaying })}\n >\n <div className=\"play-button-icon\">\n <PlayVideo />\n </div>\n <div className=\"play-button-text\">\n Riproduci\n </div>\n </div>\n </div>\n <div className=\"video-container\">\n <video\n controls\n src={videoSrc !== \"\" ? videoSrc : undefined} \n autoPlay={isPlaying} \n onEnded={() => setIsPlaying(false)}\n />\n </div>\n </div>\n\n {transcription && (\n <div className=\"transcription-container\">\n <div\n className={clsx(\n \"expand-button-container\",\n \"accordion\",\n \"base-row justify-content-between align-items-center px-x24 w-full flex-1\",\n )}\n >\n <button\n className={clsx(\n \"ui-btn-accordion\",\n \"base-row justify-content-between align-items-center\",\n )}\n type=\"button\"\n onClick={() => setExpanded(!isExpanded)}\n >\n <span\n className={clsx(\n \"fw-semibold text-primary base-col justify-content-center\",\n )}\n >\n {btnText}\n </span>\n <ArrowDown\n color={\"primary\"}\n className={clsx(\"ui-arrow\", { [\"expanded\"]: isExpanded })}\n />\n </button>\n </div>\n {isExpanded && (\n <div\n className={clsx(\n \"transcription-text-container\",\n \"pt-x8 px-x24 pb-x40 fs-6 fw-regular text-grey-black\",\n )}\n >\n <p>\n {transcription}\n </p>\n </div>\n )}\n </div>\n )}\n </Col>\n );\n};"],"names":["VIDEO_PLAYER_SIZE","sizeStyles","imgSize","VideoPlayer","btnText","sizeComp","transcription","previewImageSrc","videoSrc","isPlaying","setIsPlaying","useState","hasPlayedOnce","setHasPlayedOnce","width","heightImg","isExpanded","setExpanded","handlePlay","jsxs","Col","clsx","jsx","PlayVideo","ArrowDown"],"mappings":";;;;;;;AAOY,IAAAA,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,SAAS,UACT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ECJ,KACCa,gBAAAA,EAAA,KAAC,OAAI,EAAA,WAAU,2BACb,UAAA;AAAA,UAAAG,gBAAAA,EAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACD,WAAWD;AAAA,gBACT;AAAA,gBACA;AAAA,gBACA;AAAA,cACF;AAAA,cAEA,UAAAF,gBAAAA,EAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAWE;AAAA,oBACT;AAAA,oBACA;AAAA,kBACF;AAAA,kBACA,MAAK;AAAA,kBACL,SAAS,MAAMJ,EAAY,CAACD,CAAU;AAAA,kBAEtC,UAAA;AAAA,oBAAAM,gBAAAA,EAAA;AAAA,sBAAC;AAAA,sBAAA;AAAA,wBACC,WAAWD;AAAA,0BACT;AAAA,wBACF;AAAA,wBAEC,UAAAjB;AAAA,sBAAA;AAAA,oBACH;AAAA,oBACAkB,gBAAAA,EAAA;AAAA,sBAACE;AAAA,sBAAA;AAAA,wBACC,OAAO;AAAA,wBACP,WAAWH,EAAK,YAAY,EAAG,UAAaL,EAAY,CAAA;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBAC1D;AAAA,gBAAA;AAAA,cAAA;AAAA,YACF;AAAA,UACF;AAAA,UACCA,KACCM,gBAAAA,EAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWD;AAAA,gBACT;AAAA,gBACA;AAAA,cACF;AAAA,cAEA,UAAAC,gBAAAA,EAAAA,IAAC,OACE,UACHhB,EAAA,CAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAEJ,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAEF;AAEJ;"}
|
package/dist/index.es372.js
CHANGED
package/dist/index.es373.js
CHANGED
package/dist/index.es383.js
CHANGED
package/dist/index.es384.js
CHANGED
package/dist/index.es385.js
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
import * as r from "react";
|
2
2
|
import { composeEventHandlers as M } from "./index.es380.js";
|
3
|
-
import { createCollection as Xe } from "./index.
|
3
|
+
import { createCollection as Xe } from "./index.es419.js";
|
4
4
|
import { useComposedRefs as k, composeRefs as He } from "./index.es381.js";
|
5
5
|
import { createContextScope as We } from "./index.es382.js";
|
6
|
-
import { useDirection as ze } from "./index.
|
7
|
-
import { DismissableLayer as Ze } from "./index.
|
8
|
-
import { useFocusGuards as $e } from "./index.
|
9
|
-
import { FocusScope as qe } from "./index.
|
10
|
-
import { createPopperScope as pe, Root as Je, Anchor as Qe, Content as et, Arrow as tt } from "./index.
|
11
|
-
import { Portal as nt } from "./index.
|
12
|
-
import { Presence as H } from "./index.
|
6
|
+
import { useDirection as ze } from "./index.es420.js";
|
7
|
+
import { DismissableLayer as Ze } from "./index.es394.js";
|
8
|
+
import { useFocusGuards as $e } from "./index.es397.js";
|
9
|
+
import { FocusScope as qe } from "./index.es395.js";
|
10
|
+
import { createPopperScope as pe, Root as Je, Anchor as Qe, Content as et, Arrow as tt } from "./index.es421.js";
|
11
|
+
import { Portal as nt } from "./index.es396.js";
|
12
|
+
import { Presence as H } from "./index.es389.js";
|
13
13
|
import { Primitive as N, dispatchDiscreteCustomEvent as ot } from "./index.es384.js";
|
14
|
-
import { createRovingFocusGroupScope as ve, Item as rt, Root as ct } from "./index.
|
15
|
-
import { createSlot as st } from "./index.
|
16
|
-
import { useCallbackRef as Me } from "./index.
|
17
|
-
import { hideOthers as at } from "./index.
|
18
|
-
import ut from "./index.
|
14
|
+
import { createRovingFocusGroupScope as ve, Item as rt, Root as ct } from "./index.es422.js";
|
15
|
+
import { createSlot as st } from "./index.es400.js";
|
16
|
+
import { useCallbackRef as Me } from "./index.es418.js";
|
17
|
+
import { hideOthers as at } from "./index.es399.js";
|
18
|
+
import ut from "./index.es398.js";
|
19
19
|
import { j as u } from "./index.es209.js";
|
20
20
|
var Q = ["Enter", " "], it = ["ArrowDown", "PageUp", "Home"], he = ["ArrowUp", "PageDown", "End"], lt = [...it, ...he], dt = {
|
21
21
|
ltr: [...Q, "ArrowRight"],
|
package/dist/index.es386.js
CHANGED
package/dist/index.es387.js
CHANGED
@@ -1,18 +1,9 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
7
|
-
), c = o[0], r = o[o.length - 1], s = (e) => {
|
8
|
-
e.key === "Tab" && (e.shiftKey ? document.activeElement === c && (r.focus(), e.preventDefault()) : document.activeElement === r && (c.focus(), e.preventDefault()));
|
9
|
-
}, u = document.activeElement;
|
10
|
-
return c.focus(), document.addEventListener("keydown", s), () => {
|
11
|
-
document.removeEventListener("keydown", s), n && (u == null || u.focus());
|
12
|
-
};
|
13
|
-
}, [n, t]);
|
14
|
-
};
|
1
|
+
import * as u from "react";
|
2
|
+
function t(r) {
|
3
|
+
const e = u.useRef({ value: r, previous: r });
|
4
|
+
return u.useMemo(() => (e.current.value !== r && (e.current.previous = e.current.value, e.current.value = r), e.current.previous), [r]);
|
5
|
+
}
|
15
6
|
export {
|
16
|
-
|
7
|
+
t as usePrevious
|
17
8
|
};
|
18
9
|
//# sourceMappingURL=index.es387.js.map
|
package/dist/index.es387.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.es387.js","sources":["../
|
1
|
+
{"version":3,"file":"index.es387.js","sources":["../node_modules/@radix-ui/react-use-previous/dist/index.mjs"],"sourcesContent":["// packages/react/use-previous/src/use-previous.tsx\nimport * as React from \"react\";\nfunction usePrevious(value) {\n const ref = React.useRef({ value, previous: value });\n return React.useMemo(() => {\n if (ref.current.value !== value) {\n ref.current.previous = ref.current.value;\n ref.current.value = value;\n }\n return ref.current.previous;\n }, [value]);\n}\nexport {\n usePrevious\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["usePrevious","value","ref","React"],"mappings":";AAEA,SAASA,EAAYC,GAAO;AAC1B,QAAMC,IAAMC,EAAM,OAAO,EAAE,OAAAF,GAAO,UAAUA,GAAO;AACnD,SAAOE,EAAM,QAAQ,OACfD,EAAI,QAAQ,UAAUD,MACxBC,EAAI,QAAQ,WAAWA,EAAI,QAAQ,OACnCA,EAAI,QAAQ,QAAQD,IAEfC,EAAI,QAAQ,WAClB,CAACD,CAAK,CAAC;AACZ;","x_google_ignoreList":[0]}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as h from "react";
|
2
|
-
import { useLayoutEffect as z } from "./index.
|
2
|
+
import { useLayoutEffect as z } from "./index.es423.js";
|
3
3
|
function c(r) {
|
4
4
|
const [d, e] = h.useState(void 0);
|
5
5
|
return z(() => {
|
@@ -25,4 +25,4 @@ function c(r) {
|
|
25
25
|
export {
|
26
26
|
c as useSize
|
27
27
|
};
|
28
|
-
//# sourceMappingURL=index.
|
28
|
+
//# sourceMappingURL=index.es388.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.
|
1
|
+
{"version":3,"file":"index.es388.js","sources":["../node_modules/@radix-ui/react-use-size/dist/index.mjs"],"sourcesContent":["// packages/react/use-size/src/use-size.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nfunction useSize(element) {\n const [size, setSize] = React.useState(void 0);\n useLayoutEffect(() => {\n if (element) {\n setSize({ width: element.offsetWidth, height: element.offsetHeight });\n const resizeObserver = new ResizeObserver((entries) => {\n if (!Array.isArray(entries)) {\n return;\n }\n if (!entries.length) {\n return;\n }\n const entry = entries[0];\n let width;\n let height;\n if (\"borderBoxSize\" in entry) {\n const borderSizeEntry = entry[\"borderBoxSize\"];\n const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;\n width = borderSize[\"inlineSize\"];\n height = borderSize[\"blockSize\"];\n } else {\n width = element.offsetWidth;\n height = element.offsetHeight;\n }\n setSize({ width, height });\n });\n resizeObserver.observe(element, { box: \"border-box\" });\n return () => resizeObserver.unobserve(element);\n } else {\n setSize(void 0);\n }\n }, [element]);\n return size;\n}\nexport {\n useSize\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useSize","element","size","setSize","React","useLayoutEffect","resizeObserver","entries","entry","width","height","borderSizeEntry","borderSize"],"mappings":";;AAGA,SAASA,EAAQC,GAAS;AACxB,QAAM,CAACC,GAAMC,CAAO,IAAIC,EAAM,SAAS,MAAM;AAC7CC,SAAAA,EAAgB,MAAM;AACpB,QAAIJ,GAAS;AACX,MAAAE,EAAQ,EAAE,OAAOF,EAAQ,aAAa,QAAQA,EAAQ,cAAc;AACpE,YAAMK,IAAiB,IAAI,eAAe,CAACC,MAAY;AAIrD,YAHI,CAAC,MAAM,QAAQA,CAAO,KAGtB,CAACA,EAAQ;AACX;AAEF,cAAMC,IAAQD,EAAQ,CAAC;AACvB,YAAIE,GACAC;AACJ,YAAI,mBAAmBF,GAAO;AAC5B,gBAAMG,IAAkBH,EAAM,eACxBI,IAAa,MAAM,QAAQD,CAAe,IAAIA,EAAgB,CAAC,IAAIA;AACzE,UAAAF,IAAQG,EAAW,YACnBF,IAASE,EAAW;AAAA,QAC9B;AACU,UAAAH,IAAQR,EAAQ,aAChBS,IAAST,EAAQ;AAEnB,QAAAE,EAAQ,EAAE,OAAAM,GAAO,QAAAC,GAAQ;AAAA,MACjC,CAAO;AACD,aAAAJ,EAAe,QAAQL,GAAS,EAAE,KAAK,aAAY,CAAE,GAC9C,MAAMK,EAAe,UAAUL,CAAO;AAAA,IACnD;AACM,MAAAE,EAAQ,MAAM;AAAA,EAEpB,GAAK,CAACF,CAAO,CAAC,GACLC;AACT;","x_google_ignoreList":[0]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as a from "react";
|
2
2
|
import { useComposedRefs as E } from "./index.es381.js";
|
3
|
-
import { useLayoutEffect as A } from "./index.
|
3
|
+
import { useLayoutEffect as A } from "./index.es423.js";
|
4
4
|
function T(n, e) {
|
5
5
|
return a.useReducer((r, t) => e[r][t] ?? r, n);
|
6
6
|
}
|
@@ -69,4 +69,4 @@ function P(n) {
|
|
69
69
|
export {
|
70
70
|
R as Presence
|
71
71
|
};
|
72
|
-
//# sourceMappingURL=index.
|
72
|
+
//# sourceMappingURL=index.es389.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.
|
1
|
+
{"version":3,"file":"index.es389.js","sources":["../node_modules/@radix-ui/react-presence/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/presence/src/presence.tsx\nimport * as React2 from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\n\n// packages/react/presence/src/use-state-machine.tsx\nimport * as React from \"react\";\nfunction useStateMachine(initialState, machine) {\n return React.useReducer((state, event) => {\n const nextState = machine[state][event];\n return nextState ?? state;\n }, initialState);\n}\n\n// packages/react/presence/src/presence.tsx\nvar Presence = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n const child = typeof children === \"function\" ? children({ present: presence.isPresent }) : React2.Children.only(children);\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === \"function\";\n return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null;\n};\nPresence.displayName = \"Presence\";\nfunction usePresence(present) {\n const [node, setNode] = React2.useState();\n const stylesRef = React2.useRef({});\n const prevPresentRef = React2.useRef(present);\n const prevAnimationNameRef = React2.useRef(\"none\");\n const initialState = present ? \"mounted\" : \"unmounted\";\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: \"unmounted\",\n ANIMATION_OUT: \"unmountSuspended\"\n },\n unmountSuspended: {\n MOUNT: \"mounted\",\n ANIMATION_END: \"unmounted\"\n },\n unmounted: {\n MOUNT: \"mounted\"\n }\n });\n React2.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === \"mounted\" ? currentAnimationName : \"none\";\n }, [state]);\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n if (present) {\n send(\"MOUNT\");\n } else if (currentAnimationName === \"none\" || styles?.display === \"none\") {\n send(\"UNMOUNT\");\n } else {\n const isAnimating = prevAnimationName !== currentAnimationName;\n if (wasPresent && isAnimating) {\n send(\"ANIMATION_OUT\");\n } else {\n send(\"UNMOUNT\");\n }\n }\n prevPresentRef.current = present;\n }\n }, [present, send]);\n useLayoutEffect(() => {\n if (node) {\n let timeoutId;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n const handleAnimationEnd = (event) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(event.animationName);\n if (event.target === node && isCurrentAnimation) {\n send(\"ANIMATION_END\");\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = \"forwards\";\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === \"forwards\") {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event) => {\n if (event.target === node) {\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener(\"animationstart\", handleAnimationStart);\n node.addEventListener(\"animationcancel\", handleAnimationEnd);\n node.addEventListener(\"animationend\", handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener(\"animationstart\", handleAnimationStart);\n node.removeEventListener(\"animationcancel\", handleAnimationEnd);\n node.removeEventListener(\"animationend\", handleAnimationEnd);\n };\n } else {\n send(\"ANIMATION_END\");\n }\n }, [node, send]);\n return {\n isPresent: [\"mounted\", \"unmountSuspended\"].includes(state),\n ref: React2.useCallback((node2) => {\n if (node2) stylesRef.current = getComputedStyle(node2);\n setNode(node2);\n }, [])\n };\n}\nfunction getAnimationName(styles) {\n return styles?.animationName || \"none\";\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nvar Root = Presence;\nexport {\n Presence,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useStateMachine","initialState","machine","React","state","event","Presence","props","present","children","presence","usePresence","child","React2","ref","useComposedRefs","getElementRef","node","setNode","stylesRef","prevPresentRef","prevAnimationNameRef","send","currentAnimationName","getAnimationName","useLayoutEffect","styles","wasPresent","prevAnimationName","timeoutId","ownerWindow","handleAnimationEnd","isCurrentAnimation","currentFillMode","handleAnimationStart","node2","element","getter","_a","mayWarn","_b"],"mappings":";;;AASA,SAASA,EAAgBC,GAAcC,GAAS;AAC9C,SAAOC,EAAM,WAAW,CAACC,GAAOC,MACZH,EAAQE,CAAK,EAAEC,CAAK,KAClBD,GACnBH,CAAY;AACjB;AAGG,IAACK,IAAW,CAACC,MAAU;AACxB,QAAM,EAAE,SAAAC,GAAS,UAAAC,EAAQ,IAAKF,GACxBG,IAAWC,EAAYH,CAAO,GAC9BI,IAAQ,OAAOH,KAAa,aAAaA,EAAS,EAAE,SAASC,EAAS,UAAW,CAAA,IAAIG,EAAO,SAAS,KAAKJ,CAAQ,GAClHK,IAAMC,EAAgBL,EAAS,KAAKM,EAAcJ,CAAK,CAAC;AAE9D,SADmB,OAAOH,KAAa,cAClBC,EAAS,YAAYG,EAAO,aAAaD,GAAO,EAAE,KAAAE,EAAK,CAAA,IAAI;AAClF;AACAR,EAAS,cAAc;AACvB,SAASK,EAAYH,GAAS;AAC5B,QAAM,CAACS,GAAMC,CAAO,IAAIL,EAAO,SAAU,GACnCM,IAAYN,EAAO,OAAO,EAAE,GAC5BO,IAAiBP,EAAO,OAAOL,CAAO,GACtCa,IAAuBR,EAAO,OAAO,MAAM,GAC3CZ,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