@anoki/fse-ui 2.1.0-SNAPSHOT1.8 → 2.1.0-SNAPSHOT1.9
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.cjs323.js +1 -1
- package/dist/index.cjs330.js +1 -1
- package/dist/index.cjs402.js +1 -1
- package/dist/index.cjs429.js +1 -1
- package/dist/index.cjs429.js.map +1 -1
- package/dist/index.cjs453.js +1 -1
- package/dist/index.cjs453.js.map +1 -1
- package/dist/index.cjs476.js +1 -1
- package/dist/index.cjs477.js +1 -1
- package/dist/index.cjs485.js +2 -0
- package/dist/index.cjs485.js.map +1 -0
- package/dist/index.cjs486.js +2 -0
- package/dist/index.cjs486.js.map +1 -0
- package/dist/index.cjs487.js +2 -0
- package/dist/index.cjs487.js.map +1 -0
- package/dist/index.cjs488.js +1 -1
- package/dist/index.cjs488.js.map +1 -1
- package/dist/index.cjs489.js +1 -1
- package/dist/index.cjs489.js.map +1 -1
- package/dist/index.cjs490.js +1 -1
- package/dist/index.cjs490.js.map +1 -1
- package/dist/index.cjs491.js +1 -1
- package/dist/index.cjs491.js.map +1 -1
- package/dist/{index.cjs498.js → index.cjs500.js} +1 -1
- package/dist/{index.cjs498.js.map → index.cjs500.js.map} +1 -1
- package/dist/index.cjs534.js +1 -1
- package/dist/index.cjs621.js +1 -1
- package/dist/index.cjs626.js +1 -1
- package/dist/index.cjs630.js +1 -1
- package/dist/index.cjs631.js +1 -1
- package/dist/index.cjs643.js +1 -1
- package/dist/index.cjs668.js +1 -1
- package/dist/index.cjs669.js +1 -1
- package/dist/index.cjs677.js +1 -1
- package/dist/index.cjs677.js.map +1 -1
- package/dist/index.cjs678.js +1 -1
- package/dist/index.cjs678.js.map +1 -1
- package/dist/index.cjs679.js +1 -1
- package/dist/index.cjs679.js.map +1 -1
- package/dist/index.cjs680.js +1 -1
- package/dist/index.cjs680.js.map +1 -1
- package/dist/index.es323.js +1 -1
- package/dist/index.es330.js +7 -7
- package/dist/index.es402.js +1 -1
- package/dist/index.es429.js +12 -12
- package/dist/index.es429.js.map +1 -1
- package/dist/index.es453.js +177 -173
- package/dist/index.es453.js.map +1 -1
- package/dist/index.es476.js +1 -1
- package/dist/index.es477.js +7 -7
- package/dist/index.es485.js +128 -0
- package/dist/index.es485.js.map +1 -0
- package/dist/index.es486.js +138 -0
- package/dist/index.es486.js.map +1 -0
- package/dist/index.es487.js +17 -0
- package/dist/index.es487.js.map +1 -0
- package/dist/index.es488.js +12 -122
- package/dist/index.es488.js.map +1 -1
- package/dist/index.es489.js +8 -134
- package/dist/index.es489.js.map +1 -1
- package/dist/index.es490.js +50 -14
- package/dist/index.es490.js.map +1 -1
- package/dist/index.es491.js +54 -13
- package/dist/index.es491.js.map +1 -1
- package/dist/{index.es498.js → index.es500.js} +1 -1
- package/dist/{index.es498.js.map → index.es500.js.map} +1 -1
- package/dist/index.es534.js +1 -1
- package/dist/index.es621.js +1 -1
- package/dist/index.es626.js +1 -1
- package/dist/index.es630.js +1 -1
- package/dist/index.es631.js +7 -7
- package/dist/index.es643.js +2 -2
- package/dist/index.es668.js +1 -1
- package/dist/index.es669.js +1 -1
- package/dist/index.es677.js +21 -11
- package/dist/index.es677.js.map +1 -1
- package/dist/index.es678.js +11 -26
- package/dist/index.es678.js.map +1 -1
- package/dist/index.es679.js +27 -4
- package/dist/index.es679.js.map +1 -1
- package/dist/index.es680.js +4 -22
- package/dist/index.es680.js.map +1 -1
- package/package.json +1 -1
- package/dist/index.cjs492.js +0 -2
- package/dist/index.cjs492.js.map +0 -1
- package/dist/index.cjs493.js +0 -2
- package/dist/index.cjs493.js.map +0 -1
- package/dist/index.cjs494.js +0 -2
- package/dist/index.cjs494.js.map +0 -1
- package/dist/index.es492.js +0 -12
- package/dist/index.es492.js.map +0 -1
- package/dist/index.es493.js +0 -53
- package/dist/index.es493.js.map +0 -1
- package/dist/index.es494.js +0 -59
- package/dist/index.es494.js.map +0 -1
package/dist/index.cjs490.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs490.js","sources":["../node_modules
|
1
|
+
{"version":3,"file":"index.cjs490.js","sources":["../node_modules/aria-hidden/dist/es2015/index.js"],"sourcesContent":["var getDefaultParent = function (originalTarget) {\n if (typeof document === 'undefined') {\n return null;\n }\n var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;\n return sampleTarget.ownerDocument.body;\n};\nvar counterMap = new WeakMap();\nvar uncontrolledNodes = new WeakMap();\nvar markerMap = {};\nvar lockCount = 0;\nvar unwrapHost = function (node) {\n return node && (node.host || unwrapHost(node.parentNode));\n};\nvar correctTargets = function (parent, targets) {\n return targets\n .map(function (target) {\n if (parent.contains(target)) {\n return target;\n }\n var correctedTarget = unwrapHost(target);\n if (correctedTarget && parent.contains(correctedTarget)) {\n return correctedTarget;\n }\n console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing');\n return null;\n })\n .filter(function (x) { return Boolean(x); });\n};\n/**\n * Marks everything except given node(or nodes) as aria-hidden\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @param {String} [controlAttribute] - html Attribute to control\n * @return {Undo} undo command\n */\nvar applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) {\n var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);\n if (!markerMap[markerName]) {\n markerMap[markerName] = new WeakMap();\n }\n var markerCounter = markerMap[markerName];\n var hiddenNodes = [];\n var elementsToKeep = new Set();\n var elementsToStop = new Set(targets);\n var keep = function (el) {\n if (!el || elementsToKeep.has(el)) {\n return;\n }\n elementsToKeep.add(el);\n keep(el.parentNode);\n };\n targets.forEach(keep);\n var deep = function (parent) {\n if (!parent || elementsToStop.has(parent)) {\n return;\n }\n Array.prototype.forEach.call(parent.children, function (node) {\n if (elementsToKeep.has(node)) {\n deep(node);\n }\n else {\n try {\n var attr = node.getAttribute(controlAttribute);\n var alreadyHidden = attr !== null && attr !== 'false';\n var counterValue = (counterMap.get(node) || 0) + 1;\n var markerValue = (markerCounter.get(node) || 0) + 1;\n counterMap.set(node, counterValue);\n markerCounter.set(node, markerValue);\n hiddenNodes.push(node);\n if (counterValue === 1 && alreadyHidden) {\n uncontrolledNodes.set(node, true);\n }\n if (markerValue === 1) {\n node.setAttribute(markerName, 'true');\n }\n if (!alreadyHidden) {\n node.setAttribute(controlAttribute, 'true');\n }\n }\n catch (e) {\n console.error('aria-hidden: cannot operate on ', node, e);\n }\n }\n });\n };\n deep(parentNode);\n elementsToKeep.clear();\n lockCount++;\n return function () {\n hiddenNodes.forEach(function (node) {\n var counterValue = counterMap.get(node) - 1;\n var markerValue = markerCounter.get(node) - 1;\n counterMap.set(node, counterValue);\n markerCounter.set(node, markerValue);\n if (!counterValue) {\n if (!uncontrolledNodes.has(node)) {\n node.removeAttribute(controlAttribute);\n }\n uncontrolledNodes.delete(node);\n }\n if (!markerValue) {\n node.removeAttribute(markerName);\n }\n });\n lockCount--;\n if (!lockCount) {\n // clear\n counterMap = new WeakMap();\n counterMap = new WeakMap();\n uncontrolledNodes = new WeakMap();\n markerMap = {};\n }\n };\n};\n/**\n * Marks everything except given node(or nodes) as aria-hidden\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @return {Undo} undo command\n */\nexport var hideOthers = function (originalTarget, parentNode, markerName) {\n if (markerName === void 0) { markerName = 'data-aria-hidden'; }\n var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);\n var activeParentNode = parentNode || getDefaultParent(originalTarget);\n if (!activeParentNode) {\n return function () { return null; };\n }\n // we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10\n targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live]')));\n return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden');\n};\n/**\n * Marks everything except given node(or nodes) as inert\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @return {Undo} undo command\n */\nexport var inertOthers = function (originalTarget, parentNode, markerName) {\n if (markerName === void 0) { markerName = 'data-inert-ed'; }\n var activeParentNode = parentNode || getDefaultParent(originalTarget);\n if (!activeParentNode) {\n return function () { return null; };\n }\n return applyAttributeToOthers(originalTarget, activeParentNode, markerName, 'inert');\n};\n/**\n * @returns if current browser supports inert\n */\nexport var supportsInert = function () {\n return typeof HTMLElement !== 'undefined' && HTMLElement.prototype.hasOwnProperty('inert');\n};\n/**\n * Automatic function to \"suppress\" DOM elements - _hide_ or _inert_ in the best possible way\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @return {Undo} undo command\n */\nexport var suppressOthers = function (originalTarget, parentNode, markerName) {\n if (markerName === void 0) { markerName = 'data-suppressed'; }\n return (supportsInert() ? inertOthers : hideOthers)(originalTarget, parentNode, markerName);\n};\n"],"names":["getDefaultParent","originalTarget","sampleTarget","counterMap","uncontrolledNodes","markerMap","lockCount","unwrapHost","node","correctTargets","parent","targets","target","correctedTarget","x","applyAttributeToOthers","parentNode","markerName","controlAttribute","markerCounter","hiddenNodes","elementsToKeep","elementsToStop","keep","el","deep","attr","alreadyHidden","counterValue","markerValue","e","hideOthers","activeParentNode"],"mappings":"gFAAA,IAAIA,EAAmB,SAAUC,EAAgB,CAC7C,GAAI,OAAO,SAAa,IACpB,OAAO,KAEX,IAAIC,EAAe,MAAM,QAAQD,CAAc,EAAIA,EAAe,CAAC,EAAIA,EACvE,OAAOC,EAAa,cAAc,IACtC,EACIC,EAAa,IAAI,QACjBC,EAAoB,IAAI,QACxBC,EAAY,CAAE,EACdC,EAAY,EACZC,EAAa,SAAUC,EAAM,CAC7B,OAAOA,IAASA,EAAK,MAAQD,EAAWC,EAAK,UAAU,EAC3D,EACIC,EAAiB,SAAUC,EAAQC,EAAS,CAC5C,OAAOA,EACF,IAAI,SAAUC,EAAQ,CACvB,GAAIF,EAAO,SAASE,CAAM,EACtB,OAAOA,EAEX,IAAIC,EAAkBN,EAAWK,CAAM,EACvC,OAAIC,GAAmBH,EAAO,SAASG,CAAe,EAC3CA,GAEX,QAAQ,MAAM,cAAeD,EAAQ,0BAA2BF,EAAQ,iBAAiB,EAClF,KACV,CAAA,EACI,OAAO,SAAUI,EAAG,CAAE,MAAO,EAAQA,EAAK,CACnD,EASIC,EAAyB,SAAUd,EAAgBe,EAAYC,EAAYC,EAAkB,CAC7F,IAAIP,EAAUF,EAAeO,EAAY,MAAM,QAAQf,CAAc,EAAIA,EAAiB,CAACA,CAAc,CAAC,EACrGI,EAAUY,CAAU,IACrBZ,EAAUY,CAAU,EAAI,IAAI,SAEhC,IAAIE,EAAgBd,EAAUY,CAAU,EACpCG,EAAc,CAAE,EAChBC,EAAiB,IAAI,IACrBC,EAAiB,IAAI,IAAIX,CAAO,EAChCY,EAAO,SAAUC,EAAI,CACjB,CAACA,GAAMH,EAAe,IAAIG,CAAE,IAGhCH,EAAe,IAAIG,CAAE,EACrBD,EAAKC,EAAG,UAAU,EACrB,EACDb,EAAQ,QAAQY,CAAI,EACpB,IAAIE,EAAO,SAAUf,EAAQ,CACrB,CAACA,GAAUY,EAAe,IAAIZ,CAAM,GAGxC,MAAM,UAAU,QAAQ,KAAKA,EAAO,SAAU,SAAUF,EAAM,CAC1D,GAAIa,EAAe,IAAIb,CAAI,EACvBiB,EAAKjB,CAAI,MAGT,IAAI,CACA,IAAIkB,EAAOlB,EAAK,aAAaU,CAAgB,EACzCS,EAAgBD,IAAS,MAAQA,IAAS,QAC1CE,GAAgBzB,EAAW,IAAIK,CAAI,GAAK,GAAK,EAC7CqB,GAAeV,EAAc,IAAIX,CAAI,GAAK,GAAK,EACnDL,EAAW,IAAIK,EAAMoB,CAAY,EACjCT,EAAc,IAAIX,EAAMqB,CAAW,EACnCT,EAAY,KAAKZ,CAAI,EACjBoB,IAAiB,GAAKD,GACtBvB,EAAkB,IAAII,EAAM,EAAI,EAEhCqB,IAAgB,GAChBrB,EAAK,aAAaS,EAAY,MAAM,EAEnCU,GACDnB,EAAK,aAAaU,EAAkB,MAAM,CAElE,OACuBY,EAAG,CACN,QAAQ,MAAM,kCAAmCtB,EAAMsB,CAAC,CAC5E,CAEA,CAAS,CACJ,EACD,OAAAL,EAAKT,CAAU,EACfK,EAAe,MAAO,EACtBf,IACO,UAAY,CACfc,EAAY,QAAQ,SAAUZ,EAAM,CAChC,IAAIoB,EAAezB,EAAW,IAAIK,CAAI,EAAI,EACtCqB,EAAcV,EAAc,IAAIX,CAAI,EAAI,EAC5CL,EAAW,IAAIK,EAAMoB,CAAY,EACjCT,EAAc,IAAIX,EAAMqB,CAAW,EAC9BD,IACIxB,EAAkB,IAAII,CAAI,GAC3BA,EAAK,gBAAgBU,CAAgB,EAEzCd,EAAkB,OAAOI,CAAI,GAE5BqB,GACDrB,EAAK,gBAAgBS,CAAU,CAE/C,CAAS,EACDX,IACKA,IAEDH,EAAa,IAAI,QACjBA,EAAa,IAAI,QACjBC,EAAoB,IAAI,QACxBC,EAAY,CAAE,EAErB,CACL,EAQW0B,EAAa,SAAU9B,EAAgBe,EAAYC,EAAY,CAClEA,IAAe,SAAUA,EAAa,oBAC1C,IAAIN,EAAU,MAAM,KAAK,MAAM,QAAQV,CAAc,EAAIA,EAAiB,CAACA,CAAc,CAAC,EACtF+B,EAAiChC,EAAiBC,CAAc,EACpE,OAAK+B,GAILrB,EAAQ,KAAK,MAAMA,EAAS,MAAM,KAAKqB,EAAiB,iBAAiB,aAAa,CAAC,CAAC,EACjFjB,EAAuBJ,EAASqB,EAAkBf,EAAY,aAAa,GAJvE,UAAY,CAAE,OAAO,IAAO,CAK3C","x_google_ignoreList":[0]}
|
package/dist/index.cjs491.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),b=require("./index.cjs473.js"),u=require("./index.cjs249.js");function x(e){const t=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(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const l=x(g);function d(e){const t=j(e),r=l.forwardRef((n,o)=>{const{children:i,...c}=n,s=l.Children.toArray(i),f=s.find(E);if(f){const a=f.props.children,S=s.map(p=>p===f?l.Children.count(a)>1?l.Children.only(null):l.isValidElement(a)?a.props.children:null:p);return u.jsxRuntimeExports.jsx(t,{...c,ref:o,children:l.isValidElement(a)?l.cloneElement(a,void 0,S):null})}return u.jsxRuntimeExports.jsx(t,{...c,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var m=d("Slot");function j(e){const t=l.forwardRef((r,n)=>{const{children:o,...i}=r;if(l.isValidElement(o)){const c=C(o),s=O(i,o.props);return o.type!==l.Fragment&&(s.ref=n?b.composeRefs(n,c):c),l.cloneElement(o,s)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var y=Symbol("radix.slottable");function R(e){const t=({children:r})=>u.jsxRuntimeExports.jsx(u.jsxRuntimeExports.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=y,t}function E(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===y}function O(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...s)=>{i(...s),o(...s)}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function C(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}exports.Root=m;exports.Slot=m;exports.createSlot=d;exports.createSlottable=R;
|
2
2
|
//# sourceMappingURL=index.cjs491.js.map
|
package/dist/index.cjs491.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs491.js","sources":["../node_modules/@radix-ui/react-
|
1
|
+
{"version":3,"file":"index.cjs491.js","sources":["../node_modules/@radix-ui/react-slot/dist/index.mjs"],"sourcesContent":["// packages/react/slot/src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n childPropValue(...args);\n slotPropValue(...args);\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\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}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createSlot","ownerName","SlotClone","createSlotClone","Slot2","React","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","Slot","childrenRef","getElementRef","props2","mergeProps","composeRefs","SLOTTABLE_IDENTIFIER","createSlottable","Slottable2","Fragment2","childProps","overrideProps","propName","slotPropValue","childPropValue","args","element","getter","_a","mayWarn","_b"],"mappings":"icAKA,SAASA,EAAWC,EAAW,CAC7B,MAAMC,EAA4BC,EAAgBF,CAAS,EACrDG,EAAQC,EAAM,WAAW,CAACC,EAAOC,IAAiB,CACtD,KAAM,CAAE,SAAAC,EAAU,GAAGC,CAAS,EAAKH,EAC7BI,EAAgBL,EAAM,SAAS,QAAQG,CAAQ,EAC/CG,EAAYD,EAAc,KAAKE,CAAW,EAChD,GAAID,EAAW,CACb,MAAME,EAAaF,EAAU,MAAM,SAC7BG,EAAcJ,EAAc,IAAKK,GACjCA,IAAUJ,EACRN,EAAM,SAAS,MAAMQ,CAAU,EAAI,EAAUR,EAAM,SAAS,KAAK,IAAI,EAClEA,EAAM,eAAeQ,CAAU,EAAIA,EAAW,MAAM,SAAW,KAE/DE,CAEV,EACD,OAAuBC,EAAAA,kBAAAA,IAAId,EAAW,CAAE,GAAGO,EAAW,IAAKF,EAAc,SAAUF,EAAM,eAAeQ,CAAU,EAAIR,EAAM,aAAaQ,EAAY,OAAQC,CAAW,EAAI,KAAM,CACxL,CACI,OAAuBE,EAAAA,kBAAAA,IAAId,EAAW,CAAE,GAAGO,EAAW,IAAKF,EAAc,SAAAC,EAAU,CACvF,CAAG,EACD,OAAAJ,EAAM,YAAc,GAAGH,CAAS,QACzBG,CACT,CACG,IAACa,EAAuBjB,EAAW,MAAM,EAE5C,SAASG,EAAgBF,EAAW,CAClC,MAAMC,EAAYG,EAAM,WAAW,CAACC,EAAOC,IAAiB,CAC1D,KAAM,CAAE,SAAAC,EAAU,GAAGC,CAAS,EAAKH,EACnC,GAAID,EAAM,eAAeG,CAAQ,EAAG,CAClC,MAAMU,EAAcC,EAAcX,CAAQ,EACpCY,EAASC,EAAWZ,EAAWD,EAAS,KAAK,EACnD,OAAIA,EAAS,OAASH,EAAM,WAC1Be,EAAO,IAAMb,EAAee,EAAW,YAACf,EAAcW,CAAW,EAAIA,GAEhEb,EAAM,aAAaG,EAAUY,CAAM,CAChD,CACI,OAAOf,EAAM,SAAS,MAAMG,CAAQ,EAAI,EAAIH,EAAM,SAAS,KAAK,IAAI,EAAI,IAC5E,CAAG,EACD,OAAAH,EAAU,YAAc,GAAGD,CAAS,aAC7BC,CACT,CACA,IAAIqB,EAAuB,OAAO,iBAAiB,EAEnD,SAASC,EAAgBvB,EAAW,CAClC,MAAMwB,EAAa,CAAC,CAAE,SAAAjB,KACGQ,wBAAIU,EAAAA,kBAAAA,SAAW,CAAE,SAAAlB,EAAU,EAEpD,OAAAiB,EAAW,YAAc,GAAGxB,CAAS,aACrCwB,EAAW,UAAYF,EAChBE,CACT,CAEA,SAASb,EAAYG,EAAO,CAC1B,OAAOV,EAAM,eAAeU,CAAK,GAAK,OAAOA,EAAM,MAAS,YAAc,cAAeA,EAAM,MAAQA,EAAM,KAAK,YAAcQ,CAClI,CACA,SAASF,EAAWZ,EAAWkB,EAAY,CACzC,MAAMC,EAAgB,CAAE,GAAGD,CAAY,EACvC,UAAWE,KAAYF,EAAY,CACjC,MAAMG,EAAgBrB,EAAUoB,CAAQ,EAClCE,EAAiBJ,EAAWE,CAAQ,EACxB,WAAW,KAAKA,CAAQ,EAEpCC,GAAiBC,EACnBH,EAAcC,CAAQ,EAAI,IAAIG,IAAS,CACrCD,EAAe,GAAGC,CAAI,EACtBF,EAAc,GAAGE,CAAI,CACtB,EACQF,IACTF,EAAcC,CAAQ,EAAIC,GAEnBD,IAAa,QACtBD,EAAcC,CAAQ,EAAI,CAAE,GAAGC,EAAe,GAAGC,CAAgB,EACxDF,IAAa,cACtBD,EAAcC,CAAQ,EAAI,CAACC,EAAeC,CAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAExF,CACE,MAAO,CAAE,GAAGtB,EAAW,GAAGmB,CAAe,CAC3C,CACA,SAAST,EAAcc,EAAS,SAC9B,IAAIC,GAASC,EAAA,OAAO,yBAAyBF,EAAQ,MAAO,KAAK,IAApD,YAAAE,EAAuD,IAChEC,EAAUF,GAAU,mBAAoBA,GAAUA,EAAO,eAC7D,OAAIE,EACKH,EAAQ,KAEjBC,GAASG,EAAA,OAAO,yBAAyBJ,EAAS,KAAK,IAA9C,YAAAI,EAAiD,IAC1DD,EAAUF,GAAU,mBAAoBA,GAAUA,EAAO,eACrDE,EACKH,EAAQ,MAAM,IAEhBA,EAAQ,MAAM,KAAOA,EAAQ,IACtC","x_google_ignoreList":[0]}
|
@@ -1,2 +1,2 @@
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react");require("./index.cjs540.js");function i(){const[t,e]=o.useState(null),a=o.useCallback(async r=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(r),e(r),!0}catch(n){return console.warn("Copy failed",n),e(null),!1}},[]);return[t,a]}exports.useCopyToClipboard=i;
|
2
|
-
//# sourceMappingURL=index.
|
2
|
+
//# sourceMappingURL=index.cjs500.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs498.js","sources":["../node_modules/usehooks-ts/dist/index.js"],"sourcesContent":["import { useState, useCallback, useLayoutEffect, useEffect, useRef, useMemo } from 'react';\nimport debounce from 'lodash.debounce';\n\n// src/useBoolean/useBoolean.ts\nfunction useBoolean(defaultValue = false) {\n if (typeof defaultValue !== \"boolean\") {\n throw new Error(\"defaultValue must be `true` or `false`\");\n }\n const [value, setValue] = useState(defaultValue);\n const setTrue = useCallback(() => {\n setValue(true);\n }, []);\n const setFalse = useCallback(() => {\n setValue(false);\n }, []);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return { value, setValue, setTrue, setFalse, toggle };\n}\nvar useIsomorphicLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\n// src/useEventListener/useEventListener.ts\nfunction useEventListener(eventName, handler, element, options) {\n const savedHandler = useRef(handler);\n useIsomorphicLayoutEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n useEffect(() => {\n const targetElement = (element == null ? void 0 : element.current) ?? window;\n if (!(targetElement && targetElement.addEventListener))\n return;\n const listener = (event) => {\n savedHandler.current(event);\n };\n targetElement.addEventListener(eventName, listener, options);\n return () => {\n targetElement.removeEventListener(eventName, listener, options);\n };\n }, [eventName, element, options]);\n}\n\n// src/useClickAnyWhere/useClickAnyWhere.ts\nfunction useClickAnyWhere(handler) {\n useEventListener(\"click\", (event) => {\n handler(event);\n });\n}\nfunction useCopyToClipboard() {\n const [copiedText, setCopiedText] = useState(null);\n const copy = useCallback(async (text) => {\n if (!(navigator == null ? void 0 : navigator.clipboard)) {\n console.warn(\"Clipboard not supported\");\n return false;\n }\n try {\n await navigator.clipboard.writeText(text);\n setCopiedText(text);\n return true;\n } catch (error) {\n console.warn(\"Copy failed\", error);\n setCopiedText(null);\n return false;\n }\n }, []);\n return [copiedText, copy];\n}\nfunction useCounter(initialValue) {\n const [count, setCount] = useState(initialValue ?? 0);\n const increment = useCallback(() => {\n setCount((x) => x + 1);\n }, []);\n const decrement = useCallback(() => {\n setCount((x) => x - 1);\n }, []);\n const reset = useCallback(() => {\n setCount(initialValue ?? 0);\n }, [initialValue]);\n return {\n count,\n increment,\n decrement,\n reset,\n setCount\n };\n}\nfunction useInterval(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (delay === null) {\n return;\n }\n const id = setInterval(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearInterval(id);\n };\n }, [delay]);\n}\n\n// src/useCountdown/useCountdown.ts\nfunction useCountdown({\n countStart,\n countStop = 0,\n intervalMs = 1e3,\n isIncrement = false\n}) {\n const {\n count,\n increment,\n decrement,\n reset: resetCounter\n } = useCounter(countStart);\n const {\n value: isCountdownRunning,\n setTrue: startCountdown,\n setFalse: stopCountdown\n } = useBoolean(false);\n const resetCountdown = useCallback(() => {\n stopCountdown();\n resetCounter();\n }, [stopCountdown, resetCounter]);\n const countdownCallback = useCallback(() => {\n if (count === countStop) {\n stopCountdown();\n return;\n }\n if (isIncrement) {\n increment();\n } else {\n decrement();\n }\n }, [count, countStop, decrement, increment, isIncrement, stopCountdown]);\n useInterval(countdownCallback, isCountdownRunning ? intervalMs : null);\n return [count, { startCountdown, stopCountdown, resetCountdown }];\n}\nfunction useEventCallback(fn) {\n const ref = useRef(() => {\n throw new Error(\"Cannot call an event handler while rendering.\");\n });\n useIsomorphicLayoutEffect(() => {\n ref.current = fn;\n }, [fn]);\n return useCallback((...args) => {\n var _a;\n return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);\n }, [ref]);\n}\n\n// src/useLocalStorage/useLocalStorage.ts\nvar IS_SERVER = typeof window === \"undefined\";\nfunction useLocalStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER) {\n return initialValueToUse;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER) {\n console.warn(\n `Tried setting localStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.localStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"local-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting localStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n const removeValue = useEventCallback(() => {\n if (IS_SERVER) {\n console.warn(\n `Tried removing localStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n window.localStorage.removeItem(key);\n setStoredValue(defaultValue);\n window.dispatchEvent(new StorageEvent(\"local-storage\", { key }));\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return [storedValue, setValue, removeValue];\n}\nvar IS_SERVER2 = typeof window === \"undefined\";\nfunction useMediaQuery(query, {\n defaultValue = false,\n initializeWithValue = true\n} = {}) {\n const getMatches = (query2) => {\n if (IS_SERVER2) {\n return defaultValue;\n }\n return window.matchMedia(query2).matches;\n };\n const [matches, setMatches] = useState(() => {\n if (initializeWithValue) {\n return getMatches(query);\n }\n return defaultValue;\n });\n function handleChange() {\n setMatches(getMatches(query));\n }\n useIsomorphicLayoutEffect(() => {\n const matchMedia = window.matchMedia(query);\n handleChange();\n if (matchMedia.addListener) {\n matchMedia.addListener(handleChange);\n } else {\n matchMedia.addEventListener(\"change\", handleChange);\n }\n return () => {\n if (matchMedia.removeListener) {\n matchMedia.removeListener(handleChange);\n } else {\n matchMedia.removeEventListener(\"change\", handleChange);\n }\n };\n }, [query]);\n return matches;\n}\n\n// src/useDarkMode/useDarkMode.ts\nvar COLOR_SCHEME_QUERY = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY = \"usehooks-ts-dark-mode\";\nfunction useDarkMode(options = {}) {\n const {\n defaultValue,\n localStorageKey = LOCAL_STORAGE_KEY,\n initializeWithValue = true\n } = options;\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY, {\n initializeWithValue,\n defaultValue\n });\n const [isDarkMode, setDarkMode] = useLocalStorage(\n localStorageKey,\n defaultValue ?? isDarkOS ?? false,\n { initializeWithValue }\n );\n useIsomorphicLayoutEffect(() => {\n if (isDarkOS !== isDarkMode) {\n setDarkMode(isDarkOS);\n }\n }, [isDarkOS]);\n return {\n isDarkMode,\n toggle: () => {\n setDarkMode((prev) => !prev);\n },\n enable: () => {\n setDarkMode(true);\n },\n disable: () => {\n setDarkMode(false);\n },\n set: (value) => {\n setDarkMode(value);\n }\n };\n}\nfunction useUnmount(func) {\n const funcRef = useRef(func);\n funcRef.current = func;\n useEffect(\n () => () => {\n funcRef.current();\n },\n []\n );\n}\n\n// src/useDebounceCallback/useDebounceCallback.ts\nfunction useDebounceCallback(func, delay = 500, options) {\n const debouncedFunc = useRef();\n useUnmount(() => {\n if (debouncedFunc.current) {\n debouncedFunc.current.cancel();\n }\n });\n const debounced = useMemo(() => {\n const debouncedFuncInstance = debounce(func, delay, options);\n const wrappedFunc = (...args) => {\n return debouncedFuncInstance(...args);\n };\n wrappedFunc.cancel = () => {\n debouncedFuncInstance.cancel();\n };\n wrappedFunc.isPending = () => {\n return !!debouncedFunc.current;\n };\n wrappedFunc.flush = () => {\n return debouncedFuncInstance.flush();\n };\n return wrappedFunc;\n }, [func, delay, options]);\n useEffect(() => {\n debouncedFunc.current = debounce(func, delay, options);\n }, [func, delay, options]);\n return debounced;\n}\nfunction useDebounceValue(initialValue, delay, options) {\n const eq = (options == null ? void 0 : options.equalityFn) ?? ((left, right) => left === right);\n const unwrappedInitialValue = initialValue instanceof Function ? initialValue() : initialValue;\n const [debouncedValue, setDebouncedValue] = useState(unwrappedInitialValue);\n const previousValueRef = useRef(unwrappedInitialValue);\n const updateDebouncedValue = useDebounceCallback(\n setDebouncedValue,\n delay,\n options\n );\n if (!eq(previousValueRef.current, unwrappedInitialValue)) {\n updateDebouncedValue(unwrappedInitialValue);\n previousValueRef.current = unwrappedInitialValue;\n }\n return [debouncedValue, updateDebouncedValue];\n}\nfunction useDocumentTitle(title, options = {}) {\n const { preserveTitleOnUnmount = true } = options;\n const defaultTitle = useRef(null);\n useIsomorphicLayoutEffect(() => {\n defaultTitle.current = window.document.title;\n }, []);\n useIsomorphicLayoutEffect(() => {\n window.document.title = title;\n }, [title]);\n useUnmount(() => {\n if (!preserveTitleOnUnmount && defaultTitle.current) {\n window.document.title = defaultTitle.current;\n }\n });\n}\nfunction useHover(elementRef) {\n const [value, setValue] = useState(false);\n const handleMouseEnter = () => {\n setValue(true);\n };\n const handleMouseLeave = () => {\n setValue(false);\n };\n useEventListener(\"mouseenter\", handleMouseEnter, elementRef);\n useEventListener(\"mouseleave\", handleMouseLeave, elementRef);\n return value;\n}\nfunction useIntersectionObserver({\n threshold = 0,\n root = null,\n rootMargin = \"0%\",\n freezeOnceVisible = false,\n initialIsIntersecting = false,\n onChange\n} = {}) {\n var _a;\n const [ref, setRef] = useState(null);\n const [state, setState] = useState(() => ({\n isIntersecting: initialIsIntersecting,\n entry: void 0\n }));\n const callbackRef = useRef();\n callbackRef.current = onChange;\n const frozen = ((_a = state.entry) == null ? void 0 : _a.isIntersecting) && freezeOnceVisible;\n useEffect(() => {\n if (!ref)\n return;\n if (!(\"IntersectionObserver\" in window))\n return;\n if (frozen)\n return;\n let unobserve;\n const observer = new IntersectionObserver(\n (entries) => {\n const thresholds = Array.isArray(observer.thresholds) ? observer.thresholds : [observer.thresholds];\n entries.forEach((entry) => {\n const isIntersecting = entry.isIntersecting && thresholds.some((threshold2) => entry.intersectionRatio >= threshold2);\n setState({ isIntersecting, entry });\n if (callbackRef.current) {\n callbackRef.current(isIntersecting, entry);\n }\n if (isIntersecting && freezeOnceVisible && unobserve) {\n unobserve();\n unobserve = void 0;\n }\n });\n },\n { threshold, root, rootMargin }\n );\n observer.observe(ref);\n return () => {\n observer.disconnect();\n };\n }, [\n ref,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n JSON.stringify(threshold),\n root,\n rootMargin,\n frozen,\n freezeOnceVisible\n ]);\n const prevRef = useRef(null);\n useEffect(() => {\n var _a2;\n if (!ref && ((_a2 = state.entry) == null ? void 0 : _a2.target) && !freezeOnceVisible && !frozen && prevRef.current !== state.entry.target) {\n prevRef.current = state.entry.target;\n setState({ isIntersecting: initialIsIntersecting, entry: void 0 });\n }\n }, [ref, state.entry, freezeOnceVisible, frozen, initialIsIntersecting]);\n const result = [\n setRef,\n !!state.isIntersecting,\n state.entry\n ];\n result.ref = result[0];\n result.isIntersecting = result[1];\n result.entry = result[2];\n return result;\n}\nfunction useIsClient() {\n const [isClient, setClient] = useState(false);\n useEffect(() => {\n setClient(true);\n }, []);\n return isClient;\n}\nfunction useIsMounted() {\n const isMounted = useRef(false);\n useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n return useCallback(() => isMounted.current, []);\n}\nfunction useMap(initialState = /* @__PURE__ */ new Map()) {\n const [map, setMap] = useState(new Map(initialState));\n const actions = {\n set: useCallback((key, value) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.set(key, value);\n return copy;\n });\n }, []),\n setAll: useCallback((entries) => {\n setMap(() => new Map(entries));\n }, []),\n remove: useCallback((key) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.delete(key);\n return copy;\n });\n }, []),\n reset: useCallback(() => {\n setMap(() => /* @__PURE__ */ new Map());\n }, [])\n };\n return [map, actions];\n}\n\n// src/useOnClickOutside/useOnClickOutside.ts\nfunction useOnClickOutside(ref, handler, eventType = \"mousedown\", eventListenerOptions = {}) {\n useEventListener(\n eventType,\n (event) => {\n const target = event.target;\n if (!target || !target.isConnected) {\n return;\n }\n const isOutside = Array.isArray(ref) ? ref.filter((r) => Boolean(r.current)).every((r) => r.current && !r.current.contains(target)) : ref.current && !ref.current.contains(target);\n if (isOutside) {\n handler(event);\n }\n },\n void 0,\n eventListenerOptions\n );\n}\nvar IS_SERVER3 = typeof window === \"undefined\";\nfunction useReadLocalStorage(key, options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER3) {\n initializeWithValue = false;\n }\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return null;\n }\n return parsed;\n },\n [options]\n );\n const readValue = useCallback(() => {\n if (IS_SERVER3) {\n return null;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : null;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return null;\n }\n }, [key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return void 0;\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return storedValue;\n}\nvar initialSize = {\n width: void 0,\n height: void 0\n};\nfunction useResizeObserver(options) {\n const { ref, box = \"content-box\" } = options;\n const [{ width, height }, setSize] = useState(initialSize);\n const isMounted = useIsMounted();\n const previousSize = useRef({ ...initialSize });\n const onResize = useRef(void 0);\n onResize.current = options.onResize;\n useEffect(() => {\n if (!ref.current)\n return;\n if (typeof window === \"undefined\" || !(\"ResizeObserver\" in window))\n return;\n const observer = new ResizeObserver(([entry]) => {\n const boxProp = box === \"border-box\" ? \"borderBoxSize\" : box === \"device-pixel-content-box\" ? \"devicePixelContentBoxSize\" : \"contentBoxSize\";\n const newWidth = extractSize(entry, boxProp, \"inlineSize\");\n const newHeight = extractSize(entry, boxProp, \"blockSize\");\n const hasChanged = previousSize.current.width !== newWidth || previousSize.current.height !== newHeight;\n if (hasChanged) {\n const newSize = { width: newWidth, height: newHeight };\n previousSize.current.width = newWidth;\n previousSize.current.height = newHeight;\n if (onResize.current) {\n onResize.current(newSize);\n } else {\n if (isMounted()) {\n setSize(newSize);\n }\n }\n }\n });\n observer.observe(ref.current, { box });\n return () => {\n observer.disconnect();\n };\n }, [box, ref, isMounted]);\n return { width, height };\n}\nfunction extractSize(entry, box, sizeType) {\n if (!entry[box]) {\n if (box === \"contentBoxSize\") {\n return entry.contentRect[sizeType === \"inlineSize\" ? \"width\" : \"height\"];\n }\n return void 0;\n }\n return Array.isArray(entry[box]) ? entry[box][0][sizeType] : (\n // @ts-ignore Support Firefox's non-standard behavior\n entry[box][sizeType]\n );\n}\nvar IS_SERVER4 = typeof window === \"undefined\";\nfunction useScreen(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER4) {\n initializeWithValue = false;\n }\n const readScreen = () => {\n if (IS_SERVER4) {\n return void 0;\n }\n return window.screen;\n };\n const [screen, setScreen] = useState(() => {\n if (initializeWithValue) {\n return readScreen();\n }\n return void 0;\n });\n const debouncedSetScreen = useDebounceCallback(\n setScreen,\n options.debounceDelay\n );\n function handleSize() {\n const newScreen = readScreen();\n const setSize = options.debounceDelay ? debouncedSetScreen : setScreen;\n if (newScreen) {\n const {\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n } = newScreen;\n setSize({\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n });\n }\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return screen;\n}\nvar cachedScriptStatuses = /* @__PURE__ */ new Map();\nfunction getScriptNode(src) {\n const node = document.querySelector(\n `script[src=\"${src}\"]`\n );\n const status = node == null ? void 0 : node.getAttribute(\"data-status\");\n return {\n node,\n status\n };\n}\nfunction useScript(src, options) {\n const [status, setStatus] = useState(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return \"idle\";\n }\n if (typeof window === \"undefined\") {\n return \"loading\";\n }\n return cachedScriptStatuses.get(src) ?? \"loading\";\n });\n useEffect(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return;\n }\n const cachedScriptStatus = cachedScriptStatuses.get(src);\n if (cachedScriptStatus === \"ready\" || cachedScriptStatus === \"error\") {\n setStatus(cachedScriptStatus);\n return;\n }\n const script = getScriptNode(src);\n let scriptNode = script.node;\n if (!scriptNode) {\n scriptNode = document.createElement(\"script\");\n scriptNode.src = src;\n scriptNode.async = true;\n if (options == null ? void 0 : options.id) {\n scriptNode.id = options.id;\n }\n scriptNode.setAttribute(\"data-status\", \"loading\");\n document.body.appendChild(scriptNode);\n const setAttributeFromEvent = (event) => {\n const scriptStatus = event.type === \"load\" ? \"ready\" : \"error\";\n scriptNode == null ? void 0 : scriptNode.setAttribute(\"data-status\", scriptStatus);\n };\n scriptNode.addEventListener(\"load\", setAttributeFromEvent);\n scriptNode.addEventListener(\"error\", setAttributeFromEvent);\n } else {\n setStatus(script.status ?? cachedScriptStatus ?? \"loading\");\n }\n const setStateFromEvent = (event) => {\n const newStatus = event.type === \"load\" ? \"ready\" : \"error\";\n setStatus(newStatus);\n cachedScriptStatuses.set(src, newStatus);\n };\n scriptNode.addEventListener(\"load\", setStateFromEvent);\n scriptNode.addEventListener(\"error\", setStateFromEvent);\n return () => {\n if (scriptNode) {\n scriptNode.removeEventListener(\"load\", setStateFromEvent);\n scriptNode.removeEventListener(\"error\", setStateFromEvent);\n }\n if (scriptNode && (options == null ? void 0 : options.removeOnUnmount)) {\n scriptNode.remove();\n cachedScriptStatuses.delete(src);\n }\n };\n }, [src, options == null ? void 0 : options.shouldPreventLoad, options == null ? void 0 : options.removeOnUnmount, options == null ? void 0 : options.id]);\n return status;\n}\nvar IS_SERVER5 = typeof window === \"undefined\";\nfunction useScrollLock(options = {}) {\n const { autoLock = true, lockTarget, widthReflow = true } = options;\n const [isLocked, setIsLocked] = useState(false);\n const target = useRef(null);\n const originalStyle = useRef(null);\n const lock = () => {\n if (target.current) {\n const { overflow, paddingRight } = target.current.style;\n originalStyle.current = { overflow, paddingRight };\n if (widthReflow) {\n const offsetWidth = target.current === document.body ? window.innerWidth : target.current.offsetWidth;\n const currentPaddingRight = parseInt(window.getComputedStyle(target.current).paddingRight, 10) || 0;\n const scrollbarWidth = offsetWidth - target.current.scrollWidth;\n target.current.style.paddingRight = `${scrollbarWidth + currentPaddingRight}px`;\n }\n target.current.style.overflow = \"hidden\";\n setIsLocked(true);\n }\n };\n const unlock = () => {\n if (target.current && originalStyle.current) {\n target.current.style.overflow = originalStyle.current.overflow;\n if (widthReflow) {\n target.current.style.paddingRight = originalStyle.current.paddingRight;\n }\n }\n setIsLocked(false);\n };\n useIsomorphicLayoutEffect(() => {\n if (IS_SERVER5)\n return;\n if (lockTarget) {\n target.current = typeof lockTarget === \"string\" ? document.querySelector(lockTarget) : lockTarget;\n }\n if (!target.current) {\n target.current = document.body;\n }\n if (autoLock) {\n lock();\n }\n return () => {\n unlock();\n };\n }, [autoLock, lockTarget, widthReflow]);\n return { isLocked, lock, unlock };\n}\nvar IS_SERVER6 = typeof window === \"undefined\";\nfunction useSessionStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER6) {\n return initialValueToUse;\n }\n try {\n const raw = window.sessionStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading sessionStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER6) {\n console.warn(\n `Tried setting sessionStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.sessionStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"session-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting sessionStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n const removeValue = useEventCallback(() => {\n if (IS_SERVER6) {\n console.warn(\n `Tried removing sessionStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n window.sessionStorage.removeItem(key);\n setStoredValue(defaultValue);\n window.dispatchEvent(new StorageEvent(\"session-storage\", { key }));\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"session-storage\", handleStorageChange);\n return [storedValue, setValue, removeValue];\n}\nfunction useStep(maxStep) {\n const [currentStep, setCurrentStep] = useState(1);\n const canGoToNextStep = currentStep + 1 <= maxStep;\n const canGoToPrevStep = currentStep - 1 > 0;\n const setStep = useCallback(\n (step) => {\n const newStep = step instanceof Function ? step(currentStep) : step;\n if (newStep >= 1 && newStep <= maxStep) {\n setCurrentStep(newStep);\n return;\n }\n throw new Error(\"Step not valid\");\n },\n [maxStep, currentStep]\n );\n const goToNextStep = useCallback(() => {\n if (canGoToNextStep) {\n setCurrentStep((step) => step + 1);\n }\n }, [canGoToNextStep]);\n const goToPrevStep = useCallback(() => {\n if (canGoToPrevStep) {\n setCurrentStep((step) => step - 1);\n }\n }, [canGoToPrevStep]);\n const reset = useCallback(() => {\n setCurrentStep(1);\n }, []);\n return [\n currentStep,\n {\n goToNextStep,\n goToPrevStep,\n canGoToNextStep,\n canGoToPrevStep,\n setStep,\n reset\n }\n ];\n}\n\n// src/useTernaryDarkMode/useTernaryDarkMode.ts\nvar COLOR_SCHEME_QUERY2 = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY2 = \"usehooks-ts-ternary-dark-mode\";\nfunction useTernaryDarkMode({\n defaultValue = \"system\",\n localStorageKey = LOCAL_STORAGE_KEY2,\n initializeWithValue = true\n} = {}) {\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY2, { initializeWithValue });\n const [mode, setMode] = useLocalStorage(localStorageKey, defaultValue, {\n initializeWithValue\n });\n const isDarkMode = mode === \"dark\" || mode === \"system\" && isDarkOS;\n const toggleTernaryDarkMode = () => {\n const modes = [\"light\", \"system\", \"dark\"];\n setMode((prevMode) => {\n const nextIndex = (modes.indexOf(prevMode) + 1) % modes.length;\n return modes[nextIndex];\n });\n };\n return {\n isDarkMode,\n ternaryDarkMode: mode,\n setTernaryDarkMode: setMode,\n toggleTernaryDarkMode\n };\n}\nfunction useTimeout(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (!delay && delay !== 0) {\n return;\n }\n const id = setTimeout(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearTimeout(id);\n };\n }, [delay]);\n}\nfunction useToggle(defaultValue) {\n const [value, setValue] = useState(!!defaultValue);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return [value, toggle, setValue];\n}\nvar IS_SERVER7 = typeof window === \"undefined\";\nfunction useWindowSize(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER7) {\n initializeWithValue = false;\n }\n const [windowSize, setWindowSize] = useState(() => {\n if (initializeWithValue) {\n return {\n width: window.innerWidth,\n height: window.innerHeight\n };\n }\n return {\n width: void 0,\n height: void 0\n };\n });\n const debouncedSetWindowSize = useDebounceCallback(\n setWindowSize,\n options.debounceDelay\n );\n function handleSize() {\n const setSize = options.debounceDelay ? debouncedSetWindowSize : setWindowSize;\n setSize({\n width: window.innerWidth,\n height: window.innerHeight\n });\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return windowSize;\n}\n\nexport { useBoolean, useClickAnyWhere, useCopyToClipboard, useCountdown, useCounter, useDarkMode, useDebounceCallback, useDebounceValue, useDocumentTitle, useEventCallback, useEventListener, useHover, useIntersectionObserver, useInterval, useIsClient, useIsMounted, useIsomorphicLayoutEffect, useLocalStorage, useMap, useMediaQuery, useOnClickOutside, useReadLocalStorage, useResizeObserver, useScreen, useScript, useScrollLock, useSessionStorage, useStep, useTernaryDarkMode, useTimeout, useToggle, useUnmount, useWindowSize };\n"],"names":["useCopyToClipboard","copiedText","setCopiedText","useState","copy","useCallback","text","error"],"mappings":"sIAgDA,SAASA,GAAqB,CAC5B,KAAM,CAACC,EAAYC,CAAa,EAAIC,EAAAA,SAAS,IAAI,EAC3CC,EAAOC,cAAY,MAAOC,GAAS,CACvC,GAAI,EAAE,WAAa,MAAgB,UAAU,WAC3C,eAAQ,KAAK,yBAAyB,EAC/B,GAET,GAAI,CACF,aAAM,UAAU,UAAU,UAAUA,CAAI,EACxCJ,EAAcI,CAAI,EACX,EACR,OAAQC,EAAO,CACd,eAAQ,KAAK,cAAeA,CAAK,EACjCL,EAAc,IAAI,EACX,EACb,CACG,EAAE,EAAE,EACL,MAAO,CAACD,EAAYG,CAAI,CAC1B","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index.cjs500.js","sources":["../node_modules/usehooks-ts/dist/index.js"],"sourcesContent":["import { useState, useCallback, useLayoutEffect, useEffect, useRef, useMemo } from 'react';\nimport debounce from 'lodash.debounce';\n\n// src/useBoolean/useBoolean.ts\nfunction useBoolean(defaultValue = false) {\n if (typeof defaultValue !== \"boolean\") {\n throw new Error(\"defaultValue must be `true` or `false`\");\n }\n const [value, setValue] = useState(defaultValue);\n const setTrue = useCallback(() => {\n setValue(true);\n }, []);\n const setFalse = useCallback(() => {\n setValue(false);\n }, []);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return { value, setValue, setTrue, setFalse, toggle };\n}\nvar useIsomorphicLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\n// src/useEventListener/useEventListener.ts\nfunction useEventListener(eventName, handler, element, options) {\n const savedHandler = useRef(handler);\n useIsomorphicLayoutEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n useEffect(() => {\n const targetElement = (element == null ? void 0 : element.current) ?? window;\n if (!(targetElement && targetElement.addEventListener))\n return;\n const listener = (event) => {\n savedHandler.current(event);\n };\n targetElement.addEventListener(eventName, listener, options);\n return () => {\n targetElement.removeEventListener(eventName, listener, options);\n };\n }, [eventName, element, options]);\n}\n\n// src/useClickAnyWhere/useClickAnyWhere.ts\nfunction useClickAnyWhere(handler) {\n useEventListener(\"click\", (event) => {\n handler(event);\n });\n}\nfunction useCopyToClipboard() {\n const [copiedText, setCopiedText] = useState(null);\n const copy = useCallback(async (text) => {\n if (!(navigator == null ? void 0 : navigator.clipboard)) {\n console.warn(\"Clipboard not supported\");\n return false;\n }\n try {\n await navigator.clipboard.writeText(text);\n setCopiedText(text);\n return true;\n } catch (error) {\n console.warn(\"Copy failed\", error);\n setCopiedText(null);\n return false;\n }\n }, []);\n return [copiedText, copy];\n}\nfunction useCounter(initialValue) {\n const [count, setCount] = useState(initialValue ?? 0);\n const increment = useCallback(() => {\n setCount((x) => x + 1);\n }, []);\n const decrement = useCallback(() => {\n setCount((x) => x - 1);\n }, []);\n const reset = useCallback(() => {\n setCount(initialValue ?? 0);\n }, [initialValue]);\n return {\n count,\n increment,\n decrement,\n reset,\n setCount\n };\n}\nfunction useInterval(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (delay === null) {\n return;\n }\n const id = setInterval(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearInterval(id);\n };\n }, [delay]);\n}\n\n// src/useCountdown/useCountdown.ts\nfunction useCountdown({\n countStart,\n countStop = 0,\n intervalMs = 1e3,\n isIncrement = false\n}) {\n const {\n count,\n increment,\n decrement,\n reset: resetCounter\n } = useCounter(countStart);\n const {\n value: isCountdownRunning,\n setTrue: startCountdown,\n setFalse: stopCountdown\n } = useBoolean(false);\n const resetCountdown = useCallback(() => {\n stopCountdown();\n resetCounter();\n }, [stopCountdown, resetCounter]);\n const countdownCallback = useCallback(() => {\n if (count === countStop) {\n stopCountdown();\n return;\n }\n if (isIncrement) {\n increment();\n } else {\n decrement();\n }\n }, [count, countStop, decrement, increment, isIncrement, stopCountdown]);\n useInterval(countdownCallback, isCountdownRunning ? intervalMs : null);\n return [count, { startCountdown, stopCountdown, resetCountdown }];\n}\nfunction useEventCallback(fn) {\n const ref = useRef(() => {\n throw new Error(\"Cannot call an event handler while rendering.\");\n });\n useIsomorphicLayoutEffect(() => {\n ref.current = fn;\n }, [fn]);\n return useCallback((...args) => {\n var _a;\n return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);\n }, [ref]);\n}\n\n// src/useLocalStorage/useLocalStorage.ts\nvar IS_SERVER = typeof window === \"undefined\";\nfunction useLocalStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER) {\n return initialValueToUse;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER) {\n console.warn(\n `Tried setting localStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.localStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"local-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting localStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n const removeValue = useEventCallback(() => {\n if (IS_SERVER) {\n console.warn(\n `Tried removing localStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n window.localStorage.removeItem(key);\n setStoredValue(defaultValue);\n window.dispatchEvent(new StorageEvent(\"local-storage\", { key }));\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return [storedValue, setValue, removeValue];\n}\nvar IS_SERVER2 = typeof window === \"undefined\";\nfunction useMediaQuery(query, {\n defaultValue = false,\n initializeWithValue = true\n} = {}) {\n const getMatches = (query2) => {\n if (IS_SERVER2) {\n return defaultValue;\n }\n return window.matchMedia(query2).matches;\n };\n const [matches, setMatches] = useState(() => {\n if (initializeWithValue) {\n return getMatches(query);\n }\n return defaultValue;\n });\n function handleChange() {\n setMatches(getMatches(query));\n }\n useIsomorphicLayoutEffect(() => {\n const matchMedia = window.matchMedia(query);\n handleChange();\n if (matchMedia.addListener) {\n matchMedia.addListener(handleChange);\n } else {\n matchMedia.addEventListener(\"change\", handleChange);\n }\n return () => {\n if (matchMedia.removeListener) {\n matchMedia.removeListener(handleChange);\n } else {\n matchMedia.removeEventListener(\"change\", handleChange);\n }\n };\n }, [query]);\n return matches;\n}\n\n// src/useDarkMode/useDarkMode.ts\nvar COLOR_SCHEME_QUERY = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY = \"usehooks-ts-dark-mode\";\nfunction useDarkMode(options = {}) {\n const {\n defaultValue,\n localStorageKey = LOCAL_STORAGE_KEY,\n initializeWithValue = true\n } = options;\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY, {\n initializeWithValue,\n defaultValue\n });\n const [isDarkMode, setDarkMode] = useLocalStorage(\n localStorageKey,\n defaultValue ?? isDarkOS ?? false,\n { initializeWithValue }\n );\n useIsomorphicLayoutEffect(() => {\n if (isDarkOS !== isDarkMode) {\n setDarkMode(isDarkOS);\n }\n }, [isDarkOS]);\n return {\n isDarkMode,\n toggle: () => {\n setDarkMode((prev) => !prev);\n },\n enable: () => {\n setDarkMode(true);\n },\n disable: () => {\n setDarkMode(false);\n },\n set: (value) => {\n setDarkMode(value);\n }\n };\n}\nfunction useUnmount(func) {\n const funcRef = useRef(func);\n funcRef.current = func;\n useEffect(\n () => () => {\n funcRef.current();\n },\n []\n );\n}\n\n// src/useDebounceCallback/useDebounceCallback.ts\nfunction useDebounceCallback(func, delay = 500, options) {\n const debouncedFunc = useRef();\n useUnmount(() => {\n if (debouncedFunc.current) {\n debouncedFunc.current.cancel();\n }\n });\n const debounced = useMemo(() => {\n const debouncedFuncInstance = debounce(func, delay, options);\n const wrappedFunc = (...args) => {\n return debouncedFuncInstance(...args);\n };\n wrappedFunc.cancel = () => {\n debouncedFuncInstance.cancel();\n };\n wrappedFunc.isPending = () => {\n return !!debouncedFunc.current;\n };\n wrappedFunc.flush = () => {\n return debouncedFuncInstance.flush();\n };\n return wrappedFunc;\n }, [func, delay, options]);\n useEffect(() => {\n debouncedFunc.current = debounce(func, delay, options);\n }, [func, delay, options]);\n return debounced;\n}\nfunction useDebounceValue(initialValue, delay, options) {\n const eq = (options == null ? void 0 : options.equalityFn) ?? ((left, right) => left === right);\n const unwrappedInitialValue = initialValue instanceof Function ? initialValue() : initialValue;\n const [debouncedValue, setDebouncedValue] = useState(unwrappedInitialValue);\n const previousValueRef = useRef(unwrappedInitialValue);\n const updateDebouncedValue = useDebounceCallback(\n setDebouncedValue,\n delay,\n options\n );\n if (!eq(previousValueRef.current, unwrappedInitialValue)) {\n updateDebouncedValue(unwrappedInitialValue);\n previousValueRef.current = unwrappedInitialValue;\n }\n return [debouncedValue, updateDebouncedValue];\n}\nfunction useDocumentTitle(title, options = {}) {\n const { preserveTitleOnUnmount = true } = options;\n const defaultTitle = useRef(null);\n useIsomorphicLayoutEffect(() => {\n defaultTitle.current = window.document.title;\n }, []);\n useIsomorphicLayoutEffect(() => {\n window.document.title = title;\n }, [title]);\n useUnmount(() => {\n if (!preserveTitleOnUnmount && defaultTitle.current) {\n window.document.title = defaultTitle.current;\n }\n });\n}\nfunction useHover(elementRef) {\n const [value, setValue] = useState(false);\n const handleMouseEnter = () => {\n setValue(true);\n };\n const handleMouseLeave = () => {\n setValue(false);\n };\n useEventListener(\"mouseenter\", handleMouseEnter, elementRef);\n useEventListener(\"mouseleave\", handleMouseLeave, elementRef);\n return value;\n}\nfunction useIntersectionObserver({\n threshold = 0,\n root = null,\n rootMargin = \"0%\",\n freezeOnceVisible = false,\n initialIsIntersecting = false,\n onChange\n} = {}) {\n var _a;\n const [ref, setRef] = useState(null);\n const [state, setState] = useState(() => ({\n isIntersecting: initialIsIntersecting,\n entry: void 0\n }));\n const callbackRef = useRef();\n callbackRef.current = onChange;\n const frozen = ((_a = state.entry) == null ? void 0 : _a.isIntersecting) && freezeOnceVisible;\n useEffect(() => {\n if (!ref)\n return;\n if (!(\"IntersectionObserver\" in window))\n return;\n if (frozen)\n return;\n let unobserve;\n const observer = new IntersectionObserver(\n (entries) => {\n const thresholds = Array.isArray(observer.thresholds) ? observer.thresholds : [observer.thresholds];\n entries.forEach((entry) => {\n const isIntersecting = entry.isIntersecting && thresholds.some((threshold2) => entry.intersectionRatio >= threshold2);\n setState({ isIntersecting, entry });\n if (callbackRef.current) {\n callbackRef.current(isIntersecting, entry);\n }\n if (isIntersecting && freezeOnceVisible && unobserve) {\n unobserve();\n unobserve = void 0;\n }\n });\n },\n { threshold, root, rootMargin }\n );\n observer.observe(ref);\n return () => {\n observer.disconnect();\n };\n }, [\n ref,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n JSON.stringify(threshold),\n root,\n rootMargin,\n frozen,\n freezeOnceVisible\n ]);\n const prevRef = useRef(null);\n useEffect(() => {\n var _a2;\n if (!ref && ((_a2 = state.entry) == null ? void 0 : _a2.target) && !freezeOnceVisible && !frozen && prevRef.current !== state.entry.target) {\n prevRef.current = state.entry.target;\n setState({ isIntersecting: initialIsIntersecting, entry: void 0 });\n }\n }, [ref, state.entry, freezeOnceVisible, frozen, initialIsIntersecting]);\n const result = [\n setRef,\n !!state.isIntersecting,\n state.entry\n ];\n result.ref = result[0];\n result.isIntersecting = result[1];\n result.entry = result[2];\n return result;\n}\nfunction useIsClient() {\n const [isClient, setClient] = useState(false);\n useEffect(() => {\n setClient(true);\n }, []);\n return isClient;\n}\nfunction useIsMounted() {\n const isMounted = useRef(false);\n useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n return useCallback(() => isMounted.current, []);\n}\nfunction useMap(initialState = /* @__PURE__ */ new Map()) {\n const [map, setMap] = useState(new Map(initialState));\n const actions = {\n set: useCallback((key, value) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.set(key, value);\n return copy;\n });\n }, []),\n setAll: useCallback((entries) => {\n setMap(() => new Map(entries));\n }, []),\n remove: useCallback((key) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.delete(key);\n return copy;\n });\n }, []),\n reset: useCallback(() => {\n setMap(() => /* @__PURE__ */ new Map());\n }, [])\n };\n return [map, actions];\n}\n\n// src/useOnClickOutside/useOnClickOutside.ts\nfunction useOnClickOutside(ref, handler, eventType = \"mousedown\", eventListenerOptions = {}) {\n useEventListener(\n eventType,\n (event) => {\n const target = event.target;\n if (!target || !target.isConnected) {\n return;\n }\n const isOutside = Array.isArray(ref) ? ref.filter((r) => Boolean(r.current)).every((r) => r.current && !r.current.contains(target)) : ref.current && !ref.current.contains(target);\n if (isOutside) {\n handler(event);\n }\n },\n void 0,\n eventListenerOptions\n );\n}\nvar IS_SERVER3 = typeof window === \"undefined\";\nfunction useReadLocalStorage(key, options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER3) {\n initializeWithValue = false;\n }\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return null;\n }\n return parsed;\n },\n [options]\n );\n const readValue = useCallback(() => {\n if (IS_SERVER3) {\n return null;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : null;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return null;\n }\n }, [key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return void 0;\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return storedValue;\n}\nvar initialSize = {\n width: void 0,\n height: void 0\n};\nfunction useResizeObserver(options) {\n const { ref, box = \"content-box\" } = options;\n const [{ width, height }, setSize] = useState(initialSize);\n const isMounted = useIsMounted();\n const previousSize = useRef({ ...initialSize });\n const onResize = useRef(void 0);\n onResize.current = options.onResize;\n useEffect(() => {\n if (!ref.current)\n return;\n if (typeof window === \"undefined\" || !(\"ResizeObserver\" in window))\n return;\n const observer = new ResizeObserver(([entry]) => {\n const boxProp = box === \"border-box\" ? \"borderBoxSize\" : box === \"device-pixel-content-box\" ? \"devicePixelContentBoxSize\" : \"contentBoxSize\";\n const newWidth = extractSize(entry, boxProp, \"inlineSize\");\n const newHeight = extractSize(entry, boxProp, \"blockSize\");\n const hasChanged = previousSize.current.width !== newWidth || previousSize.current.height !== newHeight;\n if (hasChanged) {\n const newSize = { width: newWidth, height: newHeight };\n previousSize.current.width = newWidth;\n previousSize.current.height = newHeight;\n if (onResize.current) {\n onResize.current(newSize);\n } else {\n if (isMounted()) {\n setSize(newSize);\n }\n }\n }\n });\n observer.observe(ref.current, { box });\n return () => {\n observer.disconnect();\n };\n }, [box, ref, isMounted]);\n return { width, height };\n}\nfunction extractSize(entry, box, sizeType) {\n if (!entry[box]) {\n if (box === \"contentBoxSize\") {\n return entry.contentRect[sizeType === \"inlineSize\" ? \"width\" : \"height\"];\n }\n return void 0;\n }\n return Array.isArray(entry[box]) ? entry[box][0][sizeType] : (\n // @ts-ignore Support Firefox's non-standard behavior\n entry[box][sizeType]\n );\n}\nvar IS_SERVER4 = typeof window === \"undefined\";\nfunction useScreen(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER4) {\n initializeWithValue = false;\n }\n const readScreen = () => {\n if (IS_SERVER4) {\n return void 0;\n }\n return window.screen;\n };\n const [screen, setScreen] = useState(() => {\n if (initializeWithValue) {\n return readScreen();\n }\n return void 0;\n });\n const debouncedSetScreen = useDebounceCallback(\n setScreen,\n options.debounceDelay\n );\n function handleSize() {\n const newScreen = readScreen();\n const setSize = options.debounceDelay ? debouncedSetScreen : setScreen;\n if (newScreen) {\n const {\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n } = newScreen;\n setSize({\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n });\n }\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return screen;\n}\nvar cachedScriptStatuses = /* @__PURE__ */ new Map();\nfunction getScriptNode(src) {\n const node = document.querySelector(\n `script[src=\"${src}\"]`\n );\n const status = node == null ? void 0 : node.getAttribute(\"data-status\");\n return {\n node,\n status\n };\n}\nfunction useScript(src, options) {\n const [status, setStatus] = useState(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return \"idle\";\n }\n if (typeof window === \"undefined\") {\n return \"loading\";\n }\n return cachedScriptStatuses.get(src) ?? \"loading\";\n });\n useEffect(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return;\n }\n const cachedScriptStatus = cachedScriptStatuses.get(src);\n if (cachedScriptStatus === \"ready\" || cachedScriptStatus === \"error\") {\n setStatus(cachedScriptStatus);\n return;\n }\n const script = getScriptNode(src);\n let scriptNode = script.node;\n if (!scriptNode) {\n scriptNode = document.createElement(\"script\");\n scriptNode.src = src;\n scriptNode.async = true;\n if (options == null ? void 0 : options.id) {\n scriptNode.id = options.id;\n }\n scriptNode.setAttribute(\"data-status\", \"loading\");\n document.body.appendChild(scriptNode);\n const setAttributeFromEvent = (event) => {\n const scriptStatus = event.type === \"load\" ? \"ready\" : \"error\";\n scriptNode == null ? void 0 : scriptNode.setAttribute(\"data-status\", scriptStatus);\n };\n scriptNode.addEventListener(\"load\", setAttributeFromEvent);\n scriptNode.addEventListener(\"error\", setAttributeFromEvent);\n } else {\n setStatus(script.status ?? cachedScriptStatus ?? \"loading\");\n }\n const setStateFromEvent = (event) => {\n const newStatus = event.type === \"load\" ? \"ready\" : \"error\";\n setStatus(newStatus);\n cachedScriptStatuses.set(src, newStatus);\n };\n scriptNode.addEventListener(\"load\", setStateFromEvent);\n scriptNode.addEventListener(\"error\", setStateFromEvent);\n return () => {\n if (scriptNode) {\n scriptNode.removeEventListener(\"load\", setStateFromEvent);\n scriptNode.removeEventListener(\"error\", setStateFromEvent);\n }\n if (scriptNode && (options == null ? void 0 : options.removeOnUnmount)) {\n scriptNode.remove();\n cachedScriptStatuses.delete(src);\n }\n };\n }, [src, options == null ? void 0 : options.shouldPreventLoad, options == null ? void 0 : options.removeOnUnmount, options == null ? void 0 : options.id]);\n return status;\n}\nvar IS_SERVER5 = typeof window === \"undefined\";\nfunction useScrollLock(options = {}) {\n const { autoLock = true, lockTarget, widthReflow = true } = options;\n const [isLocked, setIsLocked] = useState(false);\n const target = useRef(null);\n const originalStyle = useRef(null);\n const lock = () => {\n if (target.current) {\n const { overflow, paddingRight } = target.current.style;\n originalStyle.current = { overflow, paddingRight };\n if (widthReflow) {\n const offsetWidth = target.current === document.body ? window.innerWidth : target.current.offsetWidth;\n const currentPaddingRight = parseInt(window.getComputedStyle(target.current).paddingRight, 10) || 0;\n const scrollbarWidth = offsetWidth - target.current.scrollWidth;\n target.current.style.paddingRight = `${scrollbarWidth + currentPaddingRight}px`;\n }\n target.current.style.overflow = \"hidden\";\n setIsLocked(true);\n }\n };\n const unlock = () => {\n if (target.current && originalStyle.current) {\n target.current.style.overflow = originalStyle.current.overflow;\n if (widthReflow) {\n target.current.style.paddingRight = originalStyle.current.paddingRight;\n }\n }\n setIsLocked(false);\n };\n useIsomorphicLayoutEffect(() => {\n if (IS_SERVER5)\n return;\n if (lockTarget) {\n target.current = typeof lockTarget === \"string\" ? document.querySelector(lockTarget) : lockTarget;\n }\n if (!target.current) {\n target.current = document.body;\n }\n if (autoLock) {\n lock();\n }\n return () => {\n unlock();\n };\n }, [autoLock, lockTarget, widthReflow]);\n return { isLocked, lock, unlock };\n}\nvar IS_SERVER6 = typeof window === \"undefined\";\nfunction useSessionStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER6) {\n return initialValueToUse;\n }\n try {\n const raw = window.sessionStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading sessionStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER6) {\n console.warn(\n `Tried setting sessionStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.sessionStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"session-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting sessionStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n const removeValue = useEventCallback(() => {\n if (IS_SERVER6) {\n console.warn(\n `Tried removing sessionStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n window.sessionStorage.removeItem(key);\n setStoredValue(defaultValue);\n window.dispatchEvent(new StorageEvent(\"session-storage\", { key }));\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"session-storage\", handleStorageChange);\n return [storedValue, setValue, removeValue];\n}\nfunction useStep(maxStep) {\n const [currentStep, setCurrentStep] = useState(1);\n const canGoToNextStep = currentStep + 1 <= maxStep;\n const canGoToPrevStep = currentStep - 1 > 0;\n const setStep = useCallback(\n (step) => {\n const newStep = step instanceof Function ? step(currentStep) : step;\n if (newStep >= 1 && newStep <= maxStep) {\n setCurrentStep(newStep);\n return;\n }\n throw new Error(\"Step not valid\");\n },\n [maxStep, currentStep]\n );\n const goToNextStep = useCallback(() => {\n if (canGoToNextStep) {\n setCurrentStep((step) => step + 1);\n }\n }, [canGoToNextStep]);\n const goToPrevStep = useCallback(() => {\n if (canGoToPrevStep) {\n setCurrentStep((step) => step - 1);\n }\n }, [canGoToPrevStep]);\n const reset = useCallback(() => {\n setCurrentStep(1);\n }, []);\n return [\n currentStep,\n {\n goToNextStep,\n goToPrevStep,\n canGoToNextStep,\n canGoToPrevStep,\n setStep,\n reset\n }\n ];\n}\n\n// src/useTernaryDarkMode/useTernaryDarkMode.ts\nvar COLOR_SCHEME_QUERY2 = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY2 = \"usehooks-ts-ternary-dark-mode\";\nfunction useTernaryDarkMode({\n defaultValue = \"system\",\n localStorageKey = LOCAL_STORAGE_KEY2,\n initializeWithValue = true\n} = {}) {\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY2, { initializeWithValue });\n const [mode, setMode] = useLocalStorage(localStorageKey, defaultValue, {\n initializeWithValue\n });\n const isDarkMode = mode === \"dark\" || mode === \"system\" && isDarkOS;\n const toggleTernaryDarkMode = () => {\n const modes = [\"light\", \"system\", \"dark\"];\n setMode((prevMode) => {\n const nextIndex = (modes.indexOf(prevMode) + 1) % modes.length;\n return modes[nextIndex];\n });\n };\n return {\n isDarkMode,\n ternaryDarkMode: mode,\n setTernaryDarkMode: setMode,\n toggleTernaryDarkMode\n };\n}\nfunction useTimeout(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (!delay && delay !== 0) {\n return;\n }\n const id = setTimeout(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearTimeout(id);\n };\n }, [delay]);\n}\nfunction useToggle(defaultValue) {\n const [value, setValue] = useState(!!defaultValue);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return [value, toggle, setValue];\n}\nvar IS_SERVER7 = typeof window === \"undefined\";\nfunction useWindowSize(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER7) {\n initializeWithValue = false;\n }\n const [windowSize, setWindowSize] = useState(() => {\n if (initializeWithValue) {\n return {\n width: window.innerWidth,\n height: window.innerHeight\n };\n }\n return {\n width: void 0,\n height: void 0\n };\n });\n const debouncedSetWindowSize = useDebounceCallback(\n setWindowSize,\n options.debounceDelay\n );\n function handleSize() {\n const setSize = options.debounceDelay ? debouncedSetWindowSize : setWindowSize;\n setSize({\n width: window.innerWidth,\n height: window.innerHeight\n });\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return windowSize;\n}\n\nexport { useBoolean, useClickAnyWhere, useCopyToClipboard, useCountdown, useCounter, useDarkMode, useDebounceCallback, useDebounceValue, useDocumentTitle, useEventCallback, useEventListener, useHover, useIntersectionObserver, useInterval, useIsClient, useIsMounted, useIsomorphicLayoutEffect, useLocalStorage, useMap, useMediaQuery, useOnClickOutside, useReadLocalStorage, useResizeObserver, useScreen, useScript, useScrollLock, useSessionStorage, useStep, useTernaryDarkMode, useTimeout, useToggle, useUnmount, useWindowSize };\n"],"names":["useCopyToClipboard","copiedText","setCopiedText","useState","copy","useCallback","text","error"],"mappings":"sIAgDA,SAASA,GAAqB,CAC5B,KAAM,CAACC,EAAYC,CAAa,EAAIC,EAAAA,SAAS,IAAI,EAC3CC,EAAOC,cAAY,MAAOC,GAAS,CACvC,GAAI,EAAE,WAAa,MAAgB,UAAU,WAC3C,eAAQ,KAAK,yBAAyB,EAC/B,GAET,GAAI,CACF,aAAM,UAAU,UAAU,UAAUA,CAAI,EACxCJ,EAAcI,CAAI,EACX,EACR,OAAQC,EAAO,CACd,eAAQ,KAAK,cAAeA,CAAK,EACjCL,EAAc,IAAI,EACX,EACb,CACG,EAAE,EAAE,EACL,MAAO,CAACD,EAAYG,CAAI,CAC1B","x_google_ignoreList":[0]}
|
package/dist/index.cjs534.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),v=require("./index.cjs474.js"),I=require("./index.cjs473.js"),M=require("./index.
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),v=require("./index.cjs474.js"),I=require("./index.cjs473.js"),M=require("./index.cjs491.js"),f=require("./index.cjs249.js");function _(s){const u=s+"CollectionProvider",[E,A]=v.createContextScope(u),[N,d]=E(u,{collectionRef:{current:null},itemMap:new Map}),p=c=>{const{scope:e,children:l}=c,t=r.useRef(null),o=r.useRef(new Map).current;return f.jsxRuntimeExports.jsx(N,{scope:e,itemMap:o,collectionRef:t,children:l})};p.displayName=u;const a=s+"CollectionSlot",T=M.createSlot(a),C=r.forwardRef((c,e)=>{const{scope:l,children:t}=c,o=d(a,l),n=I.useComposedRefs(e,o.collectionRef);return f.jsxRuntimeExports.jsx(T,{ref:n,children:t})});C.displayName=a;const m=s+"CollectionItemSlot",x="data-radix-collection-item",j=M.createSlot(m),R=r.forwardRef((c,e)=>{const{scope:l,children:t,...o}=c,n=r.useRef(null),S=I.useComposedRefs(e,n),i=d(m,l);return r.useEffect(()=>(i.itemMap.set(n,{ref:n,...o}),()=>void i.itemMap.delete(n))),f.jsxRuntimeExports.jsx(j,{[x]:"",ref:S,children:t})});R.displayName=m;function y(c){const e=d(s+"CollectionConsumer",c);return r.useCallback(()=>{const t=e.collectionRef.current;if(!t)return[];const o=Array.from(t.querySelectorAll(`[${x}]`));return Array.from(e.itemMap.values()).sort((i,O)=>o.indexOf(i.ref.current)-o.indexOf(O.ref.current))},[e.collectionRef,e.itemMap])}return[{Provider:p,Slot:C,ItemSlot:R},y,A]}exports.createCollection=_;
|
2
2
|
//# sourceMappingURL=index.cjs534.js.map
|
package/dist/index.cjs621.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react"),g=require("./index.cjs620.js"),o=require("./index.cjs657.js"),y=require("./index.cjs622.js"),q=require("./index.cjs639.js"),B=require("./index.cjs644.js"),P=require("./index.cjs623.js"),l=require("./index.cjs658.js"),S=require("./index.cjs625.js"),E=require("./index.
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react"),g=require("./index.cjs620.js"),o=require("./index.cjs657.js"),y=require("./index.cjs622.js"),q=require("./index.cjs639.js"),B=require("./index.cjs644.js"),P=require("./index.cjs623.js"),l=require("./index.cjs658.js"),S=require("./index.cjs625.js"),E=require("./index.cjs491.js");function j(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const t=j(b),c=t.forwardRef((e,n)=>{const{size:r=o.baseButtonPropDefs.size.default}=e,{className:a,children:s,asChild:u,color:d,radius:p,disabled:i=e.loading,...m}=P.extractProps(e,o.baseButtonPropDefs,S.marginPropDefs),f=u?E.Root:"button";return t.createElement(f,{"data-disabled":i||void 0,"data-accent-color":d,"data-radius":p,...m,ref:n,className:g("rt-reset","rt-BaseButton",a),disabled:i},e.loading?t.createElement(t.Fragment,null,t.createElement("span",{style:{display:"contents",visibility:"hidden"},"aria-hidden":!0},s),t.createElement(B.VisuallyHidden,null,s),t.createElement(y.Flex,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},t.createElement("span",null,t.createElement(q.Spinner,{size:l.mapResponsiveProp(r,l.mapButtonSizeToSpinnerSize)})))):s)});c.displayName="BaseButton";exports.BaseButton=c;
|
2
2
|
//# sourceMappingURL=index.cjs621.js.map
|
package/dist/index.cjs626.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.cjs491.js"),t=e.Root;exports.Slot=t;
|
2
2
|
//# sourceMappingURL=index.cjs626.js.map
|
package/dist/index.cjs630.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react"),A=require("./index.cjs620.js"),G=require("./index.cjs641.js"),t=require("./index.cjs642.js"),N=require("./index.cjs643.js"),O=require("./index.cjs535.js"),j=require("./index.
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react"),A=require("./index.cjs620.js"),G=require("./index.cjs641.js"),t=require("./index.cjs642.js"),N=require("./index.cjs643.js"),O=require("./index.cjs535.js"),j=require("./index.cjs491.js");function M(o){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:()=>o[e]})}}return n.default=o,Object.freeze(n)}const a=M(q),i=()=>{},E=a.createContext(void 0),b=a.forwardRef((o,n)=>a.useContext(E)===void 0?a.createElement(N.Provider,{delayDuration:200},a.createElement(O.Provider,{dir:"ltr"},a.createElement(x,{...o,ref:n}))):a.createElement(R,{...o,ref:n}));b.displayName="Theme";const x=a.forwardRef((o,n)=>{const{appearance:e=t.themePropDefs.appearance.default,accentColor:r=t.themePropDefs.accentColor.default,grayColor:s=t.themePropDefs.grayColor.default,panelBackground:u=t.themePropDefs.panelBackground.default,radius:c=t.themePropDefs.radius.default,scaling:l=t.themePropDefs.scaling.default,hasBackground:d=t.themePropDefs.hasBackground.default,...f}=o,[p,g]=a.useState(e);a.useEffect(()=>g(e),[e]);const[P,h]=a.useState(r);a.useEffect(()=>h(r),[r]);const[k,C]=a.useState(s);a.useEffect(()=>C(s),[s]);const[B,m]=a.useState(u);a.useEffect(()=>m(u),[u]);const[D,v]=a.useState(c);a.useEffect(()=>v(c),[c]);const[y,S]=a.useState(l);return a.useEffect(()=>S(l),[l]),a.createElement(R,{...f,ref:n,isRoot:!0,hasBackground:d,appearance:p,accentColor:P,grayColor:k,panelBackground:B,radius:D,scaling:y,onAppearanceChange:g,onAccentColorChange:h,onGrayColorChange:C,onPanelBackgroundChange:m,onRadiusChange:v,onScalingChange:S})});x.displayName="ThemeRoot";const R=a.forwardRef((o,n)=>{const e=a.useContext(E),{asChild:r,isRoot:s,hasBackground:u,appearance:c=(e==null?void 0:e.appearance)??t.themePropDefs.appearance.default,accentColor:l=(e==null?void 0:e.accentColor)??t.themePropDefs.accentColor.default,grayColor:d=(e==null?void 0:e.resolvedGrayColor)??t.themePropDefs.grayColor.default,panelBackground:f=(e==null?void 0:e.panelBackground)??t.themePropDefs.panelBackground.default,radius:p=(e==null?void 0:e.radius)??t.themePropDefs.radius.default,scaling:g=(e==null?void 0:e.scaling)??t.themePropDefs.scaling.default,onAppearanceChange:P=i,onAccentColorChange:h=i,onGrayColorChange:k=i,onPanelBackgroundChange:C=i,onRadiusChange:B=i,onScalingChange:m=i,...D}=o,v=r?j.Root:"div",y=d==="auto"?G.getMatchingGrayColor(l):d,S=o.appearance==="light"||o.appearance==="dark",T=u===void 0?s||S:u;return a.createElement(E.Provider,{value:a.useMemo(()=>({appearance:c,accentColor:l,grayColor:d,resolvedGrayColor:y,panelBackground:f,radius:p,scaling:g,onAppearanceChange:P,onAccentColorChange:h,onGrayColorChange:k,onPanelBackgroundChange:C,onRadiusChange:B,onScalingChange:m}),[c,l,d,y,f,p,g,P,h,k,C,B,m])},a.createElement(v,{"data-is-root-theme":s?"true":"false","data-accent-color":l,"data-gray-color":y,"data-has-background":T?"true":"false","data-panel-background":f,"data-radius":p,"data-scaling":g,ref:n,...D,className:A("radix-themes",{light:c==="light",dark:c==="dark"},D.className)}))});R.displayName="ThemeImpl";exports.Theme=b;exports.ThemeContext=E;
|
2
2
|
//# sourceMappingURL=index.cjs630.js.map
|
package/dist/index.cjs631.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react"),P=require("./index.cjs472.js"),S=require("./index.cjs473.js"),H=require("./index.cjs474.js"),L=require("./index.
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react"),P=require("./index.cjs472.js"),S=require("./index.cjs473.js"),H=require("./index.cjs474.js"),L=require("./index.cjs485.js"),G=require("./index.cjs488.js"),K=require("./index.cjs486.js"),z=require("./index.cjs478.js"),f=require("./index.cjs536.js"),U=require("./index.cjs487.js"),y=require("./index.cjs484.js"),N=require("./index.cjs476.js"),V=require("./index.cjs491.js"),W=require("./index.cjs475.js"),Z=require("./index.cjs490.js"),B=require("./index.cjs489.js"),u=require("./index.cjs249.js");function J(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:()=>e[o]})}}return n.default=e,Object.freeze(n)}const i=J(I);var C="Popover",[F,Q]=H.createContextScope(C,[f.createPopperScope]),g=f.createPopperScope(),[X,d]=F(C),E=e=>{const{__scopePopover:n,children:o,open:s,defaultOpen:t,onOpenChange:r,modal:c=!1}=e,a=g(n),p=i.useRef(null),[l,m]=i.useState(!1),[R=!1,v]=W.useControllableState({prop:s,defaultProp:t,onChange:r});return u.jsxRuntimeExports.jsx(f.Root,{...a,children:u.jsxRuntimeExports.jsx(X,{scope:n,contentId:z.useId(),triggerRef:p,open:R,onOpenChange:v,onOpenToggle:i.useCallback(()=>v(h=>!h),[v]),hasCustomAnchor:l,onCustomAnchorAdd:i.useCallback(()=>m(!0),[]),onCustomAnchorRemove:i.useCallback(()=>m(!1),[]),modal:c,children:o})})};E.displayName=C;var q="PopoverAnchor",j=i.forwardRef((e,n)=>{const{__scopePopover:o,...s}=e,t=d(q,o),r=g(o),{onCustomAnchorAdd:c,onCustomAnchorRemove:a}=t;return i.useEffect(()=>(c(),()=>a()),[c,a]),u.jsxRuntimeExports.jsx(f.Anchor,{...r,...s,ref:n})});j.displayName=q;var D="PopoverTrigger",A=i.forwardRef((e,n)=>{const{__scopePopover:o,...s}=e,t=d(D,o),r=g(o),c=S.useComposedRefs(n,t.triggerRef),a=u.jsxRuntimeExports.jsx(N.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":t.open,"aria-controls":t.contentId,"data-state":$(t.open),...s,ref:c,onClick:P.composeEventHandlers(e.onClick,t.onOpenToggle)});return t.hasCustomAnchor?a:u.jsxRuntimeExports.jsx(f.Anchor,{asChild:!0,...r,children:a})});A.displayName=D;var O="PopoverPortal",[Y,ee]=F(O,{forceMount:void 0}),_=e=>{const{__scopePopover:n,forceMount:o,children:s,container:t}=e,r=d(O,n);return u.jsxRuntimeExports.jsx(Y,{scope:n,forceMount:o,children:u.jsxRuntimeExports.jsx(y.Presence,{present:o||r.open,children:u.jsxRuntimeExports.jsx(U.Portal,{asChild:!0,container:t,children:s})})})};_.displayName=O;var x="PopoverContent",b=i.forwardRef((e,n)=>{const o=ee(x,e.__scopePopover),{forceMount:s=o.forceMount,...t}=e,r=d(x,e.__scopePopover);return u.jsxRuntimeExports.jsx(y.Presence,{present:s||r.open,children:r.modal?u.jsxRuntimeExports.jsx(te,{...t,ref:n}):u.jsxRuntimeExports.jsx(re,{...t,ref:n})})});b.displayName=x;var oe=V.createSlot("PopoverContent.RemoveScroll"),te=i.forwardRef((e,n)=>{const o=d(x,e.__scopePopover),s=i.useRef(null),t=S.useComposedRefs(n,s),r=i.useRef(!1);return i.useEffect(()=>{const c=s.current;if(c)return Z.hideOthers(c)},[]),u.jsxRuntimeExports.jsx(B,{as:oe,allowPinchZoom:!0,children:u.jsxRuntimeExports.jsx(M,{...e,ref:t,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P.composeEventHandlers(e.onCloseAutoFocus,c=>{var a;c.preventDefault(),r.current||(a=o.triggerRef.current)==null||a.focus()}),onPointerDownOutside:P.composeEventHandlers(e.onPointerDownOutside,c=>{const a=c.detail.originalEvent,p=a.button===0&&a.ctrlKey===!0,l=a.button===2||p;r.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:P.composeEventHandlers(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),re=i.forwardRef((e,n)=>{const o=d(x,e.__scopePopover),s=i.useRef(!1),t=i.useRef(!1);return u.jsxRuntimeExports.jsx(M,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var c,a;(c=e.onCloseAutoFocus)==null||c.call(e,r),r.defaultPrevented||(s.current||(a=o.triggerRef.current)==null||a.focus(),r.preventDefault()),s.current=!1,t.current=!1},onInteractOutside:r=>{var p,l;(p=e.onInteractOutside)==null||p.call(e,r),r.defaultPrevented||(s.current=!0,r.detail.originalEvent.type==="pointerdown"&&(t.current=!0));const c=r.target;((l=o.triggerRef.current)==null?void 0:l.contains(c))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&t.current&&r.preventDefault()}})}),M=i.forwardRef((e,n)=>{const{__scopePopover:o,trapFocus:s,onOpenAutoFocus:t,onCloseAutoFocus:r,disableOutsidePointerEvents:c,onEscapeKeyDown:a,onPointerDownOutside:p,onFocusOutside:l,onInteractOutside:m,...R}=e,v=d(x,o),h=g(o);return G.useFocusGuards(),u.jsxRuntimeExports.jsx(K.FocusScope,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:t,onUnmountAutoFocus:r,children:u.jsxRuntimeExports.jsx(L.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:m,onEscapeKeyDown:a,onPointerDownOutside:p,onFocusOutside:l,onDismiss:()=>v.onOpenChange(!1),children:u.jsxRuntimeExports.jsx(f.Content,{"data-state":$(v.open),role:"dialog",id:v.contentId,...h,...R,ref:n,style:{...R.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",w=i.forwardRef((e,n)=>{const{__scopePopover:o,...s}=e,t=d(T,o);return u.jsxRuntimeExports.jsx(N.Primitive.button,{type:"button",...s,ref:n,onClick:P.composeEventHandlers(e.onClick,()=>t.onOpenChange(!1))})});w.displayName=T;var ne="PopoverArrow",k=i.forwardRef((e,n)=>{const{__scopePopover:o,...s}=e,t=g(o);return u.jsxRuntimeExports.jsx(f.Arrow,{...t,...s,ref:n})});k.displayName=ne;function $(e){return e?"open":"closed"}var se=E,ce=j,ae=A,ie=_,ue=b,pe=w;exports.Anchor=ce;exports.Close=pe;exports.Content=ue;exports.Popover=E;exports.PopoverAnchor=j;exports.PopoverArrow=k;exports.PopoverClose=w;exports.PopoverContent=b;exports.PopoverPortal=_;exports.PopoverTrigger=A;exports.Portal=ie;exports.Root=se;exports.Trigger=ae;exports.createPopoverScope=Q;
|
2
2
|
//# sourceMappingURL=index.cjs631.js.map
|
package/dist/index.cjs643.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react"),y=require("./index.cjs472.js"),O=require("./index.cjs473.js"),B=require("./index.cjs474.js"),U=require("./index.
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react"),y=require("./index.cjs472.js"),O=require("./index.cjs473.js"),B=require("./index.cjs474.js"),U=require("./index.cjs485.js"),g=require("./index.cjs536.js"),V=require("./index.cjs484.js"),Y=require("./index.cjs476.js"),X=require("./index.cjs491.js"),z=require("./index.cjs645.js"),x=require("./index.cjs249.js");function K(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(o,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return o.default=t,Object.freeze(o)}const c=K(F);var[R,W]=B.createContextScope("Tooltip",[g.createPopperScope]),_=g.createPopperScope(),D="TooltipProvider",J=700,L="tooltip.open",[Q,k]=R(D),A=t=>{const{__scopeTooltip:o,delayDuration:e=J,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:a}=t,s=c.useRef(!0),d=c.useRef(!1),i=c.useRef(0);return c.useEffect(()=>{const u=i.current;return()=>window.clearTimeout(u)},[]),x.jsxRuntimeExports.jsx(Q,{scope:o,isOpenDelayedRef:s,delayDuration:e,onOpen:c.useCallback(()=>{window.clearTimeout(i.current),s.current=!1},[]),onClose:c.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:c.useCallback(u=>{d.current=u},[]),disableHoverableContent:n,children:a})};A.displayName=D;var M="Tooltip",[de,b]=R(M),j="TooltipTrigger",S=c.forwardRef((t,o)=>{const{__scopeTooltip:e,...r}=t,n=b(j,e),a=k(j,e),s=_(e),d=c.useRef(null),i=O.useComposedRefs(o,d,n.onTriggerChange),u=c.useRef(!1),l=c.useRef(!1),p=c.useCallback(()=>u.current=!1,[]);return c.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),x.jsxRuntimeExports.jsx(g.Anchor,{asChild:!0,...s,children:x.jsxRuntimeExports.jsx(Y.Primitive.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:y.composeEventHandlers(t.onPointerMove,f=>{f.pointerType!=="touch"&&!l.current&&!a.isPointerInTransitRef.current&&(n.onTriggerEnter(),l.current=!0)}),onPointerLeave:y.composeEventHandlers(t.onPointerLeave,()=>{n.onTriggerLeave(),l.current=!1}),onPointerDown:y.composeEventHandlers(t.onPointerDown,()=>{n.open&&n.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:y.composeEventHandlers(t.onFocus,()=>{u.current||n.onOpen()}),onBlur:y.composeEventHandlers(t.onBlur,n.onClose),onClick:y.composeEventHandlers(t.onClick,n.onClose)})})});S.displayName=j;var Z="TooltipPortal",[xe,ee]=R(Z,{forceMount:void 0}),E="TooltipContent",H=c.forwardRef((t,o)=>{const e=ee(E,t.__scopeTooltip),{forceMount:r=e.forceMount,side:n="top",...a}=t,s=b(E,t.__scopeTooltip);return x.jsxRuntimeExports.jsx(V.Presence,{present:r||s.open,children:s.disableHoverableContent?x.jsxRuntimeExports.jsx(I,{side:n,...a,ref:o}):x.jsxRuntimeExports.jsx(te,{side:n,...a,ref:o})})}),te=c.forwardRef((t,o)=>{const e=b(E,t.__scopeTooltip),r=k(E,t.__scopeTooltip),n=c.useRef(null),a=O.useComposedRefs(o,n),[s,d]=c.useState(null),{trigger:i,onClose:u}=e,l=n.current,{onPointerInTransitChange:p}=r,f=c.useCallback(()=>{d(null),p(!1)},[p]),T=c.useCallback((v,h)=>{const m=v.currentTarget,C={x:v.clientX,y:v.clientY},P=se(C,m.getBoundingClientRect()),w=ie(C,P),G=ce(h.getBoundingClientRect()),$=le([...w,...G]);d($),p(!0)},[p]);return c.useEffect(()=>()=>f(),[f]),c.useEffect(()=>{if(i&&l){const v=m=>T(m,l),h=m=>T(m,i);return i.addEventListener("pointerleave",v),l.addEventListener("pointerleave",h),()=>{i.removeEventListener("pointerleave",v),l.removeEventListener("pointerleave",h)}}},[i,l,T,f]),c.useEffect(()=>{if(s){const v=h=>{const m=h.target,C={x:h.clientX,y:h.clientY},P=(i==null?void 0:i.contains(m))||(l==null?void 0:l.contains(m)),w=!ae(C,s);P?f():w&&(f(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[i,l,s,u,f]),x.jsxRuntimeExports.jsx(I,{...t,ref:a})}),[oe,re]=R(M,{isInside:!1}),ne=X.createSlottable("TooltipContent"),I=c.forwardRef((t,o)=>{const{__scopeTooltip:e,children:r,"aria-label":n,onEscapeKeyDown:a,onPointerDownOutside:s,...d}=t,i=b(E,e),u=_(e),{onClose:l}=i;return c.useEffect(()=>(document.addEventListener(L,l),()=>document.removeEventListener(L,l)),[l]),c.useEffect(()=>{if(i.trigger){const p=f=>{const T=f.target;T!=null&&T.contains(i.trigger)&&l()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[i.trigger,l]),x.jsxRuntimeExports.jsx(U.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:p=>p.preventDefault(),onDismiss:l,children:x.jsxRuntimeExports.jsxs(g.Content,{"data-state":i.stateAttribute,...u,...d,ref:o,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[x.jsxRuntimeExports.jsx(ne,{children:r}),x.jsxRuntimeExports.jsx(oe,{scope:e,isInside:!0,children:x.jsxRuntimeExports.jsx(z.Root,{id:i.contentId,role:"tooltip",children:n||r})})]})})});H.displayName=E;var N="TooltipArrow",q=c.forwardRef((t,o)=>{const{__scopeTooltip:e,...r}=t,n=_(e);return re(N,e).isInside?null:x.jsxRuntimeExports.jsx(g.Arrow,{...n,...r,ref:o})});q.displayName=N;function se(t,o){const e=Math.abs(o.top-t.y),r=Math.abs(o.bottom-t.y),n=Math.abs(o.right-t.x),a=Math.abs(o.left-t.x);switch(Math.min(e,r,n,a)){case a:return"left";case n:return"right";case e:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function ie(t,o,e=5){const r=[];switch(o){case"top":r.push({x:t.x-e,y:t.y+e},{x:t.x+e,y:t.y+e});break;case"bottom":r.push({x:t.x-e,y:t.y-e},{x:t.x+e,y:t.y-e});break;case"left":r.push({x:t.x+e,y:t.y-e},{x:t.x+e,y:t.y+e});break;case"right":r.push({x:t.x-e,y:t.y-e},{x:t.x-e,y:t.y+e});break}return r}function ce(t){const{top:o,right:e,bottom:r,left:n}=t;return[{x:n,y:o},{x:e,y:o},{x:e,y:r},{x:n,y:r}]}function ae(t,o){const{x:e,y:r}=t;let n=!1;for(let a=0,s=o.length-1;a<o.length;s=a++){const d=o[a].x,i=o[a].y,u=o[s].x,l=o[s].y;i>r!=l>r&&e<(u-d)*(r-i)/(l-i)+d&&(n=!n)}return n}function le(t){const o=t.slice();return o.sort((e,r)=>e.x<r.x?-1:e.x>r.x?1:e.y<r.y?-1:e.y>r.y?1:0),ue(o)}function ue(t){if(t.length<=1)return t.slice();const o=[];for(let r=0;r<t.length;r++){const n=t[r];for(;o.length>=2;){const a=o[o.length-1],s=o[o.length-2];if((a.x-s.x)*(n.y-s.y)>=(a.y-s.y)*(n.x-s.x))o.pop();else break}o.push(n)}o.pop();const e=[];for(let r=t.length-1;r>=0;r--){const n=t[r];for(;e.length>=2;){const a=e[e.length-1],s=e[e.length-2];if((a.x-s.x)*(n.y-s.y)>=(a.y-s.y)*(n.x-s.x))e.pop();else break}e.push(n)}return e.pop(),o.length===1&&e.length===1&&o[0].x===e[0].x&&o[0].y===e[0].y?o:o.concat(e)}var pe=A;exports.Provider=pe;exports.TooltipArrow=q;exports.TooltipContent=H;exports.TooltipProvider=A;exports.TooltipTrigger=S;exports.createTooltipScope=W;
|
2
2
|
//# sourceMappingURL=index.cjs643.js.map
|
package/dist/index.cjs668.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),b=require("./index.cjs669.js"),o=require("./index.cjs646.js"),p=require("./index.
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),b=require("./index.cjs669.js"),o=require("./index.cjs646.js"),p=require("./index.cjs677.js");function v(t){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(c,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}return c.default=t,Object.freeze(c)}const u=v(f);var m=b.styleSingleton(),r="data-scroll-locked",h=function(t,c,e,n){var i=t.left,l=t.top,d=t.right,a=t.gap;return e===void 0&&(e="margin"),`
|
2
2
|
.`.concat(o.noScrollbarsClassName,` {
|
3
3
|
overflow: hidden `).concat(n,`;
|
4
4
|
padding-right: `).concat(a,"px ").concat(n,`;
|
package/dist/index.cjs669.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index.
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index.cjs678.js");var i=function(){var t=r.styleHookSingleton(),n=function(e){var l=e.styles,o=e.dynamic;return t(l,o),null};return n};exports.styleSingleton=i;
|
2
2
|
//# sourceMappingURL=index.cjs669.js.map
|
package/dist/index.cjs677.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var a={left:0,top:0,right:0,gap:0},r=function(t){return parseInt(t||"",10)||0},o=function(t){var i=window.getComputedStyle(document.body),n=i[t==="padding"?"paddingLeft":"marginLeft"],e=i[t==="padding"?"paddingTop":"marginTop"],d=i[t==="padding"?"paddingRight":"marginRight"];return[r(n),r(e),r(d)]},g=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return a;var i=o(t),n=document.documentElement.clientWidth,e=window.innerWidth;return{left:i[0],top:i[1],right:i[2],gap:Math.max(0,e-n+i[2]-i[0])}};exports.getGapWidth=g;exports.zeroGap=a;
|
2
2
|
//# sourceMappingURL=index.cjs677.js.map
|
package/dist/index.cjs677.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs677.js","sources":["../node_modules/react-
|
1
|
+
{"version":3,"file":"index.cjs677.js","sources":["../node_modules/react-remove-scroll-bar/dist/es2015/utils.js"],"sourcesContent":["export var zeroGap = {\n left: 0,\n top: 0,\n right: 0,\n gap: 0,\n};\nvar parse = function (x) { return parseInt(x || '', 10) || 0; };\nvar getOffset = function (gapMode) {\n var cs = window.getComputedStyle(document.body);\n var left = cs[gapMode === 'padding' ? 'paddingLeft' : 'marginLeft'];\n var top = cs[gapMode === 'padding' ? 'paddingTop' : 'marginTop'];\n var right = cs[gapMode === 'padding' ? 'paddingRight' : 'marginRight'];\n return [parse(left), parse(top), parse(right)];\n};\nexport var getGapWidth = function (gapMode) {\n if (gapMode === void 0) { gapMode = 'margin'; }\n if (typeof window === 'undefined') {\n return zeroGap;\n }\n var offsets = getOffset(gapMode);\n var documentWidth = document.documentElement.clientWidth;\n var windowWidth = window.innerWidth;\n return {\n left: offsets[0],\n top: offsets[1],\n right: offsets[2],\n gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]),\n };\n};\n"],"names":["zeroGap","parse","x","getOffset","gapMode","cs","left","top","right","getGapWidth","offsets","documentWidth","windowWidth"],"mappings":"gFAAU,IAACA,EAAU,CACjB,KAAM,EACN,IAAK,EACL,MAAO,EACP,IAAK,CACT,EACIC,EAAQ,SAAUC,EAAG,CAAE,OAAO,SAASA,GAAK,GAAI,EAAE,GAAK,CAAI,EAC3DC,EAAY,SAAUC,EAAS,CAC/B,IAAIC,EAAK,OAAO,iBAAiB,SAAS,IAAI,EAC1CC,EAAOD,EAAGD,IAAY,UAAY,cAAgB,YAAY,EAC9DG,EAAMF,EAAGD,IAAY,UAAY,aAAe,WAAW,EAC3DI,EAAQH,EAAGD,IAAY,UAAY,eAAiB,aAAa,EACrE,MAAO,CAACH,EAAMK,CAAI,EAAGL,EAAMM,CAAG,EAAGN,EAAMO,CAAK,CAAC,CACjD,EACWC,EAAc,SAAUL,EAAS,CAExC,GADIA,IAAY,SAAUA,EAAU,UAChC,OAAO,OAAW,IAClB,OAAOJ,EAEX,IAAIU,EAAUP,EAAUC,CAAO,EAC3BO,EAAgB,SAAS,gBAAgB,YACzCC,EAAc,OAAO,WACzB,MAAO,CACH,KAAMF,EAAQ,CAAC,EACf,IAAKA,EAAQ,CAAC,EACd,MAAOA,EAAQ,CAAC,EAChB,IAAK,KAAK,IAAI,EAAGE,EAAcD,EAAgBD,EAAQ,CAAC,EAAIA,EAAQ,CAAC,CAAC,CACzE,CACL","x_google_ignoreList":[0]}
|
package/dist/index.cjs678.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),c=require("./index.cjs679.js");function u(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const i=u(r);var a=function(){var e=c.stylesheetSingleton();return function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}};exports.styleHookSingleton=a;
|
2
2
|
//# sourceMappingURL=index.cjs678.js.map
|
package/dist/index.cjs678.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs678.js","sources":["../node_modules/react-style-singleton/dist/es2015/
|
1
|
+
{"version":3,"file":"index.cjs678.js","sources":["../node_modules/react-style-singleton/dist/es2015/hook.js"],"sourcesContent":["import * as React from 'react';\nimport { stylesheetSingleton } from './singleton';\n/**\n * creates a hook to control style singleton\n * @see {@link styleSingleton} for a safer component version\n * @example\n * ```tsx\n * const useStyle = styleHookSingleton();\n * ///\n * useStyle('body { overflow: hidden}');\n */\nexport var styleHookSingleton = function () {\n var sheet = stylesheetSingleton();\n return function (styles, isDynamic) {\n React.useEffect(function () {\n sheet.add(styles);\n return function () {\n sheet.remove();\n };\n }, [styles && isDynamic]);\n };\n};\n"],"names":["styleHookSingleton","sheet","stylesheetSingleton","styles","isDynamic","React"],"mappings":"kaAWU,IAACA,EAAqB,UAAY,CACxC,IAAIC,EAAQC,EAAAA,oBAAqB,EACjC,OAAO,SAAUC,EAAQC,EAAW,CAChCC,EAAM,UAAU,UAAY,CACxB,OAAAJ,EAAM,IAAIE,CAAM,EACT,UAAY,CACfF,EAAM,OAAQ,CACjB,CACb,EAAW,CAACE,GAAUC,CAAS,CAAC,CAC3B,CACL","x_google_ignoreList":[0]}
|
package/dist/index.cjs679.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index.cjs680.js");function r(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=o.getNonce();return e&&t.setAttribute("nonce",e),t}function l(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function i(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var u=function(){var t=0,e=null;return{add:function(n){t==0&&(e=r())&&(l(e,n),i(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}};exports.stylesheetSingleton=u;
|
2
2
|
//# sourceMappingURL=index.cjs679.js.map
|
package/dist/index.cjs679.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs679.js","sources":["../node_modules/
|
1
|
+
{"version":3,"file":"index.cjs679.js","sources":["../node_modules/react-style-singleton/dist/es2015/singleton.js"],"sourcesContent":["import { getNonce } from 'get-nonce';\nfunction makeStyleTag() {\n if (!document)\n return null;\n var tag = document.createElement('style');\n tag.type = 'text/css';\n var nonce = getNonce();\n if (nonce) {\n tag.setAttribute('nonce', nonce);\n }\n return tag;\n}\nfunction injectStyles(tag, css) {\n // @ts-ignore\n if (tag.styleSheet) {\n // @ts-ignore\n tag.styleSheet.cssText = css;\n }\n else {\n tag.appendChild(document.createTextNode(css));\n }\n}\nfunction insertStyleTag(tag) {\n var head = document.head || document.getElementsByTagName('head')[0];\n head.appendChild(tag);\n}\nexport var stylesheetSingleton = function () {\n var counter = 0;\n var stylesheet = null;\n return {\n add: function (style) {\n if (counter == 0) {\n if ((stylesheet = makeStyleTag())) {\n injectStyles(stylesheet, style);\n insertStyleTag(stylesheet);\n }\n }\n counter++;\n },\n remove: function () {\n counter--;\n if (!counter && stylesheet) {\n stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);\n stylesheet = null;\n }\n },\n };\n};\n"],"names":["makeStyleTag","tag","nonce","getNonce","injectStyles","css","insertStyleTag","head","stylesheetSingleton","counter","stylesheet","style"],"mappings":"qHACA,SAASA,GAAe,CACpB,GAAI,CAAC,SACD,OAAO,KACX,IAAIC,EAAM,SAAS,cAAc,OAAO,EACxCA,EAAI,KAAO,WACX,IAAIC,EAAQC,EAAAA,SAAU,EACtB,OAAID,GACAD,EAAI,aAAa,QAASC,CAAK,EAE5BD,CACX,CACA,SAASG,EAAaH,EAAKI,EAAK,CAExBJ,EAAI,WAEJA,EAAI,WAAW,QAAUI,EAGzBJ,EAAI,YAAY,SAAS,eAAeI,CAAG,CAAC,CAEpD,CACA,SAASC,EAAeL,EAAK,CACzB,IAAIM,EAAO,SAAS,MAAQ,SAAS,qBAAqB,MAAM,EAAE,CAAC,EACnEA,EAAK,YAAYN,CAAG,CACxB,CACU,IAACO,EAAsB,UAAY,CACzC,IAAIC,EAAU,EACVC,EAAa,KACjB,MAAO,CACH,IAAK,SAAUC,EAAO,CACdF,GAAW,IACNC,EAAaV,OACdI,EAAaM,EAAYC,CAAK,EAC9BL,EAAeI,CAAU,GAGjCD,GACH,EACD,OAAQ,UAAY,CAChBA,IACI,CAACA,GAAWC,IACZA,EAAW,YAAcA,EAAW,WAAW,YAAYA,CAAU,EACrEA,EAAa,KAEpB,CACJ,CACL","x_google_ignoreList":[0]}
|
package/dist/index.cjs680.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};exports.getNonce=e;
|
2
2
|
//# sourceMappingURL=index.cjs680.js.map
|
package/dist/index.cjs680.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs680.js","sources":["../node_modules/
|
1
|
+
{"version":3,"file":"index.cjs680.js","sources":["../node_modules/get-nonce/dist/es2015/index.js"],"sourcesContent":["var currentNonce;\nexport var setNonce = function (nonce) {\n currentNonce = nonce;\n};\nexport var getNonce = function () {\n if (currentNonce) {\n return currentNonce;\n }\n if (typeof __webpack_nonce__ !== 'undefined') {\n return __webpack_nonce__;\n }\n return undefined;\n};\n"],"names":["getNonce"],"mappings":"gFAIU,IAACA,EAAW,UAAY,CAI9B,GAAI,OAAO,kBAAsB,IAC7B,OAAO,iBAGf","x_google_ignoreList":[0]}
|
package/dist/index.es323.js
CHANGED
package/dist/index.es330.js
CHANGED
@@ -4,15 +4,15 @@ import { useComposedRefs as C } from "./index.es473.js";
|
|
4
4
|
import { createContextScope as B, createContext as H } from "./index.es474.js";
|
5
5
|
import { useId as x } from "./index.es478.js";
|
6
6
|
import { useControllableState as V } from "./index.es475.js";
|
7
|
-
import { DismissableLayer as q } from "./index.
|
8
|
-
import { FocusScope as K } from "./index.
|
9
|
-
import { Portal as U } from "./index.
|
7
|
+
import { DismissableLayer as q } from "./index.es485.js";
|
8
|
+
import { FocusScope as K } from "./index.es486.js";
|
9
|
+
import { Portal as U } from "./index.es487.js";
|
10
10
|
import { Presence as R } from "./index.es484.js";
|
11
11
|
import { Primitive as m } from "./index.es476.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.es488.js";
|
13
|
+
import Z from "./index.es489.js";
|
14
|
+
import { hideOthers as z } from "./index.es490.js";
|
15
|
+
import { createSlot as J } from "./index.es491.js";
|
16
16
|
import { j as i } from "./index.es249.js";
|
17
17
|
var _ = "Dialog", [N, he] = B(_), [Q, u] = N(_), P = (e) => {
|
18
18
|
const {
|
package/dist/index.es402.js
CHANGED
@@ -3,7 +3,7 @@ import { createContextScope as T } from "./index.es474.js";
|
|
3
3
|
import { useComposedRefs as A } from "./index.es473.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.es330.js";
|
5
5
|
import { composeEventHandlers as F } from "./index.es472.js";
|
6
|
-
import { createSlottable as G } from "./index.
|
6
|
+
import { createSlottable as G } from "./index.es491.js";
|
7
7
|
import { j as i } from "./index.es249.js";
|
8
8
|
var D = "AlertDialog", [W, te] = T(D, [
|
9
9
|
v
|