Skip to content

Commit a83072b

Browse files
committed
Merge remote-tracking branch 'origin/feat/v4' into beta-v4
2 parents ce66153 + 2cc9d4c commit a83072b

File tree

13 files changed

+186
-90
lines changed

13 files changed

+186
-90
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"storybook": "start-storybook -p 6006",
2525
"storybook:build": "build-storybook",
2626
"storybook:deploy": "firebase deploy --only hosting",
27-
"dev": "yarn build && yarn bundle"
27+
"dev": "yarn build && yarn bundle",
28+
"postinstall": "patch-package"
2829
},
2930
"husky": {
3031
"hooks": {
@@ -75,6 +76,7 @@
7576
"eslint-plugin-react-hooks": "^4.6.0",
7677
"eslint-plugin-storybook": "^0.6.11",
7778
"husky": "^4.2.5",
79+
"patch-package": "^6.5.1",
7880
"react": "^18.2.0",
7981
"react-dom": "^18.2.0",
8082
"rollup": "^3.17.3",
@@ -112,7 +114,7 @@
112114
"react-datepicker": "^4.10.0",
113115
"react-feather": "^2.0.10",
114116
"react-phone-input-2": "^2.15.1",
115-
"react-select": "^5.7.0",
117+
"react-select": "^5.7.1",
116118
"react-text-mask": "^5.5.0",
117119
"styled-system": "^5.1.5",
118120
"text-mask-addons": "^3.8.0"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
diff --git a/node_modules/@tiptap/core/dist/packages/core/src/index.d.ts b/node_modules/@tiptap/core/dist/packages/core/src/index.d.ts
2+
index 2626c14..6674936 100644
3+
--- a/node_modules/@tiptap/core/dist/packages/core/src/index.d.ts
4+
+++ b/node_modules/@tiptap/core/dist/packages/core/src/index.d.ts
5+
@@ -1,18 +1,18 @@
6+
-export * from './CommandManager';
7+
-export * from './Editor';
8+
-export * from './Extension';
9+
-export * as extensions from './extensions';
10+
-export * from './helpers';
11+
-export * from './InputRule';
12+
-export * from './inputRules';
13+
-export * from './Mark';
14+
-export * from './Node';
15+
-export * from './NodeView';
16+
-export * from './PasteRule';
17+
-export * from './pasteRules';
18+
-export * from './Tracker';
19+
-export * from './types';
20+
-export * from './utilities';
21+
+export * from './CommandManager.js'
22+
+export * from './Editor.js'
23+
+export * from './Extension.js'
24+
+export * as extensions from './extensions.js'
25+
+export * from './helpers.js'
26+
+export * from './InputRule.js'
27+
+export * from './inputRules.js'
28+
+export * from './Mark.js'
29+
+export * from './Node.js'
30+
+export * from './NodeView.js'
31+
+export * from './PasteRule.js'
32+
+export * from './pasteRules.js'
33+
+export * from './Tracker.js'
34+
+export * from './types.js'
35+
+export * from './utilities.js'
36+
export interface Commands<ReturnType = any> {
37+
}
38+
export interface ExtensionConfig<Options = any, Storage = any> {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
diff --git a/node_modules/@tiptap/react/dist/packages/react/src/index.d.ts b/node_modules/@tiptap/react/dist/packages/react/src/index.d.ts
2+
index c5109e2..5742d3c 100644
3+
--- a/node_modules/@tiptap/react/dist/packages/react/src/index.d.ts
4+
+++ b/node_modules/@tiptap/react/dist/packages/react/src/index.d.ts
5+
@@ -1,10 +1,10 @@
6+
-export * from './BubbleMenu';
7+
-export { Editor } from './Editor';
8+
-export * from './EditorContent';
9+
-export * from './FloatingMenu';
10+
-export * from './NodeViewContent';
11+
-export * from './NodeViewWrapper';
12+
-export * from './ReactNodeViewRenderer';
13+
-export * from './ReactRenderer';
14+
-export * from './useEditor';
15+
-export * from '@tiptap/core';
16+
+export * from './BubbleMenu.js'
17+
+export { Editor } from './Editor.js'
18+
+export * from './EditorContent.js'
19+
+export * from './FloatingMenu.js'
20+
+export * from './NodeViewContent.js'
21+
+export * from './NodeViewWrapper.js'
22+
+export * from './ReactNodeViewRenderer.js'
23+
+export * from './ReactRenderer.js'
24+
+export * from './useEditor.js'
25+
+export * from '@tiptap/core'

src/atoms/illustration/illustration.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import React from 'react'
2-
import { styled, DefaultTheme, withTheme } from 'styled-components'
1+
import React, { PropsWithChildren } from 'react'
2+
import { styled } from 'styled-components'
33

4-
import * as Illustrations from '../illustrations/index.js'
54
import { cssClass } from '../../utils/index.js'
5+
import * as Illustrations from '../illustrations/index.js'
66

77
export type IllustrationVariant = keyof typeof Illustrations
88

@@ -22,25 +22,25 @@ export type IllustrationProps = {
2222
const Wrapper = styled.div.attrs((props) => ({
2323
className: cssClass('Illustration', props.className),
2424
}))`
25-
[fill="#3040D6"] {
26-
fill: ${({ theme }) => theme.colors.primary100}
25+
[fill='#3040D6'] {
26+
fill: ${({ theme }) => theme.colors.primary100};
2727
}
28-
29-
[stroke="#3B3552"] {
30-
stroke: ${({ theme }) => theme.colors.accent}
28+
29+
[stroke='#3B3552'] {
30+
stroke: ${({ theme }) => theme.colors.accent};
3131
}
3232
`
3333

34-
type RawIllustrationType = IllustrationProps &
35-
{ theme: DefaultTheme, [key: string]: any } & {
36-
// this fixes unknown error with some TSC version (monkey patch)
37-
children?: React.ReactNode
38-
}
34+
type RawIllustrationType = IllustrationProps & PropsWithChildren
3935

4036
const RawIllustration: React.FC<RawIllustrationType> = (props) => {
4137
const { variant, ...other } = props
4238
const IllustrationComponent = Illustrations[variant]
43-
return <Wrapper><IllustrationComponent {...other} /></Wrapper>
39+
return (
40+
<Wrapper>
41+
<IllustrationComponent {...other} />
42+
</Wrapper>
43+
)
4444
}
4545

4646
/**
@@ -77,6 +77,6 @@ const RawIllustration: React.FC<RawIllustrationType> = (props) => {
7777
* )
7878
* @section design-system
7979
*/
80-
export const Illustration = withTheme(RawIllustration)
80+
export const Illustration = RawIllustration
8181

8282
export default Illustration

src/atoms/illustrations/props.type.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import { DefaultTheme } from 'styled-components'
33
export type Props = {
44
width?: number;
55
height?: number;
6-
theme: DefaultTheme;
6+
theme?: DefaultTheme;
77
}

src/atoms/illustrations/rocket.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import React from 'react'
22

33
import { Props } from './props.type.js'
44

5-
export const Rocket: React.FC<Props> = () => (
6-
<svg width="249px" height="179px" viewBox="0 0 249 179" version="1.1" xmlns="http://www.w3.org/2000/svg">
5+
export const Rocket: React.FC<Props> = ({ width = 249, height = 179 }) => (
6+
<svg width={width} height={height} viewBox="0 0 249 179" version="1.1" xmlns="http://www.w3.org/2000/svg">
77
<defs>
88
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
99
<stop stopColor="#FFAB86" offset="0%" />

src/atoms/illustrations/slack-logo.tsx

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,23 @@ import React from 'react'
33
import { Props } from './props.type.js'
44

55
export const Slack: React.FC<Props> = ({ width = 72, height = 72 }) => (
6-
<svg
7-
width={width}
8-
height={height}
9-
viewBox="70 70 140 140"
10-
version="1.1"
11-
xmlns="http://www.w3.org/2000/svg"
12-
>
6+
<svg width={width} height={height} viewBox="70 70 140 140" version="1.1" xmlns="http://www.w3.org/2000/svg">
137
<g>
148
<g>
159
<path style={{ fill: '#E01E5A' }} d="M99.4,151.2c0,7.1-5.8,12.9-12.9,12.9c-7.1,0-12.9-5.8-12.9-12.9c0-7.1,5.8-12.9,12.9-12.9h12.9V151.2z" />
16-
<path
17-
style={{ fill: '#E01E5A' }}
18-
d="M105.9,151.2c0-7.1,5.8-12.9,12.9-12.9s12.9,5.8,12.9,12.9v32.3c0,7.1-5.8,12.9-12.9,12.9s-12.9-5.8-12.9-12.9V151.2z"
19-
/>
10+
<path style={{ fill: '#E01E5A' }} d="M105.9,151.2c0-7.1,5.8-12.9,12.9-12.9s12.9,5.8,12.9,12.9v32.3c0,7.1-5.8,12.9-12.9,12.9s-12.9-5.8-12.9-12.9V151.2z" />
2011
</g>
2112
<g>
2213
<path style={{ fill: '#36C5F0' }} d="M118.8,99.4c-7.1,0-12.9-5.8-12.9-12.9c0-7.1,5.8-12.9,12.9-12.9s12.9,5.8,12.9,12.9v12.9H118.8z" />
23-
<path
24-
style={{ fill: '#36C5F0' }}
25-
d="M118.8,105.9c7.1,0,12.9,5.8,12.9,12.9s-5.8,12.9-12.9,12.9H86.5c-7.1,0-12.9-5.8-12.9-12.9s5.8-12.9,12.9-12.9H118.8z"
26-
/>
14+
<path style={{ fill: '#36C5F0' }} d="M118.8,105.9c7.1,0,12.9,5.8,12.9,12.9s-5.8,12.9-12.9,12.9H86.5c-7.1,0-12.9-5.8-12.9-12.9s5.8-12.9,12.9-12.9H118.8z" />
2715
</g>
2816
<g>
2917
<path style={{ fill: '#2EB67D' }} d="M170.6,118.8c0-7.1,5.8-12.9,12.9-12.9c7.1,0,12.9,5.8,12.9,12.9s-5.8,12.9-12.9,12.9h-12.9V118.8z" />
30-
<path
31-
style={{ fill: '#2EB67D' }}
32-
d="M164.1,118.8c0,7.1-5.8,12.9-12.9,12.9c-7.1,0-12.9-5.8-12.9-12.9V86.5c0-7.1,5.8-12.9,12.9-12.9c7.1,0,12.9,5.8,12.9,12.9V118.8z"
33-
/>
18+
<path style={{ fill: '#2EB67D' }} d="M164.1,118.8c0,7.1-5.8,12.9-12.9,12.9c-7.1,0-12.9-5.8-12.9-12.9V86.5c0-7.1,5.8-12.9,12.9-12.9c7.1,0,12.9,5.8,12.9,12.9V118.8z" />
3419
</g>
3520
<g>
3621
<path style={{ fill: '#ECB22E' }} d="M151.2,170.6c7.1,0,12.9,5.8,12.9,12.9c0,7.1-5.8,12.9-12.9,12.9c-7.1,0-12.9-5.8-12.9-12.9v-12.9H151.2z" />
37-
<path
38-
style={{ fill: '#ECB22E' }}
39-
d="M151.2,164.1c-7.1,0-12.9-5.8-12.9-12.9c0-7.1,5.8-12.9,12.9-12.9h32.3c7.1,0,12.9,5.8,12.9,12.9c0,7.1-5.8,12.9-12.9,12.9H151.2z"
40-
/>
22+
<path style={{ fill: '#ECB22E' }} d="M151.2,164.1c-7.1,0-12.9-5.8-12.9-12.9c0-7.1,5.8-12.9,12.9-12.9h32.3c7.1,0,12.9,5.8,12.9,12.9c0,7.1-5.8,12.9-12.9,12.9H151.2z" />
4123
</g>
4224
</g>
4325
</svg>

src/molecules/drop-down/drop-down-item.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { rgba } from 'polished'
2-
import { space, variant } from 'styled-system'
2+
import type { PropsWithChildren } from 'react'
33
import { styled } from 'styled-components'
4+
import { space, variant } from 'styled-system'
45

56
import { Box, BoxProps } from '../../atoms/box/index.js'
67
import type { VariantType } from '../../theme.js'
@@ -42,7 +43,7 @@ const colorVariants = variant<any, VariantType>({
4243
*/
4344
export type DropDownItemProps = BoxProps & {
4445
colorVariant?: VariantType
45-
}
46+
} & PropsWithChildren
4647

4748
/**
4849
* @component

src/molecules/select/select-async.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// @ts-nocheck
33
import noop from 'lodash/noop.js'
44
import React, { FC } from 'react'
5-
import ReactAsyncSelect, { AsyncProps } from 'react-select/async/dist/react-select-async.cjs.js'
5+
import ReactAsyncSelect, { AsyncProps } from 'react-select/async'
66

77
import useSelectTheme from './select-theme.js'
88
import { cssClass, filterStyles, selectStyles } from '../../utils/index.js'
Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
import { rgba } from 'polished'
2-
import { ThemeConfig } from 'react-select'
3-
import { DefaultTheme, useTheme } from 'styled-components'
2+
import { useEffect, useState } from 'react'
3+
import type { ThemeConfig } from 'react-select'
4+
import type { DefaultTheme } from 'styled-components'
5+
import { useTheme } from 'styled-components'
6+
7+
import * as defautTheme from '../../theme.js'
48

59
const useSelectTheme = (): { theme: DefaultTheme; selectTheme: ThemeConfig } => {
610
const theme = useTheme()
11+
const [currentTheme, setCurrentTheme] = useState<DefaultTheme>(defautTheme)
12+
13+
useEffect(() => {
14+
if (theme) {
15+
setCurrentTheme(theme)
16+
}
17+
}, [theme])
18+
719
const selectTheme: ThemeConfig = (config) => ({
820
...config,
921
borderRadius: 2,
@@ -14,16 +26,16 @@ const useSelectTheme = (): { theme: DefaultTheme; selectTheme: ThemeConfig } =>
1426
},
1527
colors: {
1628
...config.colors,
17-
primary: theme.colors.primary100,
18-
danger: theme.colors.error,
19-
dangerLight: theme.colors.errorLight,
20-
primary25: rgba(theme.colors.black, 0.06),
21-
primary50: rgba(theme.colors.black, 0.125),
22-
primary75: rgba(theme.colors.black, 0.25),
29+
primary: currentTheme.colors.primary100,
30+
danger: currentTheme.colors.error,
31+
dangerLight: currentTheme.colors.errorLight,
32+
primary25: rgba(currentTheme.colors.black, 0.06),
33+
primary50: rgba(currentTheme.colors.black, 0.125),
34+
primary75: rgba(currentTheme.colors.black, 0.25),
2335
},
2436
})
2537

26-
return { theme, selectTheme }
38+
return { theme: currentTheme, selectTheme }
2739
}
2840

2941
export default useSelectTheme

0 commit comments

Comments
 (0)