@graphcommerce/graphcms-ui 2.106.39 → 3.0.2
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.
- package/CHANGELOG.md +118 -82
- package/components/Asset/Asset.graphql +7 -0
- package/components/Asset/index.tsx +34 -0
- package/components/RichText/RichText.tsx +117 -0
- package/components/RichText/defaultRenderers.tsx +42 -0
- package/components/RichText/defaultSxRenderer.ts +103 -0
- package/{RichText → components/RichText}/getNodeLength.tsx +3 -2
- package/components/RichText/index.ts +2 -0
- package/components/RichText/types.ts +92 -0
- package/index.ts +2 -1
- package/package.json +17 -19
- package/RichText/RichTextColumns.tsx +0 -22
- package/RichText/RichTextDoubleSpread.tsx +0 -18
- package/RichText/RichTextHeadingStrongStroked.tsx +0 -22
- package/RichText/RichTextHero.tsx +0 -27
- package/RichText/RichTextParagraphStrongStroked.tsx +0 -23
- package/RichText/RichTextQuote.tsx +0 -21
- package/RichText/RichTextSpread.tsx +0 -14
- package/RichText/index.tsx +0 -325
- package/RichText/useRichTextStyles.tsx +0 -118
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { UseStyles, responsiveVal } from '@graphcommerce/next-ui'
|
|
2
|
-
import { makeStyles, Theme } from '@material-ui/core'
|
|
3
|
-
|
|
4
|
-
const useRichTextStyles = makeStyles(
|
|
5
|
-
(theme: Theme) => ({
|
|
6
|
-
root: {
|
|
7
|
-
'&:empty': {
|
|
8
|
-
display: 'none',
|
|
9
|
-
},
|
|
10
|
-
'&:last-child': {
|
|
11
|
-
marginBottom: 0,
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
paragraph: {
|
|
15
|
-
marginBottom: '1em',
|
|
16
|
-
wordBreak: 'break-word',
|
|
17
|
-
},
|
|
18
|
-
h1: {
|
|
19
|
-
marginTop: '0.5em',
|
|
20
|
-
marginBottom: '0.5em',
|
|
21
|
-
},
|
|
22
|
-
h2: {
|
|
23
|
-
marginTop: '0.5em',
|
|
24
|
-
marginBottom: '0.5em',
|
|
25
|
-
'&:first-child': { marginTop: 0 },
|
|
26
|
-
},
|
|
27
|
-
h3: {
|
|
28
|
-
marginTop: '0.5em',
|
|
29
|
-
marginBottom: '0.5em',
|
|
30
|
-
'&:first-child': { marginTop: 0 },
|
|
31
|
-
},
|
|
32
|
-
h4: {
|
|
33
|
-
marginTop: responsiveVal(11, 30),
|
|
34
|
-
marginBottom: responsiveVal(11, 30),
|
|
35
|
-
'&:first-child': { marginTop: 0 },
|
|
36
|
-
},
|
|
37
|
-
h5: {
|
|
38
|
-
marginTop: responsiveVal(7, 20),
|
|
39
|
-
marginBottom: responsiveVal(7, 20),
|
|
40
|
-
'&:first-child': { marginTop: 0 },
|
|
41
|
-
},
|
|
42
|
-
h6: {
|
|
43
|
-
'&:first-of-type': {
|
|
44
|
-
marginTop: 0,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
asset: {
|
|
48
|
-
width: '100%',
|
|
49
|
-
height: 'auto',
|
|
50
|
-
},
|
|
51
|
-
blockQuote: {
|
|
52
|
-
paddingLeft: theme.spacings.sm,
|
|
53
|
-
margin: `${theme.spacings.md} 0`,
|
|
54
|
-
},
|
|
55
|
-
ol: {
|
|
56
|
-
marginBottom: '1em',
|
|
57
|
-
},
|
|
58
|
-
ul: {
|
|
59
|
-
marginBottom: '1em',
|
|
60
|
-
},
|
|
61
|
-
strong: {},
|
|
62
|
-
italic: {},
|
|
63
|
-
underlined: {},
|
|
64
|
-
code: {
|
|
65
|
-
width: 'fit-content',
|
|
66
|
-
maxWidth: '100%',
|
|
67
|
-
padding: 5,
|
|
68
|
-
overflow: 'scroll',
|
|
69
|
-
},
|
|
70
|
-
iframe: {},
|
|
71
|
-
aspectContainer: {},
|
|
72
|
-
table: {
|
|
73
|
-
display: 'table',
|
|
74
|
-
width: '100%',
|
|
75
|
-
borderSpacing: '2px',
|
|
76
|
-
borderCollapse: 'collapse',
|
|
77
|
-
marginTop: theme.spacings.md,
|
|
78
|
-
marginBottom: theme.spacings.sm,
|
|
79
|
-
'& thead, tbody': {
|
|
80
|
-
'& td': {
|
|
81
|
-
padding: '10px 20px',
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
'& thead': {
|
|
85
|
-
'& tr': {
|
|
86
|
-
'& td': {
|
|
87
|
-
'& p': {
|
|
88
|
-
fontWeight: theme.typography.fontWeightBold,
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
'& tbody': {
|
|
94
|
-
display: 'table-row-group',
|
|
95
|
-
verticalAlign: 'center',
|
|
96
|
-
borderColor: 'inherit',
|
|
97
|
-
'& tr': {
|
|
98
|
-
'&:nth-child(odd)': {
|
|
99
|
-
background: theme.palette.background.paper,
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
'& td': {
|
|
103
|
-
[theme.breakpoints.up('sm')]: {
|
|
104
|
-
minWidth: '150px',
|
|
105
|
-
},
|
|
106
|
-
'& p': {},
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
link: {
|
|
111
|
-
wordBreak: 'break-word',
|
|
112
|
-
},
|
|
113
|
-
}),
|
|
114
|
-
{ name: 'RichText' },
|
|
115
|
-
)
|
|
116
|
-
export type UseRichTextStyles = UseStyles<typeof useRichTextStyles>
|
|
117
|
-
|
|
118
|
-
export default useRichTextStyles
|