@mailstep/design-system 0.6.21 → 0.6.22

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/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Live demo here: https://mailstep.gitlab.io/mailwise/mw2/design-system/storybook
4
4
 
5
+ Powered by chromatic: https://www.chromatic.com/library?appId=664c5032c1e55e80a74fcfd2&branch=master
6
+
5
7
  ## Peer dependencies
6
8
  - @xstyled/styled-components
7
9
  - styled-component
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailstep/design-system",
3
- "version": "0.6.21",
3
+ "version": "0.6.22",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -24,6 +24,7 @@
24
24
  "@babel/preset-env": "^7.22.4",
25
25
  "@babel/preset-react": "^7.22.3",
26
26
  "@babel/preset-typescript": "^7.23.3",
27
+ "@chromatic-com/storybook": "^1",
27
28
  "@fortawesome/fontawesome-svg-core": "^6.3.0",
28
29
  "@fortawesome/free-brands-svg-icons": "^6.1.1",
29
30
  "@fortawesome/pro-duotone-svg-icons": "^6.0.0",
@@ -34,14 +35,15 @@
34
35
  "@lingui/core": "3.17.2",
35
36
  "@lingui/react": "3.17.2",
36
37
  "@popperjs/core": "^2.11.8",
37
- "@storybook/addon-controls": "7.6.8",
38
- "@storybook/addon-essentials": "7.6.8",
39
- "@storybook/addon-interactions": "7.6.8",
40
- "@storybook/addon-links": "7.6.8",
41
- "@storybook/blocks": "7.6.8",
42
- "@storybook/react": "7.6.8",
43
- "@storybook/react-webpack5": "7.6.8",
44
- "@storybook/testing-library": "0.2.2",
38
+ "@storybook/addon-controls": "^8.1.1",
39
+ "@storybook/addon-designs": "^8.0.2",
40
+ "@storybook/addon-essentials": "^8.1.1",
41
+ "@storybook/addon-interactions": "^8.1.1",
42
+ "@storybook/addon-links": "^8.1.1",
43
+ "@storybook/blocks": "^8.1.1",
44
+ "@storybook/react": "^8.1.1",
45
+ "@storybook/react-webpack5": "^8.1.1",
46
+ "@storybook/test": "^8.1.1",
45
47
  "@svgr/rollup": "^8.0.1",
46
48
  "@types/faker": "^4.1.11",
47
49
  "@types/luxon": "^3.4.2",
@@ -59,7 +61,7 @@
59
61
  "babel-plugin-macros": "^3.1.0",
60
62
  "babel-plugin-named-exports-order": "^0.0.2",
61
63
  "chromatic": "^11.3.5",
62
- "eslint-plugin-storybook": "0.6.15",
64
+ "eslint-plugin-storybook": "^0.8.0",
63
65
  "faker": "^5.1.0",
64
66
  "immer": "9.0.7",
65
67
  "lodash": "^4.17.21",
@@ -81,7 +83,7 @@
81
83
  "react-use-draggable-scroll": "^0.4.7",
82
84
  "redux": ">=4.0.5",
83
85
  "reselect": "5.0.0-alpha.2",
84
- "storybook": "7.6.8",
86
+ "storybook": "^8.1.1",
85
87
  "string-width": "6.1.0",
86
88
  "styled-components": "^5.3.10",
87
89
  "swiper": "^11.0.3",
@@ -19,6 +19,7 @@ export var InfoCornerDialog = {
19
19
  statusToTitle: statusToTitle,
20
20
  intent: 'info',
21
21
  isOpen: true,
22
+ onClose: console.log
22
23
  },
23
24
  };
24
25
  export var SuccessCornerDialog = {
@@ -28,6 +29,7 @@ export var SuccessCornerDialog = {
28
29
  statusToTitle: statusToTitle,
29
30
  intent: 'success',
30
31
  isOpen: true,
32
+ onClose: console.log
31
33
  },
32
34
  };
33
35
  export var ErrorCornerDialog = {
@@ -37,6 +39,7 @@ export var ErrorCornerDialog = {
37
39
  statusToTitle: statusToTitle,
38
40
  intent: 'error',
39
41
  isOpen: true,
42
+ onClose: console.log
40
43
  },
41
44
  };
42
45
  export var WarningCornerDialog = {
@@ -46,5 +49,6 @@ export var WarningCornerDialog = {
46
49
  statusToTitle: statusToTitle,
47
50
  intent: 'warning',
48
51
  isOpen: true,
52
+ onClose: console.log
49
53
  },
50
54
  };
@@ -15,6 +15,7 @@ var images = [
15
15
  export var LightBoxDefault = {
16
16
  args: {
17
17
  images: images,
18
- isLightBoxOpen: true
18
+ isLightBoxOpen: true,
19
+ onCloseLightBox: console.log
19
20
  },
20
21
  };
@@ -5,6 +5,12 @@ declare const meta: {
5
5
  component: ({ isLoading, loadingText, icon, iconLeft, iconRight, variant, appearance, disabled, fullWidth, buttonRef, onClick, ...props }: import("../types").Props) => JSX.Element;
6
6
  tags: string[];
7
7
  argTypes: {};
8
+ parameters: {
9
+ design: {
10
+ type: string;
11
+ url: string;
12
+ };
13
+ };
8
14
  };
9
15
  export default meta;
10
16
  type Story = StoryObj<typeof meta>;
@@ -4,6 +4,12 @@ var meta = {
4
4
  component: Button,
5
5
  tags: ['autodocs'],
6
6
  argTypes: {},
7
+ parameters: {
8
+ design: {
9
+ type: 'figma',
10
+ url: 'https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Fdesign%2Fwdpl2dchqnNHAsbuoRDXjb%2FElements%3Fnode-id%3D979%253A2939%26t%3DNHB5soSntRqtsFN0-1',
11
+ },
12
+ },
7
13
  };
8
14
  export default meta;
9
15
  export var DefaultPrimary = {
@@ -15,6 +15,7 @@ export type DatePickerType = DatetimepickerProps & {
15
15
  error?: string;
16
16
  icon?: boolean;
17
17
  onClear?: () => void;
18
+ onInputChange?: () => void;
18
19
  };
19
- declare const _default: React.MemoExoticComponent<({ name, value, initialViewDate, error, label, disabled, isValidDate, onChange, dateFormat, timeFormat, open, secondValue, input, icon, showInputLabel, showCalendarLabel, spaceAround, className, onClear, ...passProps }: DatePickerType) => JSX.Element>;
20
+ declare const _default: React.MemoExoticComponent<({ name, value, initialViewDate, error, label, disabled, isValidDate, onChange, dateFormat, timeFormat, open, secondValue, input, icon, showInputLabel, showCalendarLabel, spaceAround, className, onClear, onInputChange, ...passProps }: DatePickerType) => JSX.Element>;
20
21
  export default _default;
@@ -37,13 +37,13 @@ import Input from '../../Forms/Input';
37
37
  import { LanguageContext } from '../../ThemeProvider/ThemeProvider';
38
38
  var defaultDateFormat = 'DD.MM.YYYY';
39
39
  var DatePicker = function (_a) {
40
- var name = _a.name, value = _a.value, initialViewDate = _a.initialViewDate, error = _a.error, label = _a.label, disabled = _a.disabled, isValidDate = _a.isValidDate, onChange = _a.onChange, _b = _a.dateFormat, dateFormat = _b === void 0 ? defaultDateFormat : _b, _c = _a.timeFormat, timeFormat = _c === void 0 ? false : _c, open = _a.open, _d = _a.secondValue, secondValue = _d === void 0 ? null : _d, input = _a.input, _e = _a.icon, icon = _e === void 0 ? true : _e, _f = _a.showInputLabel, showInputLabel = _f === void 0 ? false : _f, _g = _a.showCalendarLabel, showCalendarLabel = _g === void 0 ? true : _g, _h = _a.spaceAround, spaceAround = _h === void 0 ? false : _h, className = _a.className, onClear = _a.onClear, passProps = __rest(_a, ["name", "value", "initialViewDate", "error", "label", "disabled", "isValidDate", "onChange", "dateFormat", "timeFormat", "open", "secondValue", "input", "icon", "showInputLabel", "showCalendarLabel", "spaceAround", "className", "onClear"]);
40
+ var name = _a.name, value = _a.value, initialViewDate = _a.initialViewDate, error = _a.error, label = _a.label, disabled = _a.disabled, isValidDate = _a.isValidDate, onChange = _a.onChange, _b = _a.dateFormat, dateFormat = _b === void 0 ? defaultDateFormat : _b, _c = _a.timeFormat, timeFormat = _c === void 0 ? false : _c, open = _a.open, _d = _a.secondValue, secondValue = _d === void 0 ? null : _d, input = _a.input, _e = _a.icon, icon = _e === void 0 ? true : _e, _f = _a.showInputLabel, showInputLabel = _f === void 0 ? false : _f, _g = _a.showCalendarLabel, showCalendarLabel = _g === void 0 ? true : _g, _h = _a.spaceAround, spaceAround = _h === void 0 ? false : _h, className = _a.className, onClear = _a.onClear, onInputChange = _a.onInputChange, passProps = __rest(_a, ["name", "value", "initialViewDate", "error", "label", "disabled", "isValidDate", "onChange", "dateFormat", "timeFormat", "open", "secondValue", "input", "icon", "showInputLabel", "showCalendarLabel", "spaceAround", "className", "onClear", "onInputChange"]);
41
41
  var format = "".concat(dateFormat).concat(timeFormat ? " ".concat(timeFormat) : "");
42
- var isValid = !!value && moment(value, format).isValid();
42
+ var isValid = !!value && moment(value, format, true).isValid();
43
43
  var stringValue = isValid ? moment(value, format).format(format) : value;
44
44
  var locale = useContext(LanguageContext);
45
45
  var handleRenderInput = useCallback(function (_, openCalendar) {
46
- return (_jsx(Input, { type: "text", icon: icon ? 'calendar' : undefined, name: name, error: error, disabled: disabled, isInvalid: !!error, label: showInputLabel ? label : undefined, value: stringValue, onFocus: openCalendar, iconOnClick: openCalendar, onClear: onClear }));
46
+ return (_jsx(Input, { type: "text", icon: icon ? 'calendar' : undefined, name: name, error: error, disabled: disabled, isInvalid: !!error, onChange: onInputChange, label: showInputLabel ? label : undefined, value: stringValue, onFocus: openCalendar, iconOnClick: openCalendar, onClear: onClear }));
47
47
  }, [name, stringValue, error, label, showInputLabel, isValid, disabled]);
48
48
  var handleRenderView = useCallback(function (_, renderCalendar) {
49
49
  if (label && !showInputLabel) {
@@ -5,7 +5,7 @@ declare const meta: {
5
5
  component: ({ badge, ...iconProps }: {
6
6
  badge: "warning";
7
7
  } & import("..").IconProps) => JSX.Element;
8
- decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, {
8
+ decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react/dist/types-bf5e6555").R, {
9
9
  badge: "warning";
10
10
  icon: string;
11
11
  style?: "normal" | "light" | "solid" | undefined;