@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.
@@ -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 = () => /* @__PURE__ */ jsxRuntime.jsx(
82
- "svg",
83
- {
84
- xmlns: "http://www.w3.org/2000/svg",
85
- width: 24,
86
- height: 24,
87
- viewBox: "0 0 24 24",
88
- fill: defaultTheme.defaultThemeCssVariableUsages.palette.background.primary,
89
- children: /* @__PURE__ */ jsxRuntime.jsx(
90
- "path",
91
- {
92
- className: styles_module.default["checkbox-svg-path"],
93
- 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"
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 DesignSystemComponents = (hAddend, pLevel) => {
24
- return {
25
- h1: ({ color, ref, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(index.default, { ref, variant: h(1, hAddend), ...props }),
26
- h2: ({ color, ref, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(index.default, { ref, variant: h(2, hAddend), ...props }),
27
- h3: ({ color, ref, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(index.default, { ref, variant: h(3, hAddend), ...props }),
28
- h4: ({ color, ref, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(index.default, { ref, variant: h(4, hAddend), ...props }),
29
- h5: ({ color, ref, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(index.default, { ref, variant: h(5, hAddend), ...props }),
30
- h6: ({ color, ref, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(index.default, { ref, variant: h(6, hAddend), ...props }),
31
- p: ({ color, ref, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(index.default, { ref, variant: p(pLevel), ...props }),
32
- // a: ({ href, ...props }) => href ? <Link to={href} {...props} /> : <a {...props} />,
33
- // table: (props) => <Table {...props} />,
34
- // thead: (props) => <TableHead {...props} />,
35
- // tbody: (props) => <TableBody {...props} />,
36
- // tr: ({ ref, ...props }) => <TableRow ref={ref as any} {...props} />,
37
- // th: ({ ref, ...props }) => (
38
- // <TableCell ref={ref as any} variant={'header'} {...props} />
39
- // ),
40
- // td: ({ ref, ...props }) => (
41
- // <TableCell ref={ref as any} variant={'data'} {...props} />
42
- // ),
43
- li: (props) => /* @__PURE__ */ jsxRuntime.jsx(
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
- className: cx.cx(styles_module.default[`li_${p(pLevel)}`], props.className)
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
- headerLevel,
55
- paragraphLevel,
219
+ headerIncrement,
220
+ paragraphIncrement,
221
+ style,
222
+ className,
223
+ styles: componentStyles,
224
+ classNames: componentClassNames,
56
225
  ...props
57
226
  }) {
58
- const BaseComponents = React.useMemo(
59
- () => DesignSystemComponents(headerLevel ?? 0, paragraphLevel ?? 1),
60
- [headerLevel, paragraphLevel]
227
+ const allComponents = React.useMemo(
228
+ () => ({
229
+ ...DefaultComponents,
230
+ ...components
231
+ }),
232
+ [components]
61
233
  );
62
234
  return /* @__PURE__ */ jsxRuntime.jsx(
63
- ReactMarkdown,
235
+ MarkdownContext.Provider,
64
236
  {
65
- components: {
66
- ...BaseComponents,
67
- ...components
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
 
@@ -56,6 +56,9 @@ const defaultDarkTheme = createTheme.default({
56
56
  base: {
57
57
  surface: "#121212"
58
58
  }
59
+ },
60
+ thumbnailCheckbox: {
61
+ fill: { primary: "#FFFFFF", secondary: "#2A323C" }
59
62
  }
60
63
  }
61
64
  });
@@ -83,6 +83,12 @@ const defaultThemeOptions = {
83
83
  tooltip: {
84
84
  surface: disabled.on,
85
85
  on: disabled.surface
86
+ },
87
+ thumbnailCheckbox: {
88
+ fill: {
89
+ primary: "#FFFFFF",
90
+ secondary: "#2A323C"
91
+ }
86
92
  }
87
93
  },
88
94
  typography: {