mui-collage-fab 0.0.0-stage → 0.1.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 +156 -2
- package/dist-lib/index.cjs +1 -0
- package/dist-lib/index.js +275 -0
- package/dist-lib/types/components/CollageFab.d.ts +137 -0
- package/dist-lib/types/components/CollageFab.d.ts.map +1 -0
- package/dist-lib/types/index.d.ts +2 -0
- package/dist-lib/types/index.d.ts.map +1 -0
- package/package.json +76 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Radomir Wojtera
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,157 @@
|
|
|
1
|
-
#
|
|
1
|
+
# MUI CollageFab
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A Material UI floating action button that behaves like a collapsed stack of overlapping circles. Collapsed, a set of `Fab`s sits perfectly stacked and reads as a single button with soft gradient slices at the edges. On hover (mouse) or tap (touch), the parent expands its main-axis extent and the buttons fan out into a row while their CSS masks slide in lockstep with the movement — so the unfold reads as one continuous morph instead of a pop.
|
|
4
|
+
|
|
5
|
+
The trick is that each child is a full circle clipped by a static linear-gradient mask. As the element translates along the main axis, the `mask-position` is translated back by the same amount, keeping the fade boundary fixed in container space. Because the fade is a gradient rather than a hard clip, the parent's `filter: drop-shadow(...)` traces the soft edges cleanly.
|
|
6
|
+
|
|
7
|
+
Not affiliated with or endorsed by MUI.
|
|
8
|
+
|
|
9
|
+
## Requirements
|
|
10
|
+
|
|
11
|
+
- Node.js 18 or newer.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install mui-collage-fab @mui/material @emotion/react @emotion/styled
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
`react`, `react-dom`, `@mui/material` and the two emotion packages are peer
|
|
20
|
+
dependencies, so the package never ships its own copy of React or MUI.
|
|
21
|
+
|
|
22
|
+
## Getting started
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install
|
|
26
|
+
npm run dev
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Routes
|
|
30
|
+
|
|
31
|
+
Routing is hash-based, so the built site works on any static host without a
|
|
32
|
+
server-side fallback.
|
|
33
|
+
|
|
34
|
+
| URL | Page |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| `/` | Demo — the component across button counts and directions. |
|
|
37
|
+
| `#/docs` | Components API reference for `CollageFab`. |
|
|
38
|
+
| anything else | Redirects to `#/`. |
|
|
39
|
+
|
|
40
|
+
## Deployment
|
|
41
|
+
|
|
42
|
+
The demo and docs are published to GitHub Pages:
|
|
43
|
+
|
|
44
|
+
1. Demo — <https://www.radomir.dev/mui-collage-fab/>
|
|
45
|
+
2. Components API — <https://www.radomir.dev/mui-collage-fab/#/docs>
|
|
46
|
+
3. Playground — <https://www.radomir.dev/mui-collage-fab/#/playground>
|
|
47
|
+
|
|
48
|
+
`.github/workflows/deploy.yml` builds the project and publishes `dist/` on every
|
|
49
|
+
push to `main`. The production build uses a `/mui-collage-fab/` asset base while the
|
|
50
|
+
dev server stays at the root, so the local URL is unchanged — see
|
|
51
|
+
`vite.config.ts`.
|
|
52
|
+
|
|
53
|
+
## Scripts
|
|
54
|
+
|
|
55
|
+
| Command | Description |
|
|
56
|
+
| --- | --- |
|
|
57
|
+
| `npm run dev` | Start the Vite dev server with HMR. |
|
|
58
|
+
| `npm run build` | Type-check with `tsc --noEmit`, then build the demo to `dist/`. |
|
|
59
|
+
| `npm run build:lib` | Build the publishable package to `dist-lib/` (ESM + CJS + types). |
|
|
60
|
+
| `npm run preview` | Serve the production build locally. |
|
|
61
|
+
|
|
62
|
+
## Usage
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
import { Fab } from '@mui/material';
|
|
66
|
+
import { Settings, BugReport, Speed } from '@mui/icons-material';
|
|
67
|
+
import { CollageFab } from 'mui-collage-fab';
|
|
68
|
+
|
|
69
|
+
<CollageFab
|
|
70
|
+
direction="left"
|
|
71
|
+
trigger="hover"
|
|
72
|
+
gap={14}
|
|
73
|
+
fadeWidth={12}
|
|
74
|
+
aria-label="Tools"
|
|
75
|
+
slotProps={{
|
|
76
|
+
item: (ownerState) =>
|
|
77
|
+
ownerState.isAnchor ? { sx: { outline: '2px solid white' } } : {},
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
{/* Index 0 is the anchor: it never moves and is never clipped. */}
|
|
81
|
+
<Fab color="primary"><Settings /></Fab>
|
|
82
|
+
<Fab color="secondary"><BugReport /></Fab>
|
|
83
|
+
<Fab color="success"><Speed /></Fab>
|
|
84
|
+
</CollageFab>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Controlled usage, when the open state has to live in your own state:
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
const [open, setOpen] = useState(false);
|
|
91
|
+
|
|
92
|
+
<CollageFab
|
|
93
|
+
trigger="manual"
|
|
94
|
+
open={open}
|
|
95
|
+
onOpen={() => setOpen(true)}
|
|
96
|
+
onClose={() => setOpen(false)}
|
|
97
|
+
>
|
|
98
|
+
{/* children */}
|
|
99
|
+
</CollageFab>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Props
|
|
103
|
+
|
|
104
|
+
| Prop | Type | Default | Description |
|
|
105
|
+
| --- | --- | --- | --- |
|
|
106
|
+
| `children` | `React.ReactNode` | — | The buttons to stack. Order matters: index 0 is the anchor. |
|
|
107
|
+
| `direction` | `'left' \| 'right' \| 'up' \| 'down'` | `'left'` | Which way the row fans out from the anchor. `'left'` pins the stack to the right edge and expands leftward. |
|
|
108
|
+
| `size` | `'small' \| 'medium' \| 'large' \| number` | `'large'` | Diameter of each button. `small` 40, `medium` 48, `large` 56; numbers are used verbatim. |
|
|
109
|
+
| `variant` | `'circular' \| 'rounded' \| 'square'` | `'circular'` | Shape of each button. `rounded` uses a 25% corner radius, which scales with `size`. For an arbitrary radius, use `slotProps.item.sx`. |
|
|
110
|
+
| `gap` | `number` | `16` | Main-axis gap in pixels between buttons when expanded. |
|
|
111
|
+
| `fadeWidth` | `number` | `12` | Width in pixels of the soft gradient ramp at each slice edge. `0` gives a hard cut. |
|
|
112
|
+
| `trigger` | `'hover' \| 'click' \| 'manual'` | `'hover'` | `'hover'` opens on mouse enter, closes on leave, toggles on touch/pen tap. `'click'` toggles on any click. `'manual'` disables built-in pointer interaction. |
|
|
113
|
+
| `open` | `boolean` | — | Controlled open state. Passing it makes the component controlled. |
|
|
114
|
+
| `defaultOpen` | `boolean` | `false` | Initial state when uncontrolled. |
|
|
115
|
+
| `onOpen` | `(event) => void` | — | Fired on the closed → open transition. |
|
|
116
|
+
| `onClose` | `(event) => void` | — | Fired on the open → closed transition. |
|
|
117
|
+
| `disableClickAway` | `boolean` | `false` | If `true`, an outside press does not close the group. |
|
|
118
|
+
| `transitionDuration` | `number` | `400` | Duration of the morph in milliseconds. |
|
|
119
|
+
| `transitionEasing` | `string` | `'cubic-bezier(0.4, 0, 0.2, 1)'` | Easing of the morph. |
|
|
120
|
+
| `sx` | `SxProps<Theme>` | — | System overrides for the root. |
|
|
121
|
+
| `classes` | `Partial<CollageFabClasses>` | — | Override the `root` / `item` / `expanded` / `collapsed` classes. |
|
|
122
|
+
| `slots` | `Partial<CollageFabSlots>` | — | Replace the `root` or `item` slot component. |
|
|
123
|
+
| `slotProps` | `CollageFabSlotProps` | — | Props for each slot, or a callback `(ownerState) => props`. |
|
|
124
|
+
|
|
125
|
+
Remaining `div` attributes, including `aria-label` and `aria-labelledby`, are spread onto the root.
|
|
126
|
+
|
|
127
|
+
## Slots
|
|
128
|
+
|
|
129
|
+
1. `root` — the animated container. Owns the anchor-edge alignment, the animated main-axis extent, and the single `drop-shadow` filter. A replacement must forward `ref`, because the `ClickAwayListener` needs it.
|
|
130
|
+
2. `item` — one masked circular wrapper per child. `slotProps.item` accepts a props object or a callback `(ownerState) => props`, which is the per-child escape hatch: switch on `ownerState.index` or `ownerState.isAnchor` to style an individual button.
|
|
131
|
+
|
|
132
|
+
## ownerState
|
|
133
|
+
|
|
134
|
+
`CollageFabOwnerState` carries `open`, `direction`, `trigger`, `size` (resolved pixels), `gap`, `fadeWidth`, `count`, `transitionDuration` and `transitionEasing`. `CollageFabItemOwnerState` adds `index` and `isAnchor`.
|
|
135
|
+
|
|
136
|
+
Theme-level defaults and overrides work through the `MuiCollageFab` component key:
|
|
137
|
+
|
|
138
|
+
```tsx
|
|
139
|
+
const theme = createTheme({
|
|
140
|
+
components: {
|
|
141
|
+
MuiCollageFab: {
|
|
142
|
+
defaultProps: { gap: 10 },
|
|
143
|
+
styleOverrides: { item: { borderRadius: '8px' } },
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Notes
|
|
150
|
+
|
|
151
|
+
1. **The parent must pin the anchor edge.** The root animates its own main-axis extent, so it only fans out if its parent keeps the anchor edge fixed: `justify-content: flex-end` for `direction="left"`, `flex-start` for `"right"`, `align-items: flex-end` for `"up"`, `flex-start` for `"down"`. Otherwise the root grows in place and pushes surrounding content instead of fanning out.
|
|
152
|
+
2. **Each child is forced to `box-shadow: none` and 100% size**, so the parent owns the global shadow shape. Pass visual styles via each child's `sx`; the component overrides sizing and shadow only. Overriding that reset requires `slotProps.item.sx['& > *']` with `!important`.
|
|
153
|
+
3. **The single `drop-shadow` lives on the root**, because a filter traces the soft mask edges while a `box-shadow` would trace the wrapper rectangles. Setting `overflow: hidden` on the root via `sx` clips the fan-out.
|
|
154
|
+
4. **Shapes.** `variant` covers the three common cases; children inherit the wrapper's corner radius, so the shape applies to the whole group rather than to each button's own `Fab` default. Any other radius is reachable with `slotProps.item.sx`.
|
|
155
|
+
5. **Collapsed slices are hidden from assistive technology.** While collapsed, the item wrappers are `aria-hidden` and made non-focusable, so they leave the tab order and the accessibility tree. The root stays focusable: Enter or Space opens the group, focus moves to the first item, and Escape closes it and returns focus to the root.
|
|
156
|
+
6. **With a single child no mask is applied** — it behaves like a plain `Fab`.
|
|
157
|
+
7. **`direction` is physical, not logical.** It is not mirrored under RTL; right-to-left layouts should set `direction="left"` explicitly.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("react/jsx-runtime"),te=require("react"),oe=require("@mui/material"),z=require("@mui/material/styles"),F=require("@mui/material/utils"),W=require("@mui/utils/useSlotProps"),ne=require("@mui/utils/composeClasses"),re=require("@mui/utils/generateUtilityClass");function se(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return o.default=t,Object.freeze(o)}const u=se(te),ae={small:40,medium:48,large:56},ie={circular:"50%",rounded:"25%",square:0},le=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function ce(t){return typeof t=="number"?t:ae[t]}function M(t,o){return`${t}ms ${o}`}const ue=3.2;function pe(t,o){const{count:n,size:r,gap:i,fadeWidth:l,open:f,direction:c}=o,p=r+i,s=(n-1)*p+r+l,a=t*p,d=c==="left"||c==="up",b=c==="left"||c==="right",k=t===0?s:(n-t)*(r/n),y=t===0?-l/2:t*(r/n),R=f?a:0,h=d?k-s-l/2+R:y-s-l/2-R,E=d?`#000 0px, #000 ${s}px, transparent ${s+l}px, transparent ${2*s}px`:`transparent 0px, transparent ${s}px, #000 ${s+l}px, #000 ${2*s}px`,S=`${d?"-":""}${R}`;return{translate:b?`translateX(${S}px)`:`translateY(${S}px)`,maskImage:n>1?`linear-gradient(${b?"to right":"to bottom"}, ${E})`:"none",maskSize:b?`${2*s}px 100%`:`100% ${2*s}px`,maskPosition:b?`${h}px 0px`:`0px ${h}px`}}function fe(t){return re("MuiCollageFab",t)}const me=(t,o)=>ne({root:["root",t?"expanded":"collapsed"],item:["item"]},fe,o),de=z.styled("div",{name:"MuiCollageFab",slot:"root",overridesResolver:(t,o)=>o.root})(({ownerState:t})=>{const{open:o,direction:n,size:r,gap:i,count:l,transitionDuration:f,transitionEasing:c}=t,p=n==="left"||n==="right",s=n==="left"||n==="up",a=o?l*r+Math.max(l-1,0)*i:r;return{position:"relative",width:p?a:r,height:p?r:a,display:"flex",flexDirection:p?"row":"column",justifyContent:s?"flex-end":"flex-start",transition:`${p?"width":"height"} ${M(f,c)}`,filter:"drop-shadow(0px 6px 12px rgba(0,0,0,0.25))",cursor:o?"default":"pointer",WebkitTapHighlightColor:"transparent"}}),ge=z.styled("div",{name:"MuiCollageFab",slot:"item",overridesResolver:(t,o)=>o.item})(({ownerState:t})=>{const{direction:o,size:n,index:r,geometry:i,cornerRadius:l,transitionDuration:f,transitionEasing:c}=t,p=o==="left"||o==="right",s=o==="left"?{right:0}:o==="right"?{left:0}:o==="up"?{bottom:0}:{top:0},a=M(f,c),d=M(f*ue,c);return{position:"absolute",...s,...p?{top:0}:{left:0},width:n,height:n,borderRadius:l,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",zIndex:r,transform:i.translate,WebkitMaskImage:i.maskImage,maskImage:i.maskImage,WebkitMaskSize:i.maskSize,maskSize:i.maskSize,WebkitMaskPosition:i.maskPosition,maskPosition:i.maskPosition,WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",transition:`transform ${a}, -webkit-mask-position ${d}, mask-position ${d}`,"& > *":{boxShadow:"none !important",borderRadius:"inherit !important",width:"100%",height:"100%",margin:0}}});function he(t){const{index:o,ownerState:n,geometry:r,className:i,component:l,inert:f,itemRefs:c,slotProps:p,children:s}=t,a=u.useMemo(()=>({...n,index:o,isAnchor:o===0,geometry:r}),[n,o,r]),d=u.useRef(null),b=u.useCallback(h=>{c.current[o]=h},[c,o]),k=F.useForkRef(b,d);u.useEffect(()=>{const h=d.current;!h||!("inert"in HTMLElement.prototype)||(h.inert=f)},[f]);const y=W({elementType:l,externalSlotProps:p,ownerState:a,additionalProps:{ref:k,className:i,"aria-hidden":f||void 0,children:s}}),R=l;return $.jsx(R,{...y})}const be=u.forwardRef(function(o,n){const r=z.useThemeProps({props:o,name:"MuiCollageFab"}),{children:i,direction:l="left",size:f="large",variant:c="circular",gap:p=16,fadeWidth:s=12,trigger:a="hover",open:d,defaultOpen:b=!1,onOpen:k,onClose:y,disableClickAway:R=!1,transitionDuration:h=400,transitionEasing:E="cubic-bezier(0.4, 0, 0.2, 1)",classes:S,slots:x,slotProps:P,className:U,...K}=r,[m,D]=F.useControlled({controlled:d,default:b,name:"CollageFab",state:"open"}),j=u.useMemo(()=>u.Children.toArray(i).filter(e=>u.isValidElement(e)),[i]),A=j.length,I={open:m,direction:l,trigger:a,size:ce(f),variant:c,cornerRadius:ie[c],gap:p,fadeWidth:s,count:A,transitionDuration:h,transitionEasing:E},O=me(m,S),_=u.useRef(null),q=u.useRef([]),w=u.useRef(!1),L=u.useRef("mouse"),T=u.useRef(!1),B=F.useForkRef(_,n),C=u.useCallback((e,g)=>{e!==m&&(D(e),e?k==null||k(g):y==null||y(g))},[m,D,k,y]),G=e=>{a!=="hover"||e.pointerType!=="mouse"||C(!0,e)},H=e=>{a!=="hover"||e.pointerType!=="mouse"||C(!1,e)},V=e=>{a!=="manual"&&(L.current=e.pointerType,w.current=!1,!(e.pointerType==="mouse"||m)&&(w.current=!0,C(!0,e)))},X=e=>{w.current&&(w.current=!1,e.stopPropagation(),e.preventDefault())},Y=e=>{if(a!=="manual"){if(a==="click"){C(!m,e);return}m&&L.current!=="mouse"&&C(!1,e)}},Z=e=>{var g;if(a!=="manual"){if(m){if(e.key!=="Escape")return;e.stopPropagation(),C(!1,e),(g=_.current)==null||g.focus();return}e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),T.current=!0,C(!0,e))}},J=e=>{C(!1,e)},N=(x==null?void 0:x.root)??de,Q=(x==null?void 0:x.item)??ge,ee=W({elementType:N,externalForwardedProps:K,externalSlotProps:P==null?void 0:P.root,ownerState:I,additionalProps:{ref:B,role:"group",tabIndex:!m&&a!=="manual"?0:-1,onPointerEnter:G,onPointerLeave:H,onPointerDown:V,onClick:Y,onClickCapture:X,onKeyDown:Z},className:[O.root,U]});if(u.useEffect(()=>{if(!m||!T.current)return;T.current=!1;const e=q.current[0];if(!e)return;(e.querySelector(le)??e).focus()},[m]),A===0)return null;const v=$.jsx(N,{...ee,children:j.map((e,g)=>$.jsx(he,{index:g,ownerState:I,geometry:pe(g,I),className:O.item,component:Q,inert:!m&&a!=="manual",itemRefs:q,slotProps:P==null?void 0:P.item,children:e},g))});return R||a==="manual"?v:$.jsx(oe.ClickAwayListener,{onClickAway:J,children:v})});exports.CollageFab=be;
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { jsx as $ } from "react/jsx-runtime";
|
|
2
|
+
import * as u from "react";
|
|
3
|
+
import { ClickAwayListener as et } from "@mui/material";
|
|
4
|
+
import { styled as U, useThemeProps as ot } from "@mui/material/styles";
|
|
5
|
+
import { useControlled as nt, useForkRef as v } from "@mui/material/utils";
|
|
6
|
+
import j from "@mui/utils/useSlotProps";
|
|
7
|
+
import rt from "@mui/utils/composeClasses";
|
|
8
|
+
import st from "@mui/utils/generateUtilityClass";
|
|
9
|
+
const at = {
|
|
10
|
+
small: 40,
|
|
11
|
+
medium: 48,
|
|
12
|
+
large: 56
|
|
13
|
+
}, it = {
|
|
14
|
+
circular: "50%",
|
|
15
|
+
rounded: "25%",
|
|
16
|
+
square: 0
|
|
17
|
+
}, lt = [
|
|
18
|
+
"a[href]",
|
|
19
|
+
"button:not([disabled])",
|
|
20
|
+
"input:not([disabled])",
|
|
21
|
+
"select:not([disabled])",
|
|
22
|
+
"textarea:not([disabled])",
|
|
23
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
24
|
+
].join(",");
|
|
25
|
+
function ct(o) {
|
|
26
|
+
return typeof o == "number" ? o : at[o];
|
|
27
|
+
}
|
|
28
|
+
function F(o, e) {
|
|
29
|
+
return `${o}ms ${e}`;
|
|
30
|
+
}
|
|
31
|
+
const ut = 3.2;
|
|
32
|
+
function pt(o, e) {
|
|
33
|
+
const { count: n, size: a, gap: i, fadeWidth: l, open: m, direction: c } = e, p = a + i, r = (n - 1) * p + a + l, s = o * p, d = c === "left" || c === "up", k = c === "left" || c === "right", C = o === 0 ? r : (n - o) * (a / n), b = o === 0 ? -l / 2 : o * (a / n), R = m ? s : 0, h = d ? C - r - l / 2 + R : b - r - l / 2 - R, E = d ? `#000 0px, #000 ${r}px, transparent ${r + l}px, transparent ${2 * r}px` : `transparent 0px, transparent ${r}px, #000 ${r + l}px, #000 ${2 * r}px`, w = `${d ? "-" : ""}${R}`;
|
|
34
|
+
return {
|
|
35
|
+
translate: k ? `translateX(${w}px)` : `translateY(${w}px)`,
|
|
36
|
+
maskImage: n > 1 ? `linear-gradient(${k ? "to right" : "to bottom"}, ${E})` : "none",
|
|
37
|
+
maskSize: k ? `${2 * r}px 100%` : `100% ${2 * r}px`,
|
|
38
|
+
maskPosition: k ? `${h}px 0px` : `0px ${h}px`
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function mt(o) {
|
|
42
|
+
return st("MuiCollageFab", o);
|
|
43
|
+
}
|
|
44
|
+
const ft = (o, e) => rt({
|
|
45
|
+
root: ["root", o ? "expanded" : "collapsed"],
|
|
46
|
+
item: ["item"]
|
|
47
|
+
}, mt, e), dt = U("div", {
|
|
48
|
+
name: "MuiCollageFab",
|
|
49
|
+
slot: "root",
|
|
50
|
+
overridesResolver: (o, e) => e.root
|
|
51
|
+
})(({ ownerState: o }) => {
|
|
52
|
+
const { open: e, direction: n, size: a, gap: i, count: l, transitionDuration: m, transitionEasing: c } = o, p = n === "left" || n === "right", r = n === "left" || n === "up", s = e ? l * a + Math.max(l - 1, 0) * i : a;
|
|
53
|
+
return {
|
|
54
|
+
position: "relative",
|
|
55
|
+
width: p ? s : a,
|
|
56
|
+
height: p ? a : s,
|
|
57
|
+
display: "flex",
|
|
58
|
+
flexDirection: p ? "row" : "column",
|
|
59
|
+
justifyContent: r ? "flex-end" : "flex-start",
|
|
60
|
+
transition: `${p ? "width" : "height"} ${F(
|
|
61
|
+
m,
|
|
62
|
+
c
|
|
63
|
+
)}`,
|
|
64
|
+
// A filter traces the soft mask edges; a box-shadow would trace the wrapper rectangles.
|
|
65
|
+
filter: "drop-shadow(0px 6px 12px rgba(0,0,0,0.25))",
|
|
66
|
+
cursor: e ? "default" : "pointer",
|
|
67
|
+
WebkitTapHighlightColor: "transparent"
|
|
68
|
+
};
|
|
69
|
+
}), gt = U("div", {
|
|
70
|
+
name: "MuiCollageFab",
|
|
71
|
+
slot: "item",
|
|
72
|
+
overridesResolver: (o, e) => e.item
|
|
73
|
+
})(({ ownerState: o }) => {
|
|
74
|
+
const { direction: e, size: n, index: a, geometry: i, cornerRadius: l, transitionDuration: m, transitionEasing: c } = o, p = e === "left" || e === "right", r = e === "left" ? { right: 0 } : e === "right" ? { left: 0 } : e === "up" ? { bottom: 0 } : { top: 0 }, s = F(m, c), d = F(
|
|
75
|
+
m * ut,
|
|
76
|
+
c
|
|
77
|
+
);
|
|
78
|
+
return {
|
|
79
|
+
position: "absolute",
|
|
80
|
+
...r,
|
|
81
|
+
...p ? { top: 0 } : { left: 0 },
|
|
82
|
+
width: n,
|
|
83
|
+
height: n,
|
|
84
|
+
borderRadius: l,
|
|
85
|
+
overflow: "hidden",
|
|
86
|
+
display: "flex",
|
|
87
|
+
alignItems: "center",
|
|
88
|
+
justifyContent: "center",
|
|
89
|
+
// The left-most slices have to stack on top of the right-ward ones.
|
|
90
|
+
zIndex: a,
|
|
91
|
+
// Always present, even collapsed: the transform is what makes this wrapper a
|
|
92
|
+
// stacking context, which neutralizes the child's own z-index.
|
|
93
|
+
transform: i.translate,
|
|
94
|
+
WebkitMaskImage: i.maskImage,
|
|
95
|
+
maskImage: i.maskImage,
|
|
96
|
+
WebkitMaskSize: i.maskSize,
|
|
97
|
+
maskSize: i.maskSize,
|
|
98
|
+
WebkitMaskPosition: i.maskPosition,
|
|
99
|
+
maskPosition: i.maskPosition,
|
|
100
|
+
WebkitMaskRepeat: "no-repeat",
|
|
101
|
+
maskRepeat: "no-repeat",
|
|
102
|
+
transition: `transform ${s}, -webkit-mask-position ${d}, mask-position ${d}`,
|
|
103
|
+
// Strip arbitrary shadows from the children and make them inherit the wrapper's
|
|
104
|
+
// silhouette, so the root controls the global 3D shape.
|
|
105
|
+
"& > *": {
|
|
106
|
+
boxShadow: "none !important",
|
|
107
|
+
borderRadius: "inherit !important",
|
|
108
|
+
width: "100%",
|
|
109
|
+
height: "100%",
|
|
110
|
+
margin: 0
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
function ht(o) {
|
|
115
|
+
const {
|
|
116
|
+
index: e,
|
|
117
|
+
ownerState: n,
|
|
118
|
+
geometry: a,
|
|
119
|
+
className: i,
|
|
120
|
+
component: l,
|
|
121
|
+
inert: m,
|
|
122
|
+
itemRefs: c,
|
|
123
|
+
slotProps: p,
|
|
124
|
+
children: r
|
|
125
|
+
} = o, s = u.useMemo(
|
|
126
|
+
() => ({ ...n, index: e, isAnchor: e === 0, geometry: a }),
|
|
127
|
+
[n, e, a]
|
|
128
|
+
), d = u.useRef(null), k = u.useCallback(
|
|
129
|
+
(h) => {
|
|
130
|
+
c.current[e] = h;
|
|
131
|
+
},
|
|
132
|
+
[c, e]
|
|
133
|
+
), C = v(k, d);
|
|
134
|
+
u.useEffect(() => {
|
|
135
|
+
const h = d.current;
|
|
136
|
+
!h || !("inert" in HTMLElement.prototype) || (h.inert = m);
|
|
137
|
+
}, [m]);
|
|
138
|
+
const b = j({
|
|
139
|
+
elementType: l,
|
|
140
|
+
externalSlotProps: p,
|
|
141
|
+
ownerState: s,
|
|
142
|
+
additionalProps: {
|
|
143
|
+
ref: C,
|
|
144
|
+
className: i,
|
|
145
|
+
"aria-hidden": m || void 0,
|
|
146
|
+
children: r
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
return /* @__PURE__ */ $(l, { ...b });
|
|
150
|
+
}
|
|
151
|
+
const wt = u.forwardRef(
|
|
152
|
+
function(e, n) {
|
|
153
|
+
const a = ot({ props: e, name: "MuiCollageFab" }), {
|
|
154
|
+
children: i,
|
|
155
|
+
direction: l = "left",
|
|
156
|
+
size: m = "large",
|
|
157
|
+
variant: c = "circular",
|
|
158
|
+
gap: p = 16,
|
|
159
|
+
fadeWidth: r = 12,
|
|
160
|
+
trigger: s = "hover",
|
|
161
|
+
open: d,
|
|
162
|
+
defaultOpen: k = !1,
|
|
163
|
+
onOpen: C,
|
|
164
|
+
onClose: b,
|
|
165
|
+
disableClickAway: R = !1,
|
|
166
|
+
transitionDuration: h = 400,
|
|
167
|
+
transitionEasing: E = "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
168
|
+
classes: w,
|
|
169
|
+
slots: x,
|
|
170
|
+
slotProps: P,
|
|
171
|
+
className: K,
|
|
172
|
+
...q
|
|
173
|
+
} = a, [f, M] = nt({
|
|
174
|
+
controlled: d,
|
|
175
|
+
default: k,
|
|
176
|
+
name: "CollageFab",
|
|
177
|
+
state: "open"
|
|
178
|
+
}), z = u.useMemo(
|
|
179
|
+
() => u.Children.toArray(i).filter((t) => u.isValidElement(t)),
|
|
180
|
+
[i]
|
|
181
|
+
), A = z.length, I = {
|
|
182
|
+
open: f,
|
|
183
|
+
direction: l,
|
|
184
|
+
trigger: s,
|
|
185
|
+
size: ct(m),
|
|
186
|
+
variant: c,
|
|
187
|
+
cornerRadius: it[c],
|
|
188
|
+
gap: p,
|
|
189
|
+
fadeWidth: r,
|
|
190
|
+
count: A,
|
|
191
|
+
transitionDuration: h,
|
|
192
|
+
transitionEasing: E
|
|
193
|
+
}, D = ft(f, w), L = u.useRef(null), _ = u.useRef([]), S = u.useRef(!1), N = u.useRef("mouse"), T = u.useRef(!1), B = v(L, n), y = u.useCallback(
|
|
194
|
+
(t, g) => {
|
|
195
|
+
t !== f && (M(t), t ? C == null || C(g) : b == null || b(g));
|
|
196
|
+
},
|
|
197
|
+
[f, M, C, b]
|
|
198
|
+
), G = (t) => {
|
|
199
|
+
s !== "hover" || t.pointerType !== "mouse" || y(!0, t);
|
|
200
|
+
}, H = (t) => {
|
|
201
|
+
s !== "hover" || t.pointerType !== "mouse" || y(!1, t);
|
|
202
|
+
}, V = (t) => {
|
|
203
|
+
s !== "manual" && (N.current = t.pointerType, S.current = !1, !(t.pointerType === "mouse" || f) && (S.current = !0, y(!0, t)));
|
|
204
|
+
}, X = (t) => {
|
|
205
|
+
S.current && (S.current = !1, t.stopPropagation(), t.preventDefault());
|
|
206
|
+
}, Y = (t) => {
|
|
207
|
+
if (s !== "manual") {
|
|
208
|
+
if (s === "click") {
|
|
209
|
+
y(!f, t);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
f && N.current !== "mouse" && y(!1, t);
|
|
213
|
+
}
|
|
214
|
+
}, Z = (t) => {
|
|
215
|
+
var g;
|
|
216
|
+
if (s !== "manual") {
|
|
217
|
+
if (f) {
|
|
218
|
+
if (t.key !== "Escape")
|
|
219
|
+
return;
|
|
220
|
+
t.stopPropagation(), y(!1, t), (g = L.current) == null || g.focus();
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
t.key !== "Enter" && t.key !== " " || (t.preventDefault(), T.current = !0, y(!0, t));
|
|
224
|
+
}
|
|
225
|
+
}, J = (t) => {
|
|
226
|
+
y(!1, t);
|
|
227
|
+
}, W = (x == null ? void 0 : x.root) ?? dt, Q = (x == null ? void 0 : x.item) ?? gt, tt = j({
|
|
228
|
+
elementType: W,
|
|
229
|
+
externalForwardedProps: q,
|
|
230
|
+
externalSlotProps: P == null ? void 0 : P.root,
|
|
231
|
+
ownerState: I,
|
|
232
|
+
additionalProps: {
|
|
233
|
+
ref: B,
|
|
234
|
+
role: "group",
|
|
235
|
+
tabIndex: !f && s !== "manual" ? 0 : -1,
|
|
236
|
+
onPointerEnter: G,
|
|
237
|
+
onPointerLeave: H,
|
|
238
|
+
onPointerDown: V,
|
|
239
|
+
onClick: Y,
|
|
240
|
+
onClickCapture: X,
|
|
241
|
+
onKeyDown: Z
|
|
242
|
+
},
|
|
243
|
+
className: [D.root, K]
|
|
244
|
+
});
|
|
245
|
+
if (u.useEffect(() => {
|
|
246
|
+
if (!f || !T.current)
|
|
247
|
+
return;
|
|
248
|
+
T.current = !1;
|
|
249
|
+
const t = _.current[0];
|
|
250
|
+
if (!t)
|
|
251
|
+
return;
|
|
252
|
+
(t.querySelector(lt) ?? t).focus();
|
|
253
|
+
}, [f]), A === 0)
|
|
254
|
+
return null;
|
|
255
|
+
const O = /* @__PURE__ */ $(W, { ...tt, children: z.map((t, g) => /* @__PURE__ */ $(
|
|
256
|
+
ht,
|
|
257
|
+
{
|
|
258
|
+
index: g,
|
|
259
|
+
ownerState: I,
|
|
260
|
+
geometry: pt(g, I),
|
|
261
|
+
className: D.item,
|
|
262
|
+
component: Q,
|
|
263
|
+
inert: !f && s !== "manual",
|
|
264
|
+
itemRefs: _,
|
|
265
|
+
slotProps: P == null ? void 0 : P.item,
|
|
266
|
+
children: t
|
|
267
|
+
},
|
|
268
|
+
g
|
|
269
|
+
)) });
|
|
270
|
+
return R || s === "manual" ? O : /* @__PURE__ */ $(et, { onClickAway: J, children: O });
|
|
271
|
+
}
|
|
272
|
+
);
|
|
273
|
+
export {
|
|
274
|
+
wt as CollageFab
|
|
275
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
import type { CreateSlotsAndSlotProps, SlotProps } from '@mui/material/utils';
|
|
4
|
+
export type CollageFabDirection = 'left' | 'right' | 'up' | 'down';
|
|
5
|
+
export type CollageFabTrigger = 'hover' | 'click' | 'manual';
|
|
6
|
+
export type CollageFabSize = 'small' | 'medium' | 'large' | number;
|
|
7
|
+
export type CollageFabVariant = 'circular' | 'rounded' | 'square';
|
|
8
|
+
export interface CollageFabClasses {
|
|
9
|
+
root: string;
|
|
10
|
+
item: string;
|
|
11
|
+
expanded: string;
|
|
12
|
+
collapsed: string;
|
|
13
|
+
}
|
|
14
|
+
export type CollageFabClassKey = keyof CollageFabClasses;
|
|
15
|
+
export interface CollageFabRootSlotPropsOverrides {
|
|
16
|
+
}
|
|
17
|
+
export interface CollageFabItemSlotPropsOverrides {
|
|
18
|
+
}
|
|
19
|
+
export interface CollageFabOwnerState {
|
|
20
|
+
open: boolean;
|
|
21
|
+
direction: CollageFabDirection;
|
|
22
|
+
trigger: CollageFabTrigger;
|
|
23
|
+
size: number;
|
|
24
|
+
variant: CollageFabVariant;
|
|
25
|
+
cornerRadius: number | string;
|
|
26
|
+
gap: number;
|
|
27
|
+
fadeWidth: number;
|
|
28
|
+
count: number;
|
|
29
|
+
transitionDuration: number;
|
|
30
|
+
transitionEasing: string;
|
|
31
|
+
}
|
|
32
|
+
export interface CollageFabItemGeometry {
|
|
33
|
+
translate: string;
|
|
34
|
+
maskImage: string;
|
|
35
|
+
maskSize: string;
|
|
36
|
+
maskPosition: string;
|
|
37
|
+
}
|
|
38
|
+
export interface CollageFabItemOwnerState extends CollageFabOwnerState {
|
|
39
|
+
index: number;
|
|
40
|
+
isAnchor: boolean;
|
|
41
|
+
geometry: CollageFabItemGeometry;
|
|
42
|
+
}
|
|
43
|
+
export interface CollageFabSlots {
|
|
44
|
+
root?: React.ElementType;
|
|
45
|
+
item?: React.ElementType;
|
|
46
|
+
}
|
|
47
|
+
export type CollageFabSlotsAndSlotProps = CreateSlotsAndSlotProps<CollageFabSlots, {
|
|
48
|
+
root: SlotProps<'div', CollageFabRootSlotPropsOverrides, CollageFabOwnerState>;
|
|
49
|
+
item: SlotProps<'div', CollageFabItemSlotPropsOverrides, CollageFabItemOwnerState>;
|
|
50
|
+
}>;
|
|
51
|
+
export interface CollageFabProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>, CollageFabSlotsAndSlotProps {
|
|
52
|
+
/**
|
|
53
|
+
* The buttons to stack. Order matters: index 0 is the anchor, the remaining
|
|
54
|
+
* children fan out along `direction`.
|
|
55
|
+
*/
|
|
56
|
+
children?: React.ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* The axis the buttons fan out on, starting from the anchor child.
|
|
59
|
+
* @default 'left'
|
|
60
|
+
*/
|
|
61
|
+
direction?: CollageFabDirection;
|
|
62
|
+
/**
|
|
63
|
+
* Diameter of every button, in pixels. Numeric values are used verbatim.
|
|
64
|
+
* @default 'large'
|
|
65
|
+
*/
|
|
66
|
+
size?: CollageFabSize;
|
|
67
|
+
/**
|
|
68
|
+
* The shape of every button. `'circular'` clips each slice to a circle,
|
|
69
|
+
* `'rounded'` to a rounded square and `'square'` to a sharp-cornered square.
|
|
70
|
+
* The mask still slices the silhouette along the main axis, so the stack reads
|
|
71
|
+
* as one shape when collapsed and as separate shapes when expanded.
|
|
72
|
+
* @default 'circular'
|
|
73
|
+
*/
|
|
74
|
+
variant?: CollageFabVariant;
|
|
75
|
+
/**
|
|
76
|
+
* Main axis gap between two buttons when expanded, in pixels.
|
|
77
|
+
* @default 16
|
|
78
|
+
*/
|
|
79
|
+
gap?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Width of the soft cut line between two slices, in pixels.
|
|
82
|
+
* @default 12
|
|
83
|
+
*/
|
|
84
|
+
fadeWidth?: number;
|
|
85
|
+
/**
|
|
86
|
+
* How the group reacts to pointers. `'hover'` opens on mouse enter, closes on
|
|
87
|
+
* mouse leave and toggles on touch/pen tap. `'click'` toggles on any click.
|
|
88
|
+
* `'manual'` disables all built-in pointer interaction.
|
|
89
|
+
* @default 'hover'
|
|
90
|
+
*/
|
|
91
|
+
trigger?: CollageFabTrigger;
|
|
92
|
+
/**
|
|
93
|
+
* If `true`, the group is expanded. Use it to control the component.
|
|
94
|
+
*/
|
|
95
|
+
open?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* If `true`, the group is expanded by default.
|
|
98
|
+
* @default false
|
|
99
|
+
*/
|
|
100
|
+
defaultOpen?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Callback fired when the group is expanded.
|
|
103
|
+
*/
|
|
104
|
+
onOpen?: (event: React.SyntheticEvent) => void;
|
|
105
|
+
/**
|
|
106
|
+
* Callback fired when the group is collapsed.
|
|
107
|
+
*/
|
|
108
|
+
onClose?: (event: React.SyntheticEvent) => void;
|
|
109
|
+
/**
|
|
110
|
+
* If `true`, the group does not collapse when the user clicks away from it.
|
|
111
|
+
* @default false
|
|
112
|
+
*/
|
|
113
|
+
disableClickAway?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Duration of the morph, in milliseconds. The mask that slices the buttons is
|
|
116
|
+
* given a longer, internally derived duration so its cut line resolves late in
|
|
117
|
+
* the morph rather than in the first quarter; passing `0` still disables all
|
|
118
|
+
* animation.
|
|
119
|
+
* @default 400
|
|
120
|
+
*/
|
|
121
|
+
transitionDuration?: number;
|
|
122
|
+
/**
|
|
123
|
+
* Easing of the morph.
|
|
124
|
+
* @default 'cubic-bezier(0.4, 0, 0.2, 1)'
|
|
125
|
+
*/
|
|
126
|
+
transitionEasing?: string;
|
|
127
|
+
/**
|
|
128
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
129
|
+
*/
|
|
130
|
+
sx?: SxProps<Theme>;
|
|
131
|
+
/**
|
|
132
|
+
* Override or extend the styles applied to the component.
|
|
133
|
+
*/
|
|
134
|
+
classes?: Partial<CollageFabClasses>;
|
|
135
|
+
}
|
|
136
|
+
export declare const CollageFab: React.ForwardRefExoticComponent<CollageFabProps & React.RefAttributes<HTMLDivElement>>;
|
|
137
|
+
//# sourceMappingURL=CollageFab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollageFab.d.ts","sourceRoot":"","sources":["../../../src/components/CollageFab.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,78 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mui-collage-fab",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Material UI floating action button that unfolds a stack of overlapping Fab circles into a row.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Radomir Wojtera",
|
|
7
|
+
"homepage": "https://www.radomir.dev/mui-collage-fab/",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/radomir-dev/mui-collage-fab.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/radomir-dev/mui-collage-fab/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"mui",
|
|
17
|
+
"material-ui",
|
|
18
|
+
"react",
|
|
19
|
+
"component",
|
|
20
|
+
"floating-action-button",
|
|
21
|
+
"fab",
|
|
22
|
+
"animation",
|
|
23
|
+
"collage"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"sideEffects": false,
|
|
27
|
+
"files": [
|
|
28
|
+
"dist-lib"
|
|
29
|
+
],
|
|
30
|
+
"main": "./dist-lib/index.cjs",
|
|
31
|
+
"module": "./dist-lib/index.js",
|
|
32
|
+
"types": "./dist-lib/types/index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist-lib/types/index.d.ts",
|
|
36
|
+
"import": "./dist-lib/index.js",
|
|
37
|
+
"require": "./dist-lib/index.cjs"
|
|
38
|
+
},
|
|
39
|
+
"./package.json": "./package.json"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=18"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"dev": "vite",
|
|
49
|
+
"build": "tsc --noEmit && vite build",
|
|
50
|
+
"build:lib": "vite build --config vite.lib.config.ts && tsc -p tsconfig.build.json",
|
|
51
|
+
"prepublishOnly": "npm run build:lib",
|
|
52
|
+
"preview": "vite preview"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@mui/utils": "^5.15.0"
|
|
56
|
+
},
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"@emotion/react": "^11.0.0",
|
|
59
|
+
"@emotion/styled": "^11.0.0",
|
|
60
|
+
"@mui/material": "^5.0.0",
|
|
61
|
+
"react": "^18.0.0",
|
|
62
|
+
"react-dom": "^18.0.0"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@emotion/react": "^11.13.3",
|
|
66
|
+
"@emotion/styled": "^11.13.0",
|
|
67
|
+
"@mui/icons-material": "^5.16.7",
|
|
68
|
+
"@mui/material": "^5.16.7",
|
|
69
|
+
"@types/react": "^18.3.12",
|
|
70
|
+
"@types/react-dom": "^18.3.1",
|
|
71
|
+
"@vitejs/plugin-react": "^4.3.3",
|
|
72
|
+
"react": "^18.3.1",
|
|
73
|
+
"react-dom": "^18.3.1",
|
|
74
|
+
"react-router-dom": "^7.18.4",
|
|
75
|
+
"typescript": "~5.6.3",
|
|
76
|
+
"vite": "^5.4.10"
|
|
77
|
+
}
|
|
78
|
+
}
|