@helpdice/ui 1.6.7 → 1.6.9
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 +10 -10
- package/dist/auto-complete/auto-complete.d.ts +35 -3
- package/dist/auto-complete/index.js +8 -7
- package/dist/breadcrumbs/index.js +1 -1
- package/dist/button/button.compact.d.ts +2 -2
- package/dist/button/index.js +61 -61
- package/dist/button-dropdown/index.js +1 -1
- package/dist/card/index.js +1 -1
- package/dist/checkbox/index.js +1 -1
- package/dist/code-block/index.d.ts +10 -0
- package/dist/image/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1375 -1346
- package/dist/input/index.js +2 -2
- package/dist/link/index.js +1 -1
- package/dist/modal/index.js +3 -3
- package/dist/rating/index.js +1 -1
- package/dist/select/index.js +3 -3
- package/dist/snippet/index.js +1 -1
- package/dist/table/index.js +17 -17
- package/dist/tabs/index.js +2 -2
- package/dist/text/child.d.ts +1 -1
- package/dist/text/index.js +10 -10
- package/dist/text/text.d.ts +1 -1
- package/dist/ui-provider/index.js +2 -2
- package/dist/user/index.js +1 -1
- package/dist/utils/collections.d.ts +1 -1
- package/esm/auto-complete/auto-complete.d.ts +35 -3
- package/esm/auto-complete/auto-complete.js +3 -4
- package/esm/button/button-loading.js +1 -1
- package/esm/button/button.compact.d.ts +2 -2
- package/esm/button/button.compact.js +1 -1
- package/esm/button/styles.js +1 -1
- package/esm/button-dropdown/icon.js +1 -1
- package/esm/checkbox/checkbox.icon.js +1 -1
- package/esm/code-block/index.d.ts +10 -0
- package/esm/code-block/index.js +27 -28
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -1
- package/esm/input/input-block-label.js +1 -1
- package/esm/input/input-icon.js +1 -1
- package/esm/link/icon.js +1 -1
- package/esm/modal/modal-actions.js +1 -1
- package/esm/rating/rating-icon.js +1 -1
- package/esm/select/select-icon.js +1 -1
- package/esm/select/select-input.js +1 -1
- package/esm/select/select-multiple-value.js +1 -1
- package/esm/snippet/snippet-icon.js +1 -1
- package/esm/tabs/tabs.js +2 -2
- package/esm/text/child.d.ts +1 -1
- package/esm/text/child.js +10 -10
- package/esm/text/text.d.ts +1 -1
- package/esm/tooltip/__test__/index.test.js +2 -2
- package/esm/utils/collections.d.ts +1 -1
- package/esm/utils/collections.js +1 -1
- package/package.json +7 -4
- /package/esm/utils/use-context-state/{create-geist-context.js → create-ui-context.js} +0 -0
|
@@ -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 = '
|
|
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 = '
|
|
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 = '
|
|
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 = '
|
|
23
|
+
SnippetIconComponent.displayName = 'SnippetIcon';
|
|
24
24
|
var SnippetIcon = /*#__PURE__*/React.memo(SnippetIconComponent);
|
|
25
25
|
export default SnippetIcon;
|
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 {
|
|
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 (!
|
|
90
|
+
if (!isUiElement(event.target)) return;
|
|
91
91
|
setRect(event, function () {
|
|
92
92
|
return ref.current;
|
|
93
93
|
});
|
package/esm/text/child.d.ts
CHANGED
|
@@ -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
|
-
|
|
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", "
|
|
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$
|
|
26
|
-
|
|
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
|
|
39
|
-
return getTypeColor(
|
|
40
|
-
}, [
|
|
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([["
|
|
65
|
+
className: _JSXStyle.dynamic([["4133320328", [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: "
|
|
68
|
-
dynamic: [tag,
|
|
69
|
-
}, "".concat(tag, ".__jsx-style-dynamic-selector{color:").concat(
|
|
67
|
+
id: "4133320328",
|
|
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'), ";}")));
|
|
70
70
|
};
|
|
71
71
|
TextChild.displayName = 'TextChild';
|
|
72
72
|
export default TextChild;
|
package/esm/text/text.d.ts
CHANGED
|
@@ -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,
|
|
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) {
|
|
@@ -17,7 +17,7 @@ describe('Tooltip', function () {
|
|
|
17
17
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
18
18
|
while (1) switch (_context.prev = _context.next) {
|
|
19
19
|
case 0:
|
|
20
|
-
wrapper = mount(/*#__PURE__*/React.createElement(
|
|
20
|
+
wrapper = mount(/*#__PURE__*/React.createElement(UiProvider, {
|
|
21
21
|
themeType: "dark"
|
|
22
22
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
23
23
|
text: /*#__PURE__*/React.createElement("p", {
|
|
@@ -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
|
|
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;
|
package/esm/utils/collections.js
CHANGED
|
@@ -110,7 +110,7 @@ export var isChildElement = function isChildElement(parent, child) {
|
|
|
110
110
|
}
|
|
111
111
|
return false;
|
|
112
112
|
};
|
|
113
|
-
export var
|
|
113
|
+
export var isUiElement = function isUiElement(el) {
|
|
114
114
|
if (!el) return false;
|
|
115
115
|
if (el !== null && el !== void 0 && el.dataset && el !== null && el !== void 0 && el.dataset['helpdice']) return true;
|
|
116
116
|
el.attributes.getNamedItem('data-helpdice');
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helpdice/ui",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.9",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "esm/index.d.ts",
|
|
6
6
|
"unpkg": "dist/index.min.js",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"
|
|
9
|
-
"
|
|
8
|
+
"start": "next start",
|
|
9
|
+
"dev": "next dev",
|
|
10
|
+
"next": "next build",
|
|
11
|
+
"docs:dev": "yarn docs:collect && next dev",
|
|
10
12
|
"docs:collect": "node scripts/collect-meta.js",
|
|
11
13
|
"docs:seeds": "node scripts/seeds/update.js",
|
|
12
14
|
"docs:build": "yarn docs:collect & yarn docs:seeds && next build",
|
|
@@ -36,7 +38,7 @@
|
|
|
36
38
|
},
|
|
37
39
|
"prettier": "@helpdice/prettier-config",
|
|
38
40
|
"keywords": [
|
|
39
|
-
"
|
|
41
|
+
"iux",
|
|
40
42
|
"helpdice ui",
|
|
41
43
|
"components",
|
|
42
44
|
"react components",
|
|
@@ -105,6 +107,7 @@
|
|
|
105
107
|
"hoist-non-react-statics": "^3.3.2",
|
|
106
108
|
"lodash": "^4.17.21",
|
|
107
109
|
"lodash-es": "^4.17.21",
|
|
110
|
+
"next-sitemap": "^4.2.3",
|
|
108
111
|
"polished": "^4.3.1",
|
|
109
112
|
"react-fast-compare": "^3.2.2",
|
|
110
113
|
"react-is": "^19.0.0",
|
|
File without changes
|