Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Drawer", {
enumerable: true,
get: function() {
return Drawer;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const _drawerContext = require("../../contexts/drawerContext");
const _useDrawer = require("./useDrawer");
const _renderDrawer = require("./renderDrawer");
const _useDrawerStylesstyles = require("./useDrawerStyles.styles");
const Drawer = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useDrawer.useDrawer_unstable)(props, ref);
const contextValue = (0, _drawerContext.useDrawerContextValue)();
(0, _useDrawerStylesstyles.useDrawerStyles_unstable)(state);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useDrawerStyles_unstable')(state);
return (0, _renderDrawer.renderDrawer_unstable)(state, contextValue);
});
Drawer.displayName = 'Drawer';
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\nimport { useDrawerContextValue } from '../../contexts/drawerContext';\n\nimport { useDrawer_unstable } from './useDrawer';\nimport { renderDrawer_unstable } from './renderDrawer';\nimport { useDrawerStyles_unstable } from './useDrawerStyles.styles';\nimport type { DrawerProps } from './Drawer.types';\n\n/**\n * Drawer contains supplementary content and are used for complex creation, edit, or management experiences.\n */\nexport const Drawer: ForwardRefComponent<DrawerProps> = React.forwardRef((props, ref) => {\n const state = useDrawer_unstable(props, ref);\n const contextValue = useDrawerContextValue();\n\n useDrawerStyles_unstable(state);\n useCustomStyleHook_unstable('useDrawerStyles_unstable')(state);\n\n return renderDrawer_unstable(state, contextValue);\n});\n\nDrawer.displayName = 'Drawer';\n"],"names":["Drawer","React","forwardRef","props","ref","state","useDrawer_unstable","contextValue","useDrawerContextValue","useDrawerStyles_unstable","useCustomStyleHook_unstable","renderDrawer_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAcaA;;;eAAAA;;;;iEAdU;qCAEqB;+BAEN;2BAEH;8BACG;uCACG;AAMlC,MAAMA,SAAAA,WAAAA,GAA2CC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC/E,MAAMC,QAAQC,IAAAA,6BAAAA,EAAmBH,OAAOC;IACxC,MAAMG,eAAeC,IAAAA,oCAAAA;IAErBC,IAAAA,+CAAAA,EAAyBJ;IACzBK,IAAAA,gDAAAA,EAA4B,4BAA4BL;IAExD,OAAOM,IAAAA,mCAAAA,EAAsBN,OAAOE;AACtC;AAEAP,OAAOY,WAAW,GAAG"}
@@ -0,0 +1,6 @@
/**
* State used in rendering Drawer
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Drawer/Drawer.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState } from '@fluentui/react-utilities';\n\nimport type { OverlayDrawerProps, OverlayDrawerSlots } from '../OverlayDrawer';\nimport type { InlineDrawerProps, InlineDrawerSlots } from '../InlineDrawer';\n\nexport type DrawerSlots = Pick<OverlayDrawerSlots, 'root'> | Pick<InlineDrawerSlots, 'root'>;\n\n/**\n * Drawer Props\n */\nexport type DrawerProps = ComponentProps<DrawerSlots> & {\n /**\n * Type of the drawer.\n *\n * - 'overlay' - Drawer is hidden by default and can be opened by clicking on the trigger.\n * - 'inline' - Drawer is stacked with the content\n *\n * @default overlay\n */\n type?: 'inline' | 'overlay';\n} & (OverlayDrawerProps | InlineDrawerProps);\n\n/**\n * State used in rendering Drawer\n */\nexport type DrawerState = ComponentState<DrawerSlots>;\n"],"names":[],"rangeMappings":";;","mappings":"AAsBA;;CAEC"}
@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Drawer: function() {
return _Drawer.Drawer;
},
drawerClassNames: function() {
return _useDrawerStylesstyles.drawerClassNames;
},
renderDrawer_unstable: function() {
return _renderDrawer.renderDrawer_unstable;
},
useDrawerStyles_unstable: function() {
return _useDrawerStylesstyles.useDrawerStyles_unstable;
},
useDrawer_unstable: function() {
return _useDrawer.useDrawer_unstable;
}
});
const _Drawer = require("./Drawer");
const _renderDrawer = require("./renderDrawer");
const _useDrawer = require("./useDrawer");
const _useDrawerStylesstyles = require("./useDrawerStyles.styles");
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Drawer/index.ts"],"sourcesContent":["export { Drawer } from './Drawer';\nexport type { DrawerProps, DrawerSlots, DrawerState } from './Drawer.types';\nexport { renderDrawer_unstable } from './renderDrawer';\nexport { useDrawer_unstable } from './useDrawer';\nexport { drawerClassNames, useDrawerStyles_unstable } from './useDrawerStyles.styles';\n"],"names":["Drawer","drawerClassNames","renderDrawer_unstable","useDrawerStyles_unstable","useDrawer_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,MAAM;eAANA,cAAM;;IAINC,gBAAgB;eAAhBA,uCAAgB;;IAFhBC,qBAAqB;eAArBA,mCAAqB;;IAEHC,wBAAwB;eAAxBA,+CAAwB;;IAD1CC,kBAAkB;eAAlBA,6BAAkB;;;wBAHJ;8BAEe;2BACH;uCACwB"}
@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "renderDrawer_unstable", {
enumerable: true,
get: function() {
return renderDrawer_unstable;
}
});
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
const _reactutilities = require("@fluentui/react-utilities");
const _drawerContext = require("../../contexts/drawerContext");
const renderDrawer_unstable = (state, contextValue)=>{
(0, _reactutilities.assertSlots)(state);
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_drawerContext.DrawerProvider, {
value: contextValue,
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {})
});
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Drawer/renderDrawer.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { DrawerContextValue, DrawerProvider } from '../../contexts/drawerContext';\n\nimport type { DrawerState, DrawerSlots } from './Drawer.types';\n\n/**\n * Render the final JSX of Drawer\n */\nexport const renderDrawer_unstable = (state: DrawerState, contextValue: DrawerContextValue) => {\n assertSlots<DrawerSlots>(state);\n\n return (\n <DrawerProvider value={contextValue}>\n <state.root />\n </DrawerProvider>\n );\n};\n"],"names":["renderDrawer_unstable","state","contextValue","assertSlots","_jsx","DrawerProvider","value","root"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;4BAVb;gCAE4B;+BACuB;AAO5C,MAAMA,wBAAwB,CAACC,OAAoBC;IACxDC,IAAAA,2BAAAA,EAAyBF;IAEzB,OAAA,WAAA,GACEG,IAAAA,eAAA,EAACC,6BAAAA,EAAAA;QAAeC,OAAOJ;kBACrB,WAAA,GAAAE,IAAAA,eAAA,EAACH,MAAMM,IAAI,EAAA,CAAA;;AAGjB"}
@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useDrawer_unstable", {
enumerable: true,
get: function() {
return useDrawer_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactutilities = require("@fluentui/react-utilities");
const _OverlayDrawer = require("../OverlayDrawer");
const _InlineDrawer = require("../InlineDrawer");
const useDrawer_unstable = (props, ref)=>{
// casting here to convert a union of functions to a single function with the union of parameters
const elementType = props.type === 'inline' ? _InlineDrawer.InlineDrawer : _OverlayDrawer.OverlayDrawer;
const root = _reactutilities.slot.always({
ref,
...props
}, {
elementType
});
return {
components: {
root: elementType
},
root
};
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Drawer/useDrawer.ts"],"sourcesContent":["import * as React from 'react';\nimport { slot } from '@fluentui/react-utilities';\n\nimport type { DrawerProps, DrawerState } from './Drawer.types';\nimport { OverlayDrawer, type OverlayDrawerProps } from '../OverlayDrawer';\nimport { InlineDrawer, type InlineDrawerProps } from '../InlineDrawer';\n\n/**\n * Create the state required to render Drawer.\n *\n * The returned state can be modified with hooks such as useDrawerStyles_unstable,\n * before being passed to renderDrawer_unstable.\n *\n * @param props - props from this instance of Drawer\n * @param ref - reference to root HTMLElement of Drawer\n */\nexport const useDrawer_unstable = (props: DrawerProps, ref: React.Ref<HTMLElement>): DrawerState => {\n // casting here to convert a union of functions to a single function with the union of parameters\n const elementType = (props.type === 'inline' ? InlineDrawer : OverlayDrawer) as React.FC<\n InlineDrawerProps | OverlayDrawerProps\n >;\n const root: InlineDrawerProps | OverlayDrawerProps = slot.always({ ref, ...props }, { elementType });\n\n return {\n components: { root: elementType },\n root,\n };\n};\n"],"names":["useDrawer_unstable","props","ref","elementType","type","InlineDrawer","OverlayDrawer","root","slot","always","components"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBaA;;;eAAAA;;;;iEAhBU;gCACF;+BAGkC;8BACF;AAW9C,MAAMA,qBAAqB,CAACC,OAAoBC;IACrD,iGAAiG;IACjG,MAAMC,cAAeF,MAAMG,IAAI,KAAK,WAAWC,0BAAAA,GAAeC,4BAAAA;IAG9D,MAAMC,OAA+CC,oBAAAA,CAAKC,MAAM,CAAC;QAAEP;QAAK,GAAGD,KAAK;IAAC,GAAG;QAAEE;IAAY;IAElG,OAAO;QACLO,YAAY;YAAEH,MAAMJ;QAAY;QAChCI;IACF;AACF"}
@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
drawerClassNames: function() {
return drawerClassNames;
},
useDrawerStyles_unstable: function() {
return useDrawerStyles_unstable;
}
});
const _react = require("@griffel/react");
const drawerClassNames = {
root: 'fui-Drawer'
};
const useDrawerStyles_unstable = (state)=>{
'use no memo';
state.root.className = (0, _react.mergeClasses)(drawerClassNames.root, state.root.className);
return state;
};
@@ -0,0 +1 @@
{"version":3,"sources":["useDrawerStyles.styles.js"],"sourcesContent":["import { mergeClasses } from '@griffel/react';\nexport const drawerClassNames = {\n root: 'fui-Drawer'\n};\n/**\n * Apply styling to the Drawer slots based on the state\n */ export const useDrawerStyles_unstable = (state)=>{\n 'use no memo';\n state.root.className = mergeClasses(drawerClassNames.root, state.root.className);\n return state;\n};\n"],"names":["drawerClassNames","useDrawerStyles_unstable","root","state","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACaA,gBAAgB;eAAhBA;;IAKIC,wBAAwB;eAAxBA;;;uBANY;AACtB,MAAMD,mBAAmB;IAC5BE,MAAM;AACV;AAGW,MAAMD,2BAA4BE,CAAAA;IACzC;IACAA,MAAMD,IAAI,CAACE,SAAS,GAAGC,IAAAA,mBAAY,EAACL,iBAAiBE,IAAI,EAAEC,MAAMD,IAAI,CAACE,SAAS;IAC/E,OAAOD;AACX"}