28 | {args.children} 29 |
30 |
4 |
5 | ---
6 | ## Summary
7 |
8 | - [About this template](#about-this-template)
9 | - [Avaliale scripts](#avaliale-scripts)
10 | - [Other scripts available](#other-scripts-available)
11 | - [Main technologies used](#main-technologies-used)
12 | - [radix](#radix)
13 | - [stitches](#stitches)
14 | - [storybook](#storybook)
15 | - [typescript](#typescript)
16 | - [About me](#about-me)
17 | - [#followMyWork](#followmywork)
18 |
19 | ## About this template
20 |
21 | This project is a template for NextJS with TypeScript projects. This template was built with `create-next-app`, `typescript`, `stitches`, `@radix-ui` and `storybook`.
22 |
23 | ---
24 |
25 | ## Avaliale scripts
26 |
27 | At first, in the project directory, you need run:
28 |
29 | ```jsx
30 | // installing the dependencies
31 | yarn
32 | ```
33 |
34 | ### Other scripts available
35 |
36 | ```jsx
37 | // run project on http://127.0.0.1:5173/
38 | yarn dev
39 | ```
40 |
41 | _Run the app in the development mode by opening [ http://localhost:3000/]( http://localhost:3000/) to view it in the browser. The page will reload if you make edits._
42 |
43 | ```jsx
44 | // build project
45 | yarn build
46 | ```
47 |
48 | ```jsx
49 | // preview project
50 | yarn start
51 | ```
52 | ```jsx
53 | // runs the linter in all src/ files
54 | yarn lint
55 | ```
56 |
57 | ```jsx
58 | // generate components quickly. e.g. to generate a component, run:
59 | yarn generate button
60 | ```
61 |
62 | ```jsx
63 | // run storybook on http://localhost:6006/
64 | yarn storybook
65 | ```
66 |
67 | see in production here
68 | 69 | --- 70 | 71 | _Learn how to install `yarn` through the [official documentation](https://yarnpkg.com/)._ 72 | 73 | --- 74 | 75 | ## Main technologies used 76 | 77 | - [x] NextJS 78 | - [x] TypeScript 79 | - [x] Stitches 80 | - [x] Radix UI Colors 81 | - [x] Storybook 82 | - [x] ESLint 83 | - [x] Prettier 84 | - [x] Husky 85 | - [x] Commitlint 86 | - [x] Lint-staged 87 | - [x] Light / Dark theme 88 | - [x] Automated component creation 89 | 90 | 91 | ### [radix ui colors](https://www.radix-ui.com/colors) 92 | > An open-source color system for designing beautiful, accessible websites and apps. 93 | 94 | ### [stitches](https://stitches.dev/) 95 | > CSS-in-JS with near-zero runtime, SSR, multi-variant support, and a best-in-class developer experience. 96 | 97 | ### [storybook](https://storybook.js.org/) 98 | > Storybook is a frontend workshop for building UI components and pages in isolation. 99 | 100 | ### [typescript](https://www.typescriptlang.org/) 101 | > TypeScript is JavaScript with syntax for types. 102 | 103 | --- 104 | 105 | ## About me 106 | 107 | I'm Diego Silva, Senior Frontend Developer at [Neon Bank](https://neon.com.br/) with focus on improving the Developer Experience and Community Manager at [@99juniors](https://github.com/99juniors). 108 | 109 | --- 110 | 111 | #### #followMyWork 112 | 113 | [](https://twitter.com/diegosilvatech) 114 | [](https://linkedin.com/in/diegosilvatech) 115 | [](https://linktr.ee/diegosilvatech) 116 | [](https://www.youtube.com/channel/UCECVV8ODiaQtur7EyS73i1g/videos) 117 | [](https://www.twitch.tv/diegosilvatech) 118 | [](https://discord.com/invite/P5YmPENeqd) -------------------------------------------------------------------------------- /src/styles/tokens/colors.ts: -------------------------------------------------------------------------------- 1 | import { 2 | violet, 3 | teal, 4 | blue, 5 | mauve, 6 | violetDark, 7 | tealDark, 8 | blueDark, 9 | mauveDark, 10 | pink, 11 | pinkDark, 12 | blackA, 13 | whiteA 14 | } from '@radix-ui/colors'; 15 | 16 | export type ColorCategoryTypes = 17 | | 'primary' 18 | | 'secondary' 19 | | 'tertiary' 20 | | 'quaternary' 21 | | 'natural'; 22 | 23 | export type PaletteTypes = { 24 | [key in ColorCategoryTypes]: { 25 | [key in string]: string; 26 | }; 27 | }; 28 | 29 | import { ThemeTypes } from 'styles/stitches.config'; 30 | 31 | const themes: { [key in ThemeTypes]: PaletteTypes } = { 32 | light: { 33 | primary: violet, 34 | secondary: teal, 35 | tertiary: blue, 36 | quaternary: pink, 37 | natural: mauve 38 | }, 39 | dark: { 40 | primary: violetDark, 41 | secondary: tealDark, 42 | tertiary: blueDark, 43 | quaternary: pinkDark, 44 | natural: mauveDark 45 | } 46 | }; 47 | 48 | const makePalette = (theme: ThemeTypes) => { 49 | const palette = themes[theme]; 50 | 51 | const base = { 52 | 'black-01': blackA.blackA1, 53 | 'black-02': blackA.blackA2, 54 | 'black-03': blackA.blackA3, 55 | 'black-04': blackA.blackA4, 56 | 'black-05': blackA.blackA5, 57 | 'black-06': blackA.blackA6, 58 | 'black-07': blackA.blackA7, 59 | 'black-08': blackA.blackA8, 60 | 'black-09': blackA.blackA9, 61 | 'black-10': blackA.blackA10, 62 | 'black-11': blackA.blackA11, 63 | 'black-12': blackA.blackA12, 64 | 65 | 'white-01': whiteA.whiteA1, 66 | 'white-02': whiteA.whiteA2, 67 | 'white-03': whiteA.whiteA3, 68 | 'white-04': whiteA.whiteA4, 69 | 'white-05': whiteA.whiteA5, 70 | 'white-06': whiteA.whiteA6, 71 | 'white-07': whiteA.whiteA7, 72 | 'white-08': whiteA.whiteA8, 73 | 'white-09': whiteA.whiteA9, 74 | 'white-10': whiteA.whiteA10, 75 | 'white-11': whiteA.whiteA11, 76 | 'white-12': whiteA.whiteA12 77 | }; 78 | 79 | const text = { 80 | 'text-contrast-high': palette.natural.mauve12, 81 | 'text-contrast-low': palette.natural.mauve11, 82 | 'text-black': blackA.blackA12, 83 | 'text-white': whiteA.whiteA12 84 | }; 85 | 86 | const primary = { 87 | 'primary-01': palette.primary.violet1, 88 | 'primary-02': palette.primary.violet2, 89 | 'primary-03': palette.primary.violet3, 90 | 'primary-04': palette.primary.violet4, 91 | 'primary-05': palette.primary.violet5, 92 | 'primary-06': palette.primary.violet6, 93 | 'primary-07': palette.primary.violet7, 94 | 'primary-08': palette.primary.violet8, 95 | 'primary-09': palette.primary.violet9, 96 | 'primary-10': palette.primary.violet10, 97 | 'primary-11': palette.primary.violet11, 98 | 'primary-12': palette.primary.violet12 99 | }; 100 | 101 | const secondary = { 102 | 'secondary-01': palette.secondary.teal1, 103 | 'secondary-02': palette.secondary.teal2, 104 | 'secondary-03': palette.secondary.teal3, 105 | 'secondary-04': palette.secondary.teal4, 106 | 'secondary-05': palette.secondary.teal5, 107 | 'secondary-06': palette.secondary.teal6, 108 | 'secondary-07': palette.secondary.teal7, 109 | 'secondary-08': palette.secondary.teal8, 110 | 'secondary-09': palette.secondary.teal9, 111 | 'secondary-10': palette.secondary.teal10, 112 | 'secondary-11': palette.secondary.teal11, 113 | 'secondary-12': palette.secondary.teal12 114 | }; 115 | 116 | const tertiary = { 117 | 'tertiary-01': palette.tertiary.blue1, 118 | 'tertiary-02': palette.tertiary.blue2, 119 | 'tertiary-03': palette.tertiary.blue3, 120 | 'tertiary-04': palette.tertiary.blue4, 121 | 'tertiary-05': palette.tertiary.blue5, 122 | 'tertiary-06': palette.tertiary.blue6, 123 | 'tertiary-07': palette.tertiary.blue7, 124 | 'tertiary-08': palette.tertiary.blue8, 125 | 'tertiary-09': palette.tertiary.blue9, 126 | 'tertiary-10': palette.tertiary.blue10, 127 | 'tertiary-11': palette.tertiary.blue11, 128 | 'tertiary-12': palette.tertiary.blue12 129 | }; 130 | 131 | const quaternary = { 132 | 'quaternary-01': palette.quaternary.pink1, 133 | 'quaternary-02': palette.quaternary.pink2, 134 | 'quaternary-03': palette.quaternary.pink3, 135 | 'quaternary-04': palette.quaternary.pink4, 136 | 'quaternary-05': palette.quaternary.pink5, 137 | 'quaternary-06': palette.quaternary.pink6, 138 | 'quaternary-07': palette.quaternary.pink7, 139 | 'quaternary-08': palette.quaternary.pink8, 140 | 'quaternary-09': palette.quaternary.pink9, 141 | 'quaternary-10': palette.quaternary.pink10, 142 | 'quaternary-11': palette.quaternary.pink11, 143 | 'quaternary-12': palette.quaternary.pink12 144 | }; 145 | 146 | return { 147 | ...base, 148 | ...primary, 149 | ...secondary, 150 | ...tertiary, 151 | ...quaternary, 152 | ...text 153 | }; 154 | }; 155 | 156 | export const colors = { 157 | dark: makePalette('dark'), 158 | light: makePalette('light') 159 | }; 160 | --------------------------------------------------------------------------------