@decisiv/ui-components 2.0.1-alpha.175 → 2.0.1-alpha.177

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAmB,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAQvE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAA2B,MAAM,SAAS,CAAC;AAExE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;AAsDhC,QAAA,MAAM,YAAY,EAAE,sBAAsB,CAAC,QAAQ,EAAE,UAAU,CAE9D,CAAC;AAQF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAmB,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAA2B,MAAM,SAAS,CAAC;AAIxE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;AAWhC,QAAA,MAAM,YAAY,EAAE,sBAAsB,CAAC,QAAQ,EAAE,UAAU,CAE9D,CAAC;AAQF,eAAe,YAAY,CAAC"}
@@ -19,21 +19,9 @@ exports.default = void 0;
19
19
 
20
20
  var _react = _interopRequireWildcard(require("react"));
21
21
 
22
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
23
-
24
- var _styledComponentsModifiers = require("styled-components-modifiers");
25
-
26
- var _color = _interopRequireDefault(require("../../modifiers/color"));
27
-
28
- var _constants = require("./constants");
29
-
30
- var _commonUIColors = require("../../utils/commonUIColors");
31
-
32
- var _utils = require("../../utils");
33
-
34
22
  var _types = require("./types");
35
23
 
36
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
+ var _styles = require("./styles");
37
25
 
38
26
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
39
27
 
@@ -43,57 +31,13 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
43
31
 
44
32
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
45
33
 
46
- var colorModifiers = (0, _utils.applyDynamicModifiers)('color', function (_ref) {
47
- var color = _ref.color;
48
- return (0, _styledComponents.css)(["", ""], color && color in _commonUIColors.commonUIColors && (0, _color.default)(_commonUIColors.commonUIColors[color]));
49
- });
50
-
51
- var getSizeStyles = function getSizeStyles(key) {
52
- return (0, _styledComponents.css)(_constants.sizeStyles[key] || '');
53
- };
54
-
55
- var sizeModifiers = (0, _styledComponentsModifiers.applyStyleModifiers)({
56
- small: function small(_ref2) {
57
- var v = _ref2.variant;
58
- return getSizeStyles("small.".concat(v));
59
- },
60
- medium: function medium(_ref3) {
61
- var v = _ref3.variant;
62
- return getSizeStyles("medium.".concat(v));
63
- },
64
- large: function large(_ref4) {
65
- var v = _ref4.variant;
66
- return getSizeStyles("large.".concat(v));
67
- }
68
- }, 'size');
69
- var variantModifiers = (0, _styledComponentsModifiers.applyStyleModifiers)({
70
- round: function round() {
71
- return (0, _styledComponents.css)({
72
- borderRadius: '50%'
73
- });
74
- },
75
- square: function square() {
76
- return (0, _styledComponents.css)({
77
- borderRadius: '2px'
78
- });
79
- }
80
- }, 'variant'); // The default coloring is explicitly set instead of relying on the
81
- // `visualInterest.licoriceMousse.medium` colors. The "default" badge is
82
- // intended to be used in “empty” and/or “no results” messages, the snowWhite
83
- // fg color and lower contrast help convey “emptiness”.
84
-
85
- var BadgeContainer = _styledComponents.default.div.withConfig({
86
- displayName: "Badge__BadgeContainer",
87
- componentId: "sc-1y6oxgp-0"
88
- })(["align-items:center;display:inline-flex;justify-content:center;", ";", ";", ";", ";"], (0, _color.default)(_commonUIColors.commonUIColors.information), colorModifiers, sizeModifiers, variantModifiers);
89
-
90
34
  function Badge(props, containerRef) {
91
35
  var ariaLabel = props['aria-label'],
92
36
  Icon = props.icon,
93
37
  size = props.size,
94
38
  rest = _objectWithoutProperties(props, ["aria-label", "icon", "size"]);
95
39
 
96
- return _react.default.createElement(BadgeContainer, _extends({
40
+ return _react.default.createElement(_styles.BadgeContainer, _extends({
97
41
  ref: containerRef,
98
42
  size: size
99
43
  }, rest), _react.default.createElement(Icon, {
@@ -55,12 +55,23 @@ describe('Badge', function () {
55
55
  expect(container).toMatchSnapshot();
56
56
  });
57
57
  });
58
+ ['bright', 'pastel'].forEach(function (palette) {
59
+ it("renders correctly with palette=\"".concat(palette, "\""), function () {
60
+ var _renderBadge3 = renderBadge({
61
+ palette: palette,
62
+ color: 'carrotCake'
63
+ }),
64
+ container = _renderBadge3.container;
65
+
66
+ expect(container).toMatchSnapshot();
67
+ });
68
+ });
58
69
  it("renders correctly with size=\"small\" and variant=\"square\"", function () {
59
- var _renderBadge3 = renderBadge({
70
+ var _renderBadge4 = renderBadge({
60
71
  size: 'small',
61
72
  variant: 'square'
62
73
  }),
63
- container = _renderBadge3.container;
74
+ container = _renderBadge4.container;
64
75
 
65
76
  expect(container).toMatchSnapshot();
66
77
  });
@@ -70,10 +81,10 @@ describe('Badge', function () {
70
81
  key = _ref2[0],
71
82
  value = _ref2[1];
72
83
 
73
- var _renderBadge4 = renderBadge({
84
+ var _renderBadge5 = renderBadge({
74
85
  color: key
75
86
  }),
76
- container = _renderBadge4.container;
87
+ container = _renderBadge5.container;
77
88
 
78
89
  expect(container.firstChild).toHaveStyleRule('background-color', (0, _toColorString.default)(value));
79
90
  });
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAAqC,CAAC;AAwBlD,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAAqC,CAAC;AA4BlD,eAAe,MAAM,CAAC"}
@@ -15,6 +15,7 @@ schema.propTypes = {
15
15
  'aria-label': _reactDesc.PropTypes.string.description('Descriptive text for accessibility purposes').isRequired,
16
16
  color: _reactDesc.PropTypes.string.description('(See note) Sets the color for the background and the icon').defaultValue('information'),
17
17
  icon: _reactDesc.PropTypes.element.description('Must be an icon component from `@decisiv/iconix`').isRequired,
18
+ palette: _reactDesc.PropTypes.oneOf(['bright', 'pastel']).description('What color variant to render').defaultValue('bright'),
18
19
  size: _reactDesc.PropTypes.oneOf(['small', 'medium', 'large']).description('(See note) Sets the size of the badge').defaultValue('medium'),
19
20
  variant: _reactDesc.PropTypes.oneOf(['round', 'square']).description('(See note) Controls primary style variations of the badge').defaultValue('round')
20
21
  };
@@ -0,0 +1,3 @@
1
+ import { BadgeProps } from './types';
2
+ export declare const BadgeContainer: import("styled-components").StyledComponent<"div", any, Pick<BadgeProps, "variant" | "size" | "color" | "palette">, never>;
3
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/styles.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AA+DrC,eAAO,MAAM,cAAc,4HAQ1B,CAAC"}
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.BadgeContainer = void 0;
7
+
8
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
+
10
+ var _styledComponentsModifiers = require("styled-components-modifiers");
11
+
12
+ var _designTokens = require("@decisiv/design-tokens");
13
+
14
+ var _color = _interopRequireDefault(require("../../modifiers/color"));
15
+
16
+ var _constants = require("./constants");
17
+
18
+ var _commonUIColors = require("../../utils/commonUIColors");
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
23
+
24
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; }
25
+
26
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
27
+
28
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
29
+
30
+ var FG_COLOR = {
31
+ pastel: 'dark'
32
+ };
33
+ var PALETTE_MAPPER = {
34
+ pastel: 'light',
35
+ bright: 'medium'
36
+ };
37
+
38
+ var colorModifiers = function colorModifiers(props) {
39
+ var _props$palette = props.palette,
40
+ palette = _props$palette === void 0 ? 'bright' : _props$palette,
41
+ color = props.color;
42
+
43
+ if (color && color in _commonUIColors.commonUIColors) {
44
+ var baseColor = _commonUIColors.commonUIThreeShadeColors[color];
45
+ var fgColor = palette === 'bright' ? _designTokens.color.base.snowWhite : baseColor[FG_COLOR[palette]];
46
+ var bgColor = baseColor[PALETTE_MAPPER[palette]];
47
+ var colorPalette = palette === 'bright' ? bgColor : _objectSpread({}, bgColor, {
48
+ fg: fgColor
49
+ });
50
+ return (0, _styledComponents.css)(["", ""], (0, _color.default)(colorPalette));
51
+ }
52
+
53
+ return null;
54
+ };
55
+
56
+ var getSizeStyles = function getSizeStyles(key) {
57
+ return (0, _styledComponents.css)(_constants.sizeStyles[key] || '');
58
+ };
59
+
60
+ var sizeModifiers = (0, _styledComponentsModifiers.applyStyleModifiers)({
61
+ small: function small(_ref) {
62
+ var v = _ref.variant;
63
+ return getSizeStyles("small.".concat(v));
64
+ },
65
+ medium: function medium(_ref2) {
66
+ var v = _ref2.variant;
67
+ return getSizeStyles("medium.".concat(v));
68
+ },
69
+ large: function large(_ref3) {
70
+ var v = _ref3.variant;
71
+ return getSizeStyles("large.".concat(v));
72
+ }
73
+ }, 'size');
74
+ var variantModifiers = (0, _styledComponentsModifiers.applyStyleModifiers)({
75
+ round: function round() {
76
+ return (0, _styledComponents.css)({
77
+ borderRadius: '50%'
78
+ });
79
+ },
80
+ square: function square() {
81
+ return (0, _styledComponents.css)({
82
+ borderRadius: '2px'
83
+ });
84
+ }
85
+ }, 'variant'); // The default coloring is explicitly set instead of relying on the
86
+ // `visualInterest.licoriceMousse.medium` colors. The "default" badge is
87
+ // intended to be used in “empty” and/or “no results” messages, the snowWhite
88
+ // fg color and lower contrast help convey “emptiness”.
89
+ // eslint-disable-next-line import/prefer-default-export
90
+
91
+ var BadgeContainer = _styledComponents.default.div.withConfig({
92
+ displayName: "styles__BadgeContainer",
93
+ componentId: "sc-1lruwqa-0"
94
+ })(["align-items:center;display:inline-flex;justify-content:center;", ";", ";", ";"], colorModifiers, sizeModifiers, variantModifiers);
95
+
96
+ exports.BadgeContainer = BadgeContainer;
@@ -8,6 +8,7 @@ export interface BadgeProps {
8
8
  'aria-label': string;
9
9
  color?: CommonUIColorKeys;
10
10
  icon: IconComponent;
11
+ palette?: 'pastel' | 'bright';
11
12
  size?: 'small' | 'medium' | 'large';
12
13
  variant?: 'round' | 'square';
13
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EACL,iBAAiB,EAElB,MAAM,4BAA4B,CAAC;AAIpC,aAAK,aAAa,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC,OAAO,CAAC;AAEvD,oBAAY,QAAQ,GAAG,cAAc,CAAC;AAItC,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC9B;AAED,iBAAS,gBAAgB,CACvB,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,SAAS,EACnB,aAAa,EAAE,OAAO,GACrB,KAAK,GAAG,IAAI,CAqBd;AAED,eAAO,MAAM,SAAS;;;;;CAKrB,CAAC;AAEF,eAAO,MAAM,YAAY;;;CAGxB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EACL,iBAAiB,EAElB,MAAM,4BAA4B,CAAC;AAIpC,aAAK,aAAa,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC,OAAO,CAAC;AAEvD,oBAAY,QAAQ,GAAG,cAAc,CAAC;AAItC,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC9B,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC9B;AAED,iBAAS,gBAAgB,CACvB,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,SAAS,EACnB,aAAa,EAAE,OAAO,GACrB,KAAK,GAAG,IAAI,CAqBd;AAED,eAAO,MAAM,SAAS;;;;;CAKrB,CAAC;AAEF,eAAO,MAAM,YAAY;;;CAGxB,CAAC"}
@@ -8,7 +8,201 @@ export declare const Body: import("styled-components").StyledComponent<"div", an
8
8
  export declare const ScrollYBox: import("styled-components").StyledComponent<"div", any, {
9
9
  size?: "XS" | "SM" | "MD" | "LG" | "XL" | undefined;
10
10
  }, never>;
11
- export declare const Header: import("styled-components").StyledComponent<"div", any, import("../Flex").FlexComponentProps, never>;
11
+ export declare const Header: import("styled-components").StyledComponent<"div", any, Partial<{
12
+ readonly alignContent?: string | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
13
+ readonly XS: "XS";
14
+ readonly SM: "SM";
15
+ readonly MD: "MD";
16
+ readonly LG: "LG";
17
+ readonly XL: "XL";
18
+ }> | undefined;
19
+ readonly alignItems?: string | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
20
+ readonly XS: "XS";
21
+ readonly SM: "SM";
22
+ readonly MD: "MD";
23
+ readonly LG: "LG";
24
+ readonly XL: "XL";
25
+ }> | undefined;
26
+ readonly alignSelf?: string | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
27
+ readonly XS: "XS";
28
+ readonly SM: "SM";
29
+ readonly MD: "MD";
30
+ readonly LG: "LG";
31
+ readonly XL: "XL";
32
+ }> | undefined;
33
+ readonly flex?: string | number | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("react").ReactText, {
34
+ readonly XS: "XS";
35
+ readonly SM: "SM";
36
+ readonly MD: "MD";
37
+ readonly LG: "LG";
38
+ readonly XL: "XL";
39
+ }> | undefined;
40
+ readonly flexBasis?: string | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
41
+ readonly XS: "XS";
42
+ readonly SM: "SM";
43
+ readonly MD: "MD";
44
+ readonly LG: "LG";
45
+ readonly XL: "XL";
46
+ }> | undefined;
47
+ readonly flexDirection?: "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "row" | "column" | "column-reverse" | "row-reverse" | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("csstype").FlexDirectionProperty, {
48
+ readonly XS: "XS";
49
+ readonly SM: "SM";
50
+ readonly MD: "MD";
51
+ readonly LG: "LG";
52
+ readonly XL: "XL";
53
+ }> | undefined;
54
+ readonly flexGrow?: number | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("csstype").GlobalsNumber, {
55
+ readonly XS: "XS";
56
+ readonly SM: "SM";
57
+ readonly MD: "MD";
58
+ readonly LG: "LG";
59
+ readonly XL: "XL";
60
+ }> | undefined;
61
+ readonly flexShrink?: number | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("csstype").GlobalsNumber, {
62
+ readonly XS: "XS";
63
+ readonly SM: "SM";
64
+ readonly MD: "MD";
65
+ readonly LG: "LG";
66
+ readonly XL: "XL";
67
+ }> | undefined;
68
+ readonly flexWrap?: "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "nowrap" | "wrap" | "wrap-reverse" | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("csstype").FlexWrapProperty, {
69
+ readonly XS: "XS";
70
+ readonly SM: "SM";
71
+ readonly MD: "MD";
72
+ readonly LG: "LG";
73
+ readonly XL: "XL";
74
+ }> | undefined;
75
+ readonly justifyContent?: string | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
76
+ readonly XS: "XS";
77
+ readonly SM: "SM";
78
+ readonly MD: "MD";
79
+ readonly LG: "LG";
80
+ readonly XL: "XL";
81
+ }> | undefined;
82
+ readonly justifyItems?: string | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
83
+ readonly XS: "XS";
84
+ readonly SM: "SM";
85
+ readonly MD: "MD";
86
+ readonly LG: "LG";
87
+ readonly XL: "XL";
88
+ }> | undefined;
89
+ readonly justifySelf?: string | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
90
+ readonly XS: "XS";
91
+ readonly SM: "SM";
92
+ readonly MD: "MD";
93
+ readonly LG: "LG";
94
+ readonly XL: "XL";
95
+ }> | undefined;
96
+ readonly order?: number | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("csstype").GlobalsNumber, {
97
+ readonly XS: "XS";
98
+ readonly SM: "SM";
99
+ readonly MD: "MD";
100
+ readonly LG: "LG";
101
+ readonly XL: "XL";
102
+ }> | undefined;
103
+ readonly size?: "XS" | "SM" | "MD" | "LG" | "XL" | undefined;
104
+ }> & Partial<{
105
+ readonly margin: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
106
+ readonly XS: "XS";
107
+ readonly SM: "SM";
108
+ readonly MD: "MD";
109
+ readonly LG: "LG";
110
+ readonly XL: "XL";
111
+ }>;
112
+ readonly marginBottom: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
113
+ readonly XS: "XS";
114
+ readonly SM: "SM";
115
+ readonly MD: "MD";
116
+ readonly LG: "LG";
117
+ readonly XL: "XL";
118
+ }>;
119
+ readonly marginLeft: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
120
+ readonly XS: "XS";
121
+ readonly SM: "SM";
122
+ readonly MD: "MD";
123
+ readonly LG: "LG";
124
+ readonly XL: "XL";
125
+ }>;
126
+ readonly marginRight: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
127
+ readonly XS: "XS";
128
+ readonly SM: "SM";
129
+ readonly MD: "MD";
130
+ readonly LG: "LG";
131
+ readonly XL: "XL";
132
+ }>;
133
+ readonly marginTop: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
134
+ readonly XS: "XS";
135
+ readonly SM: "SM";
136
+ readonly MD: "MD";
137
+ readonly LG: "LG";
138
+ readonly XL: "XL";
139
+ }>;
140
+ readonly marginX: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
141
+ readonly XS: "XS";
142
+ readonly SM: "SM";
143
+ readonly MD: "MD";
144
+ readonly LG: "LG";
145
+ readonly XL: "XL";
146
+ }>;
147
+ readonly marginY: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
148
+ readonly XS: "XS";
149
+ readonly SM: "SM";
150
+ readonly MD: "MD";
151
+ readonly LG: "LG";
152
+ readonly XL: "XL";
153
+ }>;
154
+ readonly padding: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
155
+ readonly XS: "XS";
156
+ readonly SM: "SM";
157
+ readonly MD: "MD";
158
+ readonly LG: "LG";
159
+ readonly XL: "XL";
160
+ }>;
161
+ readonly paddingBottom: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
162
+ readonly XS: "XS";
163
+ readonly SM: "SM";
164
+ readonly MD: "MD";
165
+ readonly LG: "LG";
166
+ readonly XL: "XL";
167
+ }>;
168
+ readonly paddingLeft: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
169
+ readonly XS: "XS";
170
+ readonly SM: "SM";
171
+ readonly MD: "MD";
172
+ readonly LG: "LG";
173
+ readonly XL: "XL";
174
+ }>;
175
+ readonly paddingRight: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
176
+ readonly XS: "XS";
177
+ readonly SM: "SM";
178
+ readonly MD: "MD";
179
+ readonly LG: "LG";
180
+ readonly XL: "XL";
181
+ }>;
182
+ readonly paddingTop: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
183
+ readonly XS: "XS";
184
+ readonly SM: "SM";
185
+ readonly MD: "MD";
186
+ readonly LG: "LG";
187
+ readonly XL: "XL";
188
+ }>;
189
+ readonly paddingX: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
190
+ readonly XS: "XS";
191
+ readonly SM: "SM";
192
+ readonly MD: "MD";
193
+ readonly LG: "LG";
194
+ readonly XL: "XL";
195
+ }>;
196
+ readonly paddingY: import("../../utils/dynamicModifiers").DynamicModifiersProp<number, {
197
+ readonly XS: "XS";
198
+ readonly SM: "SM";
199
+ readonly MD: "MD";
200
+ readonly LG: "LG";
201
+ readonly XL: "XL";
202
+ }>;
203
+ }> & {
204
+ flexDirection: string;
205
+ }, "flexDirection">;
12
206
  export declare const CloseButtonContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
13
207
  export declare const Content: import("styled-components").StyledComponent<"div", any, Partial<{
14
208
  readonly alignContent?: string | import("../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
@@ -400,4 +594,5 @@ export declare const Footer: import("styled-components").StyledComponent<"div",
400
594
  }> & {
401
595
  hasIcon?: boolean | undefined;
402
596
  }, never>;
597
+ export declare const ActionWrapper: import("styled-components").StyledComponent<"div", any, import("../Flex").FlexComponentProps, never>;
403
598
  //# sourceMappingURL=components.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/components.tsx"],"names":[],"mappings":";AAwCA,eAAO,MAAM,OAAO;;SASnB,CAAC;AAEF,eAAO,MAAM,IAAI;;SA6BhB,CAAC;AAEF,eAAO,MAAM,UAAU;;SAetB,CAAC;AAEF,eAAO,MAAM,MAAM,sGAAiB,CAAC;AAErC,eAAO,MAAM,oBAAoB,oEAIhC,CAAC;AAEF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAOnB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAoBlB,CAAC"}
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/components.tsx"],"names":[],"mappings":";AAYA,eAAO,MAAM,OAAO;;SASnB,CAAC;AAEF,eAAO,MAAM,IAAI;;SA6BhB,CAAC;AAEF,eAAO,MAAM,UAAU;;SAetB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAoD,CAAC;AAExE,eAAO,MAAM,oBAAoB,oEAIhC,CAAC;AAEF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAKnB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAoBlB,CAAC;AAEF,eAAO,MAAM,aAAa,sGAkBzB,CAAC"}
@@ -3,10 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Footer = exports.Content = exports.CloseButtonContainer = exports.Header = exports.ScrollYBox = exports.Body = exports.Overlay = void 0;
6
+ exports.ActionWrapper = exports.Footer = exports.Content = exports.CloseButtonContainer = exports.Header = exports.ScrollYBox = exports.Body = exports.Overlay = void 0;
7
7
 
8
8
  var _toColorString = _interopRequireDefault(require("polished/lib/color/toColorString"));
9
9
 
10
+ var _rem = _interopRequireDefault(require("polished/lib/helpers/rem"));
11
+
10
12
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
11
13
 
12
14
  var _breakpointObserver = require("@decisiv/breakpoint-observer");
@@ -23,23 +25,6 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
23
25
 
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
27
 
26
- function withIcon() {
27
- return (0, _styledComponents.css)(["", ";"], (0, _dynamicModifiers.applyDynamicModifiers)('hasIcon', function (_ref) {
28
- var hasIcon = _ref.hasIcon,
29
- size = _ref.size;
30
-
31
- if (hasIcon) {
32
- if (size === _breakpointObserver.sizes.XS) {
33
- return (0, _styledComponents.css)(["padding-left:", "px;"], _designTokens.spacing.base * 2 + 42);
34
- }
35
-
36
- return (0, _styledComponents.css)(["padding-left:", "px;"], _designTokens.spacing.base * 3 + 42);
37
- }
38
-
39
- return '';
40
- }));
41
- }
42
-
43
28
  var Overlay = _styledComponents.default.div.withConfig({
44
29
  displayName: "components__Overlay",
45
30
  componentId: "zcog99-0"
@@ -60,7 +45,9 @@ var ScrollYBox = _styledComponents.default.div.withConfig({
60
45
  })(["overflow-y:auto;position:relative;height:100%;max-height:calc(100vh - 150px);", ";"], (0, _styleModifiers.when)('size', _breakpointObserver.sizes.XS, (0, _styledComponents.css)(["max-height:calc(100vh - 70px);"])));
61
46
 
62
47
  exports.ScrollYBox = ScrollYBox;
63
- var Header = (0, _styledComponents.default)(_Flex.default).withConfig({
48
+ var Header = (0, _styledComponents.default)(_Flex.default).attrs({
49
+ flexDirection: 'column'
50
+ }).withConfig({
64
51
  displayName: "components__Header",
65
52
  componentId: "zcog99-3"
66
53
  })([""]);
@@ -75,10 +62,15 @@ exports.CloseButtonContainer = CloseButtonContainer;
75
62
  var Content = (0, _styledComponents.default)(_Flex.default).withConfig({
76
63
  displayName: "components__Content",
77
64
  componentId: "zcog99-5"
78
- })(["flex:1;flex-direction:row;", ";"], withIcon());
65
+ })(["flex:1;flex-direction:row;"]);
79
66
  exports.Content = Content;
80
67
  var Footer = (0, _styledComponents.default)(_Flex.default).withConfig({
81
68
  displayName: "components__Footer",
82
69
  componentId: "zcog99-6"
83
- })(["background-color:", ";border-radius:0 0 2px 2px;border-top:1px solid ", ";bottom:0;left:0;position:absolute;right:0;", ";", ";"], (0, _toColorString.default)(_designTokens.color.base.fullMoon), (0, _toColorString.default)(_designTokens.color.opacity.charcoal15), withIcon(), (0, _styleModifiers.when)('size', _breakpointObserver.sizes.XS, (0, _styledComponents.css)(["border-radius:0;"])));
84
- exports.Footer = Footer;
70
+ })(["background-color:", ";border-radius:0 0 2px 2px;border-top:1px solid ", ";bottom:0;left:0;position:absolute;right:0;", ";"], (0, _toColorString.default)(_designTokens.color.base.fullMoon), (0, _toColorString.default)(_designTokens.color.opacity.charcoal15), (0, _styleModifiers.when)('size', _breakpointObserver.sizes.XS, (0, _styledComponents.css)(["border-radius:0;background-color:", ";flex-direction:column;"], (0, _toColorString.default)(_designTokens.color.base.fullMoon))));
71
+ exports.Footer = Footer;
72
+ var ActionWrapper = (0, _styledComponents.default)(_Flex.default).withConfig({
73
+ displayName: "components__ActionWrapper",
74
+ componentId: "zcog99-7"
75
+ })(["", ";"], (0, _styleModifiers.when)('size', _breakpointObserver.sizes.XS, (0, _styledComponents.css)(["width:100%;&:not(:first-child){margin-top:", ";}button{font-size:", ";width:100%;height:", ";}"], (0, _rem.default)(_designTokens.spacing.base * 0.5), (0, _rem.default)(_designTokens.typography.size.alias.extraLarge), (0, _rem.default)(_designTokens.spacing.base * 5))));
76
+ exports.ActionWrapper = ActionWrapper;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA0C,MAAM,OAAO,CAAC;AA8B/D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAyJrC,iBAAS,OAAO,CAAC,EACf,OAAO,EACP,OAAO,EACP,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,UAAU,GAAG,KAAK,CAAC,WAAW,GAAG,IAAI,CAmCvC;kBAxCQ,OAAO;;;;AAmDhB,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA0C,MAAM,OAAO,CAAC;AA+B/D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AA6JrC,iBAAS,OAAO,CAAC,EACf,OAAO,EACP,OAAO,EACP,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,UAAU,GAAG,KAAK,CAAC,WAAW,GAAG,IAAI,CAmCvC;kBAxCQ,OAAO;;;;AAmDhB,eAAe,OAAO,CAAC"}
@@ -78,7 +78,7 @@ var actionProps = [{}, {
78
78
  }];
79
79
 
80
80
  function Modal(_ref) {
81
- var _ref2, _ref3, _ref4, _ref5, _ref6;
81
+ var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
82
82
 
83
83
  var actions = _ref.actions,
84
84
  children = _ref.children,
@@ -168,7 +168,7 @@ function Modal(_ref) {
168
168
  }),
169
169
  zIndex: zIndex + 10
170
170
  }, translate(closeHint, 'modal.closeHint'))), IconComponent && _react.default.createElement(_Flex.default, {
171
- marginRight: 1
171
+ marginBottom: 0.5
172
172
  }, IconComponent), _react.default.createElement(_Typography.H2, null, title)), _react.default.createElement(_components.Content, {
173
173
  hasIcon: !!IconComponent,
174
174
  id: modalContentId,
@@ -179,21 +179,22 @@ function Modal(_ref) {
179
179
  hasIcon: !!IconComponent,
180
180
  id: modalFooterId,
181
181
  paddingX: (_ref6 = {}, _defineProperty(_ref6, _breakpointObserver.sizes.LG, 3), _defineProperty(_ref6, _breakpointObserver.sizes.XS, 2), _ref6),
182
- paddingY: 2,
182
+ paddingY: (_ref7 = {}, _defineProperty(_ref7, _breakpointObserver.sizes.LG, 2), _defineProperty(_ref7, _breakpointObserver.sizes.XS, 1.5), _ref7),
183
183
  size: breakpoint
184
184
  }, actions.map(function (action, index) {
185
- return _react.default.createElement(_Flex.default, {
185
+ return _react.default.createElement(_components.ActionWrapper, {
186
186
  key: action.text,
187
- marginRight: 0.5
187
+ marginRight: 0.5,
188
+ size: breakpoint
188
189
  }, _react.default.createElement(_Button.default, _extends({}, (0, _omit.default)(action, ['kind', 'size', 'variant']), actionProps[index])));
189
190
  }))));
190
191
  }
191
192
 
192
- function Manager(_ref7) {
193
- var onClose = _ref7.onClose,
194
- visible = _ref7.visible,
195
- children = _ref7.children,
196
- rest = _objectWithoutProperties(_ref7, ["onClose", "visible", "children"]);
193
+ function Manager(_ref8) {
194
+ var onClose = _ref8.onClose,
195
+ visible = _ref8.visible,
196
+ children = _ref8.children,
197
+ rest = _objectWithoutProperties(_ref8, ["onClose", "visible", "children"]);
197
198
 
198
199
  (0, _utils.useReturnFocus)(!visible);
199
200
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decisiv/ui-components",
3
- "version": "2.0.1-alpha.175+c6cd8fa",
3
+ "version": "2.0.1-alpha.177+205e39a",
4
4
  "description": "Decisiv's design system React components",
5
5
  "author": "Decisiv UI Development Team",
6
6
  "license": "MIT",
@@ -71,5 +71,5 @@
71
71
  "access": "public"
72
72
  },
73
73
  "private": false,
74
- "gitHead": "c6cd8fa5f14a9de6e85b240f0acbfb5e12401215"
74
+ "gitHead": "205e39a7485f904df27a6656ff9f1f15eeeef354"
75
75
  }