beyond-system 0.1.0

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 (64) hide show
  1. package/.auto-changelog +10 -0
  2. package/.editorconfig +9 -0
  3. package/.eslintrc.js +74 -0
  4. package/.storybook/growth-theme.js +23 -0
  5. package/.storybook/main.js +21 -0
  6. package/.storybook/manager.js +7 -0
  7. package/.storybook/preview-head.html +13 -0
  8. package/.storybook/preview.js +29 -0
  9. package/README.md +38 -0
  10. package/changelog-template.hbs +19 -0
  11. package/next.config.js +6 -0
  12. package/package.json +51 -0
  13. package/prettier.config.js +5 -0
  14. package/public/favicon.ico +0 -0
  15. package/public/next.svg +1 -0
  16. package/public/thirteen.svg +1 -0
  17. package/public/vercel.svg +1 -0
  18. package/setup.js +15 -0
  19. package/src/colors/base-colors.ts +75 -0
  20. package/src/colors/gradients.ts +9 -0
  21. package/src/colors/index.ts +3 -0
  22. package/src/colors/shadows.ts +9 -0
  23. package/src/components/react/Checkbox/Checkbox.stories.tsx +59 -0
  24. package/src/components/react/Checkbox/Checkbox.styles.ts +84 -0
  25. package/src/components/react/Checkbox/Checkbox.tsx +33 -0
  26. package/src/components/react/Checkbox/Checkbox.variants.ts +27 -0
  27. package/src/components/react/DefaultButton/DefaultButton.stories.tsx +98 -0
  28. package/src/components/react/DefaultButton/DefaultButton.styles.ts +106 -0
  29. package/src/components/react/DefaultButton/DefaultButton.tsx +67 -0
  30. package/src/components/react/DefaultButton/DefaultButton.variants.ts +49 -0
  31. package/src/components/react/IconButton/IconButton.stories.tsx +71 -0
  32. package/src/components/react/IconButton/IconButton.styles.ts +98 -0
  33. package/src/components/react/IconButton/IconButton.tsx +55 -0
  34. package/src/components/react/IconButton/IconButton.variants.ts +40 -0
  35. package/src/components/react/Loader/Loader.stories.tsx +36 -0
  36. package/src/components/react/Loader/Loader.tsx +40 -0
  37. package/src/components/react/Loader/index.tsx +1 -0
  38. package/src/components/react/OutlineButton/OutlineButton.stories.tsx +98 -0
  39. package/src/components/react/OutlineButton/OutlineButton.styles.ts +97 -0
  40. package/src/components/react/OutlineButton/OutlineButton.tsx +67 -0
  41. package/src/components/react/OutlineButton/OutlineButton.variants.ts +40 -0
  42. package/src/components/react/RadioInput/RadioInput.stories.tsx +53 -0
  43. package/src/components/react/RadioInput/RadioInput.styles.ts +69 -0
  44. package/src/components/react/RadioInput/RadioInput.tsx +23 -0
  45. package/src/components/react/RadioInput/RadioInput.variants.ts +23 -0
  46. package/src/components/react/Switch/Switch.stories.tsx +53 -0
  47. package/src/components/react/Switch/Switch.styles.ts +60 -0
  48. package/src/components/react/Switch/Switch.tsx +28 -0
  49. package/src/components/react/Switch/Switch.variants.ts +19 -0
  50. package/src/components/react/TransparentButton/TransparentButton.stories.tsx +53 -0
  51. package/src/components/react/TransparentButton/TransparentButton.styles.ts +74 -0
  52. package/src/components/react/TransparentButton/TransparentButton.tsx +41 -0
  53. package/src/components/react/TransparentButton/TransparentButton.variants.ts +35 -0
  54. package/src/stories/base-colors/base-colors.stories.styles.ts +65 -0
  55. package/src/stories/base-colors/base-colors.stories.tsx +89 -0
  56. package/src/stories/gradients/gradients.stories.styles.ts +60 -0
  57. package/src/stories/gradients/gradients.stories.tsx +39 -0
  58. package/src/stories/shadows/shadows.stories.styles.ts +59 -0
  59. package/src/stories/shadows/shadows.stories.tsx +37 -0
  60. package/src/web/border.ts +13 -0
  61. package/src/web/font.ts +38 -0
  62. package/src/web/index.ts +2 -0
  63. package/tsconfig.json +24 -0
  64. package/vercel.json +8 -0
@@ -0,0 +1,10 @@
1
+ {
2
+ "output": "CHANGELOG.md",
3
+ "template": "changelog-template.hbs",
4
+ "unreleased": true,
5
+ "commitLimit": false,
6
+ "releaseSummary": true,
7
+ "hideEmptyReleases": false,
8
+ "ignoreCommit": "Merge pull request #",
9
+ "handlebarsSetup": "setup.js"
10
+ }
package/.editorconfig ADDED
@@ -0,0 +1,9 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = space
5
+ indent_size = 2
6
+ end_of_line = lf
7
+ charset = utf-8
8
+ trim_trailing_whitespace = true
9
+ insert_final_newline = true
package/.eslintrc.js ADDED
@@ -0,0 +1,74 @@
1
+ module.exports = {
2
+ env: {
3
+ browser: true,
4
+ es2021: true,
5
+ node: true,
6
+ },
7
+ extends: [
8
+ 'next/core-web-vitals',
9
+ 'prettier',
10
+ ],
11
+ parser: '@typescript-eslint/parser',
12
+ parserOptions: {
13
+ ecmaFeatures: {
14
+ jsx: true,
15
+ },
16
+ ecmaVersion: 12,
17
+ sourceType: 'module',
18
+ },
19
+ plugins: ['react', '@typescript-eslint', 'prettier', 'import'],
20
+ settings: {
21
+ next: {
22
+ rootDir: ['apps/*/', 'packages/*/'],
23
+ },
24
+ 'import/parsers': {
25
+ '@typescript-eslint/parser': ['.ts', '.tsx'],
26
+ },
27
+ 'import/resolver': {
28
+ node: {
29
+ extensions: ['.js', '.jsx', '.ts', '.tsx'],
30
+ },
31
+ typescript: {
32
+ alwaysTryTypes: true,
33
+ project: ['apps/*/tsconfig.json'],
34
+ },
35
+ },
36
+ },
37
+ rules: {
38
+ 'prettier/prettier': [
39
+ 'error',
40
+ {
41
+ semi: false,
42
+ singleQuote: true,
43
+ endOfLine: 'auto',
44
+ },
45
+ ],
46
+ 'no-unused-vars': 'off',
47
+ '@typescript-eslint/no-unused-vars': 'error',
48
+ 'space-before-function-paren': 'off',
49
+ 'react/prop-types': 'off',
50
+ 'react/jsx-filename-extension': [
51
+ 1,
52
+ { extensions: ['.js', '.jsx', '.tsx'] },
53
+ ],
54
+ 'no-use-before-define': 'off',
55
+ '@typescript-eslint/no-use-before-define': [1],
56
+ 'import/extensions': 'off',
57
+ 'no-console': 'off',
58
+ camelcase: 'off',
59
+ 'react/jsx-props-no-spreading': 'off',
60
+ 'no-underscore-dangle': 'off',
61
+ 'jsx-a11y/label-has-associated-control': 'off',
62
+ },
63
+ ignorePatterns: [
64
+ '**/*.js',
65
+ '**/*.json',
66
+ 'node_modules',
67
+ 'public',
68
+ 'styles',
69
+ '.next',
70
+ 'coverage',
71
+ 'dist',
72
+ '.turbo',
73
+ ],
74
+ }
@@ -0,0 +1,23 @@
1
+
2
+ import { create } from "@storybook/theming";
3
+
4
+ export default create({
5
+ base: 'light',
6
+
7
+ colorPrimary: '#ff7d12',
8
+ colorSecondary: '#454545',
9
+
10
+ // Typography
11
+ fontBase: 'Poppins',
12
+
13
+ // Text colors
14
+ textColor: "#454545",
15
+ textInverseColor: "rgba(255,255,255,0.9)",
16
+
17
+ // Toolbar default and active colors
18
+
19
+ brandTitle: "Beyond System",
20
+ brandUrl: "https://growthmachine.com.br/",
21
+ brandImage: "https://uploads-ssl.webflow.com/6074e828c9f2b21cbb760b1b/6074e93d5555461225bac0a6_Logo%20Growth%20Machine%20-%20Normal.svg",
22
+ brandTarget: "_self",
23
+ });
@@ -0,0 +1,21 @@
1
+ const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
2
+
3
+ module.exports = {
4
+ stories: [
5
+ "../src/**/*.stories.mdx",
6
+ "../src/**/*.stories.@(js|jsx|ts|tsx)"
7
+ ],
8
+ addons: [
9
+ "@storybook/addon-links",
10
+ "@storybook/addon-essentials",
11
+ "@storybook/addon-interactions"
12
+ ],
13
+ framework: "@storybook/react",
14
+ core: {
15
+ "builder": "@storybook/builder-webpack5"
16
+ },
17
+ webpackFinal: async (config, { configType }) => {
18
+ config.resolve.plugins = [new TsconfigPathsPlugin()];
19
+ return config;
20
+ }
21
+ }
@@ -0,0 +1,7 @@
1
+
2
+ import { addons } from '@storybook/addons';
3
+ import GrowthTheme from './growth-theme';
4
+
5
+ addons.setConfig({
6
+ theme: GrowthTheme,
7
+ });
@@ -0,0 +1,13 @@
1
+ <link rel="preconnect" href="https://fonts.googleapis.com">
2
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
3
+ <link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
4
+ <style type="text/css">
5
+ body {
6
+ font-family: 'Poppins', sans-serif;
7
+ }
8
+
9
+ * {
10
+ box-sizing: border-box
11
+ }
12
+
13
+ </style>
@@ -0,0 +1,29 @@
1
+ const {COLORS} = require('../src/colors')
2
+
3
+
4
+ export const parameters = {
5
+ actions: { argTypesRegex: "^on[A-Z].*" },
6
+ backgrounds: {
7
+ default: 'NEUTRAL_HIGH',
8
+ values: [
9
+ {
10
+ name: 'NEUTRAL_HIGH',
11
+ value: COLORS.NEUTRAL_HIGH,
12
+ },
13
+ {
14
+ name: 'NEUTRAL_DARKER',
15
+ value: COLORS.NEUTRAL_DARKER,
16
+ },
17
+ {
18
+ name: 'GROWTH_MID',
19
+ value: COLORS.GROWTH_MID,
20
+ },
21
+ ],
22
+ },
23
+ controls: {
24
+ matchers: {
25
+ color: /(background|color)$/i,
26
+ date: /Date$/,
27
+ },
28
+ },
29
+ }
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2
+
3
+ ## Getting Started
4
+
5
+ First, run the development server:
6
+
7
+ ```bash
8
+ npm run dev
9
+ # or
10
+ yarn dev
11
+ # or
12
+ pnpm dev
13
+ ```
14
+
15
+ Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
16
+
17
+ You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
18
+
19
+ [API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
20
+
21
+ The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
22
+
23
+ This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
24
+
25
+ ## Learn More
26
+
27
+ To learn more about Next.js, take a look at the following resources:
28
+
29
+ - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
30
+ - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
31
+
32
+ You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
33
+
34
+ ## Deploy on Vercel
35
+
36
+ The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
37
+
38
+ Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
@@ -0,0 +1,19 @@
1
+ {{#each releases}}
2
+ ### [{{title}}]({{href}})
3
+
4
+ {{#commit-list commits heading='### New Features' message='(feat:|add:)'}}
5
+ - {{subject}} [`{{shorthash}}`]({{href}})
6
+ {{/commit-list}}
7
+
8
+ {{#commit-list commits heading='### Fixes' message='fix:'}}
9
+ - {{subject}} [`{{shorthash}}`]({{href}})
10
+ {{/commit-list}}
11
+
12
+ {{#commit-list commits heading='### Performance' message='zap:'}}
13
+ - {{subject}} [`{{shorthash}}`]({{href}})
14
+ {{/commit-list}}
15
+
16
+ {{#commit-list commits heading='### Other Changes' message='(chore:|docs:|style:|refactor:|test:)'}}
17
+ - {{subject}} [`{{shorthash}}`]({{href}})
18
+ {{/commit-list}}
19
+ {{/each}}
package/next.config.js ADDED
@@ -0,0 +1,6 @@
1
+ /** @type {import('next').NextConfig} */
2
+ const nextConfig = {
3
+ reactStrictMode: true,
4
+ }
5
+
6
+ module.exports = nextConfig
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "beyond-system",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "scripts": {
6
+ "dev": "start-storybook -p 6006",
7
+ "lint": "eslint .",
8
+ "storybook": "start-storybook -p 6006 -s public",
9
+ "build-storybook": "build-storybook -s public",
10
+ "serve-storybook": "serve storybook-static"
11
+ },
12
+ "resolutions": {
13
+ "@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.cd77847.0",
14
+ "styled-components": "^5"
15
+ },
16
+ "dependencies": {
17
+ "@radix-ui/react-checkbox": "^1.0.3",
18
+ "@radix-ui/react-radio-group": "^1.1.2",
19
+ "@radix-ui/react-switch": "^1.0.2",
20
+ "next": "13.2.4",
21
+ "react": "18.2.0",
22
+ "react-dom": "18.2.0",
23
+ "react-icons": "^4.8.0",
24
+ "styled-components": "^5.3.9",
25
+ "typescript": "5.0.2"
26
+ },
27
+ "devDependencies": {
28
+ "@babel/core": "^7.21.3",
29
+ "@storybook/addon-actions": "^6.5.16",
30
+ "@storybook/addon-essentials": "^6.5.16",
31
+ "@storybook/addon-interactions": "^6.5.16",
32
+ "@storybook/addon-links": "^6.5.16",
33
+ "@storybook/builder-webpack5": "^6.5.16",
34
+ "@storybook/manager-webpack5": "^6.5.16",
35
+ "@storybook/react": "^6.5.16",
36
+ "@storybook/testing-library": "^0.0.13",
37
+ "@types/node": "18.15.5",
38
+ "@types/react": "18.0.28",
39
+ "@types/react-dom": "18.0.11",
40
+ "@types/styled-components": "^5.1.26",
41
+ "@typescript-eslint/eslint-plugin": "^5.56.0",
42
+ "babel-loader": "^8.3.0",
43
+ "eslint": "8.36.0",
44
+ "eslint-config-next": "13.2.4",
45
+ "eslint-config-prettier": "^8.8.0",
46
+ "eslint-plugin-prettier": "^4.2.1",
47
+ "eslint-plugin-storybook": "^0.6.11",
48
+ "prettier": "^2.8.6",
49
+ "tsconfig-paths-webpack-plugin": "^4.0.1"
50
+ }
51
+ }
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ semi: false,
3
+ singleQuote: true,
4
+ endOfLine: 'auto'
5
+ }
Binary file
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="40" height="31" fill="none"><g opacity=".9"><path fill="url(#a)" d="M13 .4v29.3H7V6.3h-.2L0 10.5V5L7.2.4H13Z"/><path fill="url(#b)" d="M28.8 30.1c-2.2 0-4-.3-5.7-1-1.7-.8-3-1.8-4-3.1a7.7 7.7 0 0 1-1.4-4.6h6.2c0 .8.3 1.4.7 2 .4.5 1 .9 1.7 1.2.7.3 1.6.4 2.5.4 1 0 1.7-.2 2.5-.5.7-.3 1.3-.8 1.7-1.4.4-.6.6-1.2.6-2s-.2-1.5-.7-2.1c-.4-.6-1-1-1.8-1.4-.8-.4-1.8-.5-2.9-.5h-2.7v-4.6h2.7a6 6 0 0 0 2.5-.5 4 4 0 0 0 1.7-1.3c.4-.6.6-1.3.6-2a3.5 3.5 0 0 0-2-3.3 5.6 5.6 0 0 0-4.5 0 4 4 0 0 0-1.7 1.2c-.4.6-.6 1.2-.6 2h-6c0-1.7.6-3.2 1.5-4.5 1-1.3 2.2-2.3 3.8-3C25 .4 26.8 0 28.8 0s3.8.4 5.3 1.1c1.5.7 2.7 1.7 3.6 3a7.2 7.2 0 0 1 1.2 4.2c0 1.6-.5 3-1.5 4a7 7 0 0 1-4 2.2v.2c2.2.3 3.8 1 5 2.2a6.4 6.4 0 0 1 1.6 4.6c0 1.7-.5 3.1-1.4 4.4a9.7 9.7 0 0 1-4 3.1c-1.7.8-3.7 1.1-5.8 1.1Z"/></g><defs><linearGradient id="a" x1="20" x2="20" y1="0" y2="30.1" gradientUnits="userSpaceOnUse"><stop/><stop offset="1" stop-color="#3D3D3D"/></linearGradient><linearGradient id="b" x1="20" x2="20" y1="0" y2="30.1" gradientUnits="userSpaceOnUse"><stop/><stop offset="1" stop-color="#3D3D3D"/></linearGradient></defs></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 283 64"><path fill="black" d="M141 16c-11 0-19 7-19 18s9 18 20 18c7 0 13-3 16-7l-7-5c-2 3-6 4-9 4-5 0-9-3-10-7h28v-3c0-11-8-18-19-18zm-9 15c1-4 4-7 9-7s8 3 9 7h-18zm117-15c-11 0-19 7-19 18s9 18 20 18c6 0 12-3 16-7l-8-5c-2 3-5 4-8 4-5 0-9-3-11-7h28l1-3c0-11-8-18-19-18zm-10 15c2-4 5-7 10-7s8 3 9 7h-19zm-39 3c0 6 4 10 10 10 4 0 7-2 9-5l8 5c-3 5-9 8-17 8-11 0-19-7-19-18s8-18 19-18c8 0 14 3 17 8l-8 5c-2-3-5-5-9-5-6 0-10 4-10 10zm83-29v46h-9V5h9zM37 0l37 64H0L37 0zm92 5-27 48L74 5h10l18 30 17-30h10zm59 12v10l-3-1c-6 0-10 4-10 10v15h-9V17h9v9c0-5 6-9 13-9z"/></svg>
package/setup.js ADDED
@@ -0,0 +1,15 @@
1
+ // setup.js
2
+ module.exports = function (Handlebars) {
3
+ Handlebars.registerHelper('custom', function (context, options) {
4
+ const { exclude, message, subject, id, href } = context.hash
5
+ const excludeRegex = new RegExp(exclude)
6
+ const messageRegex = new RegExp(message)
7
+
8
+ const matchExclude = exclude && excludeRegex.test(subject)
9
+ const matchMessage = message && messageRegex.test(subject)
10
+
11
+ if (matchExclude || !matchMessage) return
12
+
13
+ return `- ${subject} [${id}](${href})`
14
+ })
15
+ }
@@ -0,0 +1,75 @@
1
+ const BASE_COLORS = {
2
+ GROWTH_DARK: '#EC6E0E',
3
+ GROWTH_MID: '#FF7D12',
4
+ GROWTH_LIGHT: '#FF9A47',
5
+ GROWTH_LIGHTER: '#FCE3CF',
6
+
7
+ NEUTRAL_LOW: '#333333',
8
+ NEUTRAL_DARKER: '#454545',
9
+ NEUTRAL_DARK: '#8E96A2',
10
+ NEUTRAL_MID: '#BFC4C9',
11
+ NEUTRAL_LIGHT: '#E2E5EA',
12
+ NEUTRAL_LIGHTER: '#F7F9FC',
13
+ NEUTRAL_HIGH: '#FFFFFF',
14
+
15
+ INFO_DARK: '#2E65E5',
16
+ INFO_MID: '#5F8EFF',
17
+
18
+ ALERT_DARK: '#cc0000',
19
+ ALERT_MID: '#FC0303',
20
+
21
+ ATTENTION_DARK: '#EBB400',
22
+ ATTENTION_MID: '#FFD600',
23
+
24
+ NICE_DARK: '#2BB048',
25
+ NICE_MID: '#40D05F',
26
+
27
+ BETTER_DARK: '#0D6320',
28
+ BETTER_MID: '#12872C',
29
+
30
+ DASHBOARD: {
31
+ CLOUDY_LIGHT: '#B4DAFB',
32
+ CLOUDY_MID: '#70B2EB',
33
+
34
+ GRASS_LIGHT: '#64DEA2',
35
+ GRASS_MID: '#2E9E67',
36
+
37
+ STRAWBERRY_LIGHT: '#FF6073',
38
+ STRAWBERRY_MID: '#F32039',
39
+
40
+ EVENING_LIGHT: '#808BB5',
41
+ EVENING_MID: '#586184',
42
+
43
+ BUBBLEGUM_LIGHT: '#F39EE9',
44
+ BUBBLEGUM_MID: '#E16BD3',
45
+
46
+ BLUEY_LIGHT: '#88A6FF',
47
+ BLUEY_MID: '#4F6DC4',
48
+
49
+ SUNBEAM_LIGHT: '#FBE15D',
50
+ SUNBEAM_MID: '#FFBA42',
51
+
52
+ POOLPARTY_LIGHT: '#76CDD6',
53
+ POOLPARTY_MID: '#35A5B1',
54
+
55
+ LAVENDER_LIGHT: '#AB9DF7',
56
+ LAVENDER_MID: '#8367E9',
57
+
58
+ PUMPKIN_LIGHT: '#FFB172',
59
+ PUMPKIN_MID: '#FF841F',
60
+ },
61
+ }
62
+
63
+ const COLOR_ALIASES = {
64
+ PRIMARY: BASE_COLORS.GROWTH_MID,
65
+ SECONDARY: BASE_COLORS.NEUTRAL_DARKER,
66
+
67
+ TEXT_PRIMARY: BASE_COLORS.NEUTRAL_DARKER,
68
+ TEXT_SECONDARY: BASE_COLORS.NEUTRAL_DARK,
69
+ TEXT_ACCENT: BASE_COLORS.GROWTH_MID,
70
+ }
71
+
72
+ export const COLORS = {
73
+ ...BASE_COLORS,
74
+ ...COLOR_ALIASES,
75
+ }
@@ -0,0 +1,9 @@
1
+ export const GRADIENTS = {
2
+ GROWTH_BACKGROUND:
3
+ 'linear-gradient(212.52deg, #FFFFFF 11.19%, #FDF4ED 66.29%);',
4
+
5
+ ALERT: 'linear-gradient(261.76deg, #FC0303 2.02%, #AF0808 98.77%);',
6
+ ATTENTION: 'linear-gradient(261.76deg, #FFB800 2.02%, #EA7306 98.77%);',
7
+ NICE: 'linear-gradient(261.76deg, #40D05F 2.02%, #159130 98.77%);',
8
+ BETTER: 'linear-gradient(261.76deg, #179733 2.02%, #016016 98.77%);',
9
+ }
@@ -0,0 +1,3 @@
1
+ export * from './base-colors'
2
+ export * from './gradients'
3
+ export * from './shadows'
@@ -0,0 +1,9 @@
1
+ export const SHADOWS = {
2
+ BOXES: '2px 2px 15px rgba(0, 0, 0, 0.08);',
3
+ POPUPS: '0px 0px 5px rgba(0, 0, 0, 0.2);',
4
+
5
+ HOVER: '1px 1px 2px rgba(0, 0, 0, 0.25), 2px 2px 10px rgba(0, 0, 0, 0.15);',
6
+
7
+ NAVBAR: '0px 1px 4px rgba(134, 21, 21, 0.15);',
8
+ SIDEBAR: '1px 0px 4px rgba(134, 21, 21, 0.15);',
9
+ }
@@ -0,0 +1,59 @@
1
+ import React from 'react'
2
+ import { Meta } from '@storybook/react/types-6-0'
3
+
4
+ import CheckboxComponent from './Checkbox'
5
+ import { DEFAULT_CHECKBOX_VARIANTS } from './Checkbox.variants'
6
+
7
+ type Props = React.ComponentProps<typeof CheckboxComponent>
8
+
9
+ export const Checkbox = (props: Props) => {
10
+ return <CheckboxComponent {...props} />
11
+ }
12
+
13
+ export default {
14
+ title: 'Inputs/Checkbox',
15
+ parameters: {
16
+ component: Checkbox,
17
+ },
18
+ args: {
19
+ variant: 'primary',
20
+ size: 'MD',
21
+ checked: false,
22
+ disabled: false,
23
+ error: false,
24
+ },
25
+ argTypes: {
26
+ variant: {
27
+ control: {
28
+ type: 'select',
29
+ options: Object.keys(DEFAULT_CHECKBOX_VARIANTS.color),
30
+ },
31
+ },
32
+ size: {
33
+ control: {
34
+ type: 'select',
35
+ options: Object.keys(DEFAULT_CHECKBOX_VARIANTS.size),
36
+ },
37
+ },
38
+ checked: {
39
+ control: {
40
+ type: 'boolean',
41
+ },
42
+ },
43
+ disabled: {
44
+ control: {
45
+ type: 'boolean',
46
+ },
47
+ },
48
+ error: {
49
+ control: {
50
+ type: 'boolean',
51
+ },
52
+ },
53
+ onCheckedChange: {
54
+ control: {
55
+ action: 'changed',
56
+ },
57
+ },
58
+ },
59
+ } as Meta
@@ -0,0 +1,84 @@
1
+ import styled from 'styled-components'
2
+
3
+ import * as RadixCheckbox from '@radix-ui/react-checkbox'
4
+
5
+ import { COLORS } from '@/colors'
6
+
7
+ export type StyledCheckboxProps = {
8
+ indicatorColor: string
9
+ indicatorHoverColor: string
10
+ indicatorActiveColor: string
11
+ boxColor: string
12
+ boxHoverColor: string
13
+ boxActiveColor: string
14
+ boxActiveHoverColor: string
15
+ borderColor: string
16
+ borderHoverColor: string
17
+ borderActiveColor: string
18
+ borderActiveHoverColor: string
19
+ error?: boolean
20
+ width: string
21
+ }
22
+
23
+ export const CheckboxContainer = styled(
24
+ RadixCheckbox.Root
25
+ )<StyledCheckboxProps>`
26
+ all: unset;
27
+ display: flex;
28
+ align-items: center;
29
+ justify-content: center;
30
+
31
+ transition: 0.1s ease-in-out;
32
+ width: ${(props) => props.width};
33
+ aspect-ratio: 1/1;
34
+
35
+ background-color: ${(props) => props.boxColor};
36
+ border: 1px solid ${(props) => props.borderColor};
37
+ border-radius: 3px;
38
+
39
+ outline: ${(props) =>
40
+ props.error ? `2px solid ${COLORS.ALERT_MID}` : 'none'};
41
+
42
+ :hover {
43
+ cursor: pointer;
44
+ background-color: ${(props) => props.boxHoverColor};
45
+ border-color: ${(props) => props.borderHoverColor};
46
+ }
47
+
48
+ &[data-state='checked'] {
49
+ background-color: ${(props) => props.boxActiveColor};
50
+ border-color: ${(props) => props.borderActiveColor};
51
+
52
+ :hover {
53
+ background-color: ${(props) => props.boxActiveHoverColor};
54
+ border-color: ${(props) => props.borderActiveHoverColor};
55
+ }
56
+ }
57
+
58
+ :disabled {
59
+ background-color: ${COLORS.NEUTRAL_MID};
60
+ border-color: ${COLORS.NEUTRAL_MID};
61
+
62
+ pointer-events: none;
63
+ }
64
+ `
65
+
66
+ export const CheckboxIndicator = styled(
67
+ RadixCheckbox.Indicator
68
+ )<StyledCheckboxProps>`
69
+ display: flex;
70
+ align-items: center;
71
+ justify-content: center;
72
+
73
+ aspect-ratio: 1/1;
74
+
75
+ * {
76
+ font-size: calc(${(props) => props.width} * 0.75);
77
+
78
+ color: ${(props) => props.indicatorColor};
79
+
80
+ &[data-state='checked'] {
81
+ color: ${(props) => props.indicatorActiveColor};
82
+ }
83
+ }
84
+ `
@@ -0,0 +1,33 @@
1
+ import React from 'react'
2
+ import { MdOutlineCheck } from 'react-icons/md'
3
+ import * as RadixCheckbox from '@radix-ui/react-checkbox'
4
+
5
+ import { DEFAULT_CHECKBOX_VARIANTS } from './Checkbox.variants'
6
+ import { CheckboxContainer, CheckboxIndicator } from './Checkbox.styles'
7
+
8
+ type RootCheckboxProps = React.ComponentProps<typeof RadixCheckbox.Root>
9
+ type CheckboxProps = {
10
+ variant?: keyof typeof DEFAULT_CHECKBOX_VARIANTS.color
11
+ size?: keyof typeof DEFAULT_CHECKBOX_VARIANTS.size
12
+ error?: boolean
13
+ } & RootCheckboxProps
14
+
15
+ const Checkbox = ({
16
+ variant = 'primary',
17
+ size = 'MD',
18
+ error = false,
19
+ ...props
20
+ }: CheckboxProps) => {
21
+ const colorProps = DEFAULT_CHECKBOX_VARIANTS.color[variant]
22
+ const sizeProps = DEFAULT_CHECKBOX_VARIANTS.size[size]
23
+
24
+ return (
25
+ <CheckboxContainer {...props} {...colorProps} {...sizeProps} error={error}>
26
+ <CheckboxIndicator {...colorProps} {...sizeProps}>
27
+ <MdOutlineCheck />
28
+ </CheckboxIndicator>
29
+ </CheckboxContainer>
30
+ )
31
+ }
32
+
33
+ export default Checkbox
@@ -0,0 +1,27 @@
1
+ import { COLORS } from '@/colors'
2
+
3
+ export const DEFAULT_CHECKBOX_VARIANTS = {
4
+ color: {
5
+ primary: {
6
+ indicatorColor: COLORS.NEUTRAL_HIGH,
7
+ indicatorHoverColor: COLORS.GROWTH_MID,
8
+ indicatorActiveColor: COLORS.GROWTH_MID,
9
+ boxColor: COLORS.NEUTRAL_HIGH,
10
+ boxHoverColor: COLORS.NEUTRAL_LIGHT,
11
+ boxActiveColor: COLORS.INFO_MID,
12
+ boxActiveHoverColor: COLORS.INFO_DARK,
13
+ borderColor: COLORS.NEUTRAL_DARK,
14
+ borderHoverColor: COLORS.NEUTRAL_DARK,
15
+ borderActiveColor: COLORS.INFO_MID,
16
+ borderActiveHoverColor: COLORS.INFO_DARK,
17
+ },
18
+ },
19
+ size: {
20
+ SM: {
21
+ width: '12px',
22
+ },
23
+ MD: {
24
+ width: '15px',
25
+ },
26
+ },
27
+ }