@fluentui/react-accordion 9.1.3 → 9.1.5
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/.swcrc +30 -0
- package/CHANGELOG.json +103 -1
- package/CHANGELOG.md +32 -2
- package/lib/Accordion.js.map +1 -1
- package/lib/AccordionHeader.js.map +1 -1
- package/lib/AccordionItem.js.map +1 -1
- package/lib/AccordionPanel.js.map +1 -1
- package/lib/components/Accordion/Accordion.js.map +1 -1
- package/lib/components/Accordion/Accordion.types.js +1 -1
- package/lib/components/Accordion/Accordion.types.js.map +1 -1
- package/lib/components/Accordion/AccordionContext.js +1 -2
- package/lib/components/Accordion/AccordionContext.js.map +1 -1
- package/lib/components/Accordion/index.js.map +1 -1
- package/lib/components/Accordion/renderAccordion.js +1 -3
- package/lib/components/Accordion/renderAccordion.js.map +1 -1
- package/lib/components/Accordion/useAccordion.js.map +1 -1
- package/lib/components/Accordion/useAccordionContextValues.js.map +1 -1
- package/lib/components/Accordion/useAccordionStyles.js.map +1 -1
- package/lib/components/AccordionHeader/AccordionHeader.js.map +1 -1
- package/lib/components/AccordionHeader/AccordionHeader.types.js.map +1 -1
- package/lib/components/AccordionHeader/AccordionHeaderContext.js +2 -4
- package/lib/components/AccordionHeader/AccordionHeaderContext.js.map +1 -1
- package/lib/components/AccordionHeader/index.js.map +1 -1
- package/lib/components/AccordionHeader/renderAccordionHeader.js +1 -11
- package/lib/components/AccordionHeader/renderAccordionHeader.js.map +1 -1
- package/lib/components/AccordionHeader/useAccordionHeader.js +5 -5
- package/lib/components/AccordionHeader/useAccordionHeader.js.map +1 -1
- package/lib/components/AccordionHeader/useAccordionHeaderContextValues.js.map +1 -1
- package/lib/components/AccordionHeader/useAccordionHeaderStyles.js.map +1 -1
- package/lib/components/AccordionItem/AccordionItem.js.map +1 -1
- package/lib/components/AccordionItem/AccordionItem.types.js +1 -1
- package/lib/components/AccordionItem/AccordionItem.types.js.map +1 -1
- package/lib/components/AccordionItem/AccordionItemContext.js +3 -6
- package/lib/components/AccordionItem/AccordionItemContext.js.map +1 -1
- package/lib/components/AccordionItem/index.js.map +1 -1
- package/lib/components/AccordionItem/renderAccordionItem.js +1 -3
- package/lib/components/AccordionItem/renderAccordionItem.js.map +1 -1
- package/lib/components/AccordionItem/useAccordionItem.js.map +1 -1
- package/lib/components/AccordionItem/useAccordionItemContextValues.js.map +1 -1
- package/lib/components/AccordionItem/useAccordionItemStyles.js.map +1 -1
- package/lib/components/AccordionPanel/AccordionPanel.js.map +1 -1
- package/lib/components/AccordionPanel/AccordionPanel.types.js.map +1 -1
- package/lib/components/AccordionPanel/index.js.map +1 -1
- package/lib/components/AccordionPanel/renderAccordionPanel.js +1 -3
- package/lib/components/AccordionPanel/renderAccordionPanel.js.map +1 -1
- package/lib/components/AccordionPanel/useAccordionPanel.js +1 -0
- package/lib/components/AccordionPanel/useAccordionPanel.js.map +1 -1
- package/lib/components/AccordionPanel/useAccordionPanelStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Accordion.js +5 -4
- package/lib-commonjs/Accordion.js.map +1 -1
- package/lib-commonjs/AccordionHeader.js +5 -4
- package/lib-commonjs/AccordionHeader.js.map +1 -1
- package/lib-commonjs/AccordionItem.js +5 -4
- package/lib-commonjs/AccordionItem.js.map +1 -1
- package/lib-commonjs/AccordionPanel.js +5 -4
- package/lib-commonjs/AccordionPanel.js.map +1 -1
- package/lib-commonjs/components/Accordion/Accordion.js +21 -22
- package/lib-commonjs/components/Accordion/Accordion.js.map +1 -1
- package/lib-commonjs/components/Accordion/Accordion.types.js +5 -2
- package/lib-commonjs/components/Accordion/Accordion.types.js.map +1 -1
- package/lib-commonjs/components/Accordion/AccordionContext.js +21 -13
- package/lib-commonjs/components/Accordion/AccordionContext.js.map +1 -1
- package/lib-commonjs/components/Accordion/index.js +11 -10
- package/lib-commonjs/components/Accordion/index.js.map +1 -1
- package/lib-commonjs/components/Accordion/renderAccordion.js +16 -21
- package/lib-commonjs/components/Accordion/renderAccordion.js.map +1 -1
- package/lib-commonjs/components/Accordion/useAccordion.js +79 -81
- package/lib-commonjs/components/Accordion/useAccordion.js.map +1 -1
- package/lib-commonjs/components/Accordion/useAccordionContextValues.js +18 -21
- package/lib-commonjs/components/Accordion/useAccordionContextValues.js.map +1 -1
- package/lib-commonjs/components/Accordion/useAccordionStyles.js +19 -11
- package/lib-commonjs/components/Accordion/useAccordionStyles.js.map +1 -1
- package/lib-commonjs/components/AccordionHeader/AccordionHeader.js +21 -23
- package/lib-commonjs/components/AccordionHeader/AccordionHeader.js.map +1 -1
- package/lib-commonjs/components/AccordionHeader/AccordionHeader.types.js +3 -2
- package/lib-commonjs/components/AccordionHeader/AccordionHeader.types.js.map +1 -1
- package/lib-commonjs/components/AccordionHeader/AccordionHeaderContext.js +21 -14
- package/lib-commonjs/components/AccordionHeader/AccordionHeaderContext.js.map +1 -1
- package/lib-commonjs/components/AccordionHeader/index.js +10 -9
- package/lib-commonjs/components/AccordionHeader/index.js.map +1 -1
- package/lib-commonjs/components/AccordionHeader/renderAccordionHeader.js +16 -29
- package/lib-commonjs/components/AccordionHeader/renderAccordionHeader.js.map +1 -1
- package/lib-commonjs/components/AccordionHeader/useAccordionHeader.js +77 -94
- package/lib-commonjs/components/AccordionHeader/useAccordionHeader.js.map +1 -1
- package/lib-commonjs/components/AccordionHeader/useAccordionHeaderContextValues.js +24 -21
- package/lib-commonjs/components/AccordionHeader/useAccordionHeaderContextValues.js.map +1 -1
- package/lib-commonjs/components/AccordionHeader/useAccordionHeaderStyles.js +383 -172
- package/lib-commonjs/components/AccordionHeader/useAccordionHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/AccordionItem/AccordionItem.js +21 -22
- package/lib-commonjs/components/AccordionItem/AccordionItem.js.map +1 -1
- package/lib-commonjs/components/AccordionItem/AccordionItem.types.js +5 -2
- package/lib-commonjs/components/AccordionItem/AccordionItem.types.js.map +1 -1
- package/lib-commonjs/components/AccordionItem/AccordionItemContext.js +23 -16
- package/lib-commonjs/components/AccordionItem/AccordionItemContext.js.map +1 -1
- package/lib-commonjs/components/AccordionItem/index.js +11 -10
- package/lib-commonjs/components/AccordionItem/index.js.map +1 -1
- package/lib-commonjs/components/AccordionItem/renderAccordionItem.js +16 -21
- package/lib-commonjs/components/AccordionItem/renderAccordionItem.js.map +1 -1
- package/lib-commonjs/components/AccordionItem/useAccordionItem.js +33 -35
- package/lib-commonjs/components/AccordionItem/useAccordionItem.js.map +1 -1
- package/lib-commonjs/components/AccordionItem/useAccordionItemContextValues.js +22 -19
- package/lib-commonjs/components/AccordionItem/useAccordionItemContextValues.js.map +1 -1
- package/lib-commonjs/components/AccordionItem/useAccordionItemStyles.js +19 -11
- package/lib-commonjs/components/AccordionItem/useAccordionItemStyles.js.map +1 -1
- package/lib-commonjs/components/AccordionPanel/AccordionPanel.js +19 -20
- package/lib-commonjs/components/AccordionPanel/AccordionPanel.js.map +1 -1
- package/lib-commonjs/components/AccordionPanel/AccordionPanel.types.js +3 -2
- package/lib-commonjs/components/AccordionPanel/AccordionPanel.types.js.map +1 -1
- package/lib-commonjs/components/AccordionPanel/index.js +9 -8
- package/lib-commonjs/components/AccordionPanel/index.js.map +1 -1
- package/lib-commonjs/components/AccordionPanel/renderAccordionPanel.js +13 -18
- package/lib-commonjs/components/AccordionPanel/renderAccordionPanel.js.map +1 -1
- package/lib-commonjs/components/AccordionPanel/useAccordionPanel.js +32 -35
- package/lib-commonjs/components/AccordionPanel/useAccordionPanel.js.map +1 -1
- package/lib-commonjs/components/AccordionPanel/useAccordionPanelStyles.js +39 -23
- package/lib-commonjs/components/AccordionPanel/useAccordionPanelStyles.js.map +1 -1
- package/lib-commonjs/index.js +43 -170
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +12 -11
- package/lib-amd/Accordion.js +0 -6
- package/lib-amd/Accordion.js.map +0 -1
- package/lib-amd/AccordionHeader.js +0 -6
- package/lib-amd/AccordionHeader.js.map +0 -1
- package/lib-amd/AccordionItem.js +0 -6
- package/lib-amd/AccordionItem.js.map +0 -1
- package/lib-amd/AccordionPanel.js +0 -6
- package/lib-amd/AccordionPanel.js.map +0 -1
- package/lib-amd/components/Accordion/Accordion.js +0 -18
- package/lib-amd/components/Accordion/Accordion.js.map +0 -1
- package/lib-amd/components/Accordion/Accordion.types.js +0 -5
- package/lib-amd/components/Accordion/Accordion.types.js.map +0 -1
- package/lib-amd/components/Accordion/AccordionContext.js +0 -22
- package/lib-amd/components/Accordion/AccordionContext.js.map +0 -1
- package/lib-amd/components/Accordion/index.js +0 -12
- package/lib-amd/components/Accordion/index.js.map +0 -1
- package/lib-amd/components/Accordion/renderAccordion.js +0 -15
- package/lib-amd/components/Accordion/renderAccordion.js.map +0 -1
- package/lib-amd/components/Accordion/useAccordion.js +0 -83
- package/lib-amd/components/Accordion/useAccordion.js.map +0 -1
- package/lib-amd/components/Accordion/useAccordionContextValues.js +0 -18
- package/lib-amd/components/Accordion/useAccordionContextValues.js.map +0 -1
- package/lib-amd/components/Accordion/useAccordionStyles.js +0 -14
- package/lib-amd/components/Accordion/useAccordionStyles.js.map +0 -1
- package/lib-amd/components/AccordionHeader/AccordionHeader.js +0 -19
- package/lib-amd/components/AccordionHeader/AccordionHeader.js.map +0 -1
- package/lib-amd/components/AccordionHeader/AccordionHeader.types.js +0 -5
- package/lib-amd/components/AccordionHeader/AccordionHeader.types.js.map +0 -1
- package/lib-amd/components/AccordionHeader/AccordionHeaderContext.js +0 -15
- package/lib-amd/components/AccordionHeader/AccordionHeaderContext.js.map +0 -1
- package/lib-amd/components/AccordionHeader/index.js +0 -11
- package/lib-amd/components/AccordionHeader/index.js.map +0 -1
- package/lib-amd/components/AccordionHeader/renderAccordionHeader.js +0 -20
- package/lib-amd/components/AccordionHeader/renderAccordionHeader.js.map +0 -1
- package/lib-amd/components/AccordionHeader/useAccordionHeader.js +0 -70
- package/lib-amd/components/AccordionHeader/useAccordionHeader.js.map +0 -1
- package/lib-amd/components/AccordionHeader/useAccordionHeaderContextValues.js +0 -17
- package/lib-amd/components/AccordionHeader/useAccordionHeaderContextValues.js.map +0 -1
- package/lib-amd/components/AccordionHeader/useAccordionHeaderStyles.js +0 -87
- package/lib-amd/components/AccordionHeader/useAccordionHeaderStyles.js.map +0 -1
- package/lib-amd/components/AccordionItem/AccordionItem.js +0 -18
- package/lib-amd/components/AccordionItem/AccordionItem.js.map +0 -1
- package/lib-amd/components/AccordionItem/AccordionItem.types.js +0 -5
- package/lib-amd/components/AccordionItem/AccordionItem.types.js.map +0 -1
- package/lib-amd/components/AccordionItem/AccordionItemContext.js +0 -17
- package/lib-amd/components/AccordionItem/AccordionItemContext.js.map +0 -1
- package/lib-amd/components/AccordionItem/index.js +0 -12
- package/lib-amd/components/AccordionItem/index.js.map +0 -1
- package/lib-amd/components/AccordionItem/renderAccordionItem.js +0 -15
- package/lib-amd/components/AccordionItem/renderAccordionItem.js.map +0 -1
- package/lib-amd/components/AccordionItem/useAccordionItem.js +0 -27
- package/lib-amd/components/AccordionItem/useAccordionItem.js.map +0 -1
- package/lib-amd/components/AccordionItem/useAccordionItemContextValues.js +0 -12
- package/lib-amd/components/AccordionItem/useAccordionItemContextValues.js.map +0 -1
- package/lib-amd/components/AccordionItem/useAccordionItemStyles.js +0 -14
- package/lib-amd/components/AccordionItem/useAccordionItemStyles.js.map +0 -1
- package/lib-amd/components/AccordionPanel/AccordionPanel.js +0 -17
- package/lib-amd/components/AccordionPanel/AccordionPanel.js.map +0 -1
- package/lib-amd/components/AccordionPanel/AccordionPanel.types.js +0 -5
- package/lib-amd/components/AccordionPanel/AccordionPanel.types.js.map +0 -1
- package/lib-amd/components/AccordionPanel/index.js +0 -10
- package/lib-amd/components/AccordionPanel/index.js.map +0 -1
- package/lib-amd/components/AccordionPanel/renderAccordionPanel.js +0 -14
- package/lib-amd/components/AccordionPanel/renderAccordionPanel.js.map +0 -1
- package/lib-amd/components/AccordionPanel/useAccordionPanel.js +0 -24
- package/lib-amd/components/AccordionPanel/useAccordionPanel.js.map +0 -1
- package/lib-amd/components/AccordionPanel/useAccordionPanelStyles.js +0 -22
- package/lib-amd/components/AccordionPanel/useAccordionPanelStyles.js.map +0 -1
- package/lib-amd/index.js +0 -33
- package/lib-amd/index.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-accordion/src/components/Accordion/Accordion.tsx"],"names":[],"mappings":";;;;IASA;;OAEG;IACU,QAAA,SAAS,GAAwC,KAAK,CAAC,UAAU,CAC5E,UAAC,KAAK,EAAE,GAAG;QACT,IAAM,KAAK,GAAG,oCAAqB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAChD,IAAM,aAAa,GAAG,8DAAkC,CAAC,KAAK,CAAC,CAAC;QAEhE,gDAA2B,CAAC,KAAK,CAAC,CAAC;QAE3B,IAA6B,eAAe,GAAK,oDAA4B,EAAE,4BAAnC,CAAoC;QACxF,eAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,0CAAwB,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IACxD,CAAC,CACF,CAAC;IAEF,iBAAS,CAAC,WAAW,GAAG,WAAW,CAAC","sourcesContent":["import * as React from 'react';\nimport { renderAccordion_unstable } from './renderAccordion';\nimport { useAccordion_unstable } from './useAccordion';\nimport { useAccordionContextValues_unstable } from './useAccordionContextValues';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\nimport { useAccordionStyles_unstable } from './useAccordionStyles';\nimport type { AccordionProps } from './Accordion.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled Accordion, using the `useAccordion_unstable` and `useAccordionStyles_unstable` hooks.\n */\nexport const Accordion: ForwardRefComponent<AccordionProps> = React.forwardRef<HTMLDivElement, AccordionProps>(\n (props, ref) => {\n const state = useAccordion_unstable(props, ref);\n const contextValues = useAccordionContextValues_unstable(state);\n\n useAccordionStyles_unstable(state);\n\n const { useAccordionStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderAccordion_unstable(state, contextValues);\n },\n);\n\nAccordion.displayName = 'Accordion';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-accordion/src/components/Accordion/Accordion.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { AccordionItemValue } from '../AccordionItem/AccordionItem.types';\n\nexport type AccordionIndex = number | number[];\n\nexport type AccordionToggleEvent<E = HTMLElement> = React.MouseEvent<E> | React.KeyboardEvent<E>;\n\nexport type AccordionToggleEventHandler = (event: AccordionToggleEvent, data: AccordionToggleData) => void;\n\nexport type AccordionContextValue = Required<Pick<AccordionProps, 'collapsible'>> &\n Pick<AccordionProps, 'navigation'> & {\n /**\n * The list of opened panels by index\n */\n openItems: AccordionItemValue[];\n /**\n * Callback used by AccordionItem to request a change on it's own opened state\n * Should be used to toggle AccordionItem\n */\n requestToggle: (event: AccordionToggleEvent, data: AccordionToggleData) => void;\n };\n\nexport type AccordionContextValues = {\n accordion: AccordionContextValue;\n};\n\nexport type AccordionSlots = {\n root: Slot<'div'>;\n};\n\nexport type AccordionToggleData = {\n value: AccordionItemValue;\n};\n\nexport type AccordionProps = ComponentProps<AccordionSlots> & {\n /**\n * Default value for the uncontrolled state of the panel.\n */\n defaultOpenItems?: AccordionItemValue | AccordionItemValue[];\n\n /**\n * Indicates if Accordion support multiple Panels closed at the same time.\n */\n collapsible?: boolean;\n\n /**\n * Indicates if Accordion support multiple Panels opened at the same time.\n */\n multiple?: boolean;\n\n /**\n * Indicates if keyboard navigation is available and gives two options, linear or circular navigation.\n */\n navigation?: 'linear' | 'circular';\n\n /**\n * Callback to be called when the opened items change.\n */\n onToggle?: AccordionToggleEventHandler;\n\n /**\n * Controls the state of the panel.\n */\n openItems?: AccordionItemValue | AccordionItemValue[];\n};\n\nexport type AccordionState = ComponentState<AccordionSlots> & AccordionContextValue;\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "@fluentui/react-context-selector"], function (require, exports, react_context_selector_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useAccordionContext_unstable = exports.AccordionProvider = exports.AccordionContext = void 0;
|
|
5
|
-
exports.AccordionContext = react_context_selector_1.createContext(undefined);
|
|
6
|
-
var accordionContextDefaultValue = {
|
|
7
|
-
openItems: [],
|
|
8
|
-
collapsible: false,
|
|
9
|
-
requestToggle: function () {
|
|
10
|
-
/* noop */
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
exports.AccordionProvider = exports.AccordionContext.Provider;
|
|
14
|
-
var useAccordionContext_unstable = function (selector) {
|
|
15
|
-
return react_context_selector_1.useContextSelector(exports.AccordionContext, function (ctx) {
|
|
16
|
-
if (ctx === void 0) { ctx = accordionContextDefaultValue; }
|
|
17
|
-
return selector(ctx);
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
exports.useAccordionContext_unstable = useAccordionContext_unstable;
|
|
21
|
-
});
|
|
22
|
-
//# sourceMappingURL=AccordionContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionContext.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-accordion/src/components/Accordion/AccordionContext.ts"],"names":[],"mappings":";;;;IAIa,QAAA,gBAAgB,GAAmC,sCAAa,CAC3E,SAAS,CACwB,CAAC;IAEpC,IAAM,4BAA4B,GAA0B;QAC1D,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,KAAK;QAClB,aAAa;YACX,UAAU;QACZ,CAAC;KACF,CAAC;IAEW,QAAA,iBAAiB,GAAG,wBAAgB,CAAC,QAAQ,CAAC;IACpD,IAAM,4BAA4B,GAAG,UAAI,QAAmD;QACjG,OAAA,2CAAkB,CAAC,wBAAgB,EAAE,UAAC,GAAkC;YAAlC,oBAAA,EAAA,kCAAkC;YAAK,OAAA,QAAQ,CAAC,GAAG,CAAC;QAAb,CAAa,CAAC;IAA3F,CAA2F,CAAC;IADjF,QAAA,4BAA4B,gCACqD","sourcesContent":["import { createContext, ContextSelector, useContextSelector } from '@fluentui/react-context-selector';\nimport type { Context } from '@fluentui/react-context-selector';\nimport type { AccordionContextValue } from './Accordion.types';\n\nexport const AccordionContext: Context<AccordionContextValue> = createContext<AccordionContextValue | undefined>(\n undefined,\n) as Context<AccordionContextValue>;\n\nconst accordionContextDefaultValue: AccordionContextValue = {\n openItems: [],\n collapsible: false,\n requestToggle() {\n /* noop */\n },\n};\n\nexport const AccordionProvider = AccordionContext.Provider;\nexport const useAccordionContext_unstable = <T>(selector: ContextSelector<AccordionContextValue, T>): T =>\n useContextSelector(AccordionContext, (ctx = accordionContextDefaultValue) => selector(ctx));\n"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "./Accordion", "./Accordion.types", "./renderAccordion", "./useAccordion", "./useAccordionStyles", "./useAccordionContextValues", "./AccordionContext"], function (require, exports, tslib_1, Accordion_1, Accordion_types_1, renderAccordion_1, useAccordion_1, useAccordionStyles_1, useAccordionContextValues_1, AccordionContext_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
tslib_1.__exportStar(Accordion_1, exports);
|
|
5
|
-
tslib_1.__exportStar(Accordion_types_1, exports);
|
|
6
|
-
tslib_1.__exportStar(renderAccordion_1, exports);
|
|
7
|
-
tslib_1.__exportStar(useAccordion_1, exports);
|
|
8
|
-
tslib_1.__exportStar(useAccordionStyles_1, exports);
|
|
9
|
-
tslib_1.__exportStar(useAccordionContextValues_1, exports);
|
|
10
|
-
tslib_1.__exportStar(AccordionContext_1, exports);
|
|
11
|
-
});
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-accordion/src/components/Accordion/index.ts"],"names":[],"mappings":";;;IAAA,2CAA4B;IAC5B,iDAAkC;IAClC,iDAAkC;IAClC,8CAA+B;IAC/B,oDAAqC;IACrC,2DAA4C;IAC5C,kDAAmC","sourcesContent":["export * from './Accordion';\nexport * from './Accordion.types';\nexport * from './renderAccordion';\nexport * from './useAccordion';\nexport * from './useAccordionStyles';\nexport * from './useAccordionContextValues';\nexport * from './AccordionContext';\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "./AccordionContext"], function (require, exports, tslib_1, React, react_utilities_1, AccordionContext_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.renderAccordion_unstable = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Function that renders the final JSX of the component
|
|
7
|
-
*/
|
|
8
|
-
var renderAccordion_unstable = function (state, contextValues) {
|
|
9
|
-
var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
|
|
10
|
-
return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
|
|
11
|
-
React.createElement(AccordionContext_1.AccordionContext.Provider, { value: contextValues.accordion }, slotProps.root.children)));
|
|
12
|
-
};
|
|
13
|
-
exports.renderAccordion_unstable = renderAccordion_unstable;
|
|
14
|
-
});
|
|
15
|
-
//# sourceMappingURL=renderAccordion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderAccordion.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-accordion/src/components/Accordion/renderAccordion.tsx"],"names":[],"mappings":";;;;IAMA;;OAEG;IACI,IAAM,wBAAwB,GAAG,UAAC,KAAqB,EAAE,aAAqC;QAC7F,IAAA,KAAuB,0BAAQ,CAAiB,KAAK,CAAC,EAApD,KAAK,WAAA,EAAE,SAAS,eAAoC,CAAC;QAE7D,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC5B,oBAAC,mCAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,CAAC,SAAS,IAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,CAA6B,CACrG,CACd,CAAC;IACJ,CAAC,CAAC;IARW,QAAA,wBAAwB,4BAQnC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\n\nimport { AccordionContext } from './AccordionContext';\nimport type { AccordionState, AccordionSlots, AccordionContextValues } from './Accordion.types';\n\n/**\n * Function that renders the final JSX of the component\n */\nexport const renderAccordion_unstable = (state: AccordionState, contextValues: AccordionContextValues) => {\n const { slots, slotProps } = getSlots<AccordionSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <AccordionContext.Provider value={contextValues.accordion}>{slotProps.root.children}</AccordionContext.Provider>\n </slots.root>\n );\n};\n"]}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "@fluentui/react-tabster"], function (require, exports, tslib_1, React, react_utilities_1, react_tabster_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useAccordion_unstable = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Returns the props and state required to render the component
|
|
7
|
-
* @param props - Accordion properties
|
|
8
|
-
* @param ref - reference to root HTMLElement of Accordion
|
|
9
|
-
*/
|
|
10
|
-
var useAccordion_unstable = function (props, ref) {
|
|
11
|
-
var controlledOpenItems = props.openItems, defaultOpenItems = props.defaultOpenItems, _a = props.multiple, multiple = _a === void 0 ? false : _a, _b = props.collapsible, collapsible = _b === void 0 ? false : _b, onToggle = props.onToggle, navigation = props.navigation;
|
|
12
|
-
var _c = react_utilities_1.useControllableState({
|
|
13
|
-
state: React.useMemo(function () { return normalizeValues(controlledOpenItems); }, [controlledOpenItems]),
|
|
14
|
-
defaultState: function () { return initializeUncontrolledOpenItems({ defaultOpenItems: defaultOpenItems, multiple: multiple }); },
|
|
15
|
-
initialState: [],
|
|
16
|
-
}), openItems = _c[0], setOpenItems = _c[1];
|
|
17
|
-
var arrowNavigationProps = react_tabster_1.useArrowNavigationGroup({
|
|
18
|
-
circular: navigation === 'circular',
|
|
19
|
-
tabbable: true,
|
|
20
|
-
});
|
|
21
|
-
var requestToggle = react_utilities_1.useEventCallback(function (event, data) {
|
|
22
|
-
onToggle === null || onToggle === void 0 ? void 0 : onToggle(event, data);
|
|
23
|
-
setOpenItems(function (previousOpenItems) { return updateOpenItems(data.value, previousOpenItems, multiple, collapsible); });
|
|
24
|
-
});
|
|
25
|
-
return {
|
|
26
|
-
collapsible: collapsible,
|
|
27
|
-
navigation: navigation,
|
|
28
|
-
openItems: openItems,
|
|
29
|
-
requestToggle: requestToggle,
|
|
30
|
-
components: {
|
|
31
|
-
root: 'div',
|
|
32
|
-
},
|
|
33
|
-
root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, props), (navigation ? arrowNavigationProps : {})), { ref: ref })),
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
exports.useAccordion_unstable = useAccordion_unstable;
|
|
37
|
-
/**
|
|
38
|
-
* Initial value for the uncontrolled case of the list of open indexes
|
|
39
|
-
*/
|
|
40
|
-
function initializeUncontrolledOpenItems(_a) {
|
|
41
|
-
var defaultOpenItems = _a.defaultOpenItems, multiple = _a.multiple;
|
|
42
|
-
if (defaultOpenItems !== undefined) {
|
|
43
|
-
if (Array.isArray(defaultOpenItems)) {
|
|
44
|
-
return multiple ? defaultOpenItems : [defaultOpenItems[0]];
|
|
45
|
-
}
|
|
46
|
-
return [defaultOpenItems];
|
|
47
|
-
}
|
|
48
|
-
return [];
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Updates the list of open indexes based on an index that changes
|
|
52
|
-
* @param value - the index that will change
|
|
53
|
-
* @param previousOpenItems - list of current open indexes
|
|
54
|
-
* @param multiple - if Accordion support multiple Panels opened at the same time
|
|
55
|
-
* @param collapsible - if Accordion support multiple Panels closed at the same time
|
|
56
|
-
*/
|
|
57
|
-
function updateOpenItems(value, previousOpenItems, multiple, collapsible) {
|
|
58
|
-
if (multiple) {
|
|
59
|
-
if (previousOpenItems.includes(value)) {
|
|
60
|
-
if (previousOpenItems.length > 1 || collapsible) {
|
|
61
|
-
return previousOpenItems.filter(function (i) { return i !== value; });
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
return tslib_1.__spreadArray(tslib_1.__spreadArray([], previousOpenItems), [value]).sort();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
return previousOpenItems[0] === value && collapsible ? [] : [value];
|
|
70
|
-
}
|
|
71
|
-
return previousOpenItems;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Normalizes Accordion index into an array of indexes
|
|
75
|
-
*/
|
|
76
|
-
function normalizeValues(index) {
|
|
77
|
-
if (index === undefined) {
|
|
78
|
-
return undefined;
|
|
79
|
-
}
|
|
80
|
-
return Array.isArray(index) ? index : [index];
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
//# sourceMappingURL=useAccordion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAccordion.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-accordion/src/components/Accordion/useAccordion.ts"],"names":[],"mappings":";;;;IAMA;;;;OAIG;IACI,IAAM,qBAAqB,GAAG,UAAC,KAAqB,EAAE,GAA2B;QAEpF,IAAW,mBAAmB,GAM5B,KAAK,UANuB,EAC9B,gBAAgB,GAKd,KAAK,iBALS,EAChB,KAIE,KAAK,SAJS,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,K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ent":["import * as React from 'react';\nimport { getNativeElementProps, useControllableState, useEventCallback } from '@fluentui/react-utilities';\nimport type { AccordionProps, AccordionState, AccordionToggleData, AccordionToggleEvent } from './Accordion.types';\nimport type { AccordionItemValue } from '../AccordionItem/AccordionItem.types';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\n\n/**\n * Returns the props and state required to render the component\n * @param props - Accordion properties\n * @param ref - reference to root HTMLElement of Accordion\n */\nexport const useAccordion_unstable = (props: AccordionProps, ref: React.Ref<HTMLElement>): AccordionState => {\n const {\n openItems: controlledOpenItems,\n defaultOpenItems,\n multiple = false,\n collapsible = false,\n onToggle,\n navigation,\n } = props;\n const [openItems, setOpenItems] = useControllableState({\n state: React.useMemo(() => normalizeValues(controlledOpenItems), [controlledOpenItems]),\n defaultState: () => initializeUncontrolledOpenItems({ defaultOpenItems, multiple }),\n initialState: [],\n });\n\n const arrowNavigationProps = useArrowNavigationGroup({\n circular: navigation === 'circular',\n tabbable: true,\n });\n\n const requestToggle = useEventCallback((event: AccordionToggleEvent, data: AccordionToggleData) => {\n onToggle?.(event, data);\n setOpenItems(previousOpenItems => updateOpenItems(data.value, previousOpenItems, multiple, collapsible));\n });\n\n return {\n collapsible,\n navigation,\n openItems,\n requestToggle,\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ...props,\n ...(navigation ? arrowNavigationProps : {}),\n ref,\n }),\n };\n};\n\n/**\n * Initial value for the uncontrolled case of the list of open indexes\n */\nfunction initializeUncontrolledOpenItems({\n defaultOpenItems,\n multiple,\n}: Pick<AccordionProps, 'defaultOpenItems' | 'multiple'>): AccordionItemValue[] {\n if (defaultOpenItems !== undefined) {\n if (Array.isArray(defaultOpenItems)) {\n return multiple ? defaultOpenItems : [defaultOpenItems[0]];\n }\n return [defaultOpenItems];\n }\n return [];\n}\n\n/**\n * Updates the list of open indexes based on an index that changes\n * @param value - the index that will change\n * @param previousOpenItems - list of current open indexes\n * @param multiple - if Accordion support multiple Panels opened at the same time\n * @param collapsible - if Accordion support multiple Panels closed at the same time\n */\nfunction updateOpenItems(\n value: AccordionItemValue,\n previousOpenItems: AccordionItemValue[],\n multiple: boolean,\n collapsible: boolean,\n) {\n if (multiple) {\n if (previousOpenItems.includes(value)) {\n if (previousOpenItems.length > 1 || collapsible) {\n return previousOpenItems.filter(i => i !== value);\n }\n } else {\n return [...previousOpenItems, value].sort();\n }\n } else {\n return previousOpenItems[0] === value && collapsible ? [] : [value];\n }\n return previousOpenItems;\n}\n\n/**\n * Normalizes Accordion index into an array of indexes\n */\nfunction normalizeValues(index?: AccordionItemValue | AccordionItemValue[]): AccordionItemValue[] | undefined {\n if (index === undefined) {\n return undefined;\n }\n return Array.isArray(index) ? index : [index];\n}\n"]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
define(["require", "exports"], function (require, exports) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useAccordionContextValues_unstable = void 0;
|
|
5
|
-
function useAccordionContextValues_unstable(state) {
|
|
6
|
-
var navigation = state.navigation, openItems = state.openItems, requestToggle = state.requestToggle, collapsible = state.collapsible;
|
|
7
|
-
// This context is created with "@fluentui/react-context-selector", these is no sense to memoize it
|
|
8
|
-
var accordion = {
|
|
9
|
-
navigation: navigation,
|
|
10
|
-
openItems: openItems,
|
|
11
|
-
requestToggle: requestToggle,
|
|
12
|
-
collapsible: collapsible,
|
|
13
|
-
};
|
|
14
|
-
return { accordion: accordion };
|
|
15
|
-
}
|
|
16
|
-
exports.useAccordionContextValues_unstable = useAccordionContextValues_unstable;
|
|
17
|
-
});
|
|
18
|
-
//# sourceMappingURL=useAccordionContextValues.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAccordionContextValues.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-accordion/src/components/Accordion/useAccordionContextValues.ts"],"names":[],"mappings":";;;;IAEA,SAAgB,kCAAkC,CAAC,KAAqB;QAC9D,IAAA,UAAU,GAA4C,KAAK,WAAjD,EAAE,SAAS,GAAiC,KAAK,UAAtC,EAAE,aAAa,GAAkB,KAAK,cAAvB,EAAE,WAAW,GAAK,KAAK,YAAV,CAAW;QAEpE,mGAAmG;QACnG,IAAM,SAAS,GAA0B;YACvC,UAAU,YAAA;YACV,SAAS,WAAA;YACT,aAAa,eAAA;YACb,WAAW,aAAA;SACZ,CAAC;QAEF,OAAO,EAAE,SAAS,WAAA,EAAE,CAAC;IACvB,CAAC;IAZD,gFAYC","sourcesContent":["import type { AccordionContextValue, AccordionContextValues, AccordionState } from './Accordion.types';\n\nexport function useAccordionContextValues_unstable(state: AccordionState): AccordionContextValues {\n const { navigation, openItems, requestToggle, collapsible } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", these is no sense to memoize it\n const accordion: AccordionContextValue = {\n navigation,\n openItems,\n requestToggle,\n collapsible,\n };\n\n return { accordion };\n}\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "@griffel/react"], function (require, exports, react_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useAccordionStyles_unstable = exports.accordionClassNames = void 0;
|
|
5
|
-
exports.accordionClassNames = {
|
|
6
|
-
root: 'fui-Accordion',
|
|
7
|
-
};
|
|
8
|
-
var useAccordionStyles_unstable = function (state) {
|
|
9
|
-
state.root.className = react_1.mergeClasses(exports.accordionClassNames.root, state.root.className);
|
|
10
|
-
return state;
|
|
11
|
-
};
|
|
12
|
-
exports.useAccordionStyles_unstable = useAccordionStyles_unstable;
|
|
13
|
-
});
|
|
14
|
-
//# sourceMappingURL=useAccordionStyles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAccordionStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-accordion/src/components/Accordion/useAccordionStyles.ts"],"names":[],"mappings":";;;;IAIa,QAAA,mBAAmB,GAAmC;QACjE,IAAI,EAAE,eAAe;KACtB,CAAC;IAEK,IAAM,2BAA2B,GAAG,UAAC,KAAqB;QAC/D,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CAAC,2BAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAEpF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAJW,QAAA,2BAA2B,+BAItC","sourcesContent":["import type { SlotClassNames } from '@fluentui/react-utilities';\nimport { mergeClasses } from '@griffel/react';\nimport type { AccordionSlots, AccordionState } from './Accordion.types';\n\nexport const accordionClassNames: SlotClassNames<AccordionSlots> = {\n root: 'fui-Accordion',\n};\n\nexport const useAccordionStyles_unstable = (state: AccordionState) => {\n state.root.className = mergeClasses(accordionClassNames.root, state.root.className);\n\n return state;\n};\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "react", "./useAccordionHeader", "./renderAccordionHeader", "./useAccordionHeaderStyles", "@fluentui/react-shared-contexts", "./useAccordionHeaderContextValues"], function (require, exports, React, useAccordionHeader_1, renderAccordionHeader_1, useAccordionHeaderStyles_1, react_shared_contexts_1, useAccordionHeaderContextValues_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.AccordionHeader = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Define a styled AccordionHeader, using the `useAccordionHeader_unstable` and `useAccordionHeaderStyles_unstable`
|
|
7
|
-
* hooks.
|
|
8
|
-
*/
|
|
9
|
-
exports.AccordionHeader = React.forwardRef(function (props, ref) {
|
|
10
|
-
var state = useAccordionHeader_1.useAccordionHeader_unstable(props, ref);
|
|
11
|
-
var contextValues = useAccordionHeaderContextValues_1.useAccordionHeaderContextValues_unstable(state);
|
|
12
|
-
useAccordionHeaderStyles_1.useAccordionHeaderStyles_unstable(state);
|
|
13
|
-
var useCustomStyles = react_shared_contexts_1.useCustomStyleHooks_unstable().useAccordionHeaderStyles_unstable;
|
|
14
|
-
useCustomStyles(state);
|
|
15
|
-
return renderAccordionHeader_1.renderAccordionHeader_unstable(state, contextValues);
|
|
16
|
-
});
|
|
17
|
-
exports.AccordionHeader.displayName = 'AccordionHeader';
|
|
18
|
-
});
|
|
19
|
-
//# sourceMappingURL=AccordionHeader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionHeader.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-accordion/src/components/AccordionHeader/AccordionHeader.tsx"],"names":[],"mappings":";;;;IASA;;;OAGG;IACU,QAAA,eAAe,GAA8C,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QACpG,IAAM,KAAK,GAAG,gDAA2B,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACtD,IAAM,aAAa,GAAG,0EAAwC,CAAC,KAAK,CAAC,CAAC;QAEtE,4DAAiC,CAAC,KAAK,CAAC,CAAC;QAEjC,IAAmC,eAAe,GAAK,oDAA4B,EAAE,kCAAnC,CAAoC;QAC9F,eAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,sDAA8B,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,uBAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["import * as React from 'react';\nimport { useAccordionHeader_unstable } from './useAccordionHeader';\nimport { renderAccordionHeader_unstable } from './renderAccordionHeader';\nimport { useAccordionHeaderStyles_unstable } from './useAccordionHeaderStyles';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\nimport { useAccordionHeaderContextValues_unstable } from './useAccordionHeaderContextValues';\nimport type { AccordionHeaderProps } from './AccordionHeader.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled AccordionHeader, using the `useAccordionHeader_unstable` and `useAccordionHeaderStyles_unstable`\n * hooks.\n */\nexport const AccordionHeader: ForwardRefComponent<AccordionHeaderProps> = React.forwardRef((props, ref) => {\n const state = useAccordionHeader_unstable(props, ref);\n const contextValues = useAccordionHeaderContextValues_unstable(state);\n\n useAccordionHeaderStyles_unstable(state);\n\n const { useAccordionHeaderStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderAccordionHeader_unstable(state, contextValues);\n});\n\nAccordionHeader.displayName = 'AccordionHeader';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionHeader.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-accordion/src/components/AccordionHeader/AccordionHeader.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { ARIAButtonSlotProps } from '@fluentui/react-aria';\n\nexport type AccordionHeaderSize = 'small' | 'medium' | 'large' | 'extra-large';\nexport type AccordionHeaderExpandIconPosition = 'start' | 'end';\n\nexport type AccordionHeaderContextValue = Required<Pick<AccordionHeaderProps, 'expandIconPosition' | 'size'>> & {\n disabled: boolean;\n open: boolean;\n};\n\nexport type AccordionHeaderContextValues = {\n accordionHeader: AccordionHeaderContextValue;\n};\n\nexport type AccordionHeaderSlots = {\n /**\n * The element wrapping the button. By default this is a div, but can be a heading.\n */\n root: Slot<'div', 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'>;\n /**\n * The component to be used as button in heading\n */\n button: NonNullable<Slot<ARIAButtonSlotProps<'a'>>>;\n /**\n * Expand icon slot rendered before (or after) children content in heading.\n */\n expandIcon: Slot<'span'>;\n /**\n * Expand icon slot rendered before (or after) children content in heading.\n */\n icon?: Slot<'div'>;\n};\n\nexport type AccordionHeaderProps = ComponentProps<Partial<AccordionHeaderSlots>> & {\n /**\n * The position of the expand icon slot in heading.\n */\n expandIconPosition?: AccordionHeaderExpandIconPosition;\n\n /**\n * Indicates if the AccordionHeader should be rendered inline.\n */\n inline?: boolean;\n\n /**\n * Size of spacing in the heading.\n */\n size?: AccordionHeaderSize;\n};\n\nexport type AccordionHeaderState = ComponentState<AccordionHeaderSlots> &\n Required<Pick<AccordionHeaderProps, 'inline'>> &\n AccordionHeaderContextValue;\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "react"], function (require, exports, React) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useAccordionHeaderContext = exports.AccordionHeaderContext = void 0;
|
|
5
|
-
exports.AccordionHeaderContext = React.createContext(undefined);
|
|
6
|
-
var accordionHeaderContextDefaultValue = {
|
|
7
|
-
open: false,
|
|
8
|
-
disabled: false,
|
|
9
|
-
size: 'medium',
|
|
10
|
-
expandIconPosition: 'start',
|
|
11
|
-
};
|
|
12
|
-
var useAccordionHeaderContext = function () { var _a; return (_a = React.useContext(exports.AccordionHeaderContext)) !== null && _a !== void 0 ? _a : accordionHeaderContextDefaultValue; };
|
|
13
|
-
exports.useAccordionHeaderContext = useAccordionHeaderContext;
|
|
14
|
-
});
|
|
15
|
-
//# sourceMappingURL=AccordionHeaderContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionHeaderContext.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-accordion/src/components/AccordionHeader/AccordionHeaderContext.ts"],"names":[],"mappings":";;;;IAGa,QAAA,sBAAsB,GAAG,KAAK,CAAC,aAAa,CAA0C,SAAS,CAAC,CAAC;IAE9G,IAAM,kCAAkC,GAAG;QACzC,IAAI,EAAE,KAAK;QACX,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,QAAQ;QACd,kBAAkB,EAAE,OAAO;KAC5B,CAAC;IAEK,IAAM,yBAAyB,GAAG,sBACvC,OAAA,MAAA,KAAK,CAAC,UAAU,CAAC,8BAAsB,CAAC,mCAAI,kCAAkC,CAAA,EAAA,CAAC;IADpE,QAAA,yBAAyB,6BAC2C","sourcesContent":["import * as React from 'react';\nimport type { AccordionHeaderContextValue } from './AccordionHeader.types';\n\nexport const AccordionHeaderContext = React.createContext<AccordionHeaderContextValue | undefined>(undefined);\n\nconst accordionHeaderContextDefaultValue = {\n open: false,\n disabled: false,\n size: 'medium',\n expandIconPosition: 'start',\n};\n\nexport const useAccordionHeaderContext = () =>\n React.useContext(AccordionHeaderContext) ?? accordionHeaderContextDefaultValue;\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "./AccordionHeader", "./AccordionHeader.types", "./renderAccordionHeader", "./useAccordionHeader", "./useAccordionHeaderContextValues", "./useAccordionHeaderStyles"], function (require, exports, tslib_1, AccordionHeader_1, AccordionHeader_types_1, renderAccordionHeader_1, useAccordionHeader_1, useAccordionHeaderContextValues_1, useAccordionHeaderStyles_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
tslib_1.__exportStar(AccordionHeader_1, exports);
|
|
5
|
-
tslib_1.__exportStar(AccordionHeader_types_1, exports);
|
|
6
|
-
tslib_1.__exportStar(renderAccordionHeader_1, exports);
|
|
7
|
-
tslib_1.__exportStar(useAccordionHeader_1, exports);
|
|
8
|
-
tslib_1.__exportStar(useAccordionHeaderContextValues_1, exports);
|
|
9
|
-
tslib_1.__exportStar(useAccordionHeaderStyles_1, exports);
|
|
10
|
-
});
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-accordion/src/components/AccordionHeader/index.ts"],"names":[],"mappings":";;;IAAA,iDAAkC;IAClC,uDAAwC;IACxC,uDAAwC;IACxC,oDAAqC;IACrC,iEAAkD;IAClD,0DAA2C","sourcesContent":["export * from './AccordionHeader';\nexport * from './AccordionHeader.types';\nexport * from './renderAccordionHeader';\nexport * from './useAccordionHeader';\nexport * from './useAccordionHeaderContextValues';\nexport * from './useAccordionHeaderStyles';\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "./AccordionHeaderContext"], function (require, exports, tslib_1, React, react_utilities_1, AccordionHeaderContext_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.renderAccordionHeader_unstable = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Function that renders the final JSX of the component
|
|
7
|
-
*/
|
|
8
|
-
var renderAccordionHeader_unstable = function (state, contextValues) {
|
|
9
|
-
var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
|
|
10
|
-
return (React.createElement(AccordionHeaderContext_1.AccordionHeaderContext.Provider, { value: contextValues.accordionHeader },
|
|
11
|
-
React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
|
|
12
|
-
React.createElement(slots.button, tslib_1.__assign({}, slotProps.button),
|
|
13
|
-
state.expandIconPosition === 'start' && React.createElement(slots.expandIcon, tslib_1.__assign({}, slotProps.expandIcon)),
|
|
14
|
-
slots.icon && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)),
|
|
15
|
-
slotProps.root.children,
|
|
16
|
-
state.expandIconPosition === 'end' && React.createElement(slots.expandIcon, tslib_1.__assign({}, slotProps.expandIcon))))));
|
|
17
|
-
};
|
|
18
|
-
exports.renderAccordionHeader_unstable = renderAccordionHeader_unstable;
|
|
19
|
-
});
|
|
20
|
-
//# sourceMappingURL=renderAccordionHeader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderAccordionHeader.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-accordion/src/components/AccordionHeader/renderAccordionHeader.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,8BAA8B,GAAG,UAC5C,KAA2B,EAC3B,aAA2C;QAErC,IAAA,KAAuB,0BAAQ,CAAuB,KAAK,CAAC,EAA1D,KAAK,WAAA,EAAE,SAAS,eAA0C,CAAC;QAEnE,OAAO,CACL,oBAAC,+CAAsB,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,CAAC,eAAe;YACnE,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;gBAC5B,oBAAC,KAAK,CAAC,MAAM,uBAAK,SAAS,CAAC,MAAM;oBAC/B,KAAK,CAAC,kBAAkB,KAAK,OAAO,IAAI,oBAAC,KAAK,CAAC,UAAU,uBAAK,SAAS,CAAC,UAAU,EAAI;oBACtF,KAAK,CAAC,IAAI,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI;oBAChD,SAAS,CAAC,IAAI,CAAC,QAAQ;oBACvB,KAAK,CAAC,kBAAkB,KAAK,KAAK,IAAI,oBAAC,KAAK,CAAC,UAAU,uBAAK,SAAS,CAAC,UAAU,EAAI,CACxE,CACJ,CACmB,CACnC,CAAC;IACJ,CAAC,CAAC;IAlBW,QAAA,8BAA8B,kCAkBzC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { AccordionHeaderContext } from './AccordionHeaderContext';\nimport type { AccordionHeaderState, AccordionHeaderSlots, AccordionHeaderContextValues } from './AccordionHeader.types';\n\n/**\n * Function that renders the final JSX of the component\n */\nexport const renderAccordionHeader_unstable = (\n state: AccordionHeaderState,\n contextValues: AccordionHeaderContextValues,\n) => {\n const { slots, slotProps } = getSlots<AccordionHeaderSlots>(state);\n\n return (\n <AccordionHeaderContext.Provider value={contextValues.accordionHeader}>\n <slots.root {...slotProps.root}>\n <slots.button {...slotProps.button}>\n {state.expandIconPosition === 'start' && <slots.expandIcon {...slotProps.expandIcon} />}\n {slots.icon && <slots.icon {...slotProps.icon} />}\n {slotProps.root.children}\n {state.expandIconPosition === 'end' && <slots.expandIcon {...slotProps.expandIcon} />}\n </slots.button>\n </slots.root>\n </AccordionHeaderContext.Provider>\n );\n};\n"]}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "../AccordionItem/index", "@fluentui/react-aria", "../Accordion/AccordionContext", "@fluentui/react-icons", "@fluentui/react-shared-contexts"], function (require, exports, tslib_1, React, react_utilities_1, index_1, react_aria_1, AccordionContext_1, react_icons_1, react_shared_contexts_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useAccordionHeader_unstable = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Returns the props and state required to render the component
|
|
7
|
-
* @param props - AccordionHeader properties
|
|
8
|
-
* @param ref - reference to root HTMLElement of AccordionHeader
|
|
9
|
-
*/
|
|
10
|
-
var useAccordionHeader_unstable = function (props, ref) {
|
|
11
|
-
var as = props.as, icon = props.icon, button = props.button, expandIcon = props.expandIcon, _a = props.inline, inline = _a === void 0 ? false : _a, _b = props.size, size = _b === void 0 ? 'medium' : _b, _c = props.expandIconPosition, expandIconPosition = _c === void 0 ? 'start' : _c;
|
|
12
|
-
var _d = index_1.useAccordionItemContext_unstable(), onAccordionHeaderClick = _d.onHeaderClick, disabled = _d.disabled, open = _d.open;
|
|
13
|
-
/**
|
|
14
|
-
* force disabled state on button if accordion isn't collapsible
|
|
15
|
-
* and this is the only item opened
|
|
16
|
-
*/
|
|
17
|
-
var disabledFocusable = AccordionContext_1.useAccordionContext_unstable(function (ctx) { return !ctx.collapsible && ctx.openItems.length === 1 && open; });
|
|
18
|
-
var dir = react_shared_contexts_1.useFluent_unstable().dir;
|
|
19
|
-
// Calculate how to rotate the expand icon [>] (ChevronRightRegular)
|
|
20
|
-
var expandIconRotation;
|
|
21
|
-
if (expandIconPosition === 'end') {
|
|
22
|
-
// If expand icon is at the end, the chevron points up [^] when open, and down [v] when closed
|
|
23
|
-
expandIconRotation = open ? -90 : 90;
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
// Otherwise, the chevron points down [v] when open, and right [>] (or left [<] in RTL) when closed
|
|
27
|
-
expandIconRotation = open ? 90 : dir !== 'rtl' ? 0 : 180;
|
|
28
|
-
}
|
|
29
|
-
var buttonShorthand = react_aria_1.useARIAButtonShorthand(button, {
|
|
30
|
-
required: true,
|
|
31
|
-
defaultProps: {
|
|
32
|
-
disabled: disabled,
|
|
33
|
-
disabledFocusable: disabledFocusable,
|
|
34
|
-
'aria-expanded': open,
|
|
35
|
-
type: 'button',
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
return {
|
|
39
|
-
disabled: disabled,
|
|
40
|
-
open: open,
|
|
41
|
-
size: size,
|
|
42
|
-
inline: inline,
|
|
43
|
-
expandIconPosition: expandIconPosition,
|
|
44
|
-
components: {
|
|
45
|
-
root: 'div',
|
|
46
|
-
button: 'button',
|
|
47
|
-
expandIcon: 'span',
|
|
48
|
-
icon: 'div',
|
|
49
|
-
},
|
|
50
|
-
root: react_utilities_1.getNativeElementProps(as || 'div', tslib_1.__assign({ ref: ref }, props)),
|
|
51
|
-
icon: react_utilities_1.resolveShorthand(icon),
|
|
52
|
-
expandIcon: react_utilities_1.resolveShorthand(expandIcon, {
|
|
53
|
-
required: true,
|
|
54
|
-
defaultProps: {
|
|
55
|
-
children: React.createElement(react_icons_1.ChevronRightRegular, { style: { transform: "rotate(" + expandIconRotation + "deg)" } }),
|
|
56
|
-
'aria-hidden': true,
|
|
57
|
-
},
|
|
58
|
-
}),
|
|
59
|
-
button: tslib_1.__assign(tslib_1.__assign({}, buttonShorthand), { onClick: react_utilities_1.useEventCallback(function (ev) {
|
|
60
|
-
var _a;
|
|
61
|
-
(_a = buttonShorthand.onClick) === null || _a === void 0 ? void 0 : _a.call(buttonShorthand, ev);
|
|
62
|
-
if (!ev.defaultPrevented) {
|
|
63
|
-
onAccordionHeaderClick(ev);
|
|
64
|
-
}
|
|
65
|
-
}) }),
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
exports.useAccordionHeader_unstable = useAccordionHeader_unstable;
|
|
69
|
-
});
|
|
70
|
-
//# sourceMappingURL=useAccordionHeader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAccordionHeader.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-accordion/src/components/AccordionHeader/useAccordionHeader.tsx"],"names":[],"mappings":";;;;IASA;;;;OAIG;IACI,IAAM,2BAA2B,GAAG,UACzC,KAA2B,EAC3B,GAA2B;QAEnB,IAAA,EAAE,GAA8F,KAAK,GAAnG,EAAE,IAAI,GAAwF,KAAK,KAA7F,EAAE,MAAM,GAAgF,KAAK,OAArF,EAAE,UAAU,GAAoE,KAAK,WAAzE,EAAE,KAAkE,KAAK,OAAzD,EAAd,MAAM,mBAAG,KAAK,KAAA,EAAE,KAAkD,KAAK,KAAxC,EAAf,IAAI,mBAAG,QAAQ,KAAA,EAAE,KAAiC,KAAK,mBAAV,EAA5B,kBAAkB,mBAAG,OAAO,KAAA,CAAW;QACxG,IAAA,KAA4D,wCAAgC,EAAE,EAA7E,sBAAsB,mBAAA,EAAE,QAAQ,cAAA,EAAE,IAAI,UAAuC,CAAC;QAErG;;;WAGG;QACH,IAAM,iBAAiB,GAAG,+CAA4B,CAAC,UAAA,GAAG,IAAI,OAAA,CAAC,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,EAAtD,CAAsD,CAAC,CAAC;QAE9G,IAAA,GAAG,GAAK,0CAAS,EAAE,IAAhB,CAAiB;QAE5B,oEAAoE;QACpE,IAAI,kBAAsC,CAAC;QAC3C,IAAI,kBAAkB,KAAK,KAAK,EAAE;YAChC,8FAA8F;YAC9F,kBAAkB,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACtC;aAAM;YACL,mGAAmG;YACnG,kBAAkB,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,C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'react';\nimport { getNativeElementProps, resolveShorthand, useEventCallback } from '@fluentui/react-utilities';\nimport { useAccordionItemContext_unstable } from '../AccordionItem/index';\nimport { useARIAButtonShorthand } from '@fluentui/react-aria';\nimport type { AccordionHeaderProps, AccordionHeaderState } from './AccordionHeader.types';\nimport { useAccordionContext_unstable } from '../Accordion/AccordionContext';\nimport { ChevronRightRegular } from '@fluentui/react-icons';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\n\n/**\n * Returns the props and state required to render the component\n * @param props - AccordionHeader properties\n * @param ref - reference to root HTMLElement of AccordionHeader\n */\nexport const useAccordionHeader_unstable = (\n props: AccordionHeaderProps,\n ref: React.Ref<HTMLElement>,\n): AccordionHeaderState => {\n const { as, icon, button, expandIcon, inline = false, size = 'medium', expandIconPosition = 'start' } = props;\n const { onHeaderClick: onAccordionHeaderClick, disabled, open } = useAccordionItemContext_unstable();\n\n /**\n * force disabled state on button if accordion isn't collapsible\n * and this is the only item opened\n */\n const disabledFocusable = useAccordionContext_unstable(ctx => !ctx.collapsible && ctx.openItems.length === 1 && open);\n\n const { dir } = useFluent();\n\n // Calculate how to rotate the expand icon [>] (ChevronRightRegular)\n let expandIconRotation: 0 | 90 | -90 | 180;\n if (expandIconPosition === 'end') {\n // If expand icon is at the end, the chevron points up [^] when open, and down [v] when closed\n expandIconRotation = open ? -90 : 90;\n } else {\n // Otherwise, the chevron points down [v] when open, and right [>] (or left [<] in RTL) when closed\n expandIconRotation = open ? 90 : dir !== 'rtl' ? 0 : 180;\n }\n\n const buttonShorthand = useARIAButtonShorthand(button, {\n required: true,\n defaultProps: {\n disabled,\n disabledFocusable,\n 'aria-expanded': open,\n type: 'button',\n },\n });\n\n return {\n disabled,\n open,\n size,\n inline,\n expandIconPosition,\n components: {\n root: 'div',\n button: 'button',\n expandIcon: 'span',\n icon: 'div',\n },\n root: getNativeElementProps(as || 'div', {\n ref,\n ...props,\n }),\n icon: resolveShorthand(icon),\n expandIcon: resolveShorthand(expandIcon, {\n required: true,\n defaultProps: {\n children: <ChevronRightRegular style={{ transform: `rotate(${expandIconRotation}deg)` }} />,\n 'aria-hidden': true,\n },\n }),\n button: {\n ...buttonShorthand,\n onClick: useEventCallback(\n (ev: React.MouseEvent<HTMLButtonElement & HTMLDivElement & HTMLSpanElement & HTMLAnchorElement>) => {\n buttonShorthand.onClick?.(ev);\n if (!ev.defaultPrevented) {\n onAccordionHeaderClick(ev);\n }\n },\n ),\n },\n };\n};\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "react"], function (require, exports, React) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useAccordionHeaderContextValues_unstable = void 0;
|
|
5
|
-
function useAccordionHeaderContextValues_unstable(state) {
|
|
6
|
-
var disabled = state.disabled, expandIconPosition = state.expandIconPosition, open = state.open, size = state.size;
|
|
7
|
-
var accordionHeader = React.useMemo(function () { return ({
|
|
8
|
-
disabled: disabled,
|
|
9
|
-
expandIconPosition: expandIconPosition,
|
|
10
|
-
open: open,
|
|
11
|
-
size: size,
|
|
12
|
-
}); }, [disabled, expandIconPosition, open, size]);
|
|
13
|
-
return { accordionHeader: accordionHeader };
|
|
14
|
-
}
|
|
15
|
-
exports.useAccordionHeaderContextValues_unstable = useAccordionHeaderContextValues_unstable;
|
|
16
|
-
});
|
|
17
|
-
//# sourceMappingURL=useAccordionHeaderContextValues.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAccordionHeaderContextValues.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-accordion/src/components/AccordionHeader/useAccordionHeaderContextValues.ts"],"names":[],"mappings":";;;;IAOA,SAAgB,wCAAwC,CAAC,KAA2B;QAC1E,IAAA,QAAQ,GAAqC,KAAK,SAA1C,EAAE,kBAAkB,GAAiB,KAAK,mBAAtB,EAAE,IAAI,GAAW,KAAK,KAAhB,EAAE,IAAI,GAAK,KAAK,KAAV,CAAW;QAE3D,IAAM,eAAe,GAAG,KAAK,CAAC,OAAO,CACnC,cAAM,OAAA,CAAC;YACL,QAAQ,UAAA;YACR,kBAAkB,oBAAA;YAClB,IAAI,MAAA;YACJ,IAAI,MAAA;SACL,CAAC,EALI,CAKJ,EACF,CAAC,QAAQ,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,CAAC,CAC3C,CAAC;QAEF,OAAO,EAAE,eAAe,iBAAA,EAAE,CAAC;IAC7B,CAAC;IAdD,4FAcC","sourcesContent":["import * as React from 'react';\nimport type {\n AccordionHeaderContextValue,\n AccordionHeaderState,\n AccordionHeaderContextValues,\n} from './AccordionHeader.types';\n\nexport function useAccordionHeaderContextValues_unstable(state: AccordionHeaderState): AccordionHeaderContextValues {\n const { disabled, expandIconPosition, open, size } = state;\n\n const accordionHeader = React.useMemo<AccordionHeaderContextValue>(\n () => ({\n disabled,\n expandIconPosition,\n open,\n size,\n }),\n [disabled, expandIconPosition, open, size],\n );\n\n return { accordionHeader };\n}\n"]}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "@griffel/react", "@fluentui/react-tabster", "@fluentui/react-theme"], function (require, exports, tslib_1, react_1, react_tabster_1, react_theme_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useAccordionHeaderStyles_unstable = exports.accordionHeaderClassNames = void 0;
|
|
5
|
-
exports.accordionHeaderClassNames = {
|
|
6
|
-
root: 'fui-AccordionHeader',
|
|
7
|
-
button: 'fui-AccordionHeader__button',
|
|
8
|
-
expandIcon: 'fui-AccordionHeader__expandIcon',
|
|
9
|
-
icon: 'fui-AccordionHeader__icon',
|
|
10
|
-
};
|
|
11
|
-
var useStyles = react_1.makeStyles({
|
|
12
|
-
// TODO: this should be extracted to another package
|
|
13
|
-
resetButton: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ boxSizing: 'content-box', backgroundColor: 'inherit', color: 'inherit', fontFamily: 'inherit', fontSize: 'inherit', lineHeight: 'normal' }, react_1.shorthands.overflow('visible')), react_1.shorthands.padding(0)), { WebkitAppearance: 'button', textAlign: 'unset' }),
|
|
14
|
-
focusIndicator: react_tabster_1.createFocusOutlineStyle(),
|
|
15
|
-
root: tslib_1.__assign(tslib_1.__assign({ color: react_theme_1.tokens.colorNeutralForeground1, backgroundColor: react_theme_1.tokens.colorTransparentBackground }, react_1.shorthands.margin(0)), react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusMedium)),
|
|
16
|
-
rootDisabled: {
|
|
17
|
-
backgroundImage: 'none',
|
|
18
|
-
color: react_theme_1.tokens.colorNeutralForegroundDisabled,
|
|
19
|
-
},
|
|
20
|
-
rootInline: {
|
|
21
|
-
display: 'inline-block',
|
|
22
|
-
},
|
|
23
|
-
button: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ position: 'relative', width: '100%' }, react_1.shorthands.border('1px', 'solid', 'transparent')), react_1.shorthands.padding(0, react_theme_1.tokens.spacingHorizontalM, 0, react_theme_1.tokens.spacingHorizontalMNudge)), { minHeight: '44px', display: 'flex', alignItems: 'center', cursor: 'pointer' }), react_theme_1.typographyStyles.body1), { boxSizing: 'border-box' }),
|
|
24
|
-
buttonSmall: {
|
|
25
|
-
minHeight: '32px',
|
|
26
|
-
fontSize: react_theme_1.tokens.fontSizeBase200,
|
|
27
|
-
},
|
|
28
|
-
buttonLarge: {
|
|
29
|
-
lineHeight: react_theme_1.tokens.lineHeightBase400,
|
|
30
|
-
fontSize: react_theme_1.tokens.fontSizeBase400,
|
|
31
|
-
},
|
|
32
|
-
buttonExtraLarge: {
|
|
33
|
-
lineHeight: react_theme_1.tokens.lineHeightBase500,
|
|
34
|
-
fontSize: react_theme_1.tokens.fontSizeBase500,
|
|
35
|
-
},
|
|
36
|
-
buttonInline: {
|
|
37
|
-
display: 'inline-flex',
|
|
38
|
-
},
|
|
39
|
-
buttonExpandIconEndNoIcon: {
|
|
40
|
-
paddingLeft: react_theme_1.tokens.spacingHorizontalM,
|
|
41
|
-
},
|
|
42
|
-
buttonExpandIconEnd: {
|
|
43
|
-
paddingRight: react_theme_1.tokens.spacingHorizontalMNudge,
|
|
44
|
-
},
|
|
45
|
-
expandIcon: {
|
|
46
|
-
height: '100%',
|
|
47
|
-
display: 'flex',
|
|
48
|
-
alignItems: 'center',
|
|
49
|
-
lineHeight: react_theme_1.tokens.lineHeightBase500,
|
|
50
|
-
fontSize: react_theme_1.tokens.fontSizeBase500,
|
|
51
|
-
},
|
|
52
|
-
expandIconStart: {
|
|
53
|
-
paddingRight: react_theme_1.tokens.spacingHorizontalS,
|
|
54
|
-
},
|
|
55
|
-
expandIconEnd: {
|
|
56
|
-
flexGrow: 1,
|
|
57
|
-
flexShrink: 1,
|
|
58
|
-
flexBasis: '0%',
|
|
59
|
-
display: 'flex',
|
|
60
|
-
justifyContent: 'flex-end',
|
|
61
|
-
paddingLeft: react_theme_1.tokens.spacingHorizontalS,
|
|
62
|
-
},
|
|
63
|
-
icon: {
|
|
64
|
-
height: '100%',
|
|
65
|
-
display: 'flex',
|
|
66
|
-
alignItems: 'center',
|
|
67
|
-
paddingRight: react_theme_1.tokens.spacingHorizontalS,
|
|
68
|
-
lineHeight: react_theme_1.tokens.lineHeightBase500,
|
|
69
|
-
fontSize: react_theme_1.tokens.fontSizeBase500,
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
|
-
/** Applies style classnames to slots */
|
|
73
|
-
var useAccordionHeaderStyles_unstable = function (state) {
|
|
74
|
-
var styles = useStyles();
|
|
75
|
-
state.root.className = react_1.mergeClasses(exports.accordionHeaderClassNames.root, styles.root, state.inline && styles.rootInline, state.disabled && styles.rootDisabled, state.root.className);
|
|
76
|
-
state.button.className = react_1.mergeClasses(exports.accordionHeaderClassNames.button, styles.resetButton, styles.button, styles.focusIndicator, state.expandIconPosition === 'end' && !state.icon && styles.buttonExpandIconEndNoIcon, state.expandIconPosition === 'end' && styles.buttonExpandIconEnd, state.inline && styles.buttonInline, state.size === 'small' && styles.buttonSmall, state.size === 'large' && styles.buttonLarge, state.size === 'extra-large' && styles.buttonExtraLarge, state.button.className);
|
|
77
|
-
if (state.expandIcon) {
|
|
78
|
-
state.expandIcon.className = react_1.mergeClasses(exports.accordionHeaderClassNames.expandIcon, styles.expandIcon, state.expandIconPosition === 'start' && styles.expandIconStart, state.expandIconPosition === 'end' && styles.expandIconEnd, state.expandIcon.className);
|
|
79
|
-
}
|
|
80
|
-
if (state.icon) {
|
|
81
|
-
state.icon.className = react_1.mergeClasses(exports.accordionHeaderClassNames.icon, styles.icon, state.icon.className);
|
|
82
|
-
}
|
|
83
|
-
return state;
|
|
84
|
-
};
|
|
85
|
-
exports.useAccordionHeaderStyles_unstable = useAccordionHeaderStyles_unstable;
|
|
86
|
-
});
|
|
87
|
-
//# sourceMappingURL=useAccordionHeaderStyles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAccordionHeaderStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-accordion/src/components/AccordionHeader/useAccordionHeaderStyles.ts"],"names":[],"mappings":";;;;IAMa,QAAA,yBAAyB,GAAyC;QAC7E,IAAI,EAAE,qBAAqB;QAC3B,MAAM,EAAE,6BAA6B;QACrC,UAAU,EAAE,iCAAiC;QAC7C,IAAI,EAAE,2BAA2B;KAClC,CAAC;IAEF,IAAM,SAAS,GAAG,kBAAU,CAAC;QAC3B,oDAAoD;QACpD,WAAW,uDACT,SAAS,EAAE,aAAa,EACxB,eAAe,EAAE,SAAS,EAC1B,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,SAAS,EACrB,QAAQ,EAAE,SAAS,EACnB,UAAU,EAAE,QAAQ,IACjB,kBAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,GAC9B,kBAAU,CAAC,OAAO,CAAC,CAAC,CAAC,KACxB,gBAAgB,EAAE,QAAQ,EAC1B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yBAAyB,EACrF,KAAK,CAAC,kBAAkB,KAAK,KAAK,IAAI,MAAM,CAAC,mBAAmB,EAChE,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,YAAY,EACnC,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,MAAM,CAAC,WAAW,EAC5C,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,MAAM,CAAC,WAAW,EAC5C,KAAK,CAAC,IAAI,KAAK,aAAa,IAAI,MAAM,CAAC,gBAAgB,EACvD,KAAK,CAAC,MAAM,CAAC,SAAS,CACvB,CAAC;QAEF,IAAI,KAAK,CAAC,UAAU,EAAE;YACpB,KAAK,CAAC,UAAU,CAAC,SAAS,GAAG,oBAAY,CACvC,iCAAyB,CAAC,UAAU,EACpC,MAAM,CAAC,UAAU,EACjB,KAAK,CAAC,kBAAkB,KAAK,OAAO,IAAI,MAAM,CAAC,eAAe,EAC9D,KAAK,CAAC,kBAAkB,KAAK,KAAK,IAAI,MAAM,CAAC,aAAa,EAC1D,KAAK,CAAC,UAAU,CAAC,SAAS,CAC3B,CAAC;SACH;QACD,IAAI,KAAK,CAAC,IAAI,EAAE;YACd,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CAAC,iCAAyB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACxG;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IArCW,QAAA,iCAAiC,qCAqC5C","sourcesContent":["import { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { AccordionHeaderSlots, AccordionHeaderState } from './AccordionHeader.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const accordionHeaderClassNames: SlotClassNames<AccordionHeaderSlots> = {\n root: 'fui-AccordionHeader',\n button: 'fui-AccordionHeader__button',\n expandIcon: 'fui-AccordionHeader__expandIcon',\n icon: 'fui-AccordionHeader__icon',\n};\n\nconst useStyles = makeStyles({\n // TODO: this should be extracted to another package\n resetButton: {\n boxSizing: 'content-box',\n backgroundColor: 'inherit',\n color: 'inherit',\n fontFamily: 'inherit',\n fontSize: 'inherit',\n lineHeight: 'normal',\n ...shorthands.overflow('visible'),\n ...shorthands.padding(0),\n WebkitAppearance: 'button',\n textAlign: 'unset',\n },\n focusIndicator: createFocusOutlineStyle(),\n root: {\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.margin(0),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n rootDisabled: {\n backgroundImage: 'none',\n color: tokens.colorNeutralForegroundDisabled,\n },\n rootInline: {\n display: 'inline-block',\n },\n button: {\n position: 'relative',\n width: '100%',\n ...shorthands.border('1px', 'solid', 'transparent'),\n ...shorthands.padding(0, tokens.spacingHorizontalM, 0, tokens.spacingHorizontalMNudge),\n minHeight: '44px',\n display: 'flex',\n alignItems: 'center',\n cursor: 'pointer',\n ...typographyStyles.body1,\n boxSizing: 'border-box',\n },\n buttonSmall: {\n minHeight: '32px',\n fontSize: tokens.fontSizeBase200,\n },\n buttonLarge: {\n lineHeight: tokens.lineHeightBase400,\n fontSize: tokens.fontSizeBase400,\n },\n buttonExtraLarge: {\n lineHeight: tokens.lineHeightBase500,\n fontSize: tokens.fontSizeBase500,\n },\n buttonInline: {\n display: 'inline-flex',\n },\n buttonExpandIconEndNoIcon: {\n paddingLeft: tokens.spacingHorizontalM,\n },\n buttonExpandIconEnd: {\n paddingRight: tokens.spacingHorizontalMNudge,\n },\n expandIcon: {\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n lineHeight: tokens.lineHeightBase500,\n fontSize: tokens.fontSizeBase500,\n },\n expandIconStart: {\n paddingRight: tokens.spacingHorizontalS,\n },\n expandIconEnd: {\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: '0%',\n display: 'flex',\n justifyContent: 'flex-end',\n paddingLeft: tokens.spacingHorizontalS,\n },\n icon: {\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n paddingRight: tokens.spacingHorizontalS,\n lineHeight: tokens.lineHeightBase500,\n fontSize: tokens.fontSizeBase500,\n },\n});\n\n/** Applies style classnames to slots */\nexport const useAccordionHeaderStyles_unstable = (state: AccordionHeaderState) => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n accordionHeaderClassNames.root,\n styles.root,\n state.inline && styles.rootInline,\n state.disabled && styles.rootDisabled,\n state.root.className,\n );\n\n state.button.className = mergeClasses(\n accordionHeaderClassNames.button,\n styles.resetButton,\n styles.button,\n styles.focusIndicator,\n state.expandIconPosition === 'end' && !state.icon && styles.buttonExpandIconEndNoIcon,\n state.expandIconPosition === 'end' && styles.buttonExpandIconEnd,\n state.inline && styles.buttonInline,\n state.size === 'small' && styles.buttonSmall,\n state.size === 'large' && styles.buttonLarge,\n state.size === 'extra-large' && styles.buttonExtraLarge,\n state.button.className,\n );\n\n if (state.expandIcon) {\n state.expandIcon.className = mergeClasses(\n accordionHeaderClassNames.expandIcon,\n styles.expandIcon,\n state.expandIconPosition === 'start' && styles.expandIconStart,\n state.expandIconPosition === 'end' && styles.expandIconEnd,\n state.expandIcon.className,\n );\n }\n if (state.icon) {\n state.icon.className = mergeClasses(accordionHeaderClassNames.icon, styles.icon, state.icon.className);\n }\n return state;\n};\n"]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "react", "./useAccordionItem", "./useAccordionItemContextValues", "./renderAccordionItem", "@fluentui/react-shared-contexts", "./useAccordionItemStyles"], function (require, exports, React, useAccordionItem_1, useAccordionItemContextValues_1, renderAccordionItem_1, react_shared_contexts_1, useAccordionItemStyles_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.AccordionItem = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Define a styled AccordionItem, using the `useAccordionItem_unstable` and `useAccordionItemStyles_unstable` hooks.
|
|
7
|
-
*/
|
|
8
|
-
exports.AccordionItem = React.forwardRef(function (props, ref) {
|
|
9
|
-
var state = useAccordionItem_1.useAccordionItem_unstable(props, ref);
|
|
10
|
-
var contextValues = useAccordionItemContextValues_1.useAccordionItemContextValues_unstable(state);
|
|
11
|
-
useAccordionItemStyles_1.useAccordionItemStyles_unstable(state);
|
|
12
|
-
var useCustomStyles = react_shared_contexts_1.useCustomStyleHooks_unstable().useAccordionItemStyles_unstable;
|
|
13
|
-
useCustomStyles(state);
|
|
14
|
-
return renderAccordionItem_1.renderAccordionItem_unstable(state, contextValues);
|
|
15
|
-
});
|
|
16
|
-
exports.AccordionItem.displayName = 'AccordionItem';
|
|
17
|
-
});
|
|
18
|
-
//# sourceMappingURL=AccordionItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionItem.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-accordion/src/components/AccordionItem/AccordionItem.tsx"],"names":[],"mappings":";;;;IASA;;OAEG;IACU,QAAA,aAAa,GAA4C,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAChG,IAAM,KAAK,GAAG,4CAAyB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACpD,IAAM,aAAa,GAAG,sEAAsC,CAAC,KAAK,CAAC,CAAC;QAEpE,wDAA+B,CAAC,KAAK,CAAC,CAAC;QAE/B,IAAiC,eAAe,GAAK,oDAA4B,EAAE,gCAAnC,CAAoC;QAC5F,eAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,kDAA4B,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import * as React from 'react';\nimport { useAccordionItem_unstable } from './useAccordionItem';\nimport { useAccordionItemContextValues_unstable } from './useAccordionItemContextValues';\nimport { renderAccordionItem_unstable } from './renderAccordionItem';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\nimport { useAccordionItemStyles_unstable } from './useAccordionItemStyles';\nimport type { AccordionItemProps } from './AccordionItem.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled AccordionItem, using the `useAccordionItem_unstable` and `useAccordionItemStyles_unstable` hooks.\n */\nexport const AccordionItem: ForwardRefComponent<AccordionItemProps> = React.forwardRef((props, ref) => {\n const state = useAccordionItem_unstable(props, ref);\n const contextValues = useAccordionItemContextValues_unstable(state);\n\n useAccordionItemStyles_unstable(state);\n\n const { useAccordionItemStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderAccordionItem_unstable(state, contextValues);\n});\n\nAccordionItem.displayName = 'AccordionItem';\n"]}
|