carbon-react 104.13.0 → 104.16.1

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.
Files changed (37) hide show
  1. package/lib/__internal__/popover/index.d.ts +1 -1
  2. package/lib/__internal__/popover/popover.component.d.ts +3 -1
  3. package/lib/__internal__/popover/popover.component.js +12 -3
  4. package/lib/__internal__/popover/popover.d.ts +46 -0
  5. package/lib/__internal__/popover/popover.style.d.ts +2 -0
  6. package/lib/__internal__/popover/popover.style.js +29 -0
  7. package/lib/components/button-bar/button-bar.style.d.ts +0 -1
  8. package/lib/components/button-bar/button-bar.style.js +6 -7
  9. package/lib/components/decimal/decimal.component.d.ts +8 -3
  10. package/lib/components/decimal/decimal.component.js +8 -3
  11. package/lib/components/dialog/dialog.style.js +3 -0
  12. package/lib/components/modal/modal.component.js +23 -24
  13. package/lib/components/modal/modal.style.js +22 -15
  14. package/lib/components/note/note.style.js +14 -28
  15. package/lib/components/profile/profile-test.stories.js +75 -0
  16. package/lib/components/select/filterable-select/filterable-select.component.js +9 -4
  17. package/lib/components/select/multi-select/multi-select.component.js +9 -5
  18. package/lib/components/select/multi-select/multi-select.style.js +1 -0
  19. package/lib/components/select/option-group-header/option-group-header.style.js +3 -3
  20. package/lib/components/select/select-list/select-list.component.js +18 -5
  21. package/lib/components/select/select-list/select-list.style.js +2 -2
  22. package/lib/components/select/select-textbox/select-textbox.component.d.ts +2 -1
  23. package/lib/components/select/select-textbox/select-textbox.component.js +67 -2
  24. package/lib/components/select/select.style.js +9 -3
  25. package/lib/components/select/simple-select/simple-select.component.js +12 -9
  26. package/lib/hooks/__internal__/useScrollBlock/index.d.ts +4 -0
  27. package/lib/hooks/__internal__/useScrollBlock/index.js +15 -0
  28. package/lib/hooks/__internal__/useScrollBlock/scroll-block-manager.d.ts +10 -0
  29. package/lib/hooks/__internal__/useScrollBlock/scroll-block-manager.js +63 -0
  30. package/lib/hooks/__internal__/useScrollBlock/useScrollBlock.d.ts +5 -0
  31. package/lib/hooks/__internal__/useScrollBlock/useScrollBlock.js +95 -0
  32. package/lib/style/themes/base/base-theme.config.d.ts +2 -4
  33. package/lib/style/themes/base/base-theme.config.js +2 -5
  34. package/lib/style/themes/sage/index.d.ts +1 -0
  35. package/package.json +16 -16
  36. package/lib/components/portal/portal.style.d.ts +0 -3
  37. package/lib/components/portal/portal.style.js +0 -20
@@ -1 +1 @@
1
- export { default } from "./popover.component";
1
+ export { default } from "./popover";
@@ -1,16 +1,18 @@
1
1
  export default Popover;
2
- declare function Popover({ children, placement, disablePortal, reference, onFirstUpdate, modifiers, }: {
2
+ declare function Popover({ children, placement, disablePortal, reference, onFirstUpdate, modifiers, disableBackgroundUI, }: {
3
3
  children: any;
4
4
  placement: any;
5
5
  disablePortal: any;
6
6
  reference: any;
7
7
  onFirstUpdate: any;
8
8
  modifiers: any;
9
+ disableBackgroundUI: any;
9
10
  }): any;
10
11
  declare namespace Popover {
11
12
  namespace propTypes {
12
13
  const children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
13
14
  const placement: PropTypes.Requireable<string>;
15
+ const disableBackgroundUI: PropTypes.Requireable<boolean>;
14
16
  const modifiers: PropTypes.Requireable<any[]>;
15
17
  const onFirstUpdate: PropTypes.Requireable<(...args: any[]) => any>;
16
18
  const disablePortal: PropTypes.Requireable<boolean>;
@@ -15,6 +15,8 @@ var _core = require("@popperjs/core");
15
15
 
16
16
  var _useResizeObserver = _interopRequireDefault(require("../../hooks/__internal__/useResizeObserver"));
17
17
 
18
+ var _popover = _interopRequireDefault(require("./popover.style"));
19
+
18
20
  var _carbonScopedTokensProvider = _interopRequireDefault(require("../../style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component"));
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -29,7 +31,8 @@ const Popover = ({
29
31
  disablePortal,
30
32
  reference,
31
33
  onFirstUpdate,
32
- modifiers
34
+ modifiers,
35
+ disableBackgroundUI
33
36
  }) => {
34
37
  const elementDOM = (0, _react.useRef)();
35
38
 
@@ -90,6 +93,10 @@ const Popover = ({
90
93
  };
91
94
  }, [disablePortal]);
92
95
 
96
+ if (disableBackgroundUI) {
97
+ content = /*#__PURE__*/_react.default.createElement(_popover.default, null, content);
98
+ }
99
+
93
100
  if (disablePortal) {
94
101
  return content;
95
102
  }
@@ -102,11 +109,13 @@ Popover.propTypes = {
102
109
  children: _propTypes.default.node.isRequired,
103
110
  // Placement of children in relation to the reference element
104
111
  placement: _propTypes.default.oneOf(["auto", "auto-start", "auto-end", "top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "right", "right-start", "right-end", "left", "left-start", "left-end"]),
112
+ // Disables interaction with background UI
113
+ disableBackgroundUI: _propTypes.default.bool,
105
114
  // Optional modifiers array, for more information and object structure go to:
106
115
  // https://popper.js.org/docs/v2/constructors/#modifiers
107
116
  modifiers: _propTypes.default.array,
108
- // Optional onFirstUpdate funcition, for more information go to:
109
- // https://popper.js.org/docs/v2/constructors/#modifiers
117
+ // Optional onFirstUpdate function, for more information go to:
118
+ // https://popper.js.org/docs/v2/lifecycle/#hook-into-the-lifecycle
110
119
  onFirstUpdate: _propTypes.default.func,
111
120
  // When true, children are not rendered in portal
112
121
  disablePortal: _propTypes.default.bool,
@@ -0,0 +1,46 @@
1
+ import * as React from "react";
2
+ import { State } from "@popperjs/core";
3
+
4
+ type PopoverModifier = {
5
+ name: string;
6
+ options?: Record<string, unknown>;
7
+ enabled?: boolean;
8
+ };
9
+
10
+ export interface PopoverPropTypes {
11
+ // Element to be positioned, has to be a single node and has to accept `ref` and `style` props
12
+ children: React.ReactNode;
13
+ // Placement of children in relation to the reference element
14
+ placement?:
15
+ | "auto"
16
+ | "auto-start"
17
+ | "auto-end"
18
+ | "top"
19
+ | "top-start"
20
+ | "top-end"
21
+ | "bottom"
22
+ | "bottom-start"
23
+ | "bottom-end"
24
+ | "right"
25
+ | "right-start"
26
+ | "right-end"
27
+ | "left"
28
+ | "left-start"
29
+ | "left-end";
30
+ // Disables interaction with background UI
31
+ disableBackgroundUI?: boolean;
32
+ // Optional modifiers array, for more information and object structure go to:
33
+ // https://popper.js.org/docs/v2/constructors/#modifiers
34
+ modifiers?: PopoverModifier[];
35
+ // Optional onFirstUpdate function, for more information go to:
36
+ // hhttps://popper.js.org/docs/v2/lifecycle/#hook-into-the-lifecycle
37
+ onFirstUpdate?: (state: State) => void;
38
+ // When true, children are not rendered in portal
39
+ disablePortal?: boolean;
40
+ // Reference element, children will be positioned in relation to this element - should be a ref
41
+ reference?: React.RefObject<HTMLElement>;
42
+ }
43
+
44
+ declare function Popover(props: PopoverPropTypes): JSX.Element;
45
+
46
+ export default Popover;
@@ -0,0 +1,2 @@
1
+ export default StyledBackdrop;
2
+ declare const StyledBackdrop: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
9
+
10
+ var _base = _interopRequireDefault(require("../../style/themes/base"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ const StyledBackdrop = _styledComponents.default.div`
15
+ bottom: 0;
16
+ left: 0;
17
+ position: fixed;
18
+ right: 0;
19
+ top: 0;
20
+ z-index: ${({
21
+ theme
22
+ }) => theme.zIndex.popover};
23
+ background: transparent;
24
+ `;
25
+ StyledBackdrop.defaultProps = {
26
+ theme: _base.default
27
+ };
28
+ var _default = StyledBackdrop;
29
+ exports.default = _default;
@@ -1,5 +1,4 @@
1
1
  export default ButtonBar;
2
2
  declare const ButtonBar: import("styled-components").StyledComponent<"div", any, {
3
- theme: any;
4
3
  size: any;
5
4
  }, never>;
@@ -29,7 +29,6 @@ const ButtonBar = _styledComponents.default.div`
29
29
  `;
30
30
 
31
31
  function stylingForType({
32
- theme,
33
32
  size
34
33
  }) {
35
34
  return (0, _styledComponents.css)`
@@ -50,7 +49,7 @@ function stylingForType({
50
49
 
51
50
  button {
52
51
  margin: 0;
53
- border: 2px solid ${theme.colors.primary};
52
+ border: 2px solid var(--colorsActionMajor500);
54
53
 
55
54
  &:not(:last-of-type) {
56
55
  border-right-color: transparent;
@@ -61,20 +60,20 @@ function stylingForType({
61
60
  &:focus {
62
61
  position: relative;
63
62
  z-index: 2;
64
- border-right-color: ${theme.colors.primary};
63
+ border-right-color: var(--colorsActionMajor500);
65
64
  }
66
65
  &:hover {
67
- background-color: ${theme.colors.secondary};
68
- border-color: ${theme.colors.secondary};
66
+ background-color: var(--colorsActionMajor600);
67
+ border-color: var(--colorsActionMajor600);
69
68
  & + button {
70
- border-left-color: ${theme.colors.secondary};
69
+ border-left-color: var(--colorsActionMajor600);
71
70
  }
72
71
  & ${_icon.default} {
73
72
  color: white;
74
73
  }
75
74
  }
76
75
  & ${_icon.default} {
77
- color: ${theme.colors.primary};
76
+ color: var(--colorsActionMajor500);
78
77
  }
79
78
  }
80
79
  `;
@@ -1,9 +1,9 @@
1
1
  export default Decimal;
2
2
  declare function Decimal({ align, defaultValue, precision, inputWidth, readOnly, onChange, onBlur, onKeyPress, id, name, allowEmptyValue, required, locale, value, ...rest }: {
3
3
  [x: string]: any;
4
- align?: string | undefined;
4
+ align: any;
5
5
  defaultValue: any;
6
- precision?: number | undefined;
6
+ precision: any;
7
7
  inputWidth: any;
8
8
  readOnly: any;
9
9
  onChange: any;
@@ -11,7 +11,7 @@ declare function Decimal({ align, defaultValue, precision, inputWidth, readOnly,
11
11
  onKeyPress: any;
12
12
  id: any;
13
13
  name: any;
14
- allowEmptyValue?: boolean | undefined;
14
+ allowEmptyValue: any;
15
15
  required: any;
16
16
  locale: any;
17
17
  value: any;
@@ -77,5 +77,10 @@ declare namespace Decimal {
77
77
  /** Aria label for rendered help component */
78
78
  helpAriaLabel: PropTypes.Requireable<string>;
79
79
  };
80
+ namespace defaultProps {
81
+ const precision: number;
82
+ const allowEmptyValue: boolean;
83
+ const align: string;
84
+ }
80
85
  }
81
86
  import PropTypes from "prop-types";
@@ -30,9 +30,9 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
30
30
  const marginPropTypes = (0, _utils.filterStyledSystemMarginProps)(_propTypes2.default.space);
31
31
 
32
32
  const Decimal = ({
33
- align = "right",
33
+ align,
34
34
  defaultValue,
35
- precision = 2,
35
+ precision,
36
36
  inputWidth,
37
37
  readOnly,
38
38
  onChange,
@@ -40,7 +40,7 @@ const Decimal = ({
40
40
  onKeyPress,
41
41
  id,
42
42
  name,
43
- allowEmptyValue = false,
43
+ allowEmptyValue,
44
44
  required,
45
45
  locale,
46
46
  value,
@@ -309,5 +309,10 @@ Decimal.propTypes = {
309
309
  /** Aria label for rendered help component */
310
310
  helpAriaLabel: _propTypes.default.string
311
311
  };
312
+ Decimal.defaultProps = {
313
+ precision: 2,
314
+ allowEmptyValue: false,
315
+ align: "right"
316
+ };
312
317
  var _default = Decimal;
313
318
  exports.default = _default;
@@ -87,6 +87,9 @@ const DialogStyle = _styledComponents.default.div`
87
87
  flex-direction: column;
88
88
  position: fixed;
89
89
  top: 50%;
90
+ z-index: ${({
91
+ theme
92
+ }) => theme.zIndex.modal};
90
93
  max-height: ${({
91
94
  topMargin
92
95
  }) => `calc(100vh - ${topMargin}px)`};
@@ -11,9 +11,11 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _reactTransitionGroup = require("react-transition-group");
13
13
 
14
- var _events = _interopRequireDefault(require("../../__internal__/utils/helpers/events"));
14
+ var _useScrollBlock = _interopRequireDefault(require("../../hooks/__internal__/useScrollBlock"));
15
+
16
+ var _portal = _interopRequireDefault(require("../portal"));
15
17
 
16
- var _portal = _interopRequireDefault(require("../portal/portal.style"));
18
+ var _events = _interopRequireDefault(require("../../__internal__/utils/helpers/events"));
17
19
 
18
20
  var _modalManager = _interopRequireDefault(require("./__internal__/modal-manager"));
19
21
 
@@ -44,35 +46,30 @@ const Modal = ({
44
46
  const ref = (0, _react.useRef)();
45
47
  const listenerAdded = (0, _react.useRef)(false);
46
48
  const modalRegistered = (0, _react.useRef)(false);
47
- const originalOverflow = (0, _react.useRef)(undefined);
48
49
  const [isAnimationComplete, setAnimationComplete] = (0, _react.useState)(false);
49
50
  const [triggerRefocusFlag, setTriggerRefocusFlag] = (0, _react.useState)(false);
50
- const setOverflow = (0, _react.useCallback)(() => {
51
- if (typeof originalOverflow.current === "undefined" && !enableBackgroundUI) {
52
- originalOverflow.current = document.documentElement.style.overflow;
53
- document.documentElement.style.overflow = "hidden";
54
- }
55
- }, [enableBackgroundUI]);
56
- const unsetOverflow = (0, _react.useCallback)(() => {
57
- if (typeof originalOverflow.current !== "undefined" && !enableBackgroundUI) {
58
- document.documentElement.style.overflow = originalOverflow.current;
59
- originalOverflow.current = undefined;
60
- }
61
- }, [enableBackgroundUI]);
51
+ const {
52
+ blockScroll,
53
+ allowScroll
54
+ } = (0, _useScrollBlock.default)();
62
55
  (0, _react.useEffect)(() => {
63
- if (open) {
64
- setOverflow();
56
+ if (enableBackgroundUI) {
57
+ return;
65
58
  }
66
59
 
67
- if (!open) {
68
- unsetOverflow();
60
+ if (open) {
61
+ blockScroll();
62
+ } else {
63
+ allowScroll();
69
64
  }
70
- }, [open, setOverflow, unsetOverflow]);
65
+ }, [allowScroll, blockScroll, enableBackgroundUI, open]);
71
66
  (0, _react.useEffect)(() => {
72
67
  return () => {
73
- unsetOverflow();
68
+ if (!enableBackgroundUI) {
69
+ allowScroll();
70
+ }
74
71
  };
75
- }, [unsetOverflow]);
72
+ }, [allowScroll, enableBackgroundUI]);
76
73
  const closeModal = (0, _react.useCallback)(ev => {
77
74
  const isTopmost = _modalManager.default.isTopmost(ref.current);
78
75
 
@@ -143,7 +140,8 @@ const Modal = ({
143
140
  if (open) {
144
141
  background = !enableBackgroundUI ? /*#__PURE__*/_react.default.createElement(_modal.StyledModalBackground, {
145
142
  "data-element": "modal-background",
146
- transitionName: "modal-background"
143
+ transitionName: "modal-background",
144
+ transitionTime: timeout
147
145
  }) : null;
148
146
  content = children;
149
147
  }
@@ -151,6 +149,7 @@ const Modal = ({
151
149
  return /*#__PURE__*/_react.default.createElement(_portal.default, null, /*#__PURE__*/_react.default.createElement(_modal.StyledModal, _extends({
152
150
  "data-state": open ? "open" : "closed",
153
151
  transitionName: "modal",
152
+ transitionTime: timeout,
154
153
  ref: ref
155
154
  }, rest), /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.TransitionGroup, null, background && /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.CSSTransition, {
156
155
  key: "modal",
@@ -197,7 +196,7 @@ Modal.defaultProps = {
197
196
  onCancel: null,
198
197
  enableBackgroundUI: false,
199
198
  disableEscKey: false,
200
- timeout: 500
199
+ timeout: 300
201
200
  };
202
201
  var _default = Modal;
203
202
  exports.default = _default;
@@ -7,14 +7,15 @@ exports.StyledModalBackground = exports.StyledModal = void 0;
7
7
 
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
 
10
+ var _base = _interopRequireDefault(require("../../style/themes/base"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
10
14
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
11
15
 
12
16
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
17
 
14
18
  const backgroundOpacity = "0.6";
15
- const backgroundAnimationLength = "300ms";
16
- const initialPosition = "50px";
17
- const animationLength = "300ms";
18
19
  const StyledModalBackground = _styledComponents.default.div`
19
20
  background-color: rgba(0, 20, 29, 0.6);
20
21
  bottom: 0;
@@ -25,7 +26,8 @@ const StyledModalBackground = _styledComponents.default.div`
25
26
  top: 0;
26
27
 
27
28
  ${({
28
- transitionName
29
+ transitionName,
30
+ transitionTime
29
31
  }) => (0, _styledComponents.css)`
30
32
  &.${transitionName}-enter, .${transitionName}-appear {
31
33
  opacity: 0;
@@ -34,7 +36,7 @@ const StyledModalBackground = _styledComponents.default.div`
34
36
  &.${transitionName}-enter.${transitionName}-enter-active,
35
37
  &.${transitionName}-appear.${transitionName}-appear-active {
36
38
  opacity: ${backgroundOpacity};
37
- transition: opacity ${backgroundAnimationLength} ease-out;
39
+ transition: opacity ${transitionTime}ms ease-out;
38
40
  }
39
41
 
40
42
  &.${transitionName}-exit {
@@ -43,37 +45,42 @@ const StyledModalBackground = _styledComponents.default.div`
43
45
 
44
46
  &.${transitionName}-exit.${transitionName}-exit-active {
45
47
  opacity: 0;
46
- transition: opacity ${backgroundAnimationLength} 100ms ease-out;
48
+ transition: opacity ${transitionTime}ms 100ms ease-out;
47
49
  }
48
- `}
50
+ `};
49
51
  `;
50
52
  exports.StyledModalBackground = StyledModalBackground;
51
53
  const StyledModal = _styledComponents.default.div`
54
+ position: absolute;
55
+ z-index: ${({
56
+ theme
57
+ }) => theme.zIndex.modal};
58
+
52
59
  ${({
53
- transitionName
60
+ transitionName,
61
+ transitionTime
54
62
  }) => (0, _styledComponents.css)`
55
63
  .${transitionName}-enter, .${transitionName}-appear {
56
64
  opacity: 0;
57
- margin-top: ${initialPosition};
58
65
  }
59
66
 
60
67
  .${transitionName}-enter.${transitionName}-enter-active,
61
68
  .${transitionName}-appear.${transitionName}-appear-active {
62
69
  opacity: 1;
63
- margin-top: 0;
64
- transition: all ${animationLength} 100ms ease-out;
70
+ transition: all ${transitionTime}ms 100ms ease-out;
65
71
  }
66
72
 
67
73
  .${transitionName}-exit {
68
74
  opacity: 1;
69
- margin-top: 0;
70
75
  }
71
76
 
72
77
  .${transitionName}-exit.${transitionName}-exit-active {
73
78
  opacity: 0;
74
- margin-top: ${initialPosition};
75
- transition: all ${animationLength} ease-out;
79
+ transition: all ${transitionTime}ms ease-out;
76
80
  }
77
81
  `}
78
82
  `;
79
- exports.StyledModal = StyledModal;
83
+ exports.StyledModal = StyledModal;
84
+ StyledModal.defaultProps = {
85
+ theme: _base.default
86
+ };
@@ -26,7 +26,6 @@ const StyledNoteContent = _styledComponents.default.div`
26
26
  width: 100%;
27
27
 
28
28
  ${({
29
- theme,
30
29
  hasPreview
31
30
  }) => (0, _styledComponents.css)`
32
31
  &:not(:last-of-type) {
@@ -42,16 +41,16 @@ const StyledNoteContent = _styledComponents.default.div`
42
41
  div.public-DraftEditor-content {
43
42
  min-height: inherit;
44
43
  height: 100%;
45
- background-color: ${theme.colors.white};
44
+ background-color: var(--colorsUtilityYang100);
46
45
  line-height: 21px;
47
46
  }
48
47
 
49
48
  &:last-of-type:not(:first-of-type) {
50
- border-top: solid 1px ${theme.tile.separator};
49
+ border-top: solid 1px var(--colorsUtilityMajor050);
51
50
  }
52
51
 
53
52
  ${hasPreview && `
54
- margin-top: ${2 * theme.spacing}px;
53
+ margin-top: var(--spacing200);
55
54
  `}
56
55
  `}
57
56
  `;
@@ -76,10 +75,9 @@ const StyledFooterContent = _styledComponents.default.div`
76
75
  font-weight: bold;
77
76
 
78
77
  ${({
79
- theme,
80
78
  hasName
81
79
  }) => (0, _styledComponents.css)`
82
- margin-top: ${2 * theme.spacing}px;
80
+ margin-top: var(--spacing200);
83
81
 
84
82
  ${hasName && (0, _styledComponents.css)`
85
83
  &:first-of-type {
@@ -88,29 +86,29 @@ const StyledFooterContent = _styledComponents.default.div`
88
86
 
89
87
  &:nth-of-type(2) {
90
88
  font-size: 12px;
91
- color: ${theme.note.timeStamp};
92
- margin-left: ${2 * theme.spacing}px;
89
+ color: var(--colorsUtilityYin065);
90
+ margin-left: var(--spacing200);
93
91
  }
94
92
 
95
93
  &:last-of-type:not(:nth-of-type(2)) {
96
94
  font-size: 12px;
97
- color: ${theme.note.timeStamp};
95
+ color: var(--colorsUtilityYin065);
98
96
  cursor: pointer;
99
- margin-left: ${3 * theme.spacing}px;
97
+ margin-left: var(--spacing300);
100
98
  }
101
99
  `}
102
100
 
103
101
  ${!hasName && (0, _styledComponents.css)`
104
102
  &:first-of-type {
105
103
  font-size: 12px;
106
- color: ${theme.note.timeStamp};
104
+ color: var(--colorsUtilityYin065);
107
105
  }
108
106
 
109
107
  &:last-of-type:not(:first-of-type) {
110
108
  font-size: 12px;
111
- color: ${theme.note.timeStamp};
109
+ color: var(--colorsUtilityYin065);
112
110
  cursor: pointer;
113
- margin-left: ${3 * theme.spacing}px;
111
+ margin-left: var(--spacing300);
114
112
  }
115
113
  `}
116
114
  `}
@@ -118,19 +116,16 @@ const StyledFooterContent = _styledComponents.default.div`
118
116
  exports.StyledFooterContent = StyledFooterContent;
119
117
  const StyledFooter = _styledComponents.default.div`
120
118
  display: flex;
121
- margin-bottom: ${({
122
- theme
123
- }) => `${-theme.spacing}px;`}
119
+ margin-bottom: calc(-1 * var(--spacing100));
124
120
  flex-wrap: wrap;
125
121
  `;
126
122
  exports.StyledFooter = StyledFooter;
127
123
  const StyledNote = _styledComponents.default.div`
128
124
  ${({
129
- theme,
130
125
  width
131
126
  }) => (0, _styledComponents.css)`
132
- background-color: ${theme.colors.white};
133
- border: 1px solid ${theme.tile.border};
127
+ background-color: var(--colorsUtilityYang100);
128
+ border: 1px solid var(--colorsUtilityMajor100);
134
129
  display: flex;
135
130
  flex-direction: column;
136
131
  padding: 24px;
@@ -155,19 +150,10 @@ const StyledNote = _styledComponents.default.div`
155
150
  ${_styledSystem.margin}
156
151
  `;
157
152
  exports.StyledNote = StyledNote;
158
- StyledNoteContent.defaultProps = {
159
- theme: _base.default
160
- };
161
153
  StyledNote.propTypes = {
162
154
  padding: _propTypes.default.string,
163
155
  width: _propTypes.default.number
164
156
  };
165
157
  StyledNote.defaultProps = {
166
158
  theme: _base.default
167
- };
168
- StyledFooter.defaultProps = {
169
- theme: _base.default
170
- };
171
- StyledFooterContent.defaultProps = {
172
- theme: _base.default
173
159
  };
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DefaultStory = exports.default = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _specialCharacters = _interopRequireWildcard(require("../../../.storybook/utils/argTypes/specialCharacters"));
11
+
12
+ var _profile = _interopRequireDefault(require("./profile.component"));
13
+
14
+ var _profile2 = require("./profile.config");
15
+
16
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
17
+
18
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
+
24
+ var _default = {
25
+ title: "Profile/Test",
26
+ parameters: {
27
+ info: {
28
+ disable: true
29
+ },
30
+ chromatic: {
31
+ disable: true
32
+ }
33
+ },
34
+ argTypes: {
35
+ size: {
36
+ control: {
37
+ type: "select",
38
+ options: _profile2.PROFILE_SIZES
39
+ }
40
+ },
41
+ emailSpecialCharacters: {
42
+ options: [..._specialCharacters.default.options, ..._specialCharacters.email.options],
43
+ mapping: { ..._specialCharacters.default.mapping,
44
+ ..._specialCharacters.email.mapping
45
+ }
46
+ },
47
+ nameSpecialCharacters: _specialCharacters.default
48
+ }
49
+ };
50
+ exports.default = _default;
51
+
52
+ const DefaultStory = ({
53
+ email,
54
+ emailSpecialCharacters,
55
+ name,
56
+ nameSpecialCharacters,
57
+ ...args
58
+ }) => /*#__PURE__*/_react.default.createElement(_profile.default, _extends({
59
+ email: email || emailSpecialCharacters,
60
+ name: name || nameSpecialCharacters
61
+ }, args));
62
+
63
+ exports.DefaultStory = DefaultStory;
64
+ DefaultStory.story = {
65
+ name: "default",
66
+ args: {
67
+ email: "johnsmith@sage.com",
68
+ initials: "JS",
69
+ size: _profile2.PROFILE_SIZES[0],
70
+ name: "John Smith",
71
+ src: "",
72
+ emailSpecialCharacters: undefined,
73
+ nameSpecialCharacters: undefined
74
+ }
75
+ };