@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.
- package/dist/Placeholder/index.js +37 -16
- package/dist/auto-complete/index.js +37 -15
- package/dist/avatar/avatar.d.ts +2 -1
- package/dist/avatar/index.js +33 -13
- package/dist/badge/index.js +30 -11
- package/dist/breadcrumbs/index.js +30 -11
- package/dist/button/index.js +32 -12
- package/dist/button-dropdown/index.js +30 -11
- package/dist/button-group/index.js +30 -11
- package/dist/capacity/index.js +30 -11
- package/dist/card/index.js +30 -11
- package/dist/checkbox/index.js +30 -11
- package/dist/code/index.js +30 -11
- package/dist/col/index.js +21 -2
- package/dist/collapse/index.js +30 -11
- package/dist/css-baseline/index.js +24 -5
- package/dist/description/index.js +30 -11
- package/dist/display/index.js +30 -11
- package/dist/divider/index.js +30 -11
- package/dist/dot/index.js +30 -11
- package/dist/drawer/index.js +30 -11
- package/dist/fieldset/index.js +30 -11
- package/dist/grid/grid-container.d.ts +3 -3
- package/dist/grid/grid.d.ts +3 -3
- package/dist/grid/index.js +30 -11
- package/dist/image/index.js +30 -11
- package/dist/index.d.ts +3 -3
- package/dist/index.js +10950 -1486
- package/dist/input/index.js +34 -13
- package/dist/keyboard/index.js +30 -11
- package/dist/link/index.js +30 -11
- package/dist/list/index.d.ts +9 -0
- package/dist/list/index.js +1287 -0
- package/dist/list/list-item.d.ts +53 -0
- package/dist/list/list.d.ts +44 -0
- package/dist/loading/index.js +30 -11
- package/dist/menu/index.d.ts +2 -0
- package/dist/menu/index.js +10354 -0
- package/dist/menu/menu.d.ts +9 -0
- package/dist/modal/index.js +34 -13
- package/dist/note/index.js +30 -11
- package/dist/page/index.js +30 -11
- package/dist/pagination/index.js +30 -11
- package/dist/popover/index.js +30 -11
- package/dist/progress/index.js +30 -11
- package/dist/radio/index.js +30 -11
- package/dist/rating/index.js +30 -11
- package/dist/row/index.js +21 -2
- package/dist/search-bar/index.js +31 -12
- package/dist/select/index.js +30 -11
- package/dist/slider/index.js +30 -11
- package/dist/snippet/index.js +30 -11
- package/dist/spacer/index.js +30 -11
- package/dist/spinner/index.js +30 -11
- package/dist/table/index.d.ts +0 -1
- package/dist/table/index.js +1663 -2242
- package/dist/tabs/index.js +30 -11
- package/dist/tag/index.js +30 -11
- package/dist/text/index.js +37 -16
- package/dist/text/text.d.ts +1 -0
- package/dist/textarea/index.js +30 -11
- package/dist/toggle/index.js +30 -11
- package/dist/tooltip/index.js +30 -11
- package/dist/tree/index.js +21 -2
- package/dist/ui-provider/index.js +32 -12
- package/dist/use-scale/index.js +9 -9
- package/dist/user/index.js +33 -13
- package/esm/auto-complete/auto-complete.js +3 -2
- package/esm/avatar/avatar.d.ts +2 -1
- package/esm/avatar/avatar.js +3 -2
- package/esm/button/button.js +2 -1
- package/esm/code-block/index.js +17 -12
- package/esm/css-baseline/css-baseline.js +3 -3
- package/esm/form/FormWrapper.js +4 -4
- package/esm/grid/grid-container.d.ts +3 -3
- package/esm/grid/grid.d.ts +3 -3
- package/esm/index.d.ts +3 -3
- package/esm/index.js +3 -3
- package/esm/input/input.js +2 -1
- package/esm/input/password.js +2 -1
- package/esm/link/link.js +2 -2
- package/esm/list/index.d.ts +9 -0
- package/esm/list/index.js +8 -0
- package/esm/list/list-item.d.ts +53 -0
- package/esm/list/list-item.js +84 -0
- package/esm/list/list.d.ts +44 -0
- package/esm/list/list.js +29 -0
- package/esm/login-with/LoginSocialApple/index.js +17 -17
- package/esm/login-with/LoginSocialGithub/index.js +2 -2
- package/esm/login-with/LoginSocialInstagram/index.js +2 -2
- package/esm/login-with/LoginSocialLinkedin/index.js +2 -2
- package/esm/login-with/LoginSocialMicrosoft/index.js +2 -2
- package/esm/login-with/LoginSocialPinterest/index.js +9 -9
- package/esm/login-with/LoginSocialTiktok/index.js +2 -2
- package/esm/login-with/LoginSocialTwitter/index.js +11 -11
- package/esm/menu/index.d.ts +2 -0
- package/esm/menu/index.js +2 -0
- package/esm/menu/menu.d.ts +9 -0
- package/esm/menu/menu.js +92 -0
- package/esm/modal/modal-action.js +2 -1
- package/esm/table/index.d.ts +0 -1
- package/esm/table/index.js +0 -1
- package/esm/table/table-body.js +4 -23
- package/esm/text/child.js +3 -3
- package/esm/text/text.d.ts +1 -0
- package/esm/text/text.js +4 -2
- package/esm/tooltip/__test__/index.test.js +28 -28
- package/package.json +15 -11
- package/dist/cart/index.d.ts +0 -72
- package/dist/cart/useLocalStorage.d.ts +0 -1
- package/dist/table/data-table.d.ts +0 -44
- package/esm/cart/index.d.ts +0 -72
- package/esm/cart/index.js +0 -265
- package/esm/cart/useLocalStorage.d.ts +0 -1
- package/esm/cart/useLocalStorage.js +0 -29
- package/esm/table/data-table.d.ts +0 -44
- package/esm/table/data-table.js +0 -451
package/esm/table/table-body.js
CHANGED
|
@@ -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 '
|
|
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
|
-
|
|
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)
|
|
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/text/child.js
CHANGED
|
@@ -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([["
|
|
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: "
|
|
67
|
+
id: "2277774325",
|
|
68
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'), ";}")));
|
|
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;
|
package/esm/text/text.d.ts
CHANGED
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
|
};
|
|
@@ -14,7 +14,7 @@ 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
|
|
17
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
18
18
|
while (1) switch (_context.prev = _context.next) {
|
|
19
19
|
case 0:
|
|
20
20
|
wrapper = mount(/*#__PURE__*/React.createElement(UiProvider, {
|
|
@@ -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 =
|
|
29
|
+
_context.next = 1;
|
|
30
30
|
return updateWrapper(wrapper, 150);
|
|
31
|
-
case
|
|
31
|
+
case 1:
|
|
32
32
|
wrapper.find('#test').simulate('click', nativeEvent);
|
|
33
33
|
expectTooltipIsShow(wrapper);
|
|
34
|
-
_context.next =
|
|
34
|
+
_context.next = 2;
|
|
35
35
|
return updateWrapper(wrapper, 150);
|
|
36
|
-
case
|
|
36
|
+
case 2:
|
|
37
37
|
wrapper.find('.tooltip').simulate('mouseLeave', nativeEvent);
|
|
38
|
-
_context.next =
|
|
38
|
+
_context.next = 3;
|
|
39
39
|
return updateWrapper(wrapper, 350);
|
|
40
|
-
case
|
|
40
|
+
case 3:
|
|
41
41
|
expectTooltipIsHidden(wrapper);
|
|
42
|
-
case
|
|
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
|
|
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 =
|
|
57
|
+
_context2.next = 1;
|
|
58
58
|
return updateWrapper(wrapper, 350);
|
|
59
|
-
case
|
|
59
|
+
case 1:
|
|
60
60
|
expectTooltipIsShow(wrapper);
|
|
61
61
|
wrapper.find('.tooltip').simulate('mouseLeave', nativeEvent);
|
|
62
|
-
_context2.next =
|
|
62
|
+
_context2.next = 2;
|
|
63
63
|
return updateWrapper(wrapper, 350);
|
|
64
|
-
case
|
|
64
|
+
case 2:
|
|
65
65
|
expectTooltipIsHidden(wrapper);
|
|
66
|
-
case
|
|
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
|
|
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 =
|
|
84
|
+
_context3.next = 1;
|
|
85
85
|
return updateWrapper(wrapper, 150);
|
|
86
|
-
case
|
|
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 =
|
|
98
|
+
_context3.next = 2;
|
|
99
99
|
return updateWrapper(wrapper, 150);
|
|
100
|
-
case
|
|
100
|
+
case 2:
|
|
101
101
|
expectTooltipIsHidden(wrapper);
|
|
102
|
-
case
|
|
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
|
|
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
|
|
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
|
|
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 =
|
|
139
|
+
_context5.next = 1;
|
|
140
140
|
return updateWrapper(wrapper, 150);
|
|
141
|
-
case
|
|
141
|
+
case 1:
|
|
142
142
|
expect(wrapper.find('#visible').length).toBe(1);
|
|
143
|
-
case
|
|
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
|
|
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
|
|
162
|
+
case 1:
|
|
163
163
|
case "end":
|
|
164
164
|
return _context6.stop();
|
|
165
165
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helpdice/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "esm/index.d.ts",
|
|
6
6
|
"unpkg": "dist/index.min.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"start": "next start",
|
|
9
9
|
"dev": "next dev",
|
|
10
|
-
"
|
|
10
|
+
"build": "next build",
|
|
11
11
|
"docs:dev": "yarn docs:collect && next dev",
|
|
12
12
|
"docs:collect": "node scripts/collect-meta.js",
|
|
13
13
|
"docs:seeds": "node scripts/seeds/update.js",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"build:babel": "babel --no-babelrc --config-file ./scripts/babel.config.js --extensions \".js,.ts,.tsx\" ./components --out-dir ./esm --ignore \"**/__tests__/**/*,**/*.d.ts\"",
|
|
24
24
|
"build:after": "node scripts/move-built-in.js",
|
|
25
25
|
"build:types": "tsc -p ./scripts & tsc -p ./scripts --outDir ./esm",
|
|
26
|
-
"build": "yarn build:rollup && yarn build:babel && yarn build:types && yarn build:after",
|
|
27
|
-
"release": "yarn
|
|
26
|
+
"build:package": "yarn build:rollup && yarn build:babel && yarn build:types && yarn build:after",
|
|
27
|
+
"release": "yarn publish --access public --non-interactive"
|
|
28
28
|
},
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"description": "Modern React UI library.",
|
|
@@ -50,11 +50,13 @@
|
|
|
50
50
|
],
|
|
51
51
|
"sideEffects": false,
|
|
52
52
|
"devDependencies": {
|
|
53
|
+
"@babel/core": "7.27.4",
|
|
53
54
|
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
|
|
54
55
|
"@babel/plugin-transform-runtime": "^7.14.5",
|
|
55
56
|
"@babel/preset-env": "^7.14.7",
|
|
56
57
|
"@babel/preset-react": "^7.14.5",
|
|
57
58
|
"@babel/preset-typescript": "^7.14.5",
|
|
59
|
+
"@helpdice/pro": "file:../pro/build",
|
|
58
60
|
"@mapbox/rehype-prism": "^0.9.0",
|
|
59
61
|
"@mdx-js/loader": "^3.1.0",
|
|
60
62
|
"@mdx-js/react": "^3.1.0",
|
|
@@ -65,7 +67,7 @@
|
|
|
65
67
|
"@rollup/plugin-node-resolve": "16.0.0",
|
|
66
68
|
"@types/enzyme": "^3.10.18",
|
|
67
69
|
"@types/lodash": "^4.17.15",
|
|
68
|
-
"@types/react": "~18.3.
|
|
70
|
+
"@types/react": "~18.3.1",
|
|
69
71
|
"@types/react-color": "^3.0.13",
|
|
70
72
|
"@types/react-dom": "~18.3.1",
|
|
71
73
|
"@types/react-html-parser": "^2.0.6",
|
|
@@ -84,11 +86,10 @@
|
|
|
84
86
|
"just-debounce-it": "^3.2.0",
|
|
85
87
|
"next": "^15.1.7",
|
|
86
88
|
"prettier": "^3.4.2",
|
|
87
|
-
"react": "
|
|
89
|
+
"react": "^18.3.1",
|
|
88
90
|
"react-color": "^2.19.3",
|
|
89
|
-
"react-dom": "
|
|
91
|
+
"react-dom": "^18.3.1",
|
|
90
92
|
"react-live": "^4.1.8",
|
|
91
|
-
"rehype-join-line": "^1.0.2",
|
|
92
93
|
"rollup": "^4.32.1",
|
|
93
94
|
"styled-jsx": "^5.1.6",
|
|
94
95
|
"typescript": "^5.7.3",
|
|
@@ -96,13 +97,16 @@
|
|
|
96
97
|
"yup": "^1.6.1"
|
|
97
98
|
},
|
|
98
99
|
"dependencies": {
|
|
100
|
+
"@floating-ui/react-dom": "^2.1.3",
|
|
99
101
|
"@helpdice/icons": "^1.1.2",
|
|
102
|
+
"@mapbox/rehype-prism": "^0.9.0",
|
|
100
103
|
"@types/hoist-non-react-statics": "^3.3.6",
|
|
101
104
|
"@types/styled-components": "^5.1.34",
|
|
102
105
|
"babel-plugin-transform-rename-import": "^2.3.0",
|
|
103
106
|
"clsx": "^2.1.1",
|
|
104
107
|
"deepmerge": "^4.3.1",
|
|
105
108
|
"dompurify": "^3.2.4",
|
|
109
|
+
"framer-motion": "^12.17.0",
|
|
106
110
|
"fuse.js": "^7.1.0",
|
|
107
111
|
"hoist-non-react-statics": "^3.3.2",
|
|
108
112
|
"lodash": "^4.17.21",
|
|
@@ -111,16 +115,16 @@
|
|
|
111
115
|
"polished": "^4.3.1",
|
|
112
116
|
"react-fast-compare": "^3.2.2",
|
|
113
117
|
"react-is": "^19.0.0",
|
|
114
|
-
"react-syntax-highlighter": "^15.6.1",
|
|
115
118
|
"react-transition-group": "^4.4.5",
|
|
119
|
+
"rehype-join-line": "^1.0.2",
|
|
116
120
|
"rollup-plugin-local-resolve": "^1.0.7",
|
|
117
121
|
"styled-components": "^6.1.14",
|
|
118
122
|
"tiny-warning": "^1.0.3",
|
|
119
123
|
"tslib": "^2.8.1"
|
|
120
124
|
},
|
|
121
125
|
"peerDependencies": {
|
|
122
|
-
"react": "
|
|
123
|
-
"react-dom": "
|
|
126
|
+
"react": "^18.3.1",
|
|
127
|
+
"react-dom": "^18.3.1"
|
|
124
128
|
},
|
|
125
129
|
"jest": {
|
|
126
130
|
"globals": {
|
package/dist/cart/index.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export interface Item {
|
|
3
|
-
id: string;
|
|
4
|
-
price: number;
|
|
5
|
-
quantity?: number;
|
|
6
|
-
itemTotal?: number;
|
|
7
|
-
[key: string]: any;
|
|
8
|
-
}
|
|
9
|
-
export interface InitialState {
|
|
10
|
-
id: string;
|
|
11
|
-
items: Item[];
|
|
12
|
-
isEmpty: boolean;
|
|
13
|
-
totalItems: number;
|
|
14
|
-
totalUniqueItems: number;
|
|
15
|
-
cartTotal: number;
|
|
16
|
-
metadata?: Metadata;
|
|
17
|
-
}
|
|
18
|
-
export interface Metadata {
|
|
19
|
-
[key: string]: any;
|
|
20
|
-
}
|
|
21
|
-
export interface CartProviderState extends InitialState {
|
|
22
|
-
addItem: (item: Item, quantity?: number) => void;
|
|
23
|
-
removeItem: (id: Item["id"]) => void;
|
|
24
|
-
updateItem: (id: Item["id"], payload: object) => void;
|
|
25
|
-
setItems: (items: Item[]) => void;
|
|
26
|
-
updateItemQuantity: (id: Item["id"], quantity: number) => void;
|
|
27
|
-
emptyCart: () => void;
|
|
28
|
-
getItem: (id: Item["id"]) => any | undefined;
|
|
29
|
-
inCart: (id: Item["id"]) => boolean;
|
|
30
|
-
clearCartMetadata: () => void;
|
|
31
|
-
setCartMetadata: (metadata: Metadata) => void;
|
|
32
|
-
updateCartMetadata: (metadata: Metadata) => void;
|
|
33
|
-
}
|
|
34
|
-
export type Actions = {
|
|
35
|
-
type: "SET_ITEMS";
|
|
36
|
-
payload: Item[];
|
|
37
|
-
} | {
|
|
38
|
-
type: "ADD_ITEM";
|
|
39
|
-
payload: Item;
|
|
40
|
-
} | {
|
|
41
|
-
type: "REMOVE_ITEM";
|
|
42
|
-
id: Item["id"];
|
|
43
|
-
} | {
|
|
44
|
-
type: "UPDATE_ITEM";
|
|
45
|
-
id: Item["id"];
|
|
46
|
-
payload: object;
|
|
47
|
-
} | {
|
|
48
|
-
type: "EMPTY_CART";
|
|
49
|
-
} | {
|
|
50
|
-
type: "CLEAR_CART_META";
|
|
51
|
-
} | {
|
|
52
|
-
type: "SET_CART_META";
|
|
53
|
-
payload: Metadata;
|
|
54
|
-
} | {
|
|
55
|
-
type: "UPDATE_CART_META";
|
|
56
|
-
payload: Metadata;
|
|
57
|
-
};
|
|
58
|
-
export declare const initialState: any;
|
|
59
|
-
export declare const createCartIdentifier: (len?: number) => string;
|
|
60
|
-
export declare const useCart: () => CartProviderState;
|
|
61
|
-
export declare const CartProvider: React.FC<{
|
|
62
|
-
children?: React.ReactNode;
|
|
63
|
-
id?: string;
|
|
64
|
-
defaultItems?: Item[];
|
|
65
|
-
onSetItems?: (items: Item[]) => void;
|
|
66
|
-
onItemAdd?: (payload: Item) => void;
|
|
67
|
-
onItemUpdate?: (payload: object) => void;
|
|
68
|
-
onItemRemove?: (id: Item["id"]) => void;
|
|
69
|
-
onEmptyCart?: () => void;
|
|
70
|
-
storage?: (key: string, initialValue: string) => [string, (value: Function | string) => void];
|
|
71
|
-
metadata?: Metadata;
|
|
72
|
-
}>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function useLocalStorage(key: string, initialValue: string): [string, (value: Function | string) => void];
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type DataTableProps = {
|
|
3
|
-
cols: any[];
|
|
4
|
-
rows: any[];
|
|
5
|
-
readOnly?: boolean;
|
|
6
|
-
loading?: boolean;
|
|
7
|
-
heading?: never[];
|
|
8
|
-
filter?: boolean;
|
|
9
|
-
menu?: never;
|
|
10
|
-
sideMenu?: boolean;
|
|
11
|
-
style?: object;
|
|
12
|
-
children?: React.ReactNode;
|
|
13
|
-
stickyHeader?: boolean;
|
|
14
|
-
hasMore?: boolean;
|
|
15
|
-
nextFn?: () => void;
|
|
16
|
-
onBack?: () => void;
|
|
17
|
-
infiniteLoader?: React.ReactNode;
|
|
18
|
-
endMessage?: React.ReactNode;
|
|
19
|
-
onRefresh?: () => void;
|
|
20
|
-
onFilters?: (filters: object) => void;
|
|
21
|
-
onSelectedDelete?: (selected: never[]) => void;
|
|
22
|
-
onSelectedEdit?: (selected: never) => void;
|
|
23
|
-
onSelected?: (selected: any) => void;
|
|
24
|
-
disableViewColumn?: boolean;
|
|
25
|
-
rowDraggable?: boolean;
|
|
26
|
-
onDragOver?: () => void;
|
|
27
|
-
onDragEnter?: () => void;
|
|
28
|
-
onDragLeave?: () => void;
|
|
29
|
-
onDrop?: () => void;
|
|
30
|
-
onRowClick?: (row: any) => void;
|
|
31
|
-
disableMenu?: boolean;
|
|
32
|
-
dataLength?: number;
|
|
33
|
-
viewLength?: number;
|
|
34
|
-
onPageChange?: (page: number, start: number, end: number) => void;
|
|
35
|
-
cursorPagination?: boolean;
|
|
36
|
-
previousCursor?: string;
|
|
37
|
-
nextCursor?: string;
|
|
38
|
-
onNextPage?: (next?: string) => void;
|
|
39
|
-
onPreviousPage?: (prev?: string) => void;
|
|
40
|
-
};
|
|
41
|
-
declare function DataTable({ cols, rows, readOnly, heading, filter, menu, sideMenu, style, children, onBack, onRefresh, // Function
|
|
42
|
-
onFilters, onSelectedDelete, onSelectedEdit, onSelected, disableViewColumn, rowDraggable, onDragOver, onDragEnter, onDragLeave, onDrop, onRowClick, dataLength, viewLength, onPageChange, disableMenu, cursorPagination, previousCursor, nextCursor, hasMore, stickyHeader, onNextPage, onPreviousPage, }: DataTableProps): React.JSX.Element;
|
|
43
|
-
declare const _default: React.MemoExoticComponent<typeof DataTable>;
|
|
44
|
-
export default _default;
|
package/esm/cart/index.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export interface Item {
|
|
3
|
-
id: string;
|
|
4
|
-
price: number;
|
|
5
|
-
quantity?: number;
|
|
6
|
-
itemTotal?: number;
|
|
7
|
-
[key: string]: any;
|
|
8
|
-
}
|
|
9
|
-
export interface InitialState {
|
|
10
|
-
id: string;
|
|
11
|
-
items: Item[];
|
|
12
|
-
isEmpty: boolean;
|
|
13
|
-
totalItems: number;
|
|
14
|
-
totalUniqueItems: number;
|
|
15
|
-
cartTotal: number;
|
|
16
|
-
metadata?: Metadata;
|
|
17
|
-
}
|
|
18
|
-
export interface Metadata {
|
|
19
|
-
[key: string]: any;
|
|
20
|
-
}
|
|
21
|
-
export interface CartProviderState extends InitialState {
|
|
22
|
-
addItem: (item: Item, quantity?: number) => void;
|
|
23
|
-
removeItem: (id: Item["id"]) => void;
|
|
24
|
-
updateItem: (id: Item["id"], payload: object) => void;
|
|
25
|
-
setItems: (items: Item[]) => void;
|
|
26
|
-
updateItemQuantity: (id: Item["id"], quantity: number) => void;
|
|
27
|
-
emptyCart: () => void;
|
|
28
|
-
getItem: (id: Item["id"]) => any | undefined;
|
|
29
|
-
inCart: (id: Item["id"]) => boolean;
|
|
30
|
-
clearCartMetadata: () => void;
|
|
31
|
-
setCartMetadata: (metadata: Metadata) => void;
|
|
32
|
-
updateCartMetadata: (metadata: Metadata) => void;
|
|
33
|
-
}
|
|
34
|
-
export type Actions = {
|
|
35
|
-
type: "SET_ITEMS";
|
|
36
|
-
payload: Item[];
|
|
37
|
-
} | {
|
|
38
|
-
type: "ADD_ITEM";
|
|
39
|
-
payload: Item;
|
|
40
|
-
} | {
|
|
41
|
-
type: "REMOVE_ITEM";
|
|
42
|
-
id: Item["id"];
|
|
43
|
-
} | {
|
|
44
|
-
type: "UPDATE_ITEM";
|
|
45
|
-
id: Item["id"];
|
|
46
|
-
payload: object;
|
|
47
|
-
} | {
|
|
48
|
-
type: "EMPTY_CART";
|
|
49
|
-
} | {
|
|
50
|
-
type: "CLEAR_CART_META";
|
|
51
|
-
} | {
|
|
52
|
-
type: "SET_CART_META";
|
|
53
|
-
payload: Metadata;
|
|
54
|
-
} | {
|
|
55
|
-
type: "UPDATE_CART_META";
|
|
56
|
-
payload: Metadata;
|
|
57
|
-
};
|
|
58
|
-
export declare const initialState: any;
|
|
59
|
-
export declare const createCartIdentifier: (len?: number) => string;
|
|
60
|
-
export declare const useCart: () => CartProviderState;
|
|
61
|
-
export declare const CartProvider: React.FC<{
|
|
62
|
-
children?: React.ReactNode;
|
|
63
|
-
id?: string;
|
|
64
|
-
defaultItems?: Item[];
|
|
65
|
-
onSetItems?: (items: Item[]) => void;
|
|
66
|
-
onItemAdd?: (payload: Item) => void;
|
|
67
|
-
onItemUpdate?: (payload: object) => void;
|
|
68
|
-
onItemRemove?: (id: Item["id"]) => void;
|
|
69
|
-
onEmptyCart?: () => void;
|
|
70
|
-
storage?: (key: string, initialValue: string) => [string, (value: Function | string) => void];
|
|
71
|
-
metadata?: Metadata;
|
|
72
|
-
}>;
|