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,24 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "TableCell", {
enumerable: true,
get: function() {
return TableCell;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _useTableCell = require("./useTableCell");
const _renderTableCell = require("./renderTableCell");
const _useTableCellStylesstyles = require("./useTableCellStyles.styles");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const TableCell = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useTableCell.useTableCell_unstable)(props, ref);
(0, _useTableCellStylesstyles.useTableCellStyles_unstable)(state);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useTableCellStyles_unstable')(state);
return (0, _renderTableCell.renderTableCell_unstable)(state);
});
TableCell.displayName = 'TableCell';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/TableCell/TableCell.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useTableCell_unstable } from './useTableCell';\nimport { renderTableCell_unstable } from './renderTableCell';\nimport { useTableCellStyles_unstable } from './useTableCellStyles.styles';\nimport type { TableCellProps } from './TableCell.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * TableCell component\n */\nexport const TableCell: ForwardRefComponent<TableCellProps> = React.forwardRef((props, ref) => {\n const state = useTableCell_unstable(props, ref);\n\n useTableCellStyles_unstable(state);\n\n useCustomStyleHook_unstable('useTableCellStyles_unstable')(state);\n\n return renderTableCell_unstable(state);\n});\n\nTableCell.displayName = 'TableCell';\n"],"names":["React","useTableCell_unstable","renderTableCell_unstable","useTableCellStyles_unstable","useCustomStyleHook_unstable","TableCell","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;8BACO,iBAAiB;iCACd,oBAAoB;0CACjB,8BAA8B;qCAG9B,kCAAkC;AAKvE,MAAMK,YAAAA,WAAAA,GAAiDL,OAAMM,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,YAAQR,mCAAAA,EAAsBM,OAAOC;QAE3CL,qDAAAA,EAA4BM;QAE5BL,gDAAAA,EAA4B,+BAA+BK;IAE3D,WAAOP,yCAAAA,EAAyBO;AAClC,GAAG;AAEHJ,UAAUK,WAAW,GAAG"}

View File

@@ -0,0 +1,6 @@
/**
* State used in rendering TableCell
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/TableCell/TableCell.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { TableContextValue } from '../Table/Table.types';\n\nexport type TableCellSlots = {\n root: Slot<'td', 'div'>;\n};\n\n/**\n * TableCell Props\n */\nexport type TableCellProps = ComponentProps<TableCellSlots> & {};\n\n/**\n * State used in rendering TableCell\n */\nexport type TableCellState = ComponentState<TableCellSlots> & Pick<TableContextValue, 'noNativeElements' | 'size'>;\n"],"names":[],"mappings":"AAYA;;CAEC,GACD,WAAmH"}

View File

@@ -0,0 +1,34 @@
"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, {
TableCell: function() {
return _TableCell.TableCell;
},
renderTableCell_unstable: function() {
return _renderTableCell.renderTableCell_unstable;
},
tableCellClassName: function() {
return _useTableCellStylesstyles.tableCellClassName;
},
tableCellClassNames: function() {
return _useTableCellStylesstyles.tableCellClassNames;
},
useTableCellStyles_unstable: function() {
return _useTableCellStylesstyles.useTableCellStyles_unstable;
},
useTableCell_unstable: function() {
return _useTableCell.useTableCell_unstable;
}
});
const _TableCell = require("./TableCell");
const _renderTableCell = require("./renderTableCell");
const _useTableCell = require("./useTableCell");
const _useTableCellStylesstyles = require("./useTableCellStyles.styles");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/TableCell/index.ts"],"sourcesContent":["export { TableCell } from './TableCell';\nexport type { TableCellProps, TableCellSlots, TableCellState } from './TableCell.types';\nexport { renderTableCell_unstable } from './renderTableCell';\nexport { useTableCell_unstable } from './useTableCell';\nexport { tableCellClassName, tableCellClassNames, useTableCellStyles_unstable } from './useTableCellStyles.styles';\n"],"names":["TableCell","renderTableCell_unstable","useTableCell_unstable","tableCellClassName","tableCellClassNames","useTableCellStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,oBAAS;;;eAETC,yCAAwB;;;eAExBE,4CAAkB;;;eAAEC,6CAAmB;;;eAAEC,qDAA2B;;;eADpEH,mCAAqB;;;2BAHJ,cAAc;iCAEC,oBAAoB;8BACvB,iBAAiB;0CAC8B,8BAA8B"}

View File

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "renderTableCell_unstable", {
enumerable: true,
get: function() {
return renderTableCell_unstable;
}
});
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
const _reactutilities = require("@fluentui/react-utilities");
const renderTableCell_unstable = (state)=>{
(0, _reactutilities.assertSlots)(state);
return /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {});
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/TableCell/renderTableCell.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { TableCellState, TableCellSlots } from './TableCell.types';\n\n/**\n * Render the final JSX of TableCell\n */\nexport const renderTableCell_unstable = (state: TableCellState): JSXElement => {\n assertSlots<TableCellSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderTableCell_unstable","state","root"],"mappings":";;;;;;;;;;4BACA,gDAAiD;gCACrB,4BAA4B;AAOjD,MAAMC,2BAA2B,CAACC;QACvCF,2BAAAA,EAA4BE;IAE5B,OAAA,WAAA,OAAO,eAAA,EAACA,MAAMC,IAAI,EAAA,CAAA;AACpB,EAAE"}

View File

@@ -0,0 +1,37 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useTableCell_unstable", {
enumerable: true,
get: function() {
return useTableCell_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 _tableContext = require("../../contexts/tableContext");
const useTableCell_unstable = (props, ref)=>{
const { noNativeElements, size } = (0, _tableContext.useTableContext)();
var _props_as;
const rootComponent = ((_props_as = props.as) !== null && _props_as !== void 0 ? _props_as : noNativeElements) ? 'div' : 'td';
return {
components: {
root: rootComponent
},
root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)(rootComponent, {
// FIXME:
// `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
ref: ref,
role: rootComponent === 'div' ? 'cell' : undefined,
...props
}), {
elementType: rootComponent
}),
noNativeElements,
size
};
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/TableCell/useTableCell.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { TableCellProps, TableCellState } from './TableCell.types';\nimport { useTableContext } from '../../contexts/tableContext';\n\n/**\n * Create the state required to render TableCell.\n *\n * The returned state can be modified with hooks such as useTableCellStyles_unstable,\n * before being passed to renderTableCell_unstable.\n *\n * @param props - props from this instance of TableCell\n * @param ref - reference to root HTMLElement of TableCell\n */\nexport const useTableCell_unstable = (props: TableCellProps, ref: React.Ref<HTMLElement>): TableCellState => {\n const { noNativeElements, size } = useTableContext();\n\n const rootComponent = props.as ?? noNativeElements ? 'div' : 'td';\n\n return {\n components: {\n root: rootComponent,\n },\n root: slot.always(\n getIntrinsicElementProps(rootComponent, {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref as React.Ref<HTMLDivElement>,\n role: rootComponent === 'div' ? 'cell' : undefined,\n ...props,\n }),\n { elementType: rootComponent },\n ),\n noNativeElements,\n size,\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","useTableContext","useTableCell_unstable","props","ref","noNativeElements","size","rootComponent","as","components","root","always","role","undefined","elementType"],"mappings":"AAAA;;;;;+BAgBaI;;;;;;;iEAdU,QAAQ;gCACgB,4BAA4B;8BAE3C,8BAA8B;AAWvD,8BAA8B,CAACC,OAAuBC;IAC3D,MAAM,EAAEC,gBAAgB,EAAEC,IAAI,EAAE,OAAGL,6BAAAA;QAEbE;IAAtB,MAAMI,gBAAgBJ,CAAAA,CAAAA,YAAAA,MAAMK,EAAAA,AAAE,MAAA,QAARL,cAAAA,KAAAA,IAAAA,YAAYE,gBAAAA,CAAe,GAAI,QAAQ;IAE7D,OAAO;QACLI,YAAY;YACVC,MAAMH;QACR;QACAG,MAAMV,oBAAAA,CAAKW,MAAM,KACfZ,wCAAAA,EAAyBQ,eAAe;YACtC,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FH,KAAKA;YACLQ,MAAML,kBAAkB,QAAQ,SAASM;YACzC,GAAGV,KAAK;QACV,IACA;YAAEW,aAAaP;QAAc;QAE/BF;QACAC;IACF;AACF,EAAE"}

View File

@@ -0,0 +1,138 @@
'use client';
"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, {
tableCellClassName: function() {
return tableCellClassName;
},
tableCellClassNames: function() {
return tableCellClassNames;
},
useTableCellStyles_unstable: function() {
return useTableCellStyles_unstable;
}
});
const _react = require("@griffel/react");
const tableCellClassName = 'fui-TableCell';
const tableCellClassNames = {
root: tableCellClassName
};
const useTableLayoutStyles = /*#__PURE__*/ (0, _react.__styles)({
root: {
mc9l5x: "f15pt5es",
ha4doy: "fmrv4ls"
},
medium: {
Bqenvij: "f1ft4266"
},
small: {
Bqenvij: "fbsu25e"
},
"extra-small": {
Bqenvij: "frvgh55"
}
}, {
d: [
".f15pt5es{display:table-cell;}",
".fmrv4ls{vertical-align:middle;}",
".f1ft4266{height:44px;}",
".fbsu25e{height:34px;}",
".frvgh55{height:24px;}"
]
});
const useFlexLayoutStyles = /*#__PURE__*/ (0, _react.__styles)({
root: {
mc9l5x: "f22iagw",
Bf4jedk: "f10tiqix",
Bt984gj: "f122n59",
xawz: 0,
Bh6795r: 0,
Bnnss6s: 0,
fkmc3a: "f1izfyrr"
},
medium: {
sshi5w: "f5pgtk9"
},
small: {
sshi5w: "fcep9tg"
},
"extra-small": {
sshi5w: "f1pha7fy"
}
}, {
d: [
".f22iagw{display:flex;}",
".f10tiqix{min-width:0px;}",
".f122n59{align-items:center;}",
[
".f1izfyrr{flex:1 1 0px;}",
{
p: -1
}
],
".f5pgtk9{min-height:44px;}",
".fcep9tg{min-height:34px;}",
".f1pha7fy{min-height:24px;}"
]
});
/**
* Styles for the root slot
*/ const useStyles = /*#__PURE__*/ (0, _react.__styles)({
root: {
qhf8xq: "f10pi13n",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f3gpkru",
Bfpq7zp: 0,
g9k6zt: 0,
Bn4voq9: 0,
giviqs: "f1dxfoyt",
Bw81rd7: 0,
kdpuga: 0,
dm238s: 0,
B6xbmo0: 0,
B3whbx2: "f2krc9w"
}
}, {
d: [
".f10pi13n{position:relative;}",
[
".f3gpkru{padding:0px var(--spacingHorizontalS);}",
{
p: -1
}
],
[
".f1dxfoyt[data-fui-focus-visible]{outline:2px solid var(--colorStrokeFocus2);}",
{
p: -1
}
],
[
".f2krc9w[data-fui-focus-visible]{border-radius:var(--borderRadiusMedium);}",
{
p: -1
}
]
]
});
const useTableCellStyles_unstable = (state)=>{
'use no memo';
const styles = useStyles();
const layoutStyles = {
table: useTableLayoutStyles(),
flex: useFlexLayoutStyles()
};
state.root.className = (0, _react.mergeClasses)(tableCellClassNames.root, styles.root, state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root, state.noNativeElements ? layoutStyles.flex[state.size] : layoutStyles.table[state.size], state.root.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["useTableCellStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nexport const tableCellClassName = 'fui-TableCell';\nexport const tableCellClassNames = {\n root: tableCellClassName\n};\nconst useTableLayoutStyles = makeStyles({\n root: {\n display: 'table-cell',\n verticalAlign: 'middle'\n },\n medium: {\n height: '44px'\n },\n small: {\n height: '34px'\n },\n 'extra-small': {\n height: '24px'\n }\n});\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'flex',\n minWidth: '0px',\n alignItems: 'center',\n flex: '1 1 0px'\n },\n medium: {\n minHeight: '44px'\n },\n small: {\n minHeight: '34px'\n },\n 'extra-small': {\n minHeight: '24px'\n }\n});\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n position: 'relative',\n padding: `0px ${tokens.spacingHorizontalS}`,\n ...createCustomFocusIndicatorStyle({\n outline: `2px solid ${tokens.colorStrokeFocus2}`,\n borderRadius: tokens.borderRadiusMedium\n }, {\n selector: 'focus'\n })\n }\n});\n/**\n * Apply styling to the TableCell slots based on the state\n */ export const useTableCellStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n const layoutStyles = {\n table: useTableLayoutStyles(),\n flex: useFlexLayoutStyles()\n };\n state.root.className = mergeClasses(tableCellClassNames.root, styles.root, state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root, state.noNativeElements ? layoutStyles.flex[state.size] : layoutStyles.table[state.size], state.root.className);\n return state;\n};\n"],"names":["__styles","mergeClasses","tokens","createCustomFocusIndicatorStyle","tableCellClassName","tableCellClassNames","root","useTableLayoutStyles","mc9l5x","ha4doy","medium","Bqenvij","small","d","useFlexLayoutStyles","Bf4jedk","Bt984gj","xawz","Bh6795r","Bnnss6s","fkmc3a","sshi5w","p","useStyles","qhf8xq","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","Bfpq7zp","g9k6zt","Bn4voq9","giviqs","Bw81rd7","kdpuga","dm238s","B6xbmo0","B3whbx2","useTableCellStyles_unstable","state","styles","layoutStyles","table","flex","className","noNativeElements","size"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAICI,kBAAkB;;;uBACC;;;IAmDfmC,2BAA2B;;;;uBAvDH,gBAAgB;AAGlD,2BAA2B,eAAe;AAC1C,MAAMlC,sBAAsB;IAC/BC,IAAI,EAAEF;AACV,CAAC;AACD,MAAMG,oBAAoB,GAAA,WAAA,OAAGP,eAAA,EAAA;IAAAM,IAAA,EAAA;QAAAE,MAAA,EAAA;QAAAC,MAAA,EAAA;IAAA;IAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;IAAA;IAAAC,KAAA,EAAA;QAAAD,OAAA,EAAA;IAAA;IAAA,eAAA;QAAAA,OAAA,EAAA;IAAA;AAAA,GAAA;IAAAE,CAAA,EAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;AAAA,CAc5B,CAAC;AACF,MAAMC,mBAAmB,GAAA,WAAA,OAAGd,eAAA,EAAA;IAAAM,IAAA,EAAA;QAAAE,MAAA,EAAA;QAAAO,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,IAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAA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EkC,KAAK,CAACM,gBAAgB,GAAGJ,YAAY,CAACE,IAAI,CAACtC,IAAI,GAAGoC,YAAY,CAACC,KAAK,CAACrC,IAAI,EAAEkC,KAAK,CAACM,gBAAgB,GAAGJ,YAAY,CAACE,IAAI,CAACJ,KAAK,CAACO,IAAI,CAAC,GAAGL,YAAY,CAACC,KAAK,CAACH,KAAK,CAACO,IAAI,CAAC,EAAEP,KAAK,CAAClC,IAAI,CAACuC,SAAS,CAAC;IACpQ,OAAOL,KAAK;AAChB,CAAC"}

View File

@@ -0,0 +1,85 @@
'use client';
"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, {
tableCellClassName: function() {
return tableCellClassName;
},
tableCellClassNames: function() {
return tableCellClassNames;
},
useTableCellStyles_unstable: function() {
return useTableCellStyles_unstable;
}
});
const _react = require("@griffel/react");
const _reacttheme = require("@fluentui/react-theme");
const _reacttabster = require("@fluentui/react-tabster");
const tableCellClassName = 'fui-TableCell';
const tableCellClassNames = {
root: tableCellClassName
};
const useTableLayoutStyles = (0, _react.makeStyles)({
root: {
display: 'table-cell',
verticalAlign: 'middle'
},
medium: {
height: '44px'
},
small: {
height: '34px'
},
'extra-small': {
height: '24px'
}
});
const useFlexLayoutStyles = (0, _react.makeStyles)({
root: {
display: 'flex',
minWidth: '0px',
alignItems: 'center',
flex: '1 1 0px'
},
medium: {
minHeight: '44px'
},
small: {
minHeight: '34px'
},
'extra-small': {
minHeight: '24px'
}
});
/**
* Styles for the root slot
*/ const useStyles = (0, _react.makeStyles)({
root: {
position: 'relative',
padding: `0px ${_reacttheme.tokens.spacingHorizontalS}`,
...(0, _reacttabster.createCustomFocusIndicatorStyle)({
outline: `2px solid ${_reacttheme.tokens.colorStrokeFocus2}`,
borderRadius: _reacttheme.tokens.borderRadiusMedium
}, {
selector: 'focus'
})
}
});
const useTableCellStyles_unstable = (state)=>{
'use no memo';
const styles = useStyles();
const layoutStyles = {
table: useTableLayoutStyles(),
flex: useFlexLayoutStyles()
};
state.root.className = (0, _react.mergeClasses)(tableCellClassNames.root, styles.root, state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root, state.noNativeElements ? layoutStyles.flex[state.size] : layoutStyles.table[state.size], state.root.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/TableCell/useTableCellStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport type { TableCellSlots, TableCellState } from './TableCell.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const tableCellClassName = 'fui-TableCell';\nexport const tableCellClassNames: SlotClassNames<TableCellSlots> = {\n root: tableCellClassName,\n};\n\nconst useTableLayoutStyles = makeStyles({\n root: {\n display: 'table-cell',\n verticalAlign: 'middle',\n },\n\n medium: {\n height: '44px',\n },\n\n small: {\n height: '34px',\n },\n\n 'extra-small': {\n height: '24px',\n },\n});\n\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'flex',\n minWidth: '0px',\n alignItems: 'center',\n flex: '1 1 0px',\n },\n\n medium: {\n minHeight: '44px',\n },\n\n small: {\n minHeight: '34px',\n },\n\n 'extra-small': {\n minHeight: '24px',\n },\n});\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n position: 'relative',\n padding: `0px ${tokens.spacingHorizontalS}`,\n\n ...createCustomFocusIndicatorStyle(\n { outline: `2px solid ${tokens.colorStrokeFocus2}`, borderRadius: tokens.borderRadiusMedium },\n { selector: 'focus' },\n ),\n },\n});\n\n/**\n * Apply styling to the TableCell slots based on the state\n */\nexport const useTableCellStyles_unstable = (state: TableCellState): TableCellState => {\n 'use no memo';\n\n const styles = useStyles();\n const layoutStyles = {\n table: useTableLayoutStyles(),\n flex: useFlexLayoutStyles(),\n };\n state.root.className = mergeClasses(\n tableCellClassNames.root,\n styles.root,\n state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root,\n state.noNativeElements ? layoutStyles.flex[state.size] : layoutStyles.table[state.size],\n state.root.className,\n );\n return state;\n};\n"],"names":["makeStyles","mergeClasses","tokens","createCustomFocusIndicatorStyle","tableCellClassName","tableCellClassNames","root","useTableLayoutStyles","display","verticalAlign","medium","height","small","useFlexLayoutStyles","minWidth","alignItems","flex","minHeight","useStyles","position","padding","spacingHorizontalS","outline","colorStrokeFocus2","borderRadius","borderRadiusMedium","selector","useTableCellStyles_unstable","state","styles","layoutStyles","table","className","noNativeElements","size"],"mappings":"AAAA;;;;;;;;;;;;IAQaI,kBAAAA;;;uBACAC;;;+BA8DAsB;eAAAA;;;uBArE4B,iBAAiB;4BACnC,wBAAwB;8BACC,0BAA0B;AAInE,2BAA2B,gBAAgB;AAC3C,MAAMtB,sBAAsD;IACjEC,MAAMF;AACR,EAAE;AAEF,MAAMG,2BAAuBP,iBAAAA,EAAW;IACtCM,MAAM;QACJE,SAAS;QACTC,eAAe;IACjB;IAEAC,QAAQ;QACNC,QAAQ;IACV;IAEAC,OAAO;QACLD,QAAQ;IACV;IAEA,eAAe;QACbA,QAAQ;IACV;AACF;AAEA,MAAME,0BAAsBb,iBAAAA,EAAW;IACrCM,MAAM;QACJE,SAAS;QACTM,UAAU;QACVC,YAAY;QACZC,MAAM;IACR;IAEAN,QAAQ;QACNO,WAAW;IACb;IAEAL,OAAO;QACLK,WAAW;IACb;IAEA,eAAe;QACbA,WAAW;IACb;AACF;AAEA;;CAEC,GACD,MAAMC,gBAAYlB,iBAAAA,EAAW;IAC3BM,MAAM;QACJa,UAAU;QACVC,SAAS,CAAC,IAAI,EAAElB,kBAAAA,CAAOmB,kBAAkB,EAAE;QAE3C,OAAGlB,6CAAAA,EACD;YAAEmB,SAAS,CAAC,UAAU,EAAEpB,kBAAAA,CAAOqB,iBAAiB,EAAE;YAAEC,cAActB,kBAAAA,C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