27 |
28 | // export const getCssText = (t: FiTheme = initialTheme) => {
29 | // const mergedTheme = deepMerge(initialTheme, t)
30 | // mergedTheme.colors = recalculateColors(mergedTheme.colors || {})
31 | // const stitches = createStitches({
32 | // theme: mergedTheme,
33 | // media,
34 | // })
35 | // return stitches.getCssText
36 | // }
37 |
--------------------------------------------------------------------------------
/packages/@finetwork:ui/src/types/boolean-string.ts:
--------------------------------------------------------------------------------
1 | export type BooleanString = boolean | 'false' | 'true'
2 |
--------------------------------------------------------------------------------
/packages/@finetwork:ui/src/types/enhancer.ts:
--------------------------------------------------------------------------------
1 | import { ReactNode } from 'react'
2 |
3 | export type Enhancer = ReactNode | string
4 |
--------------------------------------------------------------------------------
/packages/@finetwork:ui/src/types/fonts.ts:
--------------------------------------------------------------------------------
1 | export enum FONT {
2 | primary = 'primary',
3 | secondary = 'secondary',
4 | tertiary = 'tertiary',
5 | }
6 |
7 | export type FONTS = keyof typeof FONT
8 |
--------------------------------------------------------------------------------
/packages/@finetwork:ui/src/types/index.ts:
--------------------------------------------------------------------------------
1 | export * from './kind'
2 | export * from './enhancer'
3 | export * from './size'
4 | export * from './orientation'
5 | export * from './placement'
6 | export * from './boolean-string'
7 | export * from './fonts'
8 |
--------------------------------------------------------------------------------
/packages/@finetwork:ui/src/types/kind.ts:
--------------------------------------------------------------------------------
1 | export enum KIND {
2 | primary = 'primary',
3 | secondary = 'secondary',
4 | tertiary = 'tertiary',
5 | }
6 |
7 | export type KINDS = keyof typeof KIND
8 |
--------------------------------------------------------------------------------
/packages/@finetwork:ui/src/types/orientation.ts:
--------------------------------------------------------------------------------
1 | export enum ORIENTATION {
2 | horizontal = 'horizontal',
3 | vertical = 'vertical',
4 | }
5 |
6 | export type ORIENTATIONS = keyof typeof ORIENTATION
7 |
--------------------------------------------------------------------------------
/packages/@finetwork:ui/src/types/placement.ts:
--------------------------------------------------------------------------------
1 | export type Placement =
2 | | 'auto-start'
3 | | 'auto'
4 | | 'auto-end'
5 | | 'top-start'
6 | | 'top'
7 | | 'top-end'
8 | | 'right-start'
9 | | 'right'
10 | | 'right-end'
11 | | 'bottom-end'
12 | | 'bottom'
13 | | 'bottom-start'
14 | | 'left-end'
15 | | 'left'
16 | | 'left-start'
17 |
--------------------------------------------------------------------------------
/packages/@finetwork:ui/src/types/size.ts:
--------------------------------------------------------------------------------
1 | export enum SIZE {
2 | small = 'small',
3 | medium = 'medium',
4 | large = 'large',
5 | }
6 |
7 | export const mediaQuery = {
8 | mobile: 360,
9 | tablet: 480,
10 | tabletXl: 768,
11 | desktop: 1024,
12 | desktopXl: 1280,
13 | desktop2Xl: 1600,
14 | }
15 |
16 | export type SIZES = keyof typeof SIZE
17 |
18 | export enum DIALOG_SIZE {
19 | default = 'default',
20 | auto = 'auto',
21 | full = 'full',
22 | }
23 |
24 | export type DIALOG_SIZES = keyof typeof DIALOG_SIZE
25 |
--------------------------------------------------------------------------------
/packages/@finetwork:ui/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "emitDeclarationOnly": true,
5 | "composite": true,
6 | "declaration": true,
7 | "outDir": "dist"
8 | },
9 | "include": ["src/**/*.ts", "src/**/*.tsx"],
10 | "exclude": ["node_modules"]
11 | }
12 |
--------------------------------------------------------------------------------
/packages/website/next-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
4 | // NOTE: This file should not be edited
5 | // see https://nextjs.org/docs/basic-features/typescript for more information.
6 |
--------------------------------------------------------------------------------
/packages/website/next.config.js:
--------------------------------------------------------------------------------
1 | const compose = require('compose-function')
2 | const { withDokz } = require('dokz/dist/plugin')
3 | const withTM = require('next-transpile-modules')([
4 | '@finetwork/ui',
5 | '@finetwork/ui-sections',
6 | ])
7 |
8 | const composed = compose(withDokz, withTM)
9 |
10 | module.exports = composed({
11 | pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
12 | })
13 |
--------------------------------------------------------------------------------
/packages/website/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "website",
3 | "version": "0.1.0",
4 | "scripts": {
5 | "dev": "./node_modules/.bin/next dev",
6 | "build": "./node_modules/.bin/next build",
7 | "start": "./node_modules/.bin/next start"
8 | },
9 | "dependencies": {
10 | "@chakra-ui/react": "latest",
11 | "@emotion/react": "latest",
12 | "@emotion/styled": "latest",
13 | "@finetwork/ui": "1.3.23",
14 | "@finetwork/ui-sections": "0.2.0",
15 | "@stitches/react": "1.2.8",
16 | "dokz": "2.0.7",
17 | "framer-motion": "latest",
18 | "next": "latest",
19 | "next-compose-plugins": "^2.2.1",
20 | "next-transpile-modules": "^8.0.0",
21 | "polished": "4.2.2",
22 | "react": ">=17.0.0",
23 | "react-dom": "^17.0.2",
24 | "react-icons": "^4.2.0"
25 | },
26 | "devDependencies": {
27 | "@types/react": "^17.0.3",
28 | "compose-function": "^3.0.3",
29 | "typescript": "4.8.4"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/packages/website/pages/_app.jsx:
--------------------------------------------------------------------------------
1 | import '../styles/globals.css'
2 |
3 | import { ColorModeSwitch, DokzProvider, GithubLink } from 'dokz'
4 | import { H2, H3, H4 } from '@finetwork/ui'
5 |
6 | import { ChakraProvider } from '@chakra-ui/react'
7 | import Head from 'next/head'
8 | import Link from 'next/link'
9 |
10 | export default function App(props) {
11 | const { Component, pageProps } = props
12 | return (
13 |
14 |
15 |
20 |
21 |
26 |
27 |
28 |
29 |
32 |
33 | Finetwork UI
34 |
35 |
36 | }
37 | headerItems={[
38 | ,
39 |
41 | setModeTheme((prev) => (prev === 'light' ? 'dark' : 'light'))
42 | }
43 | >
44 |
45 |
,
46 | ]}
47 | sidebarOrdering={{
48 | 'index.mdx': true,
49 | 'getting-started.mdx': true,
50 | components: {
51 | 'accordion.mdx': true,
52 | 'button.mdx': true,
53 | 'card.mdx': true,
54 | 'checkbox.mdx': true,
55 | 'dialog.mdx': true,
56 | 'dropdown-menu.mdx': true,
57 | 'input.mdx': true,
58 | 'link.mdx': true,
59 | 'loading.mdx': true,
60 | 'radio.mdx': true,
61 | 'select.mdx': true,
62 | 'separator.mdx': true,
63 | 'skeleton.mdx': true,
64 | 'switch.mdx': true,
65 | 'tabs.mdx': true,
66 | 'tag.mdx': true,
67 | 'textarea.mdx': true,
68 | 'toast.mdx': true,
69 | 'tooltip.mdx': true,
70 | 'typography.mdx': true,
71 | },
72 | sections: {
73 | 'price-card.mdx': true,
74 | },
75 | }}
76 | >
77 |
78 |
79 |
80 | )
81 | }
82 |
--------------------------------------------------------------------------------
/packages/website/pages/_document.js:
--------------------------------------------------------------------------------
1 | import { getCssText } from '../styles/stitches.config'
2 | import { getCssText as getCssTextFiUi } from '@finetwork/ui'
3 | import { Html, Head, Main, NextScript } from 'next/document'
4 |
5 | export default function Document() {
6 | return (
7 |
8 |
9 |
13 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | )
24 | }
25 |
--------------------------------------------------------------------------------
/packages/website/pages/components/accordion.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Accordion
3 | ---
4 |
5 | import { Playground } from 'dokz'
6 | import { styles } from '../../styles.ts'
7 | import {
8 | Accordion,
9 | AccordionItem,
10 | AccordionContent,
11 | AccordionTrigger,
12 | H2,
13 | Paragraph4,
14 | Link,
15 | } from '@finetwork/ui'
16 |
17 |
18 |
19 |
Accordion
20 |
21 |
22 |
23 | Accordion component admit kind prop to style header
24 |
25 |
26 | You can customize your button whatever you want, even you can set css
27 | property to override styles if you need.
28 |
29 |
30 | This component is an implementation of{' '}
31 |
36 | Accordion component
37 | {' '}
38 | from radix-ui.
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | Is it accessible?
47 |
48 | Yes. It adheres to the WAI-ARAI design pattern.
49 |
50 |
51 |
52 | Is it unstyled?
53 |
54 | Yes. It's unstyled by default, giving you freedom over the look and
55 | feel. Yes. It's unstyled by default, giving you freedom over the look
56 | and feel. Yes. It's unstyled by default, giving you freedom over the
57 | look and feel. Yes. It's unstyled by default, giving you freedom over
58 | the look and feel. Yes. It's unstyled by default, giving you freedom
59 | over the look and feel.
60 |
61 |
62 |
63 | Can it be animated?
64 |
65 | Yes! You can animate the Accordion with CSS or JavaScript.
66 |
67 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/packages/website/pages/components/button.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Button
3 | ---
4 |
5 | import { Playground } from 'dokz'
6 | import {
7 | Button,
8 | H2,
9 | H3,
10 | Paragraph4,
11 | Pencil2Icon,
12 | PersonIcon,
13 | } from '@finetwork/ui'
14 | import { styles } from '../../styles.ts'
15 |
16 |
17 |
18 |
Button
19 |
20 |
21 |
22 |
23 | Button component admit such props like kind, variant, size, etc. You can
24 | customize your button whatever you want, even you can set css
25 | property to override styles if you need.
26 |
27 |
28 |
29 |
30 |
Kind
31 |
32 |
33 |
34 |
35 | Primary
36 | Secondary
37 | Tertiary
38 |
39 |
40 |
41 |
42 |
Font
43 |
44 |
45 |
46 |
47 | Default (primary)
48 | Primary
49 | Secondary
50 |
51 |
52 |
53 |
54 |
Variant
55 |
56 |
57 |
58 |
59 | Default
60 | Outline
61 |
62 |
63 |
64 |
65 |
Size
66 |
67 |
68 |
69 |
70 | Small
71 | Medium
72 | Large
73 |
74 |
75 |
76 |
77 |
Shapes
78 |
79 |
80 |
81 |
82 | Default
83 | Pill
84 | Round
85 | Circle
86 | Square
87 |
88 |
89 |
90 |
91 |
isLoading
92 |
93 |
94 |
95 |
96 | Default
97 |
98 |
99 |
100 |
101 |
isSelected
102 |
103 |
104 |
105 |
106 | Selected
107 |
108 |
109 |
110 |
111 |
startEnhancer && endEnhancer
112 |
113 |
114 |
115 |
116 | Editar
117 | Mi perfil
118 |
119 |
120 |
121 |
122 |
Overrides
123 |
124 |
125 |
126 |
127 | You can customize your button whatever you want, even you can set css
128 | property to override styles if you need.
129 |
130 |
131 |
132 |
133 |
134 |
146 | Editar
147 |
148 |
149 |
150 |
--------------------------------------------------------------------------------
/packages/website/pages/components/card.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Card
3 | ---
4 |
5 | import { Playground } from 'dokz'
6 | import {
7 | Card,
8 | CardHeader,
9 | CardBody,
10 | CardFooter,
11 | Button,
12 | H2,
13 | } from '@finetwork/ui'
14 |
15 | export const styles = {
16 | maxWidth: '1000px',
17 | padding: '2em',
18 | display: 'flex',
19 | justifyContent: 'center',
20 | alignItems: 'center',
21 | backgroundColor: '#EFF2FC',
22 | }
23 |
24 |
25 |
26 |
Card hoverAnimation
27 |
28 |
29 |
30 |
51 | Fibra 600Mb
52 |
53 |
59 | 14'90€
60 |
61 |
62 |
63 |
64 | La quiero
65 |
66 |
67 |
68 |
69 |
70 | ```jsx
71 |
72 |
93 | Fibra 600Mb
94 |
95 |
101 | 14'90€
102 |
103 |
104 |
105 |
106 | La quiero
107 |
108 |
109 |
110 |
111 | ```
112 |
113 |
114 |
Card without animation
115 |
116 |
117 |
118 |
126 | Fibra 600Mb
127 |
128 |
134 | 14'90€
135 |
136 |
137 |
138 | La quiero
139 |
140 |
141 |
142 |
143 | ```jsx
144 |
145 |
153 | Fibra 600Mb
154 |
155 |
161 | 14'90€
162 |
163 |
164 |
165 | La quiero
166 |
167 |
168 |
169 | ```
170 |
--------------------------------------------------------------------------------
/packages/website/pages/components/dropdown-menu.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Dropdown Menu
3 | ---
4 |
5 | import { Playground, TableOfContents } from 'dokz'
6 | import {
7 | DropdownMenu,
8 | DropdownMenuTrigger,
9 | DropdownMenuContent,
10 | DropdownMenuItem,
11 | DropdownMenuSeparator,
12 | DropdownMenuCheckboxItem,
13 | DropdownMenuItemIndicator,
14 | H2,
15 | Paragraph4,
16 | Link,
17 | Button,
18 | CheckIcon,
19 | HamburgerIcon,
20 | } from '@finetwork/ui'
21 |
22 |
23 |
24 |
Dropdown Menu
25 |
26 |
27 |
28 | This component is an implementation of{' '}
29 |
34 | Dropdown Menu component
35 | {' '}
36 | from radix-ui.
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | New Tab
49 | New Window
50 | New Private Window
51 |
52 |
53 |
54 |
55 |
56 | Show Bookmarks
57 |
58 |
59 |
60 |
61 |
62 | Show Full URLs
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/packages/website/pages/components/input.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Input
3 | ---
4 |
5 | import { Playground } from 'dokz'
6 | import {
7 | Input,
8 | H2,
9 | H3,
10 | Paragraph4,
11 | SunIcon,
12 | EnvelopeClosedIcon,
13 | } from '@finetwork/ui'
14 |
15 | export const styles = {
16 | maxWidth: '1000px',
17 | padding: '2em',
18 | display: 'grid',
19 | gap: '1em',
20 | }
21 |
22 |
23 |
24 |
Input
25 |
26 |
27 |
28 | Input component admit such props like size, kind, etc. You can customize your
29 | input whatever you want, even you can set css property to override
30 | styles if you need.
31 |
32 |
33 |
34 |
Kind
35 |
36 |
37 |
38 | String. Possible values primary , secondary , tertiary
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
Size
51 |
52 |
53 |
54 |
55 | String. Possible values small , medium , large
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
Label
69 |
70 |
71 |
72 |
String. Required _id_ to work correctly.
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
StartEnhancer
83 |
84 |
85 |
86 |
ReactNode or String.
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
EndEnhancer
97 |
98 |
99 |
100 |
ReactNode or String.
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
Type password
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
Type tel
121 |
122 |
123 |
124 | {() => {
125 | const App = () => {
126 | const [value, setValue] = React.useState('666666666')
127 | return (
128 |
129 |
130 |
131 | )
132 | }
133 | return
134 | }}
135 |
136 |
137 |
138 |
Disabled
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
Info message
149 |
150 |
151 |
152 |
153 |
158 |
159 |
160 |
161 |
162 |
Error message
163 |
164 |
165 |
166 |
167 |
173 |
174 |
175 |
176 |
177 |
Success
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
HandleClear
188 |
189 |
190 |
191 | {() => {
192 | const App = () => {
193 | const [value, setValue] = React.useState('sant@gmail')
194 | const inputRef = React.useRef(null)
195 | const inputRef2 = React.useRef(null)
196 | function handleChange(e) {
197 | setValue(e.target.value)
198 | }
199 | function handleClear() {
200 | setValue('')
201 | if (inputRef) inputRef.current.focus()
202 | }
203 | return (
204 |
205 |
214 |
215 | )
216 | }
217 | return
218 | }}
219 |
220 |
--------------------------------------------------------------------------------
/packages/website/pages/components/link.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Link
3 | ---
4 |
5 | import { Playground } from 'dokz'
6 | import {
7 | Link,
8 | H2,
9 | H3,
10 | Paragraph4,
11 | RocketIcon,
12 | ArrowRightIcon,
13 | } from '@finetwork/ui'
14 | import { styles } from '../../styles.ts'
15 |
16 |
17 |
18 |
Link
19 |
20 |
21 |
22 | Link component admit such props like kind, href, etc. You can customize your
23 | link whatever you want, even you can set css property to override
24 | styles if you need.
25 |
26 |
27 |
28 |
Default
29 |
30 |
31 |
32 |
33 | Active
34 |
35 | Disabled
36 |
37 |
38 |
39 |
40 |
41 |
Kind
42 |
43 |
44 | Possible values primary, secondary, tertiary
45 |
46 |
47 |
48 |
49 | Primary
50 |
51 |
52 | Secondary
53 |
54 |
55 | Tertiary
56 |
57 |
58 |
59 |
60 |
61 |
Size
62 |
63 |
64 | Possible values small, medium, large
65 |
66 |
67 |
68 |
69 | Small
70 |
71 |
72 | Medium
73 |
74 |
75 | Large
76 |
77 |
78 |
79 |
80 |
81 |
TextTransform
82 |
83 |
84 |
85 | Possible values uppercase, lowercase, capitalize, none, full-size-kana,
86 | full-width
87 |
88 |
89 |
90 |
91 |
92 | uppercase
93 |
94 |
95 | lowercase
96 |
97 |
98 | capitalize
99 |
100 |
101 | none
102 |
103 |
104 |
105 |
106 |
107 |
startEnhancer && endEnhancer
108 |
109 |
110 |
111 |
112 |
113 | Añadir cupón descuento
114 |
115 |
116 | Ver todas las tarifas
117 |
118 |
119 |
120 |
121 |
122 |
Overrides
123 |
124 |
125 |
126 | You can customize your link whatever you want, even you can set css
127 | property to override styles if you need.
128 |
129 |
130 |
131 |
132 |
144 | Link personalizado
145 |
146 |
147 |
148 |
--------------------------------------------------------------------------------
/packages/website/pages/components/separator.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Separator
3 | ---
4 |
5 | import { Playground } from 'dokz'
6 | import { Separator, H2, H3, Paragraph4 } from '@finetwork/ui'
7 |
8 | export const styles = {
9 | maxWidth: '1000px',
10 | padding: '2em',
11 | display: 'flex',
12 | flexDirection: 'column',
13 | alignItems: 'center',
14 | justifyContent: 'space-around',
15 | }
16 |
17 |
18 |
19 |
Separator
20 |
21 |
22 | This component is an implementation of a custom html hr
23 |
24 |
25 |
Orientation
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
Kind
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
Color
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
Width & Height
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
Type
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
Align
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
Border Radius
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 | Separator Props
102 |
103 |
104 |
105 | Name
106 | Type
107 | Default
108 | Description
109 |
110 |
111 |
112 |
113 | id
114 | string
115 |
116 | ID of the element
117 |
118 |
119 | orientation
120 | horizontal | vertical
121 | horizontal
122 | Set orientation
123 |
124 |
125 | kind
126 | primary | secondary | tertiary
127 |
128 | Set separator color kind
129 |
130 |
131 | color
132 | string
133 | #ddd
134 | Set color
135 |
136 |
137 | width
138 | string
139 | 100%
140 | Set width
141 |
142 |
143 | height
144 | string
145 |
146 | Set height
147 |
148 |
149 | type
150 | solid | dashed | dotted
151 | solid
152 | Set type of border style
153 |
154 |
155 | align
156 | start | center | left
157 | center
158 | Set align
159 |
160 |
161 | borderRadius
162 | string
163 |
164 | Set border radius
165 |
166 |
167 |
168 |
--------------------------------------------------------------------------------
/packages/website/pages/components/skeleton.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Skeleton
3 | ---
4 |
5 | import { Playground } from 'dokz'
6 | import { Skeleton, H3, Paragraph4, H1, H4 } from '@finetwork/ui'
7 |
8 | export const styles = {
9 | maxWidth: '1000px',
10 | padding: '2em',
11 | display: 'flex',
12 | justifyContent: 'center',
13 | gap: '2rem',
14 | alignItems: 'center',
15 | fontSize: '2rem',
16 | }
17 |
18 |
19 |
Skeleton
20 |
21 |
22 |
23 | This component is an implementation of a custom skeleton loader
24 |
25 |
26 |
27 |
Width and Height
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
Kind
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
BackgroundColor and AnimationColor
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
Group
64 |
65 |
66 |
67 |
68 |
73 |
74 |
75 |
76 |
77 |
Border Radius
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
Align
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
Chart
102 |
103 |
104 |
105 |
106 |
107 | 20GB
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
Children
116 |
117 |
118 |
119 |
120 | Hello
121 |
122 |
123 |
124 | Skeleton Props
125 |
126 |
127 |
128 | Name
129 | Type
130 | Default
131 | Required
132 | Description
133 |
134 |
135 |
136 |
137 | backgroundColor
138 | string
139 | rgb(238, 238, 238)
140 | No
141 | Color of background
142 |
143 |
144 | animationColor
145 | string
146 | rgb(246, 246, 246)
147 | No
148 | Color of animation
149 |
150 |
151 | width
152 | number | string
153 |
154 | No
155 | Set defined width component
156 |
157 |
158 | height
159 | number | string
160 |
161 | No
162 | Set defined height component
163 |
164 |
165 | kind
166 | 'primary' | 'secondary'
167 | primary
168 | No
169 | Set style depending on kind
170 |
171 |
172 | borderRadius
173 | string
174 | 5px
175 | No
176 | Set defined border radius style
177 |
178 |
179 | Align
180 | string
181 | start
182 | No
183 | Set defined justify-content
184 |
185 |
186 | group
187 | direction: 'vertical' | 'horizontal'; repeat: number; gap: string
188 |
189 | No
190 |
191 | Allows to repeat one element multiple times and display using rows or
192 | columns
193 |
194 |
195 |
196 | chart
197 | size: 'small' | 'medium' | 'large'; backgroundInnerCircle: string
198 | small && '#fff'
199 | No
200 | Set size and inner background of chart
201 |
202 |
203 |
204 |
--------------------------------------------------------------------------------
/packages/website/pages/components/textarea.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Textarea
3 | ---
4 |
5 | import { Playground } from 'dokz'
6 | import { Textarea, H2, H3, Paragraph4 } from '@finetwork/ui'
7 |
8 | export const styles = {
9 | maxWidth: '1000px',
10 | padding: '2em',
11 | display: 'grid',
12 | gap: '1em',
13 | }
14 |
15 |
16 |
17 |
Textarea
18 |
19 |
20 |
21 | Textarea component admit such props like size, kind, etc. You can customize
22 | your textarea whatever you want, even you can set css property to
23 | override styles if you need.
24 |
25 |
26 |
27 |
Resize
28 |
29 |
30 | Boolean
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
Rows
40 |
41 |
42 | Number of rows of textarea
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
Kind
54 |
55 |
56 |
57 | String. Possible values primary , secondary , tertiary
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
Size
70 |
71 |
72 |
73 |
74 | String. Possible values small , medium , large
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
Label
88 |
89 |
90 |
91 |
String. Required _id_ to work correctly.
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
Disabled
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
Info message
112 |
113 |
114 |
115 |
116 |
121 |
122 |
123 |
124 |
125 |
Error message
126 |
127 |
128 |
129 |
130 |
135 |
136 |
137 |
138 |
139 |
Success
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
--------------------------------------------------------------------------------
/packages/website/pages/components/tooltip.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Tooltip
3 | ---
4 |
5 | import { Playground } from 'dokz'
6 | import {
7 | Tooltip,
8 | TooltipTrigger,
9 | TooltipContent,
10 | H2,
11 | Paragraph4,
12 | Link,
13 | } from '@finetwork/ui'
14 |
15 |
16 |
17 |
Tooltip
18 |
19 |
20 |
21 | This component is an implementation of{' '}
22 |
27 | Tooltip component
28 | {' '}
29 | from radix-ui.
30 |
31 |
32 |
33 |
34 |
35 | Hover me!
36 | Add to library
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/packages/website/pages/components/typography.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Typography
3 | ---
4 |
5 | import { Playground } from 'dokz'
6 | import {
7 | H1,
8 | H2,
9 | H3,
10 | H4,
11 | H5,
12 | H6,
13 | Paragraph1,
14 | Paragraph2,
15 | Paragraph3,
16 | Paragraph4,
17 | Paragraph5,
18 | Paragraph6,
19 | } from '@finetwork/ui'
20 | import { styles } from '../../styles.ts'
21 |
22 |
23 |
24 |
Typography
25 |
26 |
27 |
28 | Typography components are components to use in order to heading tags
29 | (h1, h2, etc) and p tag
30 |
31 |
32 |
33 | Typography components admits color prop. Possible values
34 | (primary, secondary, tertiary) (defaults to primary).
35 |
36 |
37 |
38 |
Headings
39 |
40 |
41 |
42 |
H1
43 |
44 |
45 |
46 | Title
47 |
48 |
49 |
50 |
H2
51 |
52 |
53 |
54 | Title
55 |
56 |
57 |
58 |
H3
59 |
60 |
61 |
62 | Title
63 |
64 |
65 |
66 |
H4
67 |
68 |
69 |
70 | Title
71 |
72 |
73 |
74 |
H5
75 |
76 |
77 |
78 | Title
79 |
80 |
81 |
82 |
H6
83 |
84 |
85 |
86 | Title
87 |
88 |
89 |
90 |
Paragraphs
91 |
92 |
93 |
94 |
Paragraph1
95 |
96 |
97 |
98 | Title
99 |
100 |
101 |
102 |
Paragraph2
103 |
104 |
105 |
106 | Title
107 |
108 |
109 |
110 |
Paragraph3
111 |
112 |
113 |
114 | Title
115 |
116 |
117 |
118 |
Paragraph4
119 |
120 |
121 |
122 | Title
123 |
124 |
125 |
126 |
Paragraph5
127 |
128 |
129 |
130 | Title
131 |
132 |
133 |
134 |
Paragraph6
135 |
136 |
137 |
138 | Title
139 |
140 |
141 |
142 |
Overrides
143 |
144 |
145 |
146 | You can customize your typography component whatever you want, even you can
147 | set css property to override styles if you need.
148 |
149 |
150 |
151 | Override
152 |
153 |
--------------------------------------------------------------------------------
/packages/website/pages/getting-started.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Getting started
3 | ---
4 |
5 | import { Playground } from 'dokz'
6 | import { H2, Paragraph4, Link, H3 } from '@finetwork/ui'
7 |
8 |
9 |
10 |
Getting started
11 |
12 |
13 |
Install
14 |
15 |
16 | Using npm
17 |
18 | ```
19 | npm i @finetwork/ui react
20 | ```
21 |
22 | Or yarn
23 |
24 | ```
25 | yarn add @finetwork/ui react
26 | ```
27 |
28 |
29 | First declare your theme, then you need to follow the next steps to add styles
30 | to your app
31 |
32 |
33 | ```js
34 | const theme = {
35 | colors: {
36 | linkText: '#5F3DFF',
37 | primary: '#bf3fa1',
38 | primaryText: '#000',
39 | primaryButtonText: '#fff',
40 | primary100: '...',
41 | .
42 | .
43 | secondary: '#5F3DFF',
44 | secondaryText: '#fff',
45 | secondaryButtonText: '#fff',
46 | secondary100: '#F4F2FF',
47 | .
48 | .
49 | tertiary: '#FA9A1D',
50 | tertiaryText: '#000',
51 | tertiaryButtonText: '#000',
52 | tertiary100: '#FFF8F0',
53 | .
54 | .
55 | },
56 | fonts: {
57 | primary: 'Nunito Sans, apple-system, sans-serif',
58 | secondary: 'Druk, monospace',
59 | },
60 | }
61 | ```
62 |
63 |
64 |
Client side
65 |
66 |
67 |
68 | Wrap your application with ThemeProvider component from @finetwork/ui
69 |
70 |
71 | ```jsx
72 | export default function App() {
73 | return (
74 |
75 |
76 |
77 | )
78 | }
79 | ```
80 |
81 |
82 |
Server side
83 |
84 |
85 |
86 | Get css string with method getCssString passing your theme and set css
87 | string in your style tag
88 |
89 |
90 | ```jsx
91 | export default function App = () => {
92 | return (
93 | <>
94 |
95 |
99 |
100 |
101 | >
102 | )
103 | }
104 | ```
105 |
--------------------------------------------------------------------------------
/packages/website/pages/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: Introduction
3 | ---
4 |
5 | import { Playground } from 'dokz'
6 | import { H2, Paragraph4, Link } from '@finetwork/ui'
7 |
8 |
9 |
10 |
Introduction
11 |
12 |
13 |
14 | React components library, initially for{' '}
15 |
16 | Finetwork
17 | {' '}
18 | projects. Built on top of{' '}
19 |
24 | Radix-UI
25 | {' '}
26 | primitive components as base components) in order to have accessible
27 | components, and{' '}
28 |
29 | Stitches
30 | {' '}
31 | for styling.
32 |
33 |
34 |
35 | As @finetwork/ui uses stitches for styling, there are reserved css vars like
36 | --colors-primary , --colors-secondary etc.
37 |
38 |
--------------------------------------------------------------------------------
/packages/website/pages/sections/price-card-horizontal.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: PriceCardHorizontal
3 | ---
4 |
5 | import { Playground } from 'dokz'
6 | import { PriceCardHorizontal } from '@finetwork/ui-sections'
7 | import { Link } from '@finetwork/ui'
8 |
9 |
10 |
11 |
16 | {Array(2)
17 | .fill('')
18 | .map((el, index) => (
19 |
36 | ))}
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/packages/website/pages/sections/price-card.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | name: PriceCard
3 | ---
4 |
5 | import { Playground } from 'dokz'
6 | import { PriceCard } from '@finetwork/ui-sections'
7 | import { Link } from '@finetwork/ui'
8 |
9 |
10 |
11 |
16 | {Array(2)
17 | .fill('')
18 | .map((el, index) => (
19 |
alert('click!'),
48 | }}
49 | footerLink={{
50 | href: '#',
51 | label: 'Ver detalles de la tarifa',
52 | LinkComponent: Link,
53 | }}
54 | />
55 | ))}
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/packages/website/playgrounds/ToastPlayground.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Button,
3 | H4,
4 | Toast,
5 | ToastProvider,
6 | CheckIcon,
7 | EyeClosedIcon,
8 | } from '@finetwork/ui'
9 | import { useState } from 'react'
10 | import { styled } from '../styles/stitches.config'
11 |
12 | const kinds = [
13 | 'primary',
14 | 'secondary',
15 | 'tertiary',
16 | 'success',
17 | 'warning',
18 | 'error',
19 | 'info',
20 | ]
21 |
22 | const StyledContainer = styled('div', {
23 | display: 'grid',
24 | gridAutoFlow: 'column',
25 | alignItems: 'center',
26 | gap: '70px',
27 | justifyContent: 'space-around',
28 | padding: '0px 30px',
29 | })
30 |
31 | export const StyledButton = styled(Button, {
32 | margin: '0.1rem 1rem',
33 | variants: {
34 | button: {
35 | primary: {},
36 | },
37 | },
38 | compoundVariants: [
39 | {
40 | button: 'primary',
41 | css: {
42 | backgroundColor: '#fff',
43 | '&:hover': {
44 | backgroundColor: '$primary100',
45 | },
46 | },
47 | },
48 | ],
49 | })
50 |
51 | export const StyledCheckIcon = styled(CheckIcon, {
52 | color: '$primary',
53 | width: 20,
54 | height: 20,
55 | })
56 |
57 | export const StyledCopyIcon = styled(EyeClosedIcon, {
58 | color: '$primary',
59 | width: 20,
60 | height: 20,
61 | })
62 |
63 | export const ToastPlayground = () => {
64 | const [notifications, setNotifications] = useState([])
65 | // // If you want to remove notifications from tree components
66 | // useEffect(() => {
67 | // if (notifications.length > 0) {
68 |
69 | // // setTimeout to not remove animation
70 | // setTimeout(() => {
71 | // setNotifications((prev) => prev.filter((n) => n.show))
72 | // }, 2000)
73 | // }
74 |
75 | // }, [notifications])
76 | return (
77 |
78 |
79 |
81 | setNotifications((prev) => [
82 | ...prev,
83 | {
84 | id: prev.length + 1,
85 | show: true,
86 | kind: kinds[Math.floor(Math.random() * kinds.length)],
87 | copied: false,
88 | },
89 | ])
90 | }
91 | size="small"
92 | >
93 | Open toast
94 |
95 |
96 | {notifications.map((notification) => (
97 | {
106 | setNotifications((prev) =>
107 | prev.map((n) =>
108 | n.id === notification.id
109 | ? {
110 | ...n,
111 | show: false,
112 | }
113 | : n
114 | )
115 | )
116 | }}
117 | >
118 |
119 | Hello world!
120 | {
124 | setNotifications((prev) =>
125 | prev.map((n) =>
126 | n.id === notification.id
127 | ? {
128 | ...n,
129 | copied: true,
130 | }
131 | : n
132 | )
133 | )
134 | }}
135 | >
136 | {notification.copied ? : }
137 |
138 |
139 |
140 | ))}
141 |
142 | )
143 | }
144 |
--------------------------------------------------------------------------------
/packages/website/playgrounds/index.ts:
--------------------------------------------------------------------------------
1 | export * from './ToastPlayground'
2 |
--------------------------------------------------------------------------------
/packages/website/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finetwork-os/ui/5eb6e16e6d1adc9ed589eaa8fd2974a7151d0eb4/packages/website/public/favicon.ico
--------------------------------------------------------------------------------
/packages/website/public/finetwork.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finetwork-os/ui/5eb6e16e6d1adc9ed589eaa8fd2974a7151d0eb4/packages/website/public/finetwork.png
--------------------------------------------------------------------------------
/packages/website/public/fonts/Druk-Text-Wide.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finetwork-os/ui/5eb6e16e6d1adc9ed589eaa8fd2974a7151d0eb4/packages/website/public/fonts/Druk-Text-Wide.otf
--------------------------------------------------------------------------------
/packages/website/public/fonts/Druk.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finetwork-os/ui/5eb6e16e6d1adc9ed589eaa8fd2974a7151d0eb4/packages/website/public/fonts/Druk.eot
--------------------------------------------------------------------------------
/packages/website/public/fonts/Druk.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finetwork-os/ui/5eb6e16e6d1adc9ed589eaa8fd2974a7151d0eb4/packages/website/public/fonts/Druk.woff
--------------------------------------------------------------------------------
/packages/website/public/fonts/Druk.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finetwork-os/ui/5eb6e16e6d1adc9ed589eaa8fd2974a7151d0eb4/packages/website/public/fonts/Druk.woff2
--------------------------------------------------------------------------------
/packages/website/public/fonts/DrukText-Bold.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finetwork-os/ui/5eb6e16e6d1adc9ed589eaa8fd2974a7151d0eb4/packages/website/public/fonts/DrukText-Bold.otf
--------------------------------------------------------------------------------
/packages/website/public/fonts/DrukText-Medium.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/finetwork-os/ui/5eb6e16e6d1adc9ed589eaa8fd2974a7151d0eb4/packages/website/public/fonts/DrukText-Medium.otf
--------------------------------------------------------------------------------
/packages/website/styles.ts:
--------------------------------------------------------------------------------
1 | export const styles = {
2 | display: 'flex',
3 | justifyContent: 'space-around',
4 | padding: '1em',
5 | alignItems: 'baseline',
6 | }
7 |
--------------------------------------------------------------------------------
/packages/website/styles/globals.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'Druk';
3 | src: url('/fonts/DrukText-Bold.otf') format('opentype');
4 | font-weight: bold;
5 | font-style: normal;
6 | font-display: swap;
7 | }
8 |
9 | html,
10 | body {
11 | padding: 0;
12 | margin: 0;
13 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
14 | Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
15 | }
16 |
17 | a {
18 | color: inherit;
19 | text-decoration: none;
20 | }
21 |
22 | * {
23 | box-sizing: border-box;
24 | }
25 |
--------------------------------------------------------------------------------
/packages/website/styles/stitches.config.ts:
--------------------------------------------------------------------------------
1 | import { createStitches } from '@stitches/react'
2 | import { lightTheme } from 'website/themes'
3 |
4 | export const {
5 | styled,
6 | css,
7 | theme: createTheme,
8 | keyframes,
9 | globalCss: globalStyles,
10 | getCssText,
11 | } = createStitches({
12 | theme: lightTheme,
13 | media: {
14 | mobile: `(min-width: ${lightTheme.sizes.mobile})`,
15 | tablet: `(min-width: ${lightTheme.sizes.tablet})`,
16 | tabletXl: `(min-width: ${lightTheme.sizes.tabletXl})`,
17 | desktop: `(min-width: ${lightTheme.sizes.desktop})`,
18 | 'desktop-xl': `(min-width: ${lightTheme.sizes.desktop})`,
19 | 'desktop-2xl': `(min-width: ${lightTheme.sizes['desktop-2xl']})`,
20 | },
21 | })
22 |
--------------------------------------------------------------------------------
/packages/website/themes.ts:
--------------------------------------------------------------------------------
1 | const sharedStyles = {
2 | colors: {
3 | linkText: '#5F3DFF',
4 | secondary: '#9E88FC',
5 | secondary100: '#F7F6F9',
6 | secondary200: '#E6E1FA',
7 | secondary300: '#D5CCFA',
8 | secondary400: '#C3B6FB',
9 | secondary500: '#B2A1FC',
10 | secondary600: '#A18CFC',
11 | secondary700: '#9077FD',
12 | secondary800: '#7E61FE',
13 | secondary900: '#6D4CFE',
14 | primary: '#5F3DFF',
15 | primary100: '#F4F2FF',
16 | primary200: '#CABEFF',
17 | primary300: '#AA98FF',
18 | primary400: '#7F64FF',
19 | primary500: '#5F3DFF',
20 | primary600: '#5035DD',
21 | primary700: '#412CBA',
22 | primary800: '#2C218C',
23 | primary900: '#18165E',
24 | tertiary: '#FA9A1D',
25 | tertiaryText: '#000',
26 | tertiaryButtonText: '#000',
27 | tertiary100: '#FFF8F0',
28 | tertiary200: '#FEEBD2',
29 | tertiary300: '#FDD096',
30 | tertiary400: '#FBB559',
31 | tertiary500: '#FA9A1D',
32 | tertiary600: '#D37F17',
33 | tertiary700: '#AB6412',
34 | tertiary800: '#8D4F0E',
35 | tertiary900: '#7A420B',
36 | error: 'hsl(358, 69.4%, 55.2%)',
37 | error100: 'hsl(358, 69.4%, 95.2%)',
38 | success: 'hsl(152, 57.5%, 37.6%)',
39 | info: 'hsl(208, 100%, 47.3%)',
40 | warning: 'hsl(35, 100%, 55.5%)',
41 | default: 'hsl(206 22% 7% / 35%)',
42 | disabled: '#A7A7A7',
43 | },
44 | space: {},
45 | sizes: {
46 | mobile: '360px',
47 | tablet: '480px',
48 | tabletXl: '768px',
49 | desktop: '1024px',
50 | 'desktop-xl': '1280px',
51 | 'desktop-2xl': '1680px',
52 | },
53 | fonts: {
54 | primary: 'Nunito Sans, apple-system, sans-serif',
55 | secondary: 'Druk, monospace',
56 | },
57 | }
58 |
59 | export const lightTheme = {
60 | ...sharedStyles,
61 | colors: {
62 | ...sharedStyles.colors,
63 | primaryText: '#000',
64 | primaryButtonText: '#fff',
65 | secondaryText: '#fff',
66 | secondaryButtonText: '#000',
67 | },
68 | }
69 |
70 | export const darkTheme = {
71 | ...sharedStyles,
72 | colors: {
73 | ...sharedStyles.colors,
74 | primary100: 'rgba(92, 55, 255, .2) !important',
75 | primary200: 'rgba(92, 55, 255, .4) !important',
76 | primaryText: '#fff !important',
77 | primaryButtonText: '#000 !important',
78 | secondaryText: '#000 !important',
79 | secondaryButtonText: '#fff !important',
80 | },
81 | }
82 |
--------------------------------------------------------------------------------
/packages/website/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "rootDir": "./",
5 | "composite": true,
6 | "isolatedModules": true,
7 | "noEmit": true,
8 | "allowSyntheticDefaultImports": true,
9 | "incremental": true
10 | },
11 | "references": [
12 | {
13 | "path": "../@finetwork:ui/tsconfig.json"
14 | },
15 | {
16 | "path": "../@finetwork:ui-sections/tsconfig.json"
17 | }
18 | ],
19 | "include": [
20 | "next-env.d.ts",
21 | "**/*.ts",
22 | "**/*.tsx"
23 | ],
24 | "exclude": [
25 | "node_modules"
26 | ]
27 | }
28 |
--------------------------------------------------------------------------------
/scripts/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | ./node_modules/.bin/rimraf dist
4 | echo "Building library and generating types..."
5 | ./node_modules/.bin/npm-run-all build-types build-lib
6 | echo "Copying README..."
7 | cp ../../README.md ./dist/README.md
8 | echo "Generating package.json..."
9 | node ../../scripts/generate-package.js
10 | echo "Library built in dist folder!"
11 |
--------------------------------------------------------------------------------
/scripts/deploy.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "Deploying library..."
4 | rm -rf ./.npmrc
5 | echo "Generating .npmrc file..."
6 | echo "//registry.npmjs.org/:_authToken=$1" >> ./.npmrc
7 | echo "always-auth=true" >> ./.npmrc
8 | echo "registry=https://registry.npmjs.org/" >> ./.npmrc
9 | echo "Reading .npmrc file..."
10 | echo "------- START -------"
11 | cat ./.npmrc
12 | echo "------- END -------"
13 | echo "Publishing to npm..."
14 | npm publish ./dist --access public
15 | echo "Library published!"
16 | echo "Removing dist folder..."
17 | rm -rf ./dist
18 | echo "Dist folder removed!"
19 | echo "Library deployed..."
20 |
--------------------------------------------------------------------------------
/scripts/esbuild.config.js:
--------------------------------------------------------------------------------
1 | const esbuild = require('esbuild')
2 |
3 | const { nodeExternalsPlugin } = require('esbuild-node-externals')
4 |
5 | esbuild
6 | .build({
7 | entryPoints: ['./src/index.ts'],
8 | outfile: './dist/dist/index.js',
9 | bundle: true,
10 | minify: true,
11 | platform: 'node',
12 | sourcemap: true,
13 | target: 'node14',
14 | plugins: [nodeExternalsPlugin()],
15 | })
16 | .catch(() => process.exit(1))
17 |
--------------------------------------------------------------------------------
/scripts/generate-package.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 |
3 | const packageJson = JSON.parse(fs.readFileSync('./package.json'))
4 | const newPackageJson = {
5 | ...packageJson,
6 | main: 'dist/index.js',
7 | typings: 'src/index.d.ts',
8 | }
9 | const packageJsonString = JSON.stringify(newPackageJson, null, 2)
10 | fs.writeFileSync('./dist/package.json', packageJsonString)
11 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": "./packages",
4 | "target": "es5",
5 | "lib": ["dom", "dom.iterable", "esnext"],
6 | "allowJs": true,
7 | "skipLibCheck": true,
8 | "strict": false,
9 | "forceConsistentCasingInFileNames": true,
10 | "esModuleInterop": true,
11 | "module": "esnext",
12 | "moduleResolution": "node",
13 | "resolveJsonModule": true,
14 | "isolatedModules": true,
15 | "jsx": "preserve"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------