@fluentui/react-drawer 9.0.0-beta.20 → 9.0.0-beta.21
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/CHANGELOG.json +76 -1
- package/CHANGELOG.md +21 -2
- package/dist/index.d.ts +20 -20
- package/lib/components/Drawer/Drawer.js.map +1 -1
- package/lib/components/Drawer/Drawer.types.js.map +1 -1
- package/lib/components/Drawer/renderDrawer.js +2 -2
- package/lib/components/Drawer/renderDrawer.js.map +1 -1
- package/lib/components/Drawer/useDrawer.js +8 -7
- package/lib/components/Drawer/useDrawer.js.map +1 -1
- package/lib/components/DrawerBody/DrawerBody.js.map +1 -1
- package/lib/components/DrawerBody/renderDrawerBody.js +2 -2
- package/lib/components/DrawerBody/renderDrawerBody.js.map +1 -1
- package/lib/components/DrawerBody/useDrawerBody.js.map +1 -1
- package/lib/components/DrawerFooter/DrawerFooter.js.map +1 -1
- package/lib/components/DrawerFooter/renderDrawerFooter.js +2 -2
- package/lib/components/DrawerFooter/renderDrawerFooter.js.map +1 -1
- package/lib/components/DrawerFooter/useDrawerFooter.js.map +1 -1
- package/lib/components/DrawerHeader/DrawerHeader.js.map +1 -1
- package/lib/components/DrawerHeader/renderDrawerHeader.js +2 -2
- package/lib/components/DrawerHeader/renderDrawerHeader.js.map +1 -1
- package/lib/components/DrawerHeader/useDrawerHeader.js.map +1 -1
- package/lib/components/DrawerHeaderNavigation/DrawerHeaderNavigation.js.map +1 -1
- package/lib/components/DrawerHeaderNavigation/renderDrawerHeaderNavigation.js +2 -2
- package/lib/components/DrawerHeaderNavigation/renderDrawerHeaderNavigation.js.map +1 -1
- package/lib/components/DrawerHeaderNavigation/useDrawerHeaderNavigation.js.map +1 -1
- package/lib/components/DrawerHeaderTitle/DrawerHeaderTitle.js.map +1 -1
- package/lib/components/DrawerHeaderTitle/DrawerHeaderTitle.types.js +1 -1
- package/lib/components/DrawerHeaderTitle/DrawerHeaderTitle.types.js.map +1 -1
- package/lib/components/DrawerHeaderTitle/renderDrawerHeaderTitle.js +7 -2
- package/lib/components/DrawerHeaderTitle/renderDrawerHeaderTitle.js.map +1 -1
- package/lib/components/DrawerHeaderTitle/useDrawerHeaderTitle.js +14 -11
- package/lib/components/DrawerHeaderTitle/useDrawerHeaderTitle.js.map +1 -1
- package/lib/components/DrawerHeaderTitle/useDrawerHeaderTitleStyles.styles.js.map +1 -1
- package/lib/components/DrawerInline/DrawerInline.js +1 -1
- package/lib/components/DrawerInline/DrawerInline.js.map +1 -1
- package/lib/components/DrawerInline/DrawerInline.types.js.map +1 -1
- package/lib/components/DrawerInline/renderDrawerInline.js +4 -4
- package/lib/components/DrawerInline/renderDrawerInline.js.map +1 -1
- package/lib/components/DrawerInline/useDrawerInline.js +12 -10
- package/lib/components/DrawerInline/useDrawerInline.js.map +1 -1
- package/lib/components/DrawerInline/useDrawerInlineStyles.styles.js +23 -9
- package/lib/components/DrawerInline/useDrawerInlineStyles.styles.js.map +1 -1
- package/lib/components/DrawerOverlay/DrawerOverlay.js.map +1 -1
- package/lib/components/DrawerOverlay/DrawerOverlay.types.js.map +1 -1
- package/lib/components/DrawerOverlay/renderDrawerOverlay.js +8 -2
- package/lib/components/DrawerOverlay/renderDrawerOverlay.js.map +1 -1
- package/lib/components/DrawerOverlay/useDrawerOverlay.js +38 -19
- package/lib/components/DrawerOverlay/useDrawerOverlay.js.map +1 -1
- package/lib/components/DrawerOverlay/useDrawerOverlayStyles.styles.js +43 -9
- package/lib/components/DrawerOverlay/useDrawerOverlayStyles.styles.js.map +1 -1
- package/lib/util/DrawerBase.types.js.map +1 -1
- package/lib/util/useDrawerBaseStyles.styles.js +50 -7
- package/lib/util/useDrawerBaseStyles.styles.js.map +1 -1
- package/lib/util/useDrawerDefaultProps.js +9 -0
- package/lib/util/useDrawerDefaultProps.js.map +1 -0
- package/lib-commonjs/Drawer.js +2 -2
- package/lib-commonjs/Drawer.js.map +1 -1
- package/lib-commonjs/DrawerBody.js +2 -2
- package/lib-commonjs/DrawerBody.js.map +1 -1
- package/lib-commonjs/DrawerFooter.js +2 -2
- package/lib-commonjs/DrawerFooter.js.map +1 -1
- package/lib-commonjs/DrawerHeader.js +2 -2
- package/lib-commonjs/DrawerHeader.js.map +1 -1
- package/lib-commonjs/DrawerHeaderNavigation.js +2 -2
- package/lib-commonjs/DrawerHeaderNavigation.js.map +1 -1
- package/lib-commonjs/DrawerHeaderTitle.js +2 -2
- package/lib-commonjs/DrawerHeaderTitle.js.map +1 -1
- package/lib-commonjs/DrawerInline.js +2 -2
- package/lib-commonjs/DrawerInline.js.map +1 -1
- package/lib-commonjs/DrawerOverlay.js +2 -2
- package/lib-commonjs/DrawerOverlay.js.map +1 -1
- package/lib-commonjs/components/Drawer/Drawer.js +9 -7
- package/lib-commonjs/components/Drawer/Drawer.js.map +1 -1
- package/lib-commonjs/components/Drawer/index.js +6 -6
- package/lib-commonjs/components/Drawer/index.js.map +1 -1
- package/lib-commonjs/components/Drawer/renderDrawer.js +8 -6
- package/lib-commonjs/components/Drawer/renderDrawer.js.map +1 -1
- package/lib-commonjs/components/Drawer/useDrawer.js +16 -13
- package/lib-commonjs/components/Drawer/useDrawer.js.map +1 -1
- package/lib-commonjs/components/Drawer/useDrawerStyles.styles.js +6 -2
- package/lib-commonjs/components/Drawer/useDrawerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DrawerBody/DrawerBody.js +9 -7
- package/lib-commonjs/components/DrawerBody/DrawerBody.js.map +1 -1
- package/lib-commonjs/components/DrawerBody/index.js +6 -6
- package/lib-commonjs/components/DrawerBody/index.js.map +1 -1
- package/lib-commonjs/components/DrawerBody/renderDrawerBody.js +8 -6
- package/lib-commonjs/components/DrawerBody/renderDrawerBody.js.map +1 -1
- package/lib-commonjs/components/DrawerBody/useDrawerBody.js +7 -5
- package/lib-commonjs/components/DrawerBody/useDrawerBody.js.map +1 -1
- package/lib-commonjs/components/DrawerBody/useDrawerBodyStyles.styles.js +7 -3
- package/lib-commonjs/components/DrawerBody/useDrawerBodyStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DrawerFooter/DrawerFooter.js +7 -5
- package/lib-commonjs/components/DrawerFooter/DrawerFooter.js.map +1 -1
- package/lib-commonjs/components/DrawerFooter/index.js +6 -6
- package/lib-commonjs/components/DrawerFooter/index.js.map +1 -1
- package/lib-commonjs/components/DrawerFooter/renderDrawerFooter.js +8 -6
- package/lib-commonjs/components/DrawerFooter/renderDrawerFooter.js.map +1 -1
- package/lib-commonjs/components/DrawerFooter/useDrawerFooter.js +7 -5
- package/lib-commonjs/components/DrawerFooter/useDrawerFooter.js.map +1 -1
- package/lib-commonjs/components/DrawerFooter/useDrawerFooterStyles.styles.js +7 -3
- package/lib-commonjs/components/DrawerFooter/useDrawerFooterStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DrawerHeader/DrawerHeader.js +9 -7
- package/lib-commonjs/components/DrawerHeader/DrawerHeader.js.map +1 -1
- package/lib-commonjs/components/DrawerHeader/index.js +6 -6
- package/lib-commonjs/components/DrawerHeader/index.js.map +1 -1
- package/lib-commonjs/components/DrawerHeader/renderDrawerHeader.js +8 -6
- package/lib-commonjs/components/DrawerHeader/renderDrawerHeader.js.map +1 -1
- package/lib-commonjs/components/DrawerHeader/useDrawerHeader.js +7 -5
- package/lib-commonjs/components/DrawerHeader/useDrawerHeader.js.map +1 -1
- package/lib-commonjs/components/DrawerHeader/useDrawerHeaderStyles.styles.js +7 -3
- package/lib-commonjs/components/DrawerHeader/useDrawerHeaderStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DrawerHeaderNavigation/DrawerHeaderNavigation.js +9 -7
- package/lib-commonjs/components/DrawerHeaderNavigation/DrawerHeaderNavigation.js.map +1 -1
- package/lib-commonjs/components/DrawerHeaderNavigation/index.js +6 -6
- package/lib-commonjs/components/DrawerHeaderNavigation/index.js.map +1 -1
- package/lib-commonjs/components/DrawerHeaderNavigation/renderDrawerHeaderNavigation.js +8 -6
- package/lib-commonjs/components/DrawerHeaderNavigation/renderDrawerHeaderNavigation.js.map +1 -1
- package/lib-commonjs/components/DrawerHeaderNavigation/useDrawerHeaderNavigation.js +7 -5
- package/lib-commonjs/components/DrawerHeaderNavigation/useDrawerHeaderNavigation.js.map +1 -1
- package/lib-commonjs/components/DrawerHeaderNavigation/useDrawerHeaderNavigationStyles.styles.js +7 -3
- package/lib-commonjs/components/DrawerHeaderNavigation/useDrawerHeaderNavigationStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DrawerHeaderTitle/DrawerHeaderTitle.js +9 -7
- package/lib-commonjs/components/DrawerHeaderTitle/DrawerHeaderTitle.js.map +1 -1
- package/lib-commonjs/components/DrawerHeaderTitle/DrawerHeaderTitle.types.js +0 -2
- package/lib-commonjs/components/DrawerHeaderTitle/DrawerHeaderTitle.types.js.map +1 -1
- package/lib-commonjs/components/DrawerHeaderTitle/index.js +6 -6
- package/lib-commonjs/components/DrawerHeaderTitle/index.js.map +1 -1
- package/lib-commonjs/components/DrawerHeaderTitle/renderDrawerHeaderTitle.js +13 -6
- package/lib-commonjs/components/DrawerHeaderTitle/renderDrawerHeaderTitle.js.map +1 -1
- package/lib-commonjs/components/DrawerHeaderTitle/useDrawerHeaderTitle.js +22 -17
- package/lib-commonjs/components/DrawerHeaderTitle/useDrawerHeaderTitle.js.map +1 -1
- package/lib-commonjs/components/DrawerHeaderTitle/useDrawerHeaderTitleStyles.styles.js +10 -6
- package/lib-commonjs/components/DrawerHeaderTitle/useDrawerHeaderTitleStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DrawerInline/DrawerInline.js +7 -5
- package/lib-commonjs/components/DrawerInline/DrawerInline.js.map +1 -1
- package/lib-commonjs/components/DrawerInline/index.js +6 -6
- package/lib-commonjs/components/DrawerInline/index.js.map +1 -1
- package/lib-commonjs/components/DrawerInline/renderDrawerInline.js +9 -7
- package/lib-commonjs/components/DrawerInline/renderDrawerInline.js.map +1 -1
- package/lib-commonjs/components/DrawerInline/useDrawerInline.js +19 -15
- package/lib-commonjs/components/DrawerInline/useDrawerInline.js.map +1 -1
- package/lib-commonjs/components/DrawerInline/useDrawerInlineStyles.styles.js +44 -14
- package/lib-commonjs/components/DrawerInline/useDrawerInlineStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DrawerOverlay/DrawerOverlay.js +7 -5
- package/lib-commonjs/components/DrawerOverlay/DrawerOverlay.js.map +1 -1
- package/lib-commonjs/components/DrawerOverlay/index.js +6 -6
- package/lib-commonjs/components/DrawerOverlay/index.js.map +1 -1
- package/lib-commonjs/components/DrawerOverlay/renderDrawerOverlay.js +15 -7
- package/lib-commonjs/components/DrawerOverlay/renderDrawerOverlay.js.map +1 -1
- package/lib-commonjs/components/DrawerOverlay/useDrawerOverlay.js +44 -23
- package/lib-commonjs/components/DrawerOverlay/useDrawerOverlay.js.map +1 -1
- package/lib-commonjs/components/DrawerOverlay/useDrawerOverlayStyles.styles.js +64 -13
- package/lib-commonjs/components/DrawerOverlay/useDrawerOverlayStyles.styles.js.map +1 -1
- package/lib-commonjs/index.js +122 -46
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/util/useDrawerBaseStyles.styles.js +79 -14
- package/lib-commonjs/util/useDrawerBaseStyles.styles.js.map +1 -1
- package/lib-commonjs/util/useDrawerDefaultProps.js +19 -0
- package/lib-commonjs/util/useDrawerDefaultProps.js.map +1 -0
- package/package.json +12 -11
- package/lib/util/getDefaultDrawerProps.js +0 -9
- package/lib/util/getDefaultDrawerProps.js.map +0 -1
- package/lib-commonjs/util/getDefaultDrawerProps.js +0 -17
- package/lib-commonjs/util/getDefaultDrawerProps.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDrawerHeaderTitle.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, slot } from '@fluentui/react-utilities';\nimport type { DrawerHeaderTitleProps, DrawerHeaderTitleState } from './DrawerHeaderTitle.types';\
|
|
1
|
+
{"version":3,"sources":["useDrawerHeaderTitle.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, slot } from '@fluentui/react-utilities';\nimport type { DrawerHeaderTitleProps, DrawerHeaderTitleState } from './DrawerHeaderTitle.types';\n\n/**\n * Create the state required to render DrawerHeaderTitle.\n *\n * The returned state can be modified with hooks such as useDrawerHeaderTitleStyles_unstable,\n * before being passed to renderDrawerHeaderTitle_unstable.\n *\n * @param props - props from this instance of DrawerHeaderTitle\n * @param ref - reference to root HTMLElement of DrawerHeaderTitle\n */\nexport const useDrawerHeaderTitle_unstable = (\n props: DrawerHeaderTitleProps,\n ref: React.Ref<HTMLDivElement>,\n): DrawerHeaderTitleState => {\n let heading = slot.resolveShorthand(props.heading);\n\n if (!heading) {\n heading = {\n children: props.children,\n };\n }\n\n return {\n components: {\n root: 'div',\n heading: 'h2',\n action: 'div',\n },\n\n root: slot.always(\n getNativeElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n heading: slot.optional(getNativeElementProps(heading.as ?? 'h2', heading), {\n defaultProps: {\n children: props.children,\n },\n renderByDefault: true,\n elementType: 'h2',\n }),\n action: slot.optional(props.action, {\n elementType: 'div',\n }),\n };\n};\n"],"names":["React","getNativeElementProps","slot","useDrawerHeaderTitle_unstable","props","ref","heading","resolveShorthand","children","components","root","action","always","elementType","optional","as","defaultProps","renderByDefault"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,IAAI,QAAQ,4BAA4B;AAGxE;;;;;;;;CAQC,GACD,OAAO,MAAMC,gCAAgC,CAC3CC,OACAC;IAEA,IAAIC,UAAUJ,KAAKK,gBAAgB,CAACH,MAAME,OAAO;IAEjD,IAAI,CAACA,SAAS;QACZA,UAAU;YACRE,UAAUJ,MAAMI,QAAQ;QAC1B;IACF;QAgB+CF;IAd/C,OAAO;QACLG,YAAY;YACVC,MAAM;YACNJ,SAAS;YACTK,QAAQ;QACV;QAEAD,MAAMR,KAAKU,MAAM,CACfX,sBAAsB,OAAO;YAC3BI;YACA,GAAGD,KAAK;QACV,IACA;YAAES,aAAa;QAAM;QAEvBP,SAASJ,KAAKY,QAAQ,CAACb,sBAAsBK,CAAAA,cAAAA,QAAQS,EAAE,cAAVT,yBAAAA,cAAc,MAAMA,UAAU;YACzEU,cAAc;gBACZR,UAAUJ,MAAMI,QAAQ;YAC1B;YACAS,iBAAiB;YACjBJ,aAAa;QACf;QACAF,QAAQT,KAAKY,QAAQ,CAACV,MAAMO,MAAM,EAAE;YAClCE,aAAa;QACf;IACF;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__styles","mergeClasses","useDialogTitleStyles_unstable","tokens","drawerHeaderTitleClassNames","root","heading","action","useStyles","mc9l5x","Brf1p80","Bt984gj","i8kkvl","t21cq0","d","useDrawerHeaderTitleStyles_unstable","state","styles","components","className"],"sources":["useDrawerHeaderTitleStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { useDialogTitleStyles_unstable } from '@fluentui/react-dialog';\nimport { tokens } from '@fluentui/react-theme';\nexport const drawerHeaderTitleClassNames = {\n root: 'fui-DrawerHeaderTitle',\n heading: 'fui-DrawerHeaderTitle__heading',\n action: 'fui-DrawerHeaderTitle__action'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n columnGap: tokens.spacingHorizontalS\n },\n action: {\n marginRight: `calc(${tokens.spacingHorizontalS} * -1)`\n }\n});\n/**\n * Apply styling to the DrawerHeaderTitle slots based on the state\n */ export const useDrawerHeaderTitleStyles_unstable = (state)=>{\n const styles = useStyles();\n const { heading: root = {}
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","useDialogTitleStyles_unstable","tokens","drawerHeaderTitleClassNames","root","heading","action","useStyles","mc9l5x","Brf1p80","Bt984gj","i8kkvl","t21cq0","d","useDrawerHeaderTitleStyles_unstable","state","styles","components","className"],"sources":["useDrawerHeaderTitleStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { useDialogTitleStyles_unstable } from '@fluentui/react-dialog';\nimport { tokens } from '@fluentui/react-theme';\nexport const drawerHeaderTitleClassNames = {\n root: 'fui-DrawerHeaderTitle',\n heading: 'fui-DrawerHeaderTitle__heading',\n action: 'fui-DrawerHeaderTitle__action'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n columnGap: tokens.spacingHorizontalS\n },\n action: {\n marginRight: `calc(${tokens.spacingHorizontalS} * -1)`\n }\n});\n/**\n * Apply styling to the DrawerHeaderTitle slots based on the state\n */ export const useDrawerHeaderTitleStyles_unstable = (state)=>{\n const styles = useStyles();\n const { heading: root = {}, action, components } = state;\n useDialogTitleStyles_unstable({\n components: {\n root: components.heading,\n action: components.action\n },\n root,\n action\n });\n state.root.className = mergeClasses(drawerHeaderTitleClassNames.root, styles.root, state.root.className);\n if (state.heading) {\n state.heading.className = mergeClasses(drawerHeaderTitleClassNames.heading, state.heading.className);\n }\n if (state.action) {\n state.action.className = mergeClasses(drawerHeaderTitleClassNames.action, styles.action, state.action.className);\n }\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,6BAA6B,QAAQ,wBAAwB;AACtE,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,OAAO,MAAMC,2BAA2B,GAAG;EACvCC,IAAI,EAAE,uBAAuB;EAC7BC,OAAO,EAAE,gCAAgC;EACzCC,MAAM,EAAE;AACZ,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGR,QAAA;EAAAK,IAAA;IAAAI,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAL,MAAA;IAAAM,MAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAUrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,mCAAmC,GAAIC,KAAK,IAAG;EAC5D,MAAMC,MAAM,GAAGT,SAAS,CAAC,CAAC;EAC1B,MAAM;IAAEF,OAAO,EAAED,IAAI,GAAG,CAAC,CAAC;IAAEE,MAAM;IAAEW;EAAW,CAAC,GAAGF,KAAK;EACxDd,6BAA6B,CAAC;IAC1BgB,UAAU,EAAE;MACRb,IAAI,EAAEa,UAAU,CAACZ,OAAO;MACxBC,MAAM,EAAEW,UAAU,CAACX;IACvB,CAAC;IACDF,IAAI;IACJE;EACJ,CAAC,CAAC;EACFS,KAAK,CAACX,IAAI,CAACc,SAAS,GAAGlB,YAAY,CAACG,2BAA2B,CAACC,IAAI,EAAEY,MAAM,CAACZ,IAAI,EAAEW,KAAK,CAACX,IAAI,CAACc,SAAS,CAAC;EACxG,IAAIH,KAAK,CAACV,OAAO,EAAE;IACfU,KAAK,CAACV,OAAO,CAACa,SAAS,GAAGlB,YAAY,CAACG,2BAA2B,CAACE,OAAO,EAAEU,KAAK,CAACV,OAAO,CAACa,SAAS,CAAC;EACxG;EACA,IAAIH,KAAK,CAACT,MAAM,EAAE;IACdS,KAAK,CAACT,MAAM,CAACY,SAAS,GAAGlB,YAAY,CAACG,2BAA2B,CAACG,MAAM,EAAEU,MAAM,CAACV,MAAM,EAAES,KAAK,CAACT,MAAM,CAACY,SAAS,CAAC;EACpH;EACA,OAAOH,KAAK;AAChB,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { useDrawerInline_unstable } from './useDrawerInline';
|
|
|
3
3
|
import { renderDrawerInline_unstable } from './renderDrawerInline';
|
|
4
4
|
import { useDrawerInlineStyles_unstable } from './useDrawerInlineStyles.styles';
|
|
5
5
|
/**
|
|
6
|
-
* DrawerInline is often used for navigation that is not
|
|
6
|
+
* DrawerInline is often used for navigation that is not dismissible. As it is on the same level as
|
|
7
7
|
* the main surface, users can still interact with other UI elements.
|
|
8
8
|
*/ export const DrawerInline = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
9
9
|
const state = useDrawerInline_unstable(props, ref);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DrawerInline.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useDrawerInline_unstable } from './useDrawerInline';\nimport { renderDrawerInline_unstable } from './renderDrawerInline';\nimport { useDrawerInlineStyles_unstable } from './useDrawerInlineStyles.styles';\nimport type { DrawerInlineProps } from './DrawerInline.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * DrawerInline is often used for navigation that is not
|
|
1
|
+
{"version":3,"sources":["DrawerInline.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useDrawerInline_unstable } from './useDrawerInline';\nimport { renderDrawerInline_unstable } from './renderDrawerInline';\nimport { useDrawerInlineStyles_unstable } from './useDrawerInlineStyles.styles';\nimport type { DrawerInlineProps } from './DrawerInline.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * DrawerInline is often used for navigation that is not dismissible. As it is on the same level as\n * the main surface, users can still interact with other UI elements.\n */\nexport const DrawerInline: ForwardRefComponent<DrawerInlineProps> = React.forwardRef((props, ref) => {\n const state = useDrawerInline_unstable(props, ref);\n\n useDrawerInlineStyles_unstable(state);\n return renderDrawerInline_unstable(state);\n});\n\nDrawerInline.displayName = 'DrawerInline';\n"],"names":["React","useDrawerInline_unstable","renderDrawerInline_unstable","useDrawerInlineStyles_unstable","DrawerInline","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,8BAA8B,QAAQ,iCAAiC;AAIhF;;;CAGC,GACD,OAAO,MAAMC,6BAAuDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IAC3F,MAAMC,QAAQP,yBAAyBK,OAAOC;IAE9CJ,+BAA+BK;IAC/B,OAAON,4BAA4BM;AACrC,GAAG;AAEHJ,aAAaK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DrawerInline.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { DrawerBaseProps } from '../../util/DrawerBase.types';\n\nexport type DrawerInlineSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * DrawerInline Props\n */\nexport type DrawerInlineProps = ComponentProps<DrawerInlineSlots> &\n DrawerBaseProps & {\n /**\n * Whether the drawer has a separator line.\n *\n * @default false\n */\n separator?: boolean;\n };\n\n/**\n * State used in rendering DrawerInline\n */\nexport type DrawerInlineState = ComponentState<DrawerInlineSlots> & DrawerInlineProps
|
|
1
|
+
{"version":3,"sources":["DrawerInline.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { DrawerBaseProps, DrawerBaseState } from '../../util/DrawerBase.types';\n\nexport type DrawerInlineSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * DrawerInline Props\n */\nexport type DrawerInlineProps = ComponentProps<DrawerInlineSlots> &\n DrawerBaseProps & {\n /**\n * Whether the drawer has a separator line.\n *\n * @default false\n */\n separator?: boolean;\n };\n\n/**\n * State used in rendering DrawerInline\n */\nexport type DrawerInlineState = Required<\n ComponentState<DrawerInlineSlots> & DrawerBaseState & Pick<DrawerInlineProps, 'separator'>\n>;\n"],"names":[],"mappings":"AAAA,WAyBE"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/** @jsxRuntime
|
|
1
|
+
/** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots } from '@fluentui/react-utilities';
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of DrawerInline
|
|
5
5
|
*/ export const renderDrawerInline_unstable = (state)=>{
|
|
6
|
-
|
|
7
|
-
if (!state.open) {
|
|
6
|
+
if (!state.motion.canRender) {
|
|
8
7
|
return null;
|
|
9
8
|
}
|
|
10
|
-
|
|
9
|
+
assertSlots(state);
|
|
10
|
+
return /*#__PURE__*/ _jsx(state.root, {});
|
|
11
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderDrawerInline.tsx"],"sourcesContent":["/** @jsxRuntime
|
|
1
|
+
{"version":3,"sources":["renderDrawerInline.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { DrawerInlineState, DrawerInlineSlots } from './DrawerInline.types';\n\n/**\n * Render the final JSX of DrawerInline\n */\nexport const renderDrawerInline_unstable = (state: DrawerInlineState) => {\n if (!state.motion.canRender) {\n return null;\n }\n\n assertSlots<DrawerInlineSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderDrawerInline_unstable","state","motion","canRender","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AACjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,8BAA8B,CAACC;IAC1C,IAAI,CAACA,MAAMC,MAAM,CAACC,SAAS,EAAE;QAC3B,OAAO;IACT;IAEAJ,YAA+BE;IAE/B,qBAAO,KAACA,MAAMG,IAAI;AACpB,EAAE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { getNativeElementProps, useControllableState, slot } from '@fluentui/react-utilities';
|
|
3
|
-
import {
|
|
2
|
+
import { getNativeElementProps, useControllableState, slot, useMergedRefs } from '@fluentui/react-utilities';
|
|
3
|
+
import { useMotion } from '@fluentui/react-motion-preview';
|
|
4
|
+
import { useDrawerDefaultProps } from '../../util/useDrawerDefaultProps';
|
|
4
5
|
/**
|
|
5
6
|
* Create the state required to render DrawerInline.
|
|
6
7
|
*
|
|
@@ -10,26 +11,27 @@ import { getDefaultDrawerProps } from '../../util/getDefaultDrawerProps';
|
|
|
10
11
|
* @param props - props from this instance of DrawerInline
|
|
11
12
|
* @param ref - reference to root HTMLElement of DrawerInline
|
|
12
13
|
*/ export const useDrawerInline_unstable = (props, ref)=>{
|
|
13
|
-
const {
|
|
14
|
-
const { separator =false
|
|
14
|
+
const { size, position, ...defaultProps } = useDrawerDefaultProps(props);
|
|
15
|
+
const { separator = false } = props;
|
|
15
16
|
const [open] = useControllableState({
|
|
16
|
-
state:
|
|
17
|
-
defaultState: defaultOpen,
|
|
17
|
+
state: defaultProps.open,
|
|
18
|
+
defaultState: defaultProps.defaultOpen,
|
|
18
19
|
initialState: false
|
|
19
20
|
});
|
|
21
|
+
const motion = useMotion(open);
|
|
20
22
|
return {
|
|
21
23
|
components: {
|
|
22
24
|
root: 'div'
|
|
23
25
|
},
|
|
24
26
|
root: slot.always(getNativeElementProps('div', {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
...props,
|
|
28
|
+
ref: useMergedRefs(ref, motion.ref)
|
|
27
29
|
}), {
|
|
28
30
|
elementType: 'div'
|
|
29
31
|
}),
|
|
30
32
|
size,
|
|
31
33
|
position,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
separator,
|
|
35
|
+
motion
|
|
34
36
|
};
|
|
35
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDrawerInline.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useControllableState, slot } from '@fluentui/react-utilities';\nimport type { DrawerInlineProps, DrawerInlineState } from './DrawerInline.types';\nimport {
|
|
1
|
+
{"version":3,"sources":["useDrawerInline.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useControllableState, slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { useMotion } from '@fluentui/react-motion-preview';\n\nimport type { DrawerInlineProps, DrawerInlineState } from './DrawerInline.types';\nimport { useDrawerDefaultProps } from '../../util/useDrawerDefaultProps';\n\n/**\n * Create the state required to render DrawerInline.\n *\n * The returned state can be modified with hooks such as useDrawerInlineStyles_unstable,\n * before being passed to renderDrawerInline_unstable.\n *\n * @param props - props from this instance of DrawerInline\n * @param ref - reference to root HTMLElement of DrawerInline\n */\nexport const useDrawerInline_unstable = (\n props: DrawerInlineProps,\n ref: React.Ref<HTMLDivElement>,\n): DrawerInlineState => {\n const { size, position, ...defaultProps } = useDrawerDefaultProps(props);\n const { separator = false } = props;\n\n const [open] = useControllableState({\n state: defaultProps.open,\n defaultState: defaultProps.defaultOpen,\n initialState: false,\n });\n\n const motion = useMotion<HTMLDivElement>(open);\n\n return {\n components: {\n root: 'div',\n },\n\n root: slot.always(\n getNativeElementProps('div', {\n ...props,\n ref: useMergedRefs(ref, motion.ref),\n }),\n { elementType: 'div' },\n ),\n\n size,\n position,\n separator,\n motion,\n };\n};\n"],"names":["React","getNativeElementProps","useControllableState","slot","useMergedRefs","useMotion","useDrawerDefaultProps","useDrawerInline_unstable","props","ref","size","position","defaultProps","separator","open","state","defaultState","defaultOpen","initialState","motion","components","root","always","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,oBAAoB,EAAEC,IAAI,EAAEC,aAAa,QAAQ,4BAA4B;AAC7G,SAASC,SAAS,QAAQ,iCAAiC;AAG3D,SAASC,qBAAqB,QAAQ,mCAAmC;AAEzE;;;;;;;;CAQC,GACD,OAAO,MAAMC,2BAA2B,CACtCC,OACAC;IAEA,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGC,cAAc,GAAGN,sBAAsBE;IAClE,MAAM,EAAEK,YAAY,KAAK,EAAE,GAAGL;IAE9B,MAAM,CAACM,KAAK,GAAGZ,qBAAqB;QAClCa,OAAOH,aAAaE,IAAI;QACxBE,cAAcJ,aAAaK,WAAW;QACtCC,cAAc;IAChB;IAEA,MAAMC,SAASd,UAA0BS;IAEzC,OAAO;QACLM,YAAY;YACVC,MAAM;QACR;QAEAA,MAAMlB,KAAKmB,MAAM,CACfrB,sBAAsB,OAAO;YAC3B,GAAGO,KAAK;YACRC,KAAKL,cAAcK,KAAKU,OAAOV,GAAG;QACpC,IACA;YAAEc,aAAa;QAAM;QAGvBb;QACAC;QACAE;QACAM;IACF;AACF,EAAE"}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
3
|
-
import { useDrawerBaseStyles } from '../../util/useDrawerBaseStyles.styles';
|
|
4
3
|
import { tokens } from '@fluentui/react-theme';
|
|
4
|
+
import { drawerCSSVars, useDrawerBaseClassNames } from '../../util/useDrawerBaseStyles.styles';
|
|
5
5
|
export const drawerInlineClassNames = {
|
|
6
6
|
root: 'fui-DrawerInline'
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Styles for the root slot
|
|
10
10
|
*/
|
|
11
|
-
const
|
|
11
|
+
const separatorValues = ['1px', 'solid', tokens.colorNeutralBackground3];
|
|
12
|
+
const useDrawerRootStyles = /*#__PURE__*/__styles({
|
|
12
13
|
root: {
|
|
13
|
-
qhf8xq: "f10pi13n"
|
|
14
|
+
qhf8xq: "f10pi13n",
|
|
15
|
+
abs64n: "fk73vx1",
|
|
16
|
+
Bmy1vo4: "f15rjlgw",
|
|
17
|
+
Es3by: "f1blt7p"
|
|
14
18
|
},
|
|
15
19
|
separatorStart: {
|
|
16
20
|
Bekrc4i: ["f1hqa2wf", "finvdd3"],
|
|
@@ -21,23 +25,33 @@ const useStyles = /*#__PURE__*/__styles({
|
|
|
21
25
|
ibv6hh: ["finvdd3", "f1hqa2wf"],
|
|
22
26
|
wvpqe5: ["fjik90z", "fcdblym"],
|
|
23
27
|
zhjwy3: ["f17e9lqh", "fa8zu9y"]
|
|
28
|
+
},
|
|
29
|
+
start: {
|
|
30
|
+
Bz10aip: "f1d8gkik"
|
|
31
|
+
},
|
|
32
|
+
end: {
|
|
33
|
+
Bz10aip: "f1h1g6jt"
|
|
34
|
+
},
|
|
35
|
+
visible: {
|
|
36
|
+
abs64n: "f5p0z4x",
|
|
37
|
+
Bz10aip: "f87uvqx"
|
|
24
38
|
}
|
|
25
39
|
}, {
|
|
26
|
-
d: [".f10pi13n{position:relative;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fa8zu9y{border-right-color:var(--colorNeutralBackground3);}", ".f17e9lqh{border-left-color:var(--colorNeutralBackground3);}"]
|
|
40
|
+
d: [".f10pi13n{position:relative;}", ".fk73vx1{opacity:0;}", ".f15rjlgw{transition-property:opacity,transform;}", ".f1blt7p{will-change:opacity,transform;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fa8zu9y{border-right-color:var(--colorNeutralBackground3);}", ".f17e9lqh{border-left-color:var(--colorNeutralBackground3);}", ".f1d8gkik{transform:translate3D(calc(var(--fui-Drawer--size) * -1), 0, 0);}", ".f1h1g6jt{transform:translate3D(var(--fui-Drawer--size), 0, 0);}", ".f5p0z4x{opacity:1;}", ".f87uvqx{transform:translate3D(0, 0, 0);}"]
|
|
27
41
|
});
|
|
28
42
|
/**
|
|
29
43
|
* Apply styling to the DrawerInline slots based on the state
|
|
30
44
|
*/
|
|
31
45
|
export const useDrawerInlineStyles_unstable = state => {
|
|
32
|
-
const
|
|
33
|
-
const
|
|
46
|
+
const baseClassNames = useDrawerBaseClassNames(state);
|
|
47
|
+
const rootStyles = useDrawerRootStyles();
|
|
34
48
|
const separatorClass = React.useMemo(() => {
|
|
35
49
|
if (!state.separator) {
|
|
36
50
|
return undefined;
|
|
37
51
|
}
|
|
38
|
-
return state.position === 'start' ?
|
|
39
|
-
}, [state.position, state.separator,
|
|
40
|
-
state.root.className = mergeClasses(drawerInlineClassNames.root,
|
|
52
|
+
return state.position === 'start' ? rootStyles.separatorStart : rootStyles.separatorEnd;
|
|
53
|
+
}, [state.position, state.separator, rootStyles.separatorEnd, rootStyles.separatorStart]);
|
|
54
|
+
state.root.className = mergeClasses(drawerInlineClassNames.root, baseClassNames, rootStyles.root, separatorClass, rootStyles[state.position], state.motion.active && rootStyles.visible, state.root.className);
|
|
41
55
|
return state;
|
|
42
56
|
};
|
|
43
57
|
//# sourceMappingURL=useDrawerInlineStyles.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","__styles","mergeClasses","shorthands","
|
|
1
|
+
{"version":3,"names":["React","__styles","mergeClasses","shorthands","tokens","drawerCSSVars","useDrawerBaseClassNames","drawerInlineClassNames","root","separatorValues","colorNeutralBackground3","useDrawerRootStyles","qhf8xq","abs64n","Bmy1vo4","Es3by","separatorStart","Bekrc4i","vrafjx","h3c5rm","separatorEnd","ibv6hh","wvpqe5","zhjwy3","start","Bz10aip","end","visible","d","useDrawerInlineStyles_unstable","state","baseClassNames","rootStyles","separatorClass","useMemo","separator","undefined","position","className","motion","active"],"sources":["useDrawerInlineStyles.styles.js"],"sourcesContent":["import * as React from 'react';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { drawerCSSVars, useDrawerBaseClassNames } from '../../util/useDrawerBaseStyles.styles';\nexport const drawerInlineClassNames = {\n root: 'fui-DrawerInline'\n};\n/**\n * Styles for the root slot\n */ const separatorValues = [\n '1px',\n 'solid',\n tokens.colorNeutralBackground3\n];\nconst useDrawerRootStyles = makeStyles({\n root: {\n position: 'relative',\n opacity: 0,\n transitionProperty: 'opacity, transform',\n willChange: 'opacity, transform'\n },\n /* Separator */ separatorStart: {\n ...shorthands.borderRight(...separatorValues)\n },\n separatorEnd: {\n ...shorthands.borderLeft(...separatorValues)\n },\n /* Positioning */ start: {\n transform: `translate3D(calc(var(${drawerCSSVars.drawerSizeVar}) * -1), 0, 0)`\n },\n end: {\n transform: `translate3D(var(${drawerCSSVars.drawerSizeVar}), 0, 0)`\n },\n /* Visible */ visible: {\n opacity: 1,\n transform: `translate3D(0, 0, 0)`\n }\n});\n/**\n * Apply styling to the DrawerInline slots based on the state\n */ export const useDrawerInlineStyles_unstable = (state)=>{\n const baseClassNames = useDrawerBaseClassNames(state);\n const rootStyles = useDrawerRootStyles();\n const separatorClass = React.useMemo(()=>{\n if (!state.separator) {\n return undefined;\n }\n return state.position === 'start' ? rootStyles.separatorStart : rootStyles.separatorEnd;\n }, [\n state.position,\n state.separator,\n rootStyles.separatorEnd,\n rootStyles.separatorStart\n ]);\n state.root.className = mergeClasses(drawerInlineClassNames.root, baseClassNames, rootStyles.root, separatorClass, rootStyles[state.position], state.motion.active && rootStyles.visible, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAAAC,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,aAAa,EAAEC,uBAAuB,QAAQ,uCAAuC;AAC9F,OAAO,MAAMC,sBAAsB,GAAG;EAClCC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,eAAe,GAAG,CACxB,KAAK,EACL,OAAO,EACPL,MAAM,CAACM,uBAAuB,CACjC;AACD,MAAMC,mBAAmB,gBAAGV,QAAA;EAAAO,IAAA;IAAAI,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,KAAA;EAAA;EAAAC,cAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,YAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,KAAA;IAAAC,OAAA;EAAA;EAAAC,GAAA;IAAAD,OAAA;EAAA;EAAAE,OAAA;IAAAd,MAAA;IAAAY,OAAA;EAAA;AAAA;EAAAG,CAAA;AAAA,CAuB3B,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,8BAA8B,GAAIC,KAAK,IAAG;EACvD,MAAMC,cAAc,GAAGzB,uBAAuB,CAACwB,KAAK,CAAC;EACrD,MAAME,UAAU,GAAGrB,mBAAmB,CAAC,CAAC;EACxC,MAAMsB,cAAc,GAAGjC,KAAK,CAACkC,OAAO,CAAC,MAAI;IACrC,IAAI,CAACJ,KAAK,CAACK,SAAS,EAAE;MAClB,OAAOC,SAAS;IACpB;IACA,OAAON,KAAK,CAACO,QAAQ,KAAK,OAAO,GAAGL,UAAU,CAAChB,cAAc,GAAGgB,UAAU,CAACZ,YAAY;EAC3F,CAAC,EAAE,CACCU,KAAK,CAACO,QAAQ,EACdP,KAAK,CAACK,SAAS,EACfH,UAAU,CAACZ,YAAY,EACvBY,UAAU,CAAChB,cAAc,CAC5B,CAAC;EACFc,KAAK,CAACtB,IAAI,CAAC8B,SAAS,GAAGpC,YAAY,CAACK,sBAAsB,CAACC,IAAI,EAAEuB,cAAc,EAAEC,UAAU,CAACxB,IAAI,EAAEyB,cAAc,EAAED,UAAU,CAACF,KAAK,CAACO,QAAQ,CAAC,EAAEP,KAAK,CAACS,MAAM,CAACC,MAAM,IAAIR,UAAU,CAACL,OAAO,EAAEG,KAAK,CAACtB,IAAI,CAAC8B,SAAS,CAAC;EAC9M,OAAOR,KAAK;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DrawerOverlay.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useDrawerOverlay_unstable } from './useDrawerOverlay';\nimport { renderDrawerOverlay_unstable } from './renderDrawerOverlay';\nimport { useDrawerOverlayStyles_unstable } from './useDrawerOverlayStyles.styles';\nimport type { DrawerOverlayProps } from './DrawerOverlay.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * DrawerOverlay contains supplementary content and are used for complex creation, edit, or management experiences.\n */\nexport const DrawerOverlay: ForwardRefComponent<DrawerOverlayProps> = React.forwardRef((props, ref) => {\n const state = useDrawerOverlay_unstable(props, ref);\n\n useDrawerOverlayStyles_unstable(state);\n\n return renderDrawerOverlay_unstable(state);\n});\n\nDrawerOverlay.displayName = 'DrawerOverlay';\n"],"names":["React","useDrawerOverlay_unstable","renderDrawerOverlay_unstable","useDrawerOverlayStyles_unstable","DrawerOverlay","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,4BAA4B,QAAQ,wBAAwB;AACrE,SAASC,+BAA+B,QAAQ,kCAAkC;AAIlF;;CAEC,GACD,OAAO,MAAMC,8BAAyDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC
|
|
1
|
+
{"version":3,"sources":["DrawerOverlay.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useDrawerOverlay_unstable } from './useDrawerOverlay';\nimport { renderDrawerOverlay_unstable } from './renderDrawerOverlay';\nimport { useDrawerOverlayStyles_unstable } from './useDrawerOverlayStyles.styles';\nimport type { DrawerOverlayProps } from './DrawerOverlay.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * DrawerOverlay contains supplementary content and are used for complex creation, edit, or management experiences.\n */\nexport const DrawerOverlay: ForwardRefComponent<DrawerOverlayProps> = React.forwardRef((props, ref) => {\n const state = useDrawerOverlay_unstable(props, ref);\n\n useDrawerOverlayStyles_unstable(state);\n\n return renderDrawerOverlay_unstable(state);\n});\n\nDrawerOverlay.displayName = 'DrawerOverlay';\n"],"names":["React","useDrawerOverlay_unstable","renderDrawerOverlay_unstable","useDrawerOverlayStyles_unstable","DrawerOverlay","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,4BAA4B,QAAQ,wBAAwB;AACrE,SAASC,+BAA+B,QAAQ,kCAAkC;AAIlF;;CAEC,GACD,OAAO,MAAMC,8BAAyDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,QAAQP,0BAA0BK,OAAOC;IAE/CJ,gCAAgCK;IAEhC,OAAON,6BAA6BM;AACtC,GAAG;AAEHJ,cAAcK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DrawerOverlay.types.ts"],"sourcesContent":["import { DialogProps, DialogSurfaceProps, DialogSurfaceSlots } from '@fluentui/react-dialog';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { DrawerBaseProps } from '../../util/DrawerBase.types';\n\nexport type DrawerOverlaySlots = DialogSurfaceSlots & {\n root: Slot<DialogSurfaceProps>;\n};\n\n/**\n * DrawerOverlay Props\n */\nexport type DrawerOverlayProps = ComponentProps<DrawerOverlaySlots> &\n DrawerBaseProps &\n Pick<DialogProps, 'modalType' | 'onOpenChange' | 'inertTrapFocus'>;\n\n/**\n * State used in rendering DrawerOverlay\n */\nexport type DrawerOverlayState = ComponentState<DrawerOverlaySlots> &\n
|
|
1
|
+
{"version":3,"sources":["DrawerOverlay.types.ts"],"sourcesContent":["import { DialogProps, DialogSurfaceProps, DialogSurfaceSlots } from '@fluentui/react-dialog';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { MotionState } from '@fluentui/react-motion-preview';\nimport type { DrawerBaseProps, DrawerBaseState } from '../../util/DrawerBase.types';\n\nexport type DrawerOverlaySlots = DialogSurfaceSlots & {\n root: Slot<DialogSurfaceProps>;\n};\n\n/**\n * DrawerOverlay Props\n */\nexport type DrawerOverlayProps = ComponentProps<DrawerOverlaySlots> &\n DrawerBaseProps &\n Pick<DialogProps, 'modalType' | 'onOpenChange' | 'inertTrapFocus'>;\n\n/**\n * State used in rendering DrawerOverlay\n */\nexport type DrawerOverlayState = Required<\n Omit<ComponentState<DrawerOverlaySlots>, 'backdrop'> &\n DrawerBaseState & {\n dialog: DialogProps;\n backdropMotion: MotionState<HTMLDivElement>;\n }\n>;\n"],"names":[],"mappings":"AAAA,WAyBE"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
/** @jsxRuntime
|
|
1
|
+
/** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { assertSlots } from '@fluentui/react-utilities';
|
|
3
3
|
import { Dialog } from '@fluentui/react-dialog';
|
|
4
4
|
/**
|
|
5
5
|
* Render the final JSX of DrawerOverlay
|
|
6
6
|
*/ export const renderDrawerOverlay_unstable = (state)=>{
|
|
7
|
+
if (!state.motion.canRender) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
7
10
|
assertSlots(state);
|
|
8
|
-
return /*#__PURE__*/
|
|
11
|
+
return /*#__PURE__*/ _jsx(Dialog, {
|
|
12
|
+
...state.dialog,
|
|
13
|
+
children: /*#__PURE__*/ _jsx(state.root, {})
|
|
14
|
+
});
|
|
9
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderDrawerOverlay.tsx"],"sourcesContent":["/** @jsxRuntime
|
|
1
|
+
{"version":3,"sources":["renderDrawerOverlay.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { DrawerOverlayState, DrawerOverlaySlots } from './DrawerOverlay.types';\nimport { Dialog } from '@fluentui/react-dialog';\n\n/**\n * Render the final JSX of DrawerOverlay\n */\nexport const renderDrawerOverlay_unstable = (state: DrawerOverlayState) => {\n if (!state.motion.canRender) {\n return null;\n }\n\n assertSlots<DrawerOverlaySlots>(state);\n\n return (\n <Dialog {...state.dialog}>\n <state.root />\n </Dialog>\n );\n};\n"],"names":["assertSlots","Dialog","renderDrawerOverlay_unstable","state","motion","canRender","dialog","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AACjD,SAASA,WAAW,QAAQ,4BAA4B;AAExD,SAASC,MAAM,QAAQ,yBAAyB;AAEhD;;CAEC,GACD,OAAO,MAAMC,+BAA+B,CAACC;IAC3C,IAAI,CAACA,MAAMC,MAAM,CAACC,SAAS,EAAE;QAC3B,OAAO;IACT;IAEAL,YAAgCG;IAEhC,qBACE,KAACF;QAAQ,GAAGE,MAAMG,MAAM;kBACtB,cAAA,KAACH,MAAMI,IAAI;;AAGjB,EAAE"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { getNativeElementProps, slot } from '@fluentui/react-utilities';
|
|
2
|
+
import { getNativeElementProps, slot, useMergedRefs } from '@fluentui/react-utilities';
|
|
3
3
|
import { DialogSurface } from '@fluentui/react-dialog';
|
|
4
|
-
import {
|
|
4
|
+
import { useDrawerDefaultProps } from '../../util/useDrawerDefaultProps';
|
|
5
|
+
import { useMotion } from '@fluentui/react-motion-preview';
|
|
5
6
|
/**
|
|
6
7
|
* Create the state required to render DrawerOverlay.
|
|
7
8
|
*
|
|
@@ -9,29 +10,47 @@ import { getDefaultDrawerProps } from '../../util/getDefaultDrawerProps';
|
|
|
9
10
|
* before being passed to renderDrawerOverlay_unstable.
|
|
10
11
|
*
|
|
11
12
|
* @param props - props from this instance of DrawerOverlay
|
|
12
|
-
* @param ref - reference to root
|
|
13
|
+
* @param ref - reference to root HTMLDivElement of DrawerOverlay
|
|
13
14
|
*/ export const useDrawerOverlay_unstable = (props, ref)=>{
|
|
14
|
-
const { open
|
|
15
|
-
const { modalType ='modal'
|
|
15
|
+
const { open, defaultOpen, size, position } = useDrawerDefaultProps(props);
|
|
16
|
+
const { modalType = 'modal', inertTrapFocus, onOpenChange } = props;
|
|
17
|
+
const drawerMotion = useMotion(open);
|
|
18
|
+
const backdropMotion = useMotion(open);
|
|
19
|
+
const hasCustomBackdrop = modalType !== 'non-modal' && props.backdrop !== null;
|
|
20
|
+
const root = slot.always(getNativeElementProps('div', {
|
|
21
|
+
...props,
|
|
22
|
+
ref: useMergedRefs(ref, drawerMotion.ref)
|
|
23
|
+
}), {
|
|
24
|
+
elementType: DialogSurface,
|
|
25
|
+
defaultProps: {
|
|
26
|
+
backdrop: slot.optional(props.backdrop, {
|
|
27
|
+
elementType: 'div',
|
|
28
|
+
renderByDefault: hasCustomBackdrop,
|
|
29
|
+
defaultProps: {
|
|
30
|
+
ref: backdropMotion.ref
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
const dialog = slot.always({
|
|
36
|
+
open: true,
|
|
37
|
+
defaultOpen,
|
|
38
|
+
onOpenChange,
|
|
39
|
+
inertTrapFocus,
|
|
40
|
+
modalType
|
|
41
|
+
}, {
|
|
42
|
+
elementType: 'div'
|
|
43
|
+
});
|
|
16
44
|
return {
|
|
17
45
|
components: {
|
|
18
46
|
root: DialogSurface,
|
|
19
47
|
backdrop: 'div'
|
|
20
48
|
},
|
|
21
|
-
root
|
|
22
|
-
|
|
23
|
-
...props
|
|
24
|
-
}), {
|
|
25
|
-
elementType: DialogSurface
|
|
26
|
-
}),
|
|
27
|
-
dialog: {
|
|
28
|
-
open,
|
|
29
|
-
defaultOpen,
|
|
30
|
-
onOpenChange,
|
|
31
|
-
inertTrapFocus,
|
|
32
|
-
modalType
|
|
33
|
-
},
|
|
49
|
+
root,
|
|
50
|
+
dialog,
|
|
34
51
|
size,
|
|
35
|
-
position
|
|
52
|
+
position,
|
|
53
|
+
motion: drawerMotion,
|
|
54
|
+
backdropMotion
|
|
36
55
|
};
|
|
37
56
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDrawerOverlay.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, slot } from '@fluentui/react-utilities';\nimport type { DrawerOverlayProps, DrawerOverlayState } from './DrawerOverlay.types';\nimport { DialogProps, DialogSurface } from '@fluentui/react-dialog';\nimport {
|
|
1
|
+
{"version":3,"sources":["useDrawerOverlay.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, slot, useMergedRefs } from '@fluentui/react-utilities';\nimport type { DrawerOverlayProps, DrawerOverlayState } from './DrawerOverlay.types';\nimport { DialogProps, DialogSurface, DialogSurfaceProps } from '@fluentui/react-dialog';\nimport { useDrawerDefaultProps } from '../../util/useDrawerDefaultProps';\nimport { useMotion } from '@fluentui/react-motion-preview';\n\n/**\n * Create the state required to render DrawerOverlay.\n *\n * The returned state can be modified with hooks such as useDrawerOverlayStyles_unstable,\n * before being passed to renderDrawerOverlay_unstable.\n *\n * @param props - props from this instance of DrawerOverlay\n * @param ref - reference to root HTMLDivElement of DrawerOverlay\n */\nexport const useDrawerOverlay_unstable = (\n props: DrawerOverlayProps,\n ref: React.Ref<HTMLDivElement>,\n): DrawerOverlayState => {\n const { open, defaultOpen, size, position } = useDrawerDefaultProps(props);\n const { modalType = 'modal', inertTrapFocus, onOpenChange } = props;\n\n const drawerMotion = useMotion<HTMLDivElement>(open);\n const backdropMotion = useMotion<HTMLDivElement>(open);\n\n const hasCustomBackdrop = modalType !== 'non-modal' && props.backdrop !== null;\n\n const root = slot.always<DialogSurfaceProps>(\n getNativeElementProps('div', {\n ...props,\n ref: useMergedRefs(ref, drawerMotion.ref),\n }),\n {\n elementType: DialogSurface,\n defaultProps: {\n backdrop: slot.optional(props.backdrop, {\n elementType: 'div',\n renderByDefault: hasCustomBackdrop,\n defaultProps: {\n ref: backdropMotion.ref,\n },\n }),\n },\n },\n );\n\n const dialog = slot.always(\n {\n open: true,\n defaultOpen,\n onOpenChange,\n inertTrapFocus,\n modalType,\n } as DialogProps,\n {\n elementType: 'div',\n },\n );\n\n return {\n components: {\n root: DialogSurface,\n backdrop: 'div',\n },\n\n root,\n\n dialog,\n size,\n position,\n motion: drawerMotion,\n backdropMotion,\n };\n};\n"],"names":["React","getNativeElementProps","slot","useMergedRefs","DialogSurface","useDrawerDefaultProps","useMotion","useDrawerOverlay_unstable","props","ref","open","defaultOpen","size","position","modalType","inertTrapFocus","onOpenChange","drawerMotion","backdropMotion","hasCustomBackdrop","backdrop","root","always","elementType","defaultProps","optional","renderByDefault","dialog","components","motion"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,IAAI,EAAEC,aAAa,QAAQ,4BAA4B;AAEvF,SAAsBC,aAAa,QAA4B,yBAAyB;AACxF,SAASC,qBAAqB,QAAQ,mCAAmC;AACzE,SAASC,SAAS,QAAQ,iCAAiC;AAE3D;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,MAAM,EAAEC,IAAI,EAAEC,WAAW,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGR,sBAAsBG;IACpE,MAAM,EAAEM,YAAY,OAAO,EAAEC,cAAc,EAAEC,YAAY,EAAE,GAAGR;IAE9D,MAAMS,eAAeX,UAA0BI;IAC/C,MAAMQ,iBAAiBZ,UAA0BI;IAEjD,MAAMS,oBAAoBL,cAAc,eAAeN,MAAMY,QAAQ,KAAK;IAE1E,MAAMC,OAAOnB,KAAKoB,MAAM,CACtBrB,sBAAsB,OAAO;QAC3B,GAAGO,KAAK;QACRC,KAAKN,cAAcM,KAAKQ,aAAaR,GAAG;IAC1C,IACA;QACEc,aAAanB;QACboB,cAAc;YACZJ,UAAUlB,KAAKuB,QAAQ,CAACjB,MAAMY,QAAQ,EAAE;gBACtCG,aAAa;gBACbG,iBAAiBP;gBACjBK,cAAc;oBACZf,KAAKS,eAAeT,GAAG;gBACzB;YACF;QACF;IACF;IAGF,MAAMkB,SAASzB,KAAKoB,MAAM,CACxB;QACEZ,MAAM;QACNC;QACAK;QACAD;QACAD;IACF,GACA;QACES,aAAa;IACf;IAGF,OAAO;QACLK,YAAY;YACVP,MAAMjB;YACNgB,UAAU;QACZ;QAEAC;QAEAM;QACAf;QACAC;QACAgB,QAAQZ;QACRC;IACF;AACF,EAAE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { __styles, mergeClasses } from '@griffel/react';
|
|
2
|
-
import { useDrawerBaseStyles } from '../../util/useDrawerBaseStyles.styles';
|
|
3
1
|
import * as React from 'react';
|
|
2
|
+
import { __styles, mergeClasses } from '@griffel/react';
|
|
3
|
+
import { tokens } from '@fluentui/react-theme';
|
|
4
|
+
import { useDrawerBaseClassNames, drawerCSSVars, useDrawerDurationStyles } from '../../util/useDrawerBaseStyles.styles';
|
|
4
5
|
export const drawerOverlayClassNames = {
|
|
5
6
|
root: 'fui-DrawerOverlay',
|
|
6
7
|
backdrop: 'fui-DrawerOverlay__backdrop'
|
|
@@ -8,25 +9,58 @@ export const drawerOverlayClassNames = {
|
|
|
8
9
|
/**
|
|
9
10
|
* Styles for the root slot
|
|
10
11
|
*/
|
|
11
|
-
const
|
|
12
|
+
const useDrawerRootStyles = /*#__PURE__*/__styles({
|
|
12
13
|
root: {
|
|
13
14
|
qhf8xq: "f19dog8a",
|
|
14
15
|
Bhzewxz: "f15twtuk",
|
|
15
|
-
B5kzvoi: "f1yab3r1"
|
|
16
|
+
B5kzvoi: "f1yab3r1",
|
|
17
|
+
abs64n: "fk73vx1",
|
|
18
|
+
E5pizo: "fliqkoi",
|
|
19
|
+
Bmy1vo4: "f1neo61",
|
|
20
|
+
Es3by: "f1ytgekk"
|
|
21
|
+
},
|
|
22
|
+
start: {
|
|
23
|
+
Bz10aip: "f1d8gkik"
|
|
24
|
+
},
|
|
25
|
+
end: {
|
|
26
|
+
Bz10aip: "f1g0pcr8"
|
|
27
|
+
},
|
|
28
|
+
visible: {
|
|
29
|
+
abs64n: "f5p0z4x",
|
|
30
|
+
Bz10aip: "f87uvqx",
|
|
31
|
+
E5pizo: "f10nrhrw"
|
|
32
|
+
}
|
|
33
|
+
}, {
|
|
34
|
+
d: [".f19dog8a{position:fixed;}", ".f15twtuk{top:0;}", ".f1yab3r1{bottom:0;}", ".fk73vx1{opacity:0;}", ".fliqkoi{box-shadow:0px transparent;}", ".f1neo61{transition-property:transform,box-shadow,opacity;}", ".f1ytgekk{will-change:transform,box-shadow,opacity;}", ".f1d8gkik{transform:translate3D(calc(var(--fui-Drawer--size) * -1), 0, 0);}", ".f1g0pcr8{transform:translate3D(calc(var(--fui-Drawer--size) * 1), 0, 0);}", ".f5p0z4x{opacity:1;}", ".f87uvqx{transform:translate3D(0, 0, 0);}", ".f10nrhrw{box-shadow:var(--shadow64);}"]
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* Styles for the backdrop slot
|
|
38
|
+
*/
|
|
39
|
+
const useBackdropMotionStyles = /*#__PURE__*/__styles({
|
|
40
|
+
backdrop: {
|
|
41
|
+
abs64n: "fk73vx1",
|
|
42
|
+
Bmy1vo4: "f13u1uyl",
|
|
43
|
+
Bkqvd7p: "f17wnm97",
|
|
44
|
+
Es3by: "f1gqqdtu"
|
|
45
|
+
},
|
|
46
|
+
visible: {
|
|
47
|
+
abs64n: "f5p0z4x"
|
|
16
48
|
}
|
|
17
49
|
}, {
|
|
18
|
-
d: [".
|
|
50
|
+
d: [".fk73vx1{opacity:0;}", ".f13u1uyl{transition-property:opacity;}", ".f17wnm97{transition-timing-function:var(--curveEasyEase);}", ".f1gqqdtu{will-change:opacity;}", ".f5p0z4x{opacity:1;}"]
|
|
19
51
|
});
|
|
20
52
|
/**
|
|
21
53
|
* Apply styling to the DrawerOverlay slots based on the state
|
|
22
54
|
*/
|
|
23
55
|
export const useDrawerOverlayStyles_unstable = state => {
|
|
24
|
-
const
|
|
25
|
-
const
|
|
56
|
+
const baseClassNames = useDrawerBaseClassNames(state);
|
|
57
|
+
const rootStyles = useDrawerRootStyles();
|
|
58
|
+
const backdropMotionStyles = useBackdropMotionStyles();
|
|
59
|
+
const durationStyles = useDrawerDurationStyles();
|
|
26
60
|
const backdrop = state.root.backdrop;
|
|
27
|
-
state.root.className = mergeClasses(drawerOverlayClassNames.root,
|
|
61
|
+
state.root.className = mergeClasses(drawerOverlayClassNames.root, baseClassNames, rootStyles.root, rootStyles[state.position], state.motion.active && rootStyles.visible, state.root.className);
|
|
28
62
|
if (backdrop) {
|
|
29
|
-
backdrop.className = mergeClasses(drawerOverlayClassNames.backdrop, backdrop.className);
|
|
63
|
+
backdrop.className = mergeClasses(drawerOverlayClassNames.backdrop, backdropMotionStyles.backdrop, durationStyles[state.size], state.backdropMotion.active && backdropMotionStyles.visible, backdrop.className);
|
|
30
64
|
}
|
|
31
65
|
return state;
|
|
32
66
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__styles","mergeClasses","
|
|
1
|
+
{"version":3,"names":["React","__styles","mergeClasses","tokens","useDrawerBaseClassNames","drawerCSSVars","useDrawerDurationStyles","drawerOverlayClassNames","root","backdrop","useDrawerRootStyles","qhf8xq","Bhzewxz","B5kzvoi","abs64n","E5pizo","Bmy1vo4","Es3by","start","Bz10aip","end","visible","d","useBackdropMotionStyles","Bkqvd7p","useDrawerOverlayStyles_unstable","state","baseClassNames","rootStyles","backdropMotionStyles","durationStyles","className","position","motion","active","size","backdropMotion"],"sources":["useDrawerOverlayStyles.styles.js"],"sourcesContent":["import * as React from 'react';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { useDrawerBaseClassNames, drawerCSSVars, useDrawerDurationStyles } from '../../util/useDrawerBaseStyles.styles';\nexport const drawerOverlayClassNames = {\n root: 'fui-DrawerOverlay',\n backdrop: 'fui-DrawerOverlay__backdrop'\n};\n/**\n * Styles for the root slot\n */ const useDrawerRootStyles = makeStyles({\n root: {\n position: 'fixed',\n top: 0,\n bottom: 0,\n opacity: 0,\n boxShadow: '0px transparent',\n transitionProperty: 'transform, box-shadow, opacity',\n willChange: 'transform, box-shadow, opacity'\n },\n /* Positioning */ start: {\n transform: `translate3D(calc(var(${drawerCSSVars.drawerSizeVar}) * -1), 0, 0)`\n },\n end: {\n transform: `translate3D(calc(var(${drawerCSSVars.drawerSizeVar}) * 1), 0, 0)`\n },\n /* Visible */ visible: {\n opacity: 1,\n transform: 'translate3D(0, 0, 0)',\n boxShadow: tokens.shadow64\n }\n});\n/**\n * Styles for the backdrop slot\n */ const useBackdropMotionStyles = makeStyles({\n backdrop: {\n opacity: 0,\n transitionProperty: 'opacity',\n transitionTimingFunction: tokens.curveEasyEase,\n willChange: 'opacity'\n },\n visible: {\n opacity: 1\n }\n});\n/**\n * Apply styling to the DrawerOverlay slots based on the state\n */ export const useDrawerOverlayStyles_unstable = (state)=>{\n const baseClassNames = useDrawerBaseClassNames(state);\n const rootStyles = useDrawerRootStyles();\n const backdropMotionStyles = useBackdropMotionStyles();\n const durationStyles = useDrawerDurationStyles();\n const backdrop = state.root.backdrop;\n state.root.className = mergeClasses(drawerOverlayClassNames.root, baseClassNames, rootStyles.root, rootStyles[state.position], state.motion.active && rootStyles.visible, state.root.className);\n if (backdrop) {\n backdrop.className = mergeClasses(drawerOverlayClassNames.backdrop, backdropMotionStyles.backdrop, durationStyles[state.size], state.backdropMotion.active && backdropMotionStyles.visible, backdrop.className);\n }\n return state;\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAAAC,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,uBAAuB,EAAEC,aAAa,EAAEC,uBAAuB,QAAQ,uCAAuC;AACvH,OAAO,MAAMC,uBAAuB,GAAG;EACnCC,IAAI,EAAE,mBAAmB;EACzBC,QAAQ,EAAE;AACd,CAAC;AACD;AACA;AACA;AAAI,MAAMC,mBAAmB,gBAAGT,QAAA;EAAAO,IAAA;IAAAG,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,KAAA;EAAA;EAAAC,KAAA;IAAAC,OAAA;EAAA;EAAAC,GAAA;IAAAD,OAAA;EAAA;EAAAE,OAAA;IAAAP,MAAA;IAAAK,OAAA;IAAAJ,MAAA;EAAA;AAAA;EAAAO,CAAA;AAAA,CAqB/B,CAAC;AACF;AACA;AACA;AAAI,MAAMC,uBAAuB,gBAAGtB,QAAA;EAAAQ,QAAA;IAAAK,MAAA;IAAAE,OAAA;IAAAQ,OAAA;IAAAP,KAAA;EAAA;EAAAI,OAAA;IAAAP,MAAA;EAAA;AAAA;EAAAQ,CAAA;AAAA,CAUnC,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMG,+BAA+B,GAAIC,KAAK,IAAG;EACxD,MAAMC,cAAc,GAAGvB,uBAAuB,CAACsB,KAAK,CAAC;EACrD,MAAME,UAAU,GAAGlB,mBAAmB,CAAC,CAAC;EACxC,MAAMmB,oBAAoB,GAAGN,uBAAuB,CAAC,CAAC;EACtD,MAAMO,cAAc,GAAGxB,uBAAuB,CAAC,CAAC;EAChD,MAAMG,QAAQ,GAAGiB,KAAK,CAAClB,IAAI,CAACC,QAAQ;EACpCiB,KAAK,CAAClB,IAAI,CAACuB,SAAS,GAAG7B,YAAY,CAACK,uBAAuB,CAACC,IAAI,EAAEmB,cAAc,EAAEC,UAAU,CAACpB,IAAI,EAAEoB,UAAU,CAACF,KAAK,CAACM,QAAQ,CAAC,EAAEN,KAAK,CAACO,MAAM,CAACC,MAAM,IAAIN,UAAU,CAACP,OAAO,EAAEK,KAAK,CAAClB,IAAI,CAACuB,SAAS,CAAC;EAC/L,IAAItB,QAAQ,EAAE;IACVA,QAAQ,CAACsB,SAAS,GAAG7B,YAAY,CAACK,uBAAuB,CAACE,QAAQ,EAAEoB,oBAAoB,CAACpB,QAAQ,EAAEqB,cAAc,CAACJ,KAAK,CAACS,IAAI,CAAC,EAAET,KAAK,CAACU,cAAc,CAACF,MAAM,IAAIL,oBAAoB,CAACR,OAAO,EAAEZ,QAAQ,CAACsB,SAAS,CAAC;EACnN;EACA,OAAOL,KAAK;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DrawerBase.types.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["DrawerBase.types.ts"],"sourcesContent":["import { MotionShorthand, MotionState } from '@fluentui/react-motion-preview';\n\nexport type DrawerBaseProps = {\n /**\n * Position of the drawer.\n *\n * @default 'start'\n */\n position?: 'start' | 'end';\n\n /**\n * Size of the drawer.\n *\n * - 'small' - Drawer is 320px wide.\n * - 'medium' - Drawer is 592px wide.\n * - 'large' - Drawer is 940px wide.\n * - 'full' - Drawer is 100vw wide.\n *\n * @default 'small'\n */\n size?: 'small' | 'medium' | 'large' | 'full';\n\n /**\n * Controls the open state of the Drawer\n *\n * @default false\n */\n open?: MotionShorthand<HTMLDivElement>;\n\n /**\n * Default value for the uncontrolled open state of the Drawer.\n *\n * @default false\n */\n defaultOpen?: boolean;\n};\n\nexport type DrawerBaseState = Required<Pick<DrawerBaseProps, 'position' | 'size'>> & {\n motion: MotionState<HTMLDivElement>;\n};\n"],"names":[],"mappings":"AAAA,WAuCE"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { __styles, shorthands } from '@griffel/react';
|
|
1
|
+
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
2
2
|
import { tokens } from '@fluentui/react-theme';
|
|
3
|
+
/**
|
|
4
|
+
* CSS variable names used internally for uniform styling in Drawer.
|
|
5
|
+
*/
|
|
6
|
+
export const drawerCSSVars = {
|
|
7
|
+
drawerSizeVar: '--fui-Drawer--size'
|
|
8
|
+
};
|
|
3
9
|
/**
|
|
4
10
|
* Styles for the root slot
|
|
5
11
|
*/
|
|
@@ -19,6 +25,7 @@ export const useDrawerBaseStyles = /*#__PURE__*/__styles({
|
|
|
19
25
|
Bekrc4i: ["f1358rze", "f1rvrf73"],
|
|
20
26
|
Bn0qgzm: "fqdk4by",
|
|
21
27
|
ibv6hh: ["f1rvrf73", "f1358rze"],
|
|
28
|
+
a9b677: "f3rx6dk",
|
|
22
29
|
B2u0y6b: "f1w39fev",
|
|
23
30
|
Bqenvij: "f11ysow2",
|
|
24
31
|
B7ck84d: "f1ewtqcl",
|
|
@@ -28,6 +35,15 @@ export const useDrawerBaseStyles = /*#__PURE__*/__styles({
|
|
|
28
35
|
Brf1p80: "fbhxue7",
|
|
29
36
|
De3pzq: "fxugw4r"
|
|
30
37
|
},
|
|
38
|
+
entering: {
|
|
39
|
+
Bkqvd7p: "f18ad807"
|
|
40
|
+
},
|
|
41
|
+
exiting: {
|
|
42
|
+
Bkqvd7p: "f1mfizis"
|
|
43
|
+
},
|
|
44
|
+
reducedMotion: {
|
|
45
|
+
Hwfdqs: "f5e8c63"
|
|
46
|
+
},
|
|
31
47
|
start: {
|
|
32
48
|
oyh7mz: ["f1vgc2s3", "f1e31b4d"],
|
|
33
49
|
j35jbq: ["fvfyk4", "frppm18"]
|
|
@@ -37,19 +53,46 @@ export const useDrawerBaseStyles = /*#__PURE__*/__styles({
|
|
|
37
53
|
oyh7mz: ["frppm18", "fvfyk4"]
|
|
38
54
|
},
|
|
39
55
|
small: {
|
|
40
|
-
|
|
56
|
+
Bjr0ffy: "f1exhnwo"
|
|
57
|
+
},
|
|
58
|
+
medium: {
|
|
59
|
+
Bjr0ffy: "fqofjzu"
|
|
60
|
+
},
|
|
61
|
+
large: {
|
|
62
|
+
Bjr0ffy: "fce6y3m"
|
|
63
|
+
},
|
|
64
|
+
full: {
|
|
65
|
+
Bjr0ffy: "fsdmzs6"
|
|
66
|
+
}
|
|
67
|
+
}, {
|
|
68
|
+
d: [".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".f1p9o1ba{overflow-x:hidden;}", ".f1sil6mw{overflow-y:hidden;}", ".f1krrbdw{border-bottom-right-radius:0;}", ".f1deotkl{border-bottom-left-radius:0;}", ".f10ostut{border-top-right-radius:0;}", ".f1ozlkrg{border-top-left-radius:0;}", ".fre7gi1{border-top-width:0;}", ".f1358rze{border-right-width:0;}", ".f1rvrf73{border-left-width:0;}", ".fqdk4by{border-bottom-width:0;}", ".f3rx6dk{width:var(--fui-Drawer--size);}", ".f1w39fev{max-width:100vw;}", ".f11ysow2{height:auto;}", ".f1ewtqcl{box-sizing:border-box;}", ".f22iagw{display:flex;}", ".f1vx9l62{flex-direction:column;}", ".f6jr5hl{align-items:flex-start;}", ".fbhxue7{justify-content:flex-start;}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f18ad807{transition-timing-function:var(--curveDecelerateMid);}", ".f1mfizis{transition-timing-function:var(--curveAccelerateMin);}", ".f1vgc2s3{left:0;}", ".f1e31b4d{right:0;}", ".fvfyk4{right:auto;}", ".frppm18{left:auto;}", ".f1exhnwo{--fui-Drawer--size:320px;}", ".fqofjzu{--fui-Drawer--size:592px;}", ".fce6y3m{--fui-Drawer--size:940px;}", ".fsdmzs6{--fui-Drawer--size:100vw;}"],
|
|
69
|
+
m: [["@media screen and (prefers-reduced-motion: reduce){.f5e8c63{transition-duration:0.001ms;}}", {
|
|
70
|
+
m: "screen and (prefers-reduced-motion: reduce)"
|
|
71
|
+
}]]
|
|
72
|
+
});
|
|
73
|
+
export const useDrawerDurationStyles = /*#__PURE__*/__styles({
|
|
74
|
+
small: {
|
|
75
|
+
B3o57yi: "fc397y7"
|
|
41
76
|
},
|
|
42
77
|
medium: {
|
|
43
|
-
|
|
78
|
+
B3o57yi: "f78771"
|
|
44
79
|
},
|
|
45
80
|
large: {
|
|
46
|
-
|
|
81
|
+
B3o57yi: "f9ymmep"
|
|
47
82
|
},
|
|
48
83
|
full: {
|
|
49
|
-
|
|
50
|
-
B2u0y6b: "f1w39fev"
|
|
84
|
+
B3o57yi: "f1loko9l"
|
|
51
85
|
}
|
|
52
86
|
}, {
|
|
53
|
-
d: [".
|
|
87
|
+
d: [".fc397y7{transition-duration:var(--durationGentle);}", ".f78771{transition-duration:var(--durationSlow);}", ".f9ymmep{transition-duration:var(--durationSlower);}", ".f1loko9l{transition-duration:var(--durationUltraSlow);}"]
|
|
54
88
|
});
|
|
89
|
+
export const useDrawerBaseClassNames = ({
|
|
90
|
+
position,
|
|
91
|
+
size,
|
|
92
|
+
motion
|
|
93
|
+
}) => {
|
|
94
|
+
const baseStyles = useDrawerBaseStyles();
|
|
95
|
+
const durationStyles = useDrawerDurationStyles();
|
|
96
|
+
return mergeClasses(baseStyles.root, baseStyles[position], durationStyles[size], baseStyles[size], baseStyles.reducedMotion, motion.type === 'entering' && baseStyles.entering, motion.type === 'exiting' && baseStyles.exiting);
|
|
97
|
+
};
|
|
55
98
|
//# sourceMappingURL=useDrawerBaseStyles.styles.js.map
|