@alextheman/components 6.10.0 → 6.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +47 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +91 -85
- package/dist/index.d.ts +92 -86
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +11 -8
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License Copyright (c) 2026 alextheman231
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free
|
|
4
|
+
of charge, to any person obtaining a copy of this software and associated
|
|
5
|
+
documentation files (the "Software"), to deal in the Software without
|
|
6
|
+
restriction, including without limitation the rights to use, copy, modify, merge,
|
|
7
|
+
publish, distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to the
|
|
9
|
+
following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice
|
|
12
|
+
(including the next paragraph) shall be included in all copies or substantial
|
|
13
|
+
portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
|
16
|
+
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
17
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
|
18
|
+
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
19
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
20
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# @alextheman/components
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
[](https://github.com/alextheman231/components/actions/workflows/ci.yml)
|
|
8
|
+
[](https://github.com/alextheman231/components/actions/workflows/publish.yml)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
This is a React component library used across my projects. It is built with React and Material UI, and integrates with tools such as react-router-dom (soon to be replaced with Wouter) and react-hook-form (soon to be replaced with TanStack Form).
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
To install this into your project, you can do so with the following command:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @alextheman/components
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
From there, you may import any of the package's components. If you're using this package in your own components package, you may need to install it as a peer dependency in order for contexts to work properly.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install --save-peer @alextheman/components
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Quick start
|
|
28
|
+
|
|
29
|
+
You can import and use any component from the package in the following way:
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { ExternalLink } from "@alextheman/components";
|
|
33
|
+
|
|
34
|
+
function MyComponent() {
|
|
35
|
+
return (
|
|
36
|
+
<ExternalLink href="https://alextheman231.github.io/components/">
|
|
37
|
+
Link to documentation
|
|
38
|
+
</ExternalLink>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Documentation
|
|
44
|
+
|
|
45
|
+
The hosted documentation site uses Storybook to provide interactive demos and general documentation of the features of the package. It can be found [here](https://alextheman231.github.io/components/).
|
|
46
|
+
|
|
47
|
+
See the GitHub repository [here](https://github.com/alextheman231/components).
|
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`@mui/material/Box`);c=s(c);let l=require(`@mui/material/Card`);l=s(l);let u=require(`@mui/material/CardContent`);u=s(u);let d=require(`@mui/material/CardHeader`);d=s(d);let f=require(`@mui/material/Chip`);f=s(f);let p=require(`@mui/material/Divider`);p=s(p);let m=require(`@mui/material/Stack`);m=s(m);let h=require(`@mui/material/Typography`);h=s(h);let g=require(`react/jsx-runtime`),_=require(`@mui/material/ButtonBase`);_=s(_);let v=require(`@mui/material/Collapse`);v=s(v);let y=require(`react`),b=require(`react-icons/md`),x=require(`@mui/material/Link`);x=s(x);let S=require(`@mui/material/Button`);S=s(S);let C=require(`@mui/material/styles`),w=require(`@mui/material/IconButton`);w=s(w);let T=require(`@mui/material/List`);T=s(T);let E=require(`@mui/material/ListItem`);E=s(E);let D=require(`@mui/material/ListItemText`);D=s(D);let O=require(`react-router-dom`),k=require(`@mui/material/CircularProgress`);k=s(k);let A=require(`@alextheman/utility`),j=require(`@mui/material/Alert`);j=s(j);let M=require(`@mui/material/CssBaseline`);M=s(M);let N=require(`@mui/material/Snackbar`);N=s(N);let P=require(`@mui/material/Tooltip`);P=s(P);let F=require(`@mui/material/Switch`);F=s(F);let I=require(`@mui/material/BottomNavigation`);I=s(I);let L=require(`@mui/material/BottomNavigationAction`);L=s(L);let R=require(`@mui/material/Paper`);R=s(R);let z=require(`@mui/material/AppBar`);z=s(z);let B=require(`@mui/material/Drawer`);B=s(B);let V=require(`@mui/material/ListItemButton`);V=s(V);let H=require(`@mui/material/ListItemIcon`);H=s(H);let U=require(`@mui/material/Toolbar`);U=s(U);let ee=require(`common-tags`),W=require(`react-live`),G=require(`@mui/material/Skeleton`);G=s(G);let K=require(`@mui/material/TableCell`);K=s(K);let q=require(`@mui/material/TableRow`);q=s(q);let te=require(`react-hook-form`),J=require(`@mui/material/Menu`);J=s(J);let Y=require(`@mui/material/MenuItem`);Y=s(Y);let ne=require(`@tanstack/react-form`);require(`@mui/material/TextField`);let X=require(`@mui/material/Popover`);X=s(X);function re({containerLabel:e,chipLabels:t}){return(0,g.jsx)(l.default,{sx:{width:320,height:420,backgroundColor:`rgba(255,255,255,0.07)`,backdropFilter:`blur(8px)`,border:`1px solid rgba(255,255,255,0.06)`,boxShadow:`0 10px 40px rgba(0,0,0,0.35)`},children:(0,g.jsxs)(u.default,{children:[(0,g.jsx)(h.default,{variant:`h6`,gutterBottom:!0,sx:{color:`#f8fafc`},children:e}),(0,g.jsx)(m.default,{spacing:1,children:t.map(e=>(0,g.jsx)(f.default,{label:e,sx:{backgroundColor:`rgba(255,255,255,0.11)`,color:`rgba(255,255,255,0.88)`,border:`1px solid rgba(255,255,255,0.06)`}},e))})]})})}function ie(){return(0,g.jsx)(c.default,{sx:{width:120,height:6,borderRadius:3,background:`linear-gradient(90deg, #f43f5e, #a78bfa, #22d3ee)`,boxShadow:`0 0 24px rgba(167,139,250,0.55)`}})}function ae(){return(0,g.jsxs)(l.default,{sx:{width:1e3,height:1e3,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,p:4,background:`radial-gradient(circle at 20% 10%, rgba(167,139,250,0.35) 0%, rgba(167,139,250,0.12) 35%, rgba(0,0,0,0) 55%), linear-gradient(135deg, #3a3380 0%, #1d2e5f 40%, #2d3f55 100%)`,color:`white`},elevation:0,children:[(0,g.jsx)(d.default,{title:`An Interface For You And I`,sx:{color:`#f8fafc`,textAlign:`center`,"& .MuiCardHeader-title":{fontSize:40,fontWeight:600,letterSpacing:2}}}),(0,g.jsx)(p.default,{sx:{borderColor:`rgba(255,255,255,0.2)`}}),(0,g.jsx)(u.default,{sx:{flex:1,display:`flex`,alignItems:`center`},children:(0,g.jsxs)(m.default,{direction:`row`,spacing:4,sx:{width:`100%`,justifyContent:`center`,alignItems:`center`},children:[(0,g.jsx)(re,{containerLabel:`You`,chipLabels:[`state`,`context`,`input`,`event`,`focus`,`value`,`history`]}),(0,g.jsx)(ie,{}),(0,g.jsx)(re,{containerLabel:`I`,chipLabels:[`render`,`effect`,`response`,`update`,`history`,`layout`,`provider`]})]})})]})}function oe({isInitiallyOpen:e,onOpen:t,onClose:n,children:r,buttonStyles:i,buttonContents:a,buttonComponent:o=_.default,collapseProps:s,openIcon:l=(0,g.jsx)(b.MdArrowDropUp,{}),closedIcon:u=(0,g.jsx)(b.MdArrowDropDown,{}),useDefaultStyling:d=o===_.default}){let[f,p]=(0,y.useState)(!!e);return(0,y.useEffect)(()=>{f&&t?t():!f&&n&&n()},[f]),(0,g.jsxs)(c.default,{children:[(0,g.jsxs)(o,{onClick:()=>{p(e=>!e)},sx:d?{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,paddingY:1.5,paddingX:2,textAlign:`center`,"&:hover":o===_.default?{backgroundColor:`action.hover`}:null,...i}:i,"aria-expanded":f,children:[a,f?l:u]}),(0,g.jsx)(v.default,{in:f,...s,children:r})]})}function se({href:e,children:t,ref:n,...r}){return(0,g.jsx)(x.default,{component:`a`,href:e,ref:n,target:`_blank`,rel:`noopener noreferrer`,...r,children:t})}const ce={PDF:`application/pdf`,PNG:`image/png`,JPEG:`image/jpeg`,JPG:`image/jpg`,XLSX:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,DOCX:`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,MP3:`audio/mp3`,MP4:`video/mp4`,WAV:`audio/wav`},le=(0,C.styled)(`input`)({clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:1,overflow:`hidden`,position:`absolute`,bottom:0,left:0,whiteSpace:`nowrap`,width:1}),ue=(0,C.styled)(`div`)(({theme:e,$dragging:t})=>({border:`2px dashed`,borderColor:t?e.palette.primary.main:`#ccc`,backgroundColor:t?e.palette.action.hover:`transparent`,borderRadius:8,padding:`1.5rem`,textAlign:`center`,transition:`border-color 0.2s`,cursor:`pointer`}));function de({onFileInput:e,label:t=`Upload files`,multiple:n,accept:r,useDropzone:i,...a}){let[o,s]=(0,y.useState)(!1),c=(0,y.useId)(),l=(0,g.jsxs)(S.default,{variant:`contained`,component:`label`,"aria-label":`File input button`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),document.getElementById(c)?.click())},...a,startIcon:a.startIcon??(0,g.jsx)(b.MdCloudUpload,{}),children:[t,(0,g.jsx)(le,{id:c,type:`file`,onChange:t=>{let n=t.target;e(Array.from(n.files??[])),n.value=``},multiple:n,accept:r?.join(`,`),disabled:a.disabled})]});return i?(0,g.jsx)(ue,{$dragging:o,onDragOver:e=>{e.preventDefault(),!a.disabled&&s(!0)},onDragLeave:e=>{e.preventDefault(),s(!1)},onDrop:t=>{t.preventDefault(),s(!1),!a.disabled&&e(Array.from(t.dataTransfer.files??[]))},children:l}):l}function fe({files:e,setFiles:t,multiple:n=!0,...r}){function i(e){t(t=>[...t,...e])}return(0,g.jsxs)(c.default,{children:[(0,g.jsx)(de,{...r,multiple:n,onFileInput:i}),(0,g.jsx)(T.default,{children:e.map(e=>(0,g.jsx)(E.default,{secondaryAction:(0,g.jsx)(w.default,{"aria-label":`Delete`,edge:`end`,onClick:()=>{t(t=>t.filter(t=>t!==e))},children:(0,g.jsx)(b.MdDelete,{})}),children:(0,g.jsx)(D.default,{primary:e.name})},`${e.name}-${e.lastModified}`))})]})}function Z({to:e,component:t=O.Link,children:n,ref:r,...i}){return(0,g.jsx)(x.default,{component:t,to:e,ref:r,...i,children:n})}const pe=(0,y.createContext)(void 0);function me({strict:e=!0}={}){let t=(0,y.useContext)(pe);if(e&&!t)throw new A.DataError({strict:e,context:t},`LOADER_PROVIDER_NOT_FOUND`,`Could not find the LoaderProvider context. Please double-check that it is present.`);return t}function he({children:e,loadingComponent:t=(0,g.jsx)(k.default,{}),...n}){return(0,g.jsx)(pe.Provider,{value:{loadingComponent:t,...n},children:e})}function ge({children:e,dataParser:t,loadingComponent:n}){let{isLoading:r,data:i,dataParser:a,loadingComponent:o,error:s}=me(),c=t??a;return r?(0,g.jsx)(g.Fragment,{children:n??o}):s||i==null?(0,g.jsx)(g.Fragment,{}):c?typeof e==`function`?(0,g.jsx)(g.Fragment,{children:e(c(i))}):(0,g.jsx)(g.Fragment,{children:e}):typeof e==`function`?(0,g.jsx)(g.Fragment,{children:e(i)}):(0,g.jsx)(g.Fragment,{children:e})}function _e({children:e,undefinedComponent:t,nullComponent:n,nullableComponent:r,logError:i}){let{isLoading:a,data:o,error:s,errorComponent:c,logError:l}=me(),u=i??l,d=(0,y.useRef)(!1),f=e??c;return s?(u&&!d.current&&(console.error(s),d.current=!0),typeof f==`function`?f(s):f?(0,g.jsx)(g.Fragment,{children:f}):(0,g.jsx)(j.default,{severity:`error`,children:s?.message??`An unknown error has occured. Please try again later.`})):!a&&o==null?r?(u&&!d.current&&(console.error(`Data is nullable after loading.`),d.current=!0),(0,g.jsx)(g.Fragment,{children:r})):o===void 0&&(u&&!d.current&&(console.error(`Data is undefined after loading. This could either be an issue with the query or you have not passed in the data to LoaderProvider. Please double-check that you have provided data.`),d.current=!0),t)?(0,g.jsx)(g.Fragment,{children:t}):o===null&&(u&&!d.current&&(console.error(`Data is null after loading.`),d.current=!0),n)?(0,g.jsx)(g.Fragment,{children:n}):(0,g.jsx)(j.default,{severity:`error`,children:`Failed to load data. Please try again later.`}):(0,g.jsx)(g.Fragment,{})}var ve=he;const ye=(0,y.createContext)({toggleMode:()=>{},mode:`dark`});function Q({strict:e=!0}={}){let t=(0,y.useContext)(ye);if(e&&!t)throw new A.DataError({strict:e,context:t},`MODE_PROVIDER_NOT_FOUND`,`Could not find the ModeProvider context. Please double-check that it is present.`);return t}function be({children:e,mode:t=`dark`}){let[n,r]=(0,y.useState)(t),i=(0,y.useMemo)(()=>(0,C.createTheme)({palette:{mode:n}}),[n]);return(0,g.jsx)(ye.Provider,{value:{mode:n,toggleMode:()=>{r(e=>e===`light`?`dark`:`light`)}},children:(0,g.jsxs)(C.ThemeProvider,{theme:i,children:[(0,g.jsx)(M.default,{}),e]})})}const xe=(0,y.createContext)({windowWidth:0,windowHeight:0,isLargeScreen:!1});function Se({strict:e=!0}={}){let t=(0,y.useContext)(xe);if(e&&!t)throw new A.DataError({strict:e,context:t},`SCREEN_SIZE_PROVIDER_NOT_FOUND`,`Could not find the ScreenSizeProvider context. Please double-check that it is present.`);return t}function Ce({children:e,largeScreenWidth:t=669,largeScreenHeight:n=660}){let[r,i]=(0,y.useState)(window.innerWidth),[a,o]=(0,y.useState)(window.innerHeight);(0,y.useEffect)(()=>{function e(){i(window.innerWidth),o(window.innerHeight)}return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]);let s=(0,y.useMemo)(()=>r>t&&a>n,[r,a,t,n]);return(0,g.jsx)(xe.Provider,{value:{isLargeScreen:s,windowWidth:r,windowHeight:a},children:e})}const we=(0,y.createContext)(void 0);function Te({strict:e=!0}={}){let t=(0,y.useContext)(we);if(e&&!t)throw new A.DataError({strict:e,context:t},`SNACKBAR_PROVIDER_NOT_FOUND`,`Could not find the SnackbarProvider context. Please double-check that it is present.`);return t}function Ee({children:e,autoHideDuration:t=5e3}){let[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(t),[o,s]=(0,y.useState)(``),[c,l]=(0,y.useState)(`info`);function u(e,n,i){r(!0),a(i??t),l(n??`info`),s(e)}async function d(){r(!1),await(0,A.wait)(.2),s(``)}return(0,g.jsxs)(we.Provider,{value:{addSnackbar:u},children:[(0,g.jsx)(N.default,{open:n,autoHideDuration:i,onClose:d,children:(0,g.jsx)(j.default,{onClose:d,severity:c,children:o})}),e]})}function De({children:e,errorComponent:t,undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,loadingComponent:o=(0,g.jsx)(k.default,{}),...s}){return(0,g.jsxs)(ve,{loadingComponent:o,...s,children:[(0,g.jsx)(_e,{undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,children:t}),(0,g.jsx)(ge,{children:e})]})}const Oe=(0,C.styled)(F.default)(()=>({padding:8,"& .MuiSwitch-track":{borderRadius:11,"&::before, &::after":{content:`""`,position:`absolute`,top:`50%`,transform:`translateY(-50%)`,fontSize:16,width:28,height:28}}}));function ke({checkedIcon:e,checkedIconStyles:t,uncheckedIcon:n,uncheckedIconStyles:r,...i}){let a={borderRadius:`50%`,borderColor:`white`,backgroundColor:`white`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:.25},o={color:`black`,maxWidth:16.5,maxHeight:16.5};return(0,g.jsx)(Oe,{checkedIcon:(0,g.jsx)(c.default,{sx:a,children:(0,g.jsx)(e,{style:{...o,...t}})}),icon:(0,g.jsx)(c.default,{sx:a,children:(0,g.jsx)(n,{style:{...o,...r}})}),...i})}function Ae(){let{mode:e,toggleMode:t}=Q(),n=e===`dark`,r=`Enable ${n?`light`:`dark`} mode`;return(0,g.jsx)(P.default,{title:r,children:(0,g.jsx)(ke,{uncheckedIcon:b.MdOutlineLightMode,checkedIcon:b.MdOutlineDarkMode,checked:n,onChange:t,"aria-label":r})})}function je({children:e,navItems:t}){let[n,r]=(0,y.useState)(``);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(c.default,{sx:{paddingBottom:7},children:e}),(0,g.jsx)(R.default,{sx:{position:`fixed`,bottom:0,left:0,right:0},children:(0,g.jsx)(I.default,{showLabels:!0,value:n,onChange:(e,t)=>{r(t)},children:t.map(e=>(0,g.jsx)(L.default,{...e,component:O.Link},e.value))})})]})}function Me(e){return{width:240,transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:`hidden`}}function Ne(e){return{transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:`hidden`,width:`calc(${e.spacing(7)} + 1px)`,[e.breakpoints.up(`sm`)]:{width:`calc(${e.spacing(8)} + 1px)`}}}const Pe=(0,C.styled)(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-end`,padding:e.spacing(0,1),...e.mixins.toolbar})),Fe=(0,C.styled)(z.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({zIndex:e.zIndex.drawer+1,transition:e.transitions.create([`width`,`margin`],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),variants:[{props:({open:e})=>e,style:{marginLeft:240,width:`calc(100% - 240px)`,transition:e.transitions.create([`width`,`margin`],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})}}]})),Ie=(0,C.styled)(B.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({width:240,flexShrink:0,whiteSpace:`nowrap`,boxSizing:`border-box`,variants:[{props:({open:e})=>e,style:{...Me(e),"& .MuiDrawer-paper":Me(e)}},{props:({open:e})=>!e,style:{...Ne(e),"& .MuiDrawer-paper":Ne(e)}}]}));function Le({title:e,navItems:t,children:n,headerElements:r}){let i=(0,C.useTheme)(),[a,o]=(0,y.useState)(!0),s=(0,O.useLocation)();function l(){o(!0)}function u(){o(!1)}return(0,g.jsxs)(c.default,{sx:{display:`flex`},children:[(0,g.jsx)(M.default,{}),(0,g.jsx)(Fe,{position:`fixed`,open:a,children:(0,g.jsxs)(U.default,{children:[(0,g.jsx)(w.default,{color:`inherit`,"aria-label":`open drawer`,onClick:l,edge:`start`,sx:[{marginRight:5},a&&{display:`none`}],children:(0,g.jsx)(b.MdMenu,{})}),(0,g.jsx)(h.default,{variant:`h6`,noWrap:!0,component:`div`,children:e}),r]})}),(0,g.jsxs)(Ie,{variant:`permanent`,open:a,children:[(0,g.jsx)(Pe,{children:(0,g.jsx)(w.default,{onClick:u,children:i.direction===`rtl`?(0,g.jsx)(b.MdChevronRight,{}):(0,g.jsx)(b.MdChevronLeft,{})})}),(0,g.jsx)(p.default,{}),t.map(e=>(0,g.jsxs)(y.Fragment,{children:[(0,g.jsxs)(T.default,{children:[(0,g.jsx)(h.default,{variant:a?`h5`:`h6`,paddingLeft:a?2:1,children:a?e.category:(0,A.truncate)(e.category,4)}),e.options.map(e=>(0,g.jsx)(E.default,{disablePadding:!0,sx:{display:`block`},children:(0,g.jsxs)(V.default,{sx:[{minHeight:48,px:2.5},a?{justifyContent:`initial`}:{justifyContent:`center`}],component:O.Link,to:e.to,selected:s.pathname===e.to,children:[(0,g.jsx)(H.default,{sx:[{minWidth:0,justifyContent:`center`},a?{mr:3}:{mr:`auto`}],children:e.icon?e.icon:a?null:(0,g.jsx)(h.default,{children:(0,A.truncate)(e.label,4)})}),(0,g.jsx)(D.default,{primary:e.label,sx:[a?{opacity:1}:{opacity:0}]})]})},e.to))]}),(0,g.jsx)(p.default,{})]},e.category))]}),(0,g.jsxs)(c.default,{component:`main`,sx:{flexGrow:1,p:3},children:[(0,g.jsx)(Pe,{}),n]})]})}function Re({title:e,subtitle:t,action:n,children:r}){return(0,g.jsxs)(l.default,{children:[(0,g.jsx)(d.default,{title:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(h.default,{variant:`h6`,children:e}),t?(0,g.jsx)(h.default,{variant:`body2`,color:`text.secondary`,children:t}):null]}),action:n}),(0,g.jsx)(p.default,{}),(0,g.jsx)(u.default,{children:r})]})}function ze({code:e,previewStyles:t,...n}){let{mode:r}=Q(),i={backgroundColor:r===`dark`?`black`:`white`,border:.3,borderRadius:1,padding:2,borderColor:`darkgray`},a=t?{...i,...t}:{...i};return(0,g.jsx)(c.default,{sx:{borderRadius:1,border:.5,padding:2},children:(0,g.jsxs)(W.LiveProvider,{...n,code:(0,ee.stripIndent)(e??``),children:[(0,g.jsx)(h.default,{variant:`h5`,children:`Code`}),(0,g.jsx)(c.default,{sx:{border:.3,borderRadius:.3,borderColor:`darkgray`},children:(0,g.jsx)(W.LiveEditor,{})}),(0,g.jsx)(`br`,{}),(0,g.jsx)(h.default,{variant:`h5`,children:`Result`}),(0,g.jsxs)(c.default,{sx:a,children:[(0,g.jsx)(W.LivePreview,{}),(0,g.jsx)(W.LiveError,{})]})]})})}function Be({columns:e}){return(0,g.jsx)(q.default,{children:(0,A.fillArray)(e=>(0,g.jsx)(K.default,{children:(0,g.jsx)(G.default,{})},e),e)})}function Ve({disableClean:e,label:t,...n}){let{formState:{disabled:r,isDirty:i,isSubmitting:a}}=(0,te.useFormContext)();return(0,g.jsx)(S.default,{color:`primary`,disabled:n.disabled||e&&!i||r,loading:a,type:`submit`,variant:`contained`,...n,children:t})}const He=Ae;function Ue({children:e,button:t=S.default,buttonChildren:n=`Menu`,buttonProps:r,isOpenIcon:i=(0,g.jsx)(b.MdArrowDropUp,{}),isClosedIcon:a=(0,g.jsx)(b.MdArrowDropDown,{}),onOpen:o,onClose:s}){let[l,u]=(0,y.useState)(null),d=(0,y.useMemo)(()=>!!l,[l]),f={...r,onClick:e=>{u(e.currentTarget)},"aria-controls":d?`dropdown-menu`:void 0,"aria-haspopup":`true`,"aria-expanded":d};return t===S.default&&(f.endIcon=d?i:a),(0,y.useEffect)(()=>{d&&o?o():!d&&s&&s()},[d,o,s]),(0,g.jsxs)(c.default,{children:[(0,g.jsx)(t,{...f,children:n}),(0,g.jsx)(J.default,{id:`dropdown-menu`,anchorEl:l,open:d,onClose:()=>{u(null)},children:typeof e==`function`?(0,g.jsx)(c.default,{children:e(()=>{u(null)})}):e})]})}const We=(0,y.createContext)(void 0);function Ge({strict:e=!0}={}){let t=(0,y.useContext)(We);if(e&&!t)throw new A.DataError({strict:e,context:t},`DROPDOWN_MENU_NOT_FOUND`,`Could not find the DropdownMenu context. Please double-check that it is present.`);return t}function Ke({children:e,button:t=S.default,buttonProps:n,openIcon:r=(0,g.jsx)(b.MdArrowDropUp,{}),closedIcon:i=(0,g.jsx)(b.MdArrowDropDown,{})}){let[a,o]=(0,y.useState)(null),s=(0,y.useMemo)(()=>!!a,[a]);function c(){o(null)}return(0,g.jsxs)(We.Provider,{value:{closeMenu:c,isDropdownOpen:s},children:[(0,g.jsx)(t,{"aria-controls":s?`dropdown-menu`:void 0,"aria-haspopup":`true`,"aria-expanded":s,endIcon:s?r:i,...n,onClick:e=>{e.defaultPrevented||o(e.currentTarget),n?.onClick&&n?.onClick(e)}}),(0,g.jsx)(J.default,{anchorEl:a,open:s,onClose:c,children:e})]})}function qe({component:e,children:t,ref:n,onClick:r,...i}){let{closeMenu:a}=Ge();return(0,g.jsx)(Y.default,{component:e,ref:n,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:t})}var Je=Ke;const{fieldContext:Ye,formContext:Xe,useFieldContext:Ze,useFormContext:Qe}=(0,ne.createFormHookContexts)(),$=Ge,$e=Je,et=qe;var tt=$e;function nt({ref:e,href:t,children:n,onClick:r,...i}){let{closeMenu:a}=$();return(0,g.jsx)(Y.default,{component:se,href:t,ref:e,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function rt({to:e,ref:t,children:n,onClick:r,...i}){let{closeMenu:a}=$();return(0,g.jsx)(Y.default,{component:Z,to:e,ref:t,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function it({icon:e=b.MdVisibility,onOpen:t,onClose:n,iconProps:r,children:i}){let[a,o]=(0,y.useState)(null),s=!!a,l=(0,y.useId)();function u(e){o(e.currentTarget),t&&t()}function d(){o(null),n&&n()}return(0,g.jsxs)(c.default,{children:[(0,g.jsx)(e,{"aria-owns":s?l:void 0,"aria-haspopup":`true`,onMouseEnter:u,onMouseLeave:d,...r}),(0,g.jsx)(X.default,{id:l,disablePortal:!0,disableScrollLock:!0,slotProps:{root:{disableEnforceFocus:!0,disableAutoFocus:!0,disableRestoreFocus:!0}},sx:{pointerEvents:`none`},open:s,anchorEl:a,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},onClose:d,disableRestoreFocus:!0,children:i})]})}function at({children:e,...t}){return(0,g.jsx)(V.default,{component:Z,...t,children:e})}function ot({text:e,sx:t,...n}){return(0,g.jsx)(g.Fragment,{children:e.split(`
|
|
2
|
-
`).map((e,r)=>(0,g.jsx)(h.default,{sx:{margin:1,...t},...n,children:e},r))})}function
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`@mui/material/Box`);c=s(c);let l=require(`@mui/material/Card`);l=s(l);let u=require(`@mui/material/CardContent`);u=s(u);let d=require(`@mui/material/CardHeader`);d=s(d);let f=require(`@mui/material/Chip`);f=s(f);let p=require(`@mui/material/Divider`);p=s(p);let m=require(`@mui/material/Stack`);m=s(m);let h=require(`@mui/material/Typography`);h=s(h);let g=require(`react/jsx-runtime`),_=require(`@mui/material/ButtonBase`);_=s(_);let v=require(`@mui/material/Collapse`);v=s(v);let y=require(`react`),b=require(`react-icons/md`),x=require(`@mui/material/Link`);x=s(x);let S=require(`@mui/material/Button`);S=s(S);let C=require(`@mui/material/styles`),w=require(`@mui/material/IconButton`);w=s(w);let T=require(`@mui/material/List`);T=s(T);let E=require(`@mui/material/ListItem`);E=s(E);let D=require(`@mui/material/ListItemText`);D=s(D);let O=require(`@mui/material/CircularProgress`);O=s(O);let k=require(`@alextheman/utility`),A=require(`@mui/material/Alert`);A=s(A);let j=require(`@mui/material/CssBaseline`);j=s(j);let M=require(`@mui/material/Snackbar`);M=s(M);let N=require(`@mui/material/Tooltip`);N=s(N);let P=require(`@mui/material/Switch`);P=s(P);let F=require(`@mui/material/BottomNavigation`);F=s(F);let I=require(`@mui/material/BottomNavigationAction`);I=s(I);let L=require(`@mui/material/Paper`);L=s(L);let R=require(`react-router-dom`),ee=require(`common-tags`),z=require(`react-live`),B=require(`@mui/material/Skeleton`);B=s(B);let V=require(`@mui/material/TableCell`);V=s(V);let H=require(`@mui/material/TableRow`);H=s(H);let U=require(`@mui/material/Menu`);U=s(U);let W=require(`@mui/material/MenuItem`);W=s(W);let G=require(`@mui/material/AppBar`);G=s(G);let K=require(`@mui/material/Drawer`);K=s(K);let q=require(`@mui/material/ListItemButton`);q=s(q);let J=require(`@mui/material/ListItemIcon`);J=s(J);let Y=require(`@mui/material/Toolbar`);Y=s(Y),require(`wouter`),require(`@mui/material/AlertTitle`),require(`@mui/material/Container`),require(`wouter/memory-location`),require(`wouter/use-browser-location`);let te=require(`@tanstack/react-form`);require(`@mui/material/TextField`);let X=require(`@mui/material/Popover`);X=s(X);let ne=require(`react-hook-form`);function re({containerLabel:e,chipLabels:t}){return(0,g.jsx)(l.default,{sx:{width:320,height:420,backgroundColor:`rgba(255,255,255,0.07)`,backdropFilter:`blur(8px)`,border:`1px solid rgba(255,255,255,0.06)`,boxShadow:`0 10px 40px rgba(0,0,0,0.35)`},children:(0,g.jsxs)(u.default,{children:[(0,g.jsx)(h.default,{variant:`h6`,gutterBottom:!0,sx:{color:`#f8fafc`},children:e}),(0,g.jsx)(m.default,{spacing:1,children:t.map(e=>(0,g.jsx)(f.default,{label:e,sx:{backgroundColor:`rgba(255,255,255,0.11)`,color:`rgba(255,255,255,0.88)`,border:`1px solid rgba(255,255,255,0.06)`}},e))})]})})}function ie(){return(0,g.jsx)(c.default,{sx:{width:120,height:6,borderRadius:3,background:`linear-gradient(90deg, #f43f5e, #a78bfa, #22d3ee)`,boxShadow:`0 0 24px rgba(167,139,250,0.55)`}})}function ae(){return(0,g.jsxs)(l.default,{sx:{width:1e3,height:1e3,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,p:4,background:`radial-gradient(circle at 20% 10%, rgba(167,139,250,0.35) 0%, rgba(167,139,250,0.12) 35%, rgba(0,0,0,0) 55%), linear-gradient(135deg, #3a3380 0%, #1d2e5f 40%, #2d3f55 100%)`,color:`white`},elevation:0,children:[(0,g.jsx)(d.default,{title:`An Interface For You And I`,sx:{color:`#f8fafc`,textAlign:`center`,"& .MuiCardHeader-title":{fontSize:40,fontWeight:600,letterSpacing:2}}}),(0,g.jsx)(p.default,{sx:{borderColor:`rgba(255,255,255,0.2)`}}),(0,g.jsx)(u.default,{sx:{flex:1,display:`flex`,alignItems:`center`},children:(0,g.jsxs)(m.default,{direction:`row`,spacing:4,sx:{width:`100%`,justifyContent:`center`,alignItems:`center`},children:[(0,g.jsx)(re,{containerLabel:`You`,chipLabels:[`state`,`context`,`input`,`event`,`focus`,`value`,`history`]}),(0,g.jsx)(ie,{}),(0,g.jsx)(re,{containerLabel:`I`,chipLabels:[`render`,`effect`,`response`,`update`,`history`,`layout`,`provider`]})]})})]})}function oe({isInitiallyOpen:e,onOpen:t,onClose:n,children:r,buttonStyles:i,buttonContents:a,buttonComponent:o=_.default,collapseProps:s,openIcon:l=(0,g.jsx)(b.MdArrowDropUp,{}),closedIcon:u=(0,g.jsx)(b.MdArrowDropDown,{}),useDefaultStyling:d=o===_.default}){let[f,p]=(0,y.useState)(!!e);return(0,y.useEffect)(()=>{f&&t?t():!f&&n&&n()},[f]),(0,g.jsxs)(c.default,{children:[(0,g.jsxs)(o,{onClick:()=>{p(e=>!e)},sx:d?{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,paddingY:1.5,paddingX:2,textAlign:`center`,"&:hover":o===_.default?{backgroundColor:`action.hover`}:null,...i}:i,"aria-expanded":f,children:[a,f?l:u]}),(0,g.jsx)(v.default,{in:f,...s,children:r})]})}function se({href:e,children:t,ref:n,...r}){return(0,g.jsx)(x.default,{component:`a`,href:e,ref:n,target:`_blank`,rel:`noopener noreferrer`,...r,children:t})}const ce={PDF:`application/pdf`,PNG:`image/png`,JPEG:`image/jpeg`,JPG:`image/jpg`,XLSX:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,DOCX:`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,MP3:`audio/mp3`,MP4:`video/mp4`,WAV:`audio/wav`},le=(0,C.styled)(`input`)({clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:1,overflow:`hidden`,position:`absolute`,bottom:0,left:0,whiteSpace:`nowrap`,width:1}),ue=(0,C.styled)(`div`)(({theme:e,$dragging:t})=>({border:`2px dashed`,borderColor:t?e.palette.primary.main:`#ccc`,backgroundColor:t?e.palette.action.hover:`transparent`,borderRadius:8,padding:`1.5rem`,textAlign:`center`,transition:`border-color 0.2s`,cursor:`pointer`}));function de({onFileInput:e,label:t=`Upload files`,multiple:n,accept:r,useDropzone:i,...a}){let[o,s]=(0,y.useState)(!1),c=(0,y.useId)(),l=(0,g.jsxs)(S.default,{variant:`contained`,component:`label`,"aria-label":`File input button`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),document.getElementById(c)?.click())},...a,startIcon:a.startIcon??(0,g.jsx)(b.MdCloudUpload,{}),children:[t,(0,g.jsx)(le,{id:c,type:`file`,onChange:t=>{let n=t.target;e(Array.from(n.files??[])),n.value=``},multiple:n,accept:r?.join(`,`),disabled:a.disabled})]});return i?(0,g.jsx)(ue,{$dragging:o,onDragOver:e=>{e.preventDefault(),!a.disabled&&s(!0)},onDragLeave:e=>{e.preventDefault(),s(!1)},onDrop:t=>{t.preventDefault(),s(!1),!a.disabled&&e(Array.from(t.dataTransfer.files??[]))},children:l}):l}function fe({files:e,setFiles:t,multiple:n=!0,...r}){function i(e){t(t=>[...t,...e])}return(0,g.jsxs)(c.default,{children:[(0,g.jsx)(de,{...r,multiple:n,onFileInput:i}),(0,g.jsx)(T.default,{children:e.map(e=>(0,g.jsx)(E.default,{secondaryAction:(0,g.jsx)(w.default,{"aria-label":`Delete`,edge:`end`,onClick:()=>{t(t=>t.filter(t=>t!==e))},children:(0,g.jsx)(b.MdDelete,{})}),children:(0,g.jsx)(D.default,{primary:e.name})},`${e.name}-${e.lastModified}`))})]})}const pe=(0,y.createContext)(void 0);function me({strict:e=!0}={}){let t=(0,y.useContext)(pe);if(e&&!t)throw new k.DataError({strict:e,context:t},`LOADER_PROVIDER_NOT_FOUND`,`Could not find the LoaderProvider context. Please double-check that it is present.`);return t}function he({children:e,loadingComponent:t=(0,g.jsx)(O.default,{}),...n}){return(0,g.jsx)(pe.Provider,{value:{loadingComponent:t,...n},children:e})}function ge({children:e,dataParser:t,loadingComponent:n}){let{isLoading:r,data:i,dataParser:a,loadingComponent:o,error:s}=me(),c=t??a;return r?(0,g.jsx)(g.Fragment,{children:n??o}):s||i==null?(0,g.jsx)(g.Fragment,{}):c?typeof e==`function`?(0,g.jsx)(g.Fragment,{children:e(c(i))}):(0,g.jsx)(g.Fragment,{children:e}):typeof e==`function`?(0,g.jsx)(g.Fragment,{children:e(i)}):(0,g.jsx)(g.Fragment,{children:e})}function _e({children:e,undefinedComponent:t,nullComponent:n,nullableComponent:r,logError:i}){let{isLoading:a,data:o,error:s,errorComponent:c,logError:l}=me(),u=i??l,d=(0,y.useRef)(!1),f=e??c;return s?(u&&!d.current&&(console.error(s),d.current=!0),typeof f==`function`?f(s):f?(0,g.jsx)(g.Fragment,{children:f}):(0,g.jsx)(A.default,{severity:`error`,children:s?.message??`An unknown error has occured. Please try again later.`})):!a&&o==null?r?(u&&!d.current&&(console.error(`Data is nullable after loading.`),d.current=!0),(0,g.jsx)(g.Fragment,{children:r})):o===void 0&&(u&&!d.current&&(console.error(`Data is undefined after loading. This could either be an issue with the query or you have not passed in the data to LoaderProvider. Please double-check that you have provided data.`),d.current=!0),t)?(0,g.jsx)(g.Fragment,{children:t}):o===null&&(u&&!d.current&&(console.error(`Data is null after loading.`),d.current=!0),n)?(0,g.jsx)(g.Fragment,{children:n}):(0,g.jsx)(A.default,{severity:`error`,children:`Failed to load data. Please try again later.`}):(0,g.jsx)(g.Fragment,{})}var ve=he;const ye=(0,y.createContext)({toggleMode:()=>{},mode:`dark`});function Z({strict:e=!0}={}){let t=(0,y.useContext)(ye);if(e&&!t)throw new k.DataError({strict:e,context:t},`MODE_PROVIDER_NOT_FOUND`,`Could not find the ModeProvider context. Please double-check that it is present.`);return t}function be({children:e,mode:t=`dark`}){let[n,r]=(0,y.useState)(t),i=(0,y.useMemo)(()=>(0,C.createTheme)({palette:{mode:n}}),[n]);return(0,g.jsx)(ye.Provider,{value:{mode:n,toggleMode:()=>{r(e=>e===`light`?`dark`:`light`)}},children:(0,g.jsxs)(C.ThemeProvider,{theme:i,children:[(0,g.jsx)(j.default,{}),e]})})}const xe=(0,y.createContext)({windowWidth:0,windowHeight:0,isLargeScreen:!1});function Se({strict:e=!0}={}){let t=(0,y.useContext)(xe);if(e&&!t)throw new k.DataError({strict:e,context:t},`SCREEN_SIZE_PROVIDER_NOT_FOUND`,`Could not find the ScreenSizeProvider context. Please double-check that it is present.`);return t}function Ce({children:e,largeScreenWidth:t=669,largeScreenHeight:n=660}){let[r,i]=(0,y.useState)(window.innerWidth),[a,o]=(0,y.useState)(window.innerHeight);(0,y.useEffect)(()=>{function e(){i(window.innerWidth),o(window.innerHeight)}return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]);let s=(0,y.useMemo)(()=>r>t&&a>n,[r,a,t,n]);return(0,g.jsx)(xe.Provider,{value:{isLargeScreen:s,windowWidth:r,windowHeight:a},children:e})}const we=(0,y.createContext)(void 0);function Te({strict:e=!0}={}){let t=(0,y.useContext)(we);if(e&&!t)throw new k.DataError({strict:e,context:t},`SNACKBAR_PROVIDER_NOT_FOUND`,`Could not find the SnackbarProvider context. Please double-check that it is present.`);return t}function Ee({children:e,autoHideDuration:t=5e3}){let[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(t),[o,s]=(0,y.useState)(``),[c,l]=(0,y.useState)(`info`);function u(e,n,i){r(!0),a(i??t),l(n??`info`),s(e)}async function d(){r(!1),await(0,k.wait)(.2),s(``)}return(0,g.jsxs)(we.Provider,{value:{addSnackbar:u},children:[(0,g.jsx)(M.default,{open:n,autoHideDuration:i,onClose:d,children:(0,g.jsx)(A.default,{onClose:d,severity:c,children:o})}),e]})}function De({children:e,errorComponent:t,undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,loadingComponent:o=(0,g.jsx)(O.default,{}),...s}){return(0,g.jsxs)(ve,{loadingComponent:o,...s,children:[(0,g.jsx)(_e,{undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,children:t}),(0,g.jsx)(ge,{children:e})]})}const Oe=(0,C.styled)(P.default)(()=>({padding:8,"& .MuiSwitch-track":{borderRadius:11,"&::before, &::after":{content:`""`,position:`absolute`,top:`50%`,transform:`translateY(-50%)`,fontSize:16,width:28,height:28}}}));function ke({checkedIcon:e,checkedIconStyles:t,uncheckedIcon:n,uncheckedIconStyles:r,...i}){let a={borderRadius:`50%`,borderColor:`white`,backgroundColor:`white`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:.25},o={color:`black`,maxWidth:16.5,maxHeight:16.5};return(0,g.jsx)(Oe,{checkedIcon:(0,g.jsx)(c.default,{sx:a,children:(0,g.jsx)(e,{style:{...o,...t}})}),icon:(0,g.jsx)(c.default,{sx:a,children:(0,g.jsx)(n,{style:{...o,...r}})}),...i})}function Ae(){let{mode:e,toggleMode:t}=Z(),n=e===`dark`,r=`Enable ${n?`light`:`dark`} mode`;return(0,g.jsx)(N.default,{title:r,children:(0,g.jsx)(ke,{uncheckedIcon:b.MdOutlineLightMode,checkedIcon:b.MdOutlineDarkMode,checked:n,onChange:t,"aria-label":r})})}function je({children:e,navItems:t}){let[n,r]=(0,y.useState)(``);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(c.default,{sx:{paddingBottom:7},children:e}),(0,g.jsx)(L.default,{sx:{position:`fixed`,bottom:0,left:0,right:0},children:(0,g.jsx)(F.default,{showLabels:!0,value:n,onChange:(e,t)=>{r(t)},children:t.map(e=>(0,g.jsx)(I.default,{...e,component:R.Link},e.value))})})]})}function Me({title:e,subtitle:t,action:n,children:r}){return(0,g.jsxs)(l.default,{children:[(0,g.jsx)(d.default,{title:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(h.default,{variant:`h6`,children:e}),t?(0,g.jsx)(h.default,{variant:`body2`,color:`text.secondary`,children:t}):null]}),action:n}),(0,g.jsx)(p.default,{}),(0,g.jsx)(u.default,{children:r})]})}function Ne({code:e,previewStyles:t,...n}){let{mode:r}=Z(),i={backgroundColor:r===`dark`?`black`:`white`,border:.3,borderRadius:1,padding:2,borderColor:`darkgray`},a=t?{...i,...t}:{...i};return(0,g.jsx)(c.default,{sx:{borderRadius:1,border:.5,padding:2},children:(0,g.jsxs)(z.LiveProvider,{...n,code:(0,ee.stripIndent)(e??``),children:[(0,g.jsx)(h.default,{variant:`h5`,children:`Code`}),(0,g.jsx)(c.default,{sx:{border:.3,borderRadius:.3,borderColor:`darkgray`},children:(0,g.jsx)(z.LiveEditor,{})}),(0,g.jsx)(`br`,{}),(0,g.jsx)(h.default,{variant:`h5`,children:`Result`}),(0,g.jsxs)(c.default,{sx:a,children:[(0,g.jsx)(z.LivePreview,{}),(0,g.jsx)(z.LiveError,{})]})]})})}function Pe({columns:e}){return(0,g.jsx)(H.default,{children:(0,k.fillArray)(e=>(0,g.jsx)(V.default,{children:(0,g.jsx)(B.default,{})},e),e)})}const Fe=Ae;function Ie({children:e,button:t=S.default,buttonChildren:n=`Menu`,buttonProps:r,isOpenIcon:i=(0,g.jsx)(b.MdArrowDropUp,{}),isClosedIcon:a=(0,g.jsx)(b.MdArrowDropDown,{}),onOpen:o,onClose:s}){let[l,u]=(0,y.useState)(null),d=(0,y.useMemo)(()=>!!l,[l]),f={...r,onClick:e=>{u(e.currentTarget)},"aria-controls":d?`dropdown-menu`:void 0,"aria-haspopup":`true`,"aria-expanded":d};return t===S.default&&(f.endIcon=d?i:a),(0,y.useEffect)(()=>{d&&o?o():!d&&s&&s()},[d,o,s]),(0,g.jsxs)(c.default,{children:[(0,g.jsx)(t,{...f,children:n}),(0,g.jsx)(U.default,{id:`dropdown-menu`,anchorEl:l,open:d,onClose:()=>{u(null)},children:typeof e==`function`?(0,g.jsx)(c.default,{children:e(()=>{u(null)})}):e})]})}const Le=(0,y.createContext)(void 0);function Re({strict:e=!0}={}){let t=(0,y.useContext)(Le);if(e&&!t)throw new k.DataError({strict:e,context:t},`DROPDOWN_MENU_NOT_FOUND`,`Could not find the DropdownMenu context. Please double-check that it is present.`);return t}function ze({children:e,button:t=S.default,buttonProps:n,openIcon:r=(0,g.jsx)(b.MdArrowDropUp,{}),closedIcon:i=(0,g.jsx)(b.MdArrowDropDown,{})}){let[a,o]=(0,y.useState)(null),s=(0,y.useMemo)(()=>!!a,[a]);function c(){o(null)}return(0,g.jsxs)(Le.Provider,{value:{closeMenu:c,isDropdownOpen:s},children:[(0,g.jsx)(t,{"aria-controls":s?`dropdown-menu`:void 0,"aria-haspopup":`true`,"aria-expanded":s,endIcon:s?r:i,...n,onClick:e=>{e.defaultPrevented||o(e.currentTarget),n?.onClick&&n?.onClick(e)}}),(0,g.jsx)(U.default,{anchorEl:a,open:s,onClose:c,children:e})]})}function Be({component:e,children:t,ref:n,onClick:r,...i}){let{closeMenu:a}=Re();return(0,g.jsx)(W.default,{component:e,ref:n,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:t})}var Ve=ze;function He(e){return{width:240,transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:`hidden`}}function Ue(e){return{transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:`hidden`,width:`calc(${e.spacing(7)} + 1px)`,[e.breakpoints.up(`sm`)]:{width:`calc(${e.spacing(8)} + 1px)`}}}(0,C.styled)(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-end`,padding:e.spacing(0,1),...e.mixins.toolbar})),(0,C.styled)(G.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({zIndex:e.zIndex.drawer+1,transition:e.transitions.create([`width`,`margin`],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),variants:[{props:({open:e})=>e,style:{marginLeft:240,width:`calc(100% - 240px)`,transition:e.transitions.create([`width`,`margin`],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})}}]})),(0,C.styled)(K.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({width:240,flexShrink:0,whiteSpace:`nowrap`,boxSizing:`border-box`,variants:[{props:({open:e})=>e,style:{...He(e),"& .MuiDrawer-paper":He(e)}},{props:({open:e})=>!e,style:{...Ue(e),"& .MuiDrawer-paper":Ue(e)}}]}));const{fieldContext:We,formContext:Ge,useFieldContext:Ke,useFormContext:qe}=(0,te.createFormHookContexts)(),Q=Re,Je=Ve,Ye=Be;var Xe=Je;function Ze({ref:e,href:t,children:n,onClick:r,...i}){let{closeMenu:a}=Q();return(0,g.jsx)(W.default,{component:se,href:t,ref:e,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function $({to:e,component:t=R.Link,children:n,ref:r,...i}){return(0,g.jsx)(x.default,{component:t,to:e,ref:r,...i,children:n})}function Qe({to:e,ref:t,children:n,onClick:r,...i}){let{closeMenu:a}=Q();return(0,g.jsx)(W.default,{component:$,to:e,ref:t,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function $e({icon:e=b.MdVisibility,onOpen:t,onClose:n,iconProps:r,children:i}){let[a,o]=(0,y.useState)(null),s=!!a,l=(0,y.useId)();function u(e){o(e.currentTarget),t&&t()}function d(){o(null),n&&n()}return(0,g.jsxs)(c.default,{children:[(0,g.jsx)(e,{"aria-owns":s?l:void 0,"aria-haspopup":`true`,onMouseEnter:u,onMouseLeave:d,...r}),(0,g.jsx)(X.default,{id:l,disablePortal:!0,disableScrollLock:!0,slotProps:{root:{disableEnforceFocus:!0,disableAutoFocus:!0,disableRestoreFocus:!0}},sx:{pointerEvents:`none`},open:s,anchorEl:a,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},onClose:d,disableRestoreFocus:!0,children:i})]})}function et({children:e,...t}){return(0,g.jsx)(q.default,{component:$,...t,children:e})}function tt(e){return{width:240,transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:`hidden`}}function nt(e){return{transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:`hidden`,width:`calc(${e.spacing(7)} + 1px)`,[e.breakpoints.up(`sm`)]:{width:`calc(${e.spacing(8)} + 1px)`}}}const rt=(0,C.styled)(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-end`,padding:e.spacing(0,1),...e.mixins.toolbar})),it=(0,C.styled)(G.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({zIndex:e.zIndex.drawer+1,transition:e.transitions.create([`width`,`margin`],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),variants:[{props:({open:e})=>e,style:{marginLeft:240,width:`calc(100% - 240px)`,transition:e.transitions.create([`width`,`margin`],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})}}]})),at=(0,C.styled)(K.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({width:240,flexShrink:0,whiteSpace:`nowrap`,boxSizing:`border-box`,variants:[{props:({open:e})=>e,style:{...tt(e),"& .MuiDrawer-paper":tt(e)}},{props:({open:e})=>!e,style:{...nt(e),"& .MuiDrawer-paper":nt(e)}}]}));function ot({title:e,navItems:t,children:n,headerElements:r}){let i=(0,C.useTheme)(),[a,o]=(0,y.useState)(!0),s=(0,R.useLocation)();function l(){o(!0)}function u(){o(!1)}return(0,g.jsxs)(c.default,{sx:{display:`flex`},children:[(0,g.jsx)(j.default,{}),(0,g.jsx)(it,{position:`fixed`,open:a,children:(0,g.jsxs)(Y.default,{children:[(0,g.jsx)(w.default,{color:`inherit`,"aria-label":`open drawer`,onClick:l,edge:`start`,sx:[{marginRight:5},a&&{display:`none`}],children:(0,g.jsx)(b.MdMenu,{})}),(0,g.jsx)(h.default,{variant:`h6`,noWrap:!0,component:`div`,children:e}),r]})}),(0,g.jsxs)(at,{variant:`permanent`,open:a,children:[(0,g.jsx)(rt,{children:(0,g.jsx)(w.default,{onClick:u,children:i.direction===`rtl`?(0,g.jsx)(b.MdChevronRight,{}):(0,g.jsx)(b.MdChevronLeft,{})})}),(0,g.jsx)(p.default,{}),t.map(e=>(0,g.jsxs)(y.Fragment,{children:[(0,g.jsxs)(T.default,{children:[(0,g.jsx)(h.default,{variant:a?`h5`:`h6`,paddingLeft:a?2:1,children:a?e.category:(0,k.truncate)(e.category,4)}),e.options.map(e=>(0,g.jsx)(E.default,{disablePadding:!0,sx:{display:`block`},children:(0,g.jsxs)(q.default,{sx:[{minHeight:48,px:2.5},a?{justifyContent:`initial`}:{justifyContent:`center`}],component:R.Link,to:e.to,selected:s.pathname===e.to,children:[(0,g.jsx)(J.default,{sx:[{minWidth:0,justifyContent:`center`},a?{mr:3}:{mr:`auto`}],children:e.icon?e.icon:a?null:(0,g.jsx)(h.default,{children:(0,k.truncate)(e.label,4)})}),(0,g.jsx)(D.default,{primary:e.label,sx:[a?{opacity:1}:{opacity:0}]})]})},e.to))]}),(0,g.jsx)(p.default,{})]},e.category))]}),(0,g.jsxs)(c.default,{component:`main`,sx:{flexGrow:1,p:3},children:[(0,g.jsx)(rt,{}),n]})]})}function st({text:e,sx:t,...n}){return(0,g.jsx)(g.Fragment,{children:e.split(`
|
|
2
|
+
`).map((e,r)=>(0,g.jsx)(h.default,{sx:{margin:1,...t},...n,children:e},r))})}function ct({disableClean:e,label:t,...n}){let{formState:{disabled:r,isDirty:i,isSubmitting:a}}=(0,ne.useFormContext)();return(0,g.jsx)(S.default,{color:`primary`,disabled:n.disabled||e&&!i||r,loading:a,type:`submit`,variant:`contained`,...n,children:t})}function lt(e){let[t,n]=(0,y.useState)(()=>{let t=window.location.hash.replace(`#`,``);return e&&t===``?e:t}),r=(0,y.useCallback)(()=>{let t=window.location.hash.replace(`#`,``);n(e&&t===``?e:t)},[n,e]);return(0,y.useEffect)(()=>(window.addEventListener(`hashchange`,r),()=>{window.removeEventListener(`hashchange`,r)}),[r]),[t,(0,y.useCallback)(e=>{let n=typeof e==`function`?e(t):e;n!==t&&(window.location.hash=n)},[t])]}exports.Artwork=ae,exports.CollapsableItem=oe,exports.DarkModeToggle=Fe,exports.DropdownMenu=Ie,exports.DropdownMenu2=Xe,exports.DropdownMenuExternalLink=Ze,exports.DropdownMenuInternalLink=Qe,exports.DropdownMenuItem=Ye,exports.ExternalLink=se,exports.FileInput=de,exports.FileInputList=fe,exports.FileType=ce,exports.IconWithPopover=$e,exports.InternalLink=$,exports.ListItemInternalLink=et,exports.Loader=De,exports.LoaderData=ge,exports.LoaderError=_e,exports.LoaderProvider=ve,exports.ModeProvider=be,exports.ModeToggle=Ae,exports.NavigationBottom=je,exports.NavigationDrawer=ot,exports.Page=Me,exports.PopoverText=st,exports.ReactPlayground=Ne,exports.ScreenSizeProvider=Ce,exports.SkeletonRow=Pe,exports.SnackbarProvider=Ee,exports.SubmitButton=ct,exports.SwitchWithIcons=ke,exports.useDropdownMenu=Q,exports.useHash=lt,exports.useMode=Z,exports.useScreenSize=Se,exports.useSnackbar=Te;
|
|
3
3
|
//# sourceMappingURL=index.cjs.map
|