@activecollab/components 2.0.163 → 2.0.165
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/Input/InputUrl.js +48 -11
- package/dist/cjs/components/Input/InputUrl.js.map +1 -1
- package/dist/cjs/components/Input/Styles.js.map +1 -1
- package/dist/cjs/components/Sheet/Sheet.js +42 -13
- package/dist/cjs/components/Sheet/Sheet.js.map +1 -1
- package/dist/cjs/components/Sheet/Styles.js +24 -4
- package/dist/cjs/components/Sheet/Styles.js.map +1 -1
- package/dist/esm/components/Input/InputUrl.d.ts +1 -0
- package/dist/esm/components/Input/InputUrl.d.ts.map +1 -1
- package/dist/esm/components/Input/InputUrl.js +46 -11
- package/dist/esm/components/Input/InputUrl.js.map +1 -1
- package/dist/esm/components/Input/Styles.d.ts +1 -1
- package/dist/esm/components/Input/Styles.d.ts.map +1 -1
- package/dist/esm/components/Input/Styles.js.map +1 -1
- package/dist/esm/components/Sheet/Sheet.d.ts +8 -1
- package/dist/esm/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/esm/components/Sheet/Sheet.js +47 -14
- package/dist/esm/components/Sheet/Sheet.js.map +1 -1
- package/dist/esm/components/Sheet/Styles.d.ts +9 -1
- package/dist/esm/components/Sheet/Styles.d.ts.map +1 -1
- package/dist/esm/components/Sheet/Styles.js +19 -3
- package/dist/esm/components/Sheet/Styles.js.map +1 -1
- package/dist/index.js +112 -30
- 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,9 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import React, { forwardRef, useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
+
import React, { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { Input } from "./Input";
|
|
4
4
|
import { InputSelect } from "./InputSelect";
|
|
5
|
+
import { StyledInputSelectTrigger } from "./Styles";
|
|
5
6
|
import { useForkRef } from "../../utils";
|
|
6
|
-
const
|
|
7
|
+
const defaultOptions = [{
|
|
7
8
|
id: "https://",
|
|
8
9
|
name: "https://"
|
|
9
10
|
}, {
|
|
@@ -16,10 +17,27 @@ export const InputUrl = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
16
17
|
disabled,
|
|
17
18
|
value: defaultValue = "",
|
|
18
19
|
onChange,
|
|
20
|
+
scheme,
|
|
19
21
|
...rest
|
|
20
22
|
} = _ref;
|
|
21
23
|
const inputRef = useRef(null);
|
|
22
24
|
const handleRef = useForkRef(ref, inputRef);
|
|
25
|
+
const options = useMemo(() => {
|
|
26
|
+
if (scheme && scheme.length > 0) {
|
|
27
|
+
if (Array.isArray(scheme)) {
|
|
28
|
+
return scheme.map(i => ({
|
|
29
|
+
id: i,
|
|
30
|
+
name: i
|
|
31
|
+
}));
|
|
32
|
+
} else {
|
|
33
|
+
return [{
|
|
34
|
+
id: scheme,
|
|
35
|
+
name: scheme
|
|
36
|
+
}];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return defaultOptions;
|
|
40
|
+
}, [scheme]);
|
|
23
41
|
const [prefix, setPrefix] = useState(options[0].id);
|
|
24
42
|
const [value, setValue] = useState("");
|
|
25
43
|
const separatePrefixFromValue = fullValue => {
|
|
@@ -64,14 +82,14 @@ export const InputUrl = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
64
82
|
},
|
|
65
83
|
// eslint-disable-next-line
|
|
66
84
|
[onChange, prefix]);
|
|
67
|
-
const handleSelectChange = val => {
|
|
85
|
+
const handleSelectChange = useCallback(val => {
|
|
68
86
|
setPrefix(val);
|
|
69
87
|
setTimeout(() => {
|
|
70
88
|
var _inputRef$current;
|
|
71
89
|
(_inputRef$current = inputRef.current) == null || _inputRef$current.focus();
|
|
72
90
|
}, 200);
|
|
73
91
|
typeof onChange === "function" && onChange(val + value);
|
|
74
|
-
};
|
|
92
|
+
}, [onChange, value]);
|
|
75
93
|
const handlePaste = e => {
|
|
76
94
|
e.preventDefault();
|
|
77
95
|
const paste = e.clipboardData.getData("text");
|
|
@@ -87,6 +105,29 @@ export const InputUrl = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
87
105
|
onChange(newPrefix + newValue);
|
|
88
106
|
}
|
|
89
107
|
};
|
|
108
|
+
const startAdornmentComponent = useMemo(() => {
|
|
109
|
+
if (options.length > 1) {
|
|
110
|
+
return /*#__PURE__*/React.createElement(InputSelect, {
|
|
111
|
+
key: prefix,
|
|
112
|
+
size: size,
|
|
113
|
+
onChange: handleSelectChange,
|
|
114
|
+
options: options,
|
|
115
|
+
selected: prefix,
|
|
116
|
+
disabled: disabled
|
|
117
|
+
});
|
|
118
|
+
} else {
|
|
119
|
+
return /*#__PURE__*/React.createElement(StyledInputSelectTrigger, {
|
|
120
|
+
key: prefix,
|
|
121
|
+
$disabled: disabled,
|
|
122
|
+
$size: size
|
|
123
|
+
}, prefix);
|
|
124
|
+
}
|
|
125
|
+
}, [disabled, handleSelectChange, options, prefix, size]);
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
if (options.length > 0) {
|
|
128
|
+
setPrefix(options[0].id);
|
|
129
|
+
}
|
|
130
|
+
}, [options]);
|
|
90
131
|
return /*#__PURE__*/React.createElement(Input, _extends({}, rest, {
|
|
91
132
|
ref: handleRef,
|
|
92
133
|
size: size,
|
|
@@ -96,13 +137,7 @@ export const InputUrl = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
96
137
|
onPaste: handlePaste,
|
|
97
138
|
onChange: handleChange,
|
|
98
139
|
"data-testid": "InputUrl",
|
|
99
|
-
startAdornment:
|
|
100
|
-
size: size,
|
|
101
|
-
onChange: handleSelectChange,
|
|
102
|
-
options: options,
|
|
103
|
-
selected: prefix,
|
|
104
|
-
disabled: disabled
|
|
105
|
-
})
|
|
140
|
+
startAdornment: startAdornmentComponent
|
|
106
141
|
}));
|
|
107
142
|
});
|
|
108
143
|
InputUrl.displayName = "InputUrl";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputUrl.js","names":["React","forwardRef","useCallback","useEffect","useRef","useState","Input","InputSelect","useForkRef","
|
|
1
|
+
{"version":3,"file":"InputUrl.js","names":["React","forwardRef","useCallback","useEffect","useMemo","useRef","useState","Input","InputSelect","StyledInputSelectTrigger","useForkRef","defaultOptions","id","name","InputUrl","_ref","ref","size","disabled","value","defaultValue","onChange","scheme","rest","inputRef","handleRef","options","length","Array","isArray","map","i","prefix","setPrefix","setValue","separatePrefixFromValue","fullValue","newPrefix","newValue","forEach","option","startsWith","replace","handleChange","e","inputValue","target","handleSelectChange","val","setTimeout","_inputRef$current","current","focus","handlePaste","preventDefault","paste","clipboardData","getData","startAdornmentComponent","createElement","key","selected","$disabled","$size","_extends","type","onPaste","startAdornment","displayName"],"sources":["../../../../src/components/Input/InputUrl.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport { Input, InputProps } from \"./Input\";\nimport { InputSelect } from \"./InputSelect\";\nimport { StyledInputSelectTrigger } from \"./Styles\";\nimport { useForkRef } from \"../../utils\";\n\nexport interface InputUrlProps\n extends Omit<\n InputProps,\n \"type\" | \"startAdornment\" | \"onChange\" | \"value\" | \"size\"\n > {\n /** Input value */\n value?: string;\n /** onChange function */\n onChange?: (val: string) => void;\n /** Input size */\n size?: \"regular\" | \"big\" | \"biggest\";\n scheme?: string[] | string;\n}\n\nconst defaultOptions = [\n { id: \"https://\", name: \"https://\" },\n { id: \"http://\", name: \"http://\" },\n];\n\nexport const InputUrl = forwardRef<HTMLInputElement, InputUrlProps>(\n (\n {\n size = \"regular\",\n disabled,\n value: defaultValue = \"\",\n onChange,\n scheme,\n ...rest\n },\n ref\n ) => {\n const inputRef = useRef<HTMLInputElement | null>(null);\n const handleRef = useForkRef(ref, inputRef);\n\n const options = useMemo(() => {\n if (scheme && scheme.length > 0) {\n if (Array.isArray(scheme)) {\n return scheme.map((i) => ({ id: i, name: i }));\n } else {\n return [{ id: scheme, name: scheme }];\n }\n }\n return defaultOptions;\n }, [scheme]);\n\n const [prefix, setPrefix] = useState(options[0].id);\n\n const [value, setValue] = useState(\"\");\n\n const separatePrefixFromValue = (\n fullValue: string\n ): { newPrefix: string; newValue: string } => {\n let newPrefix = prefix;\n let newValue = fullValue;\n\n options.forEach((option) => {\n if (fullValue.startsWith(option.id)) {\n newPrefix = option.id;\n newValue = fullValue.replace(option.id, \"\");\n }\n });\n\n setValue(newValue);\n return { newPrefix, newValue };\n };\n\n useEffect(() => {\n const { newPrefix, newValue } = separatePrefixFromValue(defaultValue);\n setPrefix(newPrefix);\n setValue(newValue);\n // eslint-disable-next-line\n }, [defaultValue]);\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n if (!inputValue.startsWith(prefix)) {\n const { newPrefix, newValue } = separatePrefixFromValue(inputValue);\n setPrefix(newPrefix);\n setValue(newValue);\n typeof onChange === \"function\" && onChange(newPrefix + newValue);\n } else {\n const newValue = inputValue.replace(prefix, \"\");\n setValue(newValue);\n typeof onChange === \"function\" && onChange(prefix + newValue);\n }\n },\n // eslint-disable-next-line\n [onChange, prefix]\n );\n\n const handleSelectChange = useCallback(\n (val: string | number | (string | number)[]) => {\n setPrefix(val as string);\n setTimeout(() => {\n inputRef.current?.focus();\n }, 200);\n typeof onChange === \"function\" && onChange((val as string) + value);\n },\n [onChange, value]\n );\n\n const handlePaste = (e: React.ClipboardEvent) => {\n e.preventDefault();\n const paste = e.clipboardData.getData(\"text\");\n const { newPrefix, newValue } = separatePrefixFromValue(paste);\n if (newPrefix !== prefix) {\n setPrefix(newPrefix);\n }\n setValue(newValue);\n\n if (typeof onChange === \"function\") {\n onChange(newPrefix + newValue);\n }\n };\n\n const startAdornmentComponent = useMemo(() => {\n if (options.length > 1) {\n return (\n <InputSelect\n key={prefix}\n size={size}\n onChange={handleSelectChange}\n options={options}\n selected={prefix}\n disabled={disabled}\n />\n );\n } else {\n return (\n <StyledInputSelectTrigger\n key={prefix}\n $disabled={disabled}\n $size={size}\n >\n {prefix}\n </StyledInputSelectTrigger>\n );\n }\n }, [disabled, handleSelectChange, options, prefix, size]);\n\n useEffect(() => {\n if (options.length > 0) {\n setPrefix(options[0].id);\n }\n }, [options]);\n\n return (\n <Input\n {...rest}\n ref={handleRef}\n size={size}\n value={value}\n disabled={disabled}\n type=\"text\"\n onPaste={handlePaste}\n onChange={handleChange}\n data-testid=\"InputUrl\"\n startAdornment={startAdornmentComponent}\n />\n );\n }\n);\n\nInputUrl.displayName = \"InputUrl\";\n"],"mappings":";AAAA,OAAOA,KAAK,IACVC,UAAU,EACVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AAEd,SAASC,KAAK,QAAoB,SAAS;AAC3C,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,wBAAwB,QAAQ,UAAU;AACnD,SAASC,UAAU,QAAQ,aAAa;AAgBxC,MAAMC,cAAc,GAAG,CACrB;EAAEC,EAAE,EAAE,UAAU;EAAEC,IAAI,EAAE;AAAW,CAAC,EACpC;EAAED,EAAE,EAAE,SAAS;EAAEC,IAAI,EAAE;AAAU,CAAC,CACnC;AAED,OAAO,MAAMC,QAAQ,gBAAGb,UAAU,CAChC,CAAAc,IAAA,EASEC,GAAG,KACA;EAAA,IATH;IACEC,IAAI,GAAG,SAAS;IAChBC,QAAQ;IACRC,KAAK,EAAEC,YAAY,GAAG,EAAE;IACxBC,QAAQ;IACRC,MAAM;IACN,GAAGC;EACL,CAAC,GAAAR,IAAA;EAGD,MAAMS,QAAQ,GAAGnB,MAAM,CAA0B,IAAI,CAAC;EACtD,MAAMoB,SAAS,GAAGf,UAAU,CAACM,GAAG,EAAEQ,QAAQ,CAAC;EAE3C,MAAME,OAAO,GAAGtB,OAAO,CAAC,MAAM;IAC5B,IAAIk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AAG,EAAES,SAAU;IACfR,IAAI,EAAEA,IAAK;IACXE,KAAK,EAAEA,KAAM;IACbD,QAAQ,EAAEA,QAAS;IACnB+C,IAAI,EAAC,MAAM;IACXC,OAAO,EAAEb,WAAY;IACrBhC,QAAQ,EAAEsB,YAAa;IACvB,eAAY,UAAU;IACtBwB,cAAc,EAAET;EAAwB,EACzC,CAAC;AAEN,CACF,CAAC;AAED5C,QAAQ,CAACsD,WAAW,GAAG,UAAU"}
|
|
@@ -21,7 +21,7 @@ export declare const StyledPasswordIndicator: import("styled-components").Styled
|
|
|
21
21
|
}, never>;
|
|
22
22
|
export declare const StyledInputSelectTrigger: import("styled-components").StyledComponent<"div", any, {
|
|
23
23
|
$size: string;
|
|
24
|
-
$disabled
|
|
24
|
+
$disabled?: boolean | undefined;
|
|
25
25
|
}, never>;
|
|
26
26
|
export declare const StyledFlagTriggerLabel: import("styled-components").StyledComponent<"span", any, {
|
|
27
27
|
$size: "small" | "regular" | "big";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAK/C,UAAU,uBAAuB;IAC/B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,eAAO,MAAM,kBAAkB,yFAuE9B,CAAC;AAIF,UAAU,gBAAiB,SAAQ,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC;IAC1D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,E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|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","FontStyle","InputResetStyle","StyledInputWrapper","div","withConfig","displayName","componentId","props","$mode","$size","$disabled","$invalid","StyledInput","input","disabled","$loading","align","StyledPasswordIndicatorWrapper","StyledPasswordIndicator","$strength","$index","StyledInputSelectTrigger","StyledFlagTriggerLabel","span","_ref","StyledOptionFlag","StyledOptionName","StyledOptionWrapper"],"sources":["../../../../src/components/Input/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { InputProps } from \"./Input\";\nimport { InputMode, InputSize } from \"./types\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\nimport { InputResetStyle } from \"../InputResetStyle\";\n\ninterface StyledInputWrapperProps {\n $size?: InputSize;\n $invalid?: boolean;\n $disabled?: boolean;\n $mode?: InputMode;\n}\n\nexport const StyledInputWrapper = styled.div<StyledInputWrapperProps>`\n align-items: center;\n background-color: var(--input-background-color);\n border-color: var(--color-theme-500);\n border-radius: 8px;\n border-style: solid;\n border-width: 1px;\n cursor: text;\n display: flex;\n height: 32px;\n padding-block: 4px;\n padding-inline: 4px;\n transition: all 0.3s ease;\n width: 360px;\n\n ${FontStyle}\n ${BoxSizingStyle}\n\n\n ${(props) =>\n props.$mode === \"flat\" &&\n css`\n background-color: transparent;\n border: none;\n border-radius: none;\n `}\n\n\n ${(props) =>\n props.$size === \"small\" &&\n css`\n border-radius: 6px;\n height: 24px;\n `}\n\n ${(props) =>\n props.$size === \"big\" &&\n css`\n height: 40px;\n `}\n\n ${(props) =>\n props.$size === \"biggest\" &&\n css`\n height: 48px;\n `}\n\n ${(props) =>\n props.$disabled &&\n css`\n cursor: default;\n opacity: 50%;\n `}\n\n ${(props) =>\n !props.$disabled &&\n !props.$invalid &&\n css`\n &:focus-within,\n &:hover {\n border-color: var(--color-primary);\n }\n `}\n\n ${(props) =>\n !props.$disabled &&\n props.$invalid &&\n props.$mode === \"outlined\" &&\n css`\n border-color: var(--red-alert);\n `}\n`;\n\nStyledInputWrapper.displayName = \"StyledInputWrapper\";\n\ninterface StyledInputProps extends Pick<InputProps, \"align\"> {\n $size?: InputSize;\n $loading?: boolean;\n $mode?: InputMode;\n $invalid?: boolean;\n}\n\nexport const StyledInput = styled.input<StyledInputProps>`\n ${BoxSizingStyle}\n ${InputResetStyle}\n background-color: var(--input-background-color);\n border: none;\n color: var(--color-theme-900);\n /* @TODO: Prebaciti velicine fontova, weight, razmake, itd... u naše varijable. */\n font-size: 0.875rem;\n font-weight: 400;\n letter-spacing: 0.02em;\n margin-block: 0;\n margin-inline: 4px;\n outline: none;\n padding: 0;\n width: 100%;\n\n ${(props) =>\n props.$mode === \"flat\" &&\n css`\n background-color: transparent;\n `}\n\n &::placeholder {\n color: var(--color-theme-transparent-500);\n }\n\n ${(props) =>\n props.$size === \"big\" &&\n css`\n font-size: 1rem;\n `}\n\n ${(props) =>\n props.$size === \"biggest\" &&\n css`\n font-size: 1.25rem;\n font-weight: 700;\n `}\n\n ${(props) =>\n props.disabled &&\n css`\n cursor: default;\n `}\n\n ${(props) =>\n props.$loading &&\n css`\n cursor: progress;\n `}\n\n ${(props) =>\n props.align &&\n css`\n text-align: ${props.align};\n `}\n\n ${(props) =>\n props.$mode === \"flat\" &&\n props.$invalid &&\n css`\n color: var(--red-alert);\n `}\n`;\n\nStyledInput.displayName = \"StyledInput\";\n\nexport const StyledPasswordIndicatorWrapper = styled.div`\n display: flex;\n gap: 2px;\n margin-top: 6px;\n margin-bottom: 4px;\n`;\n\nStyledPasswordIndicatorWrapper.displayName = \"StyledPasswordIndicatorWrapper\";\n\nexport const StyledPasswordIndicator = styled.div<{\n $strength: number;\n $index: number;\n}>`\n width: 100%;\n height: 4px;\n border-radius: 6px;\n background-color: ${(props) => {\n const { $strength, $index } = props;\n\n if ($strength === 0) {\n return \"var(--color-theme-300)\";\n } else if ($strength === 1) {\n return $index === 0 ? \"var(--red-alert)\" : \"var(--color-theme-300)\";\n } else if ($strength === 2) {\n return $index < 2 ? \"var(--color-orange)\" : \"var(--color-theme-300)\";\n } else if ($strength === 3) {\n return $index < 3 ? \"var(--color-blue-sky)\" : \"var(--color-theme-300)\";\n } else {\n return \"var(--color-sucess-green)\";\n }\n }};\n`;\n\nStyledPasswordIndicator.displayName = \"StyledPasswordIndicator\";\n\nexport const StyledInputSelectTrigger = styled.div<{\n $size: string;\n $disabled
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","FontStyle","InputResetStyle","StyledInputWrapper","div","withConfig","displayName","componentId","props","$mode","$size","$disabled","$invalid","StyledInput","input","disabled","$loading","align","StyledPasswordIndicatorWrapper","StyledPasswordIndicator","$strength","$index","StyledInputSelectTrigger","StyledFlagTriggerLabel","span","_ref","StyledOptionFlag","StyledOptionName","StyledOptionWrapper"],"sources":["../../../../src/components/Input/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { InputProps } from \"./Input\";\nimport { InputMode, InputSize } from \"./types\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\nimport { InputResetStyle } from \"../InputResetStyle\";\n\ninterface StyledInputWrapperProps {\n $size?: InputSize;\n $invalid?: boolean;\n $disabled?: boolean;\n $mode?: InputMode;\n}\n\nexport const StyledInputWrapper = styled.div<StyledInputWrapperProps>`\n align-items: center;\n background-color: var(--input-background-color);\n border-color: var(--color-theme-500);\n border-radius: 8px;\n border-style: solid;\n border-width: 1px;\n cursor: text;\n display: flex;\n height: 32px;\n padding-block: 4px;\n padding-inline: 4px;\n transition: all 0.3s ease;\n width: 360px;\n\n ${FontStyle}\n ${BoxSizingStyle}\n\n\n ${(props) =>\n props.$mode === \"flat\" &&\n css`\n background-color: transparent;\n border: none;\n border-radius: none;\n `}\n\n\n ${(props) =>\n props.$size === \"small\" &&\n css`\n border-radius: 6px;\n height: 24px;\n `}\n\n ${(props) =>\n props.$size === \"big\" &&\n css`\n height: 40px;\n `}\n\n ${(props) =>\n props.$size === \"biggest\" &&\n css`\n height: 48px;\n `}\n\n ${(props) =>\n props.$disabled &&\n css`\n cursor: default;\n opacity: 50%;\n `}\n\n ${(props) =>\n !props.$disabled &&\n !props.$invalid &&\n css`\n &:focus-within,\n &:hover {\n border-color: var(--color-primary);\n }\n `}\n\n ${(props) =>\n !props.$disabled &&\n props.$invalid &&\n props.$mode === \"outlined\" &&\n css`\n border-color: var(--red-alert);\n `}\n`;\n\nStyledInputWrapper.displayName = \"StyledInputWrapper\";\n\ninterface StyledInputProps extends Pick<InputProps, \"align\"> {\n $size?: InputSize;\n $loading?: boolean;\n $mode?: InputMode;\n $invalid?: boolean;\n}\n\nexport const StyledInput = styled.input<StyledInputProps>`\n ${BoxSizingStyle}\n ${InputResetStyle}\n background-color: var(--input-background-color);\n border: none;\n color: var(--color-theme-900);\n /* @TODO: Prebaciti velicine fontova, weight, razmake, itd... u naše varijable. */\n font-size: 0.875rem;\n font-weight: 400;\n letter-spacing: 0.02em;\n margin-block: 0;\n margin-inline: 4px;\n outline: none;\n padding: 0;\n width: 100%;\n\n ${(props) =>\n props.$mode === \"flat\" &&\n css`\n background-color: transparent;\n `}\n\n &::placeholder {\n color: var(--color-theme-transparent-500);\n }\n\n ${(props) =>\n props.$size === \"big\" &&\n css`\n font-size: 1rem;\n `}\n\n ${(props) =>\n props.$size === \"biggest\" &&\n css`\n font-size: 1.25rem;\n font-weight: 700;\n `}\n\n ${(props) =>\n props.disabled &&\n css`\n cursor: default;\n `}\n\n ${(props) =>\n props.$loading &&\n css`\n cursor: progress;\n `}\n\n ${(props) =>\n props.align &&\n css`\n text-align: ${props.align};\n `}\n\n ${(props) =>\n props.$mode === \"flat\" &&\n props.$invalid &&\n css`\n color: var(--red-alert);\n `}\n`;\n\nStyledInput.displayName = \"StyledInput\";\n\nexport const StyledPasswordIndicatorWrapper = styled.div`\n display: flex;\n gap: 2px;\n margin-top: 6px;\n margin-bottom: 4px;\n`;\n\nStyledPasswordIndicatorWrapper.displayName = \"StyledPasswordIndicatorWrapper\";\n\nexport const StyledPasswordIndicator = styled.div<{\n $strength: number;\n $index: number;\n}>`\n width: 100%;\n height: 4px;\n border-radius: 6px;\n background-color: ${(props) => {\n const { $strength, $index } = props;\n\n if ($strength === 0) {\n return \"var(--color-theme-300)\";\n } else if ($strength === 1) {\n return $index === 0 ? \"var(--red-alert)\" : \"var(--color-theme-300)\";\n } else if ($strength === 2) {\n return $index < 2 ? \"var(--color-orange)\" : \"var(--color-theme-300)\";\n } else if ($strength === 3) {\n return $index < 3 ? \"var(--color-blue-sky)\" : \"var(--color-theme-300)\";\n } else {\n return \"var(--color-sucess-green)\";\n }\n }};\n`;\n\nStyledPasswordIndicator.displayName = \"StyledPasswordIndicator\";\n\nexport const StyledInputSelectTrigger = styled.div<{\n $size: string;\n $disabled?: boolean;\n}>`\n display: flex;\n gap: 6px;\n align-items: center;\n margin-right: 2px;\n margin-left: 8px;\n color: var(--color-theme-700);\n font-weight: 400;\n letter-spacing: 0.02em;\n font-size: 0.875rem;\n flex-shrink: 0;\n cursor: ${(props) => {\n if (props.$disabled) {\n return \"unset\";\n }\n return \"pointer\";\n }};\n\n pointer-events: ${(props) => {\n if (props.$disabled) {\n return \"none\";\n }\n return \"unset\";\n }};\n\n ${(props) =>\n props.$size === \"big\" &&\n css`\n font-size: 1rem;\n `}\n`;\n\nStyledInputSelectTrigger.displayName = \"StyledInputSelectTrigger\";\n\nexport const StyledFlagTriggerLabel = styled.span<{\n $size: \"small\" | \"regular\" | \"big\";\n}>`\n font-size: ${({ $size }) => ($size === \"small\" ? \"20px\" : \"24px\")};\n`;\n\nStyledFlagTriggerLabel.displayName = \"StyledFlagTriggerLabel\";\n\nexport const StyledOptionFlag = styled.span`\n font-size: 24px;\n margin-right: 4px;\n`;\n\nStyledFlagTriggerLabel.displayName = \"StyledOptionFlag\";\n\nexport const StyledOptionName = styled.span`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nStyledOptionName.displayName = \"StyledOptionName\";\n\nexport const StyledOptionWrapper = styled.span`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n margin-right: 8px;\n display: flex;\n justify-items: center;\n align-items: center;\n`;\n\nStyledOptionWrapper.displayName = \"StyledOptionWrapper\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAI/C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,eAAe,QAAQ,oBAAoB;AASpD,OAAO,MAAMC,kBAAkB,GAAGL,MAAM,CAACM,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,gUAexCN,SAAS,EACTD,cAAc,EAGbQ,KAAK,IACNA,KAAK,CAACC,KAAK,KAAK,MAAM,IACtBV,GAAG,kEAIF,EAGAS,KAAK,IACNA,KAAK,CAACE,KAAK,KAAK,OAAO,IACvBX,GAAG,oCAGF,EAEAS,KAAK,IACNA,KAAK,CAACE,KAAK,KAAK,KAAK,IACrBX,GAAG,kBAEF,EAEES,KAAK,IACRA,KAAK,CAACE,KAAK,KAAK,SAAS,IACzBX,GAAG,kBAEF,EAEAS,KAAK,IACNA,KAAK,CAACG,SAAS,IACfZ,GAAG,iCAGF,EAEAS,KAAK,IACN,CAACA,KAAK,CAACG,SAAS,IAChB,CAACH,KAAK,CAACI,QAAQ,IACfb,GAAG,gEAKF,EAEAS,KAAK,IACN,CAACA,KAAK,CAACG,SAAS,IAChBH,KAAK,CAACI,QAAQ,IACdJ,KAAK,CAACC,KAAK,KAAK,UAAU,IAC1BV,GAAG,oCAEF,CACJ;AAEDI,kBAAkB,CAACG,WAAW,GAAG,oBAAoB;AASrD,OAAO,MAAMO,WAAW,GAAGf,MAAM,CAACgB,KAAK,CAAAT,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,kUACnCP,cAAc,EACdE,eAAe,EAcdM,KAAK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I,CAAAnB,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,wIAQ7C;AAEDqB,mBAAmB,CAACtB,WAAW,GAAG,qBAAqB"}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import React, { CSSProperties } from "react";
|
|
2
|
+
interface ControlProps {
|
|
3
|
+
onClick: () => void;
|
|
4
|
+
icon: React.ReactElement;
|
|
5
|
+
tooltip: string;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
className: string;
|
|
8
|
+
}
|
|
2
9
|
interface ISheet {
|
|
3
10
|
onClose?: () => void;
|
|
4
|
-
controls?:
|
|
11
|
+
controls?: ControlProps[];
|
|
5
12
|
open?: boolean;
|
|
6
13
|
animation?: "top" | "bottom" | "left" | "right";
|
|
7
14
|
position?: "center" | "left" | "right";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../../src/components/Sheet/Sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAMZ,aAAa,
|
|
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,YAAY,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,MAAM;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,IAAI,CAAC,EAAE,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,oHAiLjB,CAAC"}
|
|
@@ -2,8 +2,10 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import React, { useCallback, useEffect, forwardRef, useState, useImperativeHandle } from "react";
|
|
3
3
|
import { Transition } from "react-transition-group";
|
|
4
4
|
import classnames from "classnames";
|
|
5
|
-
import { StyledAnimatedSpan, StyledCssTransition, StyledSheetIcons, StyledSheetWrapper, StyledSheetWrapperPaper } from "./Styles";
|
|
5
|
+
import { StyledAnimatedSpan, StyledCssTransition, StyledHeader, StyledIconsWrapperSmall, StyledListSeparator, StyledSheetIcons, StyledSheetWrapper, StyledSheetWrapperPaper } from "./Styles";
|
|
6
|
+
import { IconButton } from "../IconButton";
|
|
6
7
|
import { Overlay } from "../Overlay";
|
|
8
|
+
import { Tooltip } from "../Tooltip";
|
|
7
9
|
import { Window } from "../Window";
|
|
8
10
|
export const Sheet = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
9
11
|
let {
|
|
@@ -32,7 +34,7 @@ export const Sheet = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
32
34
|
}, []);
|
|
33
35
|
const handleExited = useCallback(() => {
|
|
34
36
|
setExited(true);
|
|
35
|
-
|
|
37
|
+
onClose == null || onClose();
|
|
36
38
|
}, [onClose]);
|
|
37
39
|
const handleClose = useCallback(() => {
|
|
38
40
|
setOpen(false);
|
|
@@ -53,34 +55,47 @@ export const Sheet = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
53
55
|
onClose: handleClose,
|
|
54
56
|
disableFocusLock: disableFocusLock,
|
|
55
57
|
disableScrollLock: disableScrollLock
|
|
56
|
-
}), open
|
|
58
|
+
}), open && /*#__PURE__*/React.createElement(Overlay, {
|
|
57
59
|
onClick: handleBackgroundClick,
|
|
58
60
|
disableBackgroundColor: disableBackgroundColor
|
|
59
|
-
})
|
|
61
|
+
}), /*#__PURE__*/React.createElement(StyledSheetWrapper, {
|
|
60
62
|
className: classnames("c-sheet__wrapper", bodyClassName),
|
|
61
63
|
style: bodyStyle,
|
|
62
64
|
$position: position,
|
|
63
65
|
$mode: mode
|
|
64
|
-
}, controls.length
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
}, controls.length > 0 && /*#__PURE__*/React.createElement(StyledSheetIcons, null, controls.map((_ref2, index) => {
|
|
67
|
+
let {
|
|
68
|
+
icon: IconComponent,
|
|
69
|
+
tooltip,
|
|
70
|
+
onClick,
|
|
71
|
+
disabled,
|
|
72
|
+
className
|
|
73
|
+
} = _ref2;
|
|
74
|
+
const maxDurationIn = 4;
|
|
75
|
+
const maxDurationOut = 2;
|
|
67
76
|
const control = index + 1;
|
|
68
|
-
const durationOut =
|
|
69
|
-
const durationIn = control
|
|
77
|
+
const durationOut = Math.max(0, maxDurationOut - control);
|
|
78
|
+
const durationIn = Math.min(control, maxDurationIn);
|
|
70
79
|
return /*#__PURE__*/React.createElement(Transition, {
|
|
71
80
|
appear: true,
|
|
72
81
|
in: open,
|
|
73
82
|
timeout: maxDurationIn * 100,
|
|
74
83
|
key: "c-sheet-control-" + index
|
|
75
|
-
}, state => /*#__PURE__*/React.createElement(
|
|
76
|
-
|
|
84
|
+
}, state => /*#__PURE__*/React.createElement(Tooltip, {
|
|
85
|
+
title: tooltip,
|
|
86
|
+
disable: !tooltip || disabled
|
|
87
|
+
}, /*#__PURE__*/React.createElement(StyledAnimatedSpan, {
|
|
88
|
+
onClick: onClick,
|
|
89
|
+
$disabled: disabled,
|
|
77
90
|
$mode: mode,
|
|
91
|
+
$state: state,
|
|
92
|
+
className: className,
|
|
78
93
|
$maxDurationIn: maxDurationIn / 10,
|
|
79
94
|
$maxDurationOut: maxDurationOut / 10,
|
|
80
95
|
$durationOut: durationOut / 10,
|
|
81
96
|
$durationIn: durationIn / 10
|
|
82
|
-
},
|
|
83
|
-
}))
|
|
97
|
+
}, IconComponent)));
|
|
98
|
+
})), /*#__PURE__*/React.createElement(StyledCssTransition, {
|
|
84
99
|
appear: true,
|
|
85
100
|
in: open,
|
|
86
101
|
timeout: 400,
|
|
@@ -90,7 +105,25 @@ export const Sheet = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
90
105
|
onExited: handleExited
|
|
91
106
|
}, /*#__PURE__*/React.createElement(StyledSheetWrapperPaper, {
|
|
92
107
|
paperClass: "c-sheet__wrapper__paper"
|
|
93
|
-
},
|
|
108
|
+
}, controls.length > 0 && /*#__PURE__*/React.createElement(StyledHeader, null, /*#__PURE__*/React.createElement(StyledIconsWrapperSmall, null, controls.map((_ref3, index) => {
|
|
109
|
+
let {
|
|
110
|
+
icon: IconComponent,
|
|
111
|
+
tooltip,
|
|
112
|
+
onClick,
|
|
113
|
+
disabled,
|
|
114
|
+
className
|
|
115
|
+
} = _ref3;
|
|
116
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
117
|
+
title: tooltip,
|
|
118
|
+
disable: !tooltip || disabled,
|
|
119
|
+
key: index
|
|
120
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
121
|
+
onClick: onClick,
|
|
122
|
+
disabled: disabled,
|
|
123
|
+
className: className,
|
|
124
|
+
variant: "text gray"
|
|
125
|
+
}, IconComponent));
|
|
126
|
+
})), /*#__PURE__*/React.createElement(StyledListSeparator, null)), children))));
|
|
94
127
|
});
|
|
95
128
|
Sheet.displayName = "Sheet";
|
|
96
129
|
//# sourceMappingURL=Sheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.js","names":["React","useCallback","useEffect","forwardRef","useState","useImperativeHandle","Transition","classnames","StyledAnimatedSpan","StyledCssTransition","StyledSheetIcons","StyledSheetWrapper","StyledSheetWrapperPaper","Overlay","Window","Sheet","_ref","ref","children","onClose","controls","open","defaultOpen","animation","position","mode","disableFocusLock","disableScrollLock","disableBackgroundColor","bodyStyle","bodyClassName","disableBackgroundClick","rest","setOpen","exited","setExited","handleEnter","handleExited","handleClose","handleBackgroundClick","event","preventDefault","close","createElement","_extends","onClick","className","style","$position","$mode","length","map","item","index","maxDurationIn","maxDurationOut","control","durationOut","durationIn","appear","in","timeout","key","state","$state","$maxDurationIn","$maxDurationOut","$durationOut","$durationIn","classNames","$direction","onEnter","onExited","paperClass","displayName"],"sources":["../../../../src/components/Sheet/Sheet.tsx"],"sourcesContent":["import React, {\n useCallback,\n useEffect,\n forwardRef,\n HTMLAttributes,\n useState,\n CSSProperties,\n ReactElement,\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 StyledSheetIcons,\n StyledSheetWrapper,\n StyledSheetWrapperPaper,\n} from \"./Styles\";\nimport { Overlay } from \"../Overlay\";\nimport { Window } from \"../Window\";\n\ninterface ISheet {\n onClose?: () => void;\n controls?: JSX.Element[];\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\nexport const Sheet = forwardRef<\n SheetMethods,\n ISheet & HTMLAttributes<HTMLDivElement>\n>(\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 typeof onClose === \"function\" && 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 ) : null}\n <StyledSheetWrapper\n className={classnames(\"c-sheet__wrapper\", bodyClassName)}\n style={bodyStyle}\n $position={position}\n $mode={mode}\n >\n {controls.length ? (\n <StyledSheetIcons>\n {controls.map((item, index) => {\n const maxDurationIn = 4; // max duration 4 for 400ms, shorten .4s\n const maxDurationOut = 2; // max duration 2 for 200ms, shorten .2s\n const control = index + 1;\n const durationOut =\n controls.length > maxDurationOut\n ? maxDurationOut\n : maxDurationOut - control;\n const durationIn = control >= maxDurationIn ? 1 : control;\n return (\n <Transition\n appear\n in={open}\n timeout={maxDurationIn * 100}\n key={`c-sheet-control-${index}`}\n >\n {(state): ReactElement => (\n <StyledAnimatedSpan\n $state={state}\n $mode={mode}\n $maxDurationIn={maxDurationIn / 10}\n $maxDurationOut={maxDurationOut / 10}\n $durationOut={durationOut / 10}\n $durationIn={durationIn / 10}\n >\n {item}\n </StyledAnimatedSpan>\n )}\n </Transition>\n );\n })}\n </StyledSheetIcons>\n ) : null}\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 {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,EAIRC,mBAAmB,QACd,OAAO;AACd,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,kBAAkB,EAClBC,mBAAmB,EACnBC,gBAAgB,EAChBC,kBAAkB,EAClBC,uBAAuB,QAClB,UAAU;AACjB,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,MAAM,QAAQ,WAAW;AAqBlC,OAAO,MAAMC,KAAK,gBAAGZ,UAAU,CAI7B,CAAAa,IAAA,EAiBEC,GAAG,KACA;EAAA,IAjBH;IACEC,QAAQ;IACRC,OAAO;IACPC,QAAQ,GAAG,EAAE;IACbC,IAAI,EAAEC,WAAW,GAAG,KAAK;IACzBC,SAAS,GAAG,KAAK;IACjBC,QAAQ,GAAG,QAAQ;IACnBC,IAAI,GAAG,QAAQ;IACfC,gBAAgB,GAAG,KAAK;IACxBC,iBAAiB,GAAG,KAAK;IACzBC,sBAAsB,GAAG,KAAK;IAC9BC,SAAS;IACTC,aAAa;IACbC,sBAAsB,GAAG,KAAK;IAC9B,GAAGC;EACL,CAAC,GAAAhB,IAAA;EAGD,MAAM,CAACK,IAAI,EAAEY,OAAO,CAAC,GAAG7B,QAAQ,CAACkB,WAAW,CAAC;E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,EAAE,GAAI;IACbQ,UAAU,EAAC,oBAAoB;IAC/BC,UAAU,EAAE/C,SAAU;IACtBgD,OAAO,EAAEnC,WAAY;IACrBoC,QAAQ,EAAEnC;EAAa,gBAEvBrC,KAAA,CAAA2C,aAAA,CAAC/B,uBAAuB;IAAC6D,UAAU,EAAC;EAAyB,GAC1DvD,QACsB,CACN,CACH,CACd,CAAC;AAEb,CACF,CAAC;AAEDH,KAAK,CAAC2D,WAAW,GAAG,OAAO"}
|
|
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","controls","open","defaultOpen","animation","position","mode","disableFocusLock","disableScrollLock","disableBackgroundColor","bodyStyle","bodyClassName","disableBackgroundClick","rest","setOpen","exited","setExited","handleEnter","handleExited","handleClose","handleBackgroundClick","event","preventDefault","close","createElement","_extends","onClick","className","style","$position","$mode","length","map","_ref2","index","icon","IconComponent","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 </StyledSheetWrap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C,EAAE,EAAE9C,IAAK;IACT+C,OAAO,EAAE,GAAI;IACbW,UAAU,EAAC,oBAAoB;IAC/BC,UAAU,EAAEzD,SAAU;IACtB0D,OAAO,EAAE7C,WAAY;IACrB8C,QAAQ,EAAE7C;EAAa,gBAEvB1C,KAAA,CAAAgD,aAAA,CAACjC,uBAAuB;IAACyE,UAAU,EAAC;EAAyB,GAC1D/D,QAAQ,CAAC8B,MAAM,GAAG,CAAC,iBAClBvD,KAAA,CAAAgD,aAAA,CAACtC,YAAY,qBACXV,KAAA,CAAAgD,aAAA,CAACrC,uBAAuB,QACrBc,QAAQ,CAAC+B,GAAG,CACX,CAAAiC,KAAA,EAQE/B,KAAK;IAAA,IAPL;MACEC,IAAI,EAAEC,aAAa;MACnBC,OAAO;MACPX,OAAO;MACPY,QAAQ;MACRX;IACF,CAAC,GAAAsC,KAAA;IAAA,oBAGDzF,KAAA,CAAAgD,aAAA,CAAC9B,OAAO;MACN0D,KAAK,EAAEf,OAAQ;MACfgB,OAAO,EAAE,CAAChB,OAAO,IAAIC,QAAS;MAC9BY,GAAG,EAAEhB;IAAM,gBAEX1D,KAAA,CAAAgD,aAAA,CAAChC,UAAU;MACTkC,OAAO,EAAEA,OAAQ;MACjBY,QAAQ,EAAEA,QAAS;MACnBX,SAAS,EAAEA,SAAU;MACrBuC,OAAO,EAAC;IAAW,GAElB9B,aACS,CACL,CAAC;EAAA,CAEd,CACuB,CAAC,eAC1B5D,KAAA,CAAAgD,aAAA,CAACpC,mBAAmB,MAAE,CACV,CACf,EACAW,QACsB,CACN,CACH,CACd,CAAC;AAEb,CACF,CAAC;AAEDH,KAAK,CAACuE,WAAW,GAAG,OAAO"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { CSSTransition } from "react-transition-group";
|
|
2
3
|
export declare const StyledSheetIcons: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
4
|
interface IStyledSheetWrapper {
|
|
@@ -15,15 +16,22 @@ export declare const StyledSheetControlsCenterIn: import("styled-components").Ke
|
|
|
15
16
|
export declare const StyledSheetControlsCenterOut: import("styled-components").Keyframes;
|
|
16
17
|
interface IStyledAnimatedSpan {
|
|
17
18
|
$mode: string;
|
|
18
|
-
$state
|
|
19
|
+
$state?: string;
|
|
19
20
|
$maxDurationIn: number;
|
|
20
21
|
$maxDurationOut: number;
|
|
21
22
|
$durationOut: number;
|
|
22
23
|
$durationIn: number;
|
|
24
|
+
$disabled?: boolean;
|
|
23
25
|
}
|
|
24
26
|
export declare const StyledAnimatedSpan: import("styled-components").StyledComponent<"span", any, IStyledAnimatedSpan, never>;
|
|
25
27
|
export declare const StyledCssTransition: import("styled-components").StyledComponent<typeof CSSTransition, any, {
|
|
26
28
|
$direction: string;
|
|
27
29
|
}, never>;
|
|
30
|
+
export declare const StyledListSeparator: import("styled-components").StyledComponent<{
|
|
31
|
+
({ className, ...props }: import("react").HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
32
|
+
displayName: string;
|
|
33
|
+
}, any, {}, never>;
|
|
34
|
+
export declare const StyledIconsWrapperSmall: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
35
|
+
export declare const StyledHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
28
36
|
export {};
|
|
29
37
|
//# sourceMappingURL=Styles.d.ts.map
|
|
@@ -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;
|
|
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,qFAmG9B,CAAC;AAIF,UAAU,wBAAwB;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,uBAAuB,0FAanC,CAAC;AAIF,eAAO,MAAM,sBAAsB,uCASlC,CAAC;AAEF,eAAO,MAAM,yBAAyB,uCASrC,CAAC;AAEF,eAAO,MAAM,2BAA2B,uCASvC,CAAC;AAEF,eAAO,MAAM,4BAA4B,uCASxC,CAAC;AAEF,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,kBAAkB,sFA2D9B,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"}
|
|
@@ -2,15 +2,16 @@ import { CSSTransition } from "react-transition-group";
|
|
|
2
2
|
import styled, { css, keyframes } from "styled-components";
|
|
3
3
|
import { BoxSizingStyle } from "../BoxSizingStyle";
|
|
4
4
|
import { FontStyle } from "../FontStyle";
|
|
5
|
+
import { ListSeparator } from "../List";
|
|
5
6
|
export const StyledSheetIcons = styled.div.withConfig({
|
|
6
7
|
displayName: "Styles__StyledSheetIcons",
|
|
7
8
|
componentId: "sc-144eyxd-0"
|
|
8
|
-
})(["display:flex;height:0;position:relative;span{position:relative;background-color:var(--page-paper-main);box-shadow:var(--shadow-secondary);cursor:pointer;border-radius:100%;width:40px;height:40px;display:flex;justify-content:center;align-items:center;& > *{height:40px;width:40px;padding:8px;fill:var(--color-theme-600);}}"]);
|
|
9
|
+
})(["display:flex;height:0;position:relative;span{position:relative;background-color:var(--page-paper-main);box-shadow:var(--shadow-secondary);cursor:pointer;border-radius:100%;width:40px;height:40px;display:flex;justify-content:center;align-items:center;& > *{height:40px;width:40px;padding:8px;fill:var(--color-theme-600);}}@media (max-width:768px){display:none;}"]);
|
|
9
10
|
StyledSheetIcons.displayName = "StyledSheetIcons";
|
|
10
11
|
export const StyledSheetWrapper = styled.div.withConfig({
|
|
11
12
|
displayName: "Styles__StyledSheetWrapper",
|
|
12
13
|
componentId: "sc-144eyxd-1"
|
|
13
|
-
})(["", " ", " 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;animation-fill-mode:both;}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;animation-fill-mode:both;}span{top:-48px;right:8px;}}"], StyledSheetIcons), props => props.$position === "center" && css(["", ""], {
|
|
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;animation-fill-mode:both;}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;animation-fill-mode:both;}span{top:-48px;right:8px;}}"], StyledSheetIcons), props => props.$mode === "stretch" && css(["@media (max-width:768px){width:100%;height:100%;}"]), props => props.$position === "center" && css(["", ""], {
|
|
14
15
|
"marginLeft": "auto",
|
|
15
16
|
"marginRight": "auto"
|
|
16
17
|
}), props => props.$position === "left" && css(["", ""], {
|
|
@@ -37,11 +38,26 @@ export const StyledSheetControlsCenterOut = keyframes(["0%{transform:translateY(
|
|
|
37
38
|
export const StyledAnimatedSpan = styled.span.withConfig({
|
|
38
39
|
displayName: "Styles__StyledAnimatedSpan",
|
|
39
40
|
componentId: "sc-144eyxd-3"
|
|
40
|
-
})(["background:red;", " ", " ", " ", ""], props => props.$state === "entering" && css(["opacity:1;", ""], props.$mode === "stretch" ? css(["animation-name:", ";animation-duration:", ";animation-delay:", ";"], StyledSheetControlsTop, props.$durationIn + "s", props.$durationIn + "s") : css(["animation-name:", ";animation-duration:", ";animation-delay:0s;"], StyledSheetControlsCenterIn, props.$maxDurationIn + "s")), props => props.$state === "entered" && css(["opacity:1;"]), props => props.$state === "exiting" && css(["opacity:0;", ""], props.$mode === "stretch" ? css(["animation-name:", ";animation-duration:", ";animation-delay:", ";"], StyledSheetControlsBottom, props.$durationOut + "s", props.$durationOut + "s") : css(["animation-name:", ";animation-duration:", ";animation-delay:0;"], StyledSheetControlsCenterOut, props.$maxDurationOut + "s")), props => props.$state === "exited" && css(["opacity:0;"]));
|
|
41
|
+
})(["background:red;", " ", " ", " ", " ", ""], props => props.$state === "entering" && css(["opacity:1;", ""], props.$mode === "stretch" ? css(["animation-name:", ";animation-duration:", ";animation-delay:", ";"], StyledSheetControlsTop, props.$durationIn + "s", props.$durationIn + "s") : css(["animation-name:", ";animation-duration:", ";animation-delay:0s;"], StyledSheetControlsCenterIn, props.$maxDurationIn + "s")), props => props.$state === "entered" && css(["opacity:1;"]), props => props.$disabled && css(["pointer-events:none;svg{opacity:0.5;}"]), props => props.$state === "exiting" && css(["opacity:0;", ""], props.$mode === "stretch" ? css(["animation-name:", ";animation-duration:", ";animation-delay:", ";"], StyledSheetControlsBottom, props.$durationOut + "s", props.$durationOut + "s") : css(["animation-name:", ";animation-duration:", ";animation-delay:0;"], StyledSheetControlsCenterOut, props.$maxDurationOut + "s")), props => props.$state === "exited" && css(["opacity:0;"]));
|
|
41
42
|
StyledAnimatedSpan.displayName = "StyledAnimatedSpan";
|
|
42
43
|
export const StyledCssTransition = styled(CSSTransition).withConfig({
|
|
43
44
|
displayName: "Styles__StyledCssTransition",
|
|
44
45
|
componentId: "sc-144eyxd-4"
|
|
45
46
|
})(["", " ", " ", " ", ""], 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;}"]));
|
|
46
47
|
StyledCssTransition.displayName = "StyledCssTransition";
|
|
48
|
+
export const StyledListSeparator = styled(ListSeparator).withConfig({
|
|
49
|
+
displayName: "Styles__StyledListSeparator",
|
|
50
|
+
componentId: "sc-144eyxd-5"
|
|
51
|
+
})(["margin:0;"]);
|
|
52
|
+
StyledListSeparator.displayName = "StyledListSeparator";
|
|
53
|
+
export const StyledIconsWrapperSmall = styled.div.withConfig({
|
|
54
|
+
displayName: "Styles__StyledIconsWrapperSmall",
|
|
55
|
+
componentId: "sc-144eyxd-6"
|
|
56
|
+
})(["height:40px;display:flex;gap:8px;padding-left:16px;padding-right:16px;align-items:center;place-content:end;flex-direction:row-reverse;"]);
|
|
57
|
+
StyledIconsWrapperSmall.displayName = "StyledIconsWrapperSmall";
|
|
58
|
+
export const StyledHeader = styled.div.withConfig({
|
|
59
|
+
displayName: "Styles__StyledHeader",
|
|
60
|
+
componentId: "sc-144eyxd-7"
|
|
61
|
+
})(["@media (min-width:768px){display:none;}"]);
|
|
62
|
+
StyledHeader.displayName = "StyledHeader";
|
|
47
63
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["CSSTransition","styled","css","keyframes","BoxSizingStyle","FontStyle","StyledSheetIcons","div","withConfig","displayName","componentId","StyledSheetWrapper","props","$mode","$position","StyledSheetWrapperPaper","attrs","className","paperClass","StyledSheetControlsTop","StyledSheetControlsBottom","StyledSheetControlsCenterIn","StyledSheetControlsCenterOut","StyledAnimatedSpan","span","$state","$durationIn","$maxDurationIn","$durationOut","$maxDurationOut","StyledCssTransition","$direction"],"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\";\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\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.$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}\n\nexport const StyledAnimatedSpan = styled.span<IStyledAnimatedSpan>`\n background: red;\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.$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"],"mapp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B,GAAG7B,MAAM,CAACD,aAAa,CAAC,CAAAQ,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,4BAGnDE,KAAK,IACNA,KAAK,CAACmB,UAAU,KAAK,KAAK,IAC1B7B,GAAG,8fA2BF,EAEAU,KAAK,IACNA,KAAK,CAACmB,UAAU,KAAK,QAAQ,IAC7B7B,GAAG,2fA2BF,EAEAU,KAAK,IACNA,KAAK,CAACmB,UAAU,KAAK,MAAM,IAC3B7B,GAAG,8fA2BF,EAEAU,KAAK,IACNA,KAAK,CAACmB,UAAU,KAAK,OAAO,IAC5B7B,GAAG,2fA2BF,CACJ;AAED4B,mBAAmB,CAACrB,WAAW,GAAG,qBAAqB"}
|
|
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: 768px) {\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: 768px) {\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 background: red;\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: 768px) {\n display: none;\n }\n`;\n\nStyledHeader.displayName = \"StyledHeader\";\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,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