Skip to content

Commit

Permalink
Replaced icons with material symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
fgatti675 committed Dec 4, 2024
1 parent 3ffb1c4 commit d2eb35b
Show file tree
Hide file tree
Showing 1,416 changed files with 580 additions and 12,158 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export function OpenAIInstructionsActions() {
open={open}
onOpenChange={setOpen}
>
<DialogTitle>OpenAI data enhancement</DialogTitle>
<DialogContent className="p-8 flex flex-col space-y-2">
<DialogTitle variant={"h5"}>OpenAI data enhancement</DialogTitle>
<DialogContent className="flex flex-col space-y-2">
<Typography gutterBottom>
Try it out by clicking on <b>ADD BOOK</b> and
then typing the title of your favourite book on the <b>AUTOFILL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
InfoLabel,
Tooltip,
Typography,
WarningOffIcon
WarningIcon
} from "@firecms/ui";
import { EnumPropertyField } from "./properties/EnumPropertyField";
import { StoragePropertyField } from "./properties/StoragePropertyField";
Expand Down Expand Up @@ -774,7 +774,7 @@ export function WidgetSelectViewItem({
<div className={"flex flex-row gap-2 items-center"}>
{shouldWarnChangingDataType && <Tooltip
title={"This widget uses a different data type than the initially selected widget. This can cause errors with existing data."}>
<WarningOffIcon size="smallest" className={"w-4"}/>
<WarningIcon size="smallest" className={"w-4"}/>
</Tooltip>}
<Typography
color={shouldWarnChangingDataType ? "secondary" : undefined}>{propertyConfig.name}</Typography>
Expand Down
4 changes: 3 additions & 1 deletion packages/firecms_core/src/core/FireCMS.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import React, { useMemo } from "react";
import { CenteredView, Typography } from "@firecms/ui";
import { CenteredView, Typography, useIconStyles } from "@firecms/ui";
import { CustomizationController, EntityCollection, FireCMSContext, FireCMSPlugin, FireCMSProps, User } from "../types";
import { AuthControllerContext } from "../contexts";
import { useBuildSideEntityController } from "../internal/useBuildSideEntityController";
Expand Down Expand Up @@ -68,6 +68,8 @@ export function FireCMS<USER extends User, EC extends EntityCollection>(props: F

const loading = authController.initialLoading || navigationController.loading || pluginsLoading;

useIconStyles({});

const customizationController: CustomizationController = {
dateTimeFormat,
locale,
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"cmdk": "^0.2.1",
"date-fns": "^3.6.0",
"markdown-it": "^14.1.0",
"material-icons": "^1.13.12",
"material-symbols": "^0.27.1",
"react-dropzone": "^14.3.5",
"react-fast-compare": "^3.2.2",
"tailwind-merge": "^2.5.5"
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from "./useInjectStyles";
export * from "./useOutsideAlerter";
export * from "./useDebounceValue";
export * from "./useIconStyles";
20 changes: 20 additions & 0 deletions packages/ui/src/hooks/useIconStyles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { useInjectStyles } from "./useInjectStyles";

export type IconStyle = {
fill?: boolean;
weight?: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
grad?: -25 | 0 | 200;
opticalSize?: 20 | 24 | 40 | 48;
}

export function useIconStyles({
fill = true,
weight = 500,
grad = 0,
opticalSize = 24
} : IconStyle) {
useInjectStyles("icons", `
.material-symbols-rounded {
font-variation-settings: 'FILL' ${fill ? 1 : 0}, 'wght' ${weight}, 'GRAD' ${grad}, 'opsz' ${opticalSize};
}`);
}
5 changes: 3 additions & 2 deletions packages/ui/src/icons/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import * as React from "react";
import { cls } from "../util";
import "material-icons/iconfont/filled.css";
import "material-symbols/rounded.css";
import "./default.css";

export type IconColor = "inherit" | "primary" | "secondary" | "disabled" | "error" | "success" | "warning";
export type IconProps = {
Expand Down Expand Up @@ -58,7 +59,7 @@ export const Icon = React.forwardRef<HTMLSpanElement, IconProps & { iconKey: str
...style
}}
className={
cls("material-icons",
cls("material-symbols-rounded",
color ? colorClassesMapping[color] : "",
"select-none",
className)}
Expand Down
8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AccountChildIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AccountChildInvertIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AccountCircleFilledIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AccountCircleOffIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/ActionKeyIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/ActivityZoneIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AdGroupIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AdGroupOffIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AddCallIcon.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { Icon, IconProps } from "../Icon";
/**
* @group Icons
*/
export function AddchartIcon(props: IconProps) {
export function AddChartIcon(props: IconProps) {
return <Icon {...props} iconKey={"addchart"}/>
}
8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AddNotesIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AdminMedsIcon.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { Icon, IconProps } from "../Icon";
/**
* @group Icons
*/
export function AmendIcon(props: IconProps) {
return <Icon {...props} iconKey={"amend"}/>
export function AdobeIcon(props: IconProps) {
return <Icon {...props} iconKey={"adobe"}/>
}
8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AgenderIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AirFreshenerIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AirPurifierGenIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AirPurifierIcon.tsx

This file was deleted.

8 changes: 8 additions & 0 deletions packages/ui/src/icons/components/AirplanemodeOffIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from "react";
import { Icon, IconProps } from "../Icon";
/**
* @group Icons
*/
export function AirplanemodeOffIcon(props: IconProps) {
return <Icon {...props} iconKey={"airplanemode_off"}/>
}
8 changes: 8 additions & 0 deletions packages/ui/src/icons/components/AirplanemodeOnIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from "react";
import { Icon, IconProps } from "../Icon";
/**
* @group Icons
*/
export function AirplanemodeOnIcon(props: IconProps) {
return <Icon {...props} iconKey={"airplanemode_on"}/>
}
8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AirwareIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AirwaveIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AlarmSmartWakeIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AlignCenterIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AlignEndIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AlignFlexCenterIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AlignFlexEndIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AlignFlexStartIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AlignItemsStretchIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AlignJustifyCenterIcon.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/src/icons/components/AlignJustifyFlexEndIcon.tsx

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit d2eb35b

Please sign in to comment.