@helpdice/ui 1.6.8 → 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 (141) hide show
  1. package/dist/Placeholder/index.js +44 -23
  2. package/dist/auto-complete/auto-complete.d.ts +35 -3
  3. package/dist/auto-complete/index.js +45 -22
  4. package/dist/avatar/avatar.d.ts +2 -1
  5. package/dist/avatar/index.js +33 -13
  6. package/dist/badge/index.js +30 -11
  7. package/dist/breadcrumbs/index.js +31 -12
  8. package/dist/button/index.js +34 -14
  9. package/dist/button-dropdown/index.js +31 -12
  10. package/dist/button-group/index.js +30 -11
  11. package/dist/capacity/index.js +30 -11
  12. package/dist/card/index.js +31 -12
  13. package/dist/checkbox/index.js +31 -12
  14. package/dist/code/index.js +30 -11
  15. package/dist/code-block/index.d.ts +10 -0
  16. package/dist/col/index.js +21 -2
  17. package/dist/collapse/index.js +30 -11
  18. package/dist/css-baseline/index.js +24 -5
  19. package/dist/description/index.js +30 -11
  20. package/dist/display/index.js +30 -11
  21. package/dist/divider/index.js +30 -11
  22. package/dist/dot/index.js +30 -11
  23. package/dist/drawer/index.js +30 -11
  24. package/dist/fieldset/index.js +30 -11
  25. package/dist/grid/grid-container.d.ts +3 -3
  26. package/dist/grid/grid.d.ts +3 -3
  27. package/dist/grid/index.js +30 -11
  28. package/dist/image/index.js +31 -12
  29. package/dist/index.d.ts +4 -3
  30. package/dist/index.js +10994 -1501
  31. package/dist/input/index.js +36 -15
  32. package/dist/keyboard/index.js +30 -11
  33. package/dist/link/index.js +31 -12
  34. package/dist/list/index.d.ts +9 -0
  35. package/dist/list/index.js +1287 -0
  36. package/dist/list/list-item.d.ts +53 -0
  37. package/dist/list/list.d.ts +44 -0
  38. package/dist/loading/index.js +30 -11
  39. package/dist/menu/index.d.ts +2 -0
  40. package/dist/menu/index.js +10354 -0
  41. package/dist/menu/menu.d.ts +9 -0
  42. package/dist/modal/index.js +37 -16
  43. package/dist/note/index.js +30 -11
  44. package/dist/page/index.js +30 -11
  45. package/dist/pagination/index.js +30 -11
  46. package/dist/popover/index.js +30 -11
  47. package/dist/progress/index.js +30 -11
  48. package/dist/radio/index.js +30 -11
  49. package/dist/rating/index.js +31 -12
  50. package/dist/row/index.js +21 -2
  51. package/dist/search-bar/index.js +31 -12
  52. package/dist/select/index.js +33 -14
  53. package/dist/slider/index.js +30 -11
  54. package/dist/snippet/index.js +31 -12
  55. package/dist/spacer/index.js +30 -11
  56. package/dist/spinner/index.js +30 -11
  57. package/dist/table/index.d.ts +0 -1
  58. package/dist/table/index.js +1673 -2252
  59. package/dist/tabs/index.js +32 -13
  60. package/dist/tag/index.js +30 -11
  61. package/dist/text/child.d.ts +1 -1
  62. package/dist/text/index.js +44 -23
  63. package/dist/text/text.d.ts +2 -1
  64. package/dist/textarea/index.js +30 -11
  65. package/dist/toggle/index.js +30 -11
  66. package/dist/tooltip/index.js +30 -11
  67. package/dist/tree/index.js +21 -2
  68. package/dist/ui-provider/index.js +34 -14
  69. package/dist/use-scale/index.js +9 -9
  70. package/dist/user/index.js +34 -14
  71. package/dist/utils/collections.d.ts +1 -1
  72. package/esm/auto-complete/auto-complete.d.ts +35 -3
  73. package/esm/auto-complete/auto-complete.js +6 -6
  74. package/esm/avatar/avatar.d.ts +2 -1
  75. package/esm/avatar/avatar.js +3 -2
  76. package/esm/button/button-loading.js +1 -1
  77. package/esm/button/button.js +2 -1
  78. package/esm/button/styles.js +1 -1
  79. package/esm/button-dropdown/icon.js +1 -1
  80. package/esm/checkbox/checkbox.icon.js +1 -1
  81. package/esm/code-block/index.d.ts +10 -0
  82. package/esm/code-block/index.js +31 -27
  83. package/esm/css-baseline/css-baseline.js +3 -3
  84. package/esm/form/FormWrapper.js +4 -4
  85. package/esm/grid/grid-container.d.ts +3 -3
  86. package/esm/grid/grid.d.ts +3 -3
  87. package/esm/index.d.ts +4 -3
  88. package/esm/index.js +4 -4
  89. package/esm/input/input-block-label.js +1 -1
  90. package/esm/input/input-icon.js +1 -1
  91. package/esm/input/input.js +2 -1
  92. package/esm/input/password.js +2 -1
  93. package/esm/link/icon.js +1 -1
  94. package/esm/link/link.js +2 -2
  95. package/esm/list/index.d.ts +9 -0
  96. package/esm/list/index.js +8 -0
  97. package/esm/list/list-item.d.ts +53 -0
  98. package/esm/list/list-item.js +84 -0
  99. package/esm/list/list.d.ts +44 -0
  100. package/esm/list/list.js +29 -0
  101. package/esm/login-with/LoginSocialApple/index.js +17 -17
  102. package/esm/login-with/LoginSocialGithub/index.js +2 -2
  103. package/esm/login-with/LoginSocialInstagram/index.js +2 -2
  104. package/esm/login-with/LoginSocialLinkedin/index.js +2 -2
  105. package/esm/login-with/LoginSocialMicrosoft/index.js +2 -2
  106. package/esm/login-with/LoginSocialPinterest/index.js +9 -9
  107. package/esm/login-with/LoginSocialTiktok/index.js +2 -2
  108. package/esm/login-with/LoginSocialTwitter/index.js +11 -11
  109. package/esm/menu/index.d.ts +2 -0
  110. package/esm/menu/index.js +2 -0
  111. package/esm/menu/menu.d.ts +9 -0
  112. package/esm/menu/menu.js +92 -0
  113. package/esm/modal/modal-action.js +2 -1
  114. package/esm/modal/modal-actions.js +1 -1
  115. package/esm/rating/rating-icon.js +1 -1
  116. package/esm/select/select-icon.js +1 -1
  117. package/esm/select/select-input.js +1 -1
  118. package/esm/select/select-multiple-value.js +1 -1
  119. package/esm/snippet/snippet-icon.js +1 -1
  120. package/esm/table/index.d.ts +0 -1
  121. package/esm/table/index.js +0 -1
  122. package/esm/table/table-body.js +4 -23
  123. package/esm/tabs/tabs.js +2 -2
  124. package/esm/text/child.d.ts +1 -1
  125. package/esm/text/child.js +10 -10
  126. package/esm/text/text.d.ts +2 -1
  127. package/esm/text/text.js +4 -2
  128. package/esm/tooltip/__test__/index.test.js +30 -30
  129. package/esm/utils/collections.d.ts +1 -1
  130. package/esm/utils/collections.js +1 -1
  131. package/package.json +19 -12
  132. package/dist/cart/index.d.ts +0 -72
  133. package/dist/cart/useLocalStorage.d.ts +0 -1
  134. package/dist/table/data-table.d.ts +0 -44
  135. package/esm/cart/index.d.ts +0 -72
  136. package/esm/cart/index.js +0 -265
  137. package/esm/cart/useLocalStorage.d.ts +0 -1
  138. package/esm/cart/useLocalStorage.js +0 -29
  139. package/esm/table/data-table.d.ts +0 -44
  140. package/esm/table/data-table.js +0 -451
  141. /package/esm/utils/use-context-state/{create-geist-context.js → create-ui-context.js} +0 -0
@@ -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, {
@@ -31,6 +31,6 @@ var ModalActionsComponent = function ModalActionsComponent(_ref) {
31
31
  dynamic: [theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border, height]
32
32
  }, "footer.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;overflow:hidden;width:100%;height:auto;position:absolute;bottom:0;left:0;right:0;border-top:1px solid ".concat(theme.palette.border, ";border-bottom-left-radius:").concat(theme.layout.radius, ";border-bottom-right-radius:").concat(theme.layout.radius, ";}footer.__jsx-style-dynamic-selector>button.btn + button.btn{border-left:1px solid ").concat(theme.palette.border, ";}div.__jsx-style-dynamic-selector{height:").concat(height, ";-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}")));
33
33
  };
34
- ModalActionsComponent.displayName = 'GeistModalActions';
34
+ ModalActionsComponent.displayName = 'ModalActions';
35
35
  var ModalActions = /*#__PURE__*/React.memo(ModalActionsComponent);
36
36
  export default ModalActions;
@@ -14,5 +14,5 @@ var RatingIcon = function RatingIcon() {
14
14
  d: "M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"
15
15
  }));
16
16
  };
17
- RatingIcon.displayName = 'GeistRatingIcon';
17
+ RatingIcon.displayName = 'RatingIcon';
18
18
  export default RatingIcon;
@@ -16,6 +16,6 @@ var SelectIconComponent = function SelectIconComponent() {
16
16
  id: "2742933678"
17
17
  }, "svg.jsx-2742933678{color:inherit;stroke:currentColor;-webkit-transition:all 200ms ease;transition:all 200ms ease;width:1.214em;height:1.214em;}"));
18
18
  };
19
- SelectIconComponent.displayName = 'GeistSelectIcon';
19
+ SelectIconComponent.displayName = 'SelectIcon';
20
20
  var SelectIcon = /*#__PURE__*/React.memo(SelectIconComponent);
21
21
  export default SelectIcon;
@@ -31,5 +31,5 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function (_ref, inputRef) {
31
31
  id: "2813108835"
32
32
  }, "input.jsx-2813108835{position:fixed;top:-10000px;left:-10000px;opacity:0;z-index:-1;width:0;height:0;padding:0;font-size:0;border:none;}"));
33
33
  });
34
- SelectInput.displayName = 'GeistSelectInput';
34
+ SelectInput.displayName = 'SelectInput';
35
35
  export default SelectInput;
@@ -17,5 +17,5 @@ var SelectMultipleValue = function SelectMultipleValue(_ref) {
17
17
  dynamic: [theme.layout.radius, theme.palette.accents_2, disabled ? theme.palette.accents_4 : theme.palette.accents_6]
18
18
  }, ".item.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;justify-items:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:1;padding:0 0.5em;font-size:var(--select-font-size);height:calc(var(--select-font-size) * 2);border-radius:".concat(theme.layout.radius, ";background-color:").concat(theme.palette.accents_2, ";color:").concat(disabled ? theme.palette.accents_4 : theme.palette.accents_6, ";}.item.__jsx-style-dynamic-selector>div:not(.clear-icon),.item.__jsx-style-dynamic-selector>div:not(.clear-icon):hover{border-radius:0;background-color:transparent;padding:0;margin:0;color:inherit;}")));
19
19
  };
20
- SelectMultipleValue.displayName = 'GeistSelectMultipleValue';
20
+ SelectMultipleValue.displayName = 'SelectMultipleValue';
21
21
  export default SelectMultipleValue;
@@ -20,6 +20,6 @@ var SnippetIconComponent = function SnippetIconComponent() {
20
20
  id: "418323402"
21
21
  }, "svg.jsx-418323402{width:calc(var(--snippet-font-size) * 1.69);height:calc(var(--snippet-font-size) * 1.69);}"));
22
22
  };
23
- SnippetIconComponent.displayName = 'GeistSnippetIcon';
23
+ SnippetIconComponent.displayName = 'SnippetIcon';
24
24
  var SnippetIcon = /*#__PURE__*/React.memo(SnippetIconComponent);
25
25
  export default SnippetIcon;
@@ -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;
@@ -8,7 +8,8 @@ import { useTableContext } from './table-context';
8
8
  import useClasses from '../use-classes';
9
9
  import _ from 'lodash';
10
10
  import Placeholder from '../Placeholder';
11
- import DataTable from './data-table';
11
+ // import { DataTable } from '@helpdice/pro';
12
+
12
13
  var TableBody = function TableBody(_ref) {
13
14
  var data = _ref.data,
14
15
  emptyText = _ref.emptyText,
@@ -130,8 +131,7 @@ var TableBody = function TableBody(_ref) {
130
131
  return /*#__PURE__*/React.createElement("tbody", {
131
132
  className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
132
133
  }, data.map(function (row, index) {
133
- var _row$table, _row$table2, _row$table3, _row$table4, _row$table5;
134
- var qid = _.uniqueId();
134
+ // const qid = _.uniqueId();
135
135
  if (row === null || row === undefined) {
136
136
  var uid = _.uniqueId();
137
137
  return /*#__PURE__*/React.createElement("tr", {
@@ -142,26 +142,7 @@ var TableBody = function TableBody(_ref) {
142
142
  className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
143
143
  }, "\u2003"));
144
144
  }
145
- return /*#__PURE__*/React.createElement(React.Fragment, null, renderRow(columns, row, index), (row === null || row === void 0 ? void 0 : row.table) && /*#__PURE__*/React.createElement("tr", {
146
- key: qid,
147
- className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
148
- }, /*#__PURE__*/React.createElement("td", {
149
- style: {
150
- padding: '1rem'
151
- },
152
- colSpan: columns.length,
153
- className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
154
- }, /*#__PURE__*/React.createElement(DataTable, {
155
- readOnly: true,
156
- stickyHeader: false,
157
- style: _extends({
158
- height: 'auto !important'
159
- }, row === null || row === void 0 || (_row$table = row.table) === null || _row$table === void 0 ? void 0 : _row$table.style),
160
- menu: (_row$table2 = row.table) === null || _row$table2 === void 0 ? void 0 : _row$table2.menu,
161
- rows: (_row$table3 = row.table) === null || _row$table3 === void 0 ? void 0 : _row$table3.rows,
162
- heading: (_row$table4 = row.table) === null || _row$table4 === void 0 ? void 0 : _row$table4.heading,
163
- cols: (_row$table5 = row.table) === null || _row$table5 === void 0 ? void 0 : _row$table5.cols
164
- }))));
145
+ return /*#__PURE__*/React.createElement(React.Fragment, null, renderRow(columns, row, index));
165
146
 
166
147
  // return (
167
148
  // <tr
package/esm/tabs/tabs.js CHANGED
@@ -12,7 +12,7 @@ import { TabsContext } from './tabs-context';
12
12
  import useScale, { withScale } from '../use-scale';
13
13
  import Highlight from '../shared/highlight';
14
14
  import { useRect } from '../utils/layouts';
15
- import { isGeistElement } from '../utils/collections';
15
+ import { isUiElement } from '../utils/collections';
16
16
  import useClasses from '../use-classes';
17
17
  var TabsComponent = function TabsComponent(_ref) {
18
18
  var userCustomInitialValue = _ref.initialValue,
@@ -87,7 +87,7 @@ var TabsComponent = function TabsComponent(_ref) {
87
87
  onChange && onChange(value);
88
88
  };
89
89
  var tabItemMouseOverHandler = function tabItemMouseOverHandler(event) {
90
- if (!isGeistElement(event.target)) return;
90
+ if (!isUiElement(event.target)) return;
91
91
  setRect(event, function () {
92
92
  return ref.current;
93
93
  });
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { NormalTypes } from '../utils/prop-types';
3
3
  export interface Props {
4
4
  tag: keyof JSX.IntrinsicElements;
5
- type?: NormalTypes;
5
+ color?: NormalTypes;
6
6
  className?: string;
7
7
  }
8
8
  type NativeAttrs = Omit<React.DetailsHTMLAttributes<any>, keyof Props>;
package/esm/text/child.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["children", "tag", "className", "type"];
3
+ var _excluded = ["children", "tag", "className", "color"];
4
4
  import _JSXStyle from "../styled-jsx.es.js";
5
5
  /* "use client" */
6
6
 
@@ -22,8 +22,8 @@ var TextChild = function TextChild(_ref) {
22
22
  tag = _ref.tag,
23
23
  _ref$className = _ref.className,
24
24
  className = _ref$className === void 0 ? '' : _ref$className,
25
- _ref$type = _ref.type,
26
- type = _ref$type === void 0 ? 'default' : _ref$type,
25
+ _ref$color = _ref.color,
26
+ color = _ref$color === void 0 ? 'default' : _ref$color,
27
27
  props = _objectWithoutProperties(_ref, _excluded);
28
28
  var Component = tag;
29
29
  var theme = useTheme();
@@ -35,9 +35,9 @@ var TextChild = function TextChild(_ref) {
35
35
  var my = getScaleProps(['margin', 'marginTop', 'marginBottom', 'my', 'mt', 'mb']);
36
36
  var px = getScaleProps(['padding', 'paddingLeft', 'paddingRight', 'pl', 'pr', 'px']);
37
37
  var py = getScaleProps(['padding', 'paddingTop', 'paddingBottom', 'pt', 'pb', 'py']);
38
- var color = useMemo(function () {
39
- return getTypeColor(type, theme.palette);
40
- }, [type, theme.palette]);
38
+ var _color = useMemo(function () {
39
+ return getTypeColor(color, theme.palette);
40
+ }, [color, theme.palette]);
41
41
  var classNames = useMemo(function () {
42
42
  var keys = [{
43
43
  value: mx,
@@ -62,11 +62,11 @@ var TextChild = function TextChild(_ref) {
62
62
  return "".concat(scaleClassNames, " ").concat(className).trim();
63
63
  }, [mx, my, px, py, font, className]);
64
64
  return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
65
- className: _JSXStyle.dynamic([["3155699851", [tag, color, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1, 'inherit'), SCALES.ml(0, 'revert'), SCALES.mr(0, 'revert'), SCALES.mt(0, 'revert'), SCALES.mb(0, 'revert'), SCALES.pl(0, 'revert'), SCALES.pr(0, 'revert'), SCALES.pt(0, 'revert'), SCALES.pb(0, 'revert')]]]) + " " + (props && props.className != null && props.className || classNames || "")
65
+ className: _JSXStyle.dynamic([["2277774325", [tag, _color, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1, 'inherit'), SCALES.ml(0, 'revert'), SCALES.mr(0, 'revert'), SCALES.mt(0, 'revert'), SCALES.mb(0, 'revert'), SCALES.pl(0, 'revert'), SCALES.pr(0, 'revert'), SCALES.pt(0, 'revert'), SCALES.pb(0, 'revert')]]]) + " " + (props && props.className != null && props.className || classNames || "")
66
66
  }), children, /*#__PURE__*/React.createElement(_JSXStyle, {
67
- id: "3155699851",
68
- dynamic: [tag, color, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1, 'inherit'), SCALES.ml(0, 'revert'), SCALES.mr(0, 'revert'), SCALES.mt(0, 'revert'), SCALES.mb(0, 'revert'), SCALES.pl(0, 'revert'), SCALES.pr(0, 'revert'), SCALES.pt(0, 'revert'), SCALES.pb(0, 'revert')]
69
- }, "".concat(tag, ".__jsx-style-dynamic-selector{color:").concat(color, ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";}.font.__jsx-style-dynamic-selector{font-size:").concat(SCALES.font(1, 'inherit'), ";}.mx.__jsx-style-dynamic-selector{margin-left:").concat(SCALES.ml(0, 'revert'), ";margin-right:").concat(SCALES.mr(0, 'revert'), ";}.my.__jsx-style-dynamic-selector{margin-top:").concat(SCALES.mt(0, 'revert'), ";margin-bottom:").concat(SCALES.mb(0, 'revert'), ";}.px.__jsx-style-dynamic-selector{padding-left:").concat(SCALES.pl(0, 'revert'), ";padding-right:").concat(SCALES.pr(0, 'revert'), ";}.py.__jsx-style-dynamic-selector{padding-top:").concat(SCALES.pt(0, 'revert'), ";padding-bottom:").concat(SCALES.pb(0, 'revert'), ";}")));
67
+ id: "2277774325",
68
+ dynamic: [tag, _color, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1, 'inherit'), SCALES.ml(0, 'revert'), SCALES.mr(0, 'revert'), SCALES.mt(0, 'revert'), SCALES.mb(0, 'revert'), SCALES.pl(0, 'revert'), SCALES.pr(0, 'revert'), SCALES.pt(0, 'revert'), SCALES.pb(0, 'revert')]
69
+ }, "".concat(tag, ".__jsx-style-dynamic-selector{color:").concat(_color, ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";}.font.__jsx-style-dynamic-selector{font-size:").concat(SCALES.font(1, 'inherit'), ";}.mx.__jsx-style-dynamic-selector{margin-left:").concat(SCALES.ml(0, 'revert'), ";margin-right:").concat(SCALES.mr(0, 'revert'), ";}.my.__jsx-style-dynamic-selector{margin-top:").concat(SCALES.mt(0, 'revert'), ";margin-bottom:").concat(SCALES.mb(0, 'revert'), ";}.px.__jsx-style-dynamic-selector{padding-left:").concat(SCALES.pl(0, 'revert'), ";padding-right:").concat(SCALES.pr(0, 'revert'), ";}.py.__jsx-style-dynamic-selector{padding-top:").concat(SCALES.pt(0, 'revert'), ";padding-bottom:").concat(SCALES.pb(0, 'revert'), ";}.no-wrap.__jsx-style-dynamic-selector{white-space:nowrap;}")));
70
70
  };
71
71
  TextChild.displayName = 'TextChild';
72
72
  export default TextChild;
@@ -16,8 +16,9 @@ interface Props {
16
16
  del?: boolean;
17
17
  em?: boolean;
18
18
  blockquote?: boolean;
19
+ noWrap?: boolean;
19
20
  className?: string;
20
- type?: TextTypes;
21
+ color?: TextTypes;
21
22
  align?: 'center' | 'right' | 'left';
22
23
  }
23
24
  type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>;
package/esm/text/text.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["h1", "h2", "h3", "h4", "h5", "h6", "p", "b", "small", "i", "span", "del", "em", "blockquote", "children", "className"];
3
+ var _excluded = ["h1", "h2", "h3", "h4", "h5", "h6", "p", "b", "small", "i", "span", "del", "em", "blockquote", "noWrap", "children", "className"];
4
4
  /* "use client" */;
5
5
  import React, { useMemo } from 'react';
6
6
  import TextChild from './child';
@@ -41,6 +41,8 @@ var TextComponent = function TextComponent(_ref) {
41
41
  em = _ref$em === void 0 ? false : _ref$em,
42
42
  _ref$blockquote = _ref.blockquote,
43
43
  blockquote = _ref$blockquote === void 0 ? false : _ref$blockquote,
44
+ _ref$noWrap = _ref.noWrap,
45
+ noWrap = _ref$noWrap === void 0 ? false : _ref$noWrap,
44
46
  children = _ref.children,
45
47
  _ref$className = _ref.className,
46
48
  className = _ref$className === void 0 ? '' : _ref$className,
@@ -96,7 +98,7 @@ var TextComponent = function TextComponent(_ref) {
96
98
  style: {
97
99
  textAlign: props.align
98
100
  },
99
- className: className,
101
+ className: "".concat(className, " ").concat(noWrap ? 'no-wrap' : ''),
100
102
  tag: tag
101
103
  }, props), modifers);
102
104
  };
@@ -2,7 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import React from 'react';
4
4
  import { mount } from 'enzyme';
5
- import { Button, Tooltip, GeistProvider } from 'components';
5
+ import { Button, Tooltip, UiProvider } from 'components';
6
6
  import { nativeEvent, updateWrapper } from 'tests/utils';
7
7
  import { act } from 'react-dom/test-utils';
8
8
  var expectTooltipIsShow = function expectTooltipIsShow(wrapper) {
@@ -14,10 +14,10 @@ var expectTooltipIsHidden = function expectTooltipIsHidden(wrapper) {
14
14
  describe('Tooltip', function () {
15
15
  it('should render correctly', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
16
16
  var wrapper;
17
- return _regeneratorRuntime.wrap(function _callee$(_context) {
17
+ return _regeneratorRuntime.wrap(function (_context) {
18
18
  while (1) switch (_context.prev = _context.next) {
19
19
  case 0:
20
- wrapper = mount(/*#__PURE__*/React.createElement(GeistProvider, {
20
+ wrapper = mount(/*#__PURE__*/React.createElement(UiProvider, {
21
21
  themeType: "dark"
22
22
  }, /*#__PURE__*/React.createElement(Tooltip, {
23
23
  text: /*#__PURE__*/React.createElement("p", {
@@ -26,20 +26,20 @@ describe('Tooltip', function () {
26
26
  }, "some tips")));
27
27
  expectTooltipIsHidden(wrapper);
28
28
  wrapper.find('.tooltip').simulate('mouseEnter', nativeEvent);
29
- _context.next = 5;
29
+ _context.next = 1;
30
30
  return updateWrapper(wrapper, 150);
31
- case 5:
31
+ case 1:
32
32
  wrapper.find('#test').simulate('click', nativeEvent);
33
33
  expectTooltipIsShow(wrapper);
34
- _context.next = 9;
34
+ _context.next = 2;
35
35
  return updateWrapper(wrapper, 150);
36
- case 9:
36
+ case 2:
37
37
  wrapper.find('.tooltip').simulate('mouseLeave', nativeEvent);
38
- _context.next = 12;
38
+ _context.next = 3;
39
39
  return updateWrapper(wrapper, 350);
40
- case 12:
40
+ case 3:
41
41
  expectTooltipIsHidden(wrapper);
42
- case 13:
42
+ case 4:
43
43
  case "end":
44
44
  return _context.stop();
45
45
  }
@@ -47,23 +47,23 @@ describe('Tooltip', function () {
47
47
  })));
48
48
  it('should render text when hover it', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
49
49
  var wrapper;
50
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
50
+ return _regeneratorRuntime.wrap(function (_context2) {
51
51
  while (1) switch (_context2.prev = _context2.next) {
52
52
  case 0:
53
53
  wrapper = mount(/*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Tooltip, {
54
54
  text: "some text"
55
55
  }, "some tips")));
56
56
  wrapper.find('.tooltip').simulate('mouseEnter', nativeEvent);
57
- _context2.next = 4;
57
+ _context2.next = 1;
58
58
  return updateWrapper(wrapper, 350);
59
- case 4:
59
+ case 1:
60
60
  expectTooltipIsShow(wrapper);
61
61
  wrapper.find('.tooltip').simulate('mouseLeave', nativeEvent);
62
- _context2.next = 8;
62
+ _context2.next = 2;
63
63
  return updateWrapper(wrapper, 350);
64
- case 8:
64
+ case 2:
65
65
  expectTooltipIsHidden(wrapper);
66
- case 9:
66
+ case 3:
67
67
  case "end":
68
68
  return _context2.stop();
69
69
  }
@@ -71,7 +71,7 @@ describe('Tooltip', function () {
71
71
  })));
72
72
  it('should render react-node when click it', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
73
73
  var wrapper, testNode;
74
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
74
+ return _regeneratorRuntime.wrap(function (_context3) {
75
75
  while (1) switch (_context3.prev = _context3.next) {
76
76
  case 0:
77
77
  wrapper = mount(/*#__PURE__*/React.createElement(Tooltip, {
@@ -81,9 +81,9 @@ describe('Tooltip', function () {
81
81
  trigger: "click"
82
82
  }, /*#__PURE__*/React.createElement("span", null, "click me")));
83
83
  wrapper.find('.tooltip').simulate('click', nativeEvent);
84
- _context3.next = 4;
84
+ _context3.next = 1;
85
85
  return updateWrapper(wrapper, 150);
86
- case 4:
86
+ case 1:
87
87
  expectTooltipIsShow(wrapper);
88
88
  testNode = wrapper.find('#test');
89
89
  expect(testNode.length).not.toBe(0);
@@ -95,11 +95,11 @@ describe('Tooltip', function () {
95
95
  cancelable: true
96
96
  }));
97
97
  });
98
- _context3.next = 11;
98
+ _context3.next = 2;
99
99
  return updateWrapper(wrapper, 150);
100
- case 11:
100
+ case 2:
101
101
  expectTooltipIsHidden(wrapper);
102
- case 12:
102
+ case 3:
103
103
  case "end":
104
104
  return _context3.stop();
105
105
  }
@@ -107,7 +107,7 @@ describe('Tooltip', function () {
107
107
  })));
108
108
  it('should render inner components', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
109
109
  var wrapper;
110
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
110
+ return _regeneratorRuntime.wrap(function (_context4) {
111
111
  while (1) switch (_context4.prev = _context4.next) {
112
112
  case 0:
113
113
  wrapper = mount(/*#__PURE__*/React.createElement(Tooltip, {
@@ -118,7 +118,7 @@ describe('Tooltip', function () {
118
118
  id: "test"
119
119
  }, "button")));
120
120
  expect(wrapper.find('#test').length).not.toBe(0);
121
- case 2:
121
+ case 1:
122
122
  case "end":
123
123
  return _context4.stop();
124
124
  }
@@ -126,7 +126,7 @@ describe('Tooltip', function () {
126
126
  })));
127
127
  it('should render correctly by visible', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
128
128
  var wrapper;
129
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
129
+ return _regeneratorRuntime.wrap(function (_context5) {
130
130
  while (1) switch (_context5.prev = _context5.next) {
131
131
  case 0:
132
132
  wrapper = mount(/*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Tooltip, {
@@ -136,11 +136,11 @@ describe('Tooltip', function () {
136
136
  visible: true,
137
137
  placement: "rightEnd"
138
138
  }, "some tips")));
139
- _context5.next = 3;
139
+ _context5.next = 1;
140
140
  return updateWrapper(wrapper, 150);
141
- case 3:
141
+ case 1:
142
142
  expect(wrapper.find('#visible').length).toBe(1);
143
- case 4:
143
+ case 2:
144
144
  case "end":
145
145
  return _context5.stop();
146
146
  }
@@ -148,7 +148,7 @@ describe('Tooltip', function () {
148
148
  })));
149
149
  it('should render correctly by using wrong placement', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
150
150
  var wrapper;
151
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
151
+ return _regeneratorRuntime.wrap(function (_context6) {
152
152
  while (1) switch (_context6.prev = _context6.next) {
153
153
  case 0:
154
154
  wrapper = mount(/*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Tooltip, {
@@ -159,7 +159,7 @@ describe('Tooltip', function () {
159
159
  placement: 'test'
160
160
  }, "some tips")));
161
161
  expect(wrapper.find('#initial-visible').length).toBe(1);
162
- case 2:
162
+ case 1:
163
163
  case "end":
164
164
  return _context6.stop();
165
165
  }
@@ -9,7 +9,7 @@ export declare const setChildrenProps: (children: ReactNode | undefined, props:
9
9
  export declare const setChildrenIndex: (children: ReactNode | undefined, targetComponents?: Array<React.ElementType>) => ReactNode | undefined;
10
10
  export declare const getReactNode: (node?: React.ReactNode | (() => React.ReactNode)) => React.ReactNode;
11
11
  export declare const isChildElement: (parent: Element | null | undefined, child: Element | null | undefined) => boolean;
12
- export declare const isGeistElement: (el?: HTMLElement) => boolean;
12
+ export declare const isUiElement: (el?: HTMLElement) => boolean;
13
13
  export declare const isBrowser: () => boolean;
14
14
  export declare const isMac: () => boolean;
15
15
  export declare const isCSSNumberValue: (value?: string | number) => boolean;