@foxford/ui 2.82.0-beta-2c266bb-20251002 → 2.84.0-beta-4d7a4d1-20251008
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/components/AccordionItem/AccordionItem.js +1 -1
- package/components/AccordionItem/AccordionItem.js.map +1 -1
- package/components/AccordionItem/AccordionItem.mjs +1 -1
- package/components/AccordionItem/AccordionItem.mjs.map +1 -1
- package/components/AccordionItem/useAccordionPanel.js +2 -0
- package/components/AccordionItem/useAccordionPanel.js.map +1 -0
- package/components/AccordionItem/useAccordionPanel.mjs +2 -0
- package/components/AccordionItem/useAccordionPanel.mjs.map +1 -0
- package/components/AccordionItem/useAccordionPanelProps.js +2 -0
- package/components/AccordionItem/useAccordionPanelProps.js.map +1 -0
- package/components/AccordionItem/useAccordionPanelProps.mjs +2 -0
- package/components/AccordionItem/useAccordionPanelProps.mjs.map +1 -0
- package/components/Dropdown/Dropdown.js +1 -1
- package/components/Dropdown/Dropdown.js.map +1 -1
- package/components/Dropdown/Dropdown.mjs +1 -1
- package/components/Dropdown/Dropdown.mjs.map +1 -1
- package/components/Dropdown/sizes.js +1 -1
- package/components/Dropdown/sizes.js.map +1 -1
- package/components/Dropdown/sizes.mjs +1 -1
- package/components/Dropdown/sizes.mjs.map +1 -1
- package/components/FormInput/FormInput.js +1 -1
- package/components/FormInput/FormInput.js.map +1 -1
- package/components/FormInput/FormInput.mjs +1 -1
- package/components/FormInput/FormInput.mjs.map +1 -1
- package/components/FormInput/sizes.js +2 -0
- package/components/FormInput/sizes.js.map +1 -0
- package/components/FormInput/sizes.mjs +2 -0
- package/components/FormInput/sizes.mjs.map +1 -0
- package/components/FormInput/style.js +1 -1
- package/components/FormInput/style.js.map +1 -1
- package/components/FormInput/style.mjs +1 -1
- package/components/FormInput/style.mjs.map +1 -1
- package/components/FormInputLabel/FormInputLabel.js +1 -1
- package/components/FormInputLabel/FormInputLabel.js.map +1 -1
- package/components/FormInputLabel/FormInputLabel.mjs +1 -1
- package/components/FormInputLabel/FormInputLabel.mjs.map +1 -1
- package/components/FormInputLabel/sizes.js +2 -0
- package/components/FormInputLabel/sizes.js.map +1 -0
- package/components/FormInputLabel/sizes.mjs +2 -0
- package/components/FormInputLabel/sizes.mjs.map +1 -0
- package/components/FormInputLabel/style.js +1 -1
- package/components/FormInputLabel/style.js.map +1 -1
- package/components/FormInputLabel/style.mjs +1 -1
- package/components/FormInputLabel/style.mjs.map +1 -1
- package/components/Input/Input.js +1 -1
- package/components/Input/Input.js.map +1 -1
- package/components/Input/Input.mjs +1 -1
- package/components/Input/Input.mjs.map +1 -1
- package/components/Input/sizes.js +2 -0
- package/components/Input/sizes.js.map +1 -0
- package/components/Input/sizes.mjs +2 -0
- package/components/Input/sizes.mjs.map +1 -0
- package/components/InputLabel/InputLabel.js +2 -0
- package/components/InputLabel/InputLabel.js.map +1 -0
- package/components/InputLabel/InputLabel.mjs +2 -0
- package/components/InputLabel/InputLabel.mjs.map +1 -0
- package/components/InputLabel/sizes.js +2 -0
- package/components/InputLabel/sizes.js.map +1 -0
- package/components/InputLabel/sizes.mjs +2 -0
- package/components/InputLabel/sizes.mjs.map +1 -0
- package/components/InputLabel/style.js +2 -0
- package/components/InputLabel/style.js.map +1 -0
- package/components/InputLabel/style.mjs +2 -0
- package/components/InputLabel/style.mjs.map +1 -0
- package/components/ProgressCircle/ProgressCircle.js +1 -1
- package/components/ProgressCircle/ProgressCircle.js.map +1 -1
- package/components/ProgressCircle/ProgressCircle.mjs +1 -1
- package/components/ProgressCircle/ProgressCircle.mjs.map +1 -1
- package/components/ProgressLine/style.js +1 -1
- package/components/ProgressLine/style.js.map +1 -1
- package/components/ProgressLine/style.mjs +1 -1
- package/components/ProgressLine/style.mjs.map +1 -1
- package/components/Textarea/Textarea.js +1 -1
- package/components/Textarea/Textarea.js.map +1 -1
- package/components/Textarea/Textarea.mjs +1 -1
- package/components/Textarea/Textarea.mjs.map +1 -1
- package/components/Textarea/sizes.js +2 -0
- package/components/Textarea/sizes.js.map +1 -0
- package/components/Textarea/sizes.mjs +2 -0
- package/components/Textarea/sizes.mjs.map +1 -0
- package/components/Textarea/style.js +1 -1
- package/components/Textarea/style.js.map +1 -1
- package/components/Textarea/style.mjs +1 -1
- package/components/Textarea/style.mjs.map +1 -1
- package/dts/index.d.ts +434 -285
- package/hooks/useClickOutside.js +1 -1
- package/hooks/useClickOutside.js.map +1 -1
- package/hooks/useClickOutside.mjs +1 -1
- package/hooks/useClickOutside.mjs.map +1 -1
- package/hooks/useResizeObserver.js +1 -1
- package/hooks/useResizeObserver.js.map +1 -1
- package/hooks/useResizeObserver.mjs +1 -1
- package/hooks/useResizeObserver.mjs.map +1 -1
- package/package.json +2 -2
- package/shared/utils/dom.js +1 -1
- package/shared/utils/dom.js.map +1 -1
- package/shared/utils/dom.mjs +1 -1
- package/shared/utils/dom.mjs.map +1 -1
- package/shared/utils/getDomTargets.js +2 -0
- package/shared/utils/getDomTargets.js.map +1 -0
- package/shared/utils/getDomTargets.mjs +2 -0
- package/shared/utils/getDomTargets.mjs.map +1 -0
- package/shared/utils/getProgressPercent.js +2 -0
- package/shared/utils/getProgressPercent.js.map +1 -0
- package/shared/utils/getProgressPercent.mjs +2 -0
- package/shared/utils/getProgressPercent.mjs.map +1 -0
- package/shared/utils/misc.js +1 -1
- package/shared/utils/misc.js.map +1 -1
- package/shared/utils/misc.mjs +1 -1
- package/shared/utils/misc.mjs.map +1 -1
- package/components/AccordionItem/hooks.js +0 -2
- package/components/AccordionItem/hooks.js.map +0 -1
- package/components/AccordionItem/hooks.mjs +0 -2
- package/components/AccordionItem/hooks.mjs.map +0 -1
- package/components/FormInputLabel/constants.js +0 -2
- package/components/FormInputLabel/constants.js.map +0 -1
- package/components/FormInputLabel/constants.mjs +0 -2
- package/components/FormInputLabel/constants.mjs.map +0 -1
- package/components/Input/constants.js +0 -2
- package/components/Input/constants.js.map +0 -1
- package/components/Input/constants.mjs +0 -2
- package/components/Input/constants.mjs.map +0 -1
- package/components/Textarea/constants.js +0 -2
- package/components/Textarea/constants.js.map +0 -1
- package/components/Textarea/constants.mjs +0 -2
- package/components/Textarea/constants.mjs.map +0 -1
package/hooks/useClickOutside.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var
|
|
1
|
+
'use strict';var React=require('react');var getDomTargets=require('../shared/utils/getDomTargets.js');exports.useClickOutside=(e,t,s)=>{const{enabled:n=!0,event:r="click",once:c,passive:a,signal:o,capture:i}=s??{};React.useEffect((()=>{const s={once:c,passive:a,signal:o,capture:i};const listener=s=>{const n=getDomTargets.getDomTargets(e);const r=s.target;r&&r.isConnected&&n.length>0&&n.every((e=>!e.contains(r)))&&t(s)};return n&&document.addEventListener(r,listener,s),()=>{document.removeEventListener(r,listener,s)}}),[e,t,n,r,c,a,o,i])};
|
|
2
2
|
//# sourceMappingURL=useClickOutside.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useClickOutside.js","sources":["../../../src/hooks/useClickOutside.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport { getDomTargets } from 'shared/utils/
|
|
1
|
+
{"version":3,"file":"useClickOutside.js","sources":["../../../src/hooks/useClickOutside.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport { getDomTargets } from 'shared/utils/getDomTargets'\nimport type { DomTarget } from 'shared/types'\n\nexport const useClickOutside = (\n target: DomTarget | DomTarget[],\n callback: (evt: MouseEvent) => void,\n options?: {\n enabled?: boolean\n event?: 'click' | 'mousedown'\n once?: boolean\n passive?: boolean\n signal?: AbortSignal\n capture?: boolean\n }\n) => {\n const { enabled = true, event = 'click', once, passive, signal, capture } = options ?? {}\n\n useEffect(() => {\n const listenerOptions = { once, passive, signal, capture }\n\n const listener = (evt: MouseEvent) => {\n const domTargets = getDomTargets(target)\n\n const evtTarget = evt.target as Node\n\n if (\n evtTarget &&\n evtTarget.isConnected &&\n domTargets.length > 0 &&\n domTargets.every((item) => !item.contains(evtTarget))\n ) {\n callback(evt)\n }\n }\n\n if (enabled) {\n document.addEventListener(event, listener, listenerOptions)\n }\n\n return () => {\n document.removeEventListener(event, listener, listenerOptions)\n }\n }, [target, callback, enabled, event, once, passive, signal, capture])\n}\n"],"names":["useClickOutside","target","callback","options","enabled","event","once","passive","signal","capture","useEffect","listenerOptions","listener","evt","domTargets","getDomTargets","evtTarget","isConnected","length","every","item","contains","document","addEventListener","removeEventListener"],"mappings":"8HAI+BA,CAC7BC,EACAC,EACAC,KASA,MAAMC,QAAEA,GAAU,EAAIC,MAAEA,EAAQ,QAAOC,KAAEA,EAAIC,QAAEA,EAAOC,OAAEA,EAAMC,QAAEA,GAAYN,GAAW,CAAA,EAEvFO,MAAAA,WAAU,KACR,MAAMC,EAAkB,CAAEL,OAAMC,UAASC,SAAQC,WAEjD,MAAMG,SAAYC,IAChB,MAAMC,EAAaC,4BAAcd,GAEjC,MAAMe,EAAYH,EAAIZ,OAGpBe,GACAA,EAAUC,aACVH,EAAWI,OAAS,GACpBJ,EAAWK,OAAOC,IAAUA,EAAKC,SAASL,MAE1Cd,EAASW,EACX,EAOF,OAJIT,GACFkB,SAASC,iBAAiBlB,EAAOO,SAAUD,GAGtC,KACLW,SAASE,oBAAoBnB,EAAOO,SAAUD,EAAgB,CAC/D,GACA,CAACV,EAAQC,EAAUE,EAASC,EAAOC,EAAMC,EAASC,EAAQC,GAAS"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useEffect}from'react';import{getDomTargets}from'../shared/utils/
|
|
1
|
+
import{useEffect}from'react';import{getDomTargets}from'../shared/utils/getDomTargets.mjs';const useClickOutside=(e,t,s)=>{const{enabled:n=!0,event:c="click",once:o,passive:r,signal:i,capture:a}=s??{};useEffect((()=>{const s={once:o,passive:r,signal:i,capture:a};const listener=s=>{const n=getDomTargets(e);const c=s.target;c&&c.isConnected&&n.length>0&&n.every((e=>!e.contains(c)))&&t(s)};return n&&document.addEventListener(c,listener,s),()=>{document.removeEventListener(c,listener,s)}}),[e,t,n,c,o,r,i,a])};export{useClickOutside};
|
|
2
2
|
//# sourceMappingURL=useClickOutside.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useClickOutside.mjs","sources":["../../../src/hooks/useClickOutside.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport { getDomTargets } from 'shared/utils/
|
|
1
|
+
{"version":3,"file":"useClickOutside.mjs","sources":["../../../src/hooks/useClickOutside.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport { getDomTargets } from 'shared/utils/getDomTargets'\nimport type { DomTarget } from 'shared/types'\n\nexport const useClickOutside = (\n target: DomTarget | DomTarget[],\n callback: (evt: MouseEvent) => void,\n options?: {\n enabled?: boolean\n event?: 'click' | 'mousedown'\n once?: boolean\n passive?: boolean\n signal?: AbortSignal\n capture?: boolean\n }\n) => {\n const { enabled = true, event = 'click', once, passive, signal, capture } = options ?? {}\n\n useEffect(() => {\n const listenerOptions = { once, passive, signal, capture }\n\n const listener = (evt: MouseEvent) => {\n const domTargets = getDomTargets(target)\n\n const evtTarget = evt.target as Node\n\n if (\n evtTarget &&\n evtTarget.isConnected &&\n domTargets.length > 0 &&\n domTargets.every((item) => !item.contains(evtTarget))\n ) {\n callback(evt)\n }\n }\n\n if (enabled) {\n document.addEventListener(event, listener, listenerOptions)\n }\n\n return () => {\n document.removeEventListener(event, listener, listenerOptions)\n }\n }, [target, callback, enabled, event, once, passive, signal, capture])\n}\n"],"names":["useClickOutside","target","callback","options","enabled","event","once","passive","signal","capture","useEffect","listenerOptions","listener","evt","domTargets","getDomTargets","evtTarget","isConnected","length","every","item","contains","document","addEventListener","removeEventListener"],"mappings":"0FAIO,MAAMA,gBAAkBA,CAC7BC,EACAC,EACAC,KASA,MAAMC,QAAEA,GAAU,EAAIC,MAAEA,EAAQ,QAAOC,KAAEA,EAAIC,QAAEA,EAAOC,OAAEA,EAAMC,QAAEA,GAAYN,GAAW,CAAA,EAEvFO,WAAU,KACR,MAAMC,EAAkB,CAAEL,OAAMC,UAASC,SAAQC,WAEjD,MAAMG,SAAYC,IAChB,MAAMC,EAAaC,cAAcd,GAEjC,MAAMe,EAAYH,EAAIZ,OAGpBe,GACAA,EAAUC,aACVH,EAAWI,OAAS,GACpBJ,EAAWK,OAAOC,IAAUA,EAAKC,SAASL,MAE1Cd,EAASW,EACX,EAOF,OAJIT,GACFkB,SAASC,iBAAiBlB,EAAOO,SAAUD,GAGtC,KACLW,SAASE,oBAAoBnB,EAAOO,SAAUD,EAAgB,CAC/D,GACA,CAACV,EAAQC,EAAUE,EAASC,EAAOC,EAAMC,EAASC,EAAQC,GAAS"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var resizeObserver=require('../shared/resize-observer.js');var
|
|
1
|
+
'use strict';var React=require('react');var resizeObserver=require('../shared/resize-observer.js');var getDomTargets=require('../shared/utils/getDomTargets.js');exports.useResizeObserver=({enabled:e=!0,target:r,onResize:s})=>{const[t]=React.useState((()=>new WeakMap));React.useLayoutEffect((()=>{const a=getDomTargets.getDomTargets(r);return e&&a.forEach((e=>{e[resizeObserver.resizeObserver.symbol]=r=>{const a=t.get(e);a&&cancelAnimationFrame(a),t.set(e,requestAnimationFrame((()=>{s(r)})))},resizeObserver.resizeObserver.observe(e)})),()=>{a.forEach((e=>{resizeObserver.resizeObserver.unobserve(e)}))}}),[e,t,r,s])};
|
|
2
2
|
//# sourceMappingURL=useResizeObserver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResizeObserver.js","sources":["../../../src/hooks/useResizeObserver.ts"],"sourcesContent":["import { useLayoutEffect, useState } from 'react'\nimport { resizeObserver } from 'shared/resize-observer'\nimport { getDomTargets } from 'shared/utils/
|
|
1
|
+
{"version":3,"file":"useResizeObserver.js","sources":["../../../src/hooks/useResizeObserver.ts"],"sourcesContent":["import { useLayoutEffect, useState } from 'react'\nimport { resizeObserver } from 'shared/resize-observer'\nimport { getDomTargets } from 'shared/utils/getDomTargets'\nimport type { DomTarget } from 'shared/types'\n\nexport const useResizeObserver = <T extends HTMLElement = HTMLElement>({\n enabled = true,\n target,\n onResize,\n}: {\n onResize: (target: T) => void\n target?: DomTarget<T> | DomTarget<T>[]\n enabled?: boolean\n}) => {\n const [animationRequests] = useState<WeakMap<T, number>>(() => new WeakMap())\n\n useLayoutEffect(() => {\n const targets = getDomTargets<T>(target)\n\n if (enabled) {\n targets.forEach((observerTarget) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n observerTarget[resizeObserver.symbol] = (e: T) => {\n const reqId = animationRequests.get(observerTarget)\n\n if (reqId) {\n cancelAnimationFrame(reqId)\n }\n\n animationRequests.set(\n observerTarget,\n requestAnimationFrame(() => {\n onResize(e)\n })\n )\n }\n\n resizeObserver.observe(observerTarget)\n })\n }\n\n return () => {\n targets.forEach((observerTarget) => {\n resizeObserver.unobserve(observerTarget)\n })\n }\n }, [enabled, animationRequests, target, onResize])\n}\n"],"names":["useResizeObserver","enabled","target","onResize","animationRequests","useState","WeakMap","useLayoutEffect","targets","getDomTargets","forEach","observerTarget","resizeObserver","symbol","e","reqId","get","cancelAnimationFrame","set","requestAnimationFrame","observe","unobserve"],"mappings":"2LAKiCA,EAC/BC,WAAU,EACVC,SACAC,eAMA,MAAOC,GAAqBC,MAAAA,UAA6B,IAAM,IAAIC,UAEnEC,MAAAA,iBAAgB,KACd,MAAMC,EAAUC,4BAAiBP,GAyBjC,OAvBID,GACFO,EAAQE,SAASC,IAGfA,EAAeC,eAAcA,eAACC,QAAWC,IACvC,MAAMC,EAAQX,EAAkBY,IAAIL,GAEhCI,GACFE,qBAAqBF,GAGvBX,EAAkBc,IAChBP,EACAQ,uBAAsB,KACpBhB,EAASW,EAAE,IAEd,EAGHF,8BAAeQ,QAAQT,EAAe,IAInC,KACLH,EAAQE,SAASC,IACfC,8BAAeS,UAAUV,EAAe,GACxC,CACH,GACA,CAACV,EAASG,EAAmBF,EAAQC,GAAU"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useState,useLayoutEffect}from'react';import{resizeObserver}from'../shared/resize-observer.mjs';import{getDomTargets}from'../shared/utils/
|
|
1
|
+
import{useState,useLayoutEffect}from'react';import{resizeObserver}from'../shared/resize-observer.mjs';import{getDomTargets}from'../shared/utils/getDomTargets.mjs';const useResizeObserver=({enabled:e=!0,target:r,onResize:s})=>{const[t]=useState((()=>new WeakMap));useLayoutEffect((()=>{const o=getDomTargets(r);return e&&o.forEach((e=>{e[resizeObserver.symbol]=r=>{const o=t.get(e);o&&cancelAnimationFrame(o),t.set(e,requestAnimationFrame((()=>{s(r)})))},resizeObserver.observe(e)})),()=>{o.forEach((e=>{resizeObserver.unobserve(e)}))}}),[e,t,r,s])};export{useResizeObserver};
|
|
2
2
|
//# sourceMappingURL=useResizeObserver.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResizeObserver.mjs","sources":["../../../src/hooks/useResizeObserver.ts"],"sourcesContent":["import { useLayoutEffect, useState } from 'react'\nimport { resizeObserver } from 'shared/resize-observer'\nimport { getDomTargets } from 'shared/utils/
|
|
1
|
+
{"version":3,"file":"useResizeObserver.mjs","sources":["../../../src/hooks/useResizeObserver.ts"],"sourcesContent":["import { useLayoutEffect, useState } from 'react'\nimport { resizeObserver } from 'shared/resize-observer'\nimport { getDomTargets } from 'shared/utils/getDomTargets'\nimport type { DomTarget } from 'shared/types'\n\nexport const useResizeObserver = <T extends HTMLElement = HTMLElement>({\n enabled = true,\n target,\n onResize,\n}: {\n onResize: (target: T) => void\n target?: DomTarget<T> | DomTarget<T>[]\n enabled?: boolean\n}) => {\n const [animationRequests] = useState<WeakMap<T, number>>(() => new WeakMap())\n\n useLayoutEffect(() => {\n const targets = getDomTargets<T>(target)\n\n if (enabled) {\n targets.forEach((observerTarget) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n observerTarget[resizeObserver.symbol] = (e: T) => {\n const reqId = animationRequests.get(observerTarget)\n\n if (reqId) {\n cancelAnimationFrame(reqId)\n }\n\n animationRequests.set(\n observerTarget,\n requestAnimationFrame(() => {\n onResize(e)\n })\n )\n }\n\n resizeObserver.observe(observerTarget)\n })\n }\n\n return () => {\n targets.forEach((observerTarget) => {\n resizeObserver.unobserve(observerTarget)\n })\n }\n }, [enabled, animationRequests, target, onResize])\n}\n"],"names":["useResizeObserver","enabled","target","onResize","animationRequests","useState","WeakMap","useLayoutEffect","targets","getDomTargets","forEach","observerTarget","resizeObserver","symbol","e","reqId","get","cancelAnimationFrame","set","requestAnimationFrame","observe","unobserve"],"mappings":"mKAKO,MAAMA,kBAAoBA,EAC/BC,WAAU,EACVC,SACAC,eAMA,MAAOC,GAAqBC,UAA6B,IAAM,IAAIC,UAEnEC,iBAAgB,KACd,MAAMC,EAAUC,cAAiBP,GAyBjC,OAvBID,GACFO,EAAQE,SAASC,IAGfA,EAAeC,eAAeC,QAAWC,IACvC,MAAMC,EAAQX,EAAkBY,IAAIL,GAEhCI,GACFE,qBAAqBF,GAGvBX,EAAkBc,IAChBP,EACAQ,uBAAsB,KACpBhB,EAASW,EAAE,IAEd,EAGHF,eAAeQ,QAAQT,EAAe,IAInC,KACLH,EAAQE,SAASC,IACfC,eAAeS,UAAUV,EAAe,GACxC,CACH,GACA,CAACV,EAASG,EAAmBF,EAAQC,GAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foxford/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.84.0-beta-4d7a4d1-20251008",
|
|
4
4
|
"description": "UI components and utilities",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/foxford/ui/issues"
|
|
@@ -68,6 +68,6 @@
|
|
|
68
68
|
"shared",
|
|
69
69
|
"theme"
|
|
70
70
|
],
|
|
71
|
-
"sha": "
|
|
71
|
+
"sha": "4d7a4d1",
|
|
72
72
|
"scripts": {}
|
|
73
73
|
}
|
package/shared/utils/dom.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var constants=require('../constants.js');const SELECTORS_KEYBOARD_FOCUSABLE='a[href]:not([tabindex^="-"]), button:not(:disabled, [tabindex^="-"]), input:not(:disabled, [type="hidden"], [tabindex^="-"]), select:not(:disabled, [tabindex^="-"]), textarea:not(:disabled, [tabindex^="-"]), area[href]:not([tabindex^="-"]), iframe:not([tabindex^="-"]), object:not([tabindex^="-"]), summary:not([tabindex^="-"]), [tabindex]:not([tabindex^="-"], :disabled), [contenteditable]:not([contenteditable="false"], [tabindex^="-"])';const focusFirstFocusable=(e,t=SELECTORS_KEYBOARD_FOCUSABLE)=>{if(e.matches(t)&&typeof e.focus=='function')return e.focus(),!0;const
|
|
1
|
+
'use strict';var constants=require('../constants.js');const SELECTORS_KEYBOARD_FOCUSABLE='a[href]:not([tabindex^="-"]), button:not(:disabled, [tabindex^="-"]), input:not(:disabled, [type="hidden"], [tabindex^="-"]), select:not(:disabled, [tabindex^="-"]), textarea:not(:disabled, [tabindex^="-"]), area[href]:not([tabindex^="-"]), iframe:not([tabindex^="-"]), object:not([tabindex^="-"]), summary:not([tabindex^="-"]), [tabindex]:not([tabindex^="-"], :disabled), [contenteditable]:not([contenteditable="false"], [tabindex^="-"])';const focusFirstFocusable=(e,t=SELECTORS_KEYBOARD_FOCUSABLE)=>{if(e.matches(t)&&typeof e.focus=='function')return e.focus(),!0;const a=e.querySelector(t);return a instanceof HTMLElement&&typeof a.focus=='function'&&(a.focus(),!0)};const createKeyboardNavigation=({prevKey:e,nextKey:t})=>(a,n,o,i=SELECTORS_KEYBOARD_FOCUSABLE)=>{let s=o.indexOf(n);if(s!==-1&&o.length!==0)do{constants.keyboardKeys[e].validate(a)?s--:constants.keyboardKeys[t].validate(a)&&s++,s<0?s=o.length-1:s>o.length-1&&(s=0)}while(!focusFirstFocusable(o[s],i))};const navigateVerticalList=createKeyboardNavigation({prevKey:'ArrowUp',nextKey:'ArrowDown'});const navigateHorizontalList=createKeyboardNavigation({prevKey:'ArrowLeft',nextKey:'ArrowRight'});exports.SELECTORS_FOCUSABLE='a[href], button:not(:disabled), input:not(:disabled, [type="hidden"]), select:not(:disabled), textarea:not(:disabled), area[href], iframe, object, summary, [tabindex]:not(:disabled), [contenteditable]:not([contenteditable="false"])',exports.SELECTORS_KEYBOARD_FOCUSABLE=SELECTORS_KEYBOARD_FOCUSABLE,exports.concatClassNames=(...e)=>e.reduce(((e,t)=>(typeof t=='string'&&(e=e?e+' '+t:t),e)),''),exports.createKeyboardNavigation=createKeyboardNavigation,exports.focusFirstFocusable=focusFirstFocusable,exports.focusLastFocusable=(e,t=SELECTORS_KEYBOARD_FOCUSABLE)=>{const a=e.querySelectorAll(t);const n=a[a.length-1];return n instanceof HTMLElement&&typeof n.focus=='function'&&(n.focus(),!0)},exports.navigateHorizontalList=navigateHorizontalList,exports.navigateVerticalList=navigateVerticalList;
|
|
2
2
|
//# sourceMappingURL=dom.js.map
|
package/shared/utils/dom.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.js","sources":["../../../../src/shared/utils/dom.ts"],"sourcesContent":["import { keyboardKeys } from 'shared/constants'\nimport type { Nullable
|
|
1
|
+
{"version":3,"file":"dom.js","sources":["../../../../src/shared/utils/dom.ts"],"sourcesContent":["import { keyboardKeys } from 'shared/constants'\nimport type { Nullable } from 'shared/types'\n\nexport const SELECTORS_KEYBOARD_FOCUSABLE =\n 'a[href]:not([tabindex^=\"-\"]), button:not(:disabled, [tabindex^=\"-\"]), input:not(:disabled, [type=\"hidden\"], [tabindex^=\"-\"]), select:not(:disabled, [tabindex^=\"-\"]), textarea:not(:disabled, [tabindex^=\"-\"]), area[href]:not([tabindex^=\"-\"]), iframe:not([tabindex^=\"-\"]), object:not([tabindex^=\"-\"]), summary:not([tabindex^=\"-\"]), [tabindex]:not([tabindex^=\"-\"], :disabled), [contenteditable]:not([contenteditable=\"false\"], [tabindex^=\"-\"])'\n\nexport const SELECTORS_FOCUSABLE =\n 'a[href], button:not(:disabled), input:not(:disabled, [type=\"hidden\"]), select:not(:disabled), textarea:not(:disabled), area[href], iframe, object, summary, [tabindex]:not(:disabled), [contenteditable]:not([contenteditable=\"false\"])'\n\nexport const focusFirstFocusable = (element: HTMLElement, selectors = SELECTORS_KEYBOARD_FOCUSABLE): boolean => {\n if (element.matches(selectors) && typeof element.focus === 'function') {\n element.focus()\n\n return true\n }\n\n const descendent = element.querySelector(selectors)\n\n if (descendent instanceof HTMLElement && typeof descendent.focus === 'function') {\n descendent.focus()\n\n return true\n }\n\n return false\n}\n\nexport const focusLastFocusable = (element: HTMLElement, selectors = SELECTORS_KEYBOARD_FOCUSABLE): boolean => {\n const descendants = element.querySelectorAll(selectors)\n const lastDescendant = descendants[descendants.length - 1]\n\n if (lastDescendant instanceof HTMLElement && typeof lastDescendant.focus === 'function') {\n lastDescendant.focus()\n\n return true\n }\n\n return false\n}\n\nexport const concatClassNames = (...classNames: Nullable<unknown>[]): string =>\n classNames.reduce<string>((acc, className) => {\n if (typeof className === 'string') {\n // eslint-disable-next-line no-param-reassign\n acc = acc ? acc + ' ' + className : className\n }\n\n return acc\n }, '')\n\nexport const createKeyboardNavigation = ({\n prevKey,\n nextKey,\n}: {\n prevKey: keyof typeof keyboardKeys\n nextKey: keyof typeof keyboardKeys\n}) => {\n return (\n key: React.KeyboardEvent['key'],\n active: HTMLElement,\n list: HTMLElement[],\n selectorsFocusable = SELECTORS_KEYBOARD_FOCUSABLE\n ) => {\n let idx = list.indexOf(active)\n\n if (idx === -1 || list.length === 0) {\n return\n }\n\n do {\n if (keyboardKeys[prevKey].validate(key)) {\n idx--\n } else if (keyboardKeys[nextKey].validate(key)) {\n idx++\n }\n\n if (idx < 0) {\n idx = list.length - 1\n } else if (idx > list.length - 1) {\n idx = 0\n }\n } while (!focusFirstFocusable(list[idx], selectorsFocusable))\n }\n}\n\nexport const navigateVerticalList = createKeyboardNavigation({\n prevKey: 'ArrowUp',\n nextKey: 'ArrowDown',\n})\n\nexport const navigateHorizontalList = createKeyboardNavigation({\n prevKey: 'ArrowLeft',\n nextKey: 'ArrowRight',\n})\n"],"names":["SELECTORS_KEYBOARD_FOCUSABLE","focusFirstFocusable","element","selectors","matches","focus","descendent","querySelector","HTMLElement","createKeyboardNavigation","prevKey","nextKey","key","active","list","selectorsFocusable","idx","indexOf","length","keyboardKeys","validate","navigateVerticalList","navigateHorizontalList","concatClassNames","classNames","reduce","acc","className","focusLastFocusable","descendants","querySelectorAll","lastDescendant"],"mappings":"sDAGO,MAAMA,6BACX,ybAKK,MAAMC,oBAAsBA,CAACC,EAAsBC,EAAYH,gCACpE,GAAIE,EAAQE,QAAQD,WAAqBD,EAAQG,OAAU,WAGzD,OAFAH,EAAQG,SAED,EAGT,MAAMC,EAAaJ,EAAQK,cAAcJ,GAEzC,OAAIG,aAAsBE,oBAAsBF,EAAWD,OAAU,aACnEC,EAAWD,SAEJ,EAGG,EA0BP,MAAMI,yBAA2BA,EACtCC,UACAC,aAKO,CACLC,EACAC,EACAC,EACAC,EAAqBf,gCAErB,IAAIgB,EAAMF,EAAKG,QAAQJ,GAEvB,GAAIG,KAAS,GAAKF,EAAKI,SAAW,EAIlC,GACMC,UAAYA,aAACT,GAASU,SAASR,GACjCI,IACSG,UAAAA,aAAaR,GAASS,SAASR,IACxCI,IAGEA,EAAM,EACRA,EAAMF,EAAKI,OAAS,EACXF,EAAMF,EAAKI,OAAS,IAC7BF,EAAM,UAEAf,oBAAoBa,EAAKE,GAAMD,GAAmB,EAInDM,MAAAA,qBAAuBZ,yBAAyB,CAC3DC,QAAS,UACTC,QAAS,cAGEW,MAAAA,uBAAyBb,yBAAyB,CAC7DC,QAAS,YACTC,QAAS,2CArFT,qUAiC8BY,IAAIC,IAClCA,EAAWC,QAAe,CAACC,EAAKC,YACnBA,GAAc,WAEvBD,EAAMA,EAAMA,EAAM,IAAMC,EAAYA,GAG/BD,IACN,yIArB6BE,CAAC1B,EAAsBC,EAAYH,gCACnE,MAAM6B,EAAc3B,EAAQ4B,iBAAiB3B,GAC7C,MAAM4B,EAAiBF,EAAYA,EAAYX,OAAS,GAExD,OAAIa,aAA0BvB,oBAAsBuB,EAAe1B,OAAU,aAC3E0B,EAAe1B,SAER,EAGG"}
|
package/shared/utils/dom.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{keyboardKeys}from'../constants.mjs';const SELECTORS_KEYBOARD_FOCUSABLE='a[href]:not([tabindex^="-"]), button:not(:disabled, [tabindex^="-"]), input:not(:disabled, [type="hidden"], [tabindex^="-"]), select:not(:disabled, [tabindex^="-"]), textarea:not(:disabled, [tabindex^="-"]), area[href]:not([tabindex^="-"]), iframe:not([tabindex^="-"]), object:not([tabindex^="-"]), summary:not([tabindex^="-"]), [tabindex]:not([tabindex^="-"], :disabled), [contenteditable]:not([contenteditable="false"], [tabindex^="-"])';const SELECTORS_FOCUSABLE='a[href], button:not(:disabled), input:not(:disabled, [type="hidden"]), select:not(:disabled), textarea:not(:disabled), area[href], iframe, object, summary, [tabindex]:not(:disabled), [contenteditable]:not([contenteditable="false"])';const focusFirstFocusable=(e,t=SELECTORS_KEYBOARD_FOCUSABLE)=>{if(e.matches(t)&&typeof e.focus=='function')return e.focus(),!0;const
|
|
1
|
+
import{keyboardKeys}from'../constants.mjs';const SELECTORS_KEYBOARD_FOCUSABLE='a[href]:not([tabindex^="-"]), button:not(:disabled, [tabindex^="-"]), input:not(:disabled, [type="hidden"], [tabindex^="-"]), select:not(:disabled, [tabindex^="-"]), textarea:not(:disabled, [tabindex^="-"]), area[href]:not([tabindex^="-"]), iframe:not([tabindex^="-"]), object:not([tabindex^="-"]), summary:not([tabindex^="-"]), [tabindex]:not([tabindex^="-"], :disabled), [contenteditable]:not([contenteditable="false"], [tabindex^="-"])';const SELECTORS_FOCUSABLE='a[href], button:not(:disabled), input:not(:disabled, [type="hidden"]), select:not(:disabled), textarea:not(:disabled), area[href], iframe, object, summary, [tabindex]:not(:disabled), [contenteditable]:not([contenteditable="false"])';const focusFirstFocusable=(e,t=SELECTORS_KEYBOARD_FOCUSABLE)=>{if(e.matches(t)&&typeof e.focus=='function')return e.focus(),!0;const a=e.querySelector(t);return a instanceof HTMLElement&&typeof a.focus=='function'&&(a.focus(),!0)};const focusLastFocusable=(e,t=SELECTORS_KEYBOARD_FOCUSABLE)=>{const a=e.querySelectorAll(t);const n=a[a.length-1];return n instanceof HTMLElement&&typeof n.focus=='function'&&(n.focus(),!0)};const concatClassNames=(...e)=>e.reduce(((e,t)=>(typeof t=='string'&&(e=e?e+' '+t:t),e)),'');const createKeyboardNavigation=({prevKey:e,nextKey:t})=>(a,n,o,i=SELECTORS_KEYBOARD_FOCUSABLE)=>{let s=o.indexOf(n);if(s!==-1&&o.length!==0)do{keyboardKeys[e].validate(a)?s--:keyboardKeys[t].validate(a)&&s++,s<0?s=o.length-1:s>o.length-1&&(s=0)}while(!focusFirstFocusable(o[s],i))};const navigateVerticalList=createKeyboardNavigation({prevKey:'ArrowUp',nextKey:'ArrowDown'});const navigateHorizontalList=createKeyboardNavigation({prevKey:'ArrowLeft',nextKey:'ArrowRight'});export{SELECTORS_FOCUSABLE,SELECTORS_KEYBOARD_FOCUSABLE,concatClassNames,createKeyboardNavigation,focusFirstFocusable,focusLastFocusable,navigateHorizontalList,navigateVerticalList};
|
|
2
2
|
//# sourceMappingURL=dom.mjs.map
|
package/shared/utils/dom.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.mjs","sources":["../../../../src/shared/utils/dom.ts"],"sourcesContent":["import { keyboardKeys } from 'shared/constants'\nimport type { Nullable
|
|
1
|
+
{"version":3,"file":"dom.mjs","sources":["../../../../src/shared/utils/dom.ts"],"sourcesContent":["import { keyboardKeys } from 'shared/constants'\nimport type { Nullable } from 'shared/types'\n\nexport const SELECTORS_KEYBOARD_FOCUSABLE =\n 'a[href]:not([tabindex^=\"-\"]), button:not(:disabled, [tabindex^=\"-\"]), input:not(:disabled, [type=\"hidden\"], [tabindex^=\"-\"]), select:not(:disabled, [tabindex^=\"-\"]), textarea:not(:disabled, [tabindex^=\"-\"]), area[href]:not([tabindex^=\"-\"]), iframe:not([tabindex^=\"-\"]), object:not([tabindex^=\"-\"]), summary:not([tabindex^=\"-\"]), [tabindex]:not([tabindex^=\"-\"], :disabled), [contenteditable]:not([contenteditable=\"false\"], [tabindex^=\"-\"])'\n\nexport const SELECTORS_FOCUSABLE =\n 'a[href], button:not(:disabled), input:not(:disabled, [type=\"hidden\"]), select:not(:disabled), textarea:not(:disabled), area[href], iframe, object, summary, [tabindex]:not(:disabled), [contenteditable]:not([contenteditable=\"false\"])'\n\nexport const focusFirstFocusable = (element: HTMLElement, selectors = SELECTORS_KEYBOARD_FOCUSABLE): boolean => {\n if (element.matches(selectors) && typeof element.focus === 'function') {\n element.focus()\n\n return true\n }\n\n const descendent = element.querySelector(selectors)\n\n if (descendent instanceof HTMLElement && typeof descendent.focus === 'function') {\n descendent.focus()\n\n return true\n }\n\n return false\n}\n\nexport const focusLastFocusable = (element: HTMLElement, selectors = SELECTORS_KEYBOARD_FOCUSABLE): boolean => {\n const descendants = element.querySelectorAll(selectors)\n const lastDescendant = descendants[descendants.length - 1]\n\n if (lastDescendant instanceof HTMLElement && typeof lastDescendant.focus === 'function') {\n lastDescendant.focus()\n\n return true\n }\n\n return false\n}\n\nexport const concatClassNames = (...classNames: Nullable<unknown>[]): string =>\n classNames.reduce<string>((acc, className) => {\n if (typeof className === 'string') {\n // eslint-disable-next-line no-param-reassign\n acc = acc ? acc + ' ' + className : className\n }\n\n return acc\n }, '')\n\nexport const createKeyboardNavigation = ({\n prevKey,\n nextKey,\n}: {\n prevKey: keyof typeof keyboardKeys\n nextKey: keyof typeof keyboardKeys\n}) => {\n return (\n key: React.KeyboardEvent['key'],\n active: HTMLElement,\n list: HTMLElement[],\n selectorsFocusable = SELECTORS_KEYBOARD_FOCUSABLE\n ) => {\n let idx = list.indexOf(active)\n\n if (idx === -1 || list.length === 0) {\n return\n }\n\n do {\n if (keyboardKeys[prevKey].validate(key)) {\n idx--\n } else if (keyboardKeys[nextKey].validate(key)) {\n idx++\n }\n\n if (idx < 0) {\n idx = list.length - 1\n } else if (idx > list.length - 1) {\n idx = 0\n }\n } while (!focusFirstFocusable(list[idx], selectorsFocusable))\n }\n}\n\nexport const navigateVerticalList = createKeyboardNavigation({\n prevKey: 'ArrowUp',\n nextKey: 'ArrowDown',\n})\n\nexport const navigateHorizontalList = createKeyboardNavigation({\n prevKey: 'ArrowLeft',\n nextKey: 'ArrowRight',\n})\n"],"names":["SELECTORS_KEYBOARD_FOCUSABLE","SELECTORS_FOCUSABLE","focusFirstFocusable","element","selectors","matches","focus","descendent","querySelector","HTMLElement","focusLastFocusable","descendants","querySelectorAll","lastDescendant","length","concatClassNames","classNames","reduce","acc","className","createKeyboardNavigation","prevKey","nextKey","key","active","list","selectorsFocusable","idx","indexOf","keyboardKeys","validate","navigateVerticalList","navigateHorizontalList"],"mappings":"2CAGO,MAAMA,6BACX,ybAEK,MAAMC,oBACX,0OAEK,MAAMC,oBAAsBA,CAACC,EAAsBC,EAAYJ,gCACpE,GAAIG,EAAQE,QAAQD,WAAqBD,EAAQG,OAAU,WAGzD,OAFAH,EAAQG,SAED,EAGT,MAAMC,EAAaJ,EAAQK,cAAcJ,GAEzC,OAAIG,aAAsBE,oBAAsBF,EAAWD,OAAU,aACnEC,EAAWD,SAEJ,EAGG,EAGP,MAAMI,mBAAqBA,CAACP,EAAsBC,EAAYJ,gCACnE,MAAMW,EAAcR,EAAQS,iBAAiBR,GAC7C,MAAMS,EAAiBF,EAAYA,EAAYG,OAAS,GAExD,OAAID,aAA0BJ,oBAAsBI,EAAeP,OAAU,aAC3EO,EAAeP,SAER,EAGG,EAGDS,MAAAA,iBAAmBA,IAAIC,IAClCA,EAAWC,QAAe,CAACC,EAAKC,YACnBA,GAAc,WAEvBD,EAAMA,EAAMA,EAAM,IAAMC,EAAYA,GAG/BD,IACN,IAEE,MAAME,yBAA2BA,EACtCC,UACAC,aAKO,CACLC,EACAC,EACAC,EACAC,EAAqB1B,gCAErB,IAAI2B,EAAMF,EAAKG,QAAQJ,GAEvB,GAAIG,KAAS,GAAKF,EAAKX,SAAW,EAIlC,GACMe,aAAaR,GAASS,SAASP,GACjCI,IACSE,aAAaP,GAASQ,SAASP,IACxCI,IAGEA,EAAM,EACRA,EAAMF,EAAKX,OAAS,EACXa,EAAMF,EAAKX,OAAS,IAC7Ba,EAAM,UAEAzB,oBAAoBuB,EAAKE,GAAMD,GAAmB,EAInDK,MAAAA,qBAAuBX,yBAAyB,CAC3DC,QAAS,UACTC,QAAS,cAGEU,MAAAA,uBAAyBZ,yBAAyB,CAC7DC,QAAS,YACTC,QAAS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDomTargets.js","sources":["../../../../src/shared/utils/getDomTargets.ts"],"sourcesContent":["import type { DomTarget } from 'shared/types'\n\nexport const getDomTargets = <T extends HTMLElement = HTMLElement>(target: DomTarget<T> | DomTarget<T>[]): T[] =>\n (Array.isArray(target) ? target : [target]).reduce<T[]>((acc, item) => {\n if (item instanceof HTMLElement) {\n if (item.isConnected) acc.push(item)\n } else if (item && item.current instanceof HTMLElement) {\n if (item.current.isConnected) acc.push(item.current)\n }\n\n return acc\n }, [])\n"],"names":["target","Array","isArray","reduce","acc","item","HTMLElement","isConnected","push","current"],"mappings":"mCAEmEA,IAChEC,MAAMC,QAAQF,GAAUA,EAAS,CAACA,IAASG,QAAY,CAACC,EAAKC,KACxDA,aAAgBC,YACdD,EAAKE,aAAaH,EAAII,KAAKH,GACtBA,GAAQA,EAAKI,mBAAmBH,aACrCD,EAAKI,QAAQF,aAAaH,EAAII,KAAKH,EAAKI,SAGvCL,IACN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDomTargets.mjs","sources":["../../../../src/shared/utils/getDomTargets.ts"],"sourcesContent":["import type { DomTarget } from 'shared/types'\n\nexport const getDomTargets = <T extends HTMLElement = HTMLElement>(target: DomTarget<T> | DomTarget<T>[]): T[] =>\n (Array.isArray(target) ? target : [target]).reduce<T[]>((acc, item) => {\n if (item instanceof HTMLElement) {\n if (item.isConnected) acc.push(item)\n } else if (item && item.current instanceof HTMLElement) {\n if (item.current.isConnected) acc.push(item.current)\n }\n\n return acc\n }, [])\n"],"names":["getDomTargets","target","Array","isArray","reduce","acc","item","HTMLElement","isConnected","push","current"],"mappings":"AAEO,MAAMA,cAAsDC,IAChEC,MAAMC,QAAQF,GAAUA,EAAS,CAACA,IAASG,QAAY,CAACC,EAAKC,KACxDA,aAAgBC,YACdD,EAAKE,aAAaH,EAAII,KAAKH,GACtBA,GAAQA,EAAKI,mBAAmBH,aACrCD,EAAKI,QAAQF,aAAaH,EAAII,KAAKH,EAAKI,SAGvCL,IACN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getProgressPercent.js","sources":["../../../../src/shared/utils/getProgressPercent.ts"],"sourcesContent":["export const getProgressPercent = (value: number, max: number): number => {\n if (value < 0 || max <= 0) return 0\n\n const percent = (value / max) * 100\n\n return Number.isNaN(percent) ? 0 : Math.round(Math.min(percent, 100))\n}\n"],"names":["getProgressPercent","value","max","percent","Number","isNaN","Math","round","min"],"mappings":"wCAAkCA,CAACC,EAAeC,KAChD,GAAID,EAAQ,GAAKC,GAAO,EAAG,OAAO,EAElC,MAAMC,EAAWF,EAAQC,EAAO,IAEhC,OAAOE,OAAOC,MAAMF,GAAW,EAAIG,KAAKC,MAAMD,KAAKE,IAAIL,EAAS,KAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getProgressPercent.mjs","sources":["../../../../src/shared/utils/getProgressPercent.ts"],"sourcesContent":["export const getProgressPercent = (value: number, max: number): number => {\n if (value < 0 || max <= 0) return 0\n\n const percent = (value / max) * 100\n\n return Number.isNaN(percent) ? 0 : Math.round(Math.min(percent, 100))\n}\n"],"names":["getProgressPercent","value","max","percent","Number","isNaN","Math","round","min"],"mappings":"MAAaA,mBAAqBA,CAACC,EAAeC,KAChD,GAAID,EAAQ,GAAKC,GAAO,EAAG,OAAO,EAElC,MAAMC,EAAWF,EAAQC,EAAO,IAEhC,OAAOE,OAAOC,MAAMF,GAAW,EAAIG,KAAKC,MAAMD,KAAKE,IAAIL,EAAS,KAAK"}
|
package/shared/utils/misc.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';const deepmerge=require('deepmerge-ts').deepmergeCustom({mergeArrays:!1});exports.createDebouncedCallback=(e,r=100)=>{let t=null;return
|
|
1
|
+
'use strict';const deepmerge=require('deepmerge-ts').deepmergeCustom({mergeArrays:!1});exports.createDebouncedCallback=(e,r=100)=>{let t=null;return l=>{t&&clearTimeout(t),t=setTimeout((()=>{e(l),t=null}),r)}},exports.createThrottledCallback=(e,r=100)=>{let t=null;return l=>{t||(t=setTimeout((()=>{t=null}),r),e(l))}},exports.deepmerge=deepmerge;
|
|
2
2
|
//# sourceMappingURL=misc.js.map
|
package/shared/utils/misc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"misc.js","sources":["../../../../src/shared/utils/misc.ts"],"sourcesContent":["import { deepmergeCustom } from 'deepmerge-ts'\nimport type { Nullable } from 'shared/types'\n\nexport const deepmerge = deepmergeCustom({\n mergeArrays: false,\n})\n\nexport const createThrottledCallback = <T>(cb: (params: T) => void, throttleMS = 100): typeof cb => {\n let timerId: Nullable<ReturnType<typeof setTimeout>> = null\n\n return (params: T) => {\n if (timerId) return\n\n timerId = setTimeout(() => {\n timerId = null\n }, throttleMS)\n\n cb(params)\n }\n}\n\nexport const createDebouncedCallback = <T>(cb: (params: T) => void, debounceMS = 100): typeof cb => {\n let timerId: ReturnType<typeof setTimeout> | null = null\n\n return (params: T) => {\n if (timerId) clearTimeout(timerId)\n timerId = setTimeout(() => {\n cb(params)\n timerId = null\n }, debounceMS)\n }\n}\n
|
|
1
|
+
{"version":3,"file":"misc.js","sources":["../../../../src/shared/utils/misc.ts"],"sourcesContent":["import { deepmergeCustom } from 'deepmerge-ts'\nimport type { Nullable } from 'shared/types'\n\nexport const deepmerge = deepmergeCustom({\n mergeArrays: false,\n})\n\nexport const createThrottledCallback = <T>(cb: (params: T) => void, throttleMS = 100): typeof cb => {\n let timerId: Nullable<ReturnType<typeof setTimeout>> = null\n\n return (params: T) => {\n if (timerId) return\n\n timerId = setTimeout(() => {\n timerId = null\n }, throttleMS)\n\n cb(params)\n }\n}\n\nexport const createDebouncedCallback = <T>(cb: (params: T) => void, debounceMS = 100): typeof cb => {\n let timerId: ReturnType<typeof setTimeout> | null = null\n\n return (params: T) => {\n if (timerId) clearTimeout(timerId)\n timerId = setTimeout(() => {\n cb(params)\n timerId = null\n }, debounceMS)\n }\n}\n"],"names":["deepmerge","deepmergeCustom","mergeArrays","createDebouncedCallback","cb","debounceMS","timerId","params","clearTimeout","setTimeout","createThrottledCallback","throttleMS"],"mappings":"aAGaA,MAAAA,kCAAYC,gBAAgB,CACvCC,aAAa,oCAiBwBC,CAAIC,EAAyBC,EAAa,OAC/E,IAAIC,EAAgD,KAEpD,OAAQC,IACFD,GAASE,aAAaF,GAC1BA,EAAUG,YAAW,KACnBL,EAAGG,GACHD,EAAU,IAAI,GACbD,EAAW,CACf,kCAvBoCK,CAAIN,EAAyBO,EAAa,OAC/E,IAAIL,EAAmD,KAEvD,OAAQC,IACFD,IAEJA,EAAUG,YAAW,KACnBH,EAAU,IAAI,GACbK,GAEHP,EAAGG,GAAO,CACX"}
|
package/shared/utils/misc.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{deepmergeCustom}from'deepmerge-ts';const deepmerge=deepmergeCustom({mergeArrays:!1});const createThrottledCallback=(e,t=100)=>{let r=null;return l=>{r||(r=setTimeout((()=>{r=null}),t),e(l))}};const createDebouncedCallback=(e,t=100)=>{let r=null;return l=>{r&&clearTimeout(r),r=setTimeout((()=>{e(l),r=null}),t)}};
|
|
1
|
+
import{deepmergeCustom}from'deepmerge-ts';const deepmerge=deepmergeCustom({mergeArrays:!1});const createThrottledCallback=(e,t=100)=>{let r=null;return l=>{r||(r=setTimeout((()=>{r=null}),t),e(l))}};const createDebouncedCallback=(e,t=100)=>{let r=null;return l=>{r&&clearTimeout(r),r=setTimeout((()=>{e(l),r=null}),t)}};export{createDebouncedCallback,createThrottledCallback,deepmerge};
|
|
2
2
|
//# sourceMappingURL=misc.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"misc.mjs","sources":["../../../../src/shared/utils/misc.ts"],"sourcesContent":["import { deepmergeCustom } from 'deepmerge-ts'\nimport type { Nullable } from 'shared/types'\n\nexport const deepmerge = deepmergeCustom({\n mergeArrays: false,\n})\n\nexport const createThrottledCallback = <T>(cb: (params: T) => void, throttleMS = 100): typeof cb => {\n let timerId: Nullable<ReturnType<typeof setTimeout>> = null\n\n return (params: T) => {\n if (timerId) return\n\n timerId = setTimeout(() => {\n timerId = null\n }, throttleMS)\n\n cb(params)\n }\n}\n\nexport const createDebouncedCallback = <T>(cb: (params: T) => void, debounceMS = 100): typeof cb => {\n let timerId: ReturnType<typeof setTimeout> | null = null\n\n return (params: T) => {\n if (timerId) clearTimeout(timerId)\n timerId = setTimeout(() => {\n cb(params)\n timerId = null\n }, debounceMS)\n }\n}\n
|
|
1
|
+
{"version":3,"file":"misc.mjs","sources":["../../../../src/shared/utils/misc.ts"],"sourcesContent":["import { deepmergeCustom } from 'deepmerge-ts'\nimport type { Nullable } from 'shared/types'\n\nexport const deepmerge = deepmergeCustom({\n mergeArrays: false,\n})\n\nexport const createThrottledCallback = <T>(cb: (params: T) => void, throttleMS = 100): typeof cb => {\n let timerId: Nullable<ReturnType<typeof setTimeout>> = null\n\n return (params: T) => {\n if (timerId) return\n\n timerId = setTimeout(() => {\n timerId = null\n }, throttleMS)\n\n cb(params)\n }\n}\n\nexport const createDebouncedCallback = <T>(cb: (params: T) => void, debounceMS = 100): typeof cb => {\n let timerId: ReturnType<typeof setTimeout> | null = null\n\n return (params: T) => {\n if (timerId) clearTimeout(timerId)\n timerId = setTimeout(() => {\n cb(params)\n timerId = null\n }, debounceMS)\n }\n}\n"],"names":["deepmerge","deepmergeCustom","mergeArrays","createThrottledCallback","cb","throttleMS","timerId","params","setTimeout","createDebouncedCallback","debounceMS","clearTimeout"],"mappings":"0CAGaA,MAAAA,UAAYC,gBAAgB,CACvCC,aAAa,IAGR,MAAMC,wBAA0BA,CAAIC,EAAyBC,EAAa,OAC/E,IAAIC,EAAmD,KAEvD,OAAQC,IACFD,IAEJA,EAAUE,YAAW,KACnBF,EAAU,IAAI,GACbD,GAEHD,EAAGG,GAAO,CACX,EAGI,MAAME,wBAA0BA,CAAIL,EAAyBM,EAAa,OAC/E,IAAIJ,EAAgD,KAEpD,OAAQC,IACFD,GAASK,aAAaL,GAC1BA,EAAUE,YAAW,KACnBJ,EAAGG,GACHD,EAAU,IAAI,GACbI,EAAW,CACf"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var React=require('react');var accordion=require('../../shared/context/accordion.js');var misc=require('../../shared/utils/misc.js');exports.useAccordionPanel=({defaultExpanded:e=!1,id:n,expanded:t,onExpandedChange:o})=>{const a=React.useContext(accordion.AccordionPanelsContext);const[c,r]=React.useState(t??e);const s=a!==null&&typeof n=='string';return React.useLayoutEffect((()=>{s||t===void 0||r(t)}),[s,t]),{panelExpanded:s?a.expandedPanels.includes(n):c,setPanelExpanded:e=>{s?a.updatePanels(n,e):(t===void 0&&r(e),o&&o(e))}}},exports.useAccordionPanelProps=e=>{const n=React.useContext(accordion.AccordionPropsContext);return n?misc.deepmerge(n,e):e};
|
|
2
|
-
//# sourceMappingURL=hooks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sources":["../../../../src/components/AccordionItem/hooks.ts"],"sourcesContent":["import { useContext, useState, useLayoutEffect } from 'react'\nimport { AccordionPanelsContext, AccordionPropsContext } from 'shared/context/accordion'\nimport { deepmerge } from 'shared/utils/misc'\nimport type { AccordionItemProps } from './types'\n\nexport const useAccordionPanel = ({\n defaultExpanded = false,\n id,\n expanded,\n onExpandedChange,\n}: Pick<AccordionItemProps, 'id' | 'expanded' | 'defaultExpanded' | 'onExpandedChange'>): {\n panelExpanded: boolean\n setPanelExpanded: (update: boolean) => void\n} => {\n const context = useContext(AccordionPanelsContext)\n\n const [panelExpandedLocal, setPanelExpandedLocal] = useState<boolean>(expanded ?? defaultExpanded)\n\n const contextEnabled = context !== null && typeof id === 'string'\n\n useLayoutEffect(() => {\n if (!contextEnabled && expanded !== undefined) {\n setPanelExpandedLocal(expanded)\n }\n }, [contextEnabled, expanded])\n\n return {\n panelExpanded: contextEnabled ? context.expandedPanels.includes(id) : panelExpandedLocal,\n setPanelExpanded: (update) => {\n if (contextEnabled) {\n context.updatePanels(id, update)\n } else {\n if (expanded === undefined) setPanelExpandedLocal(update)\n if (onExpandedChange) onExpandedChange(update)\n }\n },\n }\n}\n\nexport const useAccordionPanelProps = <T>(props: T): T => {\n const contextProps = useContext(AccordionPropsContext)\n\n return (contextProps ? deepmerge(contextProps, props) : props) as T\n}\n"],"names":["useAccordionPanel","defaultExpanded","id","expanded","onExpandedChange","context","useContext","AccordionPanelsContext","panelExpandedLocal","setPanelExpandedLocal","useState","contextEnabled","useLayoutEffect","undefined","panelExpanded","expandedPanels","includes","setPanelExpanded","update","updatePanels","props","contextProps","AccordionPropsContext","deepmerge"],"mappings":"4KAKiCA,EAC/BC,mBAAkB,EAClBC,KACAC,WACAC,uBAKA,MAAMC,EAAUC,iBAAWC,UAAAA,wBAE3B,MAAOC,EAAoBC,GAAyBC,MAAAA,SAAkBP,GAAYF,GAElF,MAAMU,EAAiBN,IAAY,aAAeH,GAAO,SAQzD,OANAU,MAAAA,iBAAgB,KACTD,GAAkBR,SAAaU,GAClCJ,EAAsBN,EACxB,GACC,CAACQ,EAAgBR,IAEb,CACLW,cAAeH,EAAiBN,EAAQU,eAAeC,SAASd,GAAMM,EACtES,iBAAmBC,IACbP,EACFN,EAAQc,aAAajB,EAAIgB,IAErBf,SAAaU,GAAWJ,EAAsBS,GAC9Cd,GAAkBA,EAAiBc,GACzC,EAEH,iCAGuCE,IACxC,MAAMC,EAAef,iBAAWgB,UAAAA,uBAEhC,OAAQD,EAAeE,KAASA,UAACF,EAAcD,GAASA,CAAK"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useContext,useState,useLayoutEffect}from'react';import{AccordionPanelsContext,AccordionPropsContext}from'../../shared/context/accordion.mjs';import{deepmerge}from'../../shared/utils/misc.mjs';const useAccordionPanel=({defaultExpanded:e=!1,id:o,expanded:n,onExpandedChange:t})=>{const s=useContext(AccordionPanelsContext);const[d,c]=useState(n??e);const r=s!==null&&typeof o=='string';return useLayoutEffect((()=>{r||n===void 0||c(n)}),[r,n]),{panelExpanded:r?s.expandedPanels.includes(o):d,setPanelExpanded:e=>{r?s.updatePanels(o,e):(n===void 0&&c(e),t&&t(e))}}};const useAccordionPanelProps=e=>{const o=useContext(AccordionPropsContext);return o?deepmerge(o,e):e};export{useAccordionPanel,useAccordionPanelProps};
|
|
2
|
-
//# sourceMappingURL=hooks.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.mjs","sources":["../../../../src/components/AccordionItem/hooks.ts"],"sourcesContent":["import { useContext, useState, useLayoutEffect } from 'react'\nimport { AccordionPanelsContext, AccordionPropsContext } from 'shared/context/accordion'\nimport { deepmerge } from 'shared/utils/misc'\nimport type { AccordionItemProps } from './types'\n\nexport const useAccordionPanel = ({\n defaultExpanded = false,\n id,\n expanded,\n onExpandedChange,\n}: Pick<AccordionItemProps, 'id' | 'expanded' | 'defaultExpanded' | 'onExpandedChange'>): {\n panelExpanded: boolean\n setPanelExpanded: (update: boolean) => void\n} => {\n const context = useContext(AccordionPanelsContext)\n\n const [panelExpandedLocal, setPanelExpandedLocal] = useState<boolean>(expanded ?? defaultExpanded)\n\n const contextEnabled = context !== null && typeof id === 'string'\n\n useLayoutEffect(() => {\n if (!contextEnabled && expanded !== undefined) {\n setPanelExpandedLocal(expanded)\n }\n }, [contextEnabled, expanded])\n\n return {\n panelExpanded: contextEnabled ? context.expandedPanels.includes(id) : panelExpandedLocal,\n setPanelExpanded: (update) => {\n if (contextEnabled) {\n context.updatePanels(id, update)\n } else {\n if (expanded === undefined) setPanelExpandedLocal(update)\n if (onExpandedChange) onExpandedChange(update)\n }\n },\n }\n}\n\nexport const useAccordionPanelProps = <T>(props: T): T => {\n const contextProps = useContext(AccordionPropsContext)\n\n return (contextProps ? deepmerge(contextProps, props) : props) as T\n}\n"],"names":["useAccordionPanel","defaultExpanded","id","expanded","onExpandedChange","context","useContext","AccordionPanelsContext","panelExpandedLocal","setPanelExpandedLocal","useState","contextEnabled","useLayoutEffect","undefined","panelExpanded","expandedPanels","includes","setPanelExpanded","update","updatePanels","useAccordionPanelProps","props","contextProps","AccordionPropsContext","deepmerge"],"mappings":"uMAKO,MAAMA,kBAAoBA,EAC/BC,mBAAkB,EAClBC,KACAC,WACAC,uBAKA,MAAMC,EAAUC,WAAWC,wBAE3B,MAAOC,EAAoBC,GAAyBC,SAAkBP,GAAYF,GAElF,MAAMU,EAAiBN,IAAY,aAAeH,GAAO,SAQzD,OANAU,iBAAgB,KACTD,GAAkBR,SAAaU,GAClCJ,EAAsBN,EACxB,GACC,CAACQ,EAAgBR,IAEb,CACLW,cAAeH,EAAiBN,EAAQU,eAAeC,SAASd,GAAMM,EACtES,iBAAmBC,IACbP,EACFN,EAAQc,aAAajB,EAAIgB,IAErBf,SAAaU,GAAWJ,EAAsBS,GAC9Cd,GAAkBA,EAAiBc,GACzC,EAEH,EAGUE,MAAAA,uBAA6BC,IACxC,MAAMC,EAAehB,WAAWiB,uBAEhC,OAAQD,EAAeE,UAAUF,EAAcD,GAASA,CAAK"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';exports.SIZES={l:{fontSize:18,paddingTop:4,paddingRight:8,paddingBottom:4,paddingLeft:16,minHeight:56,borderRadius:12},m:{fontSize:16,paddingTop:4,paddingRight:8,paddingBottom:4,paddingLeft:16,minHeight:48,borderRadius:10},s:{fontSize:14,paddingTop:2,paddingRight:6,paddingBottom:2,paddingLeft:14,minHeight:40,borderRadius:8}};
|
|
2
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../src/components/FormInputLabel/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { FormInputLabelSize } from './types'\n\nexport const SIZES: Record<FormInputLabelSize, CSSProperties> = {\n l: {\n fontSize: 18,\n paddingTop: 4,\n paddingRight: 8,\n paddingBottom: 4,\n paddingLeft: 16,\n minHeight: 56,\n borderRadius: 12,\n },\n m: {\n fontSize: 16,\n paddingTop: 4,\n paddingRight: 8,\n paddingBottom: 4,\n paddingLeft: 16,\n minHeight: 48,\n borderRadius: 10,\n },\n s: {\n fontSize: 14,\n paddingTop: 2,\n paddingRight: 6,\n paddingBottom: 2,\n paddingLeft: 14,\n minHeight: 40,\n borderRadius: 8,\n },\n}\n"],"names":["l","fontSize","paddingTop","paddingRight","paddingBottom","paddingLeft","minHeight","borderRadius","m","s"],"mappings":"2BAGgE,CAC9DA,EAAG,CACDC,SAAU,GACVC,WAAY,EACZC,aAAc,EACdC,cAAe,EACfC,YAAa,GACbC,UAAW,GACXC,aAAc,IAEhBC,EAAG,CACDP,SAAU,GACVC,WAAY,EACZC,aAAc,EACdC,cAAe,EACfC,YAAa,GACbC,UAAW,GACXC,aAAc,IAEhBE,EAAG,CACDR,SAAU,GACVC,WAAY,EACZC,aAAc,EACdC,cAAe,EACfC,YAAa,GACbC,UAAW,GACXC,aAAc"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const SIZES={l:{fontSize:18,paddingTop:4,paddingRight:8,paddingBottom:4,paddingLeft:16,minHeight:56,borderRadius:12},m:{fontSize:16,paddingTop:4,paddingRight:8,paddingBottom:4,paddingLeft:16,minHeight:48,borderRadius:10},s:{fontSize:14,paddingTop:2,paddingRight:6,paddingBottom:2,paddingLeft:14,minHeight:40,borderRadius:8}};export{SIZES};
|
|
2
|
-
//# sourceMappingURL=constants.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","sources":["../../../../src/components/FormInputLabel/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { FormInputLabelSize } from './types'\n\nexport const SIZES: Record<FormInputLabelSize, CSSProperties> = {\n l: {\n fontSize: 18,\n paddingTop: 4,\n paddingRight: 8,\n paddingBottom: 4,\n paddingLeft: 16,\n minHeight: 56,\n borderRadius: 12,\n },\n m: {\n fontSize: 16,\n paddingTop: 4,\n paddingRight: 8,\n paddingBottom: 4,\n paddingLeft: 16,\n minHeight: 48,\n borderRadius: 10,\n },\n s: {\n fontSize: 14,\n paddingTop: 2,\n paddingRight: 6,\n paddingBottom: 2,\n paddingLeft: 14,\n minHeight: 40,\n borderRadius: 8,\n },\n}\n"],"names":["SIZES","l","fontSize","paddingTop","paddingRight","paddingBottom","paddingLeft","minHeight","borderRadius","m","s"],"mappings":"AAGO,MAAMA,MAAmD,CAC9DC,EAAG,CACDC,SAAU,GACVC,WAAY,EACZC,aAAc,EACdC,cAAe,EACfC,YAAa,GACbC,UAAW,GACXC,aAAc,IAEhBC,EAAG,CACDP,SAAU,GACVC,WAAY,EACZC,aAAc,EACdC,cAAe,EACfC,YAAa,GACbC,UAAW,GACXC,aAAc,IAEhBE,EAAG,CACDR,SAAU,GACVC,WAAY,EACZC,aAAc,EACdC,cAAe,EACfC,YAAa,GACbC,UAAW,GACXC,aAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../src/components/Input/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport { SIZES_SQUARE as SIZES_ICON_BUTTON } from 'components/IconButton'\nimport type { InputSize } from './types'\n\nexport const SIZES_ICON: Record<InputSize, CSSProperties> = {\n l: { fontSize: 24 },\n m: { fontSize: 24 },\n s: { fontSize: 20 },\n}\n\nexport const SIZES_CONTROL: Record<InputSize, CSSProperties> = {\n l: SIZES_ICON_BUTTON.xl,\n m: SIZES_ICON_BUTTON.xl,\n s: SIZES_ICON_BUTTON.l,\n}\n"],"names":["l","SIZES_ICON_BUTTON","SIZES_SQUARE","xl","m","s","fontSize"],"mappings":"+EAU+D,CAC7DA,EAAGC,MAAiBC,aAACC,GACrBC,EAAGH,MAAiBC,aAACC,GACrBE,EAAGJ,MAAiBC,aAACF,sBATqC,CAC1DA,EAAG,CAAEM,SAAU,IACfF,EAAG,CAAEE,SAAU,IACfD,EAAG,CAAEC,SAAU"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","sources":["../../../../src/components/Input/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport { SIZES_SQUARE as SIZES_ICON_BUTTON } from 'components/IconButton'\nimport type { InputSize } from './types'\n\nexport const SIZES_ICON: Record<InputSize, CSSProperties> = {\n l: { fontSize: 24 },\n m: { fontSize: 24 },\n s: { fontSize: 20 },\n}\n\nexport const SIZES_CONTROL: Record<InputSize, CSSProperties> = {\n l: SIZES_ICON_BUTTON.xl,\n m: SIZES_ICON_BUTTON.xl,\n s: SIZES_ICON_BUTTON.l,\n}\n"],"names":["SIZES_ICON","l","fontSize","m","s","SIZES_CONTROL","SIZES_ICON_BUTTON","xl"],"mappings":"kDAIO,MAAMA,WAA+C,CAC1DC,EAAG,CAAEC,SAAU,IACfC,EAAG,CAAED,SAAU,IACfE,EAAG,CAAEF,SAAU,KAGV,MAAMG,cAAkD,CAC7DJ,EAAGK,aAAkBC,GACrBJ,EAAGG,aAAkBC,GACrBH,EAAGE,aAAkBL"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';const SIZES={l:{fontSize:18,paddingTop:14,paddingRight:16,paddingBottom:14,paddingLeft:16,minHeight:'auto',borderRadius:12},m:{fontSize:16,paddingTop:12,paddingRight:16,paddingBottom:12,paddingLeft:16,minHeight:'auto',borderRadius:10},s:{fontSize:14,paddingTop:10,paddingRight:14,paddingBottom:10,paddingLeft:14,minHeight:'auto',borderRadius:8}};const SIZES_WITH_LABEL={l:{...SIZES.l,paddingTop:5},m:{...SIZES.m,paddingTop:4},s:{...SIZES.s,paddingTop:2}};exports.SIZES=SIZES,exports.SIZES_WITH_LABEL=SIZES_WITH_LABEL;
|
|
2
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../src/components/Textarea/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { TextareaSize } from './types'\n\nexport const SIZES: Record<TextareaSize, CSSProperties> = {\n l: {\n fontSize: 18,\n paddingTop: 14,\n paddingRight: 16,\n paddingBottom: 14,\n paddingLeft: 16,\n minHeight: 'auto',\n borderRadius: 12,\n },\n m: {\n fontSize: 16,\n paddingTop: 12,\n paddingRight: 16,\n paddingBottom: 12,\n paddingLeft: 16,\n minHeight: 'auto',\n borderRadius: 10,\n },\n s: {\n fontSize: 14,\n paddingTop: 10,\n paddingRight: 14,\n paddingBottom: 10,\n paddingLeft: 14,\n minHeight: 'auto',\n borderRadius: 8,\n },\n}\n\nexport const SIZES_WITH_LABEL: Record<TextareaSize, CSSProperties> = {\n l: {\n ...SIZES.l,\n paddingTop: 5,\n },\n m: {\n ...SIZES.m,\n paddingTop: 4,\n },\n s: {\n ...SIZES.s,\n paddingTop: 2,\n },\n}\n"],"names":["SIZES","l","fontSize","paddingTop","paddingRight","paddingBottom","paddingLeft","minHeight","borderRadius","m","s","SIZES_WITH_LABEL"],"mappings":"aAGO,MAAMA,MAA6C,CACxDC,EAAG,CACDC,SAAU,GACVC,WAAY,GACZC,aAAc,GACdC,cAAe,GACfC,YAAa,GACbC,UAAW,OACXC,aAAc,IAEhBC,EAAG,CACDP,SAAU,GACVC,WAAY,GACZC,aAAc,GACdC,cAAe,GACfC,YAAa,GACbC,UAAW,OACXC,aAAc,IAEhBE,EAAG,CACDR,SAAU,GACVC,WAAY,GACZC,aAAc,GACdC,cAAe,GACfC,YAAa,GACbC,UAAW,OACXC,aAAc,IAIX,MAAMG,iBAAwD,CACnEV,EAAG,IACED,MAAMC,EACTE,WAAY,GAEdM,EAAG,IACET,MAAMS,EACTN,WAAY,GAEdO,EAAG,IACEV,MAAMU,EACTP,WAAY"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const SIZES={l:{fontSize:18,paddingTop:14,paddingRight:16,paddingBottom:14,paddingLeft:16,minHeight:'auto',borderRadius:12},m:{fontSize:16,paddingTop:12,paddingRight:16,paddingBottom:12,paddingLeft:16,minHeight:'auto',borderRadius:10},s:{fontSize:14,paddingTop:10,paddingRight:14,paddingBottom:10,paddingLeft:14,minHeight:'auto',borderRadius:8}};const SIZES_WITH_LABEL={l:{...SIZES.l,paddingTop:5},m:{...SIZES.m,paddingTop:4},s:{...SIZES.s,paddingTop:2}};export{SIZES,SIZES_WITH_LABEL};
|
|
2
|
-
//# sourceMappingURL=constants.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","sources":["../../../../src/components/Textarea/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { TextareaSize } from './types'\n\nexport const SIZES: Record<TextareaSize, CSSProperties> = {\n l: {\n fontSize: 18,\n paddingTop: 14,\n paddingRight: 16,\n paddingBottom: 14,\n paddingLeft: 16,\n minHeight: 'auto',\n borderRadius: 12,\n },\n m: {\n fontSize: 16,\n paddingTop: 12,\n paddingRight: 16,\n paddingBottom: 12,\n paddingLeft: 16,\n minHeight: 'auto',\n borderRadius: 10,\n },\n s: {\n fontSize: 14,\n paddingTop: 10,\n paddingRight: 14,\n paddingBottom: 10,\n paddingLeft: 14,\n minHeight: 'auto',\n borderRadius: 8,\n },\n}\n\nexport const SIZES_WITH_LABEL: Record<TextareaSize, CSSProperties> = {\n l: {\n ...SIZES.l,\n paddingTop: 5,\n },\n m: {\n ...SIZES.m,\n paddingTop: 4,\n },\n s: {\n ...SIZES.s,\n paddingTop: 2,\n },\n}\n"],"names":["SIZES","l","fontSize","paddingTop","paddingRight","paddingBottom","paddingLeft","minHeight","borderRadius","m","s","SIZES_WITH_LABEL"],"mappings":"AAGO,MAAMA,MAA6C,CACxDC,EAAG,CACDC,SAAU,GACVC,WAAY,GACZC,aAAc,GACdC,cAAe,GACfC,YAAa,GACbC,UAAW,OACXC,aAAc,IAEhBC,EAAG,CACDP,SAAU,GACVC,WAAY,GACZC,aAAc,GACdC,cAAe,GACfC,YAAa,GACbC,UAAW,OACXC,aAAc,IAEhBE,EAAG,CACDR,SAAU,GACVC,WAAY,GACZC,aAAc,GACdC,cAAe,GACfC,YAAa,GACbC,UAAW,OACXC,aAAc,IAIX,MAAMG,iBAAwD,CACnEV,EAAG,IACED,MAAMC,EACTE,WAAY,GAEdM,EAAG,IACET,MAAMS,EACTN,WAAY,GAEdO,EAAG,IACEV,MAAMU,EACTP,WAAY"}
|