@kwiz/fluentui 1.0.216 → 1.0.217
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { makeStyles } from "@fluentui/react-components";
|
|
2
|
+
import { makeStyles, mergeClasses } from "@fluentui/react-components";
|
|
3
3
|
import { ChevronLeftRegular, ChevronRightRegular } from "@fluentui/react-icons";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { useKWIZFluentContext } from "../helpers/context-internal";
|
|
@@ -9,10 +9,12 @@ import { DividerEX } from "./divider";
|
|
|
9
9
|
import { Horizontal } from "./horizontal";
|
|
10
10
|
import { Vertical } from "./vertical";
|
|
11
11
|
const useStyles = makeStyles({
|
|
12
|
-
|
|
13
|
-
transform: "rotate(90deg)",
|
|
12
|
+
chevronIcon: {
|
|
14
13
|
transition: "transform 200ms ease-out"
|
|
15
14
|
},
|
|
15
|
+
opened: {
|
|
16
|
+
transform: "rotate(90deg)"
|
|
17
|
+
},
|
|
16
18
|
header: {
|
|
17
19
|
paddingLeft: 0
|
|
18
20
|
},
|
|
@@ -30,8 +32,7 @@ export const AccordionEX = (props) => {
|
|
|
30
32
|
const ctx = useKWIZFluentContext();
|
|
31
33
|
const classes = useStyles();
|
|
32
34
|
const [opened, setOpened] = React.useState(props.opened || props.groups[0].key);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
: _jsx(ChevronRightRegular, { className: opened === group.key ? classes.opened : '' }), title: group.title, showTitleWithIcon: true, dontCenterText: true, onClick: () => setOpened(current => props.allowClose && current === group.key ? undefined : group.key) }), _jsx(DividerEX, {}), group.key === opened && _jsxs(_Fragment, { children: [_jsx(Horizontal, { main: true, css: [classes.body, KnownClassNames.accordionBodyWrapper, KnownClassNames.overflowContent], children: _jsx(Vertical, { main: true, css: [KnownClassNames.accordionBody], children: group.content }) }), _jsx(DividerEX, {})] })] }, group.key)) }));
|
|
35
|
+
const Chevron = React.useMemo(() => ctx.isRtl ? ChevronLeftRegular : ChevronRightRegular, [ctx.isRtl]);
|
|
36
|
+
return (_jsx(Vertical, { main: true, css: [classes.root, props.fillHeight && classes.rootFill, KnownClassNames.accordion], children: props.groups.map(group => _jsxs(React.Fragment, { children: [_jsx(ButtonEX, { className: `${classes.header} ${KnownClassNames.accordionHeader} ${opened === group.key ? ` ${KnownClassNames.isOpen}` : ''}`, icon: _jsx(Chevron, { className: mergeClasses(classes.chevronIcon, opened === group.key ? classes.opened : '') }), title: group.title, showTitleWithIcon: true, dontCenterText: true, onClick: () => setOpened(current => props.allowClose && current === group.key ? undefined : group.key) }), _jsx(DividerEX, {}), group.key === opened && _jsxs(_Fragment, { children: [_jsx(Horizontal, { main: true, css: [classes.body, KnownClassNames.accordionBodyWrapper, KnownClassNames.overflowContent], children: _jsx(Vertical, { main: true, css: [KnownClassNames.accordionBody], children: group.content }) }), _jsx(DividerEX, {})] })] }, group.key)) }));
|
|
36
37
|
};
|
|
37
38
|
//# sourceMappingURL=accordion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../src/controls/accordion.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../src/controls/accordion.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAA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