@activecollab/components 2.0.442 → 2.0.444
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/Dialog/Styles.js +1 -1
- package/dist/cjs/components/Dialog/Styles.js.map +1 -1
- package/dist/cjs/components/Overlay/Overlay.js +41 -2
- package/dist/cjs/components/Overlay/Overlay.js.map +1 -1
- package/dist/cjs/components/Overlay/Styles.js +4 -2
- package/dist/cjs/components/Overlay/Styles.js.map +1 -1
- package/dist/cjs/components/Overlay/overlayStack.js +48 -0
- package/dist/cjs/components/Overlay/overlayStack.js.map +1 -0
- package/dist/cjs/components/Sheet/Sheet.js +18 -36
- package/dist/cjs/components/Sheet/Sheet.js.map +1 -1
- package/dist/cjs/components/Sheet/Styles.js +15 -22
- package/dist/cjs/components/Sheet/Styles.js.map +1 -1
- package/dist/esm/components/Dialog/Styles.d.ts.map +1 -1
- package/dist/esm/components/Dialog/Styles.js +1 -1
- package/dist/esm/components/Dialog/Styles.js.map +1 -1
- package/dist/esm/components/Overlay/Overlay.d.ts.map +1 -1
- package/dist/esm/components/Overlay/Overlay.js +32 -2
- package/dist/esm/components/Overlay/Overlay.js.map +1 -1
- package/dist/esm/components/Overlay/Styles.d.ts +1 -0
- package/dist/esm/components/Overlay/Styles.d.ts.map +1 -1
- package/dist/esm/components/Overlay/Styles.js +1 -1
- package/dist/esm/components/Overlay/Styles.js.map +1 -1
- package/dist/esm/components/Overlay/overlayStack.d.ts +7 -0
- package/dist/esm/components/Overlay/overlayStack.d.ts.map +1 -0
- package/dist/esm/components/Overlay/overlayStack.js +34 -0
- package/dist/esm/components/Overlay/overlayStack.js.map +1 -0
- package/dist/esm/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/esm/components/Sheet/Sheet.js +17 -33
- package/dist/esm/components/Sheet/Sheet.js.map +1 -1
- package/dist/esm/components/Sheet/Styles.d.ts +1 -10
- package/dist/esm/components/Sheet/Styles.d.ts.map +1 -1
- package/dist/esm/components/Sheet/Styles.js +15 -14
- package/dist/esm/components/Sheet/Styles.js.map +1 -1
- package/dist/index.js +118 -68
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","screen","FontStyle","dialogSizes","s","m","l","xl","xxl","xxxl","MIN_GAP","MAX_DIALOG_HEIGHT","StyledDialogViewport","div","withConfig","displayName","componentId","sm","StyledDialog","props","$maxWidth","$height","StyledDialogTitle","CLOSE_OFFSET","CLOSE_RESERVE","StyledDialogTitleBar","StyledDialogTitleClose","StyledDialogContent","$scroll","StyledDialogContentDivider","StyledDialogActions"],"sources":["../../../../src/components/Dialog/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { screen } from \"../BreakPoints\";\nimport { FontStyle } from \"../FontStyle\";\n\nexport const dialogSizes = {\n s: 440,\n m: 540,\n l: 700,\n xl: 840,\n xxl: 1000,\n xxxl: 1120,\n} as const;\n\nexport type DialogSize = keyof typeof dialogSizes;\n\nconst MIN_GAP = \"2.5vh\";\nconst MAX_DIALOG_HEIGHT = \"95vh\";\n\n// The dialog hangs at a fixed offset while there is room below it, then grows in both directions at\n// once. Two shrinkable spacers express that: only the lower one grows, and past the crossover both\n// shrink from the same basis, so the gaps stay equal down to MIN_GAP.\nexport const StyledDialogViewport = styled.div`\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n padding-left: 16px;\n padding-right: 16px;\n pointer-events: none;\n\n --ac-dialog-offset: 60px;\n\n ${screen.sm} {\n --ac-dialog-offset: 126px;\n }\n\n &::before,\n &::after {\n content: \"\";\n flex-shrink: 1;\n flex-basis: var(--ac-dialog-offset);\n min-height: ${MIN_GAP};\n }\n\n &::before {\n flex-grow: 0;\n }\n\n &::after {\n flex-grow: 1;\n }\n\n ${BoxSizingStyle}\n`;\n\nStyledDialogViewport.displayName = \"StyledDialogViewport\";\n\nexport const StyledDialog = styled.div<{\n $maxWidth: number;\n $height?: string;\n}>`\n display: flex;\n flex-direction: column;\n flex: 0 0 auto;\n pointer-events: auto;\n width: 100%;\n max-width: ${(props) => props.$maxWidth}px;\n max-height: ${MAX_DIALOG_HEIGHT};\n background-color: var(--page-paper-main);\n color: var(--color-theme-900);\n box-shadow: var(--shadow-primary);\n border-radius: 8px;\n position: relative;\n transition: max-width 0.2s ease, height 0.2s ease;\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n\n ${(props) =>\n props.$height &&\n css`\n height: ${props.$height};\n `}\n\n ${FontStyle}\n ${BoxSizingStyle}\n`;\n\nStyledDialog.displayName = \"StyledDialog\";\n\nexport const StyledDialogTitle = styled.div`\n padding: 20px 30px;\n flex: 0 0 auto;\n\n ${FontStyle}\n ${BoxSizingStyle}\n`;\nStyledDialogTitle.displayName = \"StyledDialogTitle\";\n\n// The close button hangs 8px into the title padding, so it sits nearer the dialog edge than the\n// heading does. The bar reserves the rest, which keeps the gap to the heading unchanged.\nconst CLOSE_OFFSET = 8;\nconst CLOSE_RESERVE = 44 - CLOSE_OFFSET;\n\n// The header is as tall as its heading, with or without a close button.\nexport const StyledDialogTitleBar = styled.div`\n position: relative;\n display: flex;\n align-items: center;\n padding-right: ${CLOSE_RESERVE}px;\n`;\nStyledDialogTitleBar.displayName = \"StyledDialogTitleBar\";\n\nexport const StyledDialogTitleClose = styled.div`\n position: absolute;\n right: -${CLOSE_OFFSET}px;\n top: 50%;\n transform: translateY(-50%);\n line-height: 0;\n`;\nStyledDialogTitleClose.displayName = \"StyledDialogTitleClose\";\n\nexport const StyledDialogContent = styled.div<{ $scroll: boolean }>`\n padding: 20px 30px;\n flex: 1 1 auto;\n min-height: 0;\n overflow-y: ${(props) => (props.$scroll ? \"auto\" : \"visible\")};\n\n ${FontStyle}\n ${BoxSizingStyle}\n`;\nStyledDialogContent.displayName = \"StyledDialogContent\";\n\nexport const StyledDialogContentDivider = styled.div`\n border-top: 1px solid var(--border-primary);\n height: 1px;\n flex: 0 0 auto;\n`;\nStyledDialogContentDivider.displayName = \"StyledDialogContentDivider\";\n\nexport const StyledDialogActions = styled.div`\n padding: 20px 30px;\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n gap: 12px;\n\n ${FontStyle}\n ${BoxSizingStyle}\n`;\nStyledDialogActions.displayName = \"StyledDialogActions\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAE/C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SAASC,SAAS,QAAQ,cAAc;AAExC,OAAO,MAAMC,WAAW,GAAG;EACzBC,CAAC,EAAE,GAAG;EACNC,CAAC,EAAE,GAAG;EACNC,CAAC,EAAE,GAAG;EACNC,EAAE,EAAE,GAAG;EACPC,GAAG,EAAE,IAAI;EACTC,IAAI,EAAE;AACR,CAAU;AAIV,MAAMC,OAAO,GAAG,OAAO;AACvB,MAAMC,iBAAiB,GAAG,MAAM;;AAEhC;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,GAAGd,MAAM,CAACe,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,kXAe1Cf,MAAM,CAACgB,EAAE,EASKP,OAAO,EAWrBV,cAAc,CACjB;AAEDY,oBAAoB,CAACG,WAAW,GAAG,sBAAsB;AAEzD,OAAO,MAAMG,YAAY,GAAGpB,MAAM,CAACe,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,0XAStBG,KAAK,IAAKA,KAAK,CAACC,SAAS,EACzBT,iBAAiB,EAY5BQ,KAAK,IACNA,KAAK,CAACE,OAAO,IACbtB,GAAG,mBACSoB,KAAK,CAACE,OAAO,CACxB,EAEDnB,SAAS,EACTF,cAAc,CACjB;AAEDkB,YAAY,CAACH,WAAW,GAAG,cAAc;AAEzC,OAAO,MAAMO,iBAAiB,GAAGxB,MAAM,CAACe,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,kDAIvCd,SAAS,EACTF,cAAc,CACjB;AACDsB,iBAAiB,CAACP,WAAW,GAAG,mBAAmB;;AAEnD;AACA;AACA,MAAMQ,YAAY,GAAG,CAAC;AACtB,MAAMC,aAAa,GAAG,EAAE,GAAGD,YAAY;;AAEvC;AACA,OAAO,MAAME,oBAAoB,GAAG3B,MAAM,CAACe,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,gFAI3BQ,aAAa,CAC/B;AACDC,oBAAoB,CAACV,WAAW,GAAG,sBAAsB;AAEzD,OAAO,MAAMW,sBAAsB,GAAG5B,MAAM,CAACe,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,0FAEpCO,YAAY,CAIvB;AACDG,sBAAsB,CAACX,WAAW,GAAG,wBAAwB;AAE7D,OAAO,MAAMY,mBAAmB,GAAG7B,MAAM,CAACe,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","screen","FontStyle","dialogSizes","s","m","l","xl","xxl","xxxl","MIN_GAP","MAX_DIALOG_HEIGHT","StyledDialogViewport","div","withConfig","displayName","componentId","sm","StyledDialog","props","$maxWidth","$height","StyledDialogTitle","CLOSE_OFFSET","CLOSE_RESERVE","StyledDialogTitleBar","StyledDialogTitleClose","StyledDialogContent","$scroll","StyledDialogContentDivider","StyledDialogActions"],"sources":["../../../../src/components/Dialog/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { screen } from \"../BreakPoints\";\nimport { FontStyle } from \"../FontStyle\";\n\nexport const dialogSizes = {\n s: 440,\n m: 540,\n l: 700,\n xl: 840,\n xxl: 1000,\n xxxl: 1120,\n} as const;\n\nexport type DialogSize = keyof typeof dialogSizes;\n\nconst MIN_GAP = \"2.5vh\";\nconst MAX_DIALOG_HEIGHT = \"95vh\";\n\n// The dialog hangs at a fixed offset while there is room below it, then grows in both directions at\n// once. Two shrinkable spacers express that: only the lower one grows, and past the crossover both\n// shrink from the same basis, so the gaps stay equal down to MIN_GAP.\nexport const StyledDialogViewport = styled.div`\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n padding-left: 16px;\n padding-right: 16px;\n pointer-events: none;\n\n --ac-dialog-offset: 60px;\n\n ${screen.sm} {\n --ac-dialog-offset: 126px;\n }\n\n &::before,\n &::after {\n content: \"\";\n flex-shrink: 1;\n flex-basis: var(--ac-dialog-offset);\n min-height: ${MIN_GAP};\n }\n\n &::before {\n flex-grow: 0;\n }\n\n &::after {\n flex-grow: 1;\n }\n\n ${BoxSizingStyle}\n`;\n\nStyledDialogViewport.displayName = \"StyledDialogViewport\";\n\nexport const StyledDialog = styled.div<{\n $maxWidth: number;\n $height?: string;\n}>`\n display: flex;\n flex-direction: column;\n flex: 0 0 auto;\n pointer-events: auto;\n width: 100%;\n max-width: ${(props) => props.$maxWidth}px;\n max-height: ${MAX_DIALOG_HEIGHT};\n background-color: var(--page-paper-main);\n color: var(--color-theme-900);\n box-shadow: var(--shadow-primary);\n border-radius: 8px;\n position: relative;\n transition: max-width 0.2s ease, height 0.2s ease;\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n\n ${(props) =>\n props.$height &&\n css`\n height: ${props.$height};\n `}\n\n ${FontStyle}\n ${BoxSizingStyle}\n`;\n\nStyledDialog.displayName = \"StyledDialog\";\n\nexport const StyledDialogTitle = styled.div`\n padding: 20px 30px;\n flex: 0 0 auto;\n\n ${FontStyle}\n ${BoxSizingStyle}\n`;\nStyledDialogTitle.displayName = \"StyledDialogTitle\";\n\n// The close button hangs 8px into the title padding, so it sits nearer the dialog edge than the\n// heading does. The bar reserves the rest, which keeps the gap to the heading unchanged.\nconst CLOSE_OFFSET = 8;\nconst CLOSE_RESERVE = 44 - CLOSE_OFFSET;\n\n// The header is as tall as its heading, with or without a close button.\nexport const StyledDialogTitleBar = styled.div`\n position: relative;\n display: flex;\n align-items: center;\n padding-right: ${CLOSE_RESERVE}px;\n`;\nStyledDialogTitleBar.displayName = \"StyledDialogTitleBar\";\n\nexport const StyledDialogTitleClose = styled.div`\n position: absolute;\n right: -${CLOSE_OFFSET}px;\n top: 50%;\n transform: translateY(-50%);\n line-height: 0;\n`;\nStyledDialogTitleClose.displayName = \"StyledDialogTitleClose\";\n\nexport const StyledDialogContent = styled.div<{ $scroll: boolean }>`\n padding: 20px 30px;\n flex: 1 1 auto;\n min-height: 0;\n overscroll-behavior: contain;\n overflow-y: ${(props) => (props.$scroll ? \"auto\" : \"visible\")};\n\n ${FontStyle}\n ${BoxSizingStyle}\n`;\nStyledDialogContent.displayName = \"StyledDialogContent\";\n\nexport const StyledDialogContentDivider = styled.div`\n border-top: 1px solid var(--border-primary);\n height: 1px;\n flex: 0 0 auto;\n`;\nStyledDialogContentDivider.displayName = \"StyledDialogContentDivider\";\n\nexport const StyledDialogActions = styled.div`\n padding: 20px 30px;\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n gap: 12px;\n\n ${FontStyle}\n ${BoxSizingStyle}\n`;\nStyledDialogActions.displayName = \"StyledDialogActions\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAE/C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SAASC,SAAS,QAAQ,cAAc;AAExC,OAAO,MAAMC,WAAW,GAAG;EACzBC,CAAC,EAAE,GAAG;EACNC,CAAC,EAAE,GAAG;EACNC,CAAC,EAAE,GAAG;EACNC,EAAE,EAAE,GAAG;EACPC,GAAG,EAAE,IAAI;EACTC,IAAI,EAAE;A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mB,GAAG7B,MAAM,CAACe,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,2GAK5BG,KAAK,IAAMA,KAAK,CAACS,OAAO,GAAG,MAAM,GAAG,SAAU,EAE3D1B,SAAS,EACTF,cAAc,CACjB;AACD2B,mBAAmB,CAACZ,WAAW,GAAG,qBAAqB;AAEvD,OAAO,MAAMc,0BAA0B,GAAG/B,MAAM,CAACe,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,4EAInD;AACDa,0BAA0B,CAACd,WAAW,GAAG,4BAA4B;AAErE,OAAO,MAAMe,mBAAmB,GAAGhC,MAAM,CAACe,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,2FAOzCd,SAAS,EACTF,cAAc,CACjB;AACD8B,mBAAmB,CAACf,WAAW,GAAG,qBAAqB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../../../src/components/Overlay/Overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../../../src/components/Overlay/Overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAC;AAwCvD,MAAM,WAAW,QAAQ;IACvB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,eAAO,MAAM,OAAO,EAAE,EAAE,CACtB,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,MAAM,QAAQ,CAAC,CAavE,CAAC"}
|
|
@@ -1,17 +1,47 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["className", "disableBackgroundColor"];
|
|
4
|
-
import React from "react";
|
|
4
|
+
import React, { useEffect, useState } from "react";
|
|
5
5
|
import classnames from "classnames";
|
|
6
|
+
import { isTopOverlay, popOverlay, pushOverlay, subscribeToOverlays } from "./overlayStack";
|
|
6
7
|
import { StyledOverlay } from "./Styles";
|
|
8
|
+
import { useLayerContext } from "../../helpers/LayerContext/LayerContext";
|
|
9
|
+
import { layers } from "../../utils/layers";
|
|
10
|
+
|
|
11
|
+
// Chrome samples the backdrop of every blurred overlay on every frame, and a covered one buys
|
|
12
|
+
// nothing for that cost. Only the overlay on top keeps its blur.
|
|
13
|
+
const useKeepsBlur = (blurs, zIndex) => {
|
|
14
|
+
const _useState = useState(true),
|
|
15
|
+
isTop = _useState[0],
|
|
16
|
+
setIsTop = _useState[1];
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (!blurs) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
const id = pushOverlay(zIndex);
|
|
22
|
+
const sync = () => setIsTop(isTopOverlay(id));
|
|
23
|
+
sync();
|
|
24
|
+
const unsubscribe = subscribeToOverlays(sync);
|
|
25
|
+
return () => {
|
|
26
|
+
unsubscribe();
|
|
27
|
+
popOverlay(id);
|
|
28
|
+
};
|
|
29
|
+
}, [blurs, zIndex]);
|
|
30
|
+
return blurs && isTop;
|
|
31
|
+
};
|
|
7
32
|
export const Overlay = _ref => {
|
|
8
33
|
let className = _ref.className,
|
|
9
34
|
_ref$disableBackgroun = _ref.disableBackgroundColor,
|
|
10
35
|
disableBackgroundColor = _ref$disableBackgroun === void 0 ? false : _ref$disableBackgroun,
|
|
11
36
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
37
|
+
const _useLayerContext = useLayerContext(),
|
|
38
|
+
_useLayerContext$zInd = _useLayerContext.zIndex,
|
|
39
|
+
zIndex = _useLayerContext$zInd === void 0 ? layers.skyscraper : _useLayerContext$zInd;
|
|
40
|
+
const keepsBlur = useKeepsBlur(!disableBackgroundColor, zIndex);
|
|
12
41
|
return /*#__PURE__*/React.createElement(StyledOverlay, _extends({
|
|
13
42
|
className: classnames("c-overlay", className),
|
|
14
|
-
$disableBackgroundColor: disableBackgroundColor
|
|
43
|
+
$disableBackgroundColor: disableBackgroundColor,
|
|
44
|
+
$blurs: keepsBlur
|
|
15
45
|
}, rest));
|
|
16
46
|
};
|
|
17
47
|
Overlay.displayName = "Overlay";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overlay.js","names":["React","classnames","StyledOverlay","Overlay","_ref","className","_ref$disableBackgroun","disableBackgroundColor","rest","_objectWithoutPropertiesLoose","_excluded","createElement","_extends","$disableBackgroundColor","displayName"],"sources":["../../../../src/components/Overlay/Overlay.tsx"],"sourcesContent":["import React, { FC } from \"react\";\n\nimport classnames from \"classnames\";\n\nimport { StyledOverlay } from \"./Styles\";\n\nexport interface IOverlay {\n disableBackgroundColor?: boolean;\n}\n\nexport const Overlay: FC<\n IOverlay & Omit<React.ComponentPropsWithoutRef<\"div\">, keyof IOverlay>\n> = ({ className, disableBackgroundColor = false, ...rest }) => {\n return (\n <StyledOverlay\n className={classnames(\"c-overlay\", className)}\n $disableBackgroundColor={disableBackgroundColor}\n {...rest}\n />\n );\n};\n\nOverlay.displayName = \"Overlay\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,
|
|
1
|
+
{"version":3,"file":"Overlay.js","names":["React","useEffect","useState","classnames","isTopOverlay","popOverlay","pushOverlay","subscribeToOverlays","StyledOverlay","useLayerContext","layers","useKeepsBlur","blurs","zIndex","_useState","isTop","setIsTop","undefined","id","sync","unsubscribe","Overlay","_ref","className","_ref$disableBackgroun","disableBackgroundColor","rest","_objectWithoutPropertiesLoose","_excluded","_useLayerContext","_useLayerContext$zInd","skyscraper","keepsBlur","createElement","_extends","$disableBackgroundColor","$blurs","displayName"],"sources":["../../../../src/components/Overlay/Overlay.tsx"],"sourcesContent":["import React, { FC, useEffect, useState } from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n isTopOverlay,\n popOverlay,\n pushOverlay,\n subscribeToOverlays,\n} from \"./overlayStack\";\nimport { StyledOverlay } from \"./Styles\";\nimport { useLayerContext } from \"../../helpers/LayerContext/LayerContext\";\nimport { layers } from \"../../utils/layers\";\n\n// Chrome samples the backdrop of every blurred overlay on every frame, and a covered one buys\n// nothing for that cost. Only the overlay on top keeps its blur.\nconst useKeepsBlur = (blurs: boolean, zIndex: number): boolean => {\n const [isTop, setIsTop] = useState(true);\n\n useEffect(() => {\n if (!blurs) {\n return undefined;\n }\n\n const id = pushOverlay(zIndex);\n const sync = () => setIsTop(isTopOverlay(id));\n\n sync();\n\n const unsubscribe = subscribeToOverlays(sync);\n\n return () => {\n unsubscribe();\n popOverlay(id);\n };\n }, [blurs, zIndex]);\n\n return blurs && isTop;\n};\n\nexport interface IOverlay {\n disableBackgroundColor?: boolean;\n}\n\nexport const Overlay: FC<\n IOverlay & Omit<React.ComponentPropsWithoutRef<\"div\">, keyof IOverlay>\n> = ({ className, disableBackgroundColor = false, ...rest }) => {\n const { zIndex = layers.skyscraper } = useLayerContext();\n const keepsBlur = useKeepsBlur(!disableBackgroundColor, zIndex);\n\n return (\n <StyledOverlay\n className={classnames(\"c-overlay\", className)}\n $disableBackgroundColor={disableBackgroundColor}\n $blurs={keepsBlur}\n {...rest}\n />\n );\n};\n\nOverlay.displayName = \"Overlay\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAQC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAEtD,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,YAAY,EACZC,UAAU,EACVC,WAAW,EACXC,mBAAmB,QACd,gBAAgB;AACvB,SAASC,aAAa,QAAQ,UAAU;AACxC,SAASC,eAAe,QAAQ,yCAAyC;AACzE,SAASC,MAAM,QAAQ,oBAAoB;;AAE3C;AACA;AACA,MAAMC,YAAY,GAAGA,CAACC,KAAc,EAAEC,MAAc,KAAc;EAChE,MAAAC,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AEJ;EAAU,GACdN,IAAI,CACT,CAAC;AAEN,CAAC;AAEDL,OAAO,CAACgB,WAAW,GAAG,SAAS","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Overlay/Styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;6BACC,OAAO;
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Overlay/Styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;6BACC,OAAO;aACvB,OAAO;SAqBjB,CAAC"}
|
|
@@ -2,6 +2,6 @@ import styled, { css } from "styled-components";
|
|
|
2
2
|
export const StyledOverlay = styled.div.withConfig({
|
|
3
3
|
displayName: "Styles__StyledOverlay",
|
|
4
4
|
componentId: "sc-flnrpv-0"
|
|
5
|
-
})(["position:fixed;top:0;right:0;bottom:0;left:0;", ""], props => !props.$disableBackgroundColor && css(["background:var(--modal-background);backdrop-filter:blur(2px);"]));
|
|
5
|
+
})(["position:fixed;top:0;right:0;bottom:0;left:0;", " ", ""], props => !props.$disableBackgroundColor && css(["background:var(--modal-background);transform:translateZ(0);"]), props => props.$blurs && css(["backdrop-filter:blur(2px);"]));
|
|
6
6
|
StyledOverlay.displayName = "StyledOverlay";
|
|
7
7
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["styled","css","StyledOverlay","div","withConfig","displayName","componentId","props","$disableBackgroundColor"],"sources":["../../../../src/components/Overlay/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nexport const StyledOverlay = styled.div<{\n $disableBackgroundColor: boolean;\n}>`\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n\n ${(props) =>\n !props.$disableBackgroundColor &&\n css`\n background: var(--modal-background);\n backdrop-filter: blur(2px);\n `}\n`;\n\nStyledOverlay.displayName = \"StyledOverlay\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAE/C,OAAO,MAAMC,aAAa,GAAGF,MAAM,CAACG,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["styled","css","StyledOverlay","div","withConfig","displayName","componentId","props","$disableBackgroundColor","$blurs"],"sources":["../../../../src/components/Overlay/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nexport const StyledOverlay = styled.div<{\n $disableBackgroundColor: boolean;\n $blurs?: boolean;\n}>`\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n\n ${(props) =>\n !props.$disableBackgroundColor &&\n css`\n background: var(--modal-background);\n /* Chrome samples the backdrop per frame. On its own layer the sample survives a scroll above it. */\n transform: translateZ(0);\n `}\n\n ${(props) =>\n props.$blurs &&\n css`\n backdrop-filter: blur(2px);\n `}\n`;\n\nStyledOverlay.displayName = \"StyledOverlay\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAE/C,OAAO,MAAMC,aAAa,GAAGF,MAAM,CAACG,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,+DAUlCC,KAAK,IACN,CAACA,KAAK,CAACC,uBAAuB,IAC9BP,GAAG,iEAIF,EAEAM,KAAK,IACNA,KAAK,CAACE,MAAM,IACZR,GAAG,gCAEF,CACJ;AAEDC,aAAa,CAACG,WAAW,GAAG,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type Listener = () => void;
|
|
2
|
+
export declare const pushOverlay: (zIndex: number) => number;
|
|
3
|
+
export declare const popOverlay: (id: number) => void;
|
|
4
|
+
export declare const isTopOverlay: (id: number) => boolean;
|
|
5
|
+
export declare const subscribeToOverlays: (listener: Listener) => (() => void);
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=overlayStack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlayStack.d.ts","sourceRoot":"","sources":["../../../../src/components/Overlay/overlayStack.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAW3B,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,KAAG,MAM5C,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,IAAI,MAAM,KAAG,IAGvC,CAAC;AAIF,eAAO,MAAM,YAAY,GAAI,IAAI,MAAM,KAAG,OAazC,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,UAAU,QAAQ,KAAG,CAAC,MAAM,IAAI,CAMnE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const listeners = new Set();
|
|
2
|
+
let stack = [];
|
|
3
|
+
let lastId = 0;
|
|
4
|
+
const notify = () => listeners.forEach(listener => listener());
|
|
5
|
+
export const pushOverlay = zIndex => {
|
|
6
|
+
lastId += 1;
|
|
7
|
+
stack = [...stack, {
|
|
8
|
+
id: lastId,
|
|
9
|
+
zIndex
|
|
10
|
+
}];
|
|
11
|
+
notify();
|
|
12
|
+
return lastId;
|
|
13
|
+
};
|
|
14
|
+
export const popOverlay = id => {
|
|
15
|
+
stack = stack.filter(entry => entry.id !== id);
|
|
16
|
+
notify();
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// The overlay that covers the rest is the one on the highest layer. Mount order only breaks a tie,
|
|
20
|
+
// because a lazily loaded surface can mount after the one it sits under.
|
|
21
|
+
export const isTopOverlay = id => {
|
|
22
|
+
if (stack.length === 0) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
const top = stack.reduce((highest, entry) => entry.zIndex > highest.zIndex || entry.zIndex === highest.zIndex && entry.id > highest.id ? entry : highest);
|
|
26
|
+
return top.id === id;
|
|
27
|
+
};
|
|
28
|
+
export const subscribeToOverlays = listener => {
|
|
29
|
+
listeners.add(listener);
|
|
30
|
+
return () => {
|
|
31
|
+
listeners.delete(listener);
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=overlayStack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlayStack.js","names":["listeners","Set","stack","lastId","notify","forEach","listener","pushOverlay","zIndex","id","popOverlay","filter","entry","isTopOverlay","length","top","reduce","highest","subscribeToOverlays","add","delete"],"sources":["../../../../src/components/Overlay/overlayStack.ts"],"sourcesContent":["type Listener = () => void;\n\ntype Entry = { id: number; zIndex: number };\n\nconst listeners = new Set<Listener>();\n\nlet stack: Entry[] = [];\nlet lastId = 0;\n\nconst notify = (): void => listeners.forEach((listener) => listener());\n\nexport const pushOverlay = (zIndex: number): number => {\n lastId += 1;\n stack = [...stack, { id: lastId, zIndex }];\n notify();\n\n return lastId;\n};\n\nexport const popOverlay = (id: number): void => {\n stack = stack.filter((entry) => entry.id !== id);\n notify();\n};\n\n// The overlay that covers the rest is the one on the highest layer. Mount order only breaks a tie,\n// because a lazily loaded surface can mount after the one it sits under.\nexport const isTopOverlay = (id: number): boolean => {\n if (stack.length === 0) {\n return true;\n }\n\n const top = stack.reduce((highest, entry) =>\n entry.zIndex > highest.zIndex ||\n (entry.zIndex === highest.zIndex && entry.id > highest.id)\n ? entry\n : highest\n );\n\n return top.id === id;\n};\n\nexport const subscribeToOverlays = (listener: Listener): (() => void) => {\n listeners.add(listener);\n\n return (): void => {\n listeners.delete(listener);\n };\n};\n"],"mappings":"AAIA,MAAMA,SAAS,GAAG,IAAIC,GAAG,CAAW,CAAC;AAErC,IAAIC,KAAc,GAAG,EAAE;AACvB,IAAIC,MAAM,GAAG,CAAC;AAEd,MAAMC,MAAM,GAAGA,CAAA,KAAYJ,SAAS,CAACK,OAAO,CAAEC,QAAQ,IAAKA,QAAQ,CAAC,CAAC,CAAC;AAEtE,OAAO,MAAMC,WAAW,GAAIC,MAAc,IAAa;EACrDL,MAAM,IAAI,CAAC;EACXD,KAAK,GAAG,CAAC,GAAGA,KAAK,EAAE;IAAEO,EAAE,EAAEN,MAAM;IAAEK;EAAO,CAAC,CAAC;EAC1CJ,MAAM,CAAC,CAAC;EAER,OAAOD,MAAM;AACf,CAAC;AAED,OAAO,MAAMO,UAAU,GAAID,EAAU,IAAW;EAC9CP,KAAK,GAAGA,KAAK,CAACS,MAAM,CAAEC,KAAK,IAAKA,KAAK,CAACH,EAAE,KAAKA,EAAE,CAAC;EAChDL,MAAM,CAAC,CAAC;AACV,CAAC;;AAED;AACA;AACA,OAAO,MAAMS,YAAY,GAAIJ,EAAU,IAAc;EACnD,IAAIP,KAAK,CAACY,MAAM,KAAK,CAAC,EAAE;IACtB,OAAO,IAAI;EACb;EAEA,MAAMC,GAAG,GAAGb,KAAK,CAACc,MAAM,CAAC,CAACC,OAAO,EAAEL,KAAK,KACtCA,KAAK,CAACJ,MAAM,GAAGS,OAAO,CAACT,MAAM,IAC5BI,KAAK,CAACJ,MAAM,KAAKS,OAAO,CAACT,MAAM,IAAII,KAAK,CAACH,EAAE,GAAGQ,OAAO,CAACR,EAAG,GACtDG,KAAK,GACLK,OACN,CAAC;EAED,OAAOF,GAAG,CAACN,EAAE,KAAKA,EAAE;AACtB,CAAC;AAED,OAAO,MAAMS,mBAAmB,GAAIZ,QAAkB,IAAmB;EACvEN,SAAS,CAACmB,GAAG,CAACb,QAAQ,CAAC;EAEvB,OAAO,MAAY;IACjBN,SAAS,CAACoB,MAAM,CAACd,QAAQ,CAAC;EAC5B,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../../src/components/Sheet/Sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAMZ,aAAa,EAGd,MAAM,OAAO,CAAC;AAoBf,UAAU,YAAY;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,EAAE,KAAK,CAAC,Y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,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAChD,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IACvC,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAID,eAAO,MAAM,KAAK,oHAgKjB,CAAC"}
|
|
@@ -2,9 +2,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["children", "onClose", "controls", "open", "animation", "position", "mode", "disableFocusLock", "disableScrollLock", "disableBackgroundColor", "bodyStyle", "bodyClassName", "disableBackgroundClick"];
|
|
4
4
|
import React, { useCallback, useEffect, forwardRef, useState, useImperativeHandle } from "react";
|
|
5
|
-
import { Transition } from "react-transition-group";
|
|
6
5
|
import classnames from "classnames";
|
|
7
|
-
import { StyledAnimatedSpan, StyledCssTransition, StyledHeader, StyledIconsWrapperSmall, StyledListSeparator, StyledSheetIcons, StyledSheetWrapper, StyledSheetWrapperPaper } from "./Styles";
|
|
6
|
+
import { StyledAnimatedSpan, StyledCssTransition, StyledHeader, StyledIconsWrapperSmall, StyledListSeparator, StyledSheetIcons, StyledSheetWrapper, StyledSheetSurface, StyledSheetWrapperPaper } from "./Styles";
|
|
8
7
|
import { IconButton } from "../IconButton";
|
|
9
8
|
import { Overlay } from "../Overlay";
|
|
10
9
|
import { Tooltip } from "../Tooltip";
|
|
@@ -76,45 +75,30 @@ export const Sheet = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
76
75
|
style: bodyStyle,
|
|
77
76
|
$position: position,
|
|
78
77
|
$mode: mode
|
|
79
|
-
},
|
|
78
|
+
}, /*#__PURE__*/React.createElement(StyledCssTransition, {
|
|
79
|
+
appear: true,
|
|
80
|
+
in: open,
|
|
81
|
+
timeout: 400,
|
|
82
|
+
classNames: "c-sheet__animation",
|
|
83
|
+
$direction: animation,
|
|
84
|
+
onEnter: handleEnter,
|
|
85
|
+
onExited: handleExited
|
|
86
|
+
}, /*#__PURE__*/React.createElement(StyledSheetSurface, null, controls.length > 0 && /*#__PURE__*/React.createElement(StyledSheetIcons, null, controls.map((_ref2, index) => {
|
|
80
87
|
let IconComponent = _ref2.icon,
|
|
81
88
|
tooltip = _ref2.tooltip,
|
|
82
89
|
onClick = _ref2.onClick,
|
|
83
90
|
disabled = _ref2.disabled,
|
|
84
91
|
className = _ref2.className;
|
|
85
|
-
|
|
86
|
-
const maxDurationOut = 2;
|
|
87
|
-
const control = index + 1;
|
|
88
|
-
const durationOut = Math.max(0, maxDurationOut - control);
|
|
89
|
-
const durationIn = Math.min(control, maxDurationIn);
|
|
90
|
-
return /*#__PURE__*/React.createElement(Transition, {
|
|
91
|
-
appear: true,
|
|
92
|
-
in: open,
|
|
93
|
-
timeout: maxDurationIn * 100,
|
|
94
|
-
key: "c-sheet-control-" + index
|
|
95
|
-
}, state => /*#__PURE__*/React.createElement(Tooltip, {
|
|
92
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
96
93
|
title: tooltip,
|
|
97
|
-
disable: !tooltip || disabled
|
|
94
|
+
disable: !tooltip || disabled,
|
|
95
|
+
key: "c-sheet-control-" + index
|
|
98
96
|
}, /*#__PURE__*/React.createElement(StyledAnimatedSpan, {
|
|
99
97
|
onClick: onClick,
|
|
100
98
|
$disabled: disabled,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
$maxDurationIn: maxDurationIn / 10,
|
|
105
|
-
$maxDurationOut: maxDurationOut / 10,
|
|
106
|
-
$durationOut: durationOut / 10,
|
|
107
|
-
$durationIn: durationIn / 10
|
|
108
|
-
}, IconComponent)));
|
|
109
|
-
})), /*#__PURE__*/React.createElement(StyledCssTransition, {
|
|
110
|
-
appear: true,
|
|
111
|
-
in: open,
|
|
112
|
-
timeout: 400,
|
|
113
|
-
classNames: "c-sheet__animation",
|
|
114
|
-
$direction: animation,
|
|
115
|
-
onEnter: handleEnter,
|
|
116
|
-
onExited: handleExited
|
|
117
|
-
}, /*#__PURE__*/React.createElement(StyledSheetWrapperPaper, {
|
|
99
|
+
className: className
|
|
100
|
+
}, IconComponent));
|
|
101
|
+
})), /*#__PURE__*/React.createElement(StyledSheetWrapperPaper, {
|
|
118
102
|
paperClass: "c-sheet__wrapper__paper"
|
|
119
103
|
}, controls.length > 0 && /*#__PURE__*/React.createElement(StyledHeader, null, /*#__PURE__*/React.createElement(StyledIconsWrapperSmall, null, controls.map((_ref3, index) => {
|
|
120
104
|
let IconComponent = _ref3.icon,
|
|
@@ -132,7 +116,7 @@ export const Sheet = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
132
116
|
className: className,
|
|
133
117
|
variant: "text gray"
|
|
134
118
|
}, IconComponent));
|
|
135
|
-
})), /*#__PURE__*/React.createElement(StyledListSeparator, null)), children))));
|
|
119
|
+
})), /*#__PURE__*/React.createElement(StyledListSeparator, null)), children)))));
|
|
136
120
|
});
|
|
137
121
|
Sheet.displayName = "Sheet";
|
|
138
122
|
//# sourceMappingURL=Sheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.js","names":["React","useCallback","useEffect","forwardRef","useState","useImperativeHandle","Transition","classnames","StyledAnimatedSpan","StyledCssTransition","StyledHeader","StyledIconsWrapperSmall","StyledListSeparator","StyledSheetIcons","StyledSheetWrapper","StyledSheetWrapperPaper","IconButton","Overlay","Tooltip","Window","Sheet","_ref","ref","children","onClose","_ref$controls","controls","_ref$open","open","defaultOpen","_ref$animation","animation","_ref$position","position","_ref$mode","mode","_ref$disableFocusLock","disableFocusLock","_ref$disableScrollLoc","disableScrollLock","_ref$disableBackgroun","disableBackgroundColor","bodyStyle","bodyClassName","_ref$disableBackgroun2","disableBackgroundClick","rest","_objectWithoutPropertiesLoose","_excluded","_useState","setOpen","_useState2","exited","setExited","handleEnter","handleExited","handleClose","handleBackgroundClick","event","preventDefault","close","createElement","_extends","onClick","className","style","$position","$mode","length","map","_ref2","index","IconComponent","icon","tooltip","disabled","maxDurationIn","maxDurationOut","control","durationOut","Math","max","durationIn","min","appear","in","timeout","key","state","title","disable","$disabled","$state","$maxDurationIn","$maxDurationOut","$durationOut","$durationIn","classNames","$direction","onEnter","onExited","paperClass","_ref3","variant","displayName"],"sources":["../../../../src/components/Sheet/Sheet.tsx"],"sourcesContent":["import React, {\n useCallback,\n useEffect,\n forwardRef,\n HTMLAttributes,\n useState,\n CSSProperties,\n MouseEvent,\n useImperativeHandle,\n} from \"react\";\nimport { Transition } from \"react-transition-group\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledAnimatedSpan,\n StyledCssTransition,\n StyledHeader,\n StyledIconsWrapperSmall,\n StyledListSeparator,\n StyledSheetIcons,\n StyledSheetWrapper,\n StyledSheetWrapperPaper,\n} from \"./Styles\";\nimport { IconButton } from \"../IconButton\";\nimport { Overlay } from \"../Overlay\";\nimport { Tooltip } from \"../Tooltip\";\nimport { Window } from \"../Window\";\n\ninterface ControlProps {\n onClick: () => void;\n icon: React.ReactElement;\n tooltip: string;\n disabled: boolean;\n className: string;\n}\n\ninterface ISheet {\n onClose?: () => void;\n controls?: ControlProps[];\n open?: boolean;\n animation?: \"top\" | \"bottom\" | \"left\" | \"right\";\n position?: \"center\" | \"left\" | \"right\";\n mode?: \"normal\" | \"stretch\";\n disableFocusLock?: boolean;\n disableScrollLock?: boolean;\n disableBackgroundColor?: boolean;\n bodyStyle?: CSSProperties;\n bodyClassName?: string;\n disableBackgroundClick?: boolean;\n}\n\nexport interface SheetMethods {\n close: () => void;\n}\n\ntype SheetProps = ISheet & HTMLAttributes<HTMLDivElement>;\n\nexport const Sheet = forwardRef<SheetMethods, SheetProps>(\n (\n {\n children,\n onClose,\n controls = [],\n open: defaultOpen = false,\n animation = \"top\",\n position = \"center\",\n mode = \"normal\",\n disableFocusLock = false,\n disableScrollLock = false,\n disableBackgroundColor = false,\n bodyStyle,\n bodyClassName,\n disableBackgroundClick = false,\n ...rest\n },\n ref\n ) => {\n const [open, setOpen] = useState(defaultOpen);\n const [exited, setExited] = useState(true);\n\n useEffect(() => {\n setOpen(defaultOpen);\n }, [defaultOpen]);\n\n const handleEnter = useCallback(() => {\n setExited(false);\n }, []);\n\n const handleExited = useCallback(() => {\n setExited(true);\n onClose?.();\n }, [onClose]);\n\n const handleClose = useCallback(() => {\n setOpen(false);\n }, []);\n\n const handleBackgroundClick = useCallback(\n (event: MouseEvent<HTMLDivElement>) => {\n if (!disableBackgroundClick) {\n event.preventDefault();\n handleClose();\n }\n },\n [disableBackgroundClick, handleClose]\n );\n\n useImperativeHandle(ref, () => ({\n close: handleClose,\n }));\n\n if (!open && exited) {\n return null;\n }\n\n return (\n <Window\n {...rest}\n onClose={handleClose}\n disableFocusLock={disableFocusLock}\n disableScrollLock={disableScrollLock}\n >\n {open && (\n <Overlay\n onClick={handleBackgroundClick}\n disableBackgroundColor={disableBackgroundColor}\n />\n )}\n <StyledSheetWrapper\n className={classnames(\"c-sheet__wrapper\", bodyClassName)}\n style={bodyStyle}\n $position={position}\n $mode={mode}\n >\n {controls.length > 0 && (\n <StyledSheetIcons>\n {controls.map(\n (\n {\n icon: IconComponent,\n tooltip,\n onClick,\n disabled,\n className,\n },\n index\n ) => {\n const maxDurationIn = 4;\n const maxDurationOut = 2;\n const control = index + 1;\n const durationOut = Math.max(0, maxDurationOut - control);\n const durationIn = Math.min(control, maxDurationIn);\n\n return (\n <Transition\n appear\n in={open}\n timeout={maxDurationIn * 100}\n key={`c-sheet-control-${index}`}\n >\n {(state) => (\n <Tooltip title={tooltip} disable={!tooltip || disabled}>\n <StyledAnimatedSpan\n onClick={onClick}\n $disabled={disabled}\n $mode={mode}\n $state={state}\n className={className}\n $maxDurationIn={maxDurationIn / 10}\n $maxDurationOut={maxDurationOut / 10}\n $durationOut={durationOut / 10}\n $durationIn={durationIn / 10}\n >\n {IconComponent}\n </StyledAnimatedSpan>\n </Tooltip>\n )}\n </Transition>\n );\n }\n )}\n </StyledSheetIcons>\n )}\n <StyledCssTransition\n appear\n in={open}\n timeout={400}\n classNames=\"c-sheet__animation\"\n $direction={animation}\n onEnter={handleEnter}\n onExited={handleExited}\n >\n <StyledSheetWrapperPaper paperClass=\"c-sheet__wrapper__paper\">\n {controls.length > 0 && (\n <StyledHeader>\n <StyledIconsWrapperSmall>\n {controls.map(\n (\n {\n icon: IconComponent,\n tooltip,\n onClick,\n disabled,\n className,\n },\n index\n ) => (\n <Tooltip\n title={tooltip}\n disable={!tooltip || disabled}\n key={index}\n >\n <IconButton\n onClick={onClick}\n disabled={disabled}\n className={className}\n variant=\"text gray\"\n >\n {IconComponent}\n </IconButton>\n </Tooltip>\n )\n )}\n </StyledIconsWrapperSmall>\n <StyledListSeparator />\n </StyledHeader>\n )}\n {children}\n </StyledSheetWrapperPaper>\n </StyledCssTransition>\n </StyledSheetWrapper>\n </Window>\n );\n }\n);\n\nSheet.displayName = \"Sheet\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IACVC,WAAW,EACXC,SAAS,EACTC,UAAU,EAEVC,QAAQ,EAGRC,mBAAmB,QACd,OAAO;AACd,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,kBAAkB,EAClBC,mBAAmB,EACnBC,YAAY,EACZC,uBAAuB,EACvBC,mBAAmB,EACnBC,gBAAgB,EAChBC,kBAAkB,EAClBC,uBAAu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AA,CAAA6D,aAAA,CAAC3C,OAAO;MACNuE,KAAK,EAAEf,OAAQ;MACfgB,OAAO,EAAE,CAAChB,OAAO,IAAIC,QAAS;MAC9BY,GAAG,EAAEhB;IAAM,gBAEXvE,KAAA,CAAA6D,aAAA,CAAC7C,UAAU;MACT+C,OAAO,EAAEA,OAAQ;MACjBY,QAAQ,EAAEA,QAAS;MACnBX,SAAS,EAAEA,SAAU;MACrBuC,OAAO,EAAC;IAAW,GAElB/B,aACS,CACL,CAAC;EAAA,CAEd,CACuB,CAAC,eAC1BxE,KAAA,CAAA6D,aAAA,CAACjD,mBAAmB,MAAE,CACV,CACf,EACAW,QACsB,CACN,CACH,CACd,CAAC;AAEb,CACF,CAAC;AAEDH,KAAK,CAACoF,WAAW,GAAG,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Sheet.js","names":["React","useCallback","useEffect","forwardRef","useState","useImperativeHandle","classnames","StyledAnimatedSpan","StyledCssTransition","StyledHeader","StyledIconsWrapperSmall","StyledListSeparator","StyledSheetIcons","StyledSheetWrapper","StyledSheetSurface","StyledSheetWrapperPaper","IconButton","Overlay","Tooltip","Window","Sheet","_ref","ref","children","onClose","_ref$controls","controls","_ref$open","open","defaultOpen","_ref$animation","animation","_ref$position","position","_ref$mode","mode","_ref$disableFocusLock","disableFocusLock","_ref$disableScrollLoc","disableScrollLock","_ref$disableBackgroun","disableBackgroundColor","bodyStyle","bodyClassName","_ref$disableBackgroun2","disableBackgroundClick","rest","_objectWithoutPropertiesLoose","_excluded","_useState","setOpen","_useState2","exited","setExited","handleEnter","handleExited","handleClose","handleBackgroundClick","event","preventDefault","close","createElement","_extends","onClick","className","style","$position","$mode","appear","in","timeout","classNames","$direction","onEnter","onExited","length","map","_ref2","index","IconComponent","icon","tooltip","disabled","title","disable","key","$disabled","paperClass","_ref3","variant","displayName"],"sources":["../../../../src/components/Sheet/Sheet.tsx"],"sourcesContent":["import React, {\n useCallback,\n useEffect,\n forwardRef,\n HTMLAttributes,\n useState,\n CSSProperties,\n MouseEvent,\n useImperativeHandle,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledAnimatedSpan,\n StyledCssTransition,\n StyledHeader,\n StyledIconsWrapperSmall,\n StyledListSeparator,\n StyledSheetIcons,\n StyledSheetWrapper,\n StyledSheetSurface,\n StyledSheetWrapperPaper,\n} from \"./Styles\";\nimport { IconButton } from \"../IconButton\";\nimport { Overlay } from \"../Overlay\";\nimport { Tooltip } from \"../Tooltip\";\nimport { Window } from \"../Window\";\n\ninterface ControlProps {\n onClick: () => void;\n icon: React.ReactElement;\n tooltip: string;\n disabled: boolean;\n className: string;\n}\n\ninterface ISheet {\n onClose?: () => void;\n controls?: ControlProps[];\n open?: boolean;\n animation?: \"top\" | \"bottom\" | \"left\" | \"right\";\n position?: \"center\" | \"left\" | \"right\";\n mode?: \"normal\" | \"stretch\";\n disableFocusLock?: boolean;\n disableScrollLock?: boolean;\n disableBackgroundColor?: boolean;\n bodyStyle?: CSSProperties;\n bodyClassName?: string;\n disableBackgroundClick?: boolean;\n}\n\nexport interface SheetMethods {\n close: () => void;\n}\n\ntype SheetProps = ISheet & HTMLAttributes<HTMLDivElement>;\n\nexport const Sheet = forwardRef<SheetMethods, SheetProps>(\n (\n {\n children,\n onClose,\n controls = [],\n open: defaultOpen = false,\n animation = \"top\",\n position = \"center\",\n mode = \"normal\",\n disableFocusLock = false,\n disableScrollLock = false,\n disableBackgroundColor = false,\n bodyStyle,\n bodyClassName,\n disableBackgroundClick = false,\n ...rest\n },\n ref\n ) => {\n const [open, setOpen] = useState(defaultOpen);\n const [exited, setExited] = useState(true);\n\n useEffect(() => {\n setOpen(defaultOpen);\n }, [defaultOpen]);\n\n const handleEnter = useCallback(() => {\n setExited(false);\n }, []);\n\n const handleExited = useCallback(() => {\n setExited(true);\n onClose?.();\n }, [onClose]);\n\n const handleClose = useCallback(() => {\n setOpen(false);\n }, []);\n\n const handleBackgroundClick = useCallback(\n (event: MouseEvent<HTMLDivElement>) => {\n if (!disableBackgroundClick) {\n event.preventDefault();\n handleClose();\n }\n },\n [disableBackgroundClick, handleClose]\n );\n\n useImperativeHandle(ref, () => ({\n close: handleClose,\n }));\n\n if (!open && exited) {\n return null;\n }\n\n return (\n <Window\n {...rest}\n onClose={handleClose}\n disableFocusLock={disableFocusLock}\n disableScrollLock={disableScrollLock}\n >\n {open && (\n <Overlay\n onClick={handleBackgroundClick}\n disableBackgroundColor={disableBackgroundColor}\n />\n )}\n <StyledSheetWrapper\n className={classnames(\"c-sheet__wrapper\", bodyClassName)}\n style={bodyStyle}\n $position={position}\n $mode={mode}\n >\n <StyledCssTransition\n appear\n in={open}\n timeout={400}\n classNames=\"c-sheet__animation\"\n $direction={animation}\n onEnter={handleEnter}\n onExited={handleExited}\n >\n <StyledSheetSurface>\n {controls.length > 0 && (\n <StyledSheetIcons>\n {controls.map(\n (\n {\n icon: IconComponent,\n tooltip,\n onClick,\n disabled,\n className,\n },\n index\n ) => (\n <Tooltip\n title={tooltip}\n disable={!tooltip || disabled}\n key={`c-sheet-control-${index}`}\n >\n <StyledAnimatedSpan\n onClick={onClick}\n $disabled={disabled}\n className={className}\n >\n {IconComponent}\n </StyledAnimatedSpan>\n </Tooltip>\n )\n )}\n </StyledSheetIcons>\n )}\n <StyledSheetWrapperPaper paperClass=\"c-sheet__wrapper__paper\">\n {controls.length > 0 && (\n <StyledHeader>\n <StyledIconsWrapperSmall>\n {controls.map(\n (\n {\n icon: IconComponent,\n tooltip,\n onClick,\n disabled,\n className,\n },\n index\n ) => (\n <Tooltip\n title={tooltip}\n disable={!tooltip || disabled}\n key={index}\n >\n <IconButton\n onClick={onClick}\n disabled={disabled}\n className={className}\n variant=\"text gray\"\n >\n {IconComponent}\n </IconButton>\n </Tooltip>\n )\n )}\n </StyledIconsWrapperSmall>\n <StyledListSeparator />\n </StyledHeader>\n )}\n {children}\n </StyledSheetWrapperPaper>\n </StyledSheetSurface>\n </StyledCssTransition>\n </StyledSheetWrapper>\n </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AAW,GAElBV,aACS,CACL,CAAC;EAAA,CAEd,CACuB,CAAC,eAC1B/E,KAAA,CAAA6D,aAAA,CAAClD,mBAAmB,MAAE,CACV,CACf,EACAY,QACsB,CACP,CACD,CACH,CACd,CAAC;AAEb,CACF,CAAC;AAEDH,KAAK,CAACsE,WAAW,GAAG,OAAO","ignoreList":[]}
|
|
@@ -8,18 +8,9 @@ export declare const StyledSheetWrapper: import("styled-components").StyledCompo
|
|
|
8
8
|
interface IStyledSheetWrapperPaper {
|
|
9
9
|
paperClass?: string;
|
|
10
10
|
}
|
|
11
|
+
export declare const StyledSheetSurface: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
12
|
export declare const StyledSheetWrapperPaper: import("styled-components").StyledComponent<"div", any, IStyledSheetWrapperPaper, never>;
|
|
12
|
-
export declare const StyledSheetControlsTop: import("styled-components").Keyframes;
|
|
13
|
-
export declare const StyledSheetControlsBottom: import("styled-components").Keyframes;
|
|
14
|
-
export declare const StyledSheetControlsCenterIn: import("styled-components").Keyframes;
|
|
15
|
-
export declare const StyledSheetControlsCenterOut: import("styled-components").Keyframes;
|
|
16
13
|
interface IStyledAnimatedSpan {
|
|
17
|
-
$mode: string;
|
|
18
|
-
$state?: string;
|
|
19
|
-
$maxDurationIn: number;
|
|
20
|
-
$maxDurationOut: number;
|
|
21
|
-
$durationOut: number;
|
|
22
|
-
$durationIn: number;
|
|
23
14
|
$disabled?: boolean;
|
|
24
15
|
}
|
|
25
16
|
export declare const StyledAnimatedSpan: import("styled-components").StyledComponent<"span", any, IStyledAnimatedSpan, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Sheet/Styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AASvD,eAAO,MAAM,gBAAgB,oEA2B5B,CAAC;AAIF,UAAU,mBAAmB;IAC3B,SAAS,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IACxC,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B;AAED,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Sheet/Styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AASvD,eAAO,MAAM,gBAAgB,oEA2B5B,CAAC;AAIF,UAAU,mBAAmB;IAC3B,SAAS,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IACxC,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B;AAED,eAAO,MAAM,kBAAkB,qFAiG9B,CAAC;AAIF,UAAU,wBAAwB;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,kBAAkB,oEAM9B,CAAC;AAIF,eAAO,MAAM,uBAAuB,0FAkBnC,CAAC;AAIF,UAAU,mBAAmB;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,kBAAkB,sFAc9B,CAAC;AAIF,eAAO,MAAM,mBAAmB;gBAClB,MAAM;SA6HnB,CAAC;AAIF,eAAO,MAAM,mBAAmB;;;kBAE/B,CAAC;AAIF,eAAO,MAAM,uBAAuB,oEASnC,CAAC;AAIF,eAAO,MAAM,YAAY,oEAIxB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSTransition } from "react-transition-group";
|
|
2
|
-
import styled, { css
|
|
2
|
+
import styled, { css } from "styled-components";
|
|
3
3
|
import { BoxSizingStyle } from "../BoxSizingStyle";
|
|
4
4
|
import { FontStyle } from "../FontStyle";
|
|
5
5
|
import { ListSeparator } from "../List";
|
|
@@ -11,7 +11,7 @@ StyledSheetIcons.displayName = "StyledSheetIcons";
|
|
|
11
11
|
export const StyledSheetWrapper = styled.div.withConfig({
|
|
12
12
|
displayName: "Styles__StyledSheetWrapper",
|
|
13
13
|
componentId: "sc-144eyxd-1"
|
|
14
|
-
})(["", " ", " position:relative;max-width:95vw;display:flex;flex-direction:row;", " ", " ", " ", " ", " ", " ", ""], BoxSizingStyle, FontStyle, props => props.$mode === "stretch" ? css(["margin-top:8px;height:calc(100vh - 16px);width:calc(100vw - 100px);max-width:1000px;", "{flex-direction:column;width:0;height:calc(100vh - 32px);& > *{margin-bottom:8px;
|
|
14
|
+
})(["", " ", " position:relative;max-width:95vw;display:flex;flex-direction:row;", " ", " ", " ", " ", " ", " ", ""], BoxSizingStyle, FontStyle, props => props.$mode === "stretch" ? css(["margin-top:8px;height:calc(100vh - 16px);width:calc(100vw - 100px);max-width:1000px;", "{flex-direction:column;width:0;height:calc(100vh - 32px);& > *{margin-bottom:8px;}span{top:8px;}}"], StyledSheetIcons) : css(["max-height:calc(100vh - 156px);margin-top:126px;margin-bottom:30px;width:540px;flex-direction:column;", "{flex-direction:row-reverse;& > *{margin-left:8px;}span{top:-48px;right:8px;}}"], StyledSheetIcons), props => props.$mode === "stretch" && css(["@media (max-width:640px){width:100%;height:100%;}"]), props => props.$position === "center" && css(["", ""], {
|
|
15
15
|
"marginLeft": "auto",
|
|
16
16
|
"marginRight": "auto"
|
|
17
17
|
}), props => props.$position === "left" && css(["", ""], {
|
|
@@ -22,42 +22,43 @@ export const StyledSheetWrapper = styled.div.withConfig({
|
|
|
22
22
|
"marginRight": "0.5rem"
|
|
23
23
|
}), props => props.$mode === "stretch" && props.$position !== "left" && css(["", "{span{right:48px;}}"], StyledSheetIcons), props => props.$mode === "stretch" && props.$position === "left" && css(["flex-direction:row-reverse;", "{span{right:-8px;}}"], StyledSheetIcons));
|
|
24
24
|
StyledSheetWrapper.displayName = "StyledSheetWrapper";
|
|
25
|
+
export const StyledSheetSurface = styled.div.withConfig({
|
|
26
|
+
displayName: "Styles__StyledSheetSurface",
|
|
27
|
+
componentId: "sc-144eyxd-2"
|
|
28
|
+
})(["display:flex;flex-direction:inherit;flex:1 1 auto;min-width:0;min-height:0;"]);
|
|
29
|
+
StyledSheetSurface.displayName = "StyledSheetSurface";
|
|
25
30
|
export const StyledSheetWrapperPaper = styled.div.attrs(props => ({
|
|
26
31
|
className: props.paperClass
|
|
27
32
|
})).withConfig({
|
|
28
33
|
displayName: "Styles__StyledSheetWrapperPaper",
|
|
29
|
-
componentId: "sc-144eyxd-
|
|
30
|
-
})(["background-color:var(--page-paper-main);color:var(--color-theme-900);box-shadow:var(--shadow-primary);border-radius:6px;overflow:auto;animation:0.3s linear ease-out;", ""], {
|
|
34
|
+
componentId: "sc-144eyxd-3"
|
|
35
|
+
})(["background-color:var(--page-paper-main);color:var(--color-theme-900);box-shadow:var(--shadow-primary);border-radius:6px;overflow:auto;animation:0.3s linear ease-out;transform:translateZ(0);contain:paint;overscroll-behavior:contain;", ""], {
|
|
31
36
|
"flex": "1 1 auto"
|
|
32
37
|
});
|
|
33
38
|
StyledSheetWrapperPaper.displayName = "StyledSheetWrapperPaper";
|
|
34
|
-
export const StyledSheetControlsTop = keyframes(["0%{opacity:0;transform:translateY(-200px);}100%{opacity:1;transform:translateY(0);}"]);
|
|
35
|
-
export const StyledSheetControlsBottom = keyframes(["0%{opacity:1;transform:translateY(0);}100%{opacity:0;transform:translateY(-200px);}"]);
|
|
36
|
-
export const StyledSheetControlsCenterIn = keyframes(["0%{transform:translateY(-150px);opacity:0;}100%{transform:translateY(0);opacity:1;}"]);
|
|
37
|
-
export const StyledSheetControlsCenterOut = keyframes(["0%{transform:translateY(0);opacity:1;}100%{transform:translateY(-150px);opacity:0;}"]);
|
|
38
39
|
export const StyledAnimatedSpan = styled.span.withConfig({
|
|
39
40
|
displayName: "Styles__StyledAnimatedSpan",
|
|
40
|
-
componentId: "sc-144eyxd-
|
|
41
|
-
})(["&:hover svg{fill:var(--color-primary);}", "
|
|
41
|
+
componentId: "sc-144eyxd-4"
|
|
42
|
+
})(["&:hover svg{fill:var(--color-primary);}", ""], props => props.$disabled && css(["pointer-events:none;svg{opacity:0.5;}"]));
|
|
42
43
|
StyledAnimatedSpan.displayName = "StyledAnimatedSpan";
|
|
43
44
|
export const StyledCssTransition = styled(CSSTransition).withConfig({
|
|
44
45
|
displayName: "Styles__StyledCssTransition",
|
|
45
|
-
componentId: "sc-144eyxd-
|
|
46
|
+
componentId: "sc-144eyxd-5"
|
|
46
47
|
})(["", " ", " ", " ", ""], props => props.$direction === "top" && css(["&.c-sheet__animation-enter{opacity:0;transform:translateY(-100%);}&.c-sheet__animation-enter-active{opacity:1;transform:translateY(0);transition:opacity 400ms,transform 400ms;}&.c-sheet__animation-appear{opacity:0;transform:translateY(-100%);}&.c-sheet__animation-appear-active{opacity:1;transform:translateY(0);transition:opacity 400ms,transform 400ms;}&.c-sheet__animation-exit{opacity:1;}&.c-sheet__animation-exit-active{opacity:0;transform:translateY(-100%);transition:opacity 200ms,transform 200ms;}"]), props => props.$direction === "bottom" && css(["&.c-sheet__animation-enter{opacity:0;transform:translateY(100%);}&.c-sheet__animation-enter-active{opacity:1;transform:translateY(0);transition:opacity 400ms,transform 400ms;}&.c-sheet__animation-appear{opacity:0;transform:translateY(100%);}&.c-sheet__animation-appear-active{opacity:1;transform:translateY(0);transition:opacity 400ms,transform 400ms;}&.c-sheet__animation-exit{opacity:1;}&.c-sheet__animation-exit-active{opacity:0;transform:translateY(100%);transition:opacity 200ms,transform 200ms;}"]), props => props.$direction === "left" && css(["&.c-sheet__animation-enter{opacity:0;transform:translateX(-100%);}&.c-sheet__animation-enter-active{opacity:1;transform:translateX(0);transition:opacity 400ms,transform 400ms;}&.c-sheet__animation-appear{opacity:0;transform:translateX(-100%);}&.c-sheet__animation-appear-active{opacity:1;transform:translateX(0);transition:opacity 400ms,transform 400ms;}&.c-sheet__animation-exit{opacity:1;}&.c-sheet__animation-exit-active{opacity:0;transform:translateX(-100%);transition:opacity 200ms,transform 200ms;}"]), props => props.$direction === "right" && css(["&.c-sheet__animation-enter{opacity:0;transform:translateX(100%);}&.c-sheet__animation-enter-active{opacity:1;transform:translateX(0);transition:opacity 400ms,transform 400ms;}&.c-sheet__animation-appear{opacity:0;transform:translateX(100%);}&.c-sheet__animation-appear-active{opacity:1;transform:translateX(0);transition:opacity 400ms,transform 400ms;}&.c-sheet__animation-exit{opacity:1;}&.c-sheet__animation-exit-active{opacity:0;transform:translateX(100%);transition:opacity 200ms,transform 200ms;}"]));
|
|
47
48
|
StyledCssTransition.displayName = "StyledCssTransition";
|
|
48
49
|
export const StyledListSeparator = styled(ListSeparator).withConfig({
|
|
49
50
|
displayName: "Styles__StyledListSeparator",
|
|
50
|
-
componentId: "sc-144eyxd-
|
|
51
|
+
componentId: "sc-144eyxd-6"
|
|
51
52
|
})(["margin:0;"]);
|
|
52
53
|
StyledListSeparator.displayName = "StyledListSeparator";
|
|
53
54
|
export const StyledIconsWrapperSmall = styled.div.withConfig({
|
|
54
55
|
displayName: "Styles__StyledIconsWrapperSmall",
|
|
55
|
-
componentId: "sc-144eyxd-
|
|
56
|
+
componentId: "sc-144eyxd-7"
|
|
56
57
|
})(["height:40px;display:flex;gap:8px;padding-left:16px;padding-right:16px;align-items:center;place-content:end;flex-direction:row-reverse;"]);
|
|
57
58
|
StyledIconsWrapperSmall.displayName = "StyledIconsWrapperSmall";
|
|
58
59
|
export const StyledHeader = styled.div.withConfig({
|
|
59
60
|
displayName: "Styles__StyledHeader",
|
|
60
|
-
componentId: "sc-144eyxd-
|
|
61
|
+
componentId: "sc-144eyxd-8"
|
|
61
62
|
})(["@media (min-width:640px){display:none;}"]);
|
|
62
63
|
StyledHeader.displayName = "StyledHeader";
|
|
63
64
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["CSSTransition","styled","css","keyframes","BoxSizingStyle","FontStyle","ListSeparator","StyledSheetIcons","div","withConfig","displayName","componentId","StyledSheetWrapper","props","$mode","$position","StyledSheetWrapperPaper","attrs","className","paperClass","StyledSheetControlsTop","StyledSheetControlsBottom","StyledSheetControlsCenterIn","StyledSheetControlsCenterOut","StyledAnimatedSpan","span","$state","$durationIn","$maxDurationIn","$disabled","$durationOut","$maxDurationOut","StyledCssTransition","$direction","StyledListSeparator","StyledIconsWrapperSmall","StyledHeader"],"sources":["../../../../src/components/Sheet/Styles.ts"],"sourcesContent":["import { CSSTransition } from \"react-transition-group\";\n\nimport styled, { css, keyframes } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\nimport { ListSeparator } from \"../List\";\n\nexport const StyledSheetIcons = styled.div`\n display: flex;\n height: 0;\n position: relative;\n\n span {\n position: relative;\n background-color: var(--page-paper-main);\n box-shadow: var(--shadow-secondary);\n cursor: pointer;\n border-radius: 100%;\n width: 40px;\n height: 40px;\n display: flex;\n justify-content: center;\n align-items: center;\n & > * {\n height: 40px;\n width: 40px;\n padding: 8px;\n fill: var(--color-theme-600);\n }\n }\n\n @media (max-width: 640px) {\n display: none;\n }\n`;\n\nStyledSheetIcons.displayName = \"StyledSheetIcons\";\n\ninterface IStyledSheetWrapper {\n $position?: \"center\" | \"left\" | \"right\";\n $mode?: \"normal\" | \"stretch\";\n}\n\nexport const StyledSheetWrapper = styled.div<IStyledSheetWrapper>`\n ${BoxSizingStyle}\n ${FontStyle}\n\n position: relative;\n max-width: 95vw;\n display: flex;\n flex-direction: row;\n\n ${(props) =>\n props.$mode === \"stretch\"\n ? css`\n margin-top: 8px;\n height: calc(100vh - 16px);\n width: calc(100vw - 100px);\n max-width: 1000px;\n ${StyledSheetIcons} {\n flex-direction: column;\n width: 0;\n height: calc(100vh - 32px);\n & > * {\n margin-bottom: 8px;\n animation-fill-mode: both;\n }\n span {\n top: 8px;\n }\n }\n `\n : css`\n max-height: calc(100vh - 156px);\n margin-top: 126px;\n margin-bottom: 30px;\n width: 540px;\n flex-direction: column;\n\n ${StyledSheetIcons} {\n flex-direction: row-reverse;\n & > * {\n margin-left: 8px;\n animation-fill-mode: both;\n }\n span {\n top: -48px;\n right: 8px;\n }\n }\n `}\n\n ${(props) =>\n props.$mode === \"stretch\" &&\n css`\n @media (max-width: 640px) {\n width: 100%;\n height: 100%;\n }\n `}\n\n ${(props) =>\n props.$position === \"center\" &&\n css`\n ${tw`tw-mx-auto`}\n `}\n\n ${(props) =>\n props.$position === \"left\" &&\n css`\n ${tw`tw-ml-2 tw-mr-auto`}\n `}\n\n ${(props) =>\n props.$position === \"right\" &&\n css`\n ${tw`tw-mr-2 tw-ml-auto`}\n `}\n\n ${(props) =>\n props.$mode === \"stretch\" &&\n props.$position !== \"left\" &&\n css`\n ${StyledSheetIcons} {\n span {\n right: 48px;\n }\n }\n `}\n\n ${(props) =>\n props.$mode === \"stretch\" &&\n props.$position === \"left\" &&\n css`\n flex-direction: row-reverse;\n\n ${StyledSheetIcons} {\n span {\n right: -8px;\n }\n }\n `}\n`;\n\nStyledSheetWrapper.displayName = \"StyledSheetWrapper\";\n\ninterface IStyledSheetWrapperPaper {\n paperClass?: string;\n}\n\nexport const StyledSheetWrapperPaper = styled.div.attrs<IStyledSheetWrapperPaper>(\n (props) => ({\n className: props.paperClass,\n })\n)<IStyledSheetWrapperPaper>`\n background-color: var(--page-paper-main);\n color: var(--color-theme-900);\n box-shadow: var(--shadow-primary);\n border-radius: 6px;\n overflow: auto;\n animation: 0.3s linear ease-out;\n\n ${tw`tw-flex-auto`}\n`;\n\nStyledSheetWrapperPaper.displayName = \"StyledSheetWrapperPaper\";\n\nexport const StyledSheetControlsTop = keyframes`\n 0% {\n opacity: 0;\n transform: translateY(-200px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n`;\n\nexport const StyledSheetControlsBottom = keyframes`\n 0% {\n opacity: 1;\n transform: translateY(0);\n }\n 100% {\n opacity: 0;\n transform: translateY(-200px);\n}\n`;\n\nexport const StyledSheetControlsCenterIn = keyframes`\n 0% {\n transform: translateY(-150px);\n opacity: 0;\n }\n 100% {\n transform: translateY(0);\n opacity: 1;\n }\n`;\n\nexport const StyledSheetControlsCenterOut = keyframes`\n 0% {\n transform: translateY(0);\n opacity: 1;\n }\n 100% {\n transform: translateY(-150px);\n opacity: 0;\n }\n`;\n\ninterface IStyledAnimatedSpan {\n $mode: string;\n $state?: string;\n $maxDurationIn: number;\n $maxDurationOut: number;\n $durationOut: number;\n $durationIn: number;\n $disabled?: boolean;\n}\n\nexport const StyledAnimatedSpan = styled.span<IStyledAnimatedSpan>`\n &:hover svg {\n fill: var(--color-primary);\n }\n ${(props) =>\n props.$state === \"entering\" &&\n css`\n opacity: 1;\n\n ${props.$mode === \"stretch\"\n ? css`\n animation-name: ${StyledSheetControlsTop};\n animation-duration: ${`${props.$durationIn}s`};\n animation-delay: ${`${props.$durationIn}s`};\n `\n : css`\n animation-name: ${StyledSheetControlsCenterIn};\n animation-duration: ${`${props.$maxDurationIn}s`};\n animation-delay: 0s;\n `}\n `}\n\n ${(props) =>\n props.$state === \"entered\" &&\n css`\n opacity: 1;\n `}\n\n ${(props) =>\n props.$disabled &&\n css`\n pointer-events: none;\n\n svg {\n opacity: 0.5;\n }\n `}\n\n ${(props) =>\n props.$state === \"exiting\" &&\n css`\n opacity: 0;\n\n ${props.$mode === \"stretch\"\n ? css`\n animation-name: ${StyledSheetControlsBottom};\n animation-duration: ${`${props.$durationOut}s`};\n animation-delay: ${`${props.$durationOut}s`};\n `\n : css`\n animation-name: ${StyledSheetControlsCenterOut};\n animation-duration: ${`${props.$maxDurationOut}s`};\n animation-delay: 0;\n `}\n `}\n\n ${(props) =>\n props.$state === \"exited\" &&\n css`\n opacity: 0;\n `}\n`;\n\nStyledAnimatedSpan.displayName = \"StyledAnimatedSpan\";\n\nexport const StyledCssTransition = styled(CSSTransition)<{\n $direction: string;\n}>`\n ${(props) =>\n props.$direction === \"top\" &&\n css`\n &.c-sheet__animation-enter {\n opacity: 0;\n transform: translateY(-100%);\n }\n &.c-sheet__animation-enter-active {\n opacity: 1;\n transform: translateY(0);\n transition: opacity 400ms, transform 400ms;\n }\n &.c-sheet__animation-appear {\n opacity: 0;\n transform: translateY(-100%);\n }\n &.c-sheet__animation-appear-active {\n opacity: 1;\n transform: translateY(0);\n transition: opacity 400ms, transform 400ms;\n }\n &.c-sheet__animation-exit {\n opacity: 1;\n }\n &.c-sheet__animation-exit-active {\n opacity: 0;\n transform: translateY(-100%);\n transition: opacity 200ms, transform 200ms;\n }\n `}\n\n ${(props) =>\n props.$direction === \"bottom\" &&\n css`\n &.c-sheet__animation-enter {\n opacity: 0;\n transform: translateY(100%);\n }\n &.c-sheet__animation-enter-active {\n opacity: 1;\n transform: translateY(0);\n transition: opacity 400ms, transform 400ms;\n }\n &.c-sheet__animation-appear {\n opacity: 0;\n transform: translateY(100%);\n }\n &.c-sheet__animation-appear-active {\n opacity: 1;\n transform: translateY(0);\n transition: opacity 400ms, transform 400ms;\n }\n &.c-sheet__animation-exit {\n opacity: 1;\n }\n &.c-sheet__animation-exit-active {\n opacity: 0;\n transform: translateY(100%);\n transition: opacity 200ms, transform 200ms;\n }\n `}\n\n ${(props) =>\n props.$direction === \"left\" &&\n css`\n &.c-sheet__animation-enter {\n opacity: 0;\n transform: translateX(-100%);\n }\n &.c-sheet__animation-enter-active {\n opacity: 1;\n transform: translateX(0);\n transition: opacity 400ms, transform 400ms;\n }\n &.c-sheet__animation-appear {\n opacity: 0;\n transform: translateX(-100%);\n }\n &.c-sheet__animation-appear-active {\n opacity: 1;\n transform: translateX(0);\n transition: opacity 400ms, transform 400ms;\n }\n &.c-sheet__animation-exit {\n opacity: 1;\n }\n &.c-sheet__animation-exit-active {\n opacity: 0;\n transform: translateX(-100%);\n transition: opacity 200ms, transform 200ms;\n }\n `}\n\n ${(props) =>\n props.$direction === \"right\" &&\n css`\n &.c-sheet__animation-enter {\n opacity: 0;\n transform: translateX(100%);\n }\n &.c-sheet__animation-enter-active {\n opacity: 1;\n transform: translateX(0);\n transition: opacity 400ms, transform 400ms;\n }\n &.c-sheet__animation-appear {\n opacity: 0;\n transform: translateX(100%);\n }\n &.c-sheet__animation-appear-active {\n opacity: 1;\n transform: translateX(0);\n transition: opacity 400ms, transform 400ms;\n }\n &.c-sheet__animation-exit {\n opacity: 1;\n }\n &.c-sheet__animation-exit-active {\n opacity: 0;\n transform: translateX(100%);\n transition: opacity 200ms, transform 200ms;\n }\n `}\n`;\n\nStyledCssTransition.displayName = \"StyledCssTransition\";\n\nexport const StyledListSeparator = styled(ListSeparator)`\n margin: 0;\n`;\n\nStyledListSeparator.displayName = \"StyledListSeparator\";\n\nexport const StyledIconsWrapperSmall = styled.div`\n height: 40px;\n display: flex;\n gap: 8px;\n padding-left: 16px;\n padding-right: 16px;\n align-items: center;\n place-content: end;\n flex-direction: row-reverse;\n`;\n\nStyledIconsWrapperSmall.displayName = \"StyledIconsWrapperSmall\";\n\nexport const StyledHeader = styled.div`\n @media (min-width: 640px) {\n display: none;\n }\n`;\n\nStyledHeader.displayName = \"StyledHeader\";\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,wBAAwB;AAEtD,OAAOC,MAAM,IAAIC,GAAG,EAAEC,SAAS,QAAQ,mBAAmB;AAG1D,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,aAAa,QAAQ,SAAS;AAEvC,OAAO,MAAMC,gBAAgB,GAAGN,MAAM,CAACO,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,gXA2BzC;AAEDJ,gBAAgB,CAACG,WAAW,GAAG,kBAAkB;AAOjD,OAAO,MAAME,kBAAkB,GAAGX,MAAM,CAACO,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,sHACxCP,cAAc,EACdC,SAAS,EAORQ,KAAK,IACNA,KAAK,CAACC,KAAK,KAAK,SAAS,GACrBZ,GAAG,yNAKCK,gBAAgB,IAapBL,GAAG,uNAOCK,gBAAgB,CAWnB,EAEJM,KAAK,IACNA,KAAK,CAACC,KAAK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GAAGjC,MAAM,CAACK,aAAa,CAAC,CAAAG,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,iBAEvD;AAEDuB,mBAAmB,CAACxB,WAAW,GAAG,qBAAqB;AAEvD,OAAO,MAAMyB,uBAAuB,GAAGlC,MAAM,CAACO,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,8IAShD;AAEDwB,uBAAuB,CAACzB,WAAW,GAAG,yBAAyB;AAE/D,OAAO,MAAM0B,YAAY,GAAGnC,MAAM,CAACO,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,+CAIrC;AAEDyB,YAAY,CAAC1B,WAAW,GAAG,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["CSSTransition","styled","css","BoxSizingStyle","FontStyle","ListSeparator","StyledSheetIcons","div","withConfig","displayName","componentId","StyledSheetWrapper","props","$mode","$position","StyledSheetSurface","StyledSheetWrapperPaper","attrs","className","paperClass","StyledAnimatedSpan","span","$disabled","StyledCssTransition","$direction","StyledListSeparator","StyledIconsWrapperSmall","StyledHeader"],"sources":["../../../../src/components/Sheet/Styles.ts"],"sourcesContent":["import { CSSTransition } from \"react-transition-group\";\n\nimport styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\nimport { ListSeparator } from \"../List\";\n\nexport const StyledSheetIcons = styled.div`\n display: flex;\n height: 0;\n position: relative;\n\n span {\n position: relative;\n background-color: var(--page-paper-main);\n box-shadow: var(--shadow-secondary);\n cursor: pointer;\n border-radius: 100%;\n width: 40px;\n height: 40px;\n display: flex;\n justify-content: center;\n align-items: center;\n & > * {\n height: 40px;\n width: 40px;\n padding: 8px;\n fill: var(--color-theme-600);\n }\n }\n\n @media (max-width: 640px) {\n display: none;\n }\n`;\n\nStyledSheetIcons.displayName = \"StyledSheetIcons\";\n\ninterface IStyledSheetWrapper {\n $position?: \"center\" | \"left\" | \"right\";\n $mode?: \"normal\" | \"stretch\";\n}\n\nexport const StyledSheetWrapper = styled.div<IStyledSheetWrapper>`\n ${BoxSizingStyle}\n ${FontStyle}\n\n position: relative;\n max-width: 95vw;\n display: flex;\n flex-direction: row;\n\n ${(props) =>\n props.$mode === \"stretch\"\n ? css`\n margin-top: 8px;\n height: calc(100vh - 16px);\n width: calc(100vw - 100px);\n max-width: 1000px;\n ${StyledSheetIcons} {\n flex-direction: column;\n width: 0;\n height: calc(100vh - 32px);\n & > * {\n margin-bottom: 8px;\n }\n span {\n top: 8px;\n }\n }\n `\n : css`\n max-height: calc(100vh - 156px);\n margin-top: 126px;\n margin-bottom: 30px;\n width: 540px;\n flex-direction: column;\n\n ${StyledSheetIcons} {\n flex-direction: row-reverse;\n & > * {\n margin-left: 8px;\n }\n span {\n top: -48px;\n right: 8px;\n }\n }\n `}\n\n ${(props) =>\n props.$mode === \"stretch\" &&\n css`\n @media (max-width: 640px) {\n width: 100%;\n height: 100%;\n }\n `}\n\n ${(props) =>\n props.$position === \"center\" &&\n css`\n ${tw`tw-mx-auto`}\n `}\n\n ${(props) =>\n props.$position === \"left\" &&\n css`\n ${tw`tw-ml-2 tw-mr-auto`}\n `}\n\n ${(props) =>\n props.$position === \"right\" &&\n css`\n ${tw`tw-mr-2 tw-ml-auto`}\n `}\n\n ${(props) =>\n props.$mode === \"stretch\" &&\n props.$position !== \"left\" &&\n css`\n ${StyledSheetIcons} {\n span {\n right: 48px;\n }\n }\n `}\n\n ${(props) =>\n props.$mode === \"stretch\" &&\n props.$position === \"left\" &&\n css`\n flex-direction: row-reverse;\n\n ${StyledSheetIcons} {\n span {\n right: -8px;\n }\n }\n `}\n`;\n\nStyledSheetWrapper.displayName = \"StyledSheetWrapper\";\n\ninterface IStyledSheetWrapperPaper {\n paperClass?: string;\n}\n\nexport const StyledSheetSurface = styled.div`\n display: flex;\n flex-direction: inherit;\n flex: 1 1 auto;\n min-width: 0;\n min-height: 0;\n`;\n\nStyledSheetSurface.displayName = \"StyledSheetSurface\";\n\nexport const StyledSheetWrapperPaper = styled.div.attrs<IStyledSheetWrapperPaper>(\n (props) => ({\n className: props.paperClass,\n })\n)<IStyledSheetWrapperPaper>`\n background-color: var(--page-paper-main);\n color: var(--color-theme-900);\n box-shadow: var(--shadow-primary);\n border-radius: 6px;\n overflow: auto;\n animation: 0.3s linear ease-out;\n /* Scrolling here must not dirty the blurred overlays below, which already clip to this box. */\n transform: translateZ(0);\n contain: paint;\n /* A scroll that runs off the end must stop here. Chained to the page, it moves what the blur samples. */\n overscroll-behavior: contain;\n\n ${tw`tw-flex-auto`}\n`;\n\nStyledSheetWrapperPaper.displayName = \"StyledSheetWrapperPaper\";\n\ninterface IStyledAnimatedSpan {\n $disabled?: boolean;\n}\n\nexport const StyledAnimatedSpan = styled.span<IStyledAnimatedSpan>`\n &:hover svg {\n fill: var(--color-primary);\n }\n\n ${(props) =>\n props.$disabled &&\n css`\n pointer-events: none;\n\n svg {\n opacity: 0.5;\n }\n `}\n`;\n\nStyledAnimatedSpan.displayName = \"StyledAnimatedSpan\";\n\nexport const StyledCssTransition = styled(CSSTransition)<{\n $direction: string;\n}>`\n ${(props) =>\n props.$direction === \"top\" &&\n css`\n &.c-sheet__animation-enter {\n opacity: 0;\n transform: translateY(-100%);\n }\n &.c-sheet__animation-enter-active {\n opacity: 1;\n transform: translateY(0);\n transition: opacity 400ms, transform 400ms;\n }\n &.c-sheet__animation-appear {\n opacity: 0;\n transform: translateY(-100%);\n }\n &.c-sheet__animation-appear-active {\n opacity: 1;\n transform: translateY(0);\n transition: opacity 400ms, transform 400ms;\n }\n &.c-sheet__animation-exit {\n opacity: 1;\n }\n &.c-sheet__animation-exit-active {\n opacity: 0;\n transform: translateY(-100%);\n transition: opacity 200ms, transform 200ms;\n }\n `}\n\n ${(props) =>\n props.$direction === \"bottom\" &&\n css`\n &.c-sheet__animation-enter {\n opacity: 0;\n transform: translateY(100%);\n }\n &.c-sheet__animation-enter-active {\n opacity: 1;\n transform: translateY(0);\n transition: opacity 400ms, transform 400ms;\n }\n &.c-sheet__animation-appear {\n opacity: 0;\n transform: translateY(100%);\n }\n &.c-sheet__animation-appear-active {\n opacity: 1;\n transform: translateY(0);\n transition: opacity 400ms, transform 400ms;\n }\n &.c-sheet__animation-exit {\n opacity: 1;\n }\n &.c-sheet__animation-exit-active {\n opacity: 0;\n transform: translateY(100%);\n transition: opacity 200ms, transform 200ms;\n }\n `}\n\n ${(props) =>\n props.$direction === \"left\" &&\n css`\n &.c-sheet__animation-enter {\n opacity: 0;\n transform: translateX(-100%);\n }\n &.c-sheet__animation-enter-active {\n opacity: 1;\n transform: translateX(0);\n transition: opacity 400ms, transform 400ms;\n }\n &.c-sheet__animation-appear {\n opacity: 0;\n transform: translateX(-100%);\n }\n &.c-sheet__animation-appear-active {\n opacity: 1;\n transform: translateX(0);\n transition: opacity 400ms, transform 400ms;\n }\n &.c-sheet__animation-exit {\n opacity: 1;\n }\n &.c-sheet__animation-exit-active {\n opacity: 0;\n transform: translateX(-100%);\n transition: opacity 200ms, transform 200ms;\n }\n `}\n\n ${(props) =>\n props.$direction === \"right\" &&\n css`\n &.c-sheet__animation-enter {\n opacity: 0;\n transform: translateX(100%);\n }\n &.c-sheet__animation-enter-active {\n opacity: 1;\n transform: translateX(0);\n transition: opacity 400ms, transform 400ms;\n }\n &.c-sheet__animation-appear {\n opacity: 0;\n transform: translateX(100%);\n }\n &.c-sheet__animation-appear-active {\n opacity: 1;\n transform: translateX(0);\n transition: opacity 400ms, transform 400ms;\n }\n &.c-sheet__animation-exit {\n opacity: 1;\n }\n &.c-sheet__animation-exit-active {\n opacity: 0;\n transform: translateX(100%);\n transition: opacity 200ms, transform 200ms;\n }\n `}\n`;\n\nStyledCssTransition.displayName = \"StyledCssTransition\";\n\nexport const StyledListSeparator = styled(ListSeparator)`\n margin: 0;\n`;\n\nStyledListSeparator.displayName = \"StyledListSeparator\";\n\nexport const StyledIconsWrapperSmall = styled.div`\n height: 40px;\n display: flex;\n gap: 8px;\n padding-left: 16px;\n padding-right: 16px;\n align-items: center;\n place-content: end;\n flex-direction: row-reverse;\n`;\n\nStyledIconsWrapperSmall.displayName = \"StyledIconsWrapperSmall\";\n\nexport const StyledHeader = styled.div`\n @media (min-width: 640px) {\n display: none;\n }\n`;\n\nStyledHeader.displayName = \"StyledHeader\";\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,wBAAwB;AAEtD,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAG/C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,aAAa,QAAQ,SAAS;AAEvC,OAAO,MAAMC,gBAAgB,GAAGL,MAAM,CAACM,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,gXA2BzC;AAEDJ,gBAAgB,CAACG,WAAW,GAAG,kBAAkB;AAOjD,OAAO,MAAME,kBAAkB,GAAGV,MAAM,CAACM,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,sHACxCP,cAAc,EACdC,SAAS,EAORQ,KAAK,IACNA,KAAK,CAACC,KAAK,KAAK,SAAS,GACrBX,GAAG,gMAKCI,gBAAgB,IAYpBJ,GAAG,8LAOCI,gBAAgB,CAUnB,EAEJM,KAAK,IACNA,KAAK,CAACC,KAAK,KAAK,SAAS,IACzBX,GAAG,uDAKF,EAEAU,KAAK,IACNA,KAAK,CAACE,SAAS,KAAK,QAAQ,IAC5BZ,GAAG,WACG;EAAA;EAAA;AAAW,CAAC,CACjB,EAEAU,KAAK,IACNA,KAAK,CAACE,SAAS,KAAK,MAAM,IAC1BZ,GAAG,WACG;EAAA;EAAA;AAAmB,CAAC,CACzB,EAEAU,KAAK,IACNA,KAAK,CAACE,SAAS,KAAK,OAAO,IAC3BZ,GAAG,WACG;EAAA;EAAA;AAAmB,CAAC,CACzB,EAEAU,KAAK,IACNA,KAAK,CAACC,KAAK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