ag-common 0.0.172 → 0.0.175
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.
|
@@ -89,7 +89,10 @@ const Modal = ({ open, setOpen, children, position = 'left', topPosition = 'bott
|
|
|
89
89
|
children)));
|
|
90
90
|
};
|
|
91
91
|
exports.Modal = Modal;
|
|
92
|
-
const
|
|
92
|
+
const ModalDropListStyled = (0, styled_components_1.default)(exports.Modal) `
|
|
93
|
+
flex-flow: column;
|
|
94
|
+
`;
|
|
95
|
+
const ModalDropList = (p) => (react_1.default.createElement(ModalDropListStyled, Object.assign({}, p, { className: p.className }), p.options.map((option, index) => (react_1.default.createElement(exports.ModalItem, { key: option, onClick: (e) => {
|
|
93
96
|
var _a;
|
|
94
97
|
e.stopPropagation();
|
|
95
98
|
e.preventDefault();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const Sidebar: ({ children, className, key, cookieDocument, }: {
|
|
2
|
+
export declare const Sidebar: ({ children, className, key, cookieDocument, width, }: {
|
|
3
3
|
children: any;
|
|
4
4
|
className?: string | undefined;
|
|
5
5
|
/**
|
|
@@ -10,4 +10,8 @@ export declare const Sidebar: ({ children, className, key, cookieDocument, }: {
|
|
|
10
10
|
* optionally pass in SSR cookiedocument
|
|
11
11
|
*/
|
|
12
12
|
cookieDocument?: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* default 15rem
|
|
15
|
+
*/
|
|
16
|
+
width?: string | undefined;
|
|
13
17
|
}) => JSX.Element;
|
|
@@ -12,10 +12,10 @@ const react_1 = __importDefault(require("react"));
|
|
|
12
12
|
const Base = styled_components_1.default.div `
|
|
13
13
|
position: relative;
|
|
14
14
|
transition: all 200ms;
|
|
15
|
-
width: 15rem;
|
|
16
15
|
border-right: solid 1px #ccc;
|
|
17
16
|
margin-right: 1rem;
|
|
18
17
|
padding-left: 0.5rem;
|
|
18
|
+
//width set in style
|
|
19
19
|
|
|
20
20
|
&[data-open='false'] {
|
|
21
21
|
width: 0.5rem;
|
|
@@ -44,7 +44,7 @@ const ContentBlock = styled_components_1.default.div `
|
|
|
44
44
|
position: absolute;
|
|
45
45
|
top: 0;
|
|
46
46
|
z-index: 1;
|
|
47
|
-
width
|
|
47
|
+
//width set in style
|
|
48
48
|
}
|
|
49
49
|
`;
|
|
50
50
|
const Content = styled_components_1.default.div `
|
|
@@ -91,16 +91,16 @@ const ChevronStyled = (0, styled_components_1.default)(Chevron_1.Chevron) `
|
|
|
91
91
|
fill: #555;
|
|
92
92
|
}
|
|
93
93
|
`;
|
|
94
|
-
const Sidebar = ({ children, className, key = 'sidebar', cookieDocument, }) => {
|
|
94
|
+
const Sidebar = ({ children, className, key = 'sidebar', cookieDocument, width = '15rem', }) => {
|
|
95
95
|
const [open, setOpen] = (0, use_1.useCookieBoolean)({
|
|
96
96
|
name: key,
|
|
97
97
|
defaultValue: false,
|
|
98
98
|
cookieDocument: cookieDocument,
|
|
99
99
|
});
|
|
100
|
-
return (react_1.default.createElement(Base, { className: className, "data-open": open, onClick: () => !open && setOpen(true), "data-hover": true },
|
|
100
|
+
return (react_1.default.createElement(Base, { className: className, "data-open": open, onClick: () => !open && setOpen(true), "data-hover": true, style: { width } },
|
|
101
101
|
react_1.default.createElement(Hamburger, { "data-open": open, onClick: () => setOpen(!open), "data-hover": true },
|
|
102
102
|
react_1.default.createElement(ChevronStyled, { point: open ? 'left' : 'right', width: "100%" })),
|
|
103
|
-
react_1.default.createElement(ContentBlock, { "data-content": true, "data-open": open },
|
|
103
|
+
react_1.default.createElement(ContentBlock, { "data-content": true, "data-open": open, style: { width: open ? undefined : width } },
|
|
104
104
|
react_1.default.createElement(Content, { "data-open": open, onClick: (e) => {
|
|
105
105
|
e.stopPropagation();
|
|
106
106
|
} }, children))));
|