@automattic/vip-design-system 2.13.7 → 2.13.9

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.
@@ -9,5 +9,5 @@ export interface DescriptionListProps {
9
9
  sx?: ThemeUIStyleObject;
10
10
  labelWidth?: string;
11
11
  }
12
- export declare const DescriptionList: import("react").ForwardRefExoticComponent<DescriptionListProps & import("react").RefAttributes<HTMLDivElement>>;
13
- export default DescriptionList;
12
+ declare const DescriptionList: import("react").ForwardRefExoticComponent<DescriptionListProps & import("react").RefAttributes<HTMLDivElement>>;
13
+ export { DescriptionList };
@@ -10,7 +10,7 @@ import { Grid } from '../Grid';
10
10
  import { jsx as _jsx } from "theme-ui/jsx-runtime";
11
11
  import { jsxs as _jsxs } from "theme-ui/jsx-runtime";
12
12
  import { Fragment as _Fragment } from "theme-ui/jsx-runtime";
13
- export var DescriptionList = /*#__PURE__*/forwardRef(function (_ref) {
13
+ var DescriptionList = /*#__PURE__*/forwardRef(function (_ref) {
14
14
  var sx = _ref.sx,
15
15
  className = _ref.className,
16
16
  list = _ref.list,
@@ -37,4 +37,4 @@ export var DescriptionList = /*#__PURE__*/forwardRef(function (_ref) {
37
37
  });
38
38
  });
39
39
  DescriptionList.displayName = 'DescriptionList';
40
- export default DescriptionList;
40
+ export { DescriptionList };
@@ -47,7 +47,8 @@ export var Wizard = /*#__PURE__*/React.forwardRef(function (_ref, forwardRef) {
47
47
  titleVariant = _ref2.titleVariant,
48
48
  summary = _ref2.summary,
49
49
  onChange = _ref2.onChange,
50
- actionLabel = _ref2.actionLabel;
50
+ actionLabel = _ref2.actionLabel,
51
+ actionIcon = _ref2.actionIcon;
51
52
  return _jsx(WizardStep, {
52
53
  active: index === activeStep,
53
54
  complete: completed.includes(index),
@@ -61,6 +62,7 @@ export var Wizard = /*#__PURE__*/React.forwardRef(function (_ref, forwardRef) {
61
62
  onChange: onChange,
62
63
  shouldFocusTitle: titleAutofocus && didMount,
63
64
  actionLabel: actionLabel,
65
+ actionIcon: actionIcon,
64
66
  showStepText: showStepText,
65
67
  children: children
66
68
  }, index);
@@ -4,6 +4,7 @@
4
4
  * External dependencies
5
5
  */
6
6
  import React from 'react';
7
+ import { BsPencil } from 'react-icons/bs';
7
8
 
8
9
  /**
9
10
  * Internal dependencies
@@ -94,6 +95,7 @@ export var WithTitleAutoFocus = function WithTitleAutoFocus() {
94
95
  return setActiveStep(1);
95
96
  },
96
97
  actionLabel: 'Edit',
98
+ actionIcon: _jsx(BsPencil, {}),
97
99
  children: _jsxs(Box, {
98
100
  children: [_jsx(Label, {
99
101
  children: "DNS"
@@ -23,5 +23,6 @@ export interface WizardStepProps {
23
23
  shouldFocusTitle?: boolean;
24
24
  actionLabel?: string;
25
25
  showStepText?: boolean;
26
+ actionIcon?: React.ReactNode;
26
27
  }
27
28
  export declare const WizardStep: React.ForwardRefExoticComponent<WizardStepProps & React.RefAttributes<HTMLDivElement>>;
@@ -9,7 +9,7 @@ import { BsCircleFill, BsFillCheckCircleFill } from 'react-icons/bs';
9
9
  /**
10
10
  * Internal dependencies
11
11
  */
12
- import { Card, Heading, Text, Flex, Table, TableRow, TableCell, Button } from '..';
12
+ import { Card, Heading, Text, Flex, Table, TableRow, TableCell, Button, Box } from '..';
13
13
  import { ScreenReaderText } from '../ScreenReaderText';
14
14
  import { jsx as _jsx } from "theme-ui/jsx-runtime";
15
15
  import { jsxs as _jsxs } from "theme-ui/jsx-runtime";
@@ -32,7 +32,8 @@ export var WizardStep = /*#__PURE__*/React.forwardRef(function (_ref, forwardRef
32
32
  _ref$actionLabel = _ref.actionLabel,
33
33
  actionLabel = _ref$actionLabel === void 0 ? 'Change' : _ref$actionLabel,
34
34
  _ref$showStepText = _ref.showStepText,
35
- showStepText = _ref$showStepText === void 0 ? true : _ref$showStepText;
35
+ showStepText = _ref$showStepText === void 0 ? true : _ref$showStepText,
36
+ actionIcon = _ref.actionIcon;
36
37
  var titleRef = React.useRef(null);
37
38
  var status = 'inactive';
38
39
  var statusText = 'Step not completed';
@@ -136,6 +137,11 @@ export var WizardStep = /*#__PURE__*/React.forwardRef(function (_ref, forwardRef
136
137
  },
137
138
  children: [actionLabel, ' ', _jsx(ScreenReaderText, {
138
139
  children: "the " + (title == null ? void 0 : title.toString()) + " step"
140
+ }), Boolean(actionIcon) && _jsx(Box, {
141
+ sx: {
142
+ ml: 4
143
+ },
144
+ children: actionIcon
139
145
  })]
140
146
  })]
141
147
  }), !active && (complete || skipped) && summary && summary.length > 0 && _jsx(Table, {
@@ -20,6 +20,7 @@ import { DialogMenuItem } from './Dialog';
20
20
  import { DialogDivider } from './Dialog';
21
21
  import { DialogContent } from './Dialog';
22
22
  import { DialogTrigger } from './Dialog';
23
+ import { DescriptionList } from './DescriptionList';
23
24
  import { ConfirmationDialog } from './ConfirmationDialog';
24
25
  import { MobileMenu } from './MobileMenu/MobileMenu';
25
26
  import { MobileMenuTrigger } from './MobileMenu/MobileMenu';
@@ -63,4 +64,4 @@ import { Validation } from './Form';
63
64
  import { Wizard } from './Wizard';
64
65
  import { WizardStep } from './Wizard';
65
66
  import theme from './theme';
66
- export { Accordion, Avatar, Badge, Box, Breadcrumbs, Button, ButtonSubmit, ButtonVariant, Card, Checkbox, Code, Dialog, NewDialog, Form, Drawer, Dropdown, DialogButton, DialogMenu, DialogMenuItem, DialogDivider, DialogContent, DialogTrigger, ConfirmationDialog, MobileMenu, MobileMenuTrigger, MobileMenuWrapper, NewConfirmationDialog, Grid, FilterDropdown, Flex, Notice, OptionRow, Heading, Hr, Input, Label, ScreenReaderText, Spinner, Table, TableRow, TableCell, Tooltip, Link, LinkExternal, Radio, RadioBoxGroup, RadioGroupChip, Textarea, Progress, Text, Tabs, Nav, NavItem, Skeleton, TabsTrigger, TabsContent, TabsList, Toggle, ToggleRow, Toolbar, Snackbar, Validation, Wizard, WizardStep, theme };
67
+ export { Accordion, Avatar, Badge, Box, Breadcrumbs, Button, ButtonSubmit, ButtonVariant, Card, Checkbox, Code, Dialog, NewDialog, Form, Drawer, Dropdown, DialogButton, DialogMenu, DialogMenuItem, DialogDivider, DialogContent, DialogTrigger, DescriptionList, ConfirmationDialog, MobileMenu, MobileMenuTrigger, MobileMenuWrapper, NewConfirmationDialog, Grid, FilterDropdown, Flex, Notice, OptionRow, Heading, Hr, Input, Label, ScreenReaderText, Spinner, Table, TableRow, TableCell, Tooltip, Link, LinkExternal, Radio, RadioBoxGroup, RadioGroupChip, Textarea, Progress, Text, Tabs, Nav, NavItem, Skeleton, TabsTrigger, TabsContent, TabsList, Toggle, ToggleRow, Toolbar, Snackbar, Validation, Wizard, WizardStep, theme };
@@ -10,6 +10,7 @@ import { Button, ButtonSubmit, ButtonVariant } from './Button';
10
10
  import { Card } from './Card';
11
11
  import { Code } from './Code';
12
12
  import { ConfirmationDialog } from './ConfirmationDialog';
13
+ import { DescriptionList } from './DescriptionList';
13
14
  import {
14
15
  Dialog,
15
16
  DialogButton,
@@ -84,6 +85,7 @@ export {
84
85
  DialogDivider,
85
86
  DialogContent,
86
87
  DialogTrigger,
88
+ DescriptionList,
87
89
  ConfirmationDialog,
88
90
  MobileMenu,
89
91
  MobileMenuTrigger,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/vip-design-system",
3
- "version": "2.13.7",
3
+ "version": "2.13.9",
4
4
  "main": "build/system/index.js",
5
5
  "scripts": {
6
6
  "build-storybook": "storybook build",
@@ -19,7 +19,7 @@ export interface DescriptionListProps {
19
19
  labelWidth?: string;
20
20
  }
21
21
 
22
- export const DescriptionList = forwardRef< HTMLDivElement, DescriptionListProps >(
22
+ const DescriptionList = forwardRef< HTMLDivElement, DescriptionListProps >(
23
23
  ( { sx, className, list, labelWidth = '100px' }: DescriptionListProps ) => (
24
24
  <>
25
25
  { list.map( item => (
@@ -45,4 +45,4 @@ export const DescriptionList = forwardRef< HTMLDivElement, DescriptionListProps
45
45
 
46
46
  DescriptionList.displayName = 'DescriptionList';
47
47
 
48
- export default DescriptionList;
48
+ export { DescriptionList };
@@ -4,6 +4,7 @@
4
4
  * External dependencies
5
5
  */
6
6
  import React from 'react';
7
+ import { BsPencil } from 'react-icons/bs';
7
8
 
8
9
  /**
9
10
  * Internal dependencies
@@ -81,6 +82,7 @@ export const WithTitleAutoFocus = () => {
81
82
  titleVariant: 'h2',
82
83
  onChange: () => setActiveStep( 1 ),
83
84
  actionLabel: 'Edit',
85
+ actionIcon: <BsPencil />,
84
86
  children: (
85
87
  <Box>
86
88
  <Label>DNS</Label>
@@ -47,7 +47,7 @@ export const Wizard = React.forwardRef< HTMLDivElement, WizardProps >(
47
47
  <Box className={ classNames( 'vip-wizard-component', className ) } ref={ forwardRef }>
48
48
  { steps.map(
49
49
  (
50
- { title, subTitle, children, titleVariant, summary, onChange, actionLabel },
50
+ { title, subTitle, children, titleVariant, summary, onChange, actionLabel, actionIcon },
51
51
  index
52
52
  ) => (
53
53
  <WizardStep
@@ -64,6 +64,7 @@ export const Wizard = React.forwardRef< HTMLDivElement, WizardProps >(
64
64
  onChange={ onChange }
65
65
  shouldFocusTitle={ titleAutofocus && didMount }
66
66
  actionLabel={ actionLabel }
67
+ actionIcon={ actionIcon }
67
68
  showStepText={ showStepText }
68
69
  >
69
70
  { children }
@@ -9,7 +9,7 @@ import { BsCircleFill, BsFillCheckCircleFill } from 'react-icons/bs';
9
9
  /**
10
10
  * Internal dependencies
11
11
  */
12
- import { Card, Heading, Text, Flex, Table, TableRow, TableCell, Button } from '..';
12
+ import { Card, Heading, Text, Flex, Table, TableRow, TableCell, Button, Box } from '..';
13
13
  import { HeadingProps } from '../Heading/Heading';
14
14
  import { ScreenReaderText } from '../ScreenReaderText';
15
15
 
@@ -32,6 +32,7 @@ export interface WizardStepProps {
32
32
  shouldFocusTitle?: boolean;
33
33
  actionLabel?: string;
34
34
  showStepText?: boolean;
35
+ actionIcon?: React.ReactNode;
35
36
  }
36
37
 
37
38
  export const WizardStep = React.forwardRef< HTMLDivElement, WizardStepProps >(
@@ -51,6 +52,7 @@ export const WizardStep = React.forwardRef< HTMLDivElement, WizardStepProps >(
51
52
  onChange,
52
53
  actionLabel = 'Change',
53
54
  showStepText = true,
55
+ actionIcon,
54
56
  },
55
57
  forwardRef
56
58
  ) => {
@@ -155,6 +157,7 @@ export const WizardStep = React.forwardRef< HTMLDivElement, WizardStepProps >(
155
157
  >
156
158
  { actionLabel }{ ' ' }
157
159
  <ScreenReaderText>{ `the ${ title?.toString() } step` }</ScreenReaderText>
160
+ { Boolean( actionIcon ) && <Box sx={ { ml: 4 } }>{ actionIcon }</Box> }
158
161
  </Button>
159
162
  ) }
160
163
  </Flex>
@@ -10,6 +10,7 @@ import { Button, ButtonSubmit, ButtonVariant } from './Button';
10
10
  import { Card } from './Card';
11
11
  import { Code } from './Code';
12
12
  import { ConfirmationDialog } from './ConfirmationDialog';
13
+ import { DescriptionList } from './DescriptionList';
13
14
  import {
14
15
  Dialog,
15
16
  DialogButton,
@@ -84,6 +85,7 @@ export {
84
85
  DialogDivider,
85
86
  DialogContent,
86
87
  DialogTrigger,
88
+ DescriptionList,
87
89
  ConfirmationDialog,
88
90
  MobileMenu,
89
91
  MobileMenuTrigger,