Private
Public Access
1
0

feat: Fluent UI Outlook Lite + connections mockup

This commit is contained in:
2026-04-14 18:52:25 +00:00
parent 1199eff6c3
commit dfa4010406
34820 changed files with 1003813 additions and 205 deletions

View File

@@ -0,0 +1,15 @@
import * as React from 'react';
import { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';
/**
* @internal
* creates a ReactElement from a slot declaration
*/ export function createElementFromSlotComponent(type, overrideChildren) {
const { elementType, renderFunction, props } = getMetadataFromSlotComponent(type);
if (renderFunction) {
if (overrideChildren.length > 0) {
props.children = React.createElement(React.Fragment, {}, ...overrideChildren);
}
return React.createElement(React.Fragment, {}, renderFunction(elementType, props));
}
return React.createElement(elementType, props, ...overrideChildren);
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/jsx/createElementFromSlotComponent.ts"],"sourcesContent":["import * as React from 'react';\nimport type { SlotComponentType, UnknownSlotProps } from '@fluentui/react-utilities';\nimport { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';\n\n/**\n * @internal\n * creates a ReactElement from a slot declaration\n */\nexport function createElementFromSlotComponent<Props extends UnknownSlotProps>(\n type: SlotComponentType<Props>,\n overrideChildren: React.ReactNode[],\n): React.ReactElement<Props> {\n const { elementType, renderFunction, props } = getMetadataFromSlotComponent(type);\n\n if (renderFunction) {\n if (overrideChildren.length > 0) {\n props.children = React.createElement(React.Fragment, {}, ...overrideChildren);\n }\n\n return React.createElement(\n React.Fragment,\n {},\n renderFunction(elementType as React.ElementType<Props>, props),\n ) as React.ReactElement<Props>;\n }\n\n return React.createElement(elementType, props, ...overrideChildren);\n}\n"],"names":["React","getMetadataFromSlotComponent","createElementFromSlotComponent","type","overrideChildren","elementType","renderFunction","props","length","children","createElement","Fragment"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,4BAA4B,QAAQ,wCAAwC;AAErF;;;CAGC,GACD,OAAO,SAASC,+BACdC,IAA8B,EAC9BC,gBAAmC;IAEnC,MAAM,EAAEC,WAAW,EAAEC,cAAc,EAAEC,KAAK,EAAE,GAAGN,6BAA6BE;IAE5E,IAAIG,gBAAgB;QAClB,IAAIF,iBAAiBI,MAAM,GAAG,GAAG;YAC/BD,MAAME,QAAQ,GAAGT,MAAMU,aAAa,CAACV,MAAMW,QAAQ,EAAE,CAAC,MAAMP;QAC9D;QAEA,OAAOJ,MAAMU,aAAa,CACxBV,MAAMW,QAAQ,EACd,CAAC,GACDL,eAAeD,aAAyCE;IAE5D;IAEA,OAAOP,MAAMU,aAAa,CAACL,aAAaE,UAAUH;AACpD"}

View File

@@ -0,0 +1,19 @@
import { isSlot } from '@fluentui/react-utilities';
import * as React from 'react';
import { createCompatSlotComponent } from '../utils/createCompatSlotComponent';
import { warnIfElementTypeIsInvalid } from '../utils/warnIfElementTypeIsInvalid';
export function createJSX(runtime, slotRuntime) {
return function jsx(type, overrideProps, key, source, self) {
// TODO:
// this is for backwards compatibility with getSlotsNext
// it should be removed once getSlotsNext is obsolete
if (isSlot(overrideProps)) {
return slotRuntime(createCompatSlotComponent(type, overrideProps), null, key, source, self);
}
if (isSlot(type)) {
return slotRuntime(type, overrideProps, key, source, self);
}
warnIfElementTypeIsInvalid(type);
return runtime(type, overrideProps, key, source, self);
};
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/jsx/createJSX.ts"],"sourcesContent":["import { isSlot } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { createCompatSlotComponent } from '../utils/createCompatSlotComponent';\nimport { JSXRuntime, JSXSlotRuntime } from '../utils/types';\nimport { warnIfElementTypeIsInvalid } from '../utils/warnIfElementTypeIsInvalid';\n\nexport function createJSX(runtime: JSXRuntime, slotRuntime: JSXSlotRuntime) {\n return function jsx<Props extends {}>(\n type: React.ElementType<Props>,\n overrideProps: Props | null,\n key?: React.Key,\n source?: unknown,\n self?: unknown,\n ): React.ReactElement<Props> {\n // TODO:\n // this is for backwards compatibility with getSlotsNext\n // it should be removed once getSlotsNext is obsolete\n if (isSlot<Props>(overrideProps)) {\n return slotRuntime<Props>(createCompatSlotComponent(type, overrideProps), null, key, source, self);\n }\n if (isSlot<Props>(type)) {\n return slotRuntime(type, overrideProps, key, source, self);\n }\n warnIfElementTypeIsInvalid(type);\n return runtime(type, overrideProps, key, source, self);\n };\n}\n"],"names":["isSlot","React","createCompatSlotComponent","warnIfElementTypeIsInvalid","createJSX","runtime","slotRuntime","jsx","type","overrideProps","key","source","self"],"mappings":"AAAA,SAASA,MAAM,QAAQ,4BAA4B;AACnD,YAAYC,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,qCAAqC;AAE/E,SAASC,0BAA0B,QAAQ,sCAAsC;AAEjF,OAAO,SAASC,UAAUC,OAAmB,EAAEC,WAA2B;IACxE,OAAO,SAASC,IACdC,IAA8B,EAC9BC,aAA2B,EAC3BC,GAAe,EACfC,MAAgB,EAChBC,IAAc;QAEd,QAAQ;QACR,wDAAwD;QACxD,qDAAqD;QACrD,IAAIZ,OAAcS,gBAAgB;YAChC,OAAOH,YAAmBJ,0BAA0BM,MAAMC,gBAAgB,MAAMC,KAAKC,QAAQC;QAC/F;QACA,IAAIZ,OAAcQ,OAAO;YACvB,OAAOF,YAAYE,MAAMC,eAAeC,KAAKC,QAAQC;QACvD;QACAT,2BAA2BK;QAC3B,OAAOH,QAAQG,MAAMC,eAAeC,KAAKC,QAAQC;IACnD;AACF"}

View File

@@ -0,0 +1,32 @@
import * as React from 'react';
import { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';
import { DevRuntime } from '../utils/DevRuntime';
export const jsxDEVSlot = (type, overrideProps, key, source, self)=>{
const { elementType, renderFunction, props: slotProps } = getMetadataFromSlotComponent(type);
const props = {
...slotProps,
...overrideProps
};
if (renderFunction) {
// if runtime is static
if (source === true) {
return DevRuntime.jsxDEV(React.Fragment, {
children: renderFunction(elementType, {
...props,
/**
* If the runtime is static then children is an array and this array won't be keyed.
* Then we should wrap children by a static fragment
* as there's no way to know if renderFunction will render statically or dynamically
*/ children: DevRuntime.jsxDEV(React.Fragment, {
children: props.children
}, undefined, true, self)
})
}, key, false, self);
}
// if runtime is dynamic (source = false) things are simpler
return DevRuntime.jsxDEV(React.Fragment, {
children: renderFunction(elementType, props)
}, key, source, self);
}
return DevRuntime.jsxDEV(elementType, props, key, source, self);
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/jsx/jsxDEVSlot.ts"],"sourcesContent":["import * as React from 'react';\nimport { SlotComponentType, UnknownSlotProps } from '@fluentui/react-utilities';\nimport { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';\nimport { DevRuntime } from '../utils/DevRuntime';\n\nexport const jsxDEVSlot = <Props extends UnknownSlotProps>(\n type: SlotComponentType<Props>,\n overrideProps: Props | null,\n key?: React.Key,\n source?: unknown,\n self?: unknown,\n): React.ReactElement<Props> => {\n const { elementType, renderFunction, props: slotProps } = getMetadataFromSlotComponent(type);\n\n const props: Props = { ...slotProps, ...overrideProps };\n\n if (renderFunction) {\n // if runtime is static\n if (source === true) {\n return DevRuntime.jsxDEV(\n React.Fragment,\n {\n children: renderFunction(elementType, {\n ...props,\n /**\n * If the runtime is static then children is an array and this array won't be keyed.\n * Then we should wrap children by a static fragment\n * as there's no way to know if renderFunction will render statically or dynamically\n */\n children: DevRuntime.jsxDEV(React.Fragment, { children: props.children }, undefined, true, self),\n }),\n },\n key,\n false, // by marking source as false we're declaring that this render is dynamic\n self,\n ) as React.ReactElement<Props>;\n }\n // if runtime is dynamic (source = false) things are simpler\n return DevRuntime.jsxDEV(\n React.Fragment,\n { children: renderFunction(elementType, props) },\n key,\n source,\n self,\n ) as React.ReactElement<Props>;\n }\n return DevRuntime.jsxDEV(elementType, props, key, source, self);\n};\n"],"names":["React","getMetadataFromSlotComponent","DevRuntime","jsxDEVSlot","type","overrideProps","key","source","self","elementType","renderFunction","props","slotProps","jsxDEV","Fragment","children","undefined"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,4BAA4B,QAAQ,wCAAwC;AACrF,SAASC,UAAU,QAAQ,sBAAsB;AAEjD,OAAO,MAAMC,aAAa,CACxBC,MACAC,eACAC,KACAC,QACAC;IAEA,MAAM,EAAEC,WAAW,EAAEC,cAAc,EAAEC,OAAOC,SAAS,EAAE,GAAGX,6BAA6BG;IAEvF,MAAMO,QAAe;QAAE,GAAGC,SAAS;QAAE,GAAGP,aAAa;IAAC;IAEtD,IAAIK,gBAAgB;QAClB,uBAAuB;QACvB,IAAIH,WAAW,MAAM;YACnB,OAAOL,WAAWW,MAAM,CACtBb,MAAMc,QAAQ,EACd;gBACEC,UAAUL,eAAeD,aAAa;oBACpC,GAAGE,KAAK;oBACR;;;;aAIC,GACDI,UAAUb,WAAWW,MAAM,CAACb,MAAMc,QAAQ,EAAE;wBAAEC,UAAUJ,MAAMI,QAAQ;oBAAC,GAAGC,WAAW,MAAMR;gBAC7F;YACF,GACAF,KACA,OACAE;QAEJ;QACA,4DAA4D;QAC5D,OAAON,WAAWW,MAAM,CACtBb,MAAMc,QAAQ,EACd;YAAEC,UAAUL,eAAeD,aAAaE;QAAO,GAC/CL,KACAC,QACAC;IAEJ;IACA,OAAON,WAAWW,MAAM,CAACJ,aAAaE,OAAOL,KAAKC,QAAQC;AAC5D,EAAE"}

View File

@@ -0,0 +1,16 @@
import * as React from 'react';
import { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';
import { Runtime } from '../utils/Runtime';
export const jsxSlot = (type, overrideProps, key)=>{
const { elementType, renderFunction, props: slotProps } = getMetadataFromSlotComponent(type);
const props = {
...slotProps,
...overrideProps
};
if (renderFunction) {
return Runtime.jsx(React.Fragment, {
children: renderFunction(elementType, props)
}, key);
}
return Runtime.jsx(elementType, props, key);
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/jsx/jsxSlot.ts"],"sourcesContent":["import * as React from 'react';\nimport { SlotComponentType, UnknownSlotProps } from '@fluentui/react-utilities';\nimport { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';\nimport { Runtime } from '../utils/Runtime';\n\nexport const jsxSlot = <Props extends UnknownSlotProps>(\n type: SlotComponentType<Props>,\n overrideProps: Props | null,\n key?: React.Key,\n): React.ReactElement<Props> => {\n const { elementType, renderFunction, props: slotProps } = getMetadataFromSlotComponent(type);\n\n const props: Props = { ...slotProps, ...overrideProps };\n\n if (renderFunction) {\n return Runtime.jsx(\n React.Fragment,\n { children: renderFunction(elementType, props) },\n key,\n ) as React.ReactElement<Props>;\n }\n return Runtime.jsx(elementType, props, key);\n};\n"],"names":["React","getMetadataFromSlotComponent","Runtime","jsxSlot","type","overrideProps","key","elementType","renderFunction","props","slotProps","jsx","Fragment","children"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,4BAA4B,QAAQ,wCAAwC;AACrF,SAASC,OAAO,QAAQ,mBAAmB;AAE3C,OAAO,MAAMC,UAAU,CACrBC,MACAC,eACAC;IAEA,MAAM,EAAEC,WAAW,EAAEC,cAAc,EAAEC,OAAOC,SAAS,EAAE,GAAGT,6BAA6BG;IAEvF,MAAMK,QAAe;QAAE,GAAGC,SAAS;QAAE,GAAGL,aAAa;IAAC;IAEtD,IAAIG,gBAAgB;QAClB,OAAON,QAAQS,GAAG,CAChBX,MAAMY,QAAQ,EACd;YAAEC,UAAUL,eAAeD,aAAaE;QAAO,GAC/CH;IAEJ;IACA,OAAOJ,QAAQS,GAAG,CAACJ,aAAaE,OAAOH;AACzC,EAAE"}

View File

@@ -0,0 +1,25 @@
import * as React from 'react';
import { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';
import { Runtime } from '../utils/Runtime';
export const jsxsSlot = (type, overrideProps, key)=>{
const { elementType, renderFunction, props: slotProps } = getMetadataFromSlotComponent(type);
const props = {
...slotProps,
...overrideProps
};
if (renderFunction) {
/**
* In static runtime then children is an array and this array won't be keyed.
* We should wrap children by a static fragment
* as there's no way to know if renderFunction will render statically or dynamically
*/ return Runtime.jsx(React.Fragment, {
children: renderFunction(elementType, {
...props,
children: Runtime.jsxs(React.Fragment, {
children: props.children
}, undefined)
})
}, key);
}
return Runtime.jsxs(elementType, props, key);
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/jsx/jsxsSlot.ts"],"sourcesContent":["import * as React from 'react';\nimport { SlotComponentType, UnknownSlotProps } from '@fluentui/react-utilities';\nimport { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';\nimport { Runtime } from '../utils/Runtime';\n\nexport const jsxsSlot = <Props extends UnknownSlotProps>(\n type: SlotComponentType<Props>,\n overrideProps: Props | null,\n key?: React.Key,\n): React.ReactElement<Props> => {\n const { elementType, renderFunction, props: slotProps } = getMetadataFromSlotComponent(type);\n\n const props: Props = { ...slotProps, ...overrideProps };\n\n if (renderFunction) {\n /**\n * In static runtime then children is an array and this array won't be keyed.\n * We should wrap children by a static fragment\n * as there's no way to know if renderFunction will render statically or dynamically\n */\n return Runtime.jsx(\n React.Fragment,\n {\n children: renderFunction(elementType, {\n ...props,\n children: Runtime.jsxs(React.Fragment, { children: props.children }, undefined),\n }),\n },\n key,\n ) as React.ReactElement<Props>;\n }\n return Runtime.jsxs(elementType, props, key);\n};\n"],"names":["React","getMetadataFromSlotComponent","Runtime","jsxsSlot","type","overrideProps","key","elementType","renderFunction","props","slotProps","jsx","Fragment","children","jsxs","undefined"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,4BAA4B,QAAQ,wCAAwC;AACrF,SAASC,OAAO,QAAQ,mBAAmB;AAE3C,OAAO,MAAMC,WAAW,CACtBC,MACAC,eACAC;IAEA,MAAM,EAAEC,WAAW,EAAEC,cAAc,EAAEC,OAAOC,SAAS,EAAE,GAAGT,6BAA6BG;IAEvF,MAAMK,QAAe;QAAE,GAAGC,SAAS;QAAE,GAAGL,aAAa;IAAC;IAEtD,IAAIG,gBAAgB;QAClB;;;;KAIC,GACD,OAAON,QAAQS,GAAG,CAChBX,MAAMY,QAAQ,EACd;YACEC,UAAUL,eAAeD,aAAa;gBACpC,GAAGE,KAAK;gBACRI,UAAUX,QAAQY,IAAI,CAACd,MAAMY,QAAQ,EAAE;oBAAEC,UAAUJ,MAAMI,QAAQ;gBAAC,GAAGE;YACvE;QACF,GACAT;IAEJ;IACA,OAAOJ,QAAQY,IAAI,CAACP,aAAaE,OAAOH;AAC1C,EAAE"}