@citygross/components 0.7.72 → 0.7.73

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 (40) hide show
  1. package/build/@types/components/AlertBox/AlertBox.d.ts +4 -1
  2. package/build/@types/components/Box/Box.d.ts +4 -1
  3. package/build/@types/components/BoxArrow/BoxArrow.d.ts +7 -0
  4. package/build/@types/components/BoxArrow/BoxArrow.styles.d.ts +6 -0
  5. package/build/@types/components/Timeline/Timeline.d.ts +5 -1
  6. package/build/@types/components/Timeline/Timeline.stories.d.ts +21 -0
  7. package/build/@types/components/Timeline/Timeline.styles.d.ts +6 -1
  8. package/build/cjs/components/src/components/AddressBlock/AddressBlock.js +2 -1
  9. package/build/cjs/components/src/components/AddressBlock/AddressBlock.js.map +1 -1
  10. package/build/cjs/components/src/components/AlertBox/AlertBox.js +7 -4
  11. package/build/cjs/components/src/components/AlertBox/AlertBox.js.map +1 -1
  12. package/build/cjs/components/src/components/Box/Box.js +5 -2
  13. package/build/cjs/components/src/components/Box/Box.js.map +1 -1
  14. package/build/cjs/components/src/components/BoxArrow/BoxArrow.js +18 -0
  15. package/build/cjs/components/src/components/BoxArrow/BoxArrow.js.map +1 -0
  16. package/build/cjs/components/src/components/BoxArrow/BoxArrow.styles.js +22 -0
  17. package/build/cjs/components/src/components/BoxArrow/BoxArrow.styles.js.map +1 -0
  18. package/build/cjs/components/src/components/Timeline/Timeline.js +9 -11
  19. package/build/cjs/components/src/components/Timeline/Timeline.js.map +1 -1
  20. package/build/cjs/components/src/components/Timeline/Timeline.styles.js +4 -1
  21. package/build/cjs/components/src/components/Timeline/Timeline.styles.js.map +1 -1
  22. package/build/cjs/components/src/components/WarningLabel/WarningLabel.js +2 -1
  23. package/build/cjs/components/src/components/WarningLabel/WarningLabel.js.map +1 -1
  24. package/build/es/components/src/components/AddressBlock/AddressBlock.js +2 -1
  25. package/build/es/components/src/components/AddressBlock/AddressBlock.js.map +1 -1
  26. package/build/es/components/src/components/AlertBox/AlertBox.js +7 -4
  27. package/build/es/components/src/components/AlertBox/AlertBox.js.map +1 -1
  28. package/build/es/components/src/components/Box/Box.js +5 -2
  29. package/build/es/components/src/components/Box/Box.js.map +1 -1
  30. package/build/es/components/src/components/BoxArrow/BoxArrow.js +12 -0
  31. package/build/es/components/src/components/BoxArrow/BoxArrow.js.map +1 -0
  32. package/build/es/components/src/components/BoxArrow/BoxArrow.styles.js +14 -0
  33. package/build/es/components/src/components/BoxArrow/BoxArrow.styles.js.map +1 -0
  34. package/build/es/components/src/components/Timeline/Timeline.js +9 -11
  35. package/build/es/components/src/components/Timeline/Timeline.js.map +1 -1
  36. package/build/es/components/src/components/Timeline/Timeline.styles.js +4 -1
  37. package/build/es/components/src/components/Timeline/Timeline.styles.js.map +1 -1
  38. package/build/es/components/src/components/WarningLabel/WarningLabel.js +2 -1
  39. package/build/es/components/src/components/WarningLabel/WarningLabel.js.map +1 -1
  40. package/package.json +3 -3
@@ -5,5 +5,8 @@ export declare type TAlertBox = {
5
5
  icon?: JSX.Element;
6
6
  children: React.ReactNode;
7
7
  iconMinWidth?: number;
8
+ withArrow?: boolean;
9
+ arrowPlacement?: 'left' | 'right';
10
+ arrowSpacing?: number;
8
11
  };
9
- export declare function AlertBox({ background, borderColor, icon, iconMinWidth, children }: TAlertBox): JSX.Element;
12
+ export declare function AlertBox({ background, borderColor, icon, iconMinWidth, withArrow, arrowSpacing, arrowPlacement, children }: TAlertBox): JSX.Element;
@@ -4,5 +4,8 @@ export declare type TBox = {
4
4
  rounded?: boolean;
5
5
  padding?: number;
6
6
  children: React.ReactNode;
7
+ withArrow?: boolean;
8
+ arrowSpacing?: number;
9
+ arrowPlacement?: 'left' | 'right';
7
10
  };
8
- export declare function Box({ background, rounded, padding, children }: TBox): JSX.Element;
11
+ export declare function Box({ background, rounded, padding, arrowSpacing, arrowPlacement, withArrow, children }: TBox): JSX.Element;
@@ -0,0 +1,7 @@
1
+ declare type TBoxArrow = {
2
+ arrowPlacement?: 'left' | 'right';
3
+ arrowSpacing?: number;
4
+ background?: string;
5
+ };
6
+ declare const BoxArrow: ({ arrowPlacement, arrowSpacing, background }: TBoxArrow) => JSX.Element;
7
+ export default BoxArrow;
@@ -0,0 +1,6 @@
1
+ declare type TAlertBoxArrow = {
2
+ margin?: number;
3
+ placement?: 'left' | 'right';
4
+ };
5
+ export declare const BoxArrowContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TAlertBoxArrow, never>;
6
+ export {};
@@ -13,5 +13,9 @@ export declare type TTimeline = {
13
13
  dotColor?: string;
14
14
  dotActiveColor?: string;
15
15
  dotShadow?: string;
16
+ borderStyle?: 'dashed' | 'solid';
17
+ borderColor?: string;
18
+ completedColor?: string;
19
+ color?: string;
16
20
  };
17
- export declare function Timeline({ background, items, title, mobileTitle, current, dotColor, dotActiveColor, dotShadow }: TTimeline): JSX.Element;
21
+ export declare function Timeline({ background, items, title, mobileTitle, current, dotColor, dotActiveColor, dotShadow, borderStyle, borderColor, color, completedColor }: TTimeline): JSX.Element;
@@ -49,6 +49,27 @@ declare const _default: {
49
49
  type: string;
50
50
  };
51
51
  };
52
+ borderColor: {
53
+ options: string[];
54
+ mapping: import("@citygross/design-tokens").Palette | never[];
55
+ control: {
56
+ type: string;
57
+ };
58
+ };
59
+ color: {
60
+ options: string[];
61
+ mapping: import("@citygross/design-tokens").Palette | never[];
62
+ control: {
63
+ type: string;
64
+ };
65
+ };
66
+ completedColor: {
67
+ options: string[];
68
+ mapping: import("@citygross/design-tokens").Palette | never[];
69
+ control: {
70
+ type: string;
71
+ };
72
+ };
52
73
  };
53
74
  };
54
75
  export default _default;
@@ -1,4 +1,9 @@
1
+ declare type TBaseTimelineList = {
2
+ borderStyle: 'dashed' | 'solid';
3
+ borderColor?: string;
4
+ };
1
5
  export declare const BaseTimelineItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
6
  export declare const BaseTimeline: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
3
7
  export declare const TimeLineH3: import("styled-components").StyledComponent<({ children, lineThrough, color, fontWeight, ...props }: import("@citygross/typography/build/headers/h3/h3").IH3) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
4
- export declare const BaseTimelineList: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
8
+ export declare const BaseTimelineList: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TBaseTimelineList, never>;
9
+ export {};
@@ -6,11 +6,12 @@ var React = require('react');
6
6
  var typography = require('@citygross/typography');
7
7
  var AddressBlock_styles = require('./AddressBlock.styles.js');
8
8
  require('../../../../design-tokens/build/index.js');
9
+ require('@citygross/icons');
10
+ require('../BoxArrow/BoxArrow.styles.js');
9
11
  require('../AlertBox/AlertBox.styles.js');
10
12
  require('../Button/Button.js');
11
13
  require('@citygross/utils');
12
14
  require('@citygross/design-tokens');
13
- require('@citygross/icons');
14
15
  require('../Logo/Logo.styles.js');
15
16
  require('../Header/Header.styles.js');
16
17
  require('../HeaderLink/HeaderLink.styles.js');
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var index = require('../../../../design-tokens/build/index.js');
7
+ var BoxArrow = require('../BoxArrow/BoxArrow.js');
7
8
  var AlertBox_styles = require('./AlertBox.styles.js');
8
9
 
9
10
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -12,10 +13,12 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
12
13
 
13
14
  function AlertBox(_a) {
14
15
  var _b, _c;
15
- var _d = _a.background, background = _d === void 0 ? (_b = index.theme.palette) === null || _b === void 0 ? void 0 : _b.blueLight : _d, _e = _a.borderColor, borderColor = _e === void 0 ? (_c = index.theme.palette) === null || _c === void 0 ? void 0 : _c.alertBlue : _e, icon = _a.icon, _f = _a.iconMinWidth, iconMinWidth = _f === void 0 ? 24 : _f, children = _a.children;
16
- return (React__default['default'].createElement(AlertBox_styles.AlertBox, { background: background, borderColor: borderColor },
17
- icon && (React__default['default'].createElement(AlertBox_styles.IconContainer, { minWidth: iconMinWidth }, icon)),
18
- children));
16
+ var _d = _a.background, background = _d === void 0 ? (_b = index.theme.palette) === null || _b === void 0 ? void 0 : _b.blueLight : _d, _e = _a.borderColor, borderColor = _e === void 0 ? (_c = index.theme.palette) === null || _c === void 0 ? void 0 : _c.alertBlue : _e, icon = _a.icon, _f = _a.iconMinWidth, iconMinWidth = _f === void 0 ? 24 : _f, withArrow = _a.withArrow, arrowSpacing = _a.arrowSpacing, arrowPlacement = _a.arrowPlacement, children = _a.children;
17
+ return (React__default['default'].createElement("div", null,
18
+ withArrow && (React__default['default'].createElement(BoxArrow, { arrowPlacement: arrowPlacement, arrowSpacing: arrowSpacing, background: background })),
19
+ React__default['default'].createElement(AlertBox_styles.AlertBox, { background: background, borderColor: borderColor },
20
+ icon && (React__default['default'].createElement(AlertBox_styles.IconContainer, { minWidth: iconMinWidth }, icon)),
21
+ children)));
19
22
  }
20
23
 
21
24
  exports.AlertBox = AlertBox;
@@ -1 +1 @@
1
- {"version":3,"file":"AlertBox.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"AlertBox.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
+ var BoxArrow = require('../BoxArrow/BoxArrow.js');
6
7
  var Box_styles = require('./Box.styles.js');
7
8
 
8
9
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -10,8 +11,10 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
10
11
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
12
 
12
13
  function Box(_a) {
13
- var background = _a.background, _b = _a.rounded, rounded = _b === void 0 ? true : _b, padding = _a.padding, children = _a.children;
14
- return (React__default['default'].createElement(Box_styles.BoxContainer, { background: background || 'transparent', rounded: rounded, padding: padding }, children));
14
+ var background = _a.background, _b = _a.rounded, rounded = _b === void 0 ? true : _b, padding = _a.padding, arrowSpacing = _a.arrowSpacing, arrowPlacement = _a.arrowPlacement, withArrow = _a.withArrow, children = _a.children;
15
+ return (React__default['default'].createElement("div", null,
16
+ withArrow && (React__default['default'].createElement(BoxArrow, { arrowPlacement: arrowPlacement, arrowSpacing: arrowSpacing, background: background })),
17
+ React__default['default'].createElement(Box_styles.BoxContainer, { background: background || 'transparent', rounded: rounded, padding: padding }, children)));
15
18
  }
16
19
 
17
20
  exports.Box = Box;
@@ -1 +1 @@
1
- {"version":3,"file":"Box.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Box.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ var Icon = require('@citygross/icons');
4
+ var React = require('react');
5
+ var BoxArrow_styles = require('./BoxArrow.styles.js');
6
+
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
+
9
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
10
+
11
+ var BoxArrow = function (_a) {
12
+ var arrowPlacement = _a.arrowPlacement, arrowSpacing = _a.arrowSpacing, background = _a.background;
13
+ return (React__default['default'].createElement(BoxArrow_styles.BoxArrowContainer, { margin: arrowSpacing, placement: arrowPlacement },
14
+ React__default['default'].createElement(Icon.Icons.BoxArrow, { width: 17, height: 8, color: background })));
15
+ };
16
+
17
+ module.exports = BoxArrow;
18
+ //# sourceMappingURL=BoxArrow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BoxArrow.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _tslib = require('../../../../_virtual/_tslib.js');
6
+ var styled = require('styled-components');
7
+
8
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
+
10
+ var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
11
+
12
+ var BoxArrowContainer = styled__default['default'].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: flex;\n margin-bottom: -1px;\n justify-content: ", ";\n ", "\n"], ["\n display: flex;\n margin-bottom: -1px;\n justify-content: ", ";\n ", "\n"])), function (props) {
13
+ return props.placement === 'right' ? 'flex-end' : 'flex-start';
14
+ }, function (props) {
15
+ return props.placement && props.placement === 'right'
16
+ ? "margin-right: " + props.margin + "px"
17
+ : "margin-left: " + props.margin + "px";
18
+ });
19
+ var templateObject_1;
20
+
21
+ exports.BoxArrowContainer = BoxArrowContainer;
22
+ //# sourceMappingURL=BoxArrow.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BoxArrow.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
@@ -16,23 +16,21 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
16
 
17
17
  function Timeline(_a) {
18
18
  var _b, _c, _d;
19
- var background = _a.background, items = _a.items, _e = _a.title, title = _e === void 0 ? 'Vi skickar löpande information när:' : _e, _f = _a.mobileTitle, mobileTitle = _f === void 0 ? 'När din...' : _f, current = _a.current, _g = _a.dotColor, dotColor = _g === void 0 ? (_b = designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.greenLight : _g, _h = _a.dotActiveColor, dotActiveColor = _h === void 0 ? (_c = designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette) === null || _c === void 0 ? void 0 : _c.alertGreen : _h, _j = _a.dotShadow, dotShadow = _j === void 0 ? (_d = designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette) === null || _d === void 0 ? void 0 : _d.greenMedium : _j;
19
+ var background = _a.background, items = _a.items, _e = _a.title, title = _e === void 0 ? 'Vi skickar löpande information när:' : _e, _f = _a.mobileTitle, mobileTitle = _f === void 0 ? 'När din...' : _f, current = _a.current, _g = _a.dotColor, dotColor = _g === void 0 ? (_b = designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.greenLight : _g, _h = _a.dotActiveColor, dotActiveColor = _h === void 0 ? (_c = designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette) === null || _c === void 0 ? void 0 : _c.alertGreen : _h, _j = _a.dotShadow, dotShadow = _j === void 0 ? (_d = designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette) === null || _d === void 0 ? void 0 : _d.greenMedium : _j, _k = _a.borderStyle, borderStyle = _k === void 0 ? 'dashed' : _k, borderColor = _a.borderColor, color = _a.color, completedColor = _a.completedColor;
20
20
  var currentIndex = items === null || items === void 0 ? void 0 : items.indexOf(current);
21
21
  var isMobile = utils.useDetectDevice().isMobile;
22
22
  return (React__default['default'].createElement(Box.Box, { background: background },
23
23
  React__default['default'].createElement(Timeline_styles.BaseTimeline, null,
24
24
  React__default['default'].createElement(Timeline_styles.TimeLineH3, null, isMobile ? mobileTitle : title),
25
- React__default['default'].createElement(Timeline_styles.BaseTimelineList, null, items.map(function (item, index) { return (React__default['default'].createElement(Timeline_styles.BaseTimelineItem, { key: item.primaryText },
25
+ React__default['default'].createElement(Timeline_styles.BaseTimelineList, { borderStyle: borderStyle, borderColor: borderColor }, items.map(function (item, index) { return (React__default['default'].createElement(Timeline_styles.BaseTimelineItem, { key: item.primaryText },
26
26
  React__default['default'].createElement(DotIndicator.Dot, { color: index <= currentIndex ? dotActiveColor : dotColor, shadow: dotShadow }),
27
- current === item
28
- ? (React__default['default'].createElement(typography.H3, null, isMobile
29
- ? item.primaryText + " (" + item.time + ")"
30
- : item.primaryText + " - " + item.time))
31
- : (React__default['default'].createElement(typography.BodyText, null, isMobile
32
- ? item.primaryText + " (" + item.time + ")"
33
- : item.primaryText + " - " + item.time)),
34
- !isMobile && React__default['default'].createElement(typography.BodyText, null, item.secondaryText),
35
- React__default['default'].createElement(typography.BodyText, null, item.tiernaryText))); })))));
27
+ current === item ? (React__default['default'].createElement(typography.H3, { color: color }, isMobile
28
+ ? item.primaryText + " (" + item.time + ")"
29
+ : item.primaryText + " - " + item.time)) : (React__default['default'].createElement(typography.BodyText, { color: completedColor !== null && completedColor !== void 0 ? completedColor : color }, isMobile
30
+ ? item.primaryText + " (" + item.time + ")"
31
+ : item.primaryText + " - " + item.time)),
32
+ !isMobile && (React__default['default'].createElement(typography.BodyText, { color: current === item || !completedColor ? color : completedColor }, item.secondaryText)),
33
+ React__default['default'].createElement(typography.BodyText, { color: current === item || !completedColor ? color : completedColor }, item.tiernaryText))); })))));
36
34
  }
37
35
 
38
36
  exports.Timeline = Timeline;
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Timeline.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -13,7 +13,10 @@ var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
13
13
  var BaseTimelineItem = styled__default['default'].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: flex;\n gap: ", "px;\n align-items: center;\n padding: ", "px 0;\n position: relative;\n > * {\n &:nth-child(2) {\n flex-grow: 1;\n }\n }\n"], ["\n display: flex;\n gap: ", "px;\n align-items: center;\n padding: ", "px 0;\n position: relative;\n > * {\n &:nth-child(2) {\n flex-grow: 1;\n }\n }\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
14
14
  var BaseTimeline = styled__default['default'].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
15
15
  var TimeLineH3 = styled__default['default'](typography.H3)(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n padding-bottom: ", "px;\n"], ["\n padding-bottom: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
16
- var BaseTimelineList = styled__default['default'].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n position: relative;\n &::before {\n content: '';\n border-left: 1px dashed ", ";\n height: calc(100% - 24px);\n position: absolute;\n top: 12px;\n left: 3.5px;\n }\n"], ["\n position: relative;\n &::before {\n content: '';\n border-left: 1px dashed ", ";\n height: calc(100% - 24px);\n position: absolute;\n top: 12px;\n left: 3.5px;\n }\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.alertGreen; });
16
+ var BaseTimelineList = styled__default['default'].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n position: relative;\n\n &::before {\n content: '';\n border-left: 1px\n ", ";\n height: calc(100% - 28px);\n position: absolute;\n top: 14px;\n left: 3.5px;\n }\n"], ["\n position: relative;\n\n &::before {\n content: '';\n border-left: 1px\n ", ";\n height: calc(100% - 28px);\n position: absolute;\n top: 14px;\n left: 3.5px;\n }\n"])), function (props) {
17
+ var _a, _b;
18
+ return props.borderStyle + " " + ((_a = props === null || props === void 0 ? void 0 : props.borderColor) !== null && _a !== void 0 ? _a : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.alertGreen);
19
+ });
17
20
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
18
21
 
19
22
  exports.BaseTimeline = BaseTimeline;
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Timeline.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -6,11 +6,12 @@ var React = require('react');
6
6
  require('@citygross/typography');
7
7
  require('../AddressBlock/AddressBlock.styles.js');
8
8
  require('../../../../design-tokens/build/index.js');
9
+ require('@citygross/icons');
10
+ require('../BoxArrow/BoxArrow.styles.js');
9
11
  require('../AlertBox/AlertBox.styles.js');
10
12
  require('../Button/Button.js');
11
13
  require('@citygross/utils');
12
14
  require('@citygross/design-tokens');
13
- require('@citygross/icons');
14
15
  require('../Logo/Logo.styles.js');
15
16
  require('../Header/Header.styles.js');
16
17
  require('../HeaderLink/HeaderLink.styles.js');
@@ -1 +1 @@
1
- {"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,11 +2,12 @@ import React from 'react';
2
2
  import { H3, BodyText } from '@citygross/typography';
3
3
  import { AddressOption } from './AddressBlock.styles.js';
4
4
  import '../../../../design-tokens/build/index.js';
5
+ import '@citygross/icons';
6
+ import '../BoxArrow/BoxArrow.styles.js';
5
7
  import '../AlertBox/AlertBox.styles.js';
6
8
  import '../Button/Button.js';
7
9
  import '@citygross/utils';
8
10
  import '@citygross/design-tokens';
9
- import '@citygross/icons';
10
11
  import '../Logo/Logo.styles.js';
11
12
  import '../Header/Header.styles.js';
12
13
  import '../HeaderLink/HeaderLink.styles.js';
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,13 +1,16 @@
1
1
  import React from 'react';
2
2
  import { theme as theme_1 } from '../../../../design-tokens/build/index.js';
3
+ import BoxArrow from '../BoxArrow/BoxArrow.js';
3
4
  import { AlertBox as AlertBox$1, IconContainer } from './AlertBox.styles.js';
4
5
 
5
6
  function AlertBox(_a) {
6
7
  var _b, _c;
7
- var _d = _a.background, background = _d === void 0 ? (_b = theme_1.palette) === null || _b === void 0 ? void 0 : _b.blueLight : _d, _e = _a.borderColor, borderColor = _e === void 0 ? (_c = theme_1.palette) === null || _c === void 0 ? void 0 : _c.alertBlue : _e, icon = _a.icon, _f = _a.iconMinWidth, iconMinWidth = _f === void 0 ? 24 : _f, children = _a.children;
8
- return (React.createElement(AlertBox$1, { background: background, borderColor: borderColor },
9
- icon && (React.createElement(IconContainer, { minWidth: iconMinWidth }, icon)),
10
- children));
8
+ var _d = _a.background, background = _d === void 0 ? (_b = theme_1.palette) === null || _b === void 0 ? void 0 : _b.blueLight : _d, _e = _a.borderColor, borderColor = _e === void 0 ? (_c = theme_1.palette) === null || _c === void 0 ? void 0 : _c.alertBlue : _e, icon = _a.icon, _f = _a.iconMinWidth, iconMinWidth = _f === void 0 ? 24 : _f, withArrow = _a.withArrow, arrowSpacing = _a.arrowSpacing, arrowPlacement = _a.arrowPlacement, children = _a.children;
9
+ return (React.createElement("div", null,
10
+ withArrow && (React.createElement(BoxArrow, { arrowPlacement: arrowPlacement, arrowSpacing: arrowSpacing, background: background })),
11
+ React.createElement(AlertBox$1, { background: background, borderColor: borderColor },
12
+ icon && (React.createElement(IconContainer, { minWidth: iconMinWidth }, icon)),
13
+ children)));
11
14
  }
12
15
 
13
16
  export { AlertBox };
@@ -1 +1 @@
1
- {"version":3,"file":"AlertBox.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"AlertBox.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
@@ -1,9 +1,12 @@
1
1
  import React from 'react';
2
+ import BoxArrow from '../BoxArrow/BoxArrow.js';
2
3
  import { BoxContainer } from './Box.styles.js';
3
4
 
4
5
  function Box(_a) {
5
- var background = _a.background, _b = _a.rounded, rounded = _b === void 0 ? true : _b, padding = _a.padding, children = _a.children;
6
- return (React.createElement(BoxContainer, { background: background || 'transparent', rounded: rounded, padding: padding }, children));
6
+ var background = _a.background, _b = _a.rounded, rounded = _b === void 0 ? true : _b, padding = _a.padding, arrowSpacing = _a.arrowSpacing, arrowPlacement = _a.arrowPlacement, withArrow = _a.withArrow, children = _a.children;
7
+ return (React.createElement("div", null,
8
+ withArrow && (React.createElement(BoxArrow, { arrowPlacement: arrowPlacement, arrowSpacing: arrowSpacing, background: background })),
9
+ React.createElement(BoxContainer, { background: background || 'transparent', rounded: rounded, padding: padding }, children)));
7
10
  }
8
11
 
9
12
  export { Box };
@@ -1 +1 @@
1
- {"version":3,"file":"Box.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
1
+ {"version":3,"file":"Box.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
@@ -0,0 +1,12 @@
1
+ import { Icons } from '@citygross/icons';
2
+ import React from 'react';
3
+ import { BoxArrowContainer } from './BoxArrow.styles.js';
4
+
5
+ var BoxArrow = function (_a) {
6
+ var arrowPlacement = _a.arrowPlacement, arrowSpacing = _a.arrowSpacing, background = _a.background;
7
+ return (React.createElement(BoxArrowContainer, { margin: arrowSpacing, placement: arrowPlacement },
8
+ React.createElement(Icons.BoxArrow, { width: 17, height: 8, color: background })));
9
+ };
10
+
11
+ export default BoxArrow;
12
+ //# sourceMappingURL=BoxArrow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BoxArrow.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
@@ -0,0 +1,14 @@
1
+ import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
2
+ import styled from 'styled-components';
3
+
4
+ var BoxArrowContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n margin-bottom: -1px;\n justify-content: ", ";\n ", "\n"], ["\n display: flex;\n margin-bottom: -1px;\n justify-content: ", ";\n ", "\n"])), function (props) {
5
+ return props.placement === 'right' ? 'flex-end' : 'flex-start';
6
+ }, function (props) {
7
+ return props.placement && props.placement === 'right'
8
+ ? "margin-right: " + props.margin + "px"
9
+ : "margin-left: " + props.margin + "px";
10
+ });
11
+ var templateObject_1;
12
+
13
+ export { BoxArrowContainer };
14
+ //# sourceMappingURL=BoxArrow.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BoxArrow.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
@@ -8,23 +8,21 @@ import { BaseTimeline, TimeLineH3, BaseTimelineList, BaseTimelineItem } from './
8
8
 
9
9
  function Timeline(_a) {
10
10
  var _b, _c, _d;
11
- var background = _a.background, items = _a.items, _e = _a.title, title = _e === void 0 ? 'Vi skickar löpande information när:' : _e, _f = _a.mobileTitle, mobileTitle = _f === void 0 ? 'När din...' : _f, current = _a.current, _g = _a.dotColor, dotColor = _g === void 0 ? (_b = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _b === void 0 ? void 0 : _b.greenLight : _g, _h = _a.dotActiveColor, dotActiveColor = _h === void 0 ? (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.alertGreen : _h, _j = _a.dotShadow, dotShadow = _j === void 0 ? (_d = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _d === void 0 ? void 0 : _d.greenMedium : _j;
11
+ var background = _a.background, items = _a.items, _e = _a.title, title = _e === void 0 ? 'Vi skickar löpande information när:' : _e, _f = _a.mobileTitle, mobileTitle = _f === void 0 ? 'När din...' : _f, current = _a.current, _g = _a.dotColor, dotColor = _g === void 0 ? (_b = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _b === void 0 ? void 0 : _b.greenLight : _g, _h = _a.dotActiveColor, dotActiveColor = _h === void 0 ? (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.alertGreen : _h, _j = _a.dotShadow, dotShadow = _j === void 0 ? (_d = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _d === void 0 ? void 0 : _d.greenMedium : _j, _k = _a.borderStyle, borderStyle = _k === void 0 ? 'dashed' : _k, borderColor = _a.borderColor, color = _a.color, completedColor = _a.completedColor;
12
12
  var currentIndex = items === null || items === void 0 ? void 0 : items.indexOf(current);
13
13
  var isMobile = useDetectDevice().isMobile;
14
14
  return (React.createElement(Box, { background: background },
15
15
  React.createElement(BaseTimeline, null,
16
16
  React.createElement(TimeLineH3, null, isMobile ? mobileTitle : title),
17
- React.createElement(BaseTimelineList, null, items.map(function (item, index) { return (React.createElement(BaseTimelineItem, { key: item.primaryText },
17
+ React.createElement(BaseTimelineList, { borderStyle: borderStyle, borderColor: borderColor }, items.map(function (item, index) { return (React.createElement(BaseTimelineItem, { key: item.primaryText },
18
18
  React.createElement(Dot, { color: index <= currentIndex ? dotActiveColor : dotColor, shadow: dotShadow }),
19
- current === item
20
- ? (React.createElement(H3, null, isMobile
21
- ? item.primaryText + " (" + item.time + ")"
22
- : item.primaryText + " - " + item.time))
23
- : (React.createElement(BodyText, null, isMobile
24
- ? item.primaryText + " (" + item.time + ")"
25
- : item.primaryText + " - " + item.time)),
26
- !isMobile && React.createElement(BodyText, null, item.secondaryText),
27
- React.createElement(BodyText, null, item.tiernaryText))); })))));
19
+ current === item ? (React.createElement(H3, { color: color }, isMobile
20
+ ? item.primaryText + " (" + item.time + ")"
21
+ : item.primaryText + " - " + item.time)) : (React.createElement(BodyText, { color: completedColor !== null && completedColor !== void 0 ? completedColor : color }, isMobile
22
+ ? item.primaryText + " (" + item.time + ")"
23
+ : item.primaryText + " - " + item.time)),
24
+ !isMobile && (React.createElement(BodyText, { color: current === item || !completedColor ? color : completedColor }, item.secondaryText)),
25
+ React.createElement(BodyText, { color: current === item || !completedColor ? color : completedColor }, item.tiernaryText))); })))));
28
26
  }
29
27
 
30
28
  export { Timeline };
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Timeline.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -5,7 +5,10 @@ import { H3 } from '@citygross/typography';
5
5
  var BaseTimelineItem = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n gap: ", "px;\n align-items: center;\n padding: ", "px 0;\n position: relative;\n > * {\n &:nth-child(2) {\n flex-grow: 1;\n }\n }\n"], ["\n display: flex;\n gap: ", "px;\n align-items: center;\n padding: ", "px 0;\n position: relative;\n > * {\n &:nth-child(2) {\n flex-grow: 1;\n }\n }\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
6
6
  var BaseTimeline = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
7
7
  var TimeLineH3 = styled(H3)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding-bottom: ", "px;\n"], ["\n padding-bottom: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
8
- var BaseTimelineList = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n &::before {\n content: '';\n border-left: 1px dashed ", ";\n height: calc(100% - 24px);\n position: absolute;\n top: 12px;\n left: 3.5px;\n }\n"], ["\n position: relative;\n &::before {\n content: '';\n border-left: 1px dashed ", ";\n height: calc(100% - 24px);\n position: absolute;\n top: 12px;\n left: 3.5px;\n }\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.alertGreen; });
8
+ var BaseTimelineList = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n\n &::before {\n content: '';\n border-left: 1px\n ", ";\n height: calc(100% - 28px);\n position: absolute;\n top: 14px;\n left: 3.5px;\n }\n"], ["\n position: relative;\n\n &::before {\n content: '';\n border-left: 1px\n ", ";\n height: calc(100% - 28px);\n position: absolute;\n top: 14px;\n left: 3.5px;\n }\n"])), function (props) {
9
+ var _a, _b;
10
+ return props.borderStyle + " " + ((_a = props === null || props === void 0 ? void 0 : props.borderColor) !== null && _a !== void 0 ? _a : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.alertGreen);
11
+ });
9
12
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
10
13
 
11
14
  export { BaseTimeline, BaseTimelineItem, BaseTimelineList, TimeLineH3 };
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
1
+ {"version":3,"file":"Timeline.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
@@ -2,11 +2,12 @@ import React from 'react';
2
2
  import '@citygross/typography';
3
3
  import '../AddressBlock/AddressBlock.styles.js';
4
4
  import '../../../../design-tokens/build/index.js';
5
+ import '@citygross/icons';
6
+ import '../BoxArrow/BoxArrow.styles.js';
5
7
  import '../AlertBox/AlertBox.styles.js';
6
8
  import '../Button/Button.js';
7
9
  import '@citygross/utils';
8
10
  import '@citygross/design-tokens';
9
- import '@citygross/icons';
10
11
  import '../Logo/Logo.styles.js';
11
12
  import '../Header/Header.styles.js';
12
13
  import '../HeaderLink/HeaderLink.styles.js';
@@ -1 +1 @@
1
- {"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.7.72",
3
+ "version": "0.7.73",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "./build/cjs/components/src/index.js",
@@ -63,7 +63,7 @@
63
63
  },
64
64
  "dependencies": {
65
65
  "@citygross/design-tokens": "^0.2.22",
66
- "@citygross/icons": "^0.1.3",
66
+ "@citygross/icons": "^0.1.4",
67
67
  "@citygross/react-use-bg-wizard": "^0.0.8",
68
68
  "@citygross/typography": "^0.0.51",
69
69
  "@citygross/utils": "^0.0.21",
@@ -71,5 +71,5 @@
71
71
  "moment": "^2.29.1",
72
72
  "react-loading-skeleton": "^2.2.0"
73
73
  },
74
- "gitHead": "944a5eff6dce323177930c7dc344962d3acd0045"
74
+ "gitHead": "8c41577614136b7c86535d02eae396ca2d92a491"
75
75
  }