w-design-system 0.0.18 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/.babelrc +8 -0
  2. package/.storybook/main.ts +19 -0
  3. package/.storybook/preview.ts +14 -0
  4. package/dist/components/Banner/index.js +14 -2
  5. package/dist/components/Banner/index.js.map +1 -1
  6. package/dist/components/index.d.ts +0 -1
  7. package/dist/components/index.d.ts.map +1 -1
  8. package/dist/components/index.js +0 -1
  9. package/dist/components/index.js.map +1 -1
  10. package/package.json +4 -7
  11. package/public/favicon.ico +0 -0
  12. package/public/index.html +43 -0
  13. package/public/logo192.png +0 -0
  14. package/public/logo512.png +0 -0
  15. package/public/manifest.json +25 -0
  16. package/public/robots.txt +3 -0
  17. package/src/components/Banner/index.tsx +47 -0
  18. package/src/components/Banner/stories.tsx +31 -0
  19. package/src/components/Banner/styles.ts +59 -0
  20. package/src/components/Button/index.tsx +31 -0
  21. package/src/components/Button/stories.tsx +98 -0
  22. package/src/components/Button/styles.ts +198 -0
  23. package/src/components/Button/test.tsx +44 -0
  24. package/src/components/ButtonRadiusIcon/index.tsx +22 -0
  25. package/src/components/ButtonRadiusIcon/stories.tsx +47 -0
  26. package/src/components/ButtonRadiusIcon/styles.ts +139 -0
  27. package/src/components/ButtonRound/index.tsx +25 -0
  28. package/src/components/ButtonRound/stories.tsx +50 -0
  29. package/src/components/ButtonRound/styles.ts +136 -0
  30. package/src/components/IconWrapper/index.tsx +43 -0
  31. package/src/components/Modal/index.tsx +30 -0
  32. package/src/components/Modal/stories.tsx +53 -0
  33. package/src/components/Modal/styles.ts +51 -0
  34. package/src/components/Paragraph/index.tsx +42 -0
  35. package/src/components/Paragraph/stories.tsx +107 -0
  36. package/src/components/Tabs/index.tsx +24 -0
  37. package/src/components/Tabs/stories.tsx +74 -0
  38. package/src/components/Tabs/styles.ts +23 -0
  39. package/src/components/Themes/index.ts +99 -0
  40. package/src/components/Title/index.tsx +33 -0
  41. package/src/components/Title/stories.tsx +68 -0
  42. package/src/components/Types/index.ts +45 -0
  43. package/src/components/index.tsx +10 -0
  44. package/src/index.tsx +11 -0
  45. package/src/prettier.config.js +11 -0
  46. package/src/react-app-env.d.ts +1 -0
  47. package/src/reportWebVitals.ts +16 -0
  48. package/src/setupTests.ts +5 -0
  49. package/src/src/globalStyles.ts +11 -0
  50. package/src/stories/Button.stories.ts +52 -0
  51. package/src/stories/Button.tsx +42 -0
  52. package/src/stories/Configure.mdx +364 -0
  53. package/src/stories/Header.stories.ts +33 -0
  54. package/src/stories/Header.tsx +56 -0
  55. package/src/stories/Page.stories.ts +32 -0
  56. package/src/stories/Page.tsx +73 -0
  57. package/src/stories/assets/accessibility.png +0 -0
  58. package/src/stories/assets/accessibility.svg +1 -0
  59. package/src/stories/assets/addon-library.png +0 -0
  60. package/src/stories/assets/assets.png +0 -0
  61. package/src/stories/assets/avif-test-image.avif +0 -0
  62. package/src/stories/assets/context.png +0 -0
  63. package/src/stories/assets/discord.svg +1 -0
  64. package/src/stories/assets/docs.png +0 -0
  65. package/src/stories/assets/figma-plugin.png +0 -0
  66. package/src/stories/assets/github.svg +1 -0
  67. package/src/stories/assets/share.png +0 -0
  68. package/src/stories/assets/styling.png +0 -0
  69. package/src/stories/assets/testing.png +0 -0
  70. package/src/stories/assets/theming.png +0 -0
  71. package/src/stories/assets/tutorials.svg +1 -0
  72. package/src/stories/assets/youtube.svg +1 -0
  73. package/src/stories/button.css +30 -0
  74. package/src/stories/header.css +32 -0
  75. package/src/stories/page.css +69 -0
  76. package/src/utils/constanst.ts +2 -0
  77. package/tsconfig.json +38 -0
  78. package/webpack.config.js +56 -0
  79. package/dist/assets/icon/svg.d.ts +0 -7
  80. package/dist/assets/icons/alert.svg +0 -3
  81. package/dist/assets/icons/close.svg +0 -10
  82. package/dist/assets/icons/comment.svg +0 -10
  83. package/dist/assets/icons/doc-check.svg +0 -10
  84. package/dist/assets/icons/image.svg +0 -3
  85. package/dist/bundle.js +0 -549
  86. package/dist/bundle.js.LICENSE.txt +0 -35
  87. /package/{dist → src}/assets/icon/alert.svg +0 -0
  88. /package/{dist → src}/assets/icon/close.svg +0 -0
  89. /package/{dist → src}/assets/icon/comment.svg +0 -0
  90. /package/{dist → src}/assets/icon/doc-check.svg +0 -0
  91. /package/{dist → src}/assets/icon/image.svg +0 -0
  92. /package/{dist → src}/assets/icon/index.ts +0 -0
package/.babelrc ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"],
3
+ "plugins": [
4
+ "@babel/plugin-proposal-class-properties",
5
+ "@babel/plugin-transform-runtime",
6
+ "@babel/plugin-proposal-optional-chaining"
7
+ ]
8
+ }
@@ -0,0 +1,19 @@
1
+ import type { StorybookConfig } from "@storybook/react-webpack5";
2
+
3
+ const config: StorybookConfig = {
4
+ stories: ['../src/components/**/stories.tsx', '../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
5
+ addons: [
6
+ "@storybook/preset-create-react-app",
7
+ "@storybook/addon-onboarding",
8
+ "@storybook/addon-links",
9
+ "@storybook/addon-essentials",
10
+ "@chromatic-com/storybook",
11
+ "@storybook/addon-interactions",
12
+ ],
13
+ framework: {
14
+ name: "@storybook/react-webpack5",
15
+ options: {},
16
+ },
17
+ staticDirs: ["../public"],
18
+ };
19
+ export default config;
@@ -0,0 +1,14 @@
1
+ import type { Preview } from "@storybook/react";
2
+
3
+ const preview: Preview = {
4
+ parameters: {
5
+ controls: {
6
+ matchers: {
7
+ color: /(background|color)$/i,
8
+ date: /Date$/i,
9
+ },
10
+ },
11
+ },
12
+ };
13
+
14
+ export default preview;
@@ -1,3 +1,14 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import React from 'react';
2
13
  import { BannerStyled } from './styles';
3
14
  import { docCheckSVG, alertSVG, commentSVG, closeSVG } from '../../assets/icon';
@@ -5,7 +16,8 @@ import { IconWrapper } from '../IconWrapper';
5
16
  import { Paragraph } from '../Paragraph';
6
17
  import { theme } from '../Themes';
7
18
  const { colors: { cyan40, mint40, honey40, red40, shade40, shade30 }, } = theme;
8
- export const Banner = ({ title, onClick, variant, subTitle }) => {
19
+ export const Banner = (_a) => {
20
+ var { title, onClick, variant, subTitle } = _a, props = __rest(_a, ["title", "onClick", "variant", "subTitle"]);
9
21
  const searchIcon = () => {
10
22
  switch (variant) {
11
23
  case 'notice':
@@ -21,7 +33,7 @@ export const Banner = ({ title, onClick, variant, subTitle }) => {
21
33
  }
22
34
  };
23
35
  const { icon, color } = searchIcon();
24
- return (React.createElement(BannerStyled, { variant: variant },
36
+ return (React.createElement(BannerStyled, Object.assign({ variant: variant }, props),
25
37
  React.createElement("div", { className: 'bannerWrapper' },
26
38
  React.createElement(IconWrapper, { src: icon, className: 'buttonRadiusWrapperIcon' }),
27
39
  React.createElement("span", null,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Banner/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,KAAK,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AAO,EAAE,CAAA;YAC3C,KAAK,QAAQ;gBACX,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;YACzC;gBACE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,CAAA;QAC9C,CAAC;IACH,CAAC,CAAA;IAED,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,UAAU,EAAE,CAAA;IAEpC,OAAO,CACL,oBAAC,YAAY,kBAAC,OAAO,EAAE,OAAO,IAAM,KAAK;QACvC,6BAAK,SAAS,EAAE,eAAe;YAC7B,oBAAC,WAAW,IAAC,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,yBAAyB,GAAI;YAChE;gBACE,oBAAC,SAAS,IAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,IACpC,KAAK,CACI;gBACX,QAAQ,IAAI,CACX,oBAAC,SAAS,IAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,IACrC,QAAQ,CACC,CACb,CACI,CACH;QACN,oBAAC,WAAW,IAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAI,CAClF,CAChB,CAAA;AACH,CAAC,CAAA"}
@@ -8,5 +8,4 @@ export { Paragraph } from './Paragraph/index';
8
8
  export { Tabs } from './Tabs/index';
9
9
  export { theme } from './Themes/index';
10
10
  export { Title } from './Title/index';
11
- export { docCheckSVG, alertSVG, commentSVG, imageSVG, closeSVG } from '../assets/icon/index';
12
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA"}
@@ -8,5 +8,4 @@ export { Paragraph } from './Paragraph/index';
8
8
  export { Tabs } from './Tabs/index';
9
9
  export { theme } from './Themes/index';
10
10
  export { Title } from './Title/index';
11
- export { docCheckSVG, alertSVG, commentSVG, imageSVG, closeSVG } from '../assets/icon/index';
12
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA"}
package/package.json CHANGED
@@ -1,11 +1,7 @@
1
1
  {
2
2
  "name": "w-design-system",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "main": "dist/index.js",
5
- "files": [
6
- "dist",
7
- "README.md"
8
- ],
9
5
  "dependencies": {
10
6
  "@svgr/webpack": "^8.1.0",
11
7
  "@testing-library/jest-dom": "^5.17.0",
@@ -28,11 +24,12 @@
28
24
  "scripts": {
29
25
  "start": "react-scripts start",
30
26
  "copy-assets": "cpx 'src/assets/icon/**/*' dist/assets/icon",
31
- "build": "webpack --config webpack.config.js && yarn copy-assets",
27
+ "build": "tsc -p . && yarn copy-assets",
32
28
  "test": "react-scripts test",
33
29
  "eject": "react-scripts eject",
34
30
  "storybook": "storybook dev -p 6006",
35
- "build-storybook": "storybook build"
31
+ "build-storybook": "storybook build",
32
+ "clean": "rm -rf node_modules && rm -rf dist && yarn cache clean && yarn install"
36
33
  },
37
34
  "eslintConfig": {
38
35
  "extends": [
Binary file
@@ -0,0 +1,43 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+ <meta name="theme-color" content="#000000" />
8
+ <meta
9
+ name="description"
10
+ content="Web site created using create-react-app"
11
+ />
12
+ <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13
+ <!--
14
+ manifest.json provides metadata used when your web app is installed on a
15
+ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16
+ -->
17
+ <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18
+ <!--
19
+ Notice the use of %PUBLIC_URL% in the tags above.
20
+ It will be replaced with the URL of the `public` folder during the build.
21
+ Only files inside the `public` folder can be referenced from the HTML.
22
+
23
+ Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24
+ work correctly both with client-side routing and a non-root public URL.
25
+ Learn how to configure a non-root public URL by running `npm run build`.
26
+ -->
27
+ <title>React App</title>
28
+ </head>
29
+ <body>
30
+ <noscript>You need to enable JavaScript to run this app.</noscript>
31
+ <div id="root"></div>
32
+ <!--
33
+ This HTML file is a template.
34
+ If you open it directly in the browser, you will see an empty page.
35
+
36
+ You can add webfonts, meta tags, or analytics to this file.
37
+ The build step will place the bundled scripts into the <body> tag.
38
+
39
+ To begin the development, run `npm start` or `yarn start`.
40
+ To create a production bundle, use `npm run build` or `yarn build`.
41
+ -->
42
+ </body>
43
+ </html>
Binary file
Binary file
@@ -0,0 +1,25 @@
1
+ {
2
+ "short_name": "React App",
3
+ "name": "Create React App Sample",
4
+ "icons": [
5
+ {
6
+ "src": "favicon.ico",
7
+ "sizes": "64x64 32x32 24x24 16x16",
8
+ "type": "image/x-icon"
9
+ },
10
+ {
11
+ "src": "logo192.png",
12
+ "type": "image/png",
13
+ "sizes": "192x192"
14
+ },
15
+ {
16
+ "src": "logo512.png",
17
+ "type": "image/png",
18
+ "sizes": "512x512"
19
+ }
20
+ ],
21
+ "start_url": ".",
22
+ "display": "standalone",
23
+ "theme_color": "#000000",
24
+ "background_color": "#ffffff"
25
+ }
@@ -0,0 +1,3 @@
1
+ # https://www.robotstxt.org/robotstxt.html
2
+ User-agent: *
3
+ Disallow:
@@ -0,0 +1,47 @@
1
+ import React from 'react'
2
+ import { BannerStyled } from './styles'
3
+ import { BannerTypes } from '../Types'
4
+ import { docCheckSVG, alertSVG, commentSVG, closeSVG } from '../../assets/icon'
5
+ import { IconWrapper } from '../IconWrapper'
6
+ import { Paragraph } from '../Paragraph'
7
+ import { theme } from '../Themes'
8
+ const {
9
+ colors: { cyan40, mint40, honey40, red40, shade40, shade30 },
10
+ } = theme
11
+ export const Banner: React.FC<BannerTypes> = ({ title, onClick, variant, subTitle, ...props }) => {
12
+ const searchIcon = () => {
13
+ switch (variant) {
14
+ case 'notice':
15
+ return { icon: commentSVG, color: cyan40 }
16
+ case 'success':
17
+ return { icon: docCheckSVG, color: mint40 }
18
+ case 'warning':
19
+ return { icon: alertSVG, color: honey40 }
20
+ case 'danger':
21
+ return { icon: alertSVG, color: red40 }
22
+ default:
23
+ return { icon: commentSVG, color: cyan40 }
24
+ }
25
+ }
26
+
27
+ const { icon, color } = searchIcon()
28
+
29
+ return (
30
+ <BannerStyled variant={variant} {...props}>
31
+ <div className={'bannerWrapper'}>
32
+ <IconWrapper src={icon} className={'buttonRadiusWrapperIcon'} />
33
+ <span>
34
+ <Paragraph size={'medium'} color={color}>
35
+ {title}
36
+ </Paragraph>
37
+ {subTitle && (
38
+ <Paragraph size={'small'} color={shade40}>
39
+ {subTitle}
40
+ </Paragraph>
41
+ )}
42
+ </span>
43
+ </div>
44
+ <IconWrapper src={closeSVG} width={'14px'} height={'14px'} color={shade30} onClick={onClick} />
45
+ </BannerStyled>
46
+ )
47
+ }
@@ -0,0 +1,31 @@
1
+ import { Meta, StoryObj } from '@storybook/react'
2
+ import { VARIANTS_TYPES_BANNER } from '../../utils/constanst'
3
+
4
+ import { Banner } from './index'
5
+
6
+ const meta: Meta<typeof Banner> = {
7
+ title: 'Components/Banner',
8
+ component: Banner,
9
+ tags: ['autodocs'],
10
+ argTypes: {
11
+ variant: {
12
+ control: {
13
+ type: 'select',
14
+ options: VARIANTS_TYPES_BANNER,
15
+ },
16
+ },
17
+
18
+ onClick: { action: 'clicked' },
19
+ },
20
+ } satisfies Meta<typeof Banner>
21
+
22
+ export default meta
23
+ type Story = StoryObj<typeof Banner>
24
+
25
+ export const Playground: Story = {
26
+ args: {
27
+ variant: 'success',
28
+ title: 'Sucesso!',
29
+ subTitle: 'Mensagem de sucesso.',
30
+ },
31
+ }
@@ -0,0 +1,59 @@
1
+ import styled, { css } from 'styled-components'
2
+ import { theme } from '../Themes'
3
+
4
+ import { BannerTypes } from '../Types'
5
+
6
+ const { colors } = theme
7
+ const buttonRadiusWrapperIconStyles = (color: string) => css`
8
+ .buttonRadiusWrapperIcon {
9
+ svg {
10
+ fill: ${color};
11
+ path {
12
+ fill: ${color};
13
+ }
14
+ }
15
+ }
16
+ `
17
+ const colorScheme = {
18
+ notice: css`
19
+ background: ${colors.cyan10};
20
+ border-color: ${colors.cyan40};
21
+ ${buttonRadiusWrapperIconStyles(colors.cyan40)};
22
+ `,
23
+ danger: css`
24
+ background: ${colors.red10};
25
+ border-color: ${colors.red40};
26
+ ${buttonRadiusWrapperIconStyles(colors.red40)};
27
+ `,
28
+ warning: css`
29
+ background: ${colors.honey10};
30
+ border-color: ${colors.honey40};
31
+ ${buttonRadiusWrapperIconStyles(colors.honey40)};
32
+ `,
33
+ success: css`
34
+ background: ${colors.mint10};
35
+ border-color: ${colors.mint40};
36
+ ${buttonRadiusWrapperIconStyles(colors.mint40)};
37
+ `,
38
+ } as const
39
+
40
+ export const BannerStyled = styled.div<BannerTypes>`
41
+ display: flex;
42
+ box-sizing: border-box;
43
+ justify-content: space-between;
44
+ align-items: center;
45
+ width: 100%;
46
+ height: 100%;
47
+ max-height: 100px;
48
+ min-height: 56px;
49
+ padding: 12px 24px;
50
+ border-radius: 16px;
51
+ border: 1px dashed;
52
+ ${({ variant = 'notice' }) => colorScheme[variant]};
53
+
54
+ .bannerWrapper {
55
+ display: flex;
56
+ align-items: center;
57
+ gap: 12px;
58
+ }
59
+ `
@@ -0,0 +1,31 @@
1
+ import React from 'react'
2
+ import { IconWrapper } from '../IconWrapper'
3
+ import { ButtonStyled } from './styles'
4
+ import { ButtonTypes } from '../Types'
5
+
6
+ export const Button: React.FC<ButtonTypes> = ({
7
+ variant = 'primary',
8
+ children,
9
+ disabled = false,
10
+ icon,
11
+ radius,
12
+ outline,
13
+ halfLeft,
14
+ halfRight,
15
+ fullWidth,
16
+ ...props
17
+ }) => (
18
+ <ButtonStyled
19
+ variant={variant}
20
+ disabled={disabled}
21
+ radius={radius}
22
+ outline={outline}
23
+ halfLeft={halfLeft}
24
+ halfRight={halfRight}
25
+ fullWidth={fullWidth}
26
+ {...props}
27
+ >
28
+ {icon && <IconWrapper src={icon} color={'white'} className={'buttonRadiusWrapperIcon'} />}
29
+ {children}
30
+ </ButtonStyled>
31
+ )
@@ -0,0 +1,98 @@
1
+ import { Meta, StoryObj } from '@storybook/react'
2
+ import exampleIcon from '../../assets/icon/image.svg'
3
+ import { Button } from './index'
4
+ import { VARIANTS_TYPES } from '../../utils/constanst'
5
+
6
+ const meta: Meta<typeof Button> = {
7
+ title: 'Components/Button',
8
+ component: Button,
9
+ tags: ['autodocs'],
10
+ argTypes: {
11
+ variant: {
12
+ control: {
13
+ type: 'select',
14
+ options: VARIANTS_TYPES,
15
+ },
16
+ },
17
+ disabled: {
18
+ control: 'boolean',
19
+ },
20
+ icon: {
21
+ control: 'object',
22
+ options: [exampleIcon],
23
+ description: exampleIcon,
24
+ },
25
+
26
+ onClick: { action: 'clicked' },
27
+ },
28
+ } satisfies Meta<typeof Button>
29
+
30
+ export default meta
31
+ type Story = StoryObj<typeof Button>
32
+
33
+ export const Playground: Story = {
34
+ args: {
35
+ variant: 'primary',
36
+ children: 'ButtonPlayground',
37
+ disabled: false,
38
+ },
39
+ }
40
+
41
+ export const ButtonDefault: Story = {
42
+ args: {
43
+ variant: 'secondary',
44
+ children: 'ButtonPlayground',
45
+ disabled: false,
46
+ },
47
+ }
48
+
49
+ export const ButtonOutilne: Story = {
50
+ args: {
51
+ variant: 'secondary',
52
+ children: 'ButtonPlayground',
53
+ disabled: false,
54
+ outline: true,
55
+ },
56
+ }
57
+ export const ButtonRadius: Story = {
58
+ args: {
59
+ variant: 'success',
60
+ children: 'ButtonPlayground',
61
+ disabled: false,
62
+ radius: true,
63
+ },
64
+ }
65
+
66
+ export const ButtonDisabled: Story = {
67
+ args: {
68
+ variant: 'danger',
69
+ children: 'ButtonPlayground',
70
+ disabled: true,
71
+ },
72
+ }
73
+
74
+ export const ButtonIcon: Story = {
75
+ args: {
76
+ variant: 'primary',
77
+ children: 'ButtonPlayground',
78
+ icon: exampleIcon,
79
+ },
80
+ }
81
+
82
+ export const ButtonIconHalfRightOutiline: Story = {
83
+ args: {
84
+ variant: 'success',
85
+ children: 'ButtonPlayground',
86
+ icon: exampleIcon,
87
+ halfRight: true,
88
+ outline: true,
89
+ },
90
+ }
91
+ export const ButtonIconHalfLeft: Story = {
92
+ args: {
93
+ variant: 'success',
94
+ children: 'ButtonPlayground',
95
+ icon: exampleIcon,
96
+ halfLeft: true,
97
+ },
98
+ }