@helpdice/ui 2.1.9 → 2.2.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,12 +1,17 @@
1
+ import React from "react";
1
2
  declare const wrap: ["nowrap", "wrap", "wrap-reverse"];
2
3
  export type Wrap = typeof wrap[number];
3
4
  type ContainerProps = {
4
5
  gap?: number;
6
+ direction?: string;
5
7
  children?: React.ReactNode;
8
+ justify?: string;
9
+ alignItems?: string;
10
+ alignContent?: string;
6
11
  wrap?: Wrap;
7
12
  className?: string;
8
13
  };
9
- declare const _default: import("react").ForwardRefExoticComponent<ContainerProps & {
14
+ declare const _default: React.ForwardRefExoticComponent<ContainerProps & {
10
15
  width?: string | number;
11
16
  height?: string | number;
12
17
  padding?: string | number;
@@ -38,5 +43,5 @@ declare const _default: import("react").ForwardRefExoticComponent<ContainerProps
38
43
  scale?: number;
39
44
  children?: any;
40
45
  className?: string;
41
- } & import("react").InputHTMLAttributes<any> & import("react").RefAttributes<unknown>>;
46
+ } & React.InputHTMLAttributes<any> & React.RefAttributes<unknown>>;
42
47
  export default _default;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var React$1 = require('react');
5
+ var React = require('react');
6
6
  var theme = require('@helpdice/theme');
7
7
 
8
8
  function _arrayLikeToArray(r, a) {
@@ -106,11 +106,11 @@ var hasRequiredIndex;
106
106
  function requireIndex () {
107
107
  if (hasRequiredIndex) return index;
108
108
  hasRequiredIndex = 1;
109
- var React = React$1;
109
+ var React$1 = React;
110
110
 
111
111
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
112
112
 
113
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
113
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1);
114
114
 
115
115
  /*
116
116
  Based on Glamor's sheet
@@ -546,15 +546,15 @@ function requireIndex () {
546
546
  throw new Error("StyleSheetRegistry: " + message + ".");
547
547
  }
548
548
  }
549
- var StyleSheetContext = /*#__PURE__*/ React.createContext(null);
549
+ var StyleSheetContext = /*#__PURE__*/ React$1.createContext(null);
550
550
  StyleSheetContext.displayName = "StyleSheetContext";
551
551
  function createStyleRegistry() {
552
552
  return new StyleSheetRegistry();
553
553
  }
554
554
  function StyleRegistry(param) {
555
555
  var configuredRegistry = param.registry, children = param.children;
556
- var rootRegistry = React.useContext(StyleSheetContext);
557
- var ref = React.useState(function() {
556
+ var rootRegistry = React$1.useContext(StyleSheetContext);
557
+ var ref = React$1.useState(function() {
558
558
  return rootRegistry || configuredRegistry || createStyleRegistry();
559
559
  }), registry = ref[0];
560
560
  return /*#__PURE__*/ React__default["default"].createElement(StyleSheetContext.Provider, {
@@ -562,16 +562,16 @@ function requireIndex () {
562
562
  }, children);
563
563
  }
564
564
  function useStyleRegistry() {
565
- return React.useContext(StyleSheetContext);
565
+ return React$1.useContext(StyleSheetContext);
566
566
  }
567
567
 
568
568
  // Opt-into the new `useInsertionEffect` API in React 18, fallback to `useLayoutEffect`.
569
569
  // https://github.com/reactwg/react-18/discussions/110
570
- var useInsertionEffect = React__default["default"].useInsertionEffect || React.useLayoutEffect;
570
+ var useInsertionEffect = React__default["default"].useInsertionEffect || React$1.useLayoutEffect;
571
571
  var defaultRegistry = typeof window !== "undefined" ? createStyleRegistry() : undefined;
572
572
  function JSXStyle(props) {
573
573
  var registry = defaultRegistry ? defaultRegistry : useStyleRegistry();
574
- var insertionEffectCalled = React.useRef(false);
574
+ var insertionEffectCalled = React$1.useRef(false);
575
575
  // `registry` might not exist while server-side rendering
576
576
  if (!registry) {
577
577
  return null;
@@ -595,7 +595,7 @@ function requireIndex () {
595
595
  props.id,
596
596
  String(props.dynamic)
597
597
  ]);
598
- React.useLayoutEffect(function() {
598
+ React$1.useLayoutEffect(function() {
599
599
  if (!document.head || insertionEffectCalled.current) {
600
600
  return;
601
601
  }
@@ -670,9 +670,9 @@ var defaultContext = {
670
670
  },
671
671
  unit: '16px'
672
672
  };
673
- var ScaleContext = /*#__PURE__*/React$1.createContext(defaultContext);
673
+ var ScaleContext = /*#__PURE__*/React.createContext(defaultContext);
674
674
  var useScale = function useScale() {
675
- return React$1.useContext(ScaleContext);
675
+ return React.useContext(ScaleContext);
676
676
  };
677
677
 
678
678
  /* "use client" */
@@ -734,7 +734,7 @@ var reduceScaleCoefficient = function reduceScaleCoefficient(scale) {
734
734
  return scale > 1 ? 1 + diff : 1 - diff;
735
735
  };
736
736
  var withScale = function withScale(Render) {
737
- var ScaleFC = /*#__PURE__*/React$1.forwardRef(function (_ref, ref) {
737
+ var ScaleFC = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
738
738
  var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref0, _ref1, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31;
739
739
  var children = _ref.children,
740
740
  props = _objectWithoutProperties(_ref, _excluded$2);
@@ -810,9 +810,9 @@ var withScale = function withScale(Render) {
810
810
  getScaleProps: generateGetScaleProps(props),
811
811
  getAllScaleProps: generateGetAllScaleProps(props)
812
812
  };
813
- return /*#__PURE__*/React$1.createElement(ScaleContext.Provider, {
813
+ return /*#__PURE__*/React.createElement(ScaleContext.Provider, {
814
814
  value: value
815
- }, /*#__PURE__*/React$1.createElement(Render, _extends({}, props, {
815
+ }, /*#__PURE__*/React.createElement(Render, _extends({}, props, {
816
816
  ref: ref
817
817
  }), children));
818
818
  });
@@ -862,7 +862,7 @@ var GridBasicItem = function GridBasicItem(_ref) {
862
862
  var theme$1 = theme.useTheme();
863
863
  var _useScale = useScale(),
864
864
  SCALES = _useScale.SCALES;
865
- var classes = React$1.useMemo(function () {
865
+ var classes = React.useMemo(function () {
866
866
  var aligns = {
867
867
  justify: justify,
868
868
  direction: direction,
@@ -880,7 +880,7 @@ var GridBasicItem = function GridBasicItem(_ref) {
880
880
  }, '');
881
881
  return classString.trim();
882
882
  }, [justify, direction, alignItems, alignContent, xs, sm, md, lg, xl]);
883
- var layout = React$1.useMemo(function () {
883
+ var layout = React.useMemo(function () {
884
884
  return {
885
885
  xs: getItemLayout(xs),
886
886
  sm: getItemLayout(sm),
@@ -889,9 +889,9 @@ var GridBasicItem = function GridBasicItem(_ref) {
889
889
  xl: getItemLayout(xl)
890
890
  };
891
891
  }, [xs, sm, md, lg, xl]);
892
- return /*#__PURE__*/React$1.createElement("div", _extends({}, props, {
892
+ return /*#__PURE__*/React.createElement("div", _extends({}, props, {
893
893
  className: _JSXStyle.dynamic([["568430467", [SCALES.font(1, 'inherit'), SCALES.height(1, 'auto'), justify, direction, alignContent, alignItems, layout.xs.grow, layout.xs.width, layout.xs.basis, layout.xs.display, theme$1.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme$1.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme$1.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme$1.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]]]) + " " + (props && props.className != null && props.className || theme.useClasses('item', classes, className) || "")
894
- }), children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
894
+ }), children, /*#__PURE__*/React.createElement(_JSXStyle, {
895
895
  id: "568430467",
896
896
  dynamic: [SCALES.font(1, 'inherit'), SCALES.height(1, 'auto'), justify, direction, alignContent, alignItems, layout.xs.grow, layout.xs.width, layout.xs.basis, layout.xs.display, theme$1.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme$1.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme$1.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme$1.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]
897
897
  }, ".item.__jsx-style-dynamic-selector{font-size:".concat(SCALES.font(1, 'inherit'), ";height:").concat(SCALES.height(1, 'auto'), ";}.justify.__jsx-style-dynamic-selector{-webkit-box-pack:").concat(justify, ";-webkit-justify-content:").concat(justify, ";-ms-flex-pack:").concat(justify, ";justify-content:").concat(justify, ";}.direction.__jsx-style-dynamic-selector{-webkit-flex-direction:").concat(direction, ";-ms-flex-direction:").concat(direction, ";flex-direction:").concat(direction, ";}.alignContent.__jsx-style-dynamic-selector{-webkit-align-content:").concat(alignContent, ";-ms-flex-line-pack:").concat(alignContent, ";align-content:").concat(alignContent, ";}.alignItems.__jsx-style-dynamic-selector{-webkit-align-items:").concat(alignItems, ";-webkit-box-align:").concat(alignItems, ";-ms-flex-align:").concat(alignItems, ";align-items:").concat(alignItems, ";}.xs.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.xs.grow, ";-webkit-flex-grow:").concat(layout.xs.grow, ";-ms-flex-positive:").concat(layout.xs.grow, ";flex-grow:").concat(layout.xs.grow, ";max-width:").concat(layout.xs.width, ";-webkit-flex-basis:").concat(layout.xs.basis, ";-ms-flex-preferred-size:").concat(layout.xs.basis, ";flex-basis:").concat(layout.xs.basis, ";").concat(layout.xs.display, ";}@media only screen and (min-width:").concat(theme$1.breakpoints.sm.min, "){.sm.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.sm.grow, ";-webkit-flex-grow:").concat(layout.sm.grow, ";-ms-flex-positive:").concat(layout.sm.grow, ";flex-grow:").concat(layout.sm.grow, ";max-width:").concat(layout.sm.width, ";-webkit-flex-basis:").concat(layout.sm.basis, ";-ms-flex-preferred-size:").concat(layout.sm.basis, ";flex-basis:").concat(layout.sm.basis, ";").concat(layout.sm.display, ";}}@media only screen and (min-width:").concat(theme$1.breakpoints.md.min, "){.md.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.md.grow, ";-webkit-flex-grow:").concat(layout.md.grow, ";-ms-flex-positive:").concat(layout.md.grow, ";flex-grow:").concat(layout.md.grow, ";max-width:").concat(layout.md.width, ";-webkit-flex-basis:").concat(layout.md.basis, ";-ms-flex-preferred-size:").concat(layout.md.basis, ";flex-basis:").concat(layout.md.basis, ";").concat(layout.md.display, ";}}@media only screen and (min-width:").concat(theme$1.breakpoints.lg.min, "){.lg.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.lg.grow, ";-webkit-flex-grow:").concat(layout.lg.grow, ";-ms-flex-positive:").concat(layout.lg.grow, ";flex-grow:").concat(layout.lg.grow, ";max-width:").concat(layout.lg.width, ";-webkit-flex-basis:").concat(layout.lg.basis, ";-ms-flex-preferred-size:").concat(layout.lg.basis, ";flex-basis:").concat(layout.lg.basis, ";").concat(layout.lg.display, ";}}@media only screen and (min-width:").concat(theme$1.breakpoints.xl.min, "){.xl.__jsx-style-dynamic-selector{-webkit-box-flex:").concat(layout.xl.grow, ";-webkit-flex-grow:").concat(layout.xl.grow, ";-ms-flex-positive:").concat(layout.xl.grow, ";flex-grow:").concat(layout.xl.grow, ";max-width:").concat(layout.xl.width, ";-webkit-flex-basis:").concat(layout.xl.basis, ";-ms-flex-preferred-size:").concat(layout.xl.basis, ";flex-basis:").concat(layout.xl.basis, ";").concat(layout.xl.display, ";}}")));
@@ -913,27 +913,31 @@ tuple('hover', 'click');
913
913
  tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
914
914
  tuple('start', 'center', 'end', 'left', 'right');
915
915
 
916
- var _excluded = ["gap", "children", "className"];
916
+ var _excluded = ["gap", "children", "direction", "justify", "alignItems", "alignContent", "className"];
917
917
  var wrap = tuple('nowrap', 'wrap', 'wrap-reverse');
918
918
  var Container = function Container(_ref) {
919
919
  var _ref$gap = _ref.gap,
920
920
  gap = _ref$gap === void 0 ? 0 : _ref$gap,
921
921
  children = _ref.children,
922
+ direction = _ref.direction,
923
+ justify = _ref.justify,
924
+ alignItems = _ref.alignItems,
925
+ alignContent = _ref.alignContent,
922
926
  _ref$className = _ref.className,
923
927
  className = _ref$className === void 0 ? '' : _ref$className,
924
928
  props = _objectWithoutProperties(_ref, _excluded);
925
929
  var _useScale = useScale(),
926
930
  unit = _useScale.unit,
927
931
  SCALES = _useScale.SCALES;
928
- var gapUnit = React$1.useMemo(function () {
932
+ var gapUnit = React.useMemo(function () {
929
933
  return "calc(".concat(gap, " * ").concat(unit, " * 1/3)");
930
934
  }, [gap, unit]);
931
935
  var _styles$className = {
932
936
  styles: /*#__PURE__*/React.createElement(_JSXStyle, {
933
- id: "2955470113",
934
- dynamic: [gapUnit, wrap, SCALES.width(1, 'var(--container-width)')]
935
- }, "div.__jsx-style-dynamic-selector{--gap-unit:".concat(gapUnit, ";--container-width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:").concat(wrap, ";-ms-flex-wrap:").concat(wrap, ";flex-wrap:").concat(wrap, ";box-sizing:border-box;gap:var(--gap-unit);width:").concat(SCALES.width(1, 'var(--container-width)'), ";}")),
936
- className: _JSXStyle.dynamic([["2955470113", [gapUnit, wrap, SCALES.width(1, 'var(--container-width)')]]])
937
+ id: "635877754",
938
+ dynamic: [gapUnit, direction, wrap, justify, alignContent, alignItems, SCALES.width(1, 'var(--container-width)')]
939
+ }, "div.__jsx-style-dynamic-selector{--gap-unit:".concat(gapUnit, ";--container-width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:").concat(direction, ";-ms-flex-direction:").concat(direction, ";flex-direction:").concat(direction, ";-webkit-flex-wrap:").concat(wrap, ";-ms-flex-wrap:").concat(wrap, ";flex-wrap:").concat(wrap, ";-webkit-box-pack:").concat(justify, ";-webkit-justify-content:").concat(justify, ";-ms-flex-pack:").concat(justify, ";justify-content:").concat(justify, ";-webkit-align-content:").concat(alignContent, ";-ms-flex-line-pack:").concat(alignContent, ";align-content:").concat(alignContent, ";-webkit-align-items:").concat(alignItems, ";-webkit-box-align:").concat(alignItems, ";-ms-flex-align:").concat(alignItems, ";align-items:").concat(alignItems, ";box-sizing:border-box;gap:var(--gap-unit);width:").concat(SCALES.width(1, 'var(--container-width)'), ";}")),
940
+ className: _JSXStyle.dynamic([["635877754", [gapUnit, direction, wrap, justify, alignContent, alignItems, SCALES.width(1, 'var(--container-width)')]]])
937
941
  },
938
942
  resolveClassName = _styles$className.className,
939
943
  styles = _styles$className.styles;