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,7 @@
import * as React from "react";
export declare type FluentIconsProps<TBaseAttributes extends React.SVGAttributes<SVGElement> | React.HTMLAttributes<HTMLElement> = React.SVGAttributes<SVGElement>, TRefType extends HTMLElement | SVGSVGElement = SVGSVGElement> = TBaseAttributes & React.RefAttributes<TRefType> & {
primaryFill?: string;
className?: string;
filled?: boolean;
title?: string;
};
@@ -0,0 +1 @@
export {};
+3
View File
@@ -0,0 +1,3 @@
import { FluentIcon } from "./createFluentIcon";
declare const bundleIcon: (FilledIcon: FluentIcon, RegularIcon: FluentIcon) => FluentIcon;
export default bundleIcon;
+31
View File
@@ -0,0 +1,31 @@
import * as React from "react";
import { iconFilledClassName, iconRegularClassName } from "./constants";
import { __styles, mergeClasses } from "@griffel/react";
const useBundledIconStyles = __styles({
"root": {
"mc9l5x": "fjseox"
},
"visible": {
"mc9l5x": "f1w7gpdv"
}
}, {
"d": [".fjseox{display:none;}", ".f1w7gpdv{display:inline;}"]
});
const bundleIcon = (FilledIcon, RegularIcon) => {
const Component = props => {
const {
className,
filled,
...rest
} = props;
const styles = useBundledIconStyles();
return React.createElement(React.Fragment, null, React.createElement(FilledIcon, Object.assign({}, rest, {
className: mergeClasses(styles.root, filled && styles.visible, iconFilledClassName, className)
})), React.createElement(RegularIcon, Object.assign({}, rest, {
className: mergeClasses(styles.root, !filled && styles.visible, iconRegularClassName, className)
})));
};
Component.displayName = "CompoundIcon";
return Component;
};
export default bundleIcon;
+4
View File
@@ -0,0 +1,4 @@
export declare const iconFilledClassName = "fui-Icon-filled";
export declare const iconRegularClassName = "fui-Icon-regular";
export declare const iconLightClassName = "fui-Icon-light";
export declare const fontIconClassName = "fui-Icon-font";
+4
View File
@@ -0,0 +1,4 @@
export const iconFilledClassName = "fui-Icon-filled";
export const iconRegularClassName = "fui-Icon-regular";
export const iconLightClassName = "fui-Icon-light";
export const fontIconClassName = "fui-Icon-font";
+10
View File
@@ -0,0 +1,10 @@
/// <reference types="react" />
import { FluentIconsProps } from "./FluentIconsProps.types";
export declare type FluentIcon = {
(props: FluentIconsProps): JSX.Element;
displayName?: string;
};
export declare type CreateFluentIconOptions = {
flipInRtl?: boolean;
};
export declare const createFluentIcon: (displayName: string, width: string, paths: string[], options?: CreateFluentIconOptions | undefined) => FluentIcon;
+23
View File
@@ -0,0 +1,23 @@
import * as React from "react";
import { useIconState } from "./useIconState";
export const createFluentIcon = (displayName, width, paths, options) => {
const viewBoxWidth = width === "1em" ? "20" : width;
const Icon = React.forwardRef((props, ref) => {
const state = {
...useIconState(props, {
flipInRtl: options === null || options === void 0 ? void 0 : options.flipInRtl
}),
ref,
width,
height: width,
viewBox: `0 0 ${viewBoxWidth} ${viewBoxWidth}`,
xmlns: "http://www.w3.org/2000/svg"
};
return React.createElement("svg", state, ...paths.map(d => React.createElement("path", {
d,
fill: state.fill
})));
});
Icon.displayName = displayName;
return Icon;
};
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,183 @@
{
"AccessibilityCheckmark32Light": 57344,
"Add32Light": 57345,
"Alert32Light": 57346,
"AppFolder32Light": 57347,
"AppGeneric32Light": 57348,
"Archive32Light": 57349,
"ArchiveSettings32Light": 57350,
"ArrowClockwise32Light": 57351,
"ArrowDown32Light": 57352,
"ArrowDownload32Light": 57353,
"ArrowForward32Light": 57354,
"ArrowHookUpLeft32Light": 57355,
"ArrowRedo32Light": 57356,
"ArrowReply32Light": 57357,
"ArrowReplyAll32Light": 57358,
"ArrowUndo32Light": 57359,
"Attach32Light": 57360,
"AutoFit32Light": 57361,
"Autocorrect32Light": 57362,
"BreakoutRoom32Light": 57363,
"Broom32Light": 57364,
"Calendar3Day32Light": 57365,
"CalendarClock32Light": 57366,
"CalendarDataBar32Light": 57367,
"CalendarDay32Light": 57368,
"CalendarEdit32Light": 57369,
"CalendarEmpty32Light": 57370,
"CalendarLtr32Light": 57371,
"CalendarMonth32Light": 57372,
"CalendarMultiple32Light": 57373,
"CalendarPattern32Light": 57374,
"CalendarReply32Light": 57375,
"CalendarSparkle32Light": 57376,
"CalendarTodo32Light": 57377,
"CalendarWorkWeek32Light": 57378,
"Chat32Light": 57379,
"Checkmark32Light": 57380,
"CheckmarkCircle32Light": 57381,
"Classification32Light": 57382,
"ClipboardPaste32Light": 57383,
"Clock32Light": 57384,
"ClockAlarm32Light": 57385,
"Color32Light": 57386,
"ColorFill32Light": 57387,
"ColorFillAccent32Light": 57388,
"Comment32Light": 57389,
"CommentAdd32Light": 57390,
"Compose32Light": 57391,
"Copy32Light": 57392,
"Crop32Light": 57393,
"Cursor32Light": 57394,
"Delete32Light": 57395,
"Dismiss32Light": 57396,
"DismissCircle32Light": 57397,
"Document24Light": 57398,
"Document28Light": 57399,
"Document32Light": 57400,
"Document48Light": 57401,
"DocumentLightning32Light": 57402,
"DocumentSignature32Light": 57403,
"DocumentSparkle24Light": 57404,
"DocumentSparkle28Light": 57405,
"DocumentSparkle32Light": 57406,
"DocumentSparkle48Light": 57407,
"DoorArrowRight32Light": 57408,
"Edit32Light": 57409,
"Emoji32Light": 57410,
"Eye32Light": 57411,
"EyeOff32Light": 57412,
"Filter32Light": 57413,
"Flag32Light": 57414,
"FlagOff32Light": 57415,
"Flash32Light": 57416,
"FolderArrowRight32Light": 57417,
"FolderMail32Light": 57418,
"HandDraw32Light": 57419,
"History32Light": 57420,
"ImageAdd32Light": 57421,
"ImageAltText32Light": 57422,
"ImageCopy32Light": 57423,
"ImageReflection32Light": 57424,
"ImageShadow32Light": 57425,
"ImmersiveReader32Light": 57426,
"Important32Light": 57427,
"Lasso32Light": 57428,
"LayoutColumnTwo32Light": 57429,
"LayoutColumnTwoFocusLeft32Light": 57430,
"LayoutColumnTwoFocusRight32Light": 57431,
"LayoutRowTwo32Light": 57432,
"LayoutRowTwoFocusTop32Light": 57433,
"LayoutRowTwoFocusTopSettings32Light": 57434,
"LayoutRowTwoSettings32Light": 57435,
"Lightbulb32Light": 57436,
"Link32Light": 57437,
"LockClosed32Light": 57438,
"LockOpen32Light": 57439,
"Mail32Light": 57440,
"MailAlert32Light": 57441,
"MailArrowClockwise32Light": 57442,
"MailArrowDoubleBack32Light": 57443,
"MailCopy32Light": 57444,
"MailEdit32Light": 57445,
"MailList32Light": 57446,
"MailMultiple32Light": 57447,
"MailRead32Light": 57448,
"MailReadMultiple32Light": 57449,
"MailRewind32Light": 57450,
"MailSettings32Light": 57451,
"MailUnread32Light": 57452,
"Mic32Light": 57453,
"Molecule32Light": 57454,
"Note32Light": 57455,
"Options32Light": 57456,
"PaintBrush32Light": 57457,
"PanelLeftDefault32Light": 57458,
"PanelLeftFocusRight32Light": 57459,
"PenSparkle32Light": 57460,
"People32Light": 57461,
"PeopleAdd32Light": 57462,
"PeopleCommunity32Light": 57463,
"PeopleEdit32Light": 57464,
"PeopleList32Light": 57465,
"PeopleSettings32Light": 57466,
"PeopleSync32Light": 57467,
"Person32Light": 57468,
"PersonAdd32Light": 57469,
"PersonAvailable32Light": 57470,
"PersonFeedback32Light": 57471,
"PersonMail32Light": 57472,
"PersonProhibited32Light": 57473,
"PersonSuport32Light": 57474,
"Phone32Light": 57475,
"PictureInPicture32Light": 57476,
"Pin32Light": 57477,
"PinOff32Light": 57478,
"Poll32Light": 57479,
"Print32Light": 57480,
"Question32Light": 57481,
"ReadAloud32Light": 57482,
"RectangleLandscape32Light": 57483,
"RotateLeft32Light": 57484,
"Save32Light": 57485,
"SendClock32Light": 57486,
"Settings32Light": 57487,
"Share32Light": 57488,
"ShieldError32Light": 57489,
"Signature32Light": 57490,
"SquareArrowForward32Light": 57491,
"Stamp32Light": 57492,
"StarAdd32Light": 57493,
"StarArrowRight32Light": 57494,
"TabAdd32Light": 57495,
"Table32Light": 57496,
"TableAltText32Light": 57497,
"TableCellsMerge32Light": 57498,
"TableCellsSplit32Light": 57499,
"TableDismiss32Light": 57500,
"TableMoveAbove32Light": 57501,
"TableMoveBelow32Light": 57502,
"TableMoveLeft32Light": 57503,
"TableMoveRight32Light": 57504,
"TableSettings32Light": 57505,
"TableSimple32Light": 57506,
"Tag32Light": 57507,
"Text32Light": 57508,
"TextClearFormatting32Light": 57509,
"TextCollapse32Light": 57510,
"TextDensity32Light": 57511,
"TextEditStyle32Light": 57512,
"TextExpand32Light": 57513,
"TextboxAlignTopLeft32Light": 57514,
"Toolbox32Light": 57515,
"Translate32Light": 57516,
"Video32Light": 57517,
"VideoClip32Light": 57518,
"WeatherMoon32Light": 57519,
"WeatherSunny32Light": 57520,
"Window32Light": 57521,
"WrenchScrewdriver32Light": 57522,
"ZoomIn32Light": 57523,
"ZoomOut32Light": 57524
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,14 @@
import * as React from 'react';
import { FluentIconsProps } from '../FluentIconsProps.types';
export declare const enum FontFile {
Filled = 0,
Regular = 1,
Resizable = 2,
Light = 3
}
export declare type CreateFluentFontIconOptions = {
flipInRtl?: boolean;
};
export declare function createFluentFontIcon(displayName: string, codepoint: string, font: FontFile, fontSize?: number, options?: CreateFluentFontIconOptions): React.FC<FluentIconsProps<React.HTMLAttributes<HTMLElement>, HTMLElement>> & {
codepoint: string;
};
@@ -0,0 +1,106 @@
import * as React from 'react';
import { __styles, makeStaticStyles, mergeClasses } from "@griffel/react";
import { useIconState } from '../useIconState';
import { fontIconClassName } from '../constants';
import fontFilledTtf from './FluentSystemIcons-Filled.ttf';
import fontFilledWoff from './FluentSystemIcons-Filled.woff';
import fontFilledWoff2 from './FluentSystemIcons-Filled.woff2';
import fontRegularTtf from './FluentSystemIcons-Regular.ttf';
import fontRegularWoff from './FluentSystemIcons-Regular.woff';
import fontRegularWoff2 from './FluentSystemIcons-Regular.woff2';
import fontLightTtf from './FluentSystemIcons-Light.ttf';
import fontLightWoff from './FluentSystemIcons-Light.woff';
import fontLightWoff2 from './FluentSystemIcons-Light.woff2';
import fontOneSizeTtf from './FluentSystemIcons-Resizable.ttf';
import fontOneSizeWoff from './FluentSystemIcons-Resizable.woff';
import fontOneSizeWoff2 from './FluentSystemIcons-Resizable.woff2';
const FONT_FAMILY_MAP = {
[0 /* Filled */]: 'FluentSystemIconsFilled',
[1 /* Regular */]: 'FluentSystemIconsRegular',
[2 /* Resizable */]: 'FluentSystemIcons'
};
const useStaticStyles = makeStaticStyles(`
@font-face {
font-family: ${FONT_FAMILY_MAP[0 /* Filled */]};
font-display: "block";
src: url(${JSON.stringify(fontFilledWoff2)}) format("woff2"),
url(${JSON.stringify(fontFilledWoff)}) format("woff"),
url(${JSON.stringify(fontFilledTtf)}) format("truetype");
}
@font-face {
font-family: ${FONT_FAMILY_MAP[1 /* Regular */]};
font-display: "block";
src: url(${JSON.stringify(fontRegularWoff2)}) format("woff2"),
url(${JSON.stringify(fontRegularWoff)}) format("woff"),
url(${JSON.stringify(fontRegularTtf)}) format("truetype");
}
@font-face {
font-family: ${FONT_FAMILY_MAP[3 /* Light */]};
src: url(${JSON.stringify(fontLightWoff2)}) format("woff2"),
url(${JSON.stringify(fontLightWoff)}) format("woff"),
url(${JSON.stringify(fontLightTtf)}) format("truetype");
}
@font-face {
font-family: ${FONT_FAMILY_MAP[2 /* Resizable */]};
font-display: "block";
src: url(${JSON.stringify(fontOneSizeWoff2)}) format("woff2"),
url(${JSON.stringify(fontOneSizeWoff)}) format("woff"),
url(${JSON.stringify(fontOneSizeTtf)}) format("truetype");
}
`);
const useRootStyles = __styles({
"0": {
"Bahqtrf": "f9dzkbp"
},
"1": {
"Bahqtrf": "f1krtbx5"
},
"2": {
"Bahqtrf": "f1sxfq9t"
},
"3": {
"Bahqtrf": "fgtzeza"
},
"root": {
"mc9l5x": "f14t3ns0",
"B80ckks": "fmd4ok8",
"Bg96gwp": "fne0op0",
"sj55zd": "f303qgw",
"ycbfsm": "fg4l7m0"
}
}, {
"d": [".f9dzkbp{font-family:FluentSystemIconsFilled;}", ".f1krtbx5{font-family:FluentSystemIconsRegular;}", ".f1sxfq9t{font-family:FluentSystemIcons;}", ".fgtzeza{font-family:FluentSystemIconsLight;}", ".f14t3ns0{display:inline-block;}", ".fmd4ok8{font-style:normal;}", ".fne0op0{line-height:1em;}", ".f303qgw{color:currentColor;}"],
"t": ["@media (forced-colors: active){.fg4l7m0{forced-color-adjust:auto;}}"]
});
export function createFluentFontIcon(displayName, codepoint, font, fontSize, options) {
const Component = props => {
useStaticStyles();
const styles = useRootStyles();
const className = mergeClasses(styles.root, styles[font], fontIconClassName, props.className);
const state = useIconState({
...props,
className
}, {
flipInRtl: options === null || options === void 0 ? void 0 : options.flipInRtl
});
// We want to keep the same API surface as the SVG icons, so translate `primaryFill` to `color`
if (props.primaryFill && props.primaryFill.toLowerCase() !== 'currentcolor') {
state.style = {
...state.style,
color: props.primaryFill
};
}
if (fontSize) {
state.style = {
...state.style,
fontSize
};
}
return React.createElement("i", Object.assign({}, state), codepoint);
};
Component.displayName = displayName;
Component.codepoint = codepoint;
return Component;
}
+6
View File
@@ -0,0 +1,6 @@
/// <reference types="react" />
import { FluentIconsProps } from "./FluentIconsProps.types";
export declare type UseIconStateOptions = {
flipInRtl?: boolean;
};
export declare const useIconState: <TBaseAttributes extends import("react").HTMLAttributes<HTMLElement> | import("react").SVGAttributes<SVGElement> = import("react").SVGAttributes<SVGElement>, TRefType extends HTMLElement | SVGSVGElement = SVGSVGElement>(props: FluentIconsProps<TBaseAttributes, TRefType>, options?: UseIconStateOptions | undefined) => Pick<FluentIconsProps<TBaseAttributes, TRefType>, "title" | "filled" | "ref" | "key" | "className" | Exclude<keyof TBaseAttributes, "primaryFill">>;
+39
View File
@@ -0,0 +1,39 @@
import { useIconContext } from "../contexts";
import { __styles, mergeClasses } from "@griffel/react";
const useRootStyles = __styles({
"root": {
"mc9l5x": "f1w7gpdv",
"Bg96gwp": "fez10in",
"ycbfsm": "fg4l7m0"
},
"rtl": {
"Bz10aip": "f13rod7r"
}
}, {
"d": [".f1w7gpdv{display:inline;}", ".fez10in{line-height:0;}", ".f13rod7r{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);transform:scaleX(-1);}"],
"t": ["@media (forced-colors: active){.fg4l7m0{forced-color-adjust:auto;}}"]
});
export const useIconState = (props, options) => {
const {
title,
primaryFill = "currentColor",
...rest
} = props;
const state = {
...rest,
title: undefined,
fill: primaryFill
};
const styles = useRootStyles();
const iconContext = useIconContext();
state.className = mergeClasses(styles.root, (options === null || options === void 0 ? void 0 : options.flipInRtl) && (iconContext === null || iconContext === void 0 ? void 0 : iconContext.textDirection) === 'rtl' && styles.rtl, state.className);
if (title) {
state['aria-label'] = title;
}
if (!state['aria-label'] && !state['aria-labelledby']) {
state['aria-hidden'] = true;
} else {
state['role'] = 'img';
}
return state;
};
+5
View File
@@ -0,0 +1,5 @@
/// <reference types="react" />
import { FluentIconsProps } from "./FluentIconsProps.types";
import { CreateFluentIconOptions, FluentIcon } from "./createFluentIcon";
declare const wrapIcon: (Icon: (iconProps: FluentIconsProps) => JSX.Element, displayName?: string | undefined, options?: CreateFluentIconOptions | undefined) => FluentIcon;
export default wrapIcon;
+16
View File
@@ -0,0 +1,16 @@
import * as React from "react";
import { useIconState } from "./useIconState";
const wrapIcon = (Icon, displayName, options) => {
const WrappedIcon = React.forwardRef((props, ref) => {
const state = {
...useIconState(props, {
flipInRtl: options === null || options === void 0 ? void 0 : options.flipInRtl
}),
ref
};
return React.createElement(Icon, Object.assign({}, state));
});
WrappedIcon.displayName = displayName;
return WrappedIcon;
};
export default wrapIcon;