@helpdice/ui 1.6.9 → 1.7.0

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.
Files changed (117) hide show
  1. package/dist/Placeholder/index.js +37 -16
  2. package/dist/auto-complete/index.js +37 -15
  3. package/dist/avatar/avatar.d.ts +2 -1
  4. package/dist/avatar/index.js +33 -13
  5. package/dist/badge/index.js +30 -11
  6. package/dist/breadcrumbs/index.js +30 -11
  7. package/dist/button/index.js +32 -12
  8. package/dist/button-dropdown/index.js +30 -11
  9. package/dist/button-group/index.js +30 -11
  10. package/dist/capacity/index.js +30 -11
  11. package/dist/card/index.js +30 -11
  12. package/dist/checkbox/index.js +30 -11
  13. package/dist/code/index.js +30 -11
  14. package/dist/col/index.js +21 -2
  15. package/dist/collapse/index.js +30 -11
  16. package/dist/css-baseline/index.js +24 -5
  17. package/dist/description/index.js +30 -11
  18. package/dist/display/index.js +30 -11
  19. package/dist/divider/index.js +30 -11
  20. package/dist/dot/index.js +30 -11
  21. package/dist/drawer/index.js +30 -11
  22. package/dist/fieldset/index.js +30 -11
  23. package/dist/grid/grid-container.d.ts +3 -3
  24. package/dist/grid/grid.d.ts +3 -3
  25. package/dist/grid/index.js +30 -11
  26. package/dist/image/index.js +30 -11
  27. package/dist/index.d.ts +3 -3
  28. package/dist/index.js +10950 -1486
  29. package/dist/input/index.js +34 -13
  30. package/dist/keyboard/index.js +30 -11
  31. package/dist/link/index.js +30 -11
  32. package/dist/list/index.d.ts +9 -0
  33. package/dist/list/index.js +1287 -0
  34. package/dist/list/list-item.d.ts +53 -0
  35. package/dist/list/list.d.ts +44 -0
  36. package/dist/loading/index.js +30 -11
  37. package/dist/menu/index.d.ts +2 -0
  38. package/dist/menu/index.js +10354 -0
  39. package/dist/menu/menu.d.ts +9 -0
  40. package/dist/modal/index.js +34 -13
  41. package/dist/note/index.js +30 -11
  42. package/dist/page/index.js +30 -11
  43. package/dist/pagination/index.js +30 -11
  44. package/dist/popover/index.js +30 -11
  45. package/dist/progress/index.js +30 -11
  46. package/dist/radio/index.js +30 -11
  47. package/dist/rating/index.js +30 -11
  48. package/dist/row/index.js +21 -2
  49. package/dist/search-bar/index.js +31 -12
  50. package/dist/select/index.js +30 -11
  51. package/dist/slider/index.js +30 -11
  52. package/dist/snippet/index.js +30 -11
  53. package/dist/spacer/index.js +30 -11
  54. package/dist/spinner/index.js +30 -11
  55. package/dist/table/index.d.ts +0 -1
  56. package/dist/table/index.js +1663 -2242
  57. package/dist/tabs/index.js +30 -11
  58. package/dist/tag/index.js +30 -11
  59. package/dist/text/index.js +37 -16
  60. package/dist/text/text.d.ts +1 -0
  61. package/dist/textarea/index.js +30 -11
  62. package/dist/toggle/index.js +30 -11
  63. package/dist/tooltip/index.js +30 -11
  64. package/dist/tree/index.js +21 -2
  65. package/dist/ui-provider/index.js +32 -12
  66. package/dist/use-scale/index.js +9 -9
  67. package/dist/user/index.js +33 -13
  68. package/esm/auto-complete/auto-complete.js +3 -2
  69. package/esm/avatar/avatar.d.ts +2 -1
  70. package/esm/avatar/avatar.js +3 -2
  71. package/esm/button/button.js +2 -1
  72. package/esm/code-block/index.js +17 -12
  73. package/esm/css-baseline/css-baseline.js +3 -3
  74. package/esm/form/FormWrapper.js +4 -4
  75. package/esm/grid/grid-container.d.ts +3 -3
  76. package/esm/grid/grid.d.ts +3 -3
  77. package/esm/index.d.ts +3 -3
  78. package/esm/index.js +3 -3
  79. package/esm/input/input.js +2 -1
  80. package/esm/input/password.js +2 -1
  81. package/esm/link/link.js +2 -2
  82. package/esm/list/index.d.ts +9 -0
  83. package/esm/list/index.js +8 -0
  84. package/esm/list/list-item.d.ts +53 -0
  85. package/esm/list/list-item.js +84 -0
  86. package/esm/list/list.d.ts +44 -0
  87. package/esm/list/list.js +29 -0
  88. package/esm/login-with/LoginSocialApple/index.js +17 -17
  89. package/esm/login-with/LoginSocialGithub/index.js +2 -2
  90. package/esm/login-with/LoginSocialInstagram/index.js +2 -2
  91. package/esm/login-with/LoginSocialLinkedin/index.js +2 -2
  92. package/esm/login-with/LoginSocialMicrosoft/index.js +2 -2
  93. package/esm/login-with/LoginSocialPinterest/index.js +9 -9
  94. package/esm/login-with/LoginSocialTiktok/index.js +2 -2
  95. package/esm/login-with/LoginSocialTwitter/index.js +11 -11
  96. package/esm/menu/index.d.ts +2 -0
  97. package/esm/menu/index.js +2 -0
  98. package/esm/menu/menu.d.ts +9 -0
  99. package/esm/menu/menu.js +92 -0
  100. package/esm/modal/modal-action.js +2 -1
  101. package/esm/table/index.d.ts +0 -1
  102. package/esm/table/index.js +0 -1
  103. package/esm/table/table-body.js +4 -23
  104. package/esm/text/child.js +3 -3
  105. package/esm/text/text.d.ts +1 -0
  106. package/esm/text/text.js +4 -2
  107. package/esm/tooltip/__test__/index.test.js +28 -28
  108. package/package.json +15 -11
  109. package/dist/cart/index.d.ts +0 -72
  110. package/dist/cart/useLocalStorage.d.ts +0 -1
  111. package/dist/table/data-table.d.ts +0 -44
  112. package/esm/cart/index.d.ts +0 -72
  113. package/esm/cart/index.js +0 -265
  114. package/esm/cart/useLocalStorage.d.ts +0 -1
  115. package/esm/cart/useLocalStorage.js +0 -29
  116. package/esm/table/data-table.d.ts +0 -44
  117. package/esm/table/data-table.js +0 -451
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ line?: boolean;
4
+ direction?: string;
5
+ justify?: string;
6
+ alignItems?: string;
7
+ leading?: React.ReactNode;
8
+ primary?: string;
9
+ secondary?: string;
10
+ trailing?: React.ReactNode;
11
+ showTitle?: boolean;
12
+ disableAutoClose?: boolean;
13
+ selected?: boolean;
14
+ onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
15
+ }
16
+ type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>;
17
+ export type ListItemProps = Props & NativeAttrs;
18
+ declare const ListItem: React.ForwardRefExoticComponent<Props & NativeAttrs & {
19
+ children?: React.ReactNode | undefined;
20
+ } & {
21
+ width?: string | number;
22
+ height?: string | number;
23
+ padding?: string | number;
24
+ margin?: string | number;
25
+ w?: string | number;
26
+ h?: string | number;
27
+ paddingLeft?: string | number;
28
+ paddingRight?: string | number;
29
+ paddingTop?: string | number;
30
+ paddingBottom?: string | number;
31
+ pl?: string | number;
32
+ pr?: string | number;
33
+ pt?: string | number;
34
+ pb?: string | number;
35
+ marginLeft?: string | number;
36
+ marginRight?: string | number;
37
+ marginTop?: string | number;
38
+ marginBottom?: string | number;
39
+ ml?: string | number;
40
+ mr?: string | number;
41
+ mt?: string | number;
42
+ mb?: string | number;
43
+ px?: string | number;
44
+ py?: string | number;
45
+ mx?: string | number;
46
+ my?: string | number;
47
+ font?: string | number;
48
+ unit?: string;
49
+ scale?: number;
50
+ children?: any;
51
+ className?: string;
52
+ } & React.InputHTMLAttributes<any> & React.RefAttributes<unknown>>;
53
+ export default ListItem;
@@ -0,0 +1,84 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ var _excluded = ["children", "direction", "justify", "alignItems", "line", "showTitle", "className", "onClick", "leading", "primary", "secondary", "trailing", "selected", "disableAutoClose"];
4
+ import _JSXStyle from "../styled-jsx.es.js";
5
+ import React from 'react';
6
+ import useTheme from '../use-theme';
7
+ import useScale, { withScale } from '../use-scale';
8
+ import useClasses from '../use-classes';
9
+ var ListItemComponent = function ListItemComponent(_ref) {
10
+ var children = _ref.children,
11
+ _ref$direction = _ref.direction,
12
+ direction = _ref$direction === void 0 ? 'row' : _ref$direction,
13
+ _ref$justify = _ref.justify,
14
+ justify = _ref$justify === void 0 ? 'flex-start' : _ref$justify,
15
+ _ref$alignItems = _ref.alignItems,
16
+ alignItems = _ref$alignItems === void 0 ? 'center' : _ref$alignItems,
17
+ _ref$line = _ref.line,
18
+ line = _ref$line === void 0 ? false : _ref$line,
19
+ _ref$showTitle = _ref.showTitle,
20
+ showTitle = _ref$showTitle === void 0 ? false : _ref$showTitle,
21
+ _ref$className = _ref.className,
22
+ className = _ref$className === void 0 ? '' : _ref$className,
23
+ onClick = _ref.onClick,
24
+ leading = _ref.leading,
25
+ primary = _ref.primary,
26
+ secondary = _ref.secondary,
27
+ trailing = _ref.trailing,
28
+ _ref$selected = _ref.selected,
29
+ selected = _ref$selected === void 0 ? false : _ref$selected,
30
+ _ref$disableAutoClose = _ref.disableAutoClose,
31
+ disableAutoClose = _ref$disableAutoClose === void 0 ? false : _ref$disableAutoClose,
32
+ props = _objectWithoutProperties(_ref, _excluded);
33
+ var theme = useTheme();
34
+ var _useScale = useScale(),
35
+ SCALES = _useScale.SCALES;
36
+ // const { disableItemsAutoClose, onItemClick } = usePopoverContext()
37
+ var hasHandler = Boolean(onClick);
38
+ // const dontCloseByClick = disableAutoClose || disableItemsAutoClose || showTitle || line
39
+ var classes = useClasses('item', {
40
+ line: line,
41
+ showTitle: showTitle
42
+ }, className);
43
+ var clickHandler = function clickHandler(event) {
44
+ onClick && onClick(event);
45
+ // if (dontCloseByClick) {
46
+ // return event.stopPropagation()
47
+ // }
48
+ // onItemClick(event)
49
+ };
50
+ return /*#__PURE__*/React.createElement("li", {
51
+ style: {
52
+ all: 'unset',
53
+ listStyle: 'none'
54
+ }
55
+ }, /*#__PURE__*/React.createElement("div", _extends({
56
+ style: {
57
+ backgroundColor: selected ? '#efefef' : ''
58
+ },
59
+ onClick: clickHandler
60
+ }, props, {
61
+ className: _JSXStyle.dynamic([["937997701", [direction, justify, alignItems, 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 || "")
62
+ }), children ? children : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
63
+ className: _JSXStyle.dynamic([["937997701", [direction, justify, alignItems, 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]]]) + " " + "item-left"
64
+ }, /*#__PURE__*/React.createElement("span", {
65
+ className: _JSXStyle.dynamic([["937997701", [direction, justify, alignItems, 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]]])
66
+ }, leading), /*#__PURE__*/React.createElement("div", {
67
+ className: _JSXStyle.dynamic([["937997701", [direction, justify, alignItems, 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]]]) + " " + "item-description"
68
+ }, /*#__PURE__*/React.createElement("p", {
69
+ className: _JSXStyle.dynamic([["937997701", [direction, justify, alignItems, 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]]]) + " " + "item-description-primary"
70
+ }, primary), secondary && /*#__PURE__*/React.createElement("small", {
71
+ className: _JSXStyle.dynamic([["937997701", [direction, justify, alignItems, 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]]]) + " " + "item-description-secondary"
72
+ }, secondary))), /*#__PURE__*/React.createElement("div", {
73
+ className: _JSXStyle.dynamic([["937997701", [direction, justify, alignItems, 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]]]) + " " + "item-right"
74
+ }, trailing)), /*#__PURE__*/React.createElement(_JSXStyle, {
75
+ id: "937997701",
76
+ dynamic: [direction, justify, alignItems, 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]
77
+ }, ".item.__jsx-style-dynamic-selector{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, ";box-sizing:border-box;-webkit-box-pack:").concat(justify, ";-webkit-justify-content:").concat(justify, ";-ms-flex-pack:").concat(justify, ";justify-content:").concat(justify, ";-webkit-align-items:").concat(alignItems, ";-webkit-box-align:").concat(alignItems, ";-ms-flex-align:").concat(alignItems, ";align-items:").concat(alignItems, ";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-description.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:5px;}.item-description-primary.__jsx-style-dynamic-selector{margin:0;}.item-description-secondary.__jsx-style-dynamic-selector{margin:0;}.item-left.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:0.7rem;}.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, ";}"))), line && /*#__PURE__*/React.createElement(ListItem, {
78
+ line: true,
79
+ showTitle: false
80
+ }));
81
+ };
82
+ ListItemComponent.displayName = 'ListItem';
83
+ var ListItem = withScale(ListItemComponent);
84
+ export default ListItem;
@@ -0,0 +1,44 @@
1
+ import React from "react";
2
+ interface Props {
3
+ heading?: any;
4
+ showHeading?: boolean;
5
+ secondary?: any;
6
+ className?: string;
7
+ children?: React.ReactNode;
8
+ }
9
+ type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>;
10
+ export type ListProps = Props & NativeAttrs;
11
+ declare const List: React.ForwardRefExoticComponent<Props & NativeAttrs & {
12
+ width?: string | number;
13
+ height?: string | number;
14
+ padding?: string | number;
15
+ margin?: string | number;
16
+ w?: string | number;
17
+ h?: string | number;
18
+ paddingLeft?: string | number;
19
+ paddingRight?: string | number;
20
+ paddingTop?: string | number;
21
+ paddingBottom?: string | number;
22
+ pl?: string | number;
23
+ pr?: string | number;
24
+ pt?: string | number;
25
+ pb?: string | number;
26
+ marginLeft?: string | number;
27
+ marginRight?: string | number;
28
+ marginTop?: string | number;
29
+ marginBottom?: string | number;
30
+ ml?: string | number;
31
+ mr?: string | number;
32
+ mt?: string | number;
33
+ mb?: string | number;
34
+ px?: string | number;
35
+ py?: string | number;
36
+ mx?: string | number;
37
+ my?: string | number;
38
+ font?: string | number;
39
+ unit?: string;
40
+ scale?: number;
41
+ children?: any;
42
+ className?: string;
43
+ } & React.InputHTMLAttributes<any> & React.RefAttributes<unknown>>;
44
+ export default List;
@@ -0,0 +1,29 @@
1
+ import _JSXStyle from "../styled-jsx.es.js";
2
+ import React from "react";
3
+ import Description from "../description";
4
+ import useScale, { withScale } from "../use-scale";
5
+ var ListComponent = function ListComponent(_ref) {
6
+ var heading = _ref.heading,
7
+ _ref$showHeading = _ref.showHeading,
8
+ showHeading = _ref$showHeading === void 0 ? true : _ref$showHeading,
9
+ secondary = _ref.secondary,
10
+ children = _ref.children;
11
+ var _useScale = useScale(),
12
+ SCALES = _useScale.SCALES;
13
+ return /*#__PURE__*/React.createElement("div", {
14
+ className: _JSXStyle.dynamic([["2885341068", [SCALES.pt(0.9), SCALES.pr(0), SCALES.pb(0.9), SCALES.pl(0)]]])
15
+ }, showHeading && /*#__PURE__*/React.createElement(Description, {
16
+ mb: 1,
17
+ mt: 1,
18
+ title: heading,
19
+ content: secondary
20
+ }), /*#__PURE__*/React.createElement("ul", {
21
+ className: _JSXStyle.dynamic([["2885341068", [SCALES.pt(0.9), SCALES.pr(0), SCALES.pb(0.9), SCALES.pl(0)]]]) + " " + "helpdice-ui-list"
22
+ }, children), /*#__PURE__*/React.createElement(_JSXStyle, {
23
+ id: "2885341068",
24
+ dynamic: [SCALES.pt(0.9), SCALES.pr(0), SCALES.pb(0.9), SCALES.pl(0)]
25
+ }, ".helpdice-ui-list.__jsx-style-dynamic-selector{all:unset;padding:".concat(SCALES.pt(0.9), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0.9), " ").concat(SCALES.pl(0), ";}")));
26
+ };
27
+ ListComponent.displayName = 'List';
28
+ var List = withScale(ListComponent);
29
+ export default List;
@@ -92,45 +92,45 @@ var LoginSocialApple = function LoginSocialApple(_ref) {
92
92
  }
93
93
  }, [scope, client_id, redirect_uri, insertScript, checkIsExistsSDKScript]);
94
94
  var loginApple = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
95
- var response;
96
- return _regeneratorRuntime.wrap(function _callee$(_context) {
95
+ var response, _t;
96
+ return _regeneratorRuntime.wrap(function (_context) {
97
97
  while (1) switch (_context.prev = _context.next) {
98
98
  case 0:
99
99
  if (isSdkLoaded) {
100
- _context.next = 2;
100
+ _context.next = 1;
101
101
  break;
102
102
  }
103
103
  return _context.abrupt("return");
104
- case 2:
104
+ case 1:
105
105
  if (_window.AppleID) {
106
- _context.next = 7;
106
+ _context.next = 2;
107
107
  break;
108
108
  }
109
109
  load();
110
110
  onReject("Apple SDK isn't loaded!");
111
- _context.next = 18;
111
+ _context.next = 6;
112
112
  break;
113
- case 7:
113
+ case 2:
114
114
  onLoginStart && onLoginStart();
115
- _context.prev = 8;
116
- _context.next = 11;
115
+ _context.prev = 3;
116
+ _context.next = 4;
117
117
  return _window.AppleID.auth.signIn();
118
- case 11:
118
+ case 4:
119
119
  response = _context.sent;
120
120
  handleResponse(response);
121
- _context.next = 18;
121
+ _context.next = 6;
122
122
  break;
123
- case 15:
124
- _context.prev = 15;
125
- _context.t0 = _context["catch"](8);
123
+ case 5:
124
+ _context.prev = 5;
125
+ _t = _context["catch"](3);
126
126
  onReject({
127
- err: _context.t0
127
+ err: _t
128
128
  });
129
- case 18:
129
+ case 6:
130
130
  case "end":
131
131
  return _context.stop();
132
132
  }
133
- }, _callee, null, [[8, 15]]);
133
+ }, _callee, null, [[3, 5]]);
134
134
  })), [handleResponse, isSdkLoaded, load, onLoginStart, onReject]);
135
135
  return /*#__PURE__*/React.createElement("div", {
136
136
  className: className,
@@ -118,12 +118,12 @@ export var LoginSocialGithub = function LoginSocialGithub(_ref) {
118
118
  var handlePostMessage = useCallback(/*#__PURE__*/function () {
119
119
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
120
120
  var type, code, provider;
121
- return _regeneratorRuntime.wrap(function _callee$(_context) {
121
+ return _regeneratorRuntime.wrap(function (_context) {
122
122
  while (1) switch (_context.prev = _context.next) {
123
123
  case 0:
124
124
  type = _ref2.type, code = _ref2.code, provider = _ref2.provider;
125
125
  return _context.abrupt("return", type === 'code' && provider === 'github' && code && getAccessToken(code));
126
- case 2:
126
+ case 1:
127
127
  case "end":
128
128
  return _context.stop();
129
129
  }
@@ -100,12 +100,12 @@ export var LoginSocialInstagram = function LoginSocialInstagram(_ref) {
100
100
  var handlePostMessage = useCallback(/*#__PURE__*/function () {
101
101
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
102
102
  var type, code, provider;
103
- return _regeneratorRuntime.wrap(function _callee$(_context) {
103
+ return _regeneratorRuntime.wrap(function (_context) {
104
104
  while (1) switch (_context.prev = _context.next) {
105
105
  case 0:
106
106
  type = _ref2.type, code = _ref2.code, provider = _ref2.provider;
107
107
  return _context.abrupt("return", type === 'code' && provider === 'instagram' && code && getAccessToken(code));
108
- case 2:
108
+ case 1:
109
109
  case "end":
110
110
  return _context.stop();
111
111
  }
@@ -106,12 +106,12 @@ export var LoginSocialLinkedin = function LoginSocialLinkedin(_ref) {
106
106
  var handlePostMessage = useCallback(/*#__PURE__*/function () {
107
107
  var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref4) {
108
108
  var type, code, provider;
109
- return _regeneratorRuntime.wrap(function _callee$(_context) {
109
+ return _regeneratorRuntime.wrap(function (_context) {
110
110
  while (1) switch (_context.prev = _context.next) {
111
111
  case 0:
112
112
  type = _ref4.type, code = _ref4.code, provider = _ref4.provider;
113
113
  return _context.abrupt("return", type === 'code' && provider === 'linkedin' && code && getAccessToken(code));
114
- case 2:
114
+ case 1:
115
115
  case "end":
116
116
  return _context.stop();
117
117
  }
@@ -109,12 +109,12 @@ export var LoginSocialMicrosoft = function LoginSocialMicrosoft(_ref) {
109
109
  var handlePostMessage = useCallback(/*#__PURE__*/function () {
110
110
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
111
111
  var type, code, provider;
112
- return _regeneratorRuntime.wrap(function _callee$(_context) {
112
+ return _regeneratorRuntime.wrap(function (_context) {
113
113
  while (1) switch (_context.prev = _context.next) {
114
114
  case 0:
115
115
  type = _ref2.type, code = _ref2.code, provider = _ref2.provider;
116
116
  return _context.abrupt("return", type === 'code' && provider === 'microsoft' && code && getAccessToken(code));
117
- case 2:
117
+ case 1:
118
118
  case "end":
119
119
  return _context.stop();
120
120
  }
@@ -63,11 +63,11 @@ export var LoginSocialPinterest = function LoginSocialPinterest(_ref) {
63
63
  var getAccessToken = useCallback(/*#__PURE__*/function () {
64
64
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(code) {
65
65
  var details, formBody, property, encodedKey, encodedValue, data;
66
- return _regeneratorRuntime.wrap(function _callee$(_context) {
66
+ return _regeneratorRuntime.wrap(function (_context) {
67
67
  while (1) switch (_context.prev = _context.next) {
68
68
  case 0:
69
69
  if (!isOnlyGetCode) {
70
- _context.next = 4;
70
+ _context.next = 1;
71
71
  break;
72
72
  }
73
73
  onResolve({
@@ -76,9 +76,9 @@ export var LoginSocialPinterest = function LoginSocialPinterest(_ref) {
76
76
  code: code
77
77
  }
78
78
  });
79
- _context.next = 12;
79
+ _context.next = 3;
80
80
  break;
81
- case 4:
81
+ case 1:
82
82
  details = {
83
83
  code: code,
84
84
  redirect_uri: redirect_uri,
@@ -91,7 +91,7 @@ export var LoginSocialPinterest = function LoginSocialPinterest(_ref) {
91
91
  formBody.push(encodedKey + '=' + encodedValue);
92
92
  }
93
93
  formBody = formBody.join('&');
94
- _context.next = 10;
94
+ _context.next = 2;
95
95
  return fetch("".concat(PREVENT_CORS_URL, "/").concat(PINTEREST_URL_API, "/oauth/token"), {
96
96
  method: 'POST',
97
97
  headers: {
@@ -105,7 +105,7 @@ export var LoginSocialPinterest = function LoginSocialPinterest(_ref) {
105
105
  })["catch"](function (err) {
106
106
  return onReject(err);
107
107
  });
108
- case 10:
108
+ case 2:
109
109
  data = _context.sent;
110
110
  if (data.access_token) {
111
111
  if (isOnlyGetToken) onResolve({
@@ -113,7 +113,7 @@ export var LoginSocialPinterest = function LoginSocialPinterest(_ref) {
113
113
  data: data
114
114
  });else getProfile(data);
115
115
  }
116
- case 12:
116
+ case 3:
117
117
  case "end":
118
118
  return _context.stop();
119
119
  }
@@ -126,12 +126,12 @@ export var LoginSocialPinterest = function LoginSocialPinterest(_ref) {
126
126
  var handlePostMessage = useCallback(/*#__PURE__*/function () {
127
127
  var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
128
128
  var type, code, provider;
129
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
129
+ return _regeneratorRuntime.wrap(function (_context2) {
130
130
  while (1) switch (_context2.prev = _context2.next) {
131
131
  case 0:
132
132
  type = _ref3.type, code = _ref3.code, provider = _ref3.provider;
133
133
  return _context2.abrupt("return", type === 'code' && provider === 'pinterest' && code && getAccessToken(code));
134
- case 2:
134
+ case 1:
135
135
  case "end":
136
136
  return _context2.stop();
137
137
  }
@@ -100,7 +100,7 @@ export var LoginSocialGithub = function LoginSocialGithub(_ref) {
100
100
  var handlePostMessage = useCallback(/*#__PURE__*/function () {
101
101
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
102
102
  var type, code, provider;
103
- return _regeneratorRuntime.wrap(function _callee$(_context) {
103
+ return _regeneratorRuntime.wrap(function (_context) {
104
104
  while (1) switch (_context.prev = _context.next) {
105
105
  case 0:
106
106
  type = _ref2.type, code = _ref2.code, provider = _ref2.provider;
@@ -110,7 +110,7 @@ export var LoginSocialGithub = function LoginSocialGithub(_ref) {
110
110
  code: code
111
111
  }
112
112
  }));
113
- case 2:
113
+ case 1:
114
114
  case "end":
115
115
  return _context.stop();
116
116
  }
@@ -65,11 +65,11 @@ export var LoginSocialTwitter = function LoginSocialTwitter(_ref) {
65
65
  var getAccessToken = useCallback(/*#__PURE__*/function () {
66
66
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(code) {
67
67
  var details, requestOAuthURL, data;
68
- return _regeneratorRuntime.wrap(function _callee$(_context) {
68
+ return _regeneratorRuntime.wrap(function (_context) {
69
69
  while (1) switch (_context.prev = _context.next) {
70
70
  case 0:
71
71
  if (!isOnlyGetCode) {
72
- _context.next = 4;
72
+ _context.next = 1;
73
73
  break;
74
74
  }
75
75
  onResolve({
@@ -78,9 +78,9 @@ export var LoginSocialTwitter = function LoginSocialTwitter(_ref) {
78
78
  code: code
79
79
  }
80
80
  });
81
- _context.next = 10;
81
+ _context.next = 3;
82
82
  break;
83
- case 4:
83
+ case 1:
84
84
  details = new URLSearchParams({
85
85
  code: code,
86
86
  redirect_uri: redirect_uri,
@@ -89,7 +89,7 @@ export var LoginSocialTwitter = function LoginSocialTwitter(_ref) {
89
89
  code_verifier: 'challenge'
90
90
  });
91
91
  requestOAuthURL = "".concat(PREVENT_CORS_URL, "/").concat(TWITTER_API_URL, "/2/oauth2/token");
92
- _context.next = 8;
92
+ _context.next = 2;
93
93
  return fetch(requestOAuthURL, {
94
94
  method: 'POST',
95
95
  body: details,
@@ -102,7 +102,7 @@ export var LoginSocialTwitter = function LoginSocialTwitter(_ref) {
102
102
  })["catch"](function (err) {
103
103
  return onReject(err);
104
104
  });
105
- case 8:
105
+ case 2:
106
106
  data = _context.sent;
107
107
  if (data.access_token) {
108
108
  if (isOnlyGetToken) onResolve({
@@ -110,7 +110,7 @@ export var LoginSocialTwitter = function LoginSocialTwitter(_ref) {
110
110
  data: data
111
111
  });else getProfile(data);
112
112
  }
113
- case 10:
113
+ case 3:
114
114
  case "end":
115
115
  return _context.stop();
116
116
  }
@@ -123,12 +123,12 @@ export var LoginSocialTwitter = function LoginSocialTwitter(_ref) {
123
123
  var handlePostMessage = useCallback(/*#__PURE__*/function () {
124
124
  var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
125
125
  var type, code, provider;
126
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
126
+ return _regeneratorRuntime.wrap(function (_context2) {
127
127
  while (1) switch (_context2.prev = _context2.next) {
128
128
  case 0:
129
129
  type = _ref3.type, code = _ref3.code, provider = _ref3.provider;
130
130
  return _context2.abrupt("return", type === 'code' && provider === 'twitter' && code && getAccessToken(code));
131
- case 2:
131
+ case 1:
132
132
  case "end":
133
133
  return _context2.stop();
134
134
  }
@@ -152,7 +152,7 @@ export var LoginSocialTwitter = function LoginSocialTwitter(_ref) {
152
152
  }, [handlePostMessage]);
153
153
  var onLogin = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
154
154
  var oauthUrl, width, height, left, top;
155
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
155
+ return _regeneratorRuntime.wrap(function (_context3) {
156
156
  while (1) switch (_context3.prev = _context3.next) {
157
157
  case 0:
158
158
  onLoginStart && onLoginStart();
@@ -163,7 +163,7 @@ export var LoginSocialTwitter = function LoginSocialTwitter(_ref) {
163
163
  left = window.screen.width / 2 - width / 2;
164
164
  top = window.screen.height / 2 - height / 2;
165
165
  window.open(oauthUrl, 'twitter', 'menubar=no,location=no,resizable=no,scrollbars=no,status=no, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left);
166
- case 8:
166
+ case 1:
167
167
  case "end":
168
168
  return _context3.stop();
169
169
  }
@@ -0,0 +1,2 @@
1
+ import Menu from "./menu";
2
+ export default Menu;
@@ -0,0 +1,2 @@
1
+ import Menu from "./menu";
2
+ export default Menu;
@@ -0,0 +1,9 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { Placement } from '@floating-ui/react-dom';
3
+ interface MenuProps {
4
+ anchor: ReactNode;
5
+ children: ReactNode | ((close: () => void) => ReactNode);
6
+ placement?: Placement;
7
+ }
8
+ declare const Menu: React.FC<MenuProps>;
9
+ export default Menu;
@@ -0,0 +1,92 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import React, { useState, useEffect } from 'react';
3
+ import { motion, AnimatePresence } from 'framer-motion';
4
+ import { useFloating, offset, flip, shift, autoUpdate } from '@floating-ui/react-dom';
5
+ var Menu = function Menu(_ref) {
6
+ var anchor = _ref.anchor,
7
+ children = _ref.children,
8
+ _ref$placement = _ref.placement,
9
+ placement = _ref$placement === void 0 ? 'bottom-start' : _ref$placement;
10
+ var _useState = useState(false),
11
+ _useState2 = _slicedToArray(_useState, 2),
12
+ open = _useState2[0],
13
+ setOpen = _useState2[1];
14
+ var _useFloating = useFloating({
15
+ placement: placement,
16
+ middleware: [offset(8), flip(), shift({
17
+ padding: 8
18
+ })]
19
+ }),
20
+ refs = _useFloating.refs,
21
+ x = _useFloating.x,
22
+ y = _useFloating.y,
23
+ strategy = _useFloating.strategy,
24
+ update = _useFloating.update;
25
+
26
+ // Auto-update on layout changes
27
+ useEffect(function () {
28
+ if (open && refs.reference.current && refs.floating.current) {
29
+ return autoUpdate(refs.reference.current, refs.floating.current, update);
30
+ }
31
+ }, [open, refs.reference, refs.floating, update]);
32
+
33
+ // Close when clicking outside
34
+ useEffect(function () {
35
+ var handleClickOutside = function handleClickOutside(event) {
36
+ if (refs.reference.current && refs.floating.current && !refs.floating.current.contains(event.target)) {
37
+ setOpen(false);
38
+ }
39
+ };
40
+ document.addEventListener('mousedown', handleClickOutside);
41
+ return function () {
42
+ return document.removeEventListener('mousedown', handleClickOutside);
43
+ };
44
+ }, [refs]);
45
+ return /*#__PURE__*/React.createElement("div", {
46
+ style: {
47
+ display: 'inline-block'
48
+ }
49
+ }, /*#__PURE__*/React.createElement("div", {
50
+ ref: refs.setReference,
51
+ onClick: function onClick() {
52
+ return setOpen(function (prev) {
53
+ return !prev;
54
+ });
55
+ },
56
+ style: {
57
+ cursor: 'pointer'
58
+ }
59
+ }, anchor), /*#__PURE__*/React.createElement(AnimatePresence, null, open && /*#__PURE__*/React.createElement(motion.div, {
60
+ ref: refs.setFloating,
61
+ initial: {
62
+ opacity: 0,
63
+ scale: 0.95,
64
+ y: -5
65
+ },
66
+ animate: {
67
+ opacity: 1,
68
+ scale: 1,
69
+ y: 0
70
+ },
71
+ exit: {
72
+ opacity: 0,
73
+ scale: 0.95,
74
+ y: -5
75
+ },
76
+ transition: {
77
+ duration: 0.2,
78
+ ease: 'easeOut'
79
+ },
80
+ style: {
81
+ position: strategy,
82
+ top: y !== null && y !== void 0 ? y : 0,
83
+ left: x !== null && x !== void 0 ? x : 0,
84
+ zIndex: 1000,
85
+ boxShadow: '0 2px 8px rgba(0,0,0,0.15)',
86
+ minWidth: '150px'
87
+ }
88
+ }, typeof children === 'function' ? children(function () {
89
+ return setOpen(false);
90
+ }) : children)));
91
+ };
92
+ export default Menu;
@@ -28,7 +28,8 @@ var ModalActionComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
28
28
  _close = _useModalContext.close;
29
29
  useImperativeHandle(ref, function () {
30
30
  return btnRef.current;
31
- });
31
+ }); // Changed with !
32
+
32
33
  var clickHandler = function clickHandler(event) {
33
34
  if (disabled) return;
34
35
  var actionEvent = Object.assign({}, event, {
@@ -2,5 +2,4 @@ import Table from './table';
2
2
  export type { TableProps } from './table';
3
3
  export type { TableColumnProps } from './table-column';
4
4
  export type { TableOnCellClick, TableAbstractColumn, TableOnChange, TableOnRowClick, TableRowClassNameHandler, TableDataItemBase, TableColumnRender } from './table-types';
5
- export { default as DataTable } from './data-table';
6
5
  export default Table;
@@ -1,3 +1,2 @@
1
1
  import Table from './table';
2
- export { default as DataTable } from './data-table';
3
2
  export default Table;