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,16 @@
'use client';
import * as React from 'react';
import { useText_unstable } from './useText';
import { renderText_unstable } from './renderText';
import { useTextStyles_unstable } from './useTextStyles.styles';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
/**
* Typography and styling abstraction component used to ensure consistency of text.
*/ export const Text = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useText_unstable(props, ref);
useTextStyles_unstable(state);
useCustomStyleHook_unstable('useTextStyles_unstable')(state);
return renderText_unstable(state);
// Work around some small mismatches in inferred types which don't matter in practice
});
Text.displayName = 'Text';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Text/Text.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useText_unstable } from './useText';\nimport { renderText_unstable } from './renderText';\nimport { useTextStyles_unstable } from './useTextStyles.styles';\nimport type { TextProps } from './Text.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Typography and styling abstraction component used to ensure consistency of text.\n */\nexport const Text: ForwardRefComponent<TextProps> = React.forwardRef((props, ref) => {\n const state = useText_unstable(props, ref);\n\n useTextStyles_unstable(state);\n\n useCustomStyleHook_unstable('useTextStyles_unstable')(state);\n\n return renderText_unstable(state);\n // Work around some small mismatches in inferred types which don't matter in practice\n}) as ForwardRefComponent<TextProps>;\n\nText.displayName = 'Text';\n"],"names":["React","useText_unstable","renderText_unstable","useTextStyles_unstable","useCustomStyleHook_unstable","Text","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SAASC,sBAAsB,QAAQ,yBAAyB;AAGhE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,qBAAuCL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC3E,MAAMC,QAAQR,iBAAiBM,OAAOC;IAEtCL,uBAAuBM;IAEvBL,4BAA4B,0BAA0BK;IAEtD,OAAOP,oBAAoBO;AAC3B,qFAAqF;AACvF,GAAqC;AAErCJ,KAAKK,WAAW,GAAG"}

View File

@@ -0,0 +1,3 @@
/**
* State used in rendering Text
*/ export { };

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Text/Text.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\n/**\n * Text slots\n */\nexport type TextSlots = {\n root: Slot<'span', 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'pre' | 'strong' | 'b' | 'em' | 'i'>;\n};\n\n/**\n * Text Props\n */\nexport type TextProps = ComponentProps<TextSlots> & {\n /**\n * Aligns text based on the parent container.\n *\n * @default start\n */\n align?: 'start' | 'center' | 'end' | 'justify';\n\n /**\n * Applies a block display for the content.\n *\n * @default false\n */\n block?: boolean;\n\n /**\n * Applies the font family to the content.\n *\n * @default base\n */\n font?: 'base' | 'monospace' | 'numeric';\n\n /**\n * Applies the italic font style to the content.\n *\n * @default false\n */\n italic?: boolean;\n\n /**\n * Applies font size and line height based on the theme typography tokens.\n *\n * @default 300\n */\n size?: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 1000;\n\n /**\n * Applies the strikethrough text decoration to the content.\n *\n * @default false\n */\n strikethrough?: boolean;\n\n /**\n * Truncate overflowing text for block displays.\n *\n * @default false\n */\n\n truncate?: boolean;\n\n /**\n * Applies the underline text decoration to the content.\n *\n * @default false\n */\n underline?: boolean;\n\n /**\n * Applies font weight to the content.\n *\n * @default regular\n */\n weight?: 'regular' | 'medium' | 'semibold' | 'bold';\n\n /**\n * Wraps the text content on white spaces.\n *\n * @default true\n */\n wrap?: boolean;\n};\n\n/**\n * TextPreset Props\n */\nexport type TextPresetProps = Omit<TextProps, 'font' | 'size' | 'weight'>;\n\n/**\n * State used in rendering Text\n */\nexport type TextState = ComponentState<TextSlots> &\n Required<\n Pick<\n TextProps,\n 'align' | 'block' | 'font' | 'italic' | 'size' | 'strikethrough' | 'truncate' | 'underline' | 'weight' | 'wrap'\n >\n >;\n"],"names":[],"mappings":"AA0FA;;CAEC,GACD,WAMI"}

View File

@@ -0,0 +1,4 @@
export { Text } from './Text';
export { renderText_unstable } from './renderText';
export { useText_unstable } from './useText';
export { textClassNames, useTextStyles_unstable } from './useTextStyles.styles';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Text/index.ts"],"sourcesContent":["export { Text } from './Text';\nexport type { TextPresetProps, TextProps, TextSlots, TextState } from './Text.types';\nexport { renderText_unstable } from './renderText';\nexport { useText_unstable } from './useText';\nexport { textClassNames, useTextStyles_unstable } from './useTextStyles.styles';\n"],"names":["Text","renderText_unstable","useText_unstable","textClassNames","useTextStyles_unstable"],"mappings":"AAAA,SAASA,IAAI,QAAQ,SAAS;AAE9B,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SAASC,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,cAAc,EAAEC,sBAAsB,QAAQ,yBAAyB"}

View File

@@ -0,0 +1,8 @@
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
import { assertSlots } from '@fluentui/react-utilities';
/**
* Render the final JSX of Text
*/ export const renderText_unstable = (state)=>{
assertSlots(state);
return /*#__PURE__*/ _jsx(state.root, {});
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Text/renderText.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { TextSlots, TextState } from './Text.types';\n\n/**\n * Render the final JSX of Text\n */\nexport const renderText_unstable = (state: TextState): JSXElement => {\n assertSlots<TextSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderText_unstable","state","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,sBAAsB,CAACC;IAClCF,YAAuBE;IAEvB,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}

View File

@@ -0,0 +1,38 @@
import * as React from 'react';
import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
/**
* Create the state required to render Text.
*
* The returned state can be modified with hooks such as useTextStyles_unstable,
* before being passed to renderText_unstable.
*
* @param props - props from this instance of Text
* @param ref - reference to root HTMLElement of Text
*/ export const useText_unstable = (props, ref)=>{
const { wrap, truncate, block, italic, underline, strikethrough, size, font, weight, align } = props;
const state = {
align: align !== null && align !== void 0 ? align : 'start',
block: block !== null && block !== void 0 ? block : false,
font: font !== null && font !== void 0 ? font : 'base',
italic: italic !== null && italic !== void 0 ? italic : false,
size: size !== null && size !== void 0 ? size : 300,
strikethrough: strikethrough !== null && strikethrough !== void 0 ? strikethrough : false,
truncate: truncate !== null && truncate !== void 0 ? truncate : false,
underline: underline !== null && underline !== void 0 ? underline : false,
weight: weight !== null && weight !== void 0 ? weight : 'regular',
wrap: wrap !== null && wrap !== void 0 ? wrap : true,
components: {
root: 'span'
},
root: slot.always(getIntrinsicElementProps('span', {
// FIXME:
// `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLHeadingElement & HTMLPreElement`
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
ref: ref,
...props
}), {
elementType: 'span'
})
};
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Text/useText.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { TextProps, TextState } from './Text.types';\n\n/**\n * Create the state required to render Text.\n *\n * The returned state can be modified with hooks such as useTextStyles_unstable,\n * before being passed to renderText_unstable.\n *\n * @param props - props from this instance of Text\n * @param ref - reference to root HTMLElement of Text\n */\nexport const useText_unstable = (props: TextProps, ref: React.Ref<HTMLElement>): TextState => {\n const { wrap, truncate, block, italic, underline, strikethrough, size, font, weight, align } = props;\n\n const state: TextState = {\n align: align ?? 'start',\n block: block ?? false,\n font: font ?? 'base',\n italic: italic ?? false,\n size: size ?? 300,\n strikethrough: strikethrough ?? false,\n truncate: truncate ?? false,\n underline: underline ?? false,\n weight: weight ?? 'regular',\n wrap: wrap ?? true,\n\n components: { root: 'span' },\n\n root: slot.always(\n getIntrinsicElementProps('span', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLHeadingElement & HTMLPreElement`\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<HTMLHeadingElement & HTMLPreElement>,\n ...props,\n }),\n { elementType: 'span' },\n ),\n };\n\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","slot","useText_unstable","props","ref","wrap","truncate","block","italic","underline","strikethrough","size","font","weight","align","state","components","root","always","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAG3E;;;;;;;;CAQC,GACD,OAAO,MAAMC,mBAAmB,CAACC,OAAkBC;IACjD,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,MAAM,EAAEC,SAAS,EAAEC,aAAa,EAAEC,IAAI,EAAEC,IAAI,EAAEC,MAAM,EAAEC,KAAK,EAAE,GAAGX;IAE/F,MAAMY,QAAmB;QACvBD,OAAOA,kBAAAA,mBAAAA,QAAS;QAChBP,OAAOA,kBAAAA,mBAAAA,QAAS;QAChBK,MAAMA,iBAAAA,kBAAAA,OAAQ;QACdJ,QAAQA,mBAAAA,oBAAAA,SAAU;QAClBG,MAAMA,iBAAAA,kBAAAA,OAAQ;QACdD,eAAeA,0BAAAA,2BAAAA,gBAAiB;QAChCJ,UAAUA,qBAAAA,sBAAAA,WAAY;QACtBG,WAAWA,sBAAAA,uBAAAA,YAAa;QACxBI,QAAQA,mBAAAA,oBAAAA,SAAU;QAClBR,MAAMA,iBAAAA,kBAAAA,OAAQ;QAEdW,YAAY;YAAEC,MAAM;QAAO;QAE3BA,MAAMhB,KAAKiB,MAAM,CACflB,yBAAyB,QAAQ;YAC/B,SAAS;YACT,iGAAiG;YACjG,4FAA4F;YAC5FI,KAAKA;YACL,GAAGD,KAAK;QACV,IACA;YAAEgB,aAAa;QAAO;IAE1B;IAEA,OAAOJ;AACT,EAAE"}

View File

@@ -0,0 +1,125 @@
'use client';
import { __styles, mergeClasses } from '@griffel/react';
import { tokens } from '@fluentui/react-theme';
export const textClassNames = {
root: 'fui-Text'
};
/**
* Styles for the root slot
*/
const useStyles = /*#__PURE__*/__styles({
root: {
Bahqtrf: "fk6fouc",
Be2twd7: "fkhj508",
Bg96gwp: "f1i3iumi",
Bhrd7zp: "figsok6",
fsow6f: "fpgzoln",
mc9l5x: "f1w7gpdv",
Huce71: "f6juhto",
B68tc82: 0,
Bmxbyg5: 0,
Bpg54ce: "f1gl81tg",
ygn44y: "f2jf649"
},
nowrap: {
Huce71: "fz5stix",
B68tc82: 0,
Bmxbyg5: 0,
Bpg54ce: "f1a3p1vp"
},
truncate: {
ygn44y: "f1cmbuwj"
},
block: {
mc9l5x: "ftgm304"
},
italic: {
B80ckks: "f1j4dglz"
},
underline: {
w71qe1: "f13mvf36"
},
strikethrough: {
w71qe1: "fv5q2k7"
},
strikethroughUnderline: {
w71qe1: "f1drk4o6"
},
base100: {
Be2twd7: "f13mqy1h",
Bg96gwp: "fcpl73t"
},
base200: {
Be2twd7: "fy9rknc",
Bg96gwp: "fwrc4pm"
},
base400: {
Be2twd7: "fod5ikn",
Bg96gwp: "faaz57k"
},
base500: {
Be2twd7: "f1pp30po",
Bg96gwp: "f106mvju"
},
base600: {
Be2twd7: "f1x0m3f5",
Bg96gwp: "fb86gi6"
},
hero700: {
Be2twd7: "fojgt09",
Bg96gwp: "fcen8rp"
},
hero800: {
Be2twd7: "fccw675",
Bg96gwp: "f1ebx5kk"
},
hero900: {
Be2twd7: "f15afnhw",
Bg96gwp: "fr3w3wp"
},
hero1000: {
Be2twd7: "fpyltcb",
Bg96gwp: "f1ivgwrt"
},
monospace: {
Bahqtrf: "f1fedwem"
},
numeric: {
Bahqtrf: "f1uq0ln5"
},
weightMedium: {
Bhrd7zp: "fdj6btp"
},
weightSemibold: {
Bhrd7zp: "fl43uef"
},
weightBold: {
Bhrd7zp: "flh3ekv"
},
alignCenter: {
fsow6f: "f17mccla"
},
alignEnd: {
fsow6f: "f12ymhq5"
},
alignJustify: {
fsow6f: "f1j59e10"
}
}, {
d: [".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fpgzoln{text-align:start;}", ".f1w7gpdv{display:inline;}", ".f6juhto{white-space:normal;}", [".f1gl81tg{overflow:visible;}", {
p: -1
}], ".f2jf649{text-overflow:clip;}", ".fz5stix{white-space:nowrap;}", [".f1a3p1vp{overflow:hidden;}", {
p: -1
}], ".f1cmbuwj{text-overflow:ellipsis;}", ".ftgm304{display:block;}", ".f1j4dglz{font-style:italic;}", ".f13mvf36{text-decoration-line:underline;}", ".fv5q2k7{text-decoration-line:line-through;}", ".f1drk4o6{text-decoration-line:line-through underline;}", ".f13mqy1h{font-size:var(--fontSizeBase100);}", ".fcpl73t{line-height:var(--lineHeightBase100);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".f1pp30po{font-size:var(--fontSizeBase500);}", ".f106mvju{line-height:var(--lineHeightBase500);}", ".f1x0m3f5{font-size:var(--fontSizeBase600);}", ".fb86gi6{line-height:var(--lineHeightBase600);}", ".fojgt09{font-size:var(--fontSizeHero700);}", ".fcen8rp{line-height:var(--lineHeightHero700);}", ".fccw675{font-size:var(--fontSizeHero800);}", ".f1ebx5kk{line-height:var(--lineHeightHero800);}", ".f15afnhw{font-size:var(--fontSizeHero900);}", ".fr3w3wp{line-height:var(--lineHeightHero900);}", ".fpyltcb{font-size:var(--fontSizeHero1000);}", ".f1ivgwrt{line-height:var(--lineHeightHero1000);}", ".f1fedwem{font-family:var(--fontFamilyMonospace);}", ".f1uq0ln5{font-family:var(--fontFamilyNumeric);}", ".fdj6btp{font-weight:var(--fontWeightMedium);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".flh3ekv{font-weight:var(--fontWeightBold);}", ".f17mccla{text-align:center;}", ".f12ymhq5{text-align:end;}", ".f1j59e10{text-align:justify;}"]
});
/**
* Apply styling to the Text slots based on the state
*/
export const useTextStyles_unstable = state => {
'use no memo';
const styles = useStyles();
state.root.className = mergeClasses(textClassNames.root, styles.root, state.wrap === false && styles.nowrap, state.truncate && styles.truncate, state.block && styles.block, state.italic && styles.italic, state.underline && styles.underline, state.strikethrough && styles.strikethrough, state.underline && state.strikethrough && styles.strikethroughUnderline, state.size === 100 && styles.base100, state.size === 200 && styles.base200, state.size === 400 && styles.base400, state.size === 500 && styles.base500, state.size === 600 && styles.base600, state.size === 700 && styles.hero700, state.size === 800 && styles.hero800, state.size === 900 && styles.hero900, state.size === 1000 && styles.hero1000, state.font === 'monospace' && styles.monospace, state.font === 'numeric' && styles.numeric, state.weight === 'medium' && styles.weightMedium, state.weight === 'semibold' && styles.weightSemibold, state.weight === 'bold' && styles.weightBold, state.align === 'center' && styles.alignCenter, state.align === 'end' && styles.alignEnd, state.align === 'justify' && styles.alignJustify, state.root.className);
return state;
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,111 @@
'use client';
import { makeStyles, mergeClasses } from '@griffel/react';
import { tokens } from '@fluentui/react-theme';
export const textClassNames = {
root: 'fui-Text'
};
/**
* Styles for the root slot
*/ const useStyles = makeStyles({
root: {
fontFamily: tokens.fontFamilyBase,
fontSize: tokens.fontSizeBase300,
lineHeight: tokens.lineHeightBase300,
fontWeight: tokens.fontWeightRegular,
textAlign: 'start',
display: 'inline',
whiteSpace: 'normal',
overflow: 'visible',
textOverflow: 'clip'
},
nowrap: {
whiteSpace: 'nowrap',
overflow: 'hidden'
},
truncate: {
textOverflow: 'ellipsis'
},
block: {
display: 'block'
},
italic: {
fontStyle: 'italic'
},
underline: {
textDecorationLine: 'underline'
},
strikethrough: {
textDecorationLine: 'line-through'
},
strikethroughUnderline: {
textDecorationLine: 'line-through underline'
},
base100: {
fontSize: tokens.fontSizeBase100,
lineHeight: tokens.lineHeightBase100
},
base200: {
fontSize: tokens.fontSizeBase200,
lineHeight: tokens.lineHeightBase200
},
base400: {
fontSize: tokens.fontSizeBase400,
lineHeight: tokens.lineHeightBase400
},
base500: {
fontSize: tokens.fontSizeBase500,
lineHeight: tokens.lineHeightBase500
},
base600: {
fontSize: tokens.fontSizeBase600,
lineHeight: tokens.lineHeightBase600
},
hero700: {
fontSize: tokens.fontSizeHero700,
lineHeight: tokens.lineHeightHero700
},
hero800: {
fontSize: tokens.fontSizeHero800,
lineHeight: tokens.lineHeightHero800
},
hero900: {
fontSize: tokens.fontSizeHero900,
lineHeight: tokens.lineHeightHero900
},
hero1000: {
fontSize: tokens.fontSizeHero1000,
lineHeight: tokens.lineHeightHero1000
},
monospace: {
fontFamily: tokens.fontFamilyMonospace
},
numeric: {
fontFamily: tokens.fontFamilyNumeric
},
weightMedium: {
fontWeight: tokens.fontWeightMedium
},
weightSemibold: {
fontWeight: tokens.fontWeightSemibold
},
weightBold: {
fontWeight: tokens.fontWeightBold
},
alignCenter: {
textAlign: 'center'
},
alignEnd: {
textAlign: 'end'
},
alignJustify: {
textAlign: 'justify'
}
});
/**
* Apply styling to the Text slots based on the state
*/ export const useTextStyles_unstable = (state)=>{
'use no memo';
const styles = useStyles();
state.root.className = mergeClasses(textClassNames.root, styles.root, state.wrap === false && styles.nowrap, state.truncate && styles.truncate, state.block && styles.block, state.italic && styles.italic, state.underline && styles.underline, state.strikethrough && styles.strikethrough, state.underline && state.strikethrough && styles.strikethroughUnderline, state.size === 100 && styles.base100, state.size === 200 && styles.base200, state.size === 400 && styles.base400, state.size === 500 && styles.base500, state.size === 600 && styles.base600, state.size === 700 && styles.hero700, state.size === 800 && styles.hero800, state.size === 900 && styles.hero900, state.size === 1000 && styles.hero1000, state.font === 'monospace' && styles.monospace, state.font === 'numeric' && styles.numeric, state.weight === 'medium' && styles.weightMedium, state.weight === 'semibold' && styles.weightSemibold, state.weight === 'bold' && styles.weightBold, state.align === 'center' && styles.alignCenter, state.align === 'end' && styles.alignEnd, state.align === 'justify' && styles.alignJustify, state.root.className);
return state;
};

File diff suppressed because one or more lines are too long