@mailstep/design-system 0.6.12 → 0.6.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailstep/design-system",
3
- "version": "0.6.12",
3
+ "version": "0.6.13",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -4,7 +4,6 @@ type Props = {
4
4
  appearanceMap: Record<string, FlagAppearanceType>;
5
5
  enumObj: Record<string, () => string>;
6
6
  size?: 'default' | 'small' | 'wide' | 'fitContent';
7
- onClick?: () => void;
8
7
  };
9
- export declare const EnumInCell: ({ value, enumObj, appearanceMap, size, onClick }: Props) => JSX.Element | null;
8
+ export declare const EnumInCell: ({ value, enumObj, appearanceMap, size }: Props) => JSX.Element | null;
10
9
  export {};
@@ -19,7 +19,7 @@ import styled from '@xstyled/styled-components';
19
19
  import HighlightBox from '../../../../Elements/HighlightBox';
20
20
  var Center = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: flex-start;\n width: 100%;\n"], ["\n display: flex;\n justify-content: flex-start;\n width: 100%;\n"])));
21
21
  export var EnumInCell = function (_a) {
22
- var value = _a.value, enumObj = _a.enumObj, appearanceMap = _a.appearanceMap, size = _a.size, onClick = _a.onClick;
22
+ var value = _a.value, enumObj = _a.enumObj, appearanceMap = _a.appearanceMap, size = _a.size;
23
23
  var finalLabel = useMemo(function () {
24
24
  return enumObj[value] ? enumObj[value]() : value;
25
25
  }, [enumObj, value]);
@@ -28,6 +28,6 @@ export var EnumInCell = function (_a) {
28
28
  }, [appearanceMap, value]);
29
29
  if (!finalLabel)
30
30
  return null;
31
- return (_jsx(Center, { onClick: onClick, children: _jsx(HighlightBox, __assign({}, coloringProp, { size: size, prefix: "grid", children: finalLabel })) }));
31
+ return (_jsx(Center, { children: _jsx(HighlightBox, __assign({ className: "cell" }, coloringProp, { size: size, prefix: "grid", children: finalLabel })) }));
32
32
  };
33
33
  var templateObject_1;
@@ -44,7 +44,8 @@ type HighlightBoxType = {
44
44
  children: React.ReactNode;
45
45
  appearance: FlagAppearanceType;
46
46
  size?: 'default' | 'small' | 'wide' | 'fitContent';
47
+ className?: string;
47
48
  prefix?: string;
48
49
  };
49
- declare const HighlightBox: ({ children, appearance, size, prefix }: HighlightBoxType) => JSX.Element;
50
+ declare const HighlightBox: ({ children, appearance, size, className, prefix }: HighlightBoxType) => JSX.Element;
50
51
  export default HighlightBox;
@@ -5,7 +5,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import styled, { useTheme } from '@xstyled/styled-components';
7
7
  import { th } from '@xstyled/system';
8
- var StyledHighlightBox = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: flex-start;\n border-radius: ml;\n font-size: 12px;\n text-align: center;\n line-height: 19.2px;\n min-width: 0;\n font-weight: semiBold;\n .default {\n height: 24px;\n padding: 2px 8px;\n }\n .small {\n height: 18px;\n padding: 1px 6px;\n }\n .wide {\n height: 2.75em;\n display: flex;\n flex-flow: row wrap;\n width: 11rem;\n align-content: center;\n line-height: 14px;\n padding: 0.5px 12px;\n }\n .fitContent {\n width: fit-content;\n height: auto;\n padding: 4px 5px;\n font-size: 13px;\n line-height: 15px;\n font-weight: 400;\n }\n background-color: ", ";\n color: ", ";\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: flex-start;\n border-radius: ml;\n font-size: 12px;\n text-align: center;\n line-height: 19.2px;\n min-width: 0;\n font-weight: semiBold;\n .default {\n height: 24px;\n padding: 2px 8px;\n }\n .small {\n height: 18px;\n padding: 1px 6px;\n }\n .wide {\n height: 2.75em;\n display: flex;\n flex-flow: row wrap;\n width: 11rem;\n align-content: center;\n line-height: 14px;\n padding: 0.5px 12px;\n }\n .fitContent {\n width: fit-content;\n height: auto;\n padding: 4px 5px;\n font-size: 13px;\n line-height: 15px;\n font-weight: 400;\n }\n background-color: ", ";\n color: ", ";\n"])), function (_a) {
8
+ var StyledHighlightBox = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: flex-start;\n border-radius: ml;\n font-size: 12px;\n text-align: center;\n line-height: 19.2px;\n min-width: 0;\n font-weight: semiBold;\n .default {\n height: 24px;\n padding: 2px 8px !important;\n }\n .small {\n height: 18px;\n padding: 1px 6px;\n }\n .wide {\n height: 2.75em;\n display: flex;\n flex-flow: row wrap;\n width: 11rem;\n align-content: center;\n line-height: 14px;\n padding: 0.5px 12px;\n }\n .fitContent {\n width: fit-content;\n height: auto;\n padding: 4px 5px;\n font-size: 13px;\n line-height: 15px;\n font-weight: 400;\n }\n background-color: ", ";\n color: ", ";\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: flex-start;\n border-radius: ml;\n font-size: 12px;\n text-align: center;\n line-height: 19.2px;\n min-width: 0;\n font-weight: semiBold;\n .default {\n height: 24px;\n padding: 2px 8px !important;\n }\n .small {\n height: 18px;\n padding: 1px 6px;\n }\n .wide {\n height: 2.75em;\n display: flex;\n flex-flow: row wrap;\n width: 11rem;\n align-content: center;\n line-height: 14px;\n padding: 0.5px 12px;\n }\n .fitContent {\n width: fit-content;\n height: auto;\n padding: 4px 5px;\n font-size: 13px;\n line-height: 15px;\n font-weight: 400;\n }\n background-color: ", ";\n color: ", ";\n"])), function (_a) {
9
9
  var $bgcolor = _a.$bgcolor;
10
10
  return $bgcolor;
11
11
  }, function (_a) {
@@ -54,12 +54,12 @@ export var flagAppearanceToFontColorMap = {
54
54
  redSubtle: 'red80',
55
55
  };
56
56
  var HighlightBox = function (_a) {
57
- var children = _a.children, appearance = _a.appearance, _b = _a.size, size = _b === void 0 ? 'default' : _b, prefix = _a.prefix;
57
+ var children = _a.children, appearance = _a.appearance, _b = _a.size, size = _b === void 0 ? 'default' : _b, className = _a.className, prefix = _a.prefix;
58
58
  var theme = useTheme();
59
59
  var bgColor = th.color(appearance ? flagAppearanceToColorMap[appearance] : 'transparent')({ theme: theme });
60
60
  var fontColor = th.color(appearance ? flagAppearanceToFontColorMap[appearance] : 'typoPrimary')({ theme: theme });
61
61
  var name = !!prefix ? "".concat(prefix, "Label") : 'label';
62
- return (_jsx(StyledHighlightBox, { "$bgcolor": bgColor, "$fontColor": fontColor, "data-cy": name, children: _jsx(OverflowWrap, { className: size, children: children }) }));
62
+ return (_jsx(StyledHighlightBox, { "$bgcolor": bgColor, "$fontColor": fontColor, "data-cy": name, children: _jsx(OverflowWrap, { className: size + ' ' + className, children: children }) }));
63
63
  };
64
64
  export default HighlightBox;
65
65
  var templateObject_1, templateObject_2;
package/ui/index.es.js CHANGED
@@ -37430,7 +37430,7 @@ const Cs = /* @__PURE__ */ ho(j4e), TSe = ({
37430
37430
  font-weight: semiBold;
37431
37431
  .default {
37432
37432
  height: 24px;
37433
- padding: 2px 8px;
37433
+ padding: 2px 8px !important;
37434
37434
  }
37435
37435
  .small {
37436
37436
  height: 18px;
@@ -37504,14 +37504,15 @@ const Cs = /* @__PURE__ */ ho(j4e), TSe = ({
37504
37504
  children: e,
37505
37505
  appearance: t,
37506
37506
  size: r = "default",
37507
- prefix: n
37507
+ className: n,
37508
+ prefix: i
37508
37509
  }) => {
37509
- const i = wt(), o = ne.color(t ? Q4e[t] : "transparent")({
37510
- theme: i
37511
- }), l = ne.color(t ? K4e[t] : "typoPrimary")({
37512
- theme: i
37513
- }), u = n ? `${n}Label` : "label";
37514
- return /* @__PURE__ */ b.jsx($4e, { $bgcolor: o, $fontColor: l, "data-cy": u, children: /* @__PURE__ */ b.jsx(q4e, { className: r, children: e }) });
37510
+ const o = wt(), l = ne.color(t ? Q4e[t] : "transparent")({
37511
+ theme: o
37512
+ }), u = ne.color(t ? K4e[t] : "typoPrimary")({
37513
+ theme: o
37514
+ }), c = i ? `${i}Label` : "label";
37515
+ return /* @__PURE__ */ b.jsx($4e, { $bgcolor: l, $fontColor: u, "data-cy": c, children: /* @__PURE__ */ b.jsx(q4e, { className: r + " " + n, children: e }) });
37515
37516
  }, t6e = ae.div`
37516
37517
  display: flex;
37517
37518
  justify-content: flex-start;
@@ -37520,13 +37521,12 @@ const Cs = /* @__PURE__ */ ho(j4e), TSe = ({
37520
37521
  value: e,
37521
37522
  enumObj: t,
37522
37523
  appearanceMap: r,
37523
- size: n,
37524
- onClick: i
37524
+ size: n
37525
37525
  }) => {
37526
- const o = it(() => t[e] ? t[e]() : e, [t, e]), l = it(() => ({
37526
+ const i = it(() => t[e] ? t[e]() : e, [t, e]), o = it(() => ({
37527
37527
  appearance: r[e]
37528
37528
  }), [r, e]);
37529
- return o ? /* @__PURE__ */ b.jsx(t6e, { onClick: i, children: /* @__PURE__ */ b.jsx(e6e, { ...l, size: n, prefix: "grid", children: o }) }) : null;
37529
+ return i ? /* @__PURE__ */ b.jsx(t6e, { children: /* @__PURE__ */ b.jsx(e6e, { className: "cell", ...o, size: n, prefix: "grid", children: i }) }) : null;
37530
37530
  }, r6e = ae.div`
37531
37531
  text-align: center;
37532
37532
  overflow: hidden;
package/ui/index.umd.js CHANGED
@@ -2960,7 +2960,7 @@ function print() { __p += __j.call(arguments, '') }
2960
2960
  font-weight: semiBold;
2961
2961
  .default {
2962
2962
  height: 24px;
2963
- padding: 2px 8px;
2963
+ padding: 2px 8px !important;
2964
2964
  }
2965
2965
  .small {
2966
2966
  height: 18px;
@@ -2988,11 +2988,11 @@ function print() { __p += __j.call(arguments, '') }
2988
2988
  `,U6e=oe.span`
2989
2989
  text-overflow: ellipsis;
2990
2990
  overflow: hidden;
2991
- `,J6e={neutralBold:"neutral300",neutralSubtle:"neutral20",blueBold:"blue70",blueSubtle:"blue20",tealBold:"teal60",tealSubtle:"teal20",greenBold:"green60",greenSubtle:"green20",orangeBold:"orange60",orangeSubtle:"orange20",yellowBold:"yellow60",yellowSubtle:"yellow20",pinkBold:"magenta60",pinkSubtle:"magenta20",purpleBold:"purple60",purpleSubtle:"purple20",redBold:"red60",redSubtle:"red20"},X6e={neutralBold:"white",neutralSubtle:"typoPrimary",blueBold:"white",blueSubtle:"blue80",tealBold:"white",tealSubtle:"teal90",greenBold:"white",greenSubtle:"green80",orangeBold:"white",orangeSubtle:"orange80",yellowBold:"typoPrimary",yellowSubtle:"typoPrimary",pinkBold:"white",pinkSubtle:"magenta80",purpleBold:"white",purpleSubtle:"purple80",redBold:"white",redSubtle:"red80"},q6e=({children:e,appearance:t,size:r="default",prefix:n})=>{const i=vt(),o=ne.color(t?J6e[t]:"transparent")({theme:i}),l=ne.color(t?X6e[t]:"typoPrimary")({theme:i}),u=n?`${n}Label`:"label";return b.jsx(Z6e,{$bgcolor:o,$fontColor:l,"data-cy":u,children:b.jsx(U6e,{className:r,children:e})})},Q6e=oe.div`
2991
+ `,J6e={neutralBold:"neutral300",neutralSubtle:"neutral20",blueBold:"blue70",blueSubtle:"blue20",tealBold:"teal60",tealSubtle:"teal20",greenBold:"green60",greenSubtle:"green20",orangeBold:"orange60",orangeSubtle:"orange20",yellowBold:"yellow60",yellowSubtle:"yellow20",pinkBold:"magenta60",pinkSubtle:"magenta20",purpleBold:"purple60",purpleSubtle:"purple20",redBold:"red60",redSubtle:"red20"},X6e={neutralBold:"white",neutralSubtle:"typoPrimary",blueBold:"white",blueSubtle:"blue80",tealBold:"white",tealSubtle:"teal90",greenBold:"white",greenSubtle:"green80",orangeBold:"white",orangeSubtle:"orange80",yellowBold:"typoPrimary",yellowSubtle:"typoPrimary",pinkBold:"white",pinkSubtle:"magenta80",purpleBold:"white",purpleSubtle:"purple80",redBold:"white",redSubtle:"red80"},q6e=({children:e,appearance:t,size:r="default",className:n,prefix:i})=>{const o=vt(),l=ne.color(t?J6e[t]:"transparent")({theme:o}),u=ne.color(t?X6e[t]:"typoPrimary")({theme:o}),c=i?`${i}Label`:"label";return b.jsx(Z6e,{$bgcolor:l,$fontColor:u,"data-cy":c,children:b.jsx(U6e,{className:r+" "+n,children:e})})},Q6e=oe.div`
2992
2992
  display: flex;
2993
2993
  justify-content: flex-start;
2994
2994
  width: 100%;
2995
- `,K6e=({value:e,enumObj:t,appearanceMap:r,size:n,onClick:i})=>{const o=k.useMemo(()=>t[e]?t[e]():e,[t,e]),l=k.useMemo(()=>({appearance:r[e]}),[r,e]);return o?b.jsx(Q6e,{onClick:i,children:b.jsx(q6e,{...l,size:n,prefix:"grid",children:o})}):null},$6e=oe.div`
2995
+ `,K6e=({value:e,enumObj:t,appearanceMap:r,size:n})=>{const i=k.useMemo(()=>t[e]?t[e]():e,[t,e]),o=k.useMemo(()=>({appearance:r[e]}),[r,e]);return i?b.jsx(Q6e,{children:b.jsx(q6e,{className:"cell",...o,size:n,prefix:"grid",children:i})}):null},$6e=oe.div`
2996
2996
  text-align: center;
2997
2997
  overflow: hidden;
2998
2998
  text-overflow: ellipsis;