@automattic/vip-design-system 0.23.6 → 0.23.7

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.
@@ -26,9 +26,9 @@ var Link = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwardRef)
26
26
  props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
27
27
  return (0, _jsxRuntime.jsx)(_themeUi.Link, (0, _extends2["default"])({
28
28
  sx: (0, _extends2["default"])({
29
- color: active ? 'links.active' : 'link',
30
29
  textDdecorationThickness: '0.1em',
31
30
  textUnderlineOffset: '0.1em',
31
+ color: active ? 'links.active' : 'link',
32
32
  '&:visited': {
33
33
  color: 'links.visited'
34
34
  },
@@ -96,7 +96,16 @@ var Notice = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, forwardR
96
96
  color: color + ".90",
97
97
  a: {
98
98
  color: color + ".90",
99
- border: 'none'
99
+ '&:visited': {
100
+ color: color + ".90"
101
+ },
102
+ '&:active': {
103
+ color: color + ".90"
104
+ },
105
+ '&:hover, &:focus': {
106
+ color: color + ".90",
107
+ textDecoration: 'none'
108
+ }
100
109
  }
101
110
  }, sx),
102
111
  className: (0, _classnames["default"])('vip-notice-component', className),
@@ -44,8 +44,8 @@ var Default = function Default() {
44
44
  sx: {
45
45
  mb: 4
46
46
  },
47
- children: ["It looks like you\u2018re ready to share your ", (0, _jsxRuntime.jsx)("a", {
48
- href: "#",
47
+ children: ["It looks like you\u2018re ready to share your", ' ', (0, _jsxRuntime.jsx)(_.Link, {
48
+ href: "https://google.com/",
49
49
  children: "application with the world."
50
50
  })]
51
51
  }), (0, _jsxRuntime.jsx)(_.Notice, {
@@ -64,13 +64,15 @@ var Wizard = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwardRe
64
64
  }) : steps.map(function (_ref3, index) {
65
65
  var title = _ref3.title,
66
66
  subTitle = _ref3.subTitle,
67
- children = _ref3.children;
67
+ children = _ref3.children,
68
+ titleVariant = _ref3.titleVariant;
68
69
  return (0, _jsxRuntime.jsx)(_.WizardStep, {
69
70
  active: index === activeStep,
70
71
  complete: completed.includes(index),
71
72
  order: index + 1,
72
73
  subTitle: subTitle,
73
74
  title: title,
75
+ titleVariant: titleVariant,
74
76
  children: children
75
77
  }, index);
76
78
  })
@@ -29,6 +29,7 @@ exports["default"] = _default;
29
29
  var Default = function Default() {
30
30
  var steps = [{
31
31
  title: 'Choose Domain',
32
+ titleVariant: 'h2',
32
33
  subTitle: 'You can bring a domain name you already own, or buy a new one.',
33
34
  children: (0, _jsxRuntime.jsxs)(_.Box, {
34
35
  children: [(0, _jsxRuntime.jsx)(_.Label, {
@@ -41,45 +42,24 @@ var Default = function Default() {
41
42
  })]
42
43
  })
43
44
  }, {
44
- title: 'Configure DNS'
45
+ title: 'Configure DNS',
46
+ titleVariant: 'h2'
45
47
  }, {
46
- title: 'Configure Certificate'
48
+ title: 'Configure Certificate',
49
+ titleVariant: 'h2'
47
50
  }, {
48
- title: 'Verify Domain'
51
+ title: 'Verify Domain',
52
+ titleVariant: 'h2'
49
53
  }];
50
- return (0, _jsxRuntime.jsxs)(_react["default"].Fragment, {
51
- children: [(0, _jsxRuntime.jsx)(_.Flex, {
52
- sx: {
53
- alignItems: 'center'
54
- },
55
- children: (0, _jsxRuntime.jsx)(_.Box, {
56
- sx: {
57
- flex: '1 1 auto'
58
- },
59
- children: (0, _jsxRuntime.jsxs)(_.Heading, {
60
- variant: "h1",
61
- sx: {
62
- display: 'flex',
63
- alignItems: 'center',
64
- mb: 1
65
- },
66
- children: ["Add Domain: ", (0, _jsxRuntime.jsx)("span", {
67
- sx: {
68
- color: 'muted',
69
- ml: 2
70
- },
71
- children: "Production"
72
- })]
73
- })
74
- })
75
- }), (0, _jsxRuntime.jsx)(_.Box, {
54
+ return (0, _jsxRuntime.jsx)(_react["default"].Fragment, {
55
+ children: (0, _jsxRuntime.jsx)(_.Box, {
76
56
  mt: 4,
77
57
  children: (0, _jsxRuntime.jsx)(_.Wizard, {
78
58
  activeStep: 0,
79
59
  steps: steps,
80
60
  className: "vip-wizard-xyz"
81
61
  })
82
- })]
62
+ })
83
63
  });
84
64
  };
85
65
 
@@ -31,7 +31,9 @@ var WizardStep = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwa
31
31
  complete = _ref$complete === void 0 ? false : _ref$complete,
32
32
  children = _ref.children,
33
33
  active = _ref.active,
34
- order = _ref.order;
34
+ order = _ref.order,
35
+ _ref$titleVariant = _ref.titleVariant,
36
+ titleVariant = _ref$titleVariant === void 0 ? 'h3' : _ref$titleVariant;
35
37
  var borderLeftColor = 'border';
36
38
 
37
39
  if (complete) {
@@ -49,6 +51,7 @@ var WizardStep = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwa
49
51
  }
50
52
 
51
53
  return (0, _jsxRuntime.jsxs)(_.Card, {
54
+ as: "section",
52
55
  sx: {
53
56
  boxShadow: active ? 'low' : 'none',
54
57
  borderLeft: '2px solid',
@@ -68,12 +71,14 @@ var WizardStep = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwa
68
71
  "data-active": active || undefined,
69
72
  ref: forwardRef,
70
73
  children: [typeof title === 'string' ? (0, _jsxRuntime.jsxs)(_.Heading, {
71
- variant: "h4",
74
+ variant: titleVariant,
72
75
  sx: {
73
76
  mb: 0,
74
77
  display: 'flex',
75
78
  alignItems: 'center',
76
- color: color
79
+ color: color,
80
+ fontSize: 2,
81
+ fontWeight: active ? 'bold' : 'normal'
77
82
  },
78
83
  children: [(0, _jsxRuntime.jsx)(_md.MdCheckCircle, {
79
84
  "aria-hidden": "true",
@@ -109,5 +114,6 @@ WizardStep.propTypes = {
109
114
  complete: _propTypes["default"].bool,
110
115
  order: _propTypes["default"].number.isRequired,
111
116
  subTitle: _propTypes["default"].node,
112
- title: _propTypes["default"].node
117
+ title: _propTypes["default"].node,
118
+ titleVariant: _propTypes["default"].string
113
119
  };
@@ -27,14 +27,17 @@ var _jsxRuntime = require("theme-ui/jsx-runtime");
27
27
  var WizardStepHorizontal = /*#__PURE__*/_react["default"].forwardRef(function (_ref, forwardRef) {
28
28
  var title = _ref.title,
29
29
  active = _ref.active,
30
- order = _ref.order;
30
+ order = _ref.order,
31
+ _ref$titleVariant = _ref.titleVariant,
32
+ titleVariant = _ref$titleVariant === void 0 ? 'h3' : _ref$titleVariant;
31
33
  var color = active ? 'heading' : 'muted';
32
34
  return typeof title === 'string' ? (0, _jsxRuntime.jsxs)(_.Heading, {
33
- variant: "h4",
35
+ variant: titleVariant,
34
36
  sx: {
35
37
  mb: 0,
36
38
  display: 'flex',
37
39
  alignItems: 'center',
40
+ fontSize: 2,
38
41
  color: color
39
42
  },
40
43
  "data-step": order,
@@ -66,5 +69,6 @@ WizardStepHorizontal.propTypes = {
66
69
  active: _propTypes["default"].bool,
67
70
  order: _propTypes["default"].number.isRequired,
68
71
  subTitle: _propTypes["default"].node,
69
- title: _propTypes["default"].node
72
+ title: _propTypes["default"].node,
73
+ titleVariant: _propTypes["default"].string
70
74
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/vip-design-system",
3
- "version": "0.23.6",
3
+ "version": "0.23.7",
4
4
  "main": "build/system/index.js",
5
5
  "scripts": {
6
6
  "build-storybook": "build-storybook",
@@ -10,9 +10,9 @@ import PropTypes from 'prop-types';
10
10
  const Link = React.forwardRef( ( { active = false, sx, ...props }, forwardRef ) => (
11
11
  <ThemeLink
12
12
  sx={ {
13
- color: active ? 'links.active' : 'link',
14
13
  textDdecorationThickness: '0.1em',
15
14
  textUnderlineOffset: '0.1em',
15
+ color: active ? 'links.active' : 'link',
16
16
  '&:visited': {
17
17
  color: 'links.visited',
18
18
  },
@@ -74,7 +74,16 @@ const Notice = React.forwardRef(
74
74
  color: `${ color }.90`,
75
75
  a: {
76
76
  color: `${ color }.90`,
77
- border: 'none',
77
+ '&:visited': {
78
+ color: `${ color }.90`,
79
+ },
80
+ '&:active': {
81
+ color: `${ color }.90`,
82
+ },
83
+ '&:hover, &:focus': {
84
+ color: `${ color }.90`,
85
+ textDecoration: 'none',
86
+ },
78
87
  },
79
88
  ...sx,
80
89
  } }
@@ -6,7 +6,7 @@
6
6
  * Internal dependencies
7
7
  */
8
8
  import React from 'react';
9
- import { Notice, Text } from '..';
9
+ import { Notice, Text, Link } from '..';
10
10
 
11
11
  export default {
12
12
  title: 'Notice',
@@ -27,7 +27,8 @@ export const Default = () => (
27
27
  </Notice>
28
28
 
29
29
  <Notice variant="success" sx={ { mb: 4 } }>
30
- It looks like you&lsquo;re ready to share your <a href="#">application with the world.</a>
30
+ It looks like you&lsquo;re ready to share your{ ' ' }
31
+ <Link href="https://google.com/">application with the world.</Link>
31
32
  </Notice>
32
33
 
33
34
  <Notice sx={ { mb: 4 } } title="This notice has only the title prop passed" />
@@ -43,7 +43,7 @@ const Wizard = React.forwardRef(
43
43
  { steps[ activeStep ].children }
44
44
  </Box>
45
45
  ) : (
46
- steps.map( ( { title, subTitle, children }, index ) => (
46
+ steps.map( ( { title, subTitle, children, titleVariant }, index ) => (
47
47
  <WizardStep
48
48
  active={ index === activeStep }
49
49
  complete={ completed.includes( index ) }
@@ -51,6 +51,7 @@ const Wizard = React.forwardRef(
51
51
  order={ index + 1 }
52
52
  subTitle={ subTitle }
53
53
  title={ title }
54
+ titleVariant={ titleVariant }
54
55
  >
55
56
  { children }
56
57
  </WizardStep>
@@ -8,7 +8,7 @@ import React from 'react';
8
8
  /**
9
9
  * Internal dependencies
10
10
  */
11
- import { Wizard, Flex, Box, Heading, Label, Input, Button } from '..';
11
+ import { Wizard, Box, Label, Input, Button } from '..';
12
12
 
13
13
  export default {
14
14
  title: 'Wizard',
@@ -19,6 +19,7 @@ export const Default = () => {
19
19
  const steps = [
20
20
  {
21
21
  title: 'Choose Domain',
22
+ titleVariant: 'h2',
22
23
  subTitle: 'You can bring a domain name you already own, or buy a new one.',
23
24
  children: (
24
25
  <Box>
@@ -30,23 +31,19 @@ export const Default = () => {
30
31
  },
31
32
  {
32
33
  title: 'Configure DNS',
34
+ titleVariant: 'h2',
33
35
  },
34
36
  {
35
37
  title: 'Configure Certificate',
38
+ titleVariant: 'h2',
36
39
  },
37
40
  {
38
41
  title: 'Verify Domain',
42
+ titleVariant: 'h2',
39
43
  },
40
44
  ];
41
45
  return (
42
46
  <React.Fragment>
43
- <Flex sx={ { alignItems: 'center' } }>
44
- <Box sx={ { flex: '1 1 auto' } }>
45
- <Heading variant="h1" sx={ { display: 'flex', alignItems: 'center', mb: 1 } }>
46
- Add Domain: <span sx={ { color: 'muted', ml: 2 } }>Production</span>
47
- </Heading>
48
- </Box>
49
- </Flex>
50
47
  <Box mt={ 4 }>
51
48
  <Wizard activeStep={ 0 } steps={ steps } className="vip-wizard-xyz" />
52
49
  </Box>
@@ -13,7 +13,10 @@ import PropTypes from 'prop-types';
13
13
  import { Card, Heading, Text, Flex } from '..';
14
14
 
15
15
  const WizardStep = React.forwardRef(
16
- ( { title, subTitle, complete = false, children, active, order }, forwardRef ) => {
16
+ (
17
+ { title, subTitle, complete = false, children, active, order, titleVariant = 'h3' },
18
+ forwardRef
19
+ ) => {
17
20
  let borderLeftColor = 'border';
18
21
 
19
22
  if ( complete ) {
@@ -32,6 +35,7 @@ const WizardStep = React.forwardRef(
32
35
 
33
36
  return (
34
37
  <Card
38
+ as="section"
35
39
  sx={ {
36
40
  boxShadow: active ? 'low' : 'none',
37
41
  borderLeft: '2px solid',
@@ -53,12 +57,14 @@ const WizardStep = React.forwardRef(
53
57
  >
54
58
  { typeof title === 'string' ? (
55
59
  <Heading
56
- variant="h4"
60
+ variant={ titleVariant }
57
61
  sx={ {
58
62
  mb: 0,
59
63
  display: 'flex',
60
64
  alignItems: 'center',
61
- color: color,
65
+ color,
66
+ fontSize: 2,
67
+ fontWeight: active ? 'bold' : 'normal',
62
68
  } }
63
69
  >
64
70
  <MdCheckCircle aria-hidden="true" sx={ { mr: 2 } } />
@@ -88,6 +94,7 @@ WizardStep.propTypes = {
88
94
  order: PropTypes.number.isRequired,
89
95
  subTitle: PropTypes.node,
90
96
  title: PropTypes.node,
97
+ titleVariant: PropTypes.string,
91
98
  };
92
99
 
93
100
  export { WizardStep };
@@ -12,32 +12,35 @@ import PropTypes from 'prop-types';
12
12
  */
13
13
  import { Heading, Flex } from '..';
14
14
 
15
- const WizardStepHorizontal = React.forwardRef( ( { title, active, order }, forwardRef ) => {
16
- const color = active ? 'heading' : 'muted';
15
+ const WizardStepHorizontal = React.forwardRef(
16
+ ( { title, active, order, titleVariant = 'h3' }, forwardRef ) => {
17
+ const color = active ? 'heading' : 'muted';
17
18
 
18
- return typeof title === 'string' ? (
19
- <Heading
20
- variant="h4"
21
- sx={ {
22
- mb: 0,
23
- display: 'flex',
24
- alignItems: 'center',
25
- color,
26
- } }
27
- data-step={ order }
28
- data-active={ active || undefined }
29
- ref={ forwardRef }
30
- >
31
- <MdCheckCircle aria-hidden="true" sx={ { mr: 2 } } />
32
- { title }
33
- </Heading>
34
- ) : (
35
- <Flex sx={ { alignItems: 'center', color } }>
36
- <MdCheckCircle aria-hidden="true" sx={ { mr: 2 } } />
37
- { title }
38
- </Flex>
39
- );
40
- } );
19
+ return typeof title === 'string' ? (
20
+ <Heading
21
+ variant={ titleVariant }
22
+ sx={ {
23
+ mb: 0,
24
+ display: 'flex',
25
+ alignItems: 'center',
26
+ fontSize: 2,
27
+ color,
28
+ } }
29
+ data-step={ order }
30
+ data-active={ active || undefined }
31
+ ref={ forwardRef }
32
+ >
33
+ <MdCheckCircle aria-hidden="true" sx={ { mr: 2 } } />
34
+ { title }
35
+ </Heading>
36
+ ) : (
37
+ <Flex sx={ { alignItems: 'center', color } }>
38
+ <MdCheckCircle aria-hidden="true" sx={ { mr: 2 } } />
39
+ { title }
40
+ </Flex>
41
+ );
42
+ }
43
+ );
41
44
 
42
45
  WizardStepHorizontal.displayName = 'WizardStepHorizontal';
43
46
 
@@ -46,6 +49,7 @@ WizardStepHorizontal.propTypes = {
46
49
  order: PropTypes.number.isRequired,
47
50
  subTitle: PropTypes.node,
48
51
  title: PropTypes.node,
52
+ titleVariant: PropTypes.string,
49
53
  };
50
54
 
51
55
  export { WizardStepHorizontal };