@automattic/vip-design-system 2.13.4 → 2.13.5

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.
@@ -44,7 +44,8 @@ export var Wizard = /*#__PURE__*/React.forwardRef(function (_ref, forwardRef) {
44
44
  children = _ref2.children,
45
45
  titleVariant = _ref2.titleVariant,
46
46
  summary = _ref2.summary,
47
- onChange = _ref2.onChange;
47
+ onChange = _ref2.onChange,
48
+ actionLabel = _ref2.actionLabel;
48
49
  return _jsx(WizardStep, {
49
50
  active: index === activeStep,
50
51
  complete: completed.includes(index),
@@ -57,6 +58,7 @@ export var Wizard = /*#__PURE__*/React.forwardRef(function (_ref, forwardRef) {
57
58
  summary: summary,
58
59
  onChange: onChange,
59
60
  shouldFocusTitle: titleAutofocus && didMount,
61
+ actionLabel: actionLabel,
60
62
  children: children
61
63
  }, index);
62
64
  })
@@ -93,6 +93,7 @@ export var WithTitleAutoFocus = function WithTitleAutoFocus() {
93
93
  onChange: function onChange() {
94
94
  return setActiveStep(1);
95
95
  },
96
+ actionLabel: 'Edit',
96
97
  children: _jsxs(Box, {
97
98
  children: [_jsx(Label, {
98
99
  children: "DNS"
@@ -21,5 +21,6 @@ export interface WizardStepProps {
21
21
  onChange?: () => void;
22
22
  summary?: WizardStepSummary[];
23
23
  shouldFocusTitle?: boolean;
24
+ actionLabel?: string;
24
25
  }
25
26
  export declare const WizardStep: React.ForwardRefExoticComponent<WizardStepProps & React.RefAttributes<HTMLDivElement>>;
@@ -28,7 +28,9 @@ export var WizardStep = /*#__PURE__*/React.forwardRef(function (_ref, forwardRef
28
28
  _ref$titleVariant = _ref.titleVariant,
29
29
  titleVariant = _ref$titleVariant === void 0 ? 'h3' : _ref$titleVariant,
30
30
  summary = _ref.summary,
31
- onChange = _ref.onChange;
31
+ onChange = _ref.onChange,
32
+ _ref$actionLabel = _ref.actionLabel,
33
+ actionLabel = _ref$actionLabel === void 0 ? 'Change' : _ref$actionLabel;
32
34
  var titleRef = React.useRef(null);
33
35
  var status = 'inactive';
34
36
  var statusText = 'Step not completed';
@@ -129,7 +131,7 @@ export var WizardStep = /*#__PURE__*/React.forwardRef(function (_ref, forwardRef
129
131
  height: 'auto',
130
132
  alignSelf: 'flex-end'
131
133
  },
132
- children: ["Change ", _jsx(ScreenReaderText, {
134
+ children: [actionLabel, ' ', _jsx(ScreenReaderText, {
133
135
  children: "the " + (title == null ? void 0 : title.toString()) + " step"
134
136
  })]
135
137
  })]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/vip-design-system",
3
- "version": "2.13.4",
3
+ "version": "2.13.5",
4
4
  "main": "build/system/index.js",
5
5
  "scripts": {
6
6
  "build-storybook": "storybook build",
@@ -80,6 +80,7 @@ export const WithTitleAutoFocus = () => {
80
80
  title: 'Configure DNS',
81
81
  titleVariant: 'h2',
82
82
  onChange: () => setActiveStep( 1 ),
83
+ actionLabel: 'Edit',
83
84
  children: (
84
85
  <Box>
85
86
  <Label>DNS</Label>
@@ -36,24 +36,30 @@ export const Wizard = React.forwardRef< HTMLDivElement, WizardProps >(
36
36
  }, [ initialStep, activeStep, didMount, setDidMount ] );
37
37
  return (
38
38
  <Box className={ classNames( 'vip-wizard-component', className ) } ref={ forwardRef }>
39
- { steps.map( ( { title, subTitle, children, titleVariant, summary, onChange }, index ) => (
40
- <WizardStep
41
- active={ index === activeStep }
42
- complete={ completed.includes( index ) }
43
- skipped={ skipped.includes( index ) }
44
- key={ index }
45
- order={ index + 1 }
46
- totalSteps={ steps.length }
47
- subTitle={ subTitle }
48
- title={ title }
49
- titleVariant={ titleVariant }
50
- summary={ summary }
51
- onChange={ onChange }
52
- shouldFocusTitle={ titleAutofocus && didMount }
53
- >
54
- { children }
55
- </WizardStep>
56
- ) ) }
39
+ { steps.map(
40
+ (
41
+ { title, subTitle, children, titleVariant, summary, onChange, actionLabel },
42
+ index
43
+ ) => (
44
+ <WizardStep
45
+ active={ index === activeStep }
46
+ complete={ completed.includes( index ) }
47
+ skipped={ skipped.includes( index ) }
48
+ key={ index }
49
+ order={ index + 1 }
50
+ totalSteps={ steps.length }
51
+ subTitle={ subTitle }
52
+ title={ title }
53
+ titleVariant={ titleVariant }
54
+ summary={ summary }
55
+ onChange={ onChange }
56
+ shouldFocusTitle={ titleAutofocus && didMount }
57
+ actionLabel={ actionLabel }
58
+ >
59
+ { children }
60
+ </WizardStep>
61
+ )
62
+ ) }
57
63
  </Box>
58
64
  );
59
65
  }
@@ -30,6 +30,7 @@ export interface WizardStepProps {
30
30
  onChange?: () => void;
31
31
  summary?: WizardStepSummary[];
32
32
  shouldFocusTitle?: boolean;
33
+ actionLabel?: string;
33
34
  }
34
35
 
35
36
  export const WizardStep = React.forwardRef< HTMLDivElement, WizardStepProps >(
@@ -47,6 +48,7 @@ export const WizardStep = React.forwardRef< HTMLDivElement, WizardStepProps >(
47
48
  titleVariant = 'h3',
48
49
  summary,
49
50
  onChange,
51
+ actionLabel = 'Change',
50
52
  },
51
53
  forwardRef
52
54
  ) => {
@@ -146,7 +148,8 @@ export const WizardStep = React.forwardRef< HTMLDivElement, WizardStepProps >(
146
148
  onClick={ onChange }
147
149
  sx={ { height: 'auto', alignSelf: 'flex-end' } }
148
150
  >
149
- Change <ScreenReaderText>{ `the ${ title?.toString() } step` }</ScreenReaderText>
151
+ { actionLabel }{ ' ' }
152
+ <ScreenReaderText>{ `the ${ title?.toString() } step` }</ScreenReaderText>
150
153
  </Button>
151
154
  ) }
152
155
  </Flex>