scoobie 15.0.0 → 15.2.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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "license": "MIT",
5
5
  "main": "src/index.ts",
6
6
  "sideEffects": false,
7
- "version": "15.0.0",
7
+ "version": "15.2.0",
8
8
  "dependencies": {
9
9
  "@capsizecss/core": "^3.0.0",
10
10
  "@mdx-js/react": "^1.6.22",
@@ -17,7 +17,7 @@
17
17
  "fs-extra": "^11.0.0",
18
18
  "jsonc-parser": "^3.0.0",
19
19
  "polished": "^4.1.3",
20
- "prism-react-renderer": "2.1.0",
20
+ "prism-react-renderer": "2.3.1",
21
21
  "react-keyed-flatten-children": "^2.0.0",
22
22
  "refractor": "^3.4.0",
23
23
  "remark-slug": "^6.1.0",
@@ -28,20 +28,20 @@
28
28
  "which": "^4.0.0"
29
29
  },
30
30
  "devDependencies": {
31
- "@mermaid-js/mermaid-cli": "10.4.0",
32
- "@storybook/addon-essentials": "7.4.6",
33
- "@storybook/storybook-deployer": "2.8.16",
34
- "@types/react": "18.2.25",
35
- "@types/react-dom": "18.2.10",
36
- "braid-design-system": "32.12.1",
37
- "loki": "0.32.0",
31
+ "@changesets/cli": "2.27.1",
32
+ "@changesets/get-github-info": "0.6.0",
33
+ "@mermaid-js/mermaid-cli": "10.6.1",
34
+ "@types/react": "18.2.47",
35
+ "@storybook/addon-essentials": "7.6.8",
36
+ "@types/react-dom": "18.2.18",
37
+ "braid-design-system": "32.14.4",
38
+ "loki": "0.33.1",
38
39
  "react": "18.2.0",
39
40
  "react-dom": "18.2.0",
40
41
  "react-helmet-async": "1.3.0",
41
- "react-router-dom": "6.16.0",
42
- "semantic-release": "21.1.2",
43
- "sku": "12.4.2",
44
- "webpack": "5.88.2",
42
+ "react-router-dom": "6.21.2",
43
+ "sku": "12.4.9",
44
+ "webpack": "5.89.0",
45
45
  "@mdx-js/loader": "^1.6.22"
46
46
  },
47
47
  "files": [
@@ -78,9 +78,9 @@
78
78
  "loki:test": "loki test --host host.docker.internal --port 8081",
79
79
  "loki:test:ci": "cp -R dist-storybook/. dist-storybook-tmp/ && loki --requireReference --reactUri file:./dist-storybook-tmp --chromeFlags='--headless --hide-scrollbars --no-sandbox'",
80
80
  "loki:update": "loki update --host host.docker.internal --port 8081",
81
- "release": "semantic-release --success false",
81
+ "release": "changeset publish",
82
+ "stage": "changeset version && yarn format",
82
83
  "storybook:build": "sku build-storybook",
83
- "storybook:deploy": "storybook-to-ghpages --existing-output-dir=dist-storybook",
84
84
  "storybook:start": "sku storybook",
85
85
  "test": "sku test",
86
86
  "test:ci": "sku test --coverage"
@@ -91,6 +91,7 @@ g.node foreignObject.label {
91
91
  }
92
92
 
93
93
  circle.label-container,
94
+ .node circle,
94
95
  .node path,
95
96
  .node polygon,
96
97
  .node rect {
@@ -79,7 +79,7 @@ export const CodeBlock = ({
79
79
 
80
80
  return (
81
81
  <Stack space={tablePadding}>
82
- <ScrollableInline>
82
+ <ScrollableInline whiteSpace="nowrap">
83
83
  <Box display="flex" justifyContent="spaceBetween">
84
84
  <Box display="flex">
85
85
  {children.map(({ label }, labelIndex) => (
@@ -12,7 +12,7 @@ import { DEFAULT_SIZE, type Size } from '../private/size';
12
12
 
13
13
  import { TableRow } from './TableRow';
14
14
 
15
- interface Props {
15
+ interface BaseProps {
16
16
  align?: readonly TableAlign[];
17
17
  children: ReactNode;
18
18
  header: ComponentProps<typeof Stack>['children'] | readonly string[];
@@ -21,15 +21,29 @@ interface Props {
21
21
  width?: 'full';
22
22
  }
23
23
 
24
+ type Props = BaseProps &
25
+ (
26
+ | {
27
+ overflowX: 'scroll';
28
+ whiteSpace?: 'nowrap';
29
+ }
30
+ | {
31
+ overflowX?: never;
32
+ whiteSpace?: never;
33
+ }
34
+ );
35
+
24
36
  export const Table = ({
25
37
  align,
26
38
  children,
27
39
  header,
40
+ overflowX,
28
41
  size = DEFAULT_SIZE,
29
42
  type = DEFAULT_TABLE_TYPE,
43
+ whiteSpace,
30
44
  width,
31
45
  }: Props) => (
32
- <BaseTable width={width}>
46
+ <BaseTable overflowX={overflowX} whiteSpace={whiteSpace} width={width}>
33
47
  <TableContext.Provider
34
48
  value={{
35
49
  align,
@@ -1,15 +1,18 @@
1
1
  import { Prism } from 'prism-react-renderer';
2
- // @ts-ignore
2
+ // @ts-expect-error
3
+ import bashLang from 'refractor/lang/bash';
4
+ // @ts-expect-error
3
5
  import csharpLang from 'refractor/lang/csharp';
4
- // @ts-ignore
6
+ // @ts-expect-error
5
7
  import diffLang from 'refractor/lang/diff';
6
- // @ts-ignore
8
+ // @ts-expect-error
7
9
  import httpLang from 'refractor/lang/http';
8
- // @ts-ignore
10
+ // @ts-expect-error
9
11
  import jsonLang from 'refractor/lang/json';
10
- // @ts-ignore
12
+ // @ts-expect-error
11
13
  import splunkSplLang from 'refractor/lang/splunk-spl';
12
14
 
15
+ bashLang(Prism);
13
16
  csharpLang(Prism);
14
17
  diffLang(Prism);
15
18
  httpLang(Prism);
@@ -1,4 +1,4 @@
1
- import { style } from '@vanilla-extract/css';
1
+ import { style, styleVariants } from '@vanilla-extract/css';
2
2
  import { calc } from '@vanilla-extract/css-utils';
3
3
  import { vars } from 'braid-design-system/css';
4
4
 
@@ -12,7 +12,11 @@ export const scrollX = style({
12
12
  overflowX: 'auto',
13
13
  overflowY: 'hidden',
14
14
  scrollbarWidth: 'none',
15
- whiteSpace: 'nowrap',
16
15
 
17
16
  WebkitOverflowScrolling: 'touch',
18
17
  });
18
+
19
+ export const whiteSpace = styleVariants(
20
+ { undefined, nowrap: 'nowrap' } as const,
21
+ (value) => ({ whiteSpace: value }),
22
+ );
@@ -1,16 +1,21 @@
1
- import { Box } from 'braid-design-system';
1
+ import { Bleed, Box } from 'braid-design-system';
2
2
  import React, { type ReactNode } from 'react';
3
3
 
4
4
  import * as styles from './ScrollableInline.css';
5
5
 
6
6
  interface Props {
7
7
  children: ReactNode;
8
+ whiteSpace?: 'nowrap';
8
9
  }
9
10
 
10
- export const ScrollableInline = ({ children }: Props) => (
11
- <Box className={styles.trimPaddingY}>
12
- <Box className={styles.scrollX} paddingY="small" width="full">
11
+ export const ScrollableInline = ({ children, whiteSpace }: Props) => (
12
+ <Bleed vertical="small">
13
+ <Box
14
+ className={[styles.scrollX, styles.whiteSpace[whiteSpace ?? 'undefined']]}
15
+ paddingY="small"
16
+ width="full"
17
+ >
13
18
  {children}
14
19
  </Box>
15
- </Box>
20
+ </Bleed>
16
21
  );
@@ -8,7 +8,3 @@ export const table = style({
8
8
  borderCollapse: 'separate',
9
9
  borderSpacing: 0,
10
10
  });
11
-
12
- export const tableWrapper = style({
13
- overflowX: 'auto',
14
- });
@@ -1,6 +1,7 @@
1
1
  import { Box } from 'braid-design-system';
2
- import React, { type ReactNode } from 'react';
2
+ import React, { Fragment, type ReactNode } from 'react';
3
3
 
4
+ import { ScrollableInline } from './ScrollableInline';
4
5
  import {
5
6
  DEFAULT_TABLE_CELL_COMPONENT,
6
7
  DEFAULT_TABLE_TYPE,
@@ -13,17 +14,33 @@ import * as styles from './Table.css';
13
14
 
14
15
  interface BaseTableProps {
15
16
  children: ReactNode;
17
+ overflowX?: 'scroll';
18
+ whiteSpace?: 'nowrap';
16
19
  width?: 'full';
17
20
  }
18
21
 
19
- export const BaseTable = ({ children, width }: BaseTableProps) => (
20
- <Box
21
- component="table"
22
- className={{ [styles.table]: true, [styles.fullWidth]: width === 'full' }}
23
- >
24
- {children}
25
- </Box>
26
- );
22
+ export const BaseTable = ({
23
+ children,
24
+ overflowX,
25
+ whiteSpace,
26
+ width,
27
+ }: BaseTableProps) => {
28
+ const Wrapper = overflowX === 'scroll' ? ScrollableInline : Fragment;
29
+
30
+ return (
31
+ <Wrapper {...(overflowX === 'scroll' ? { whiteSpace } : {})}>
32
+ <Box
33
+ component="table"
34
+ className={{
35
+ [styles.table]: true,
36
+ [styles.fullWidth]: width === 'full',
37
+ }}
38
+ >
39
+ {children}
40
+ </Box>
41
+ </Wrapper>
42
+ );
43
+ };
27
44
 
28
45
  interface MdxTableProps {
29
46
  children: ReactNode;
@@ -43,8 +60,8 @@ export const MdxTable = ({
43
60
  type,
44
61
  }}
45
62
  >
46
- <Box className={styles.tableWrapper}>
47
- <BaseTable>{children}</BaseTable>
48
- </Box>
63
+ <BaseTable overflowX="scroll" width="full">
64
+ {children}
65
+ </BaseTable>
49
66
  </TableContext.Provider>
50
67
  );
@@ -1,11 +1,12 @@
1
1
  import { style, styleVariants } from '@vanilla-extract/css';
2
- import { vars } from 'braid-design-system/css';
2
+
3
+ import { codeBackgroundColor } from '../../styles';
3
4
 
4
5
  export const tableRow = styleVariants({
5
6
  stripe: {
6
7
  selectors: {
7
8
  'tbody &:nth-child(odd)': {
8
- backgroundColor: vars.backgroundColor.body,
9
+ backgroundColor: codeBackgroundColor,
9
10
  },
10
11
  },
11
12
  },
package/styles/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // Braid grey.50
2
- // https://github.com/seek-oss/braid-design-system/blob/v31.14.0/lib/color/palette.ts
2
+ // https://github.com/seek-oss/braid-design-system/blob/braid-design-system%4032.14.4/packages/braid-design-system/src/lib/color/palette.ts#L13
3
3
  export const codeBackgroundColor = '#F7F8FB';
4
4
 
5
5
  // SEEK's corporate font + GitHub defaults