braid-design-system 31.0.0 → 31.1.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/.nvmrc CHANGED
@@ -1 +1 @@
1
- 12.14.1
1
+ 16.13.0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # braid-design-system
2
2
 
3
+ ## 31.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - **IconTip:** Add tip icon ([#1040](https://github.com/seek-oss/braid-design-system/pull/1040))
8
+
9
+ - **IconZoomIn, IconZoomOut:** Add zoom in/out icons ([#1035](https://github.com/seek-oss/braid-design-system/pull/1035))
10
+
3
11
  ## 31.0.0
4
12
 
5
13
  ### Major Changes
@@ -0,0 +1,31 @@
1
+ import React, { forwardRef } from 'react';
2
+ import { atoms, Atoms } from '../../css/atoms/atoms';
3
+ import { sprinkles } from '../../css/atoms/sprinkles.css';
4
+ import { Box as BraidBox, BoxProps } from './Box';
5
+
6
+ export const Box = forwardRef<HTMLElement, BoxProps>((props, ref) => {
7
+ const sprinklesProps: Record<string, unknown> = {};
8
+ const otherProps: Record<string, unknown> = {};
9
+
10
+ for (const key in props) {
11
+ if (sprinkles.properties.has(key as keyof Omit<Atoms, 'reset'>)) {
12
+ const value = props[key as keyof typeof props];
13
+ try {
14
+ // Try passing to atoms, if sprinkle property but value is not
15
+ // valid, property will be left out until value is valid.
16
+ atoms({ [key]: value });
17
+ sprinklesProps[key] = value;
18
+ } catch (e) {
19
+ if (key === 'background' && /^customDark|customLight$/.test(value)) {
20
+ sprinklesProps[key] = value;
21
+ }
22
+ }
23
+ } else {
24
+ otherProps[key] = props[key as keyof typeof props];
25
+ }
26
+ }
27
+
28
+ return <BraidBox ref={ref} {...sprinklesProps} {...otherProps} />;
29
+ });
30
+
31
+ Box.displayName = 'Box';
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { ReactNode } from 'react';
2
3
  import source from '../../utils/source.macro';
3
4
  import { ComponentDocs } from '../../../site/src/types';
4
5
  import {
@@ -13,7 +14,6 @@ import {
13
14
  Notice,
14
15
  } from '../';
15
16
  import { Placeholder } from '../../playroom/components';
16
- import { ReactNode } from 'markdown-to-jsx/node_modules/@types/react';
17
17
 
18
18
  const Container = ({ children }: { children: ReactNode }) => (
19
19
  <Box maxWidth="xsmall">{children}</Box>
@@ -21,12 +21,12 @@ export const root = style({
21
21
  },
22
22
  });
23
23
 
24
- export const realField = style({
25
- height: hitArea,
26
- selectors: {
27
- ...debugTouchable(),
24
+ export const realField = style([
25
+ {
26
+ height: hitArea,
28
27
  },
29
- });
28
+ debugTouchable(),
29
+ ]);
30
30
 
31
31
  export const realFieldPosition = styleVariants(sizes, (size) => ({
32
32
  top: calc(hitArea)
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { ComponentDocs } from '../../../../site/src/types';
3
+ import source from '../../../utils/source.macro';
4
+ import { IconTip, Heading, Stack } from '../../';
5
+
6
+ const docs: ComponentDocs = {
7
+ category: 'Icon',
8
+ migrationGuide: true,
9
+ Example: () =>
10
+ source(
11
+ <Stack space="none" align="center">
12
+ <Heading component="div" level="1">
13
+ <IconTip />
14
+ </Heading>
15
+ </Stack>,
16
+ ),
17
+ alternatives: [],
18
+ };
19
+
20
+ export default docs;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { Box } from '../../Box/Box';
3
+ import useIcon, { UseIconProps } from '../../../hooks/useIcon';
4
+ import { IconTipSvg } from './IconTipSvg';
5
+
6
+ export type IconTipProps = UseIconProps;
7
+
8
+ export const IconTip = (props: IconTipProps) => {
9
+ const iconProps = useIcon(props);
10
+
11
+ return <Box component={IconTipSvg} {...iconProps} />;
12
+ };
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+
3
+ import type { SVGProps } from '../SVGTypes';
4
+
5
+ export const IconTipSvg = ({ title, titleId, ...props }: SVGProps) => (
6
+ <svg
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ width={16}
9
+ height={16}
10
+ viewBox="0 0 24 24"
11
+ focusable="false"
12
+ fill="currentColor"
13
+ aria-labelledby={titleId}
14
+ {...props}
15
+ >
16
+ {title ? <title id={titleId}>{title}</title> : null}
17
+ <path d="M9 18.957a1 1 0 0 1-1-1V16a8.96 8.96 0 0 0-1.485-2.633l-.277-.391a7 7 0 1 1 11.524 0l-.277.391A8.96 8.96 0 0 0 16 16v1.932a1 1 0 0 1-2 0V16c0-1.095.878-2.419 1.856-3.793l.261-.368a5 5 0 1 0-8.234 0l.26.368C9.124 13.581 10 14.905 10 16v1.957a1 1 0 0 1-1 1z" />
18
+ <path d="M13.286 22h-2.572A2.761 2.761 0 0 1 8 19.2V17a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2.2a2.761 2.761 0 0 1-2.714 2.8zM10 18v1.2a.761.761 0 0 0 .714.8h2.572a.761.761 0 0 0 .714-.8V18zm13-8h-2a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2zm-1.475 5.5a.994.994 0 0 1-.499-.134l-1.732-1a1 1 0 1 1 1-1.732l1.732 1a1 1 0 0 1-.5 1.866zm-1.73-10a1 1 0 0 1-.501-1.866l1.732-1a1 1 0 1 1 1 1.732l-1.732 1a.994.994 0 0 1-.5.134zM3 10H1a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2zm-.525 5.5a1 1 0 0 1-.501-1.866l1.732-1a1 1 0 1 1 1 1.732l-1.732 1a.994.994 0 0 1-.5.134zm1.73-10a.994.994 0 0 1-.499-.134l-1.732-1a1 1 0 0 1 1-1.732l1.732 1a1 1 0 0 1-.5 1.866zM15 10a1 1 0 0 1-1-1 2.003 2.003 0 0 0-2-2 1 1 0 0 1 0-2 4.004 4.004 0 0 1 4 4 1 1 0 0 1-1 1z" />
19
+ <path d="M14 21a2 2 0 0 1-4 0" />
20
+ </svg>
21
+ );
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { ComponentDocs } from '../../../../site/src/types';
3
+ import source from '../../../utils/source.macro';
4
+ import { IconZoomIn, Heading, Stack } from '../../';
5
+
6
+ const docs: ComponentDocs = {
7
+ category: 'Icon',
8
+ migrationGuide: true,
9
+ Example: () =>
10
+ source(
11
+ <Stack space="none" align="center">
12
+ <Heading component="div" level="1">
13
+ <IconZoomIn />
14
+ </Heading>
15
+ </Stack>,
16
+ ),
17
+ alternatives: [],
18
+ };
19
+
20
+ export default docs;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { Box } from '../../Box/Box';
3
+ import useIcon, { UseIconProps } from '../../../hooks/useIcon';
4
+ import { IconZoomInSvg } from './IconZoomInSvg';
5
+
6
+ export type IconZoomInProps = UseIconProps;
7
+
8
+ export const IconZoomIn = (props: IconZoomInProps) => {
9
+ const iconProps = useIcon(props);
10
+
11
+ return <Box component={IconZoomInSvg} {...iconProps} />;
12
+ };
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+
3
+ import type { SVGProps } from '../SVGTypes';
4
+
5
+ export const IconZoomInSvg = ({ title, titleId, ...props }: SVGProps) => (
6
+ <svg
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ width={16}
9
+ height={16}
10
+ viewBox="0 0 24 24"
11
+ focusable="false"
12
+ fill="currentColor"
13
+ aria-labelledby={titleId}
14
+ {...props}
15
+ >
16
+ {title ? <title id={titleId}>{title}</title> : null}
17
+ <path d="m21.707 20.293-3.682-3.682a9.022 9.022 0 1 0-1.414 1.414l3.682 3.682a1 1 0 0 0 1.414-1.414zM4 11a7 7 0 1 1 11.962 4.93c-.006.006-.013.008-.019.013s-.007.013-.012.02A6.995 6.995 0 0 1 4 11z" />
18
+ <path d="M14 10h-2V8a1 1 0 0 0-2 0v2H8a1 1 0 0 0 0 2h2v2a1 1 0 0 0 2 0v-2h2a1 1 0 0 0 0-2z" />
19
+ </svg>
20
+ );
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { ComponentDocs } from '../../../../site/src/types';
3
+ import source from '../../../utils/source.macro';
4
+ import { IconZoomOut, Heading, Stack } from '../../';
5
+
6
+ const docs: ComponentDocs = {
7
+ category: 'Icon',
8
+ migrationGuide: true,
9
+ Example: () =>
10
+ source(
11
+ <Stack space="none" align="center">
12
+ <Heading component="div" level="1">
13
+ <IconZoomOut />
14
+ </Heading>
15
+ </Stack>,
16
+ ),
17
+ alternatives: [],
18
+ };
19
+
20
+ export default docs;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { Box } from '../../Box/Box';
3
+ import useIcon, { UseIconProps } from '../../../hooks/useIcon';
4
+ import { IconZoomOutSvg } from './IconZoomOutSvg';
5
+
6
+ export type IconZoomOutProps = UseIconProps;
7
+
8
+ export const IconZoomOut = (props: IconZoomOutProps) => {
9
+ const iconProps = useIcon(props);
10
+
11
+ return <Box component={IconZoomOutSvg} {...iconProps} />;
12
+ };
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+
3
+ import type { SVGProps } from '../SVGTypes';
4
+
5
+ export const IconZoomOutSvg = ({ title, titleId, ...props }: SVGProps) => (
6
+ <svg
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ width={16}
9
+ height={16}
10
+ viewBox="0 0 24 24"
11
+ focusable="false"
12
+ fill="currentColor"
13
+ aria-labelledby={titleId}
14
+ {...props}
15
+ >
16
+ {title ? <title id={titleId}>{title}</title> : null}
17
+ <path d="m21.707 20.293-3.682-3.682a9.022 9.022 0 1 0-1.414 1.414l3.682 3.682a1 1 0 0 0 1.414-1.414zM4 11a7 7 0 1 1 11.962 4.93c-.006.006-.013.008-.019.013s-.007.013-.012.02A6.995 6.995 0 0 1 4 11z" />
18
+ <path d="M14 10H8a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2z" />
19
+ </svg>
20
+ );
@@ -69,7 +69,10 @@ export { IconTag } from './IconTag/IconTag';
69
69
  export { IconThumb } from './IconThumb/IconThumb';
70
70
  export { IconTick } from './IconTick/IconTick';
71
71
  export { IconTime } from './IconTime/IconTime';
72
+ export { IconTip } from './IconTip/IconTip';
72
73
  export { IconUpload } from './IconUpload/IconUpload';
73
74
  export { IconVideo } from './IconVideo/IconVideo';
74
75
  export { IconVisibility } from './IconVisibility/IconVisibility';
75
76
  export { IconWorkExperience } from './IconWorkExperience/IconWorkExperience';
77
+ export { IconZoomIn } from './IconZoomIn/IconZoomIn';
78
+ export { IconZoomOut } from './IconZoomOut/IconZoomOut';
@@ -19,13 +19,13 @@ export const root = style({
19
19
  },
20
20
  });
21
21
 
22
- export const realField = style({
23
- width: hitArea,
24
- height: hitArea,
25
- selectors: {
26
- ...debugTouchable(),
22
+ export const realField = style([
23
+ {
24
+ width: hitArea,
25
+ height: hitArea,
27
26
  },
28
- });
27
+ debugTouchable(),
28
+ ]);
29
29
 
30
30
  export const realFieldPosition = styleVariants(sizes, (size: Size) => {
31
31
  const offset = calc(hitArea)
@@ -1,13 +1,13 @@
1
- import { Style } from 'sku/treat';
1
+ import type { StyleRule } from '@vanilla-extract/css';
2
2
 
3
- type SelectorMap = Style['selectors'];
4
-
5
- export const debugTouchable = ({ after = false } = {}): SelectorMap =>
3
+ export const debugTouchable = ({ after = false } = {}): StyleRule =>
6
4
  process.env.NODE_ENV === 'production'
7
5
  ? {}
8
6
  : {
9
- [`[data-braid-debug] &${after ? ':after' : ''}`]: {
10
- background: 'red',
11
- opacity: 0.2,
7
+ selectors: {
8
+ [`[data-braid-debug] &${after ? ':after' : ''}`]: {
9
+ background: 'red',
10
+ opacity: 0.2,
11
+ },
12
12
  },
13
13
  };
@@ -3,19 +3,19 @@ import { style } from '@vanilla-extract/css';
3
3
  import { debugTouchable } from './debugTouchable';
4
4
  import { virtualTouchableRules } from './virtualTouchableRules';
5
5
 
6
- export const virtualTouchable = style({
7
- position: 'relative',
8
- ':after': {
9
- content: '""',
10
- position: 'absolute',
11
- left: -10,
12
- right: -10,
13
- ...virtualTouchableRules,
14
- },
15
- selectors: {
16
- ...debugTouchable({ after: true }),
6
+ export const virtualTouchable = style([
7
+ {
8
+ position: 'relative',
9
+ ':after': {
10
+ content: '""',
11
+ position: 'absolute',
12
+ left: -10,
13
+ right: -10,
14
+ ...virtualTouchableRules,
15
+ },
17
16
  },
18
- });
17
+ debugTouchable({ after: true }),
18
+ ]);
19
19
 
20
20
  export const yAxisOnly = style({
21
21
  ':after': {
@@ -6,6 +6,7 @@ export { AccordionItem } from '../components/Accordion/AccordionItem.playroom';
6
6
  export { Alert } from '../components/Alert/Alert.playroom';
7
7
  export { Autosuggest } from '../components/Autosuggest/Autosuggest.playroom';
8
8
  export { Badge } from '../components/Badge/Badge.playroom';
9
+ export { Box } from '../components/Box/Box.playroom';
9
10
  export { Button } from '../components/Button/Button.playroom';
10
11
  export { ButtonLink } from '../components/ButtonLink/ButtonLink.playroom';
11
12
  export { Card } from '../components/Card/Card.playroom';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-design-system",
3
- "version": "31.0.0",
3
+ "version": "31.1.0",
4
4
  "description": "Themeable design system for the SEEK Group",
5
5
  "main": "lib/components/index.ts",
6
6
  "sideEffects": [