@autoguru/overdrive 4.53.0 → 4.54.0
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/components/Badge/index.d.ts +1 -0
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/Columns/index.d.ts +1 -0
- package/dist/components/Columns/index.d.ts.map +1 -1
- package/dist/components/HintText/index.d.ts +3 -0
- package/dist/components/HintText/index.d.ts.map +1 -0
- package/dist/components/HintText/index.js +1 -0
- package/dist/components/MarkdownRenderer/MarkdownRenderer.css.d.ts +22 -1
- package/dist/components/MarkdownRenderer/MarkdownRenderer.css.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/MarkdownRenderer.css.js +40 -8
- package/dist/components/MarkdownRenderer/MarkdownRenderer.d.ts +11 -1
- package/dist/components/MarkdownRenderer/MarkdownRenderer.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/MarkdownRenderer.js +18 -11
- package/dist/components/MarkdownRenderer/MarkdownRendererContext.d.ts +4 -0
- package/dist/components/MarkdownRenderer/MarkdownRendererContext.d.ts.map +1 -0
- package/dist/components/MarkdownRenderer/MarkdownRendererContext.js +4 -0
- package/dist/components/MarkdownRenderer/components/MarkdownBlockquote.css.d.ts +23 -1
- package/dist/components/MarkdownRenderer/components/MarkdownBlockquote.css.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownBlockquote.css.js +36 -13
- package/dist/components/MarkdownRenderer/components/MarkdownBlockquote.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownBlockquote.js +5 -1
- package/dist/components/MarkdownRenderer/components/MarkdownCodeBlock.css.d.ts +27 -1
- package/dist/components/MarkdownRenderer/components/MarkdownCodeBlock.css.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownCodeBlock.css.js +40 -13
- package/dist/components/MarkdownRenderer/components/MarkdownCodeBlock.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownCodeBlock.js +5 -1
- package/dist/components/MarkdownRenderer/components/MarkdownHeading.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownHeading.js +31 -11
- package/dist/components/MarkdownRenderer/components/MarkdownHorizontalRule.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownHorizontalRule.js +10 -4
- package/dist/components/MarkdownRenderer/components/MarkdownInlineCode.css.d.ts +19 -1
- package/dist/components/MarkdownRenderer/components/MarkdownInlineCode.css.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownInlineCode.css.js +31 -9
- package/dist/components/MarkdownRenderer/components/MarkdownInlineCode.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownInlineCode.js +5 -1
- package/dist/components/MarkdownRenderer/components/MarkdownListItem.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownListItem.js +9 -3
- package/dist/components/MarkdownRenderer/components/MarkdownOrderedList.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownOrderedList.js +8 -2
- package/dist/components/MarkdownRenderer/components/MarkdownParagraph.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownParagraph.js +5 -1
- package/dist/components/MarkdownRenderer/components/MarkdownTable.css.d.ts +57 -3
- package/dist/components/MarkdownRenderer/components/MarkdownTable.css.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownTable.css.js +88 -20
- package/dist/components/MarkdownRenderer/components/MarkdownTable.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownTable.js +13 -3
- package/dist/components/MarkdownRenderer/components/MarkdownUnorderedList.d.ts.map +1 -1
- package/dist/components/MarkdownRenderer/components/MarkdownUnorderedList.js +8 -2
- package/dist/components/MarkdownRenderer/index.d.ts +1 -0
- package/dist/components/MarkdownRenderer/index.d.ts.map +1 -1
- package/dist/components/OverdriveProvider/index.d.ts +1 -0
- package/dist/components/OverdriveProvider/index.d.ts.map +1 -1
- package/dist/components/Positioner/index.d.ts +1 -1
- package/dist/components/Positioner/index.d.ts.map +1 -1
- package/dist/components/Positioner/index.js +1 -1
- package/dist/components/Radio/index.d.ts +1 -1
- package/dist/components/Radio/index.d.ts.map +1 -1
- package/dist/components/Radio/index.js +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +28 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/Badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/Badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/Columns/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/Columns/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/HintText/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HintText } from "../private/InputBase/HintText.js";
|
|
@@ -1,2 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
import { cssLayerComponent } from '../../styles/layers.css';
|
|
2
|
+
export declare const rootBase: string;
|
|
3
|
+
export declare const rootDensity: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
4
|
+
density: {
|
|
5
|
+
comfortable: {
|
|
6
|
+
'@layer': {
|
|
7
|
+
[cssLayerComponent]: {
|
|
8
|
+
fontSize: `var(--${string})`;
|
|
9
|
+
lineHeight: `var(--${string})`;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
compact: {
|
|
14
|
+
'@layer': {
|
|
15
|
+
[cssLayerComponent]: {
|
|
16
|
+
fontSize: `var(--${string})`;
|
|
17
|
+
lineHeight: `var(--${string})`;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}>;
|
|
2
23
|
//# sourceMappingURL=MarkdownRenderer.css.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownRenderer.css.d.ts","sourceRoot":"","sources":["../../../lib/components/MarkdownRenderer/MarkdownRenderer.css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MarkdownRenderer.css.d.ts","sourceRoot":"","sources":["../../../lib/components/MarkdownRenderer/MarkdownRenderer.css.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D,eAAO,MAAM,QAAQ,QAOnB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;gBAKnB,CAAC,iBAAiB,CAAC;;;kBAGlB;;;;;gBAKD,CAAC,iBAAiB,CAAC;;;kBAGlB;;;;EAQJ,CAAC"}
|
|
@@ -1,22 +1,54 @@
|
|
|
1
1
|
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
2
2
|
__vanilla_filescope__.setFileScope("lib/components/MarkdownRenderer/MarkdownRenderer.css.ts", "@autoguru/overdrive");
|
|
3
3
|
import { globalStyle, style } from '@vanilla-extract/css';
|
|
4
|
+
import { recipe } from '@vanilla-extract/recipes';
|
|
4
5
|
import { cssLayerComponent } from "../../styles/layers.css.js";
|
|
5
6
|
import { overdriveTokens as tokens } from "../../themes/theme.css.js";
|
|
6
|
-
export const
|
|
7
|
+
export const rootBase = style({
|
|
7
8
|
'@layer': {
|
|
8
9
|
[cssLayerComponent]: {
|
|
9
10
|
fontFamily: tokens.typography.fontFamily,
|
|
10
|
-
fontSize: tokens.typography.size[4].fontSize,
|
|
11
|
-
lineHeight: tokens.typography.size[4].lineHeight,
|
|
12
11
|
wordBreak: 'break-word'
|
|
13
12
|
}
|
|
14
13
|
}
|
|
15
|
-
}, "
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
}, "rootBase");
|
|
15
|
+
export const rootDensity = recipe({
|
|
16
|
+
variants: {
|
|
17
|
+
density: {
|
|
18
|
+
comfortable: {
|
|
19
|
+
'@layer': {
|
|
20
|
+
[cssLayerComponent]: {
|
|
21
|
+
fontSize: tokens.typography.size[4].fontSize,
|
|
22
|
+
lineHeight: tokens.typography.size[4].lineHeight
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
compact: {
|
|
27
|
+
'@layer': {
|
|
28
|
+
[cssLayerComponent]: {
|
|
29
|
+
fontSize: tokens.typography.size[3].fontSize,
|
|
30
|
+
lineHeight: tokens.typography.size[3].lineHeight
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
density: 'comfortable'
|
|
38
|
+
}
|
|
39
|
+
}, "rootDensity");
|
|
40
|
+
globalStyle(`${rootBase} > *:first-child`, {
|
|
41
|
+
'@layer': {
|
|
42
|
+
[cssLayerComponent]: {
|
|
43
|
+
marginTop: 0
|
|
44
|
+
}
|
|
45
|
+
}
|
|
18
46
|
});
|
|
19
|
-
globalStyle(`${
|
|
20
|
-
|
|
47
|
+
globalStyle(`${rootBase} > *:last-child`, {
|
|
48
|
+
'@layer': {
|
|
49
|
+
[cssLayerComponent]: {
|
|
50
|
+
marginBottom: 0
|
|
51
|
+
}
|
|
52
|
+
}
|
|
21
53
|
});
|
|
22
54
|
__vanilla_filescope__.endFileScope();
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import type { ClassValue as ClassName } from 'clsx';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { TestIdProp } from '../../types';
|
|
4
|
+
import type { MarkdownRendererDensity } from './MarkdownRendererContext';
|
|
4
5
|
export interface MarkdownRendererProps extends TestIdProp {
|
|
5
6
|
/** The markdown string to render */
|
|
6
7
|
content: string;
|
|
7
8
|
/** Optional additional class name */
|
|
8
9
|
className?: ClassName;
|
|
10
|
+
/**
|
|
11
|
+
* Controls the visual density of the rendered markdown.
|
|
12
|
+
*
|
|
13
|
+
* - `'comfortable'` (default): Full-size typography and spacing, suitable for
|
|
14
|
+
* page-level content.
|
|
15
|
+
* - `'compact'`: Reduced typography and tighter spacing, optimised for
|
|
16
|
+
* widget and sidebar contexts where space is constrained.
|
|
17
|
+
*/
|
|
18
|
+
density?: MarkdownRendererDensity;
|
|
9
19
|
}
|
|
10
20
|
/**
|
|
11
|
-
* Renders GitHub
|
|
21
|
+
* Renders GitHub Flavoured Markdown content using Overdrive design tokens and components.
|
|
12
22
|
*/
|
|
13
23
|
export declare const MarkdownRenderer: React.ForwardRefExoticComponent<MarkdownRendererProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
24
|
//# sourceMappingURL=MarkdownRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownRenderer.d.ts","sourceRoot":"","sources":["../../../lib/components/MarkdownRenderer/MarkdownRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AACpD,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"MarkdownRenderer.d.ts","sourceRoot":"","sources":["../../../lib/components/MarkdownRenderer/MarkdownRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AACpD,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAIzE,MAAM,WAAW,qBAAsB,SAAQ,UAAU;IACxD,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,uBAAuB,CAAC;CAClC;AAID;;GAEG;AACH,eAAO,MAAM,gBAAgB,8FA4B3B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
const _excluded = ["content", "className", "testId"];
|
|
3
|
+
const _excluded = ["content", "className", "density", "testId"];
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
import React from 'react';
|
|
@@ -8,17 +8,19 @@ import ReactMarkdown from 'react-markdown';
|
|
|
8
8
|
import remarkGfm from 'remark-gfm';
|
|
9
9
|
import { useBox } from "../Box/useBox/useBox.js";
|
|
10
10
|
import * as styles from "./MarkdownRenderer.css.js";
|
|
11
|
+
import { MarkdownRendererDensityProvider } from "./MarkdownRendererContext.js";
|
|
11
12
|
import { createComponentMap } from "./components/index.js";
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
14
|
const componentMap = createComponentMap();
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
|
-
* Renders GitHub
|
|
17
|
+
* Renders GitHub Flavoured Markdown content using Overdrive design tokens and components.
|
|
17
18
|
*/
|
|
18
19
|
export const MarkdownRenderer = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
19
20
|
let {
|
|
20
21
|
content,
|
|
21
22
|
className,
|
|
23
|
+
density = 'comfortable',
|
|
22
24
|
testId
|
|
23
25
|
} = _ref,
|
|
24
26
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -27,17 +29,22 @@ export const MarkdownRenderer = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
27
29
|
componentProps
|
|
28
30
|
} = useBox(_objectSpread(_objectSpread({}, props), {}, {
|
|
29
31
|
as: 'div',
|
|
30
|
-
className: [styles.
|
|
32
|
+
className: [styles.rootBase, styles.rootDensity({
|
|
33
|
+
density
|
|
34
|
+
}), className],
|
|
31
35
|
odComponent: 'markdown-renderer',
|
|
32
36
|
testId
|
|
33
37
|
}));
|
|
34
|
-
return /*#__PURE__*/_jsx(
|
|
35
|
-
|
|
36
|
-
children: /*#__PURE__*/_jsx(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
return /*#__PURE__*/_jsx(MarkdownRendererDensityProvider, {
|
|
39
|
+
value: density,
|
|
40
|
+
children: /*#__PURE__*/_jsx(Component, _objectSpread(_objectSpread({}, componentProps), {}, {
|
|
41
|
+
ref: ref,
|
|
42
|
+
children: /*#__PURE__*/_jsx(ReactMarkdown, {
|
|
43
|
+
remarkPlugins: [remarkGfm],
|
|
44
|
+
components: componentMap,
|
|
45
|
+
children: content
|
|
46
|
+
})
|
|
47
|
+
}))
|
|
48
|
+
});
|
|
42
49
|
});
|
|
43
50
|
MarkdownRenderer.displayName = 'MarkdownRenderer';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type MarkdownRendererDensity = 'comfortable' | 'compact';
|
|
2
|
+
export declare const MarkdownRendererDensityProvider: import("react").Provider<MarkdownRendererDensity>;
|
|
3
|
+
export declare const useMarkdownRendererDensity: () => MarkdownRendererDensity;
|
|
4
|
+
//# sourceMappingURL=MarkdownRendererContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownRendererContext.d.ts","sourceRoot":"","sources":["../../../lib/components/MarkdownRenderer/MarkdownRendererContext.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,uBAAuB,GAAG,aAAa,GAAG,SAAS,CAAC;AAKhE,eAAO,MAAM,+BAA+B,mDACJ,CAAC;AAEzC,eAAO,MAAM,0BAA0B,QAAO,uBACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
const markdownRendererDensityContext = /*#__PURE__*/createContext('comfortable');
|
|
3
|
+
export const MarkdownRendererDensityProvider = markdownRendererDensityContext.Provider;
|
|
4
|
+
export const useMarkdownRendererDensity = () => useContext(markdownRendererDensityContext);
|
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import { cssLayerComponent } from '../../../styles/layers.css';
|
|
2
|
+
export declare const blockquote: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
3
|
+
density: {
|
|
4
|
+
comfortable: {
|
|
5
|
+
'@layer': {
|
|
6
|
+
[cssLayerComponent]: {
|
|
7
|
+
marginBottom: `var(--${string})`;
|
|
8
|
+
marginTop: `var(--${string})`;
|
|
9
|
+
padding: `var(--${string})`;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
compact: {
|
|
14
|
+
'@layer': {
|
|
15
|
+
[cssLayerComponent]: {
|
|
16
|
+
marginBottom: `var(--${string})`;
|
|
17
|
+
marginTop: `var(--${string})`;
|
|
18
|
+
padding: `var(--${string})`;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
2
24
|
//# sourceMappingURL=MarkdownBlockquote.css.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownBlockquote.css.d.ts","sourceRoot":"","sources":["../../../../lib/components/MarkdownRenderer/components/MarkdownBlockquote.css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MarkdownBlockquote.css.d.ts","sourceRoot":"","sources":["../../../../lib/components/MarkdownRenderer/components/MarkdownBlockquote.css.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D,eAAO,MAAM,UAAU;;;;gBAgBlB,CAAC,iBAAiB,CAAC;;;;kBAIlB;;;;;gBAKD,CAAC,iBAAiB,CAAC;;;;kBAIlB;;;;EAQJ,CAAC"}
|
|
@@ -1,21 +1,44 @@
|
|
|
1
1
|
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
2
2
|
__vanilla_filescope__.setFileScope("lib/components/MarkdownRenderer/components/MarkdownBlockquote.css.ts", "@autoguru/overdrive");
|
|
3
|
-
import {
|
|
3
|
+
import { recipe } from '@vanilla-extract/recipes';
|
|
4
4
|
import { cssLayerComponent } from "../../../styles/layers.css.js";
|
|
5
5
|
import { overdriveTokens as tokens } from "../../../themes/theme.css.js";
|
|
6
|
-
export const blockquote =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
padding: tokens.space[4],
|
|
17
|
-
paddingLeft: tokens.space[4]
|
|
6
|
+
export const blockquote = recipe({
|
|
7
|
+
base: {
|
|
8
|
+
'@layer': {
|
|
9
|
+
[cssLayerComponent]: {
|
|
10
|
+
backgroundColor: tokens.color.gamut.gray[100],
|
|
11
|
+
borderLeft: `${tokens.border.width['3']} solid ${tokens.color.gamut.gray[400]}`,
|
|
12
|
+
color: tokens.color.gamut.gray[700],
|
|
13
|
+
marginLeft: 0,
|
|
14
|
+
marginRight: 0
|
|
15
|
+
}
|
|
18
16
|
}
|
|
17
|
+
},
|
|
18
|
+
variants: {
|
|
19
|
+
density: {
|
|
20
|
+
comfortable: {
|
|
21
|
+
'@layer': {
|
|
22
|
+
[cssLayerComponent]: {
|
|
23
|
+
marginBottom: tokens.space[3],
|
|
24
|
+
marginTop: tokens.space[3],
|
|
25
|
+
padding: tokens.space[4]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
compact: {
|
|
30
|
+
'@layer': {
|
|
31
|
+
[cssLayerComponent]: {
|
|
32
|
+
marginBottom: tokens.space[2],
|
|
33
|
+
marginTop: tokens.space[2],
|
|
34
|
+
padding: tokens.space[2]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
density: 'comfortable'
|
|
19
42
|
}
|
|
20
43
|
}, "blockquote");
|
|
21
44
|
__vanilla_filescope__.endFileScope();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownBlockquote.d.ts","sourceRoot":"","sources":["../../../../lib/components/MarkdownRenderer/components/MarkdownBlockquote.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MarkdownBlockquote.d.ts","sourceRoot":"","sources":["../../../../lib/components/MarkdownRenderer/components/MarkdownBlockquote.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAM9C,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;CACf;AAED,eAAO,MAAM,kBAAkB;0CAI5B,uBAAuB;;CAWzB,CAAC"}
|
|
@@ -4,6 +4,7 @@ const _excluded = ["children", "node"];
|
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
import React from 'react';
|
|
7
|
+
import { useMarkdownRendererDensity } from "../MarkdownRendererContext.js";
|
|
7
8
|
import * as styles from "./MarkdownBlockquote.css.js";
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
10
|
export const MarkdownBlockquote = _ref => {
|
|
@@ -12,8 +13,11 @@ export const MarkdownBlockquote = _ref => {
|
|
|
12
13
|
node: _node
|
|
13
14
|
} = _ref,
|
|
14
15
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
+
const density = useMarkdownRendererDensity();
|
|
15
17
|
return /*#__PURE__*/_jsx("blockquote", _objectSpread(_objectSpread({
|
|
16
|
-
className: styles.blockquote
|
|
18
|
+
className: styles.blockquote({
|
|
19
|
+
density
|
|
20
|
+
})
|
|
17
21
|
}, props), {}, {
|
|
18
22
|
children: children
|
|
19
23
|
}));
|
|
@@ -1,3 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
import { cssLayerComponent } from '../../../styles/layers.css';
|
|
2
|
+
export declare const codeBlock: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
3
|
+
density: {
|
|
4
|
+
comfortable: {
|
|
5
|
+
'@layer': {
|
|
6
|
+
[cssLayerComponent]: {
|
|
7
|
+
fontSize: `var(--${string})`;
|
|
8
|
+
lineHeight: `var(--${string})`;
|
|
9
|
+
marginBottom: `var(--${string})`;
|
|
10
|
+
marginTop: `var(--${string})`;
|
|
11
|
+
padding: `var(--${string})`;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
compact: {
|
|
16
|
+
'@layer': {
|
|
17
|
+
[cssLayerComponent]: {
|
|
18
|
+
fontSize: `var(--${string})`;
|
|
19
|
+
lineHeight: `var(--${string})`;
|
|
20
|
+
marginBottom: `var(--${string})`;
|
|
21
|
+
marginTop: `var(--${string})`;
|
|
22
|
+
padding: `var(--${string})`;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}>;
|
|
2
28
|
export declare const codeBlockInner: string;
|
|
3
29
|
//# sourceMappingURL=MarkdownCodeBlock.css.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownCodeBlock.css.d.ts","sourceRoot":"","sources":["../../../../lib/components/MarkdownRenderer/components/MarkdownCodeBlock.css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MarkdownCodeBlock.css.d.ts","sourceRoot":"","sources":["../../../../lib/components/MarkdownRenderer/components/MarkdownCodeBlock.css.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D,eAAO,MAAM,SAAS;;;;gBAgBjB,CAAC,iBAAiB,CAAC;;;;;;kBAMlB;;;;;gBAKD,CAAC,iBAAiB,CAAC;;;;;;kBAMlB;;;;EAQJ,CAAC;AAEH,eAAO,MAAM,cAAc,QASzB,CAAC"}
|
|
@@ -1,22 +1,49 @@
|
|
|
1
1
|
import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
|
|
2
2
|
__vanilla_filescope__.setFileScope("lib/components/MarkdownRenderer/components/MarkdownCodeBlock.css.ts", "@autoguru/overdrive");
|
|
3
3
|
import { style } from '@vanilla-extract/css';
|
|
4
|
+
import { recipe } from '@vanilla-extract/recipes';
|
|
4
5
|
import { cssLayerComponent } from "../../../styles/layers.css.js";
|
|
5
6
|
import { overdriveTokens as tokens } from "../../../themes/theme.css.js";
|
|
6
|
-
export const codeBlock =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
export const codeBlock = recipe({
|
|
8
|
+
base: {
|
|
9
|
+
'@layer': {
|
|
10
|
+
[cssLayerComponent]: {
|
|
11
|
+
backgroundColor: tokens.color.gamut.gray[900],
|
|
12
|
+
borderRadius: tokens.border.radius.md,
|
|
13
|
+
color: tokens.color.gamut.white,
|
|
14
|
+
fontFamily: tokens.typography.fontFamilyMono,
|
|
15
|
+
overflowX: 'auto'
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
variants: {
|
|
20
|
+
density: {
|
|
21
|
+
comfortable: {
|
|
22
|
+
'@layer': {
|
|
23
|
+
[cssLayerComponent]: {
|
|
24
|
+
fontSize: tokens.typography.size[3].fontSize,
|
|
25
|
+
lineHeight: tokens.typography.size[3].lineHeight,
|
|
26
|
+
marginBottom: tokens.space[3],
|
|
27
|
+
marginTop: tokens.space[3],
|
|
28
|
+
padding: tokens.space[4]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
compact: {
|
|
33
|
+
'@layer': {
|
|
34
|
+
[cssLayerComponent]: {
|
|
35
|
+
fontSize: tokens.typography.size[2].fontSize,
|
|
36
|
+
lineHeight: tokens.typography.size[2].lineHeight,
|
|
37
|
+
marginBottom: tokens.space[2],
|
|
38
|
+
marginTop: tokens.space[2],
|
|
39
|
+
padding: tokens.space[2]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
19
43
|
}
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
density: 'comfortable'
|
|
20
47
|
}
|
|
21
48
|
}, "codeBlock");
|
|
22
49
|
export const codeBlockInner = style({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownCodeBlock.d.ts","sourceRoot":"","sources":["../../../../lib/components/MarkdownRenderer/components/MarkdownCodeBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MarkdownCodeBlock.d.ts","sourceRoot":"","sources":["../../../../lib/components/MarkdownRenderer/components/MarkdownCodeBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAM9C,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;CACf;AAED,eAAO,MAAM,iBAAiB;0CAI3B,sBAAsB;;CAkBxB,CAAC"}
|
|
@@ -4,6 +4,7 @@ const _excluded = ["children", "node"];
|
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
import React from 'react';
|
|
7
|
+
import { useMarkdownRendererDensity } from "../MarkdownRendererContext.js";
|
|
7
8
|
import * as styles from "./MarkdownCodeBlock.css.js";
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
10
|
export const MarkdownCodeBlock = _ref => {
|
|
@@ -12,8 +13,11 @@ export const MarkdownCodeBlock = _ref => {
|
|
|
12
13
|
node: _node
|
|
13
14
|
} = _ref,
|
|
14
15
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
+
const density = useMarkdownRendererDensity();
|
|
15
17
|
return /*#__PURE__*/_jsx("pre", _objectSpread(_objectSpread({
|
|
16
|
-
className: styles.codeBlock
|
|
18
|
+
className: styles.codeBlock({
|
|
19
|
+
density
|
|
20
|
+
})
|
|
17
21
|
}, props), {}, {
|
|
18
22
|
children: React.Children.map(children, child => {
|
|
19
23
|
if (/*#__PURE__*/React.isValidElement(child) && child.type === 'code') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownHeading.d.ts","sourceRoot":"","sources":["../../../../lib/components/MarkdownRenderer/components/MarkdownHeading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MarkdownHeading.d.ts","sourceRoot":"","sources":["../../../../lib/components/MarkdownRenderer/components/MarkdownHeading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQ9C,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;CACf;AAuDD,eAAO,MAAM,UAAU;0CArBnB,oBAAoB;;CAqB8B,CAAC;AACvD,eAAO,MAAM,UAAU;0CAtBnB,oBAAoB;;CAsB8B,CAAC;AACvD,eAAO,MAAM,UAAU;0CAvBnB,oBAAoB;;CAuB8B,CAAC;AACvD,eAAO,MAAM,UAAU;0CAxBnB,oBAAoB;;CAwB8B,CAAC;AACvD,eAAO,MAAM,UAAU;0CAzBnB,oBAAoB;;CAyB8B,CAAC;AACvD,eAAO,MAAM,UAAU;0CA1BnB,oBAAoB;;CA0B8B,CAAC"}
|
|
@@ -5,27 +5,47 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { Heading } from "../../Heading/Heading.js";
|
|
8
|
+
import { useMarkdownRendererDensity } from "../MarkdownRendererContext.js";
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
const comfortableSizeMap = {
|
|
11
|
+
h1: '9',
|
|
12
|
+
h2: '8',
|
|
13
|
+
h3: '7',
|
|
14
|
+
h4: '6',
|
|
15
|
+
h5: '5',
|
|
16
|
+
h6: '4'
|
|
17
|
+
};
|
|
18
|
+
const compactSizeMap = {
|
|
19
|
+
h1: '4',
|
|
20
|
+
h2: '4',
|
|
21
|
+
h3: '3',
|
|
22
|
+
h4: '3',
|
|
23
|
+
h5: '3',
|
|
24
|
+
h6: '3'
|
|
25
|
+
};
|
|
26
|
+
const compactWeightMap = {
|
|
27
|
+
h1: 'bold',
|
|
28
|
+
h2: 'bold',
|
|
29
|
+
h3: 'bold',
|
|
30
|
+
h4: 'semiBold',
|
|
31
|
+
h5: 'semiBold',
|
|
32
|
+
h6: 'semiBold'
|
|
33
|
+
};
|
|
9
34
|
function createHeadingComponent(level) {
|
|
10
|
-
const sizeMap = {
|
|
11
|
-
h1: '9',
|
|
12
|
-
h2: '8',
|
|
13
|
-
h3: '7',
|
|
14
|
-
h4: '6',
|
|
15
|
-
h5: '5',
|
|
16
|
-
h6: '4'
|
|
17
|
-
};
|
|
18
35
|
const Component = _ref => {
|
|
19
36
|
let {
|
|
20
37
|
children,
|
|
21
38
|
node: _node
|
|
22
39
|
} = _ref,
|
|
23
40
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
41
|
+
const density = useMarkdownRendererDensity();
|
|
42
|
+
const isCompact = density === 'compact';
|
|
24
43
|
return /*#__PURE__*/_jsx(Heading, _objectSpread(_objectSpread({
|
|
25
44
|
as: level,
|
|
26
|
-
size:
|
|
27
|
-
|
|
28
|
-
mt:
|
|
45
|
+
size: isCompact ? compactSizeMap[level] : comfortableSizeMap[level],
|
|
46
|
+
weight: isCompact ? compactWeightMap[level] : 'bold',
|
|
47
|
+
mt: isCompact ? '3' : '5',
|
|
48
|
+
mb: isCompact ? '1' : '3'
|
|
29
49
|
}, props), {}, {
|
|
30
50
|
children: children
|
|
31
51
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownHorizontalRule.d.ts","sourceRoot":"","sources":["../../../../lib/components/MarkdownRenderer/components/MarkdownHorizontalRule.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MarkdownHorizontalRule.d.ts","sourceRoot":"","sources":["../../../../lib/components/MarkdownRenderer/components/MarkdownHorizontalRule.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,WAAW,2BAA2B;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAC;CACf;AAED,eAAO,MAAM,sBAAsB;gCAGhC,2BAA2B;;CAW7B,CAAC"}
|
|
@@ -5,15 +5,21 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { DividerLine } from "../../DividerLine/DividerLine.js";
|
|
8
|
+
import { useMarkdownRendererDensity } from "../MarkdownRendererContext.js";
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
10
|
export const MarkdownHorizontalRule = _ref => {
|
|
10
11
|
let {
|
|
11
12
|
node: _node
|
|
12
13
|
} = _ref,
|
|
13
14
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}, props)
|
|
15
|
+
const density = useMarkdownRendererDensity();
|
|
16
|
+
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
17
|
+
role: "separator"
|
|
18
|
+
}, props), {}, {
|
|
19
|
+
children: /*#__PURE__*/_jsx(DividerLine, {
|
|
20
|
+
space: density === 'compact' ? '2' : '4',
|
|
21
|
+
colour: "neutral"
|
|
22
|
+
})
|
|
23
|
+
}));
|
|
18
24
|
};
|
|
19
25
|
MarkdownHorizontalRule.displayName = 'MarkdownHorizontalRule';
|
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import { cssLayerComponent } from '../../../styles/layers.css';
|
|
2
|
+
export declare const inlineCode: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
3
|
+
density: {
|
|
4
|
+
comfortable: {
|
|
5
|
+
'@layer': {
|
|
6
|
+
[cssLayerComponent]: {
|
|
7
|
+
fontSize: `var(--${string})`;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
compact: {
|
|
12
|
+
'@layer': {
|
|
13
|
+
[cssLayerComponent]: {
|
|
14
|
+
fontSize: `var(--${string})`;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
2
20
|
//# sourceMappingURL=MarkdownInlineCode.css.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownInlineCode.css.d.ts","sourceRoot":"","sources":["../../../../lib/components/MarkdownRenderer/components/MarkdownInlineCode.css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MarkdownInlineCode.css.d.ts","sourceRoot":"","sources":["../../../../lib/components/MarkdownRenderer/components/MarkdownInlineCode.css.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D,eAAO,MAAM,UAAU;;;;gBAelB,CAAC,iBAAiB,CAAC;;kBAElB;;;;;gBAKD,CAAC,iBAAiB,CAAC;;kBAElB;;;;EAQJ,CAAC"}
|