@helpdice/ui 1.3.2 → 1.3.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.
package/README.md CHANGED
@@ -13,13 +13,13 @@
13
13
  2. import into project:
14
14
 
15
15
  ```jsx
16
- import { ThemeProvider, CssBaseline } from '@helpdice/ui'
16
+ import { UiProvider, CssBaseline } from '@helpdice/ui'
17
17
 
18
18
  const Application = () => (
19
- <ThemeProvider>
19
+ <UiProvider>
20
20
  <CssBaseline /> // ---> Normalize styles
21
21
  <AppComponent /> // ---> Your App Component
22
- </ThemeProvider>
22
+ </UiProvider>
23
23
  )
24
24
  ```
25
25
 
package/dist/index.js CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  var React = require('react');
4
4
  var reactDom = require('react-dom');
5
- var Popover$1 = require('components/popover');
6
5
  var require$$0 = require('react-is');
7
6
  var isEqual = require('react-fast-compare');
8
7
 
@@ -42772,7 +42771,7 @@ function DataTable(_ref) {
42772
42771
  var content = function content() {
42773
42772
  return /*#__PURE__*/React.createElement(React.Fragment, null, cols.map(function (option, index) {
42774
42773
  var colunqid = _.uniqueId("".concat(option.name, "-").concat(index));
42775
- return /*#__PURE__*/React.createElement(Popover$1.Item, {
42774
+ return /*#__PURE__*/React.createElement(Popover.Item, {
42776
42775
  key: colunqid
42777
42776
  // selected={!hideColumn.includes(option.name as never)}
42778
42777
  ,
@@ -42880,7 +42879,7 @@ function DataTable(_ref) {
42880
42879
  px: 0.6,
42881
42880
  py: 0.4,
42882
42881
  type: "dark"
42883
- }, /*#__PURE__*/React.createElement(Popover$1, {
42882
+ }, /*#__PURE__*/React.createElement(Popover, {
42884
42883
  child: content
42885
42884
  }, /*#__PURE__*/React.createElement(Button, {
42886
42885
  onClick: function onClick() {},
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var reactDom = require('react-dom');
7
- var Popover = require('components/popover');
8
7
 
9
8
  function _interopNamespaceDefault(e) {
10
9
  var n = Object.create(null);
@@ -1142,7 +1141,7 @@ var ScalePropKeys = ['width', 'height', 'padding', 'margin', 'w', 'h', 'paddingL
1142
1141
  var defaultDynamicLayoutPipe = function defaultDynamicLayoutPipe(scale1x) {
1143
1142
  return "".concat(scale1x);
1144
1143
  };
1145
- var defaultContext$4 = {
1144
+ var defaultContext$5 = {
1146
1145
  getScaleProps: function getScaleProps() {
1147
1146
  return undefined;
1148
1147
  },
@@ -1168,7 +1167,7 @@ var defaultContext$4 = {
1168
1167
  },
1169
1168
  unit: '16px'
1170
1169
  };
1171
- var ScaleContext = /*#__PURE__*/React.createContext(defaultContext$4);
1170
+ var ScaleContext = /*#__PURE__*/React.createContext(defaultContext$5);
1172
1171
  var useScale = function useScale() {
1173
1172
  return React.useContext(ScaleContext);
1174
1173
  };
@@ -1213,6 +1212,11 @@ var pickChildByProps = function pickChildByProps(children, key, value) {
1213
1212
  var targetChildren = target.length >= 0 ? target : undefined;
1214
1213
  return [withoutPropChildren, targetChildren];
1215
1214
  };
1215
+ var getReactNode = function getReactNode(node) {
1216
+ if (!node) return null;
1217
+ if (typeof node !== 'function') return node;
1218
+ return node();
1219
+ };
1216
1220
  var isBrowser = function isBrowser() {
1217
1221
  return Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
1218
1222
  };
@@ -1266,7 +1270,7 @@ var generateGetAllScaleProps = function generateGetAllScaleProps(props) {
1266
1270
  return getAllScaleProps;
1267
1271
  };
1268
1272
 
1269
- var _excluded$i = ["children"];
1273
+ var _excluded$k = ["children"];
1270
1274
  var reduceScaleCoefficient = function reduceScaleCoefficient(scale) {
1271
1275
  if (scale === 1) return scale;
1272
1276
  var diff = Math.abs((scale - 1) / 2);
@@ -1276,7 +1280,7 @@ var withScale = function withScale(Render) {
1276
1280
  var ScaleFC = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1277
1281
  var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31, _ref32, _ref33;
1278
1282
  var children = _ref.children,
1279
- props = _objectWithoutProperties(_ref, _excluded$i);
1283
+ props = _objectWithoutProperties(_ref, _excluded$k);
1280
1284
  var _useTheme = useTheme(),
1281
1285
  layout = _useTheme.layout;
1282
1286
  var paddingLeft = props.paddingLeft,
@@ -1359,7 +1363,7 @@ var withScale = function withScale(Render) {
1359
1363
  return ScaleFC;
1360
1364
  };
1361
1365
 
1362
- var _excluded$h = ["label", "labelRight", "type", "error", "htmlType", "icon", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled"];
1366
+ var _excluded$j = ["label", "labelRight", "type", "error", "htmlType", "icon", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled"];
1363
1367
  var simulateChangeEvent = function simulateChangeEvent(el, event) {
1364
1368
  return _objectSpread2(_objectSpread2({}, event), {}, {
1365
1369
  target: el,
@@ -1399,7 +1403,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1399
1403
  children = _ref.children,
1400
1404
  _ref$disabled = _ref.disabled,
1401
1405
  disabled = _ref$disabled === undefined ? false : _ref$disabled,
1402
- props = _objectWithoutProperties(_ref, _excluded$h);
1406
+ props = _objectWithoutProperties(_ref, _excluded$j);
1403
1407
  var theme = useTheme();
1404
1408
  var _useScale = useScale(),
1405
1409
  SCALES = _useScale.SCALES;
@@ -1541,7 +1545,7 @@ tuple('hover', 'click');
1541
1545
  tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
1542
1546
  tuple('start', 'center', 'end', 'left', 'right');
1543
1547
 
1544
- var _excluded$g = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "resize"];
1548
+ var _excluded$i = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "resize"];
1545
1549
  tuple('none', 'both', 'horizontal', 'vertical', 'initial', 'inherit');
1546
1550
  var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1547
1551
  var _ref$type = _ref.type,
@@ -1561,7 +1565,7 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1561
1565
  placeholder = _ref.placeholder,
1562
1566
  _ref$resize = _ref.resize,
1563
1567
  resize = _ref$resize === undefined ? 'none' : _ref$resize,
1564
- props = _objectWithoutProperties(_ref, _excluded$g);
1568
+ props = _objectWithoutProperties(_ref, _excluded$i);
1565
1569
  var theme = useTheme();
1566
1570
  var _useScale = useScale(),
1567
1571
  SCALES = _useScale.SCALES;
@@ -1661,11 +1665,11 @@ var PasswordIcon = function PasswordIcon(_ref) {
1661
1665
  };
1662
1666
  var MemoPasswordIcon = /*#__PURE__*/React.memo(PasswordIcon);
1663
1667
 
1664
- var _excluded$f = ["hideToggle", "children"];
1668
+ var _excluded$h = ["hideToggle", "children"];
1665
1669
  var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1666
1670
  var hideToggle = _ref.hideToggle,
1667
1671
  children = _ref.children,
1668
- props = _objectWithoutProperties(_ref, _excluded$f);
1672
+ props = _objectWithoutProperties(_ref, _excluded$h);
1669
1673
  var _useScale = useScale(),
1670
1674
  getAllScaleProps = _useScale.getAllScaleProps;
1671
1675
  var inputRef = React.useRef(null);
@@ -18962,11 +18966,11 @@ var SelectIcon = /*#__PURE__*/React.memo(SelectIconComponent);
18962
18966
 
18963
18967
  /* "use client" */
18964
18968
 
18965
- var defaultContext$3 = {
18969
+ var defaultContext$4 = {
18966
18970
  visible: false,
18967
18971
  disableAll: false
18968
18972
  };
18969
- var SelectContext = /*#__PURE__*/React.createContext(defaultContext$3);
18973
+ var SelectContext = /*#__PURE__*/React.createContext(defaultContext$4);
18970
18974
  var useSelectContext = function useSelectContext() {
18971
18975
  return React.useContext(SelectContext);
18972
18976
  };
@@ -19031,7 +19035,7 @@ var useResize = function useResize(callback) {
19031
19035
  }, []);
19032
19036
  };
19033
19037
 
19034
- var _excluded$e = ["children", "className", "visible", "enterTime", "leaveTime", "clearTime", "name"];
19038
+ var _excluded$g = ["children", "className", "visible", "enterTime", "leaveTime", "clearTime", "name"];
19035
19039
  var CssTransition = function CssTransition(_ref) {
19036
19040
  var children = _ref.children,
19037
19041
  _ref$className = _ref.className,
@@ -19046,7 +19050,7 @@ var CssTransition = function CssTransition(_ref) {
19046
19050
  clearTime = _ref$clearTime === undefined ? 60 : _ref$clearTime,
19047
19051
  _ref$name = _ref.name,
19048
19052
  name = _ref$name === undefined ? 'transition' : _ref$name,
19049
- props = _objectWithoutProperties(_ref, _excluded$e);
19053
+ props = _objectWithoutProperties(_ref, _excluded$g);
19050
19054
  var _useState = React.useState(''),
19051
19055
  _useState2 = _slicedToArray(_useState, 2),
19052
19056
  classes = _useState2[0],
@@ -19302,7 +19306,7 @@ var SelectDropdown = /*#__PURE__*/React.forwardRef(function (_ref, dropdownRef)
19302
19306
  });
19303
19307
  SelectDropdown.displayName = 'SelectDropdown';
19304
19308
 
19305
- var _excluded$d = ["xs", "sm", "md", "lg", "xl", "justify", "direction", "alignItems", "alignContent", "children", "className"];
19309
+ var _excluded$f = ["xs", "sm", "md", "lg", "xl", "justify", "direction", "alignItems", "alignContent", "children", "className"];
19306
19310
  var getItemLayout = function getItemLayout(val) {
19307
19311
  var display = val === 0 ? 'display: none;' : 'display: inherit;';
19308
19312
  if (typeof val === 'number') {
@@ -19340,7 +19344,7 @@ var GridBasicItem = function GridBasicItem(_ref) {
19340
19344
  children = _ref.children,
19341
19345
  _ref$className = _ref.className,
19342
19346
  className = _ref$className === undefined ? '' : _ref$className,
19343
- props = _objectWithoutProperties(_ref, _excluded$d);
19347
+ props = _objectWithoutProperties(_ref, _excluded$f);
19344
19348
  var theme = useTheme();
19345
19349
  var _useScale = useScale(),
19346
19350
  SCALES = _useScale.SCALES;
@@ -19380,12 +19384,12 @@ var GridBasicItem = function GridBasicItem(_ref) {
19380
19384
  };
19381
19385
  GridBasicItem.displayName = 'GridBasicItem';
19382
19386
 
19383
- var _excluded$c = ["children", "className"];
19387
+ var _excluded$e = ["children", "className"];
19384
19388
  var GridComponent = function GridComponent(_ref) {
19385
19389
  var children = _ref.children,
19386
19390
  _ref$className = _ref.className,
19387
19391
  className = _ref$className === undefined ? '' : _ref$className,
19388
- props = _objectWithoutProperties(_ref, _excluded$c);
19392
+ props = _objectWithoutProperties(_ref, _excluded$e);
19389
19393
  var _useScale = useScale(),
19390
19394
  SCALES = _useScale.SCALES;
19391
19395
  var _styles$className = {
@@ -19405,7 +19409,7 @@ var GridComponent = function GridComponent(_ref) {
19405
19409
  GridComponent.displayName = 'Grid';
19406
19410
  var Grid = withScale(GridComponent);
19407
19411
 
19408
- var _excluded$b = ["gap", "wrap", "children", "className"];
19412
+ var _excluded$d = ["gap", "wrap", "children", "className"];
19409
19413
  var GridContainerComponent = function GridContainerComponent(_ref) {
19410
19414
  var _ref$gap = _ref.gap,
19411
19415
  gap = _ref$gap === undefined ? 0 : _ref$gap,
@@ -19414,7 +19418,7 @@ var GridContainerComponent = function GridContainerComponent(_ref) {
19414
19418
  children = _ref.children,
19415
19419
  _ref$className = _ref.className,
19416
19420
  className = _ref$className === undefined ? '' : _ref$className,
19417
- props = _objectWithoutProperties(_ref, _excluded$b);
19421
+ props = _objectWithoutProperties(_ref, _excluded$d);
19418
19422
  var _useScale = useScale(),
19419
19423
  unit = _useScale.unit,
19420
19424
  SCALES = _useScale.SCALES;
@@ -19570,7 +19574,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function (_ref, inputRef) {
19570
19574
  });
19571
19575
  SelectInput.displayName = 'GeistSelectInput';
19572
19576
 
19573
- var _excluded$a = ["children", "label", "type", "disabled", "initialValue", "value", "icon", "onChange", "pure", "multiple", "clearable", "placeholder", "className", "dropdownClassName", "dropdownStyle", "disableMatchWidth", "getPopupContainer", "onDropdownVisibleChange"];
19577
+ var _excluded$c = ["children", "label", "type", "disabled", "initialValue", "value", "icon", "onChange", "pure", "multiple", "clearable", "placeholder", "className", "dropdownClassName", "dropdownStyle", "disableMatchWidth", "getPopupContainer", "onDropdownVisibleChange"];
19574
19578
  var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
19575
19579
  var children = _ref.children,
19576
19580
  label = _ref.label,
@@ -19599,7 +19603,7 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
19599
19603
  getPopupContainer = _ref.getPopupContainer,
19600
19604
  _ref$onDropdownVisibl = _ref.onDropdownVisibleChange,
19601
19605
  onDropdownVisibleChange = _ref$onDropdownVisibl === undefined ? function () {} : _ref$onDropdownVisibl,
19602
- props = _objectWithoutProperties(_ref, _excluded$a);
19606
+ props = _objectWithoutProperties(_ref, _excluded$c);
19603
19607
  var theme = useTheme();
19604
19608
  var _useScale = useScale(),
19605
19609
  SCALES = _useScale.SCALES;
@@ -19771,7 +19775,7 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
19771
19775
  SelectComponent.displayName = 'Select';
19772
19776
  var Select = withScale(SelectComponent);
19773
19777
 
19774
- var _excluded$9 = ["value", "className", "children", "disabled", "divider", "label", "preventAllEvents"];
19778
+ var _excluded$b = ["value", "className", "children", "disabled", "divider", "label", "preventAllEvents"];
19775
19779
  var SelectOptionComponent = function SelectOptionComponent(_ref) {
19776
19780
  var identValue = _ref.value,
19777
19781
  _ref$className = _ref.className,
@@ -19785,7 +19789,7 @@ var SelectOptionComponent = function SelectOptionComponent(_ref) {
19785
19789
  label = _ref$label === undefined ? false : _ref$label,
19786
19790
  _ref$preventAllEvents = _ref.preventAllEvents,
19787
19791
  preventAllEvents = _ref$preventAllEvents === undefined ? false : _ref$preventAllEvents,
19788
- props = _objectWithoutProperties(_ref, _excluded$9);
19792
+ props = _objectWithoutProperties(_ref, _excluded$b);
19789
19793
  var theme = useTheme();
19790
19794
  var _useScale = useScale(),
19791
19795
  SCALES = _useScale.SCALES;
@@ -20034,11 +20038,11 @@ var TableCell = function TableCell(_ref) {
20034
20038
 
20035
20039
  /* "use client" */
20036
20040
 
20037
- var defaultContext$2 = {
20041
+ var defaultContext$3 = {
20038
20042
  columns: [],
20039
20043
  updateColumn: function updateColumn() {}
20040
20044
  };
20041
- var TableContext = /*#__PURE__*/React.createContext(defaultContext$2);
20045
+ var TableContext = /*#__PURE__*/React.createContext(defaultContext$3);
20042
20046
  var useTableContext = function useTableContext() {
20043
20047
  return React.useContext(TableContext);
20044
20048
  };
@@ -30187,13 +30191,13 @@ var addColorAlpha = function addColorAlpha(color, alpha) {
30187
30191
  return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(safeAlpha, ")");
30188
30192
  };
30189
30193
 
30190
- var _excluded$8 = ["active", "children", "disabled", "onClick"];
30194
+ var _excluded$a = ["active", "children", "disabled", "onClick"];
30191
30195
  var PaginationItem = function PaginationItem(_ref) {
30192
30196
  var active = _ref.active,
30193
30197
  children = _ref.children,
30194
30198
  disabled = _ref.disabled,
30195
30199
  onClick = _ref.onClick,
30196
- props = _objectWithoutProperties(_ref, _excluded$8);
30200
+ props = _objectWithoutProperties(_ref, _excluded$a);
30197
30201
  var theme = useTheme();
30198
30202
  var _useMemo = React.useMemo(function () {
30199
30203
  return [addColorAlpha(theme.palette.success, 0.1), addColorAlpha(theme.palette.success, 0.8)];
@@ -30225,16 +30229,16 @@ PaginationItem.displayName = 'GeistPaginationItem';
30225
30229
  /* "use client" */
30226
30230
 
30227
30231
  tuple('prev', 'next', 'click');
30228
- var defaultContext$1 = {};
30229
- var PaginationContext = /*#__PURE__*/React.createContext(defaultContext$1);
30232
+ var defaultContext$2 = {};
30233
+ var PaginationContext = /*#__PURE__*/React.createContext(defaultContext$2);
30230
30234
  var usePaginationContext = function usePaginationContext() {
30231
30235
  return React.useContext(PaginationContext);
30232
30236
  };
30233
30237
 
30234
- var _excluded$7 = ["children"];
30238
+ var _excluded$9 = ["children"];
30235
30239
  var PaginationPrevious = function PaginationPrevious(_ref) {
30236
30240
  var children = _ref.children,
30237
- props = _objectWithoutProperties(_ref, _excluded$7);
30241
+ props = _objectWithoutProperties(_ref, _excluded$9);
30238
30242
  var _usePaginationContext = usePaginationContext(),
30239
30243
  update = _usePaginationContext.update,
30240
30244
  isFirst = _usePaginationContext.isFirst;
@@ -30247,10 +30251,10 @@ var PaginationPrevious = function PaginationPrevious(_ref) {
30247
30251
  };
30248
30252
  PaginationPrevious.displayName = 'GeistPaginationPrevious';
30249
30253
 
30250
- var _excluded$6 = ["children"];
30254
+ var _excluded$8 = ["children"];
30251
30255
  var PaginationNext = function PaginationNext(_ref) {
30252
30256
  var children = _ref.children,
30253
- props = _objectWithoutProperties(_ref, _excluded$6);
30257
+ props = _objectWithoutProperties(_ref, _excluded$8);
30254
30258
  var _usePaginationContext = usePaginationContext(),
30255
30259
  update = _usePaginationContext.update,
30256
30260
  isLast = _usePaginationContext.isLast;
@@ -30409,7 +30413,7 @@ var PaginationPages = function PaginationPages(_ref) {
30409
30413
  };
30410
30414
  PaginationPages.displayName = 'GeistPaginationPages';
30411
30415
 
30412
- var _excluded$5 = ["page", "initialPage", "count", "limit", "children", "onChange", "className"];
30416
+ var _excluded$7 = ["page", "initialPage", "count", "limit", "children", "onChange", "className"];
30413
30417
  var PaginationComponent = function PaginationComponent(_ref) {
30414
30418
  var customPage = _ref.page,
30415
30419
  _ref$initialPage = _ref.initialPage,
@@ -30422,7 +30426,7 @@ var PaginationComponent = function PaginationComponent(_ref) {
30422
30426
  onChange = _ref.onChange,
30423
30427
  _ref$className = _ref.className,
30424
30428
  className = _ref$className === undefined ? '' : _ref$className,
30425
- props = _objectWithoutProperties(_ref, _excluded$5);
30429
+ props = _objectWithoutProperties(_ref, _excluded$7);
30426
30430
  var _useScale = useScale(),
30427
30431
  SCALES = _useScale.SCALES;
30428
30432
  var _useCurrentState = useCurrentState(initialPage),
@@ -30494,7 +30498,7 @@ var Pagination = withScale(PaginationComponent);
30494
30498
  Pagination.Previous = PaginationPrevious;
30495
30499
  Pagination.Next = PaginationNext;
30496
30500
 
30497
- var _excluded$4 = ["children", "data", "initialData", "hover", "emptyText", "rowDraggable", "readOnly", "onRow", "onCell", "onChange", "onFilters", "onPageChange", "showFilters", "stickyHeader", "onSelected", "dataLength", "viewLength", "className", "rowClassName"];
30501
+ var _excluded$6 = ["children", "data", "initialData", "hover", "emptyText", "rowDraggable", "readOnly", "onRow", "onCell", "onChange", "onFilters", "onPageChange", "showFilters", "stickyHeader", "onSelected", "dataLength", "viewLength", "className", "rowClassName"];
30498
30502
  function TableComponent(tableProps) {
30499
30503
  /* eslint-disable @typescript-eslint/no-unused-vars */
30500
30504
  var _ref = tableProps,
@@ -30528,7 +30532,7 @@ function TableComponent(tableProps) {
30528
30532
  rowClassName = _ref$rowClassName === undefined ? function () {
30529
30533
  return '';
30530
30534
  } : _ref$rowClassName,
30531
- props = _objectWithoutProperties(_ref, _excluded$4);
30535
+ props = _objectWithoutProperties(_ref, _excluded$6);
30532
30536
  /* eslint-enable @typescript-eslint/no-unused-vars */
30533
30537
  var _useScale = useScale(),
30534
30538
  SCALES = _useScale.SCALES;
@@ -30678,7 +30682,7 @@ var ButtonDrip = function ButtonDrip(_ref) {
30678
30682
  };
30679
30683
  ButtonDrip.displayName = 'ButtonDrip';
30680
30684
 
30681
- var _excluded$3 = ["children", "type", "color", "className", "spaceRatio"];
30685
+ var _excluded$5 = ["children", "type", "color", "className", "spaceRatio"];
30682
30686
  var getIconBgColor = function getIconBgColor(type, palette, color) {
30683
30687
  var colors = {
30684
30688
  "default": palette.accents_6,
@@ -30698,7 +30702,7 @@ var LoadingComponent = function LoadingComponent(_ref) {
30698
30702
  className = _ref$className === undefined ? '' : _ref$className,
30699
30703
  _ref$spaceRatio = _ref.spaceRatio,
30700
30704
  spaceRatio = _ref$spaceRatio === undefined ? 1 : _ref$spaceRatio,
30701
- props = _objectWithoutProperties(_ref, _excluded$3);
30705
+ props = _objectWithoutProperties(_ref, _excluded$5);
30702
30706
  var theme = useTheme();
30703
30707
  var _useScale = useScale(),
30704
30708
  SCALES = _useScale.SCALES;
@@ -30738,7 +30742,7 @@ var ButtonLoading = function ButtonLoading(_ref) {
30738
30742
  };
30739
30743
  ButtonLoading.displayName = 'GeistButtonLoading';
30740
30744
 
30741
- var _excluded$2 = ["isRight", "isSingle", "children", "className"];
30745
+ var _excluded$4 = ["isRight", "isSingle", "children", "className"];
30742
30746
  var ButtonIcon = function ButtonIcon(_ref) {
30743
30747
  var _ref$isRight = _ref.isRight,
30744
30748
  isRight = _ref$isRight === undefined ? false : _ref$isRight,
@@ -30746,7 +30750,7 @@ var ButtonIcon = function ButtonIcon(_ref) {
30746
30750
  children = _ref.children,
30747
30751
  _ref$className = _ref.className,
30748
30752
  className = _ref$className === undefined ? '' : _ref$className,
30749
- props = _objectWithoutProperties(_ref, _excluded$2);
30753
+ props = _objectWithoutProperties(_ref, _excluded$4);
30750
30754
  var classes = useClasses('icon', {
30751
30755
  right: isRight,
30752
30756
  single: isSingle
@@ -30797,11 +30801,11 @@ var filterPropsWithGroup = function filterPropsWithGroup(props, config) {
30797
30801
 
30798
30802
  /* "use client" */
30799
30803
 
30800
- var defaultContext = {
30804
+ var defaultContext$1 = {
30801
30805
  isButtonGroup: false,
30802
30806
  disabled: false
30803
30807
  };
30804
- var ButtonGroupContext = /*#__PURE__*/React.createContext(defaultContext);
30808
+ var ButtonGroupContext = /*#__PURE__*/React.createContext(defaultContext$1);
30805
30809
  var useButtonGroupContext = function useButtonGroupContext() {
30806
30810
  return React.useContext(ButtonGroupContext);
30807
30811
  };
@@ -30993,7 +30997,7 @@ var getButtonDripColor = function getButtonDripColor(palette, props) {
30993
30997
  return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
30994
30998
  };
30995
30999
 
30996
- var _excluded$1 = ["children", "disabled", "type", "loading", "shadow", "ghost", "effect", "onClick", "auto", "icon", "htmlType", "iconRight", "className", "crossOrigin"];
31000
+ var _excluded$3 = ["children", "disabled", "type", "loading", "shadow", "ghost", "effect", "onClick", "auto", "icon", "htmlType", "iconRight", "className", "crossOrigin"];
30997
31001
  var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
30998
31002
  var theme = useTheme();
30999
31003
  var _useScale = useScale(),
@@ -31039,7 +31043,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
31039
31043
  _filteredProps$classN = filteredProps.className,
31040
31044
  className = _filteredProps$classN === undefined ? '' : _filteredProps$classN;
31041
31045
  filteredProps.crossOrigin;
31042
- var props = _objectWithoutProperties(filteredProps, _excluded$1);
31046
+ var props = _objectWithoutProperties(filteredProps, _excluded$3);
31043
31047
  /* eslint-enable @typescript-eslint/no-unused-vars */
31044
31048
 
31045
31049
  var _useMemo = React.useMemo(function () {
@@ -31409,7 +31413,7 @@ var useClickAway = function useClickAway(ref, handler) {
31409
31413
  }, [ref]);
31410
31414
  };
31411
31415
 
31412
- var _excluded = ["children", "initialVisible", "text", "offset", "placement", "portalClassName", "enterDelay", "leaveDelay", "trigger", "type", "className", "onVisibleChange", "hideArrow", "visible"];
31416
+ var _excluded$2 = ["children", "initialVisible", "text", "offset", "placement", "portalClassName", "enterDelay", "leaveDelay", "trigger", "type", "className", "onVisibleChange", "hideArrow", "visible"];
31413
31417
  var TooltipComponent = function TooltipComponent(_ref) {
31414
31418
  var children = _ref.children,
31415
31419
  _ref$initialVisible = _ref.initialVisible,
@@ -31436,7 +31440,7 @@ var TooltipComponent = function TooltipComponent(_ref) {
31436
31440
  _ref$hideArrow = _ref.hideArrow,
31437
31441
  hideArrow = _ref$hideArrow === undefined ? false : _ref$hideArrow,
31438
31442
  customVisible = _ref.visible,
31439
- props = _objectWithoutProperties(_ref, _excluded);
31443
+ props = _objectWithoutProperties(_ref, _excluded$2);
31440
31444
  var timer = React.useRef();
31441
31445
  var ref = React.useRef(null);
31442
31446
  var _useState = React.useState(initialVisible),
@@ -31517,6 +31521,142 @@ var TooltipComponent = function TooltipComponent(_ref) {
31517
31521
  TooltipComponent.displayName = 'Tooltip';
31518
31522
  var Tooltip = withScale(TooltipComponent);
31519
31523
 
31524
+ /* "use client" */
31525
+
31526
+ var defaultContext = {
31527
+ disableItemsAutoClose: false,
31528
+ onItemClick: function onItemClick() {}
31529
+ };
31530
+ var PopoverContext = /*#__PURE__*/React.createContext(defaultContext);
31531
+ var usePopoverContext = function usePopoverContext() {
31532
+ return React.useContext(PopoverContext);
31533
+ };
31534
+
31535
+ var _excluded$1 = ["child", "children", "enterDelay", "leaveDelay", "offset", "type", "trigger", "placement", "initialVisible", "portalClassName", "disableItemsAutoClose", "onVisibleChange", "visible"];
31536
+ var PopoverComponent = function PopoverComponent(_ref) {
31537
+ var child = _ref.child,
31538
+ children = _ref.children,
31539
+ _ref$enterDelay = _ref.enterDelay,
31540
+ enterDelay = _ref$enterDelay === undefined ? 100 : _ref$enterDelay,
31541
+ _ref$leaveDelay = _ref.leaveDelay,
31542
+ leaveDelay = _ref$leaveDelay === undefined ? 150 : _ref$leaveDelay,
31543
+ _ref$offset = _ref.offset,
31544
+ offset = _ref$offset === undefined ? 12 : _ref$offset,
31545
+ _ref$type = _ref.type,
31546
+ type = _ref$type === undefined ? 'default' : _ref$type,
31547
+ _ref$trigger = _ref.trigger,
31548
+ trigger = _ref$trigger === undefined ? 'click' : _ref$trigger,
31549
+ _ref$placement = _ref.placement,
31550
+ placement = _ref$placement === undefined ? 'bottom' : _ref$placement,
31551
+ _ref$initialVisible = _ref.initialVisible,
31552
+ initialVisible = _ref$initialVisible === undefined ? false : _ref$initialVisible,
31553
+ _ref$portalClassName = _ref.portalClassName,
31554
+ portalClassName = _ref$portalClassName === undefined ? '' : _ref$portalClassName,
31555
+ _ref$disableItemsAuto = _ref.disableItemsAutoClose,
31556
+ disableItemsAutoClose = _ref$disableItemsAuto === undefined ? false : _ref$disableItemsAuto,
31557
+ _ref$onVisibleChange = _ref.onVisibleChange,
31558
+ onVisibleChange = _ref$onVisibleChange === undefined ? function () {} : _ref$onVisibleChange,
31559
+ customVisible = _ref.visible,
31560
+ props = _objectWithoutProperties(_ref, _excluded$1);
31561
+ var _useScale = useScale(),
31562
+ SCALES = _useScale.SCALES;
31563
+ var _useState = React.useState(initialVisible),
31564
+ _useState2 = _slicedToArray(_useState, 2),
31565
+ visible = _useState2[0],
31566
+ setVisible = _useState2[1];
31567
+ var textNode = React.useMemo(function () {
31568
+ return getReactNode(child);
31569
+ }, [child]);
31570
+ var onChildClick = function onChildClick() {
31571
+ onPopoverVisibleChange(false);
31572
+ };
31573
+ var value = React.useMemo(function () {
31574
+ return {
31575
+ onItemClick: onChildClick,
31576
+ disableItemsAutoClose: disableItemsAutoClose
31577
+ };
31578
+ }, [disableItemsAutoClose]);
31579
+ var classes = useClasses('popover', portalClassName);
31580
+ var onPopoverVisibleChange = function onPopoverVisibleChange(next) {
31581
+ setVisible(next);
31582
+ onVisibleChange(next);
31583
+ };
31584
+ React.useEffect(function () {
31585
+ if (customVisible === undefined) return;
31586
+ onPopoverVisibleChange(customVisible);
31587
+ }, [customVisible]);
31588
+ return /*#__PURE__*/React.createElement(PopoverContext.Provider, {
31589
+ value: value
31590
+ }, /*#__PURE__*/React.createElement(Tooltip, _extends({
31591
+ type: type,
31592
+ enterDelay: enterDelay,
31593
+ leaveDelay: leaveDelay,
31594
+ offset: offset,
31595
+ text: textNode,
31596
+ trigger: trigger,
31597
+ placement: placement,
31598
+ portalClassName: classes,
31599
+ visible: visible,
31600
+ onVisibleChange: onPopoverVisibleChange
31601
+ }, props), children, /*#__PURE__*/React.createElement(_JSXStyle, {
31602
+ id: "622655983",
31603
+ dynamic: [SCALES.pt(0.9), SCALES.pr(0), SCALES.pb(0.9), SCALES.pl(0)]
31604
+ }, ".tooltip-content.popover > .inner{padding:".concat(SCALES.pt(0.9), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0.9), " ").concat(SCALES.pl(0), ";}"))));
31605
+ };
31606
+ PopoverComponent.displayName = 'Popover';
31607
+ var Popover = withScale(PopoverComponent);
31608
+
31609
+ var _excluded = ["children", "line", "showTitle", "className", "onClick", "disableAutoClose"];
31610
+ var PopoverItemComponent = function PopoverItemComponent(_ref) {
31611
+ var children = _ref.children,
31612
+ _ref$line = _ref.line,
31613
+ line = _ref$line === undefined ? false : _ref$line,
31614
+ _ref$showTitle = _ref.showTitle,
31615
+ showTitle = _ref$showTitle === undefined ? false : _ref$showTitle,
31616
+ _ref$className = _ref.className,
31617
+ className = _ref$className === undefined ? '' : _ref$className,
31618
+ onClick = _ref.onClick,
31619
+ _ref$disableAutoClose = _ref.disableAutoClose,
31620
+ disableAutoClose = _ref$disableAutoClose === undefined ? false : _ref$disableAutoClose,
31621
+ props = _objectWithoutProperties(_ref, _excluded);
31622
+ var theme = useTheme();
31623
+ var _useScale = useScale(),
31624
+ SCALES = _useScale.SCALES;
31625
+ var _usePopoverContext = usePopoverContext(),
31626
+ disableItemsAutoClose = _usePopoverContext.disableItemsAutoClose,
31627
+ onItemClick = _usePopoverContext.onItemClick;
31628
+ var hasHandler = Boolean(onClick);
31629
+ var dontCloseByClick = disableAutoClose || disableItemsAutoClose || showTitle || line;
31630
+ var classes = useClasses('item', {
31631
+ line: line,
31632
+ showTitle: showTitle
31633
+ }, className);
31634
+ var clickHandler = function clickHandler(event) {
31635
+ onClick && onClick(event);
31636
+ if (dontCloseByClick) {
31637
+ return event.stopPropagation();
31638
+ }
31639
+ onItemClick(event);
31640
+ };
31641
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
31642
+ onClick: clickHandler
31643
+ }, props, {
31644
+ className: _JSXStyle.dynamic([["190621384", [theme.palette.accents_5, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.5), SCALES.pr(0.75), SCALES.pb(0.5), SCALES.pl(0.75), hasHandler ? 'pointer' : 'default', theme.palette.foreground, theme.palette.border, SCALES.height(0.0625), SCALES.mt(0.35), SCALES.mr(0), SCALES.mb(0.35), SCALES.ml(0), SCALES.width(1, '100%'), SCALES.font(0.925), theme.palette.foreground]]]) + " " + (props && props.className != null && props.className || classes || "")
31645
+ }), children, /*#__PURE__*/React.createElement(_JSXStyle, {
31646
+ id: "190621384",
31647
+ dynamic: [theme.palette.accents_5, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.5), SCALES.pr(0.75), SCALES.pb(0.5), SCALES.pl(0.75), hasHandler ? 'pointer' : 'default', theme.palette.foreground, theme.palette.border, SCALES.height(0.0625), SCALES.mt(0.35), SCALES.mr(0), SCALES.mb(0.35), SCALES.ml(0), SCALES.width(1, '100%'), SCALES.font(0.925), theme.palette.foreground]
31648
+ }, ".item.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;box-sizing:border-box;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:".concat(theme.palette.accents_5, ";-webkit-transition:color,background-color 150ms linear;transition:color,background-color 150ms linear;line-height:1.25em;font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, 'auto'), ";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.5), " ").concat(SCALES.pr(0.75), " ").concat(SCALES.pb(0.5), " ").concat(SCALES.pl(0.75), ";cursor:").concat(hasHandler ? 'pointer' : 'default', ";}.item.__jsx-style-dynamic-selector:hover{color:").concat(theme.palette.foreground, ";}.item.line.__jsx-style-dynamic-selector{line-height:0;padding:0;background-color:").concat(theme.palette.border, ";height:").concat(SCALES.height(0.0625), ";margin:").concat(SCALES.mt(0.35), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0.35), " ").concat(SCALES.ml(0), ";width:").concat(SCALES.width(1, '100%'), ";}.item.title.__jsx-style-dynamic-selector{font-weight:500;font-size:").concat(SCALES.font(0.925), ";color:").concat(theme.palette.foreground, ";}"))), showTitle && /*#__PURE__*/React.createElement(PopoverItem, {
31649
+ line: true,
31650
+ showTitle: false
31651
+ }));
31652
+ };
31653
+ PopoverItemComponent.displayName = 'PopoverItem';
31654
+ var PopoverItem = withScale(PopoverItemComponent);
31655
+
31656
+ /* "use client" */
31657
+ Popover.Item = PopoverItem;
31658
+ Popover.Option = PopoverItem;
31659
+
31520
31660
  function DataTable(_ref) {
31521
31661
  var _ref$cols = _ref.cols,
31522
31662
  cols = _ref$cols === undefined ? [] : _ref$cols,
@@ -11,7 +11,7 @@ import Grid from '../grid';
11
11
  import Button from '../button';
12
12
  import Tooltip from '../tooltip';
13
13
  import Table from './table';
14
- import Popover from 'components/popover';
14
+ import Popover from '../popover';
15
15
  function DataTable(_ref) {
16
16
  var _ref$cols = _ref.cols,
17
17
  cols = _ref$cols === void 0 ? [] : _ref$cols,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helpdice/ui",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "esm/index.d.ts",
6
6
  "unpkg": "dist/index.min.js",