@helpdice/ui 2.3.3 → 2.3.6
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/avatar/avatar.d.ts +1 -0
- package/dist/avatar/index.js +3 -2
- package/dist/button/button.d.ts +2 -0
- package/dist/button/button.small.d.ts +17 -0
- package/dist/button/index.d.ts +8 -2
- package/dist/button/index.js +40 -27
- package/dist/carousal/index.js +66 -3
- package/dist/container/index.js +66 -3
- package/dist/copy-to-clipboard/index.js +66 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +46 -30
- package/dist/modal/index.js +9 -3
- package/dist/placeholder/index.js +66 -3
- package/dist/table/index.js +76 -4
- package/dist/text/index.js +66 -3
- package/dist/user/index.js +3 -2
- package/esm/avatar/avatar.d.ts +1 -0
- package/esm/avatar/avatar.js +3 -2
- package/esm/button/button.d.ts +2 -0
- package/esm/button/{button.compact.js → button.icon.js} +0 -21
- package/esm/button/button.js +9 -3
- package/esm/button/button.small.d.ts +17 -0
- package/esm/button/button.small.js +29 -0
- package/esm/button/index.d.ts +8 -2
- package/esm/button/index.js +4 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/table/table-cell.js +2 -1
- package/package.json +2 -2
- /package/dist/button/{button.compact.d.ts → button.icon.d.ts} +0 -0
- /package/esm/button/{button.compact.d.ts → button.icon.d.ts} +0 -0
|
@@ -4,8 +4,6 @@ import Button from './button';
|
|
|
4
4
|
import { useTheme } from '@helpdice/theme';
|
|
5
5
|
var CompactButton = function CompactButton(_ref) {
|
|
6
6
|
var _color = _ref.color,
|
|
7
|
-
_ref$to = _ref.to,
|
|
8
|
-
to = _ref$to === void 0 ? '/' : _ref$to,
|
|
9
7
|
children = _ref.children,
|
|
10
8
|
iconRight = _ref.iconRight,
|
|
11
9
|
icon = _ref.icon,
|
|
@@ -13,27 +11,8 @@ var CompactButton = function CompactButton(_ref) {
|
|
|
13
11
|
scale = _ref$scale === void 0 ? 2 / 3 : _ref$scale,
|
|
14
12
|
type = _ref.type,
|
|
15
13
|
style = _ref.style,
|
|
16
|
-
a = _ref.a,
|
|
17
|
-
_ref$target = _ref.target,
|
|
18
|
-
target = _ref$target === void 0 ? "_self" : _ref$target,
|
|
19
14
|
onClick = _ref.onClick;
|
|
20
15
|
var theme = useTheme();
|
|
21
|
-
if (a) {
|
|
22
|
-
return /*#__PURE__*/React.createElement(Button, {
|
|
23
|
-
icon: icon,
|
|
24
|
-
style: _extends({}, style, {
|
|
25
|
-
backgroundColor: theme.palette.background
|
|
26
|
-
}),
|
|
27
|
-
type: type,
|
|
28
|
-
onClick: function onClick() {
|
|
29
|
-
return window.open(to, target);
|
|
30
|
-
},
|
|
31
|
-
auto: true,
|
|
32
|
-
scale: scale,
|
|
33
|
-
px: 0.6,
|
|
34
|
-
iconRight: iconRight
|
|
35
|
-
}, children);
|
|
36
|
-
}
|
|
37
16
|
return /*#__PURE__*/React.createElement(Button, {
|
|
38
17
|
icon: icon,
|
|
39
18
|
style: _extends({}, style, {
|
package/esm/button/button.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
-
var _excluded = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
|
|
4
|
+
var _excluded = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "a", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
|
|
5
5
|
import _JSXStyle from "../styled-jsx.es.js";
|
|
6
6
|
/* "use client" */
|
|
7
7
|
|
|
@@ -52,6 +52,8 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
52
52
|
effect = _filteredProps$effect === void 0 ? true : _filteredProps$effect,
|
|
53
53
|
_filteredProps$round = filteredProps.round,
|
|
54
54
|
round = _filteredProps$round === void 0 ? false : _filteredProps$round,
|
|
55
|
+
_filteredProps$a = filteredProps.a,
|
|
56
|
+
a = _filteredProps$a === void 0 ? false : _filteredProps$a,
|
|
55
57
|
onClick = filteredProps.onClick,
|
|
56
58
|
_filteredProps$auto = filteredProps.auto,
|
|
57
59
|
auto = _filteredProps$auto === void 0 ? false : _filteredProps$auto,
|
|
@@ -156,7 +158,11 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
156
158
|
|
|
157
159
|
// If shadow provided is string then value other default
|
|
158
160
|
var btnShadow = typeof shadow === 'string' ? shadow : shadow ? theme.shadows.level.z2 : 'none';
|
|
159
|
-
return /*#__PURE__*/React.createElement("
|
|
161
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, a ? /*#__PURE__*/React.createElement("a", _extends({}, props, {
|
|
162
|
+
className: _JSXStyle.dynamic([["905110486", [SCALES.height(2.5), round ? '50%' : theme.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor, events, shadow ? btnShadow : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, btnShadow, shadow ? '-1px' : '0px']]]) + " " + (props && props.className != null && props.className || useClasses('btn', className) || "")
|
|
163
|
+
}), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
|
|
164
|
+
color: color
|
|
165
|
+
}), childrenWithIcon) : /*#__PURE__*/React.createElement("button", _extends({
|
|
160
166
|
ref: buttonRef,
|
|
161
167
|
type: type,
|
|
162
168
|
disabled: disabled,
|
|
@@ -170,7 +176,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
170
176
|
y: dripY,
|
|
171
177
|
color: dripColor,
|
|
172
178
|
onCompleted: dripCompletedHandle
|
|
173
|
-
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
179
|
+
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
174
180
|
id: "905110486",
|
|
175
181
|
dynamic: [SCALES.height(2.5), round ? '50%' : theme.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor, events, shadow ? btnShadow : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, btnShadow, shadow ? '-1px' : '0px']
|
|
176
182
|
}, ".btn.__jsx-style-dynamic-selector{box-sizing:border-box;display:inline-block;line-height:".concat(SCALES.height(2.5), ";border-radius:").concat(round ? '50%' : theme.layout.radius, ";font-weight:400;font-size:").concat(SCALES.font(0.875), ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;text-transform:capitalize;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;white-space:nowrap;-webkit-transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;position:relative;overflow:hidden;color:").concat(color, ";background-color:").concat(bg, ";border:1px solid ").concat(shadow ? 'transparent' : border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ? btnShadow : 'none', ";--helpdice-ui-button-icon-padding:").concat(SCALES.pl(0.727), ";--helpdice-ui-button-height:").concat(SCALES.height(2.5), ";--helpdice-ui-button-color:").concat(color, ";--helpdice-ui-button-bg:").concat(bg, ";min-width:").concat(auto ? 'min-content' : SCALES.width(10.5), ";width:").concat(auto ? 'auto' : 'initial', ";height:").concat(SCALES.height(2.5), ";padding:").concat(SCALES.pt(0), " ").concat(paddingRight, " ").concat(SCALES.pb(0), " ").concat(paddingLeft, ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.btn.__jsx-style-dynamic-selector:hover,.btn.__jsx-style-dynamic-selector:focus{color:").concat(hover.color, ";--helpdice-ui-button-color:").concat(hover.color, ";background-color:").concat(hover.bg, ";border-color:").concat(hover.border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(btnShadow, ";}.btn.__jsx-style-dynamic-selector .text{position:relative;z-index:1;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;text-align:center;line-height:inherit;top:-1px;}.btn.__jsx-style-dynamic-selector .text p,.btn.__jsx-style-dynamic-selector .text pre,.btn.__jsx-style-dynamic-selector .text div{margin:0;}.ripple.__jsx-style-dynamic-selector{position:absolute;border-radius:50%;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-animation:ripple-animation-__jsx-style-dynamic-selector 600ms ease-out;animation:ripple-animation-__jsx-style-dynamic-selector 600ms ease-out;background-color:rgba(0,0,0,0.3);pointer-events:none;z-index:1;}@-webkit-keyframes ripple-animation-__jsx-style-dynamic-selector{to{-webkit-transform:scale(2.5);-ms-transform:scale(2.5);transform:scale(2.5);opacity:0;}}@keyframes ripple-animation-__jsx-style-dynamic-selector{to{-webkit-transform:scale(2.5);-ms-transform:scale(2.5);transform:scale(2.5);opacity:0;}}")));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
import { ButtonTypes } from 'components/button-group';
|
|
3
|
+
type SmallButtonProps = {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
iconRight?: React.ReactNode;
|
|
6
|
+
to: string;
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
scale?: number;
|
|
9
|
+
type?: any;
|
|
10
|
+
style?: CSSProperties;
|
|
11
|
+
a?: boolean;
|
|
12
|
+
target?: string;
|
|
13
|
+
color?: ButtonTypes;
|
|
14
|
+
onClick?: () => void;
|
|
15
|
+
};
|
|
16
|
+
declare const _default: React.NamedExoticComponent<SmallButtonProps>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import React, { memo } from 'react';
|
|
3
|
+
import Button from './button';
|
|
4
|
+
import { useTheme } from '@helpdice/theme';
|
|
5
|
+
var SmallButton = function SmallButton(_ref) {
|
|
6
|
+
var _color = _ref.color,
|
|
7
|
+
children = _ref.children,
|
|
8
|
+
iconRight = _ref.iconRight,
|
|
9
|
+
icon = _ref.icon,
|
|
10
|
+
_ref$scale = _ref.scale,
|
|
11
|
+
scale = _ref$scale === void 0 ? 2 / 3 : _ref$scale,
|
|
12
|
+
type = _ref.type,
|
|
13
|
+
style = _ref.style,
|
|
14
|
+
onClick = _ref.onClick;
|
|
15
|
+
var theme = useTheme();
|
|
16
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
17
|
+
icon: icon,
|
|
18
|
+
style: _extends({}, style, {
|
|
19
|
+
backgroundColor: theme.palette.background
|
|
20
|
+
}),
|
|
21
|
+
type: type,
|
|
22
|
+
onClick: onClick,
|
|
23
|
+
auto: true,
|
|
24
|
+
scale: scale,
|
|
25
|
+
py: 0.6,
|
|
26
|
+
iconRight: iconRight
|
|
27
|
+
}, children);
|
|
28
|
+
};
|
|
29
|
+
export default /*#__PURE__*/memo(SmallButton);
|
package/esm/button/index.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import Button from './button';
|
|
2
|
-
|
|
2
|
+
import IconButton from './button.icon';
|
|
3
|
+
import SmallButton from './button.small';
|
|
3
4
|
export type { ButtonProps } from './button';
|
|
4
5
|
export type { ButtonTypes } from '../utils/prop-types';
|
|
5
|
-
export
|
|
6
|
+
export type ButtonComponentType = typeof Button & {
|
|
7
|
+
Icon: typeof IconButton;
|
|
8
|
+
Small: typeof SmallButton;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: ButtonComponentType;
|
|
11
|
+
export default _default;
|
package/esm/button/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/* "use client" */
|
|
2
2
|
|
|
3
3
|
import Button from './button';
|
|
4
|
-
|
|
4
|
+
import IconButton from './button.icon';
|
|
5
|
+
import SmallButton from './button.small';
|
|
6
|
+
Button.Icon = IconButton;
|
|
7
|
+
Button.Small = SmallButton;
|
|
5
8
|
export default Button;
|
package/esm/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { default as Badge } from './badge';
|
|
|
6
6
|
export type { BadgeProps, BadgeAnchorProps } from './badge';
|
|
7
7
|
export { default as Breadcrumbs } from './breadcrumbs';
|
|
8
8
|
export type { BreadcrumbsProps, BreadcrumbsItemProps, BreadcrumbsSeparatorProps, } from './breadcrumbs';
|
|
9
|
-
export { default as Button
|
|
9
|
+
export { default as Button } from './button';
|
|
10
10
|
export type { ButtonProps } from './button';
|
|
11
11
|
export { default as ButtonDropdown } from './button-dropdown';
|
|
12
12
|
export type { ButtonDropdownProps, ButtonDropdownItemProps } from './button-dropdown';
|
package/esm/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export { default as AutoComplete } from './auto-complete';
|
|
|
5
5
|
export { default as Avatar } from './avatar';
|
|
6
6
|
export { default as Badge } from './badge';
|
|
7
7
|
export { default as Breadcrumbs } from './breadcrumbs';
|
|
8
|
-
export { default as Button
|
|
8
|
+
export { default as Button } from './button';
|
|
9
9
|
export { default as ButtonDropdown } from './button-dropdown';
|
|
10
10
|
export { default as ButtonGroup } from './button-group';
|
|
11
11
|
export { default as Capacity } from './capacity';
|
package/esm/table/table-cell.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
2
3
|
import React from 'react';
|
|
3
4
|
var TableCell = function TableCell(_ref) {
|
|
4
5
|
var columns = _ref.columns,
|
|
@@ -10,7 +11,7 @@ var TableCell = function TableCell(_ref) {
|
|
|
10
11
|
return /*#__PURE__*/React.createElement(React.Fragment, null, columns.map(function (column, index) {
|
|
11
12
|
var _row$_id;
|
|
12
13
|
var currentRowValue = row[column.prop];
|
|
13
|
-
var cellValue = currentRowValue || emptyText;
|
|
14
|
+
var cellValue = _typeof(currentRowValue) === "object" ? currentRowValue === null || currentRowValue === void 0 ? void 0 : currentRowValue.value : currentRowValue || emptyText;
|
|
14
15
|
var shouldBeRenderElement = column.renderHandler(currentRowValue, row, rowIndex);
|
|
15
16
|
return /*#__PURE__*/React.createElement("td", {
|
|
16
17
|
style: _extends({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helpdice/ui",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.6",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "esm/index.d.ts",
|
|
6
6
|
"unpkg": "dist/index.min.js",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@helpdice/icons": "^1.2.5",
|
|
66
66
|
"@helpdice/sdk": "^0.4.3",
|
|
67
67
|
"@helpdice/utils": "^0.1.4",
|
|
68
|
-
"@helpdice/pro": "2.0
|
|
68
|
+
"@helpdice/pro": "2.1.0",
|
|
69
69
|
"@mapbox/rehype-prism": "^0.9.0",
|
|
70
70
|
"@mdx-js/loader": "^3.1.0",
|
|
71
71
|
"@mdx-js/react": "^3.1.0",
|
|
File without changes
|
|
File without changes
|