@luscii-healthtech/web-ui 0.15.1 → 0.15.2

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,4 +1,18 @@
1
+ import React from "react";
1
2
  export interface IconProps {
2
3
  className?: string;
3
4
  onClick?: () => void;
5
+ /**
6
+ * The trick to a perfectly center item is to make it translate in -half its dimensions.
7
+ * Because IE11 doesn't support translating SVG elements in CSS, we need to tap into the
8
+ * attribute from the SVG itself to do that.
9
+ *
10
+ * We can make it dynamic with `ref` and javascript but for now this is good enough.
11
+ *
12
+ * Assuming `20` is the rendered component height:
13
+ *
14
+ * @example <SVGIconComponent className="absolute top-1/2" transform="translate(0, -20)" />
15
+ *
16
+ */
17
+ transform?: React.SVGAttributes<SVGSVGElement>["transform"];
4
18
  }
@@ -2033,10 +2033,6 @@ video {
2033
2033
  --transform-translate-x: -50%;
2034
2034
  }
2035
2035
 
2036
- .-translate-y-1\/2 {
2037
- --transform-translate-y: -50%;
2038
- }
2039
-
2040
2036
  .transition-all {
2041
2037
  transition-property: all;
2042
2038
  }
@@ -1828,6 +1828,7 @@ var CrossIcon = function CrossIcon(props) {
1828
1828
  return /*#__PURE__*/React__default.createElement("svg", {
1829
1829
  className: props.className,
1830
1830
  onClick: props.onClick,
1831
+ transform: props.transform,
1831
1832
  role: props.onClick ? "button" : undefined,
1832
1833
  width: "24",
1833
1834
  height: "24",
@@ -1925,7 +1926,8 @@ var Input = function Input(_ref) {
1925
1926
  "rounded-r border-r": withSuffix !== ""
1926
1927
  }, "border-t border-b border-solid border-input-border", "flex flex-col items-center p-3", "text-sm", "text-slate-500", "bg-main-background")
1927
1928
  }, withSuffix || withPrefix), icon && /*#__PURE__*/React__default.createElement(icon, {
1928
- className: "w-6 h-6 transform top-1/2 -translate-y-1/2 left-4 text-slate-300 absolute"
1929
+ transform: "translate(0, -12)",
1930
+ className: "w-6 h-6 top-1/2 left-4 text-slate-300 absolute"
1929
1931
  }), /*#__PURE__*/React__default.createElement("input", Object.assign({}, otherProps, {
1930
1932
  "data-test-id": "input-component",
1931
1933
  name: name,
@@ -1956,7 +1958,8 @@ var Input = function Input(_ref) {
1956
1958
  "order-1": withSuffix !== ""
1957
1959
  }, "shadow-default", className)
1958
1960
  })), /*#__PURE__*/React__default.createElement(CrossIcon, {
1959
- className: classNames("absolute right-0 transform top-1/2 h-5 w-5", "-translate-y-1/2 w-6 h-6 mr-3 cursor-pointer text-slate-300", {
1961
+ transform: "translate(0, -12)",
1962
+ className: classNames("absolute right-0 top-1/2", "w-6 h-6 mr-3 cursor-pointer text-slate-300", {
1960
1963
  block: isClearIconVisible,
1961
1964
  hidden: !isClearIconVisible
1962
1965
  }),
@@ -3561,7 +3564,7 @@ var PreviewPhone = function PreviewPhone(_ref) {
3561
3564
  }))) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
3562
3565
  };
3563
3566
 
3564
- var css_248z$i = ".cweb-radio {\n outline: none;\n}\n\n.cweb-radio .cweb-radio-input {\n -webkit-appearance: none;\n height: 1px;\n opacity: 0;\n width: 1px;\n}\n\n.cweb-radio .cweb-radio-label-text {\n margin-left: 8px;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n}\n\n.cweb-radio .cweb-radio-label {\n display: flex;\n align-items: center;\n margin-bottom: 0;\n}\n\n.cweb-radio .cweb-radio-icon-container {\n width: 16px;\n height: 16px;\n position: relative;\n border: 1px solid #cccccc;\n border-radius: 50%;\n transition: background-color 0.3s ease-in-out;\n}\n\n.cweb-radio .cweb-radio-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n display: block;\n}\n\n.cweb-radio.is-focused .cweb-radio-icon-container {\n border-color: #0074dd;\n}\n\n.cweb-radio.is-checked .cweb-radio-icon {\n width: 5px;\n height: 5px;\n background-color: #ffffff;\n border-radius: 50%;\n}\n";
3567
+ var css_248z$i = ".cweb-radio {\n outline: none;\n}\n\n.cweb-radio .cweb-radio-input {\n -webkit-appearance: none;\n height: 1px;\n opacity: 0;\n width: 1px;\n}\n\n.cweb-radio .cweb-radio-label-text {\n margin-left: 8px;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n}\n\n.cweb-radio .cweb-radio-label {\n display: flex;\n align-items: center;\n margin-bottom: 0;\n}\n\n.cweb-radio .cweb-radio-icon-container {\n width: 16px;\n height: 16px;\n position: relative;\n border: 1px solid #cccccc;\n border-radius: 50%;\n transition: background-color 0.3s ease-in-out;\n}\n\n.cweb-radio .cweb-radio-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n display: block;\n}\n\n.cweb-radio.is-focused .cweb-radio-icon-container {\n border-color: #0074dd;\n}\n\n.cweb-radio.is-checked .cweb-radio-icon {\n width: 5px;\n height: 5px;\n background-color: #ffffff;\n border-radius: 50%;\n}\n";
3565
3568
  styleInject(css_248z$i);
3566
3569
 
3567
3570
  var Radio = /*#__PURE__*/function (_PureComponent) {
@@ -4516,6 +4519,7 @@ var SearchIcon = function SearchIcon(props) {
4516
4519
  return /*#__PURE__*/React__default.createElement("svg", {
4517
4520
  className: props.className,
4518
4521
  onClick: props.onClick,
4522
+ transform: props.transform,
4519
4523
  role: props.onClick ? "button" : undefined,
4520
4524
  width: "24",
4521
4525
  height: "24",