@helpdice/ui 1.8.0 → 1.8.3

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.
@@ -3679,13 +3679,22 @@ var LoadingComponent = function LoadingComponent(_ref) {
3679
3679
  LoadingComponent.displayName = 'Loading';
3680
3680
  var Loading = withScale(LoadingComponent);
3681
3681
 
3682
- // import { IconContext } from "./context.js";
3682
+ const defaultValues = {
3683
+ color: "#001A72",
3684
+ strokeWidth: "1.5",
3685
+ size: "24",
3686
+ set: "outline",
3687
+ };
3688
+ const IconContext = React.createContext(defaultValues);
3689
+ IconContext.displayName = "IconContext";
3690
+
3691
+ // 001A72
3683
3692
  const createIcon = (Component) => {
3684
- const IconWrapper = React.forwardRef(({ color = "#001A72", strokeWidth = "1.5", size = "24", set = "outline", style, ...props }, ref) => {
3685
- // const context = useContext(IconContext);
3693
+ const IconWrapper = React.forwardRef(({ color = "inherit", strokeWidth = "1.5", size = "24", set = "outline", style, ...props }, ref) => {
3694
+ const context = React.useContext(IconContext);
3686
3695
  return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, fill: "none", viewBox: "0 0 24 24", style: style, ...props, ref: ref },
3687
3696
  React.createElement("title", null, "Icon"),
3688
- React.createElement(Component, { color: color, strokeWidth: strokeWidth, set: set })));
3697
+ React.createElement(Component, { color: context.color, strokeWidth: context.strokeWidth, set: context.set })));
3689
3698
  });
3690
3699
  const MemoIcon = React.memo(IconWrapper);
3691
3700
  return MemoIcon;
@@ -3133,13 +3133,13 @@ var LinkComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
3133
3133
  href: href
3134
3134
  }, props, {
3135
3135
  ref: ref,
3136
- className: _JSXStyle.dynamic([["1742013413", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
3136
+ className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
3137
3137
  }), icon && icon, /*#__PURE__*/React.createElement("span", {
3138
- className: _JSXStyle.dynamic([["1742013413", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]])
3138
+ className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + "link-extra"
3139
3139
  }, children, arrow && /*#__PURE__*/React.createElement(LinkIcon, null)), /*#__PURE__*/React.createElement(_JSXStyle, {
3140
- id: "1742013413",
3140
+ id: "2838069667",
3141
3141
  dynamic: [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]
3142
- }, ".link.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
3142
+ }, ".link.__jsx-style-dynamic-selector,.link-extra.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
3143
3143
  });
3144
3144
  LinkComponent.displayName = 'Link';
3145
3145
  var Link = withScale(LinkComponent);
@@ -3326,13 +3326,13 @@ var LinkComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
3326
3326
  href: href
3327
3327
  }, props, {
3328
3328
  ref: ref,
3329
- className: _JSXStyle.dynamic([["1742013413", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
3329
+ className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
3330
3330
  }), icon && icon, /*#__PURE__*/React.createElement("span", {
3331
- className: _JSXStyle.dynamic([["1742013413", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]])
3331
+ className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + "link-extra"
3332
3332
  }, children, arrow && /*#__PURE__*/React.createElement(LinkIcon, null)), /*#__PURE__*/React.createElement(_JSXStyle, {
3333
- id: "1742013413",
3333
+ id: "2838069667",
3334
3334
  dynamic: [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]
3335
- }, ".link.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
3335
+ }, ".link.__jsx-style-dynamic-selector,.link-extra.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
3336
3336
  });
3337
3337
  LinkComponent.displayName = 'Link';
3338
3338
  var Link = withScale(LinkComponent);
@@ -4969,13 +4969,22 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
4969
4969
  ButtonComponent.displayName = 'Button';
4970
4970
  var Button = withScale(ButtonComponent);
4971
4971
 
4972
- // import { IconContext } from "./context.js";
4972
+ const defaultValues = {
4973
+ color: "#001A72",
4974
+ strokeWidth: "1.5",
4975
+ size: "24",
4976
+ set: "outline",
4977
+ };
4978
+ const IconContext = React.createContext(defaultValues);
4979
+ IconContext.displayName = "IconContext";
4980
+
4981
+ // 001A72
4973
4982
  const createIcon = (Component) => {
4974
- const IconWrapper = React.forwardRef(({ color = "#001A72", strokeWidth = "1.5", size = "24", set = "outline", style, ...props }, ref) => {
4975
- // const context = useContext(IconContext);
4983
+ const IconWrapper = React.forwardRef(({ color = "inherit", strokeWidth = "1.5", size = "24", set = "outline", style, ...props }, ref) => {
4984
+ const context = React.useContext(IconContext);
4976
4985
  return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, fill: "none", viewBox: "0 0 24 24", style: style, ...props, ref: ref },
4977
4986
  React.createElement("title", null, "Icon"),
4978
- React.createElement(Component, { color: color, strokeWidth: strokeWidth, set: set })));
4987
+ React.createElement(Component, { color: context.color, strokeWidth: context.strokeWidth, set: context.set })));
4979
4988
  });
4980
4989
  const MemoIcon = React.memo(IconWrapper);
4981
4990
  return MemoIcon;
@@ -3168,13 +3168,13 @@ var LinkComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
3168
3168
  href: href
3169
3169
  }, props, {
3170
3170
  ref: ref,
3171
- className: _JSXStyle.dynamic([["1742013413", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
3171
+ className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
3172
3172
  }), icon && icon, /*#__PURE__*/React.createElement("span", {
3173
- className: _JSXStyle.dynamic([["1742013413", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]])
3173
+ className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + "link-extra"
3174
3174
  }, children, arrow && /*#__PURE__*/React.createElement(LinkIcon, null)), /*#__PURE__*/React.createElement(_JSXStyle, {
3175
- id: "1742013413",
3175
+ id: "2838069667",
3176
3176
  dynamic: [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]
3177
- }, ".link.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
3177
+ }, ".link.__jsx-style-dynamic-selector,.link-extra.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
3178
3178
  });
3179
3179
  LinkComponent.displayName = 'Link';
3180
3180
  var Link = withScale(LinkComponent);
package/dist/index.js CHANGED
@@ -4003,13 +4003,22 @@ var LoadingComponent = function LoadingComponent(_ref) {
4003
4003
  LoadingComponent.displayName = 'Loading';
4004
4004
  var Loading = withScale(LoadingComponent);
4005
4005
 
4006
- // import { IconContext } from "./context.js";
4006
+ const defaultValues = {
4007
+ color: "#001A72",
4008
+ strokeWidth: "1.5",
4009
+ size: "24",
4010
+ set: "outline",
4011
+ };
4012
+ const IconContext = React.createContext(defaultValues);
4013
+ IconContext.displayName = "IconContext";
4014
+
4015
+ // 001A72
4007
4016
  const createIcon = (Component) => {
4008
- const IconWrapper = React.forwardRef(({ color = "#001A72", strokeWidth = "1.5", size = "24", set = "outline", style, ...props }, ref) => {
4009
- // const context = useContext(IconContext);
4017
+ const IconWrapper = React.forwardRef(({ color = "inherit", strokeWidth = "1.5", size = "24", set = "outline", style, ...props }, ref) => {
4018
+ const context = React.useContext(IconContext);
4010
4019
  return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, fill: "none", viewBox: "0 0 24 24", style: style, ...props, ref: ref },
4011
4020
  React.createElement("title", null, "Icon"),
4012
- React.createElement(Component, { color: color, strokeWidth: strokeWidth, set: set })));
4021
+ React.createElement(Component, { color: context.color, strokeWidth: context.strokeWidth, set: context.set })));
4013
4022
  });
4014
4023
  const MemoIcon = React.memo(IconWrapper);
4015
4024
  return MemoIcon;
@@ -14395,13 +14404,13 @@ var LinkComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
14395
14404
  href: href
14396
14405
  }, props, {
14397
14406
  ref: ref,
14398
- className: _JSXStyle.dynamic([["1742013413", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
14407
+ className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
14399
14408
  }), icon && icon, /*#__PURE__*/React.createElement("span", {
14400
- className: _JSXStyle.dynamic([["1742013413", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]])
14409
+ className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + "link-extra"
14401
14410
  }, children, arrow && /*#__PURE__*/React.createElement(LinkIcon, null)), /*#__PURE__*/React.createElement(_JSXStyle, {
14402
- id: "1742013413",
14411
+ id: "2838069667",
14403
14412
  dynamic: [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]
14404
- }, ".link.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
14413
+ }, ".link.__jsx-style-dynamic-selector,.link-extra.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
14405
14414
  });
14406
14415
  LinkComponent.displayName = 'Link';
14407
14416
  var Link = withScale(LinkComponent);
@@ -3065,13 +3065,13 @@ var LinkComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
3065
3065
  href: href
3066
3066
  }, props, {
3067
3067
  ref: ref,
3068
- className: _JSXStyle.dynamic([["1742013413", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
3068
+ className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
3069
3069
  }), icon && icon, /*#__PURE__*/React.createElement("span", {
3070
- className: _JSXStyle.dynamic([["1742013413", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]])
3070
+ className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + "link-extra"
3071
3071
  }, children, arrow && /*#__PURE__*/React.createElement(LinkIcon, null)), /*#__PURE__*/React.createElement(_JSXStyle, {
3072
- id: "1742013413",
3072
+ id: "2838069667",
3073
3073
  dynamic: [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]
3074
- }, ".link.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
3074
+ }, ".link.__jsx-style-dynamic-selector,.link-extra.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
3075
3075
  });
3076
3076
  LinkComponent.displayName = 'Link';
3077
3077
  var Link = withScale(LinkComponent);
@@ -22409,13 +22409,22 @@ var TableColumn = function TableColumn(columnProps) {
22409
22409
  };
22410
22410
  TableColumn.displayName = 'TableColumn';
22411
22411
 
22412
- // import { IconContext } from "./context.js";
22412
+ const defaultValues = {
22413
+ color: "#001A72",
22414
+ strokeWidth: "1.5",
22415
+ size: "24",
22416
+ set: "outline",
22417
+ };
22418
+ const IconContext = React.createContext(defaultValues);
22419
+ IconContext.displayName = "IconContext";
22420
+
22421
+ // 001A72
22413
22422
  const createIcon = (Component) => {
22414
- const IconWrapper = React.forwardRef(({ color = "#001A72", strokeWidth = "1.5", size = "24", set = "outline", style, ...props }, ref) => {
22415
- // const context = useContext(IconContext);
22423
+ const IconWrapper = React.forwardRef(({ color = "inherit", strokeWidth = "1.5", size = "24", set = "outline", style, ...props }, ref) => {
22424
+ const context = React.useContext(IconContext);
22416
22425
  return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, fill: "none", viewBox: "0 0 24 24", style: style, ...props, ref: ref },
22417
22426
  React.createElement("title", null, "Icon"),
22418
- React.createElement(Component, { color: color, strokeWidth: strokeWidth, set: set })));
22427
+ React.createElement(Component, { color: context.color, strokeWidth: context.strokeWidth, set: context.set })));
22419
22428
  });
22420
22429
  const MemoIcon = React.memo(IconWrapper);
22421
22430
  return MemoIcon;
@@ -3173,13 +3173,13 @@ var LinkComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
3173
3173
  href: href
3174
3174
  }, props, {
3175
3175
  ref: ref,
3176
- className: _JSXStyle.dynamic([["1742013413", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
3176
+ className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
3177
3177
  }), icon && icon, /*#__PURE__*/React.createElement("span", {
3178
- className: _JSXStyle.dynamic([["1742013413", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]])
3178
+ className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + "link-extra"
3179
3179
  }, children, arrow && /*#__PURE__*/React.createElement(LinkIcon, null)), /*#__PURE__*/React.createElement(_JSXStyle, {
3180
- id: "1742013413",
3180
+ id: "2838069667",
3181
3181
  dynamic: [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]
3182
- }, ".link.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
3182
+ }, ".link.__jsx-style-dynamic-selector,.link-extra.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
3183
3183
  });
3184
3184
  LinkComponent.displayName = 'Link';
3185
3185
  var Link = withScale(LinkComponent);
package/esm/link/link.js CHANGED
@@ -38,13 +38,13 @@ var LinkComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
38
38
  href: href
39
39
  }, props, {
40
40
  ref: ref,
41
- className: _JSXStyle.dynamic([["1742013413", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
41
+ className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
42
42
  }), icon && icon, /*#__PURE__*/React.createElement("span", {
43
- className: _JSXStyle.dynamic([["1742013413", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]])
43
+ className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + "link-extra"
44
44
  }, children, arrow && /*#__PURE__*/React.createElement(LinkIcon, null)), /*#__PURE__*/React.createElement(_JSXStyle, {
45
- id: "1742013413",
45
+ id: "2838069667",
46
46
  dynamic: [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]
47
- }, ".link.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
47
+ }, ".link.__jsx-style-dynamic-selector,.link-extra.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
48
48
  });
49
49
  LinkComponent.displayName = 'Link';
50
50
  var Link = withScale(LinkComponent);
@@ -0,0 +1,24 @@
1
+ import htmlparser2 from 'htmlparser2';
2
+ import processNodes from './processNodes';
3
+
4
+ /**
5
+ * Parses a HTML string and returns a list of React components generated from it
6
+ *
7
+ * @param {String} html The HTML to convert into React component
8
+ * @param {Object} options Options to pass
9
+ * @returns {Array} List of top level React elements
10
+ */
11
+ export default function HtmlParser(html) {
12
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
13
+ _ref$decodeEntities = _ref.decodeEntities,
14
+ decodeEntities = _ref$decodeEntities === void 0 ? true : _ref$decodeEntities,
15
+ transform = _ref.transform,
16
+ _ref$preprocessNodes = _ref.preprocessNodes,
17
+ preprocessNodes = _ref$preprocessNodes === void 0 ? function (nodes) {
18
+ return nodes;
19
+ } : _ref$preprocessNodes;
20
+ var nodes = preprocessNodes(htmlparser2.parseDOM(html, {
21
+ decodeEntities: decodeEntities
22
+ }));
23
+ return processNodes(nodes, transform);
24
+ }
@@ -0,0 +1,13 @@
1
+ import ElementTypes from './elementTypes';
2
+
3
+ /**
4
+ * Converts a htmlparser2 node to a React element
5
+ *
6
+ * @param {Object} node The htmlparser2 node to convert
7
+ * @param {Number} index The index of the current node
8
+ * @param {Function} transform Transform function to apply to children of the node
9
+ * @returns {React.Element}
10
+ */
11
+ export default function convertNodeToElement(node, index, transform) {
12
+ return ElementTypes[node.type](node, index, transform);
13
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * List of boolean attributes
3
+ * These attributes should have their React attribute value set to be the same as their name
4
+ * E.g. <input disabled> = <input disabled>
5
+ * <input disabled=""> = <input disabled>
6
+ * <input disabled="disabled"> = <input disabled>
7
+ * @type {Array}
8
+ */
9
+ export default ['allowfullScreen', 'async', 'autoplay', 'capture', 'checked', 'controls', 'default', 'defer', 'disabled', 'formnovalidate', 'hidden', 'loop', 'multiple', 'muted', 'novalidate', 'open', 'playsinline', 'readonly', 'required', 'reversed', 'scoped', 'seamless', 'selected', 'itemscope'];
@@ -0,0 +1,164 @@
1
+ /**
2
+ * Mapping of standard HTML attributes to their React counterparts
3
+ * List taken and reversed from react/src/renderers/dom/shared/HTMLDOMPropertyConfig.js
4
+ * https://github.com/facebook/react/blob/c9c3c339b757682f1154f1c915eb55e6a8766933/src/renderers/dom/shared/HTMLDOMPropertyConfig.js
5
+ * @type {Object}
6
+ */
7
+ export default {
8
+ /**
9
+ * Standard Properties
10
+ */
11
+ accept: 'accept',
12
+ 'accept-charset': 'acceptCharset',
13
+ accesskey: 'accessKey',
14
+ action: 'action',
15
+ allowfullscreen: 'allowFullScreen',
16
+ allowtransparency: 'allowTransparency',
17
+ alt: 'alt',
18
+ as: 'as',
19
+ async: 'async',
20
+ autocomplete: 'autoComplete',
21
+ autoplay: 'autoPlay',
22
+ capture: 'capture',
23
+ cellpadding: 'cellPadding',
24
+ cellspacing: 'cellSpacing',
25
+ charset: 'charSet',
26
+ challenge: 'challenge',
27
+ checked: 'checked',
28
+ cite: 'cite',
29
+ classid: 'classID',
30
+ "class": 'className',
31
+ cols: 'cols',
32
+ colspan: 'colSpan',
33
+ content: 'content',
34
+ contenteditable: 'contentEditable',
35
+ contextmenu: 'contextMenu',
36
+ controls: 'controls',
37
+ controlsList: 'controlsList',
38
+ coords: 'coords',
39
+ crossorigin: 'crossOrigin',
40
+ data: 'data',
41
+ datetime: 'dateTime',
42
+ "default": 'default',
43
+ defer: 'defer',
44
+ dir: 'dir',
45
+ disabled: 'disabled',
46
+ download: 'download',
47
+ draggable: 'draggable',
48
+ enctype: 'encType',
49
+ form: 'form',
50
+ formaction: 'formAction',
51
+ formenctype: 'formEncType',
52
+ formmethod: 'formMethod',
53
+ formnovalidate: 'formNoValidate',
54
+ formtarget: 'formTarget',
55
+ frameborder: 'frameBorder',
56
+ headers: 'headers',
57
+ height: 'height',
58
+ hidden: 'hidden',
59
+ high: 'high',
60
+ href: 'href',
61
+ hreflang: 'hrefLang',
62
+ "for": 'htmlFor',
63
+ 'http-equiv': 'httpEquiv',
64
+ icon: 'icon',
65
+ id: 'id',
66
+ inputmode: 'inputMode',
67
+ integrity: 'integrity',
68
+ is: 'is',
69
+ keyparams: 'keyParams',
70
+ keytype: 'keyType',
71
+ kind: 'kind',
72
+ label: 'label',
73
+ lang: 'lang',
74
+ list: 'list',
75
+ loop: 'loop',
76
+ low: 'low',
77
+ manifest: 'manifest',
78
+ marginheight: 'marginHeight',
79
+ marginwidth: 'marginWidth',
80
+ max: 'max',
81
+ maxlength: 'maxLength',
82
+ media: 'media',
83
+ mediagroup: 'mediaGroup',
84
+ method: 'method',
85
+ min: 'min',
86
+ minlength: 'minLength',
87
+ multiple: 'multiple',
88
+ muted: 'muted',
89
+ name: 'name',
90
+ nonce: 'nonce',
91
+ novalidate: 'noValidate',
92
+ open: 'open',
93
+ optimum: 'optimum',
94
+ pattern: 'pattern',
95
+ placeholder: 'placeholder',
96
+ playsinline: 'playsInline',
97
+ poster: 'poster',
98
+ preload: 'preload',
99
+ profile: 'profile',
100
+ radiogroup: 'radioGroup',
101
+ readonly: 'readOnly',
102
+ referrerpolicy: 'referrerPolicy',
103
+ rel: 'rel',
104
+ required: 'required',
105
+ reversed: 'reversed',
106
+ role: 'role',
107
+ rows: 'rows',
108
+ rowspan: 'rowSpan',
109
+ sandbox: 'sandbox',
110
+ scope: 'scope',
111
+ scoped: 'scoped',
112
+ scrolling: 'scrolling',
113
+ seamless: 'seamless',
114
+ selected: 'selected',
115
+ shape: 'shape',
116
+ size: 'size',
117
+ sizes: 'sizes',
118
+ slot: 'slot',
119
+ span: 'span',
120
+ spellcheck: 'spellCheck',
121
+ src: 'src',
122
+ srcdoc: 'srcDoc',
123
+ srclang: 'srcLang',
124
+ srcset: 'srcSet',
125
+ start: 'start',
126
+ step: 'step',
127
+ style: 'style',
128
+ summary: 'summary',
129
+ tabindex: 'tabIndex',
130
+ target: 'target',
131
+ title: 'title',
132
+ type: 'type',
133
+ usemap: 'useMap',
134
+ value: 'value',
135
+ width: 'width',
136
+ wmode: 'wmode',
137
+ wrap: 'wrap',
138
+ /**
139
+ * RDFa Properties
140
+ */
141
+ about: 'about',
142
+ datatype: 'datatype',
143
+ inlist: 'inlist',
144
+ prefix: 'prefix',
145
+ property: 'property',
146
+ resource: 'resource',
147
+ "typeof": 'typeof',
148
+ vocab: 'vocab',
149
+ /**
150
+ * Non-standard Properties
151
+ */
152
+ autocapitalize: 'autoCapitalize',
153
+ autocorrect: 'autoCorrect',
154
+ autosave: 'autoSave',
155
+ color: 'color',
156
+ itemprop: 'itemProp',
157
+ itemscope: 'itemScope',
158
+ itemtype: 'itemType',
159
+ itemid: 'itemID',
160
+ itemref: 'itemRef',
161
+ results: 'results',
162
+ security: 'security',
163
+ unselectable: 'unselectable'
164
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * List of void elements
3
+ * These elements are not allowed to have children
4
+ * @type {Array}
5
+ */
6
+ export default ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import generateElementProps from '../utils/generatePropsFromAttributes';
3
+
4
+ /**
5
+ * Converts a <style> element to a React element
6
+ *
7
+ * @param {Object} node The style node
8
+ * @param {String} index The index of the React element relative to it's parent
9
+ * @returns {React.Element} The React style element
10
+ */
11
+ export default function StyleElementType(node, index) {
12
+ // The style element only ever has a single child which is the styles so try and find this to add as
13
+ // a child to the style element that will be created
14
+ var styles;
15
+ if (node.children.length > 0) {
16
+ styles = node.children[0].data;
17
+ }
18
+
19
+ // generate props
20
+ var props = generateElementProps(node.attribs, index);
21
+
22
+ // create and return the element
23
+ return /*#__PURE__*/React.createElement('style', props, styles);
24
+ }
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import processNodes from '../processNodes';
3
+ import generatePropsFromAttributes from '../utils/generatePropsFromAttributes';
4
+ import VoidElements from '../dom/elements/VoidElements';
5
+ import isValidTagOrAttributeName from '../utils/isValidTagOrAttributeName';
6
+
7
+ /**
8
+ * Converts any element (excluding style - see StyleElementType - and script) to a react element.
9
+ *
10
+ * @param {Object} node The tag node
11
+ * @param {String} index The index of the React element relative to it's parent
12
+ * @param {Function} transform The transform function to apply to all children
13
+ * @returns {React.Element} The React tag element
14
+ */
15
+ export default function TagElementType(node, index, transform) {
16
+ var tagName = node.name;
17
+
18
+ // validate tag name
19
+ if (!isValidTagOrAttributeName(tagName)) {
20
+ return null;
21
+ }
22
+
23
+ // generate props
24
+ var props = generatePropsFromAttributes(node.attribs, index);
25
+
26
+ // If the node is not a void element and has children then process them
27
+ var children = null;
28
+ if (VoidElements.indexOf(tagName) === -1) {
29
+ children = processNodes(node.children, transform);
30
+ }
31
+
32
+ // create and return the element
33
+ return /*#__PURE__*/React.createElement(tagName, props, children);
34
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Converts a text node to a React text element
3
+ *
4
+ * @param {Object} node The text node
5
+ * @returns {String} The text
6
+ */
7
+ export default function TextElementType(node) {
8
+ // React will accept plain text for rendering so just return the node data
9
+ return node.data;
10
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Handles an unsupported element type by returning null so nothing is rendered
3
+ * @returns {null}
4
+ */
5
+ export default function UnsupportedElementType() {
6
+ // do nothing because the element type is unsupported
7
+ // comment, directive, script, cdata, doctype are all currently unsupported
8
+ return null;
9
+ }
@@ -0,0 +1,13 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ /*
3
+ * Map each htmlparser2 element type to a function which will convert that element type to a React element
4
+ * Not all of the element types are supported so the UnsupportedElementType is used for them which will not return any
5
+ * value
6
+ */
7
+
8
+ import { ElementType } from 'htmlparser2';
9
+ import TextElementType from './TextElementType';
10
+ import TagElementType from './TagElementType';
11
+ import StyleElementType from './StyleElementType';
12
+ import UnsupportedElementType from './UnsupportedElementType';
13
+ export default _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ElementType.Text, TextElementType), ElementType.Tag, TagElementType), ElementType.Style, StyleElementType), ElementType.Directive, UnsupportedElementType), ElementType.Comment, UnsupportedElementType), ElementType.Script, UnsupportedElementType), ElementType.CDATA, UnsupportedElementType), ElementType.Doctype, UnsupportedElementType);
@@ -0,0 +1,7 @@
1
+ import HtmlParser from './HtmlParser';
2
+ export default HtmlParser;
3
+ export { default as processNodes } from './processNodes';
4
+ export { default as convertNodeToElement } from './convertNodeToElement';
5
+
6
+ // expose htmlparser2 so it can be used if required
7
+ export { default as htmlparser2 } from 'htmlparser2';
@@ -0,0 +1,27 @@
1
+ import isEmptyTextNode from './utils/isEmptyTextNode';
2
+ import convertNodeToElement from './convertNodeToElement';
3
+
4
+ /**
5
+ * Processes the nodes generated by htmlparser2 and convert them all into React elements
6
+ *
7
+ * @param {Object[]} nodes List of nodes to process
8
+ * @param {Function} transform Transform function to optionally apply to nodes
9
+ * @returns {React.Element[]} The list of processed React elements
10
+ */
11
+ export default function processNodes(nodes, transform) {
12
+ return nodes.filter(function (node) {
13
+ return !isEmptyTextNode(node);
14
+ }).map(function (node, index) {
15
+ // return the result of the transform function if applicable
16
+ var transformed;
17
+ if (typeof transform === 'function') {
18
+ transformed = transform(node, index);
19
+ if (transformed === null || !!transformed) {
20
+ return transformed;
21
+ }
22
+ }
23
+
24
+ // otherwise convert the node as standard
25
+ return convertNodeToElement(node, index, transform);
26
+ });
27
+ }
@@ -0,0 +1,26 @@
1
+ // this script diffs the react attribute whitelist with the one react html parser maintains
2
+ // to determine if it is out of date
3
+ // the build:lib task must have been run before this can work
4
+
5
+ var currentProperties = require('../lib/dom/attributes/ReactAttributes')["default"];
6
+ var reactProperties = require('react-dom/lib/HTMLDOMPropertyConfig').Properties;
7
+ var changes = {};
8
+ var currentKeys = Object.keys(currentProperties).map(function (key) {
9
+ return currentProperties[key];
10
+ });
11
+ var reactKeys = Object.keys(reactProperties);
12
+
13
+ // attributes that have been added to react
14
+ reactKeys.forEach(function (key) {
15
+ if (currentKeys.indexOf(key) === -1) {
16
+ changes[key] = 'add';
17
+ }
18
+ });
19
+
20
+ // attributes that have been removed from react
21
+ currentKeys.forEach(function (key) {
22
+ if (reactKeys.indexOf(key) === -1) {
23
+ changes[key] = 'remove';
24
+ }
25
+ });
26
+ console.log(changes); // eslint-disable-line no-console
@@ -0,0 +1,24 @@
1
+ import htmlAttributesToReact from './htmlAttributesToReact';
2
+ import inlineStyleToObject from './inlineStyleToObject';
3
+
4
+ /**
5
+ * Generates props for a React element from an object of HTML attributes
6
+ *
7
+ * @param {Object} attributes The HTML attributes
8
+ * @param {String} key The key to give the react element
9
+ */
10
+ export default function generatePropsFromAttributes(attributes, key) {
11
+ // generate props
12
+ var props = Object.assign({}, htmlAttributesToReact(attributes), {
13
+ key: key
14
+ });
15
+
16
+ // if there is an inline/string style prop then convert it to a React style object
17
+ // otherwise, it is invalid and omitted
18
+ if (typeof props.style === 'string' || props.style instanceof String) {
19
+ props.style = inlineStyleToObject(props.style);
20
+ } else {
21
+ delete props.style;
22
+ }
23
+ return props;
24
+ }
@@ -0,0 +1,45 @@
1
+ import BooleanAttributes from '../dom/attributes/BooleanAttributes';
2
+ import ReactAttributes from '../dom/attributes/ReactAttributes';
3
+ import isValidTagOrAttributeName from './isValidTagOrAttributeName';
4
+
5
+ /**
6
+ * Returns the parsed attribute value taking into account things like boolean attributes
7
+ *
8
+ * @param {String} attribute The name of the attribute
9
+ * @param {*} value The value of the attribute from the HTML
10
+ * @returns {*} The parsed attribute value
11
+ */
12
+ var getParsedAttributeValue = function getParsedAttributeValue(attribute, value) {
13
+ // if the attribute if a boolean then it's value should be the same as it's name
14
+ // e.g. disabled="disabled"
15
+ var lowerBooleanAttributes = BooleanAttributes.map(function (attr) {
16
+ return attr.toLowerCase();
17
+ });
18
+ if (lowerBooleanAttributes.indexOf(attribute.toLowerCase()) >= 0) {
19
+ value = attribute;
20
+ }
21
+ return value;
22
+ };
23
+
24
+ /**
25
+ * Takes an object of standard HTML property names and converts them to their React counterpart. If the react
26
+ * version does not exist for an attribute then just use it as it is
27
+ *
28
+ * @param {Object} attributes The HTML attributes to convert
29
+ * @returns {Object} The React attributes
30
+ */
31
+ export default function htmlAttributesToReact(attributes) {
32
+ return Object.keys(attributes).filter(function (attr) {
33
+ return isValidTagOrAttributeName(attr);
34
+ }).reduce(function (mappedAttributes, attribute) {
35
+ // lowercase the attribute name and find it in the react attribute map
36
+ var lowerCaseAttribute = attribute.toLowerCase();
37
+
38
+ // format the attribute name
39
+ var name = ReactAttributes[lowerCaseAttribute] || lowerCaseAttribute;
40
+
41
+ // add the parsed attribute value to the mapped attributes
42
+ mappedAttributes[name] = getParsedAttributeValue(name, attributes[attribute]);
43
+ return mappedAttributes;
44
+ }, {});
45
+ }
@@ -0,0 +1,43 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ /**
3
+ * Converts an inline style string into an object of React style properties
4
+ *
5
+ * @param {String} inlineStyle='' The inline style to convert
6
+ * @returns {Object} The converted style
7
+ */
8
+ export default function InlineStyleToObject() {
9
+ var inlineStyle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
10
+ // just return empty object if the inlineStyle is empty
11
+ if (inlineStyle === '') {
12
+ return {};
13
+ }
14
+ return inlineStyle.split(';').reduce(function (styleObject, stylePropertyValue) {
15
+ // extract the style property name and value
16
+ var _stylePropertyValue$s = stylePropertyValue.split(/^([^:]+):/).filter(function (val, i) {
17
+ return i > 0;
18
+ }).map(function (item) {
19
+ return item.trim().toLowerCase();
20
+ }),
21
+ _stylePropertyValue$s2 = _slicedToArray(_stylePropertyValue$s, 2),
22
+ property = _stylePropertyValue$s2[0],
23
+ value = _stylePropertyValue$s2[1];
24
+
25
+ // if there is no value (i.e. no : in the style) then ignore it
26
+ if (value === undefined) {
27
+ return styleObject;
28
+ }
29
+
30
+ // convert the property name into the correct React format
31
+ // remove all hyphens and convert the letter immediately after each hyphen to upper case
32
+ // additionally don't uppercase any -ms- prefix
33
+ // e.g. -ms-style-property = msStyleProperty
34
+ // -webkit-style-property = WebkitStyleProperty
35
+ property = property.replace(/^-ms-/, 'ms-').replace(/-(.)/g, function (_, character) {
36
+ return character.toUpperCase();
37
+ });
38
+
39
+ // add the new style property and value to the style object
40
+ styleObject[property] = value;
41
+ return styleObject;
42
+ }, {});
43
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Tests a htmlparser2 node and returns whether is it a text node at the start and end of the line containing only
3
+ * white space. This allows these node types to be excluded from the rendering because they are unnecessary.
4
+ *
5
+ * @param {Object} node The element object as created by htmlparser2
6
+ * @returns {boolean} Whether the node is an empty text node
7
+ */
8
+ export default function isEmptyTextNode(node) {
9
+ return node.type === 'text' && /\r?\n/.test(node.data) && node.data.trim() === '';
10
+ }
@@ -0,0 +1,8 @@
1
+ var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/;
2
+ var nameCache = {};
3
+ export default function isValidTagOrAttributeName(tagName) {
4
+ if (!nameCache.hasOwnProperty(tagName)) {
5
+ nameCache[tagName] = VALID_TAG_REGEX.test(tagName);
6
+ }
7
+ return nameCache[tagName];
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helpdice/ui",
3
- "version": "1.8.0",
3
+ "version": "1.8.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "esm/index.d.ts",
6
6
  "unpkg": "dist/index.min.js",
@@ -24,7 +24,8 @@
24
24
  "build:after": "node scripts/move-built-in.js",
25
25
  "build:types": "tsc -p ./scripts & tsc -p ./scripts --outDir ./esm",
26
26
  "build:package": "yarn build:rollup && yarn build:babel && yarn build:types && yarn build:after",
27
- "release": "yarn publish --access public --non-interactive"
27
+ "release": "yarn publish --access public --non-interactive",
28
+ "release:github": "yarn publish --registry=https://npm.pkg.github.com"
28
29
  },
29
30
  "license": "MIT",
30
31
  "description": "Modern React UI library.",
@@ -36,6 +37,9 @@
36
37
  "type": "git",
37
38
  "url": "https://github.com/helpdice/ui"
38
39
  },
40
+ "publishConfig": {
41
+ "registry": "https://registry.npmjs.org/"
42
+ },
39
43
  "prettier": "@helpdice/prettier-config",
40
44
  "keywords": [
41
45
  "flux",
@@ -57,9 +61,7 @@
57
61
  "@babel/preset-env": "^7.14.7",
58
62
  "@babel/preset-react": "^7.14.5",
59
63
  "@babel/preset-typescript": "^7.14.5",
60
- "@helpdice/icons": "^1.1.2",
61
- "@helpdice/pro": "^1.1.6",
62
- "@helpdice/theme": "^1.0.3",
64
+ "@helpdice/icons": "^1.1.3",
63
65
  "@mapbox/rehype-prism": "^0.9.0",
64
66
  "@mdx-js/loader": "^3.1.0",
65
67
  "@mdx-js/react": "^3.1.0",
@@ -74,7 +76,6 @@
74
76
  "@types/react": "~18.3.1",
75
77
  "@types/react-color": "^3.0.13",
76
78
  "@types/react-dom": "~18.3.1",
77
- "@types/react-html-parser": "^2.0.6",
78
79
  "@types/react-syntax-highlighter": "^15.5.13",
79
80
  "@types/react-transition-group": "^4.4.12",
80
81
  "@types/warning": "^3.0.3",
@@ -104,12 +105,13 @@
104
105
  },
105
106
  "dependencies": {
106
107
  "@floating-ui/react-dom": "^2.1.3",
107
- "@helpdice/sdk": "^0.1.3",
108
+ "@helpdice/sdk": "^0.1.4",
108
109
  "@helpdice/utils": "^0.1.3",
109
110
  "@mapbox/rehype-prism": "^0.9.0",
110
111
  "@types/hoist-non-react-statics": "^3.3.6",
111
112
  "@types/styled-components": "^5.1.34",
112
113
  "babel-plugin-transform-rename-import": "^2.3.0",
114
+ "classnames": "^2.5.1",
113
115
  "clsx": "^2.1.1",
114
116
  "css-box-model": "^1.2.1",
115
117
  "date-fns": "^4.1.0",
@@ -123,7 +125,6 @@
123
125
  "next-sitemap": "^4.2.3",
124
126
  "polished": "^4.3.1",
125
127
  "react-fast-compare": "^3.2.2",
126
- "react-html-parser": "^2.0.2",
127
128
  "react-is": "^19.0.0",
128
129
  "react-syntax-highlighter": "^15.6.1",
129
130
  "react-transition-group": "^4.4.5",
@@ -134,7 +135,7 @@
134
135
  "tslib": "^2.8.1"
135
136
  },
136
137
  "peerDependencies": {
137
- "@helpdice/theme": "^1.0.3",
138
+ "@helpdice/theme": "^1.0.5",
138
139
  "react": "^18.3.1 || ^19.1.0",
139
140
  "react-dom": "^18.3.1 || ^19.1.0"
140
141
  },