@veritone-ce/design-system 2.5.17 → 2.5.19
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/dist/cjs/Checkbox/index.js +35 -19
- package/dist/cjs/extras/Markdown/index.js +209 -35
- package/dist/cjs/extras/Markdown/styles.module.scss.js +1 -1
- package/dist/cjs/styles/createPalette.js +2 -1
- package/dist/cjs/styles/defaultTheme.js +3 -0
- package/dist/cjs/styles/defaultThemeOptions.js +6 -0
- package/dist/cjs/styles.css +1 -1
- package/dist/esm/Checkbox/index.js +35 -19
- package/dist/esm/extras/Markdown/index.js +210 -36
- package/dist/esm/extras/Markdown/styles.module.scss.js +1 -1
- package/dist/esm/styles/createPalette.js +2 -1
- package/dist/esm/styles/defaultTheme.js +3 -0
- package/dist/esm/styles/defaultThemeOptions.js +6 -0
- package/dist/esm/styles/scss/theme.generated.scss +4 -0
- package/dist/esm/styles.css +1 -1
- package/dist/types/Checkbox/index.d.ts +2 -0
- package/dist/types/extras/Markdown/index.d.ts +25 -4
- package/dist/types/styles/defaultThemeOptions.d.ts +6 -0
- package/dist/types/styles/palette.d.ts +6 -0
- package/dist/types/styles/themeOptions.d.ts +7 -0
- package/package.json +1 -1
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var material = require('@mui/material');
|
|
10
|
-
var styles_module = require('./styles.module.scss.js');
|
|
11
10
|
var cx = require('../styles/cx.js');
|
|
12
11
|
require('../styles/defaultThemeOptions.js');
|
|
13
12
|
require('@capsizecss/core');
|
|
@@ -17,6 +16,7 @@ require('@mui/system');
|
|
|
17
16
|
require('../styles/css-vars.js');
|
|
18
17
|
require('../Box/index.js');
|
|
19
18
|
require('../styles/styled.js');
|
|
19
|
+
var styles_module = require('./styles.module.scss.js');
|
|
20
20
|
|
|
21
21
|
const Checkbox = React.forwardRef(
|
|
22
22
|
({
|
|
@@ -28,6 +28,7 @@ const Checkbox = React.forwardRef(
|
|
|
28
28
|
"data-testid": dataTestId,
|
|
29
29
|
style,
|
|
30
30
|
className,
|
|
31
|
+
onThumbnail = false,
|
|
31
32
|
...props
|
|
32
33
|
}, ref) => {
|
|
33
34
|
const inputRef = React.useRef(null);
|
|
@@ -70,7 +71,7 @@ const Checkbox = React.forwardRef(
|
|
|
70
71
|
className: styles_module.default["invisible-checkbox"]
|
|
71
72
|
}
|
|
72
73
|
),
|
|
73
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles_module.default["icon-container"], children: indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(IndeterminateIcon, {}) : checked ? /* @__PURE__ */ jsxRuntime.jsx(CheckedIcon, {}) : /* @__PURE__ */ jsxRuntime.jsx(UncheckedIcon, {}) })
|
|
74
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles_module.default["icon-container"], children: indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(IndeterminateIcon, {}) : checked ? /* @__PURE__ */ jsxRuntime.jsx(CheckedIcon, {}) : /* @__PURE__ */ jsxRuntime.jsx(UncheckedIcon, { onThumbnail }) })
|
|
74
75
|
] }),
|
|
75
76
|
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles_module.default["visible-label"], id: labelId, children: label })
|
|
76
77
|
]
|
|
@@ -78,23 +79,38 @@ const Checkbox = React.forwardRef(
|
|
|
78
79
|
);
|
|
79
80
|
}
|
|
80
81
|
);
|
|
81
|
-
const UncheckedIcon = () =>
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
82
|
+
const UncheckedIcon = ({ onThumbnail }) => {
|
|
83
|
+
console.log("onThumbnail", onThumbnail);
|
|
84
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
85
|
+
"svg",
|
|
86
|
+
{
|
|
87
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
88
|
+
width: 24,
|
|
89
|
+
height: 24,
|
|
90
|
+
viewBox: "0 0 24 24",
|
|
91
|
+
fill: defaultTheme.defaultThemeCssVariableUsages.palette.background.primary,
|
|
92
|
+
children: [
|
|
93
|
+
onThumbnail && /* @__PURE__ */ jsxRuntime.jsx(
|
|
94
|
+
"rect",
|
|
95
|
+
{
|
|
96
|
+
x: "4",
|
|
97
|
+
y: "4",
|
|
98
|
+
width: "15",
|
|
99
|
+
height: "15",
|
|
100
|
+
fill: defaultTheme.defaultThemeCssVariableUsages.palette.thumbnailCheckbox.fill
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
104
|
+
"path",
|
|
105
|
+
{
|
|
106
|
+
className: styles_module.default["checkbox-svg-path"],
|
|
107
|
+
d: "M19 5v14H5V5h14Zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2Z"
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
};
|
|
98
114
|
const CheckedIcon = () => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
99
115
|
"svg",
|
|
100
116
|
{
|
|
@@ -18,55 +18,229 @@ require('../../styles/css-vars.js');
|
|
|
18
18
|
require('../../Box/index.js');
|
|
19
19
|
require('../../styles/styled.js');
|
|
20
20
|
|
|
21
|
+
const MarkdownContext = React.createContext({
|
|
22
|
+
headerIncrement: 0,
|
|
23
|
+
paragraphIncrement: 0,
|
|
24
|
+
styles: {},
|
|
25
|
+
classNames: {}
|
|
26
|
+
});
|
|
21
27
|
const h = (base, hAddend) => `h${Math.max(1, Math.min(base + hAddend, 4))}`;
|
|
22
|
-
const p = (base) => `paragraph${Math.max(1, Math.min(base, 3))}`;
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
28
|
+
const p = (base, pAddend) => `paragraph${Math.max(1, Math.min(base + pAddend, 3))}`;
|
|
29
|
+
const DefaultComponents = {
|
|
30
|
+
h1: function H1({ color, ref, style, className, ...props }) {
|
|
31
|
+
const {
|
|
32
|
+
headerIncrement,
|
|
33
|
+
styles: { h1: h1Style },
|
|
34
|
+
classNames: { h1: h1ClassName }
|
|
35
|
+
} = React.useContext(MarkdownContext);
|
|
36
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37
|
+
index.default,
|
|
38
|
+
{
|
|
39
|
+
ref,
|
|
40
|
+
variant: h(1, headerIncrement),
|
|
41
|
+
style: {
|
|
42
|
+
...h1Style,
|
|
43
|
+
...style
|
|
44
|
+
},
|
|
45
|
+
className: cx.cx(styles_module.default.inheritColor, h1ClassName, className),
|
|
46
|
+
...props
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
},
|
|
50
|
+
h2: function H2({ color, ref, style, className, ...props }) {
|
|
51
|
+
const {
|
|
52
|
+
headerIncrement,
|
|
53
|
+
styles: { h2: h2Style },
|
|
54
|
+
classNames: { h2: h2ClassName }
|
|
55
|
+
} = React.useContext(MarkdownContext);
|
|
56
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
57
|
+
index.default,
|
|
58
|
+
{
|
|
59
|
+
ref,
|
|
60
|
+
variant: h(2, headerIncrement),
|
|
61
|
+
style: {
|
|
62
|
+
...h2Style,
|
|
63
|
+
...style
|
|
64
|
+
},
|
|
65
|
+
className: cx.cx(styles_module.default.inheritColor, h2ClassName, className),
|
|
66
|
+
...props
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
},
|
|
70
|
+
h3: function H3({ color, ref, style, className, ...props }) {
|
|
71
|
+
const {
|
|
72
|
+
headerIncrement,
|
|
73
|
+
styles: { h3: h3Style },
|
|
74
|
+
classNames: { h3: h3ClassName }
|
|
75
|
+
} = React.useContext(MarkdownContext);
|
|
76
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
77
|
+
index.default,
|
|
78
|
+
{
|
|
79
|
+
ref,
|
|
80
|
+
variant: h(3, headerIncrement),
|
|
81
|
+
style: {
|
|
82
|
+
...h3Style,
|
|
83
|
+
...style
|
|
84
|
+
},
|
|
85
|
+
className: cx.cx(styles_module.default.inheritColor, h3ClassName, className),
|
|
86
|
+
...props
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
},
|
|
90
|
+
h4: function H4({ color, ref, style, className, ...props }) {
|
|
91
|
+
const {
|
|
92
|
+
headerIncrement,
|
|
93
|
+
styles: { h4: h4Style },
|
|
94
|
+
classNames: { h4: h4ClassName }
|
|
95
|
+
} = React.useContext(MarkdownContext);
|
|
96
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
97
|
+
index.default,
|
|
98
|
+
{
|
|
99
|
+
ref,
|
|
100
|
+
variant: h(4, headerIncrement),
|
|
101
|
+
style: {
|
|
102
|
+
...h4Style,
|
|
103
|
+
...style
|
|
104
|
+
},
|
|
105
|
+
className: cx.cx(styles_module.default.inheritColor, h4ClassName, className),
|
|
106
|
+
...props
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
},
|
|
110
|
+
h5: function H5({ color, ref, style, className, ...props }) {
|
|
111
|
+
const {
|
|
112
|
+
headerIncrement,
|
|
113
|
+
styles: { h5: h5Style },
|
|
114
|
+
classNames: { h5: h5ClassName }
|
|
115
|
+
} = React.useContext(MarkdownContext);
|
|
116
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
117
|
+
index.default,
|
|
118
|
+
{
|
|
119
|
+
ref,
|
|
120
|
+
variant: h(5, headerIncrement),
|
|
121
|
+
style: {
|
|
122
|
+
...h5Style,
|
|
123
|
+
...style
|
|
124
|
+
},
|
|
125
|
+
className: cx.cx(styles_module.default.inheritColor, h5ClassName, className),
|
|
126
|
+
...props
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
},
|
|
130
|
+
h6: function H6({ color, ref, style, className, ...props }) {
|
|
131
|
+
const {
|
|
132
|
+
headerIncrement,
|
|
133
|
+
styles: { h6: h6Style },
|
|
134
|
+
classNames: { h6: h6ClassName }
|
|
135
|
+
} = React.useContext(MarkdownContext);
|
|
136
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
137
|
+
index.default,
|
|
138
|
+
{
|
|
139
|
+
ref,
|
|
140
|
+
variant: h(6, headerIncrement),
|
|
141
|
+
style: {
|
|
142
|
+
...h6Style,
|
|
143
|
+
...style
|
|
144
|
+
},
|
|
145
|
+
className: cx.cx(styles_module.default.inheritColor, h6ClassName, className),
|
|
146
|
+
...props
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
},
|
|
150
|
+
p: function P({ color, ref, style, className, ...props }) {
|
|
151
|
+
const {
|
|
152
|
+
paragraphIncrement,
|
|
153
|
+
styles: { p: pStyle },
|
|
154
|
+
classNames: { p: pClassName }
|
|
155
|
+
} = React.useContext(MarkdownContext);
|
|
156
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
157
|
+
index.default,
|
|
158
|
+
{
|
|
159
|
+
ref,
|
|
160
|
+
variant: p(1, paragraphIncrement),
|
|
161
|
+
style: {
|
|
162
|
+
...pStyle,
|
|
163
|
+
...style
|
|
164
|
+
},
|
|
165
|
+
className: cx.cx(styles_module.default.inheritColor, pClassName, className),
|
|
166
|
+
...props
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
},
|
|
170
|
+
// table: (props) => <Table {...props} />,
|
|
171
|
+
// thead: (props) => <TableHead {...props} />,
|
|
172
|
+
// tbody: (props) => <TableBody {...props} />,
|
|
173
|
+
// tr: ({ ref, ...props }) => <TableRow ref={ref as any} {...props} />,
|
|
174
|
+
// th: ({ ref, ...props }) => (
|
|
175
|
+
// <TableCell ref={ref as any} variant={'header'} {...props} />
|
|
176
|
+
// ),
|
|
177
|
+
// td: ({ ref, ...props }) => (
|
|
178
|
+
// <TableCell ref={ref as any} variant={'data'} {...props} />
|
|
179
|
+
// ),
|
|
180
|
+
li: function Li(props) {
|
|
181
|
+
const {
|
|
182
|
+
paragraphIncrement,
|
|
183
|
+
styles: { li: liStyle },
|
|
184
|
+
classNames: { li: liClassName }
|
|
185
|
+
} = React.useContext(MarkdownContext);
|
|
186
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
44
187
|
"li",
|
|
45
188
|
{
|
|
46
189
|
...props,
|
|
47
|
-
|
|
190
|
+
style: {
|
|
191
|
+
...liStyle,
|
|
192
|
+
...props.style
|
|
193
|
+
},
|
|
194
|
+
className: cx.cx(
|
|
195
|
+
styles_module.default[`li_${p(1, paragraphIncrement)}`],
|
|
196
|
+
liClassName,
|
|
197
|
+
props.className
|
|
198
|
+
)
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
},
|
|
202
|
+
img: function Img(props) {
|
|
203
|
+
const {
|
|
204
|
+
styles: { li: liStyle },
|
|
205
|
+
classNames: { li: liClassName }
|
|
206
|
+
} = React.useContext(MarkdownContext);
|
|
207
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
208
|
+
"img",
|
|
209
|
+
{
|
|
210
|
+
...props,
|
|
211
|
+
style: { ...liStyle, ...props.style },
|
|
212
|
+
className: cx.cx(styles_module.default.img, liClassName, props.className)
|
|
48
213
|
}
|
|
49
|
-
)
|
|
50
|
-
}
|
|
214
|
+
);
|
|
215
|
+
}
|
|
51
216
|
};
|
|
52
217
|
function Markdown({
|
|
53
218
|
components,
|
|
54
|
-
|
|
55
|
-
|
|
219
|
+
headerIncrement,
|
|
220
|
+
paragraphIncrement,
|
|
221
|
+
style,
|
|
222
|
+
className,
|
|
223
|
+
styles: componentStyles,
|
|
224
|
+
classNames: componentClassNames,
|
|
56
225
|
...props
|
|
57
226
|
}) {
|
|
58
|
-
const
|
|
59
|
-
() =>
|
|
60
|
-
|
|
227
|
+
const allComponents = React.useMemo(
|
|
228
|
+
() => ({
|
|
229
|
+
...DefaultComponents,
|
|
230
|
+
...components
|
|
231
|
+
}),
|
|
232
|
+
[components]
|
|
61
233
|
);
|
|
62
234
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
63
|
-
|
|
235
|
+
MarkdownContext.Provider,
|
|
64
236
|
{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
237
|
+
value: {
|
|
238
|
+
headerIncrement: headerIncrement ?? 0,
|
|
239
|
+
paragraphIncrement: paragraphIncrement ?? 0,
|
|
240
|
+
styles: componentStyles ?? {},
|
|
241
|
+
classNames: componentClassNames ?? {}
|
|
68
242
|
},
|
|
69
|
-
...props
|
|
243
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { style, className: cx.cx(styles_module.default.markdown, className), children: /* @__PURE__ */ jsxRuntime.jsx(ReactMarkdown, { components: allComponents, ...props }) })
|
|
70
244
|
}
|
|
71
245
|
);
|
|
72
246
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var styles = {"li_paragraph1":"vt_ce_Markdown_li_paragraph1__89e8a4f2","li_paragraph2":"vt_ce_Markdown_li_paragraph2__41a747e0","li_paragraph3":"vt_ce_Markdown_li_paragraph3__4bbed1ba"};
|
|
5
|
+
var styles = {"markdown":"vt_ce_Markdown_markdown__f723c3f8","inheritColor":"vt_ce_Markdown_inheritColor__d0ceef43","img":"vt_ce_Markdown_img__4bf1a967","li_paragraph1":"vt_ce_Markdown_li_paragraph1__89e8a4f2","li_paragraph2":"vt_ce_Markdown_li_paragraph2__41a747e0","li_paragraph3":"vt_ce_Markdown_li_paragraph3__4bbed1ba"};
|
|
6
6
|
|
|
7
7
|
exports.default = styles;
|
|
@@ -216,7 +216,8 @@ function createPalette(options = {}) {
|
|
|
216
216
|
),
|
|
217
217
|
tooltip: createPaletteTooltip(
|
|
218
218
|
options.tooltip ?? defaultThemeOptions.defaultThemeOptions.palette.tooltip
|
|
219
|
-
)
|
|
219
|
+
),
|
|
220
|
+
thumbnailCheckbox: defaultThemeOptions.defaultThemeOptions.palette.thumbnailCheckbox
|
|
220
221
|
};
|
|
221
222
|
}
|
|
222
223
|
|