Merge branch 'text-control-prefix-icon' of github.com:webstudio-is/webstudio-designer into text-control-prefix-icon

This commit is contained in:
Sultan committed 2022-11-05 15:25:05 +03:00
commit cd2d244d5d
6 files changed
+131 -32

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
module.exports = {
stories: ["../src/*.stories.mdx", "../src/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
],
framework: "@storybook/react",
};
+9
View File
@@ -0,0 +1,9 @@
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
};
+12 -1
View File
@@ -9,9 +9,20 @@
"build": "rm -fr lib tsconfig.tsbuildinfo && tsc",
"typecheck": "tsc --noEmit",
"lint": "eslint ./src --ext .ts,.tsx --max-warnings 0",
"checks": "yarn typecheck && yarn lint"
"checks": "yarn typecheck && yarn lint",
"storybook:run": "start-storybook -p 6006",
"storybook:build": "build-storybook"
},
"devDependencies": {
"@storybook/addon-actions": "^6.5.6",
"@storybook/addon-essentials": "^6.5.6",
"@storybook/addon-interactions": "^6.5.12",
"@storybook/addon-links": "^6.5.6",
"@storybook/builder-webpack4": "^6.5.6",
"@storybook/jest": "^0.0.10",
"@storybook/manager-webpack4": "^6.5.6",
"@storybook/react": "^6.5.6",
"@storybook/testing-library": "^0.0.13",
"tsup": "^6.1.3",
"typescript": "4.7.4"
},
+69
View File
@@ -0,0 +1,69 @@
import * as icons from "./index";
import * as legacyIcons from "./legacy";
export const Icons = () => {
return (
<>
<style>{`
svg {width: 100%; height: 100%;}
`}</style>
<div style={{ display: "flex", flexWrap: "wrap" }}>
{Object.entries(icons).map(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
([name, Icon]: [string, any]) => {
if (name.endsWith("Icon") === false) {
return null;
}
return (
<div
key={name}
style={{
width: 150,
height: 100,
margin: 5,
padding: 5,
border: "solid 1px #f5f5f5",
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
}}
>
<div
style={{
display: "flex",
width: 32,
height: 32,
alignItems: "center",
justifyContent: "center",
marginBottom: 16,
}}
>
<Icon />
</div>
<div
style={{
fontFamily: "Arial",
textAlign: "center",
wordWrap: "break-word",
width: "100%",
fontSize: "14px",
color: "#5a5a5a",
}}
>
{name.replace(/Icon$/, "")}
{name in legacyIcons && " (legacy)"}
</div>
</div>
);
}
)}
</div>
</>
);
};
export default {
title: "All Icons",
component: Icons,
};
+1 -31
View File
@@ -1,34 +1,4 @@
export {
ImageIcon,
FontBoldIcon,
FontItalicIcon,
Link2Icon,
MobileIcon,
LaptopIcon,
DesktopIcon,
PlusIcon,
HamburgerMenuIcon,
DotsHorizontalIcon,
CheckIcon,
RocketIcon,
ExternalLinkIcon,
Share1Icon,
EyeOpenIcon,
ExclamationTriangleIcon,
DotFilledIcon,
TriangleRightIcon,
TriangleDownIcon,
CommitIcon,
InputIcon,
ButtonIcon,
TextAlignLeftIcon,
HeadingIcon,
TextIcon,
SquareIcon,
InfoCircledIcon,
CrossCircledIcon,
CheckCircledIcon,
} from "@radix-ui/react-icons"; // Legacy icons
export * from "./legacy";
export * from "./list-nested";
export * from "./brush";
export * from "./form";
+31
View File
@@ -0,0 +1,31 @@
export {
ImageIcon,
FontBoldIcon,
FontItalicIcon,
Link2Icon,
MobileIcon,
LaptopIcon,
DesktopIcon,
PlusIcon,
HamburgerMenuIcon,
DotsHorizontalIcon,
CheckIcon,
RocketIcon,
ExternalLinkIcon,
Share1Icon,
EyeOpenIcon,
ExclamationTriangleIcon,
DotFilledIcon,
TriangleRightIcon,
TriangleDownIcon,
CommitIcon,
InputIcon,
ButtonIcon,
TextAlignLeftIcon,
HeadingIcon,
TextIcon,
SquareIcon,
InfoCircledIcon,
CrossCircledIcon,
CheckCircledIcon,
} from "@radix-ui/react-icons";