@helpdice/ui 2.5.4 → 2.5.8
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/auto-complete/index.js +1273 -404
- package/dist/avatar/index.js +88 -49
- package/dist/badge/index.js +69 -27
- package/dist/breadcrumbs/index.js +107 -56
- package/dist/button/button.icon.d.ts +3 -16
- package/dist/button/button.small.d.ts +3 -16
- package/dist/button/index.js +143 -157
- package/dist/button-dropdown/index.js +96 -83
- package/dist/button-group/index.js +61 -21
- package/dist/capacity/index.js +61 -22
- package/dist/card/index.js +147 -123
- package/dist/carousal/index.js +349 -330
- package/dist/checkbox/index.js +72 -67
- package/dist/circular-progress/CircularProgress.d.ts +17 -0
- package/dist/circular-progress/index.d.ts +3 -4
- package/dist/circular-progress/index.js +713 -336
- package/dist/circular-progress/useCircularProgress.d.ts +12 -0
- package/dist/code/index.js +70 -26
- package/dist/col/index.js +61 -24
- package/dist/collapse/index.js +102 -52
- package/dist/container/index.js +187 -190
- package/dist/copy-to-clipboard/index.js +158 -210
- package/dist/description/index.js +64 -23
- package/dist/display/index.js +64 -23
- package/dist/divider/index.js +62 -22
- package/dist/dot/index.js +63 -23
- package/dist/drawer/index.js +74 -61
- package/dist/fieldset/index.js +127 -63
- package/dist/form/index.js +15 -40
- package/dist/grid/index.js +74 -29
- package/dist/html-renderer/index.js +3 -2
- package/dist/image/index.js +163 -104
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5240 -4755
- package/dist/input/index.js +1183 -277
- package/dist/keyboard/index.js +73 -29
- package/dist/linear-progress/index.js +27 -24
- package/dist/link/index.js +78 -36
- package/dist/list/index.js +118 -63
- package/dist/loadable/index.js +76 -27
- package/dist/loading/index.js +70 -29
- package/dist/menu/index.js +53 -47
- package/dist/modal/index.js +225 -178
- package/dist/note/index.js +64 -23
- package/dist/notetip/index.js +54 -45
- package/dist/notetip/note-tip.d.ts +2 -0
- package/dist/page/index.js +102 -51
- package/dist/pagination/index.js +181 -124
- package/dist/placeholder/index.js +554 -538
- package/dist/popover/index.js +94 -81
- package/dist/progress/index.js +66 -27
- package/dist/radio/index.js +94 -48
- package/dist/rating/index.js +78 -38
- package/dist/row/index.js +62 -25
- package/dist/search-bar/index.js +172 -162
- package/dist/select/index.js +1098 -163
- package/dist/select/select.d.ts +2 -0
- package/dist/slider/index.js +91 -47
- package/dist/snippet/index.js +39 -39
- package/dist/spacer/index.js +58 -19
- package/dist/spinner/index.js +69 -28
- package/dist/swipe/index.js +28 -13
- package/dist/table/index.js +4162 -3863
- package/dist/table/table-body.d.ts +4 -3
- package/dist/table/table-cell.d.ts +4 -2
- package/dist/table/table-types.d.ts +2 -0
- package/dist/table/table.d.ts +5 -1
- package/dist/tabs/index.js +61 -59
- package/dist/tag/index.js +16 -20
- package/dist/text/index.js +187 -184
- package/dist/text/text.d.ts +3 -0
- package/dist/textarea/index.js +916 -36
- package/dist/textarea/textarea.d.ts +3 -0
- package/dist/toggle/index.js +75 -33
- package/dist/tooltip/index.d.ts +1 -2
- package/dist/tooltip/index.js +59 -53
- package/dist/tooltip/tooltip-content.d.ts +1 -1
- package/dist/tooltip/tooltip-small.d.ts +2 -5
- package/dist/tooltip/tooltip.d.ts +2 -1
- package/dist/tree/index.js +176 -115
- package/dist/use-scale/index.js +50 -13
- package/dist/user/index.js +152 -100
- package/esm/avatar/avatar.js +8 -6
- package/esm/button/button.icon.d.ts +3 -16
- package/esm/button/button.icon.js +22 -22
- package/esm/button/button.js +5 -5
- package/esm/button/button.small.d.ts +3 -16
- package/esm/button/button.small.js +20 -23
- package/esm/circular-progress/CircularProgress.d.ts +17 -0
- package/esm/circular-progress/CircularProgress.js +110 -0
- package/esm/circular-progress/index.d.ts +3 -4
- package/esm/circular-progress/index.js +3 -4
- package/esm/circular-progress/useCircularProgress.d.ts +12 -0
- package/esm/circular-progress/useCircularProgress.js +35 -0
- package/esm/index.d.ts +2 -1
- package/esm/index.js +1 -1
- package/esm/input/input-field.js +11 -9
- package/esm/list/list-item.js +11 -11
- package/esm/notetip/note-tip.d.ts +2 -0
- package/esm/notetip/note-tip.js +8 -5
- package/esm/pagination/pagination-item.js +6 -6
- package/esm/select/select.d.ts +2 -0
- package/esm/select/select.js +15 -2
- package/esm/skeleton/index.js +9 -4
- package/esm/table/table-body.d.ts +4 -3
- package/esm/table/table-body.js +25 -15
- package/esm/table/table-cell.d.ts +4 -2
- package/esm/table/table-cell.js +19 -3
- package/esm/table/table-types.d.ts +2 -0
- package/esm/table/table.d.ts +5 -1
- package/esm/table/table.js +52 -25
- package/esm/text/text.d.ts +3 -0
- package/esm/text/text.js +9 -2
- package/esm/textarea/textarea.d.ts +3 -0
- package/esm/textarea/textarea.js +19 -2
- package/esm/tooltip/index.d.ts +1 -2
- package/esm/tooltip/tooltip-content.d.ts +1 -1
- package/esm/tooltip/tooltip-content.js +5 -5
- package/esm/tooltip/tooltip-small.d.ts +2 -5
- package/esm/tooltip/tooltip-small.js +0 -1
- package/esm/tooltip/tooltip.d.ts +2 -1
- package/esm/tooltip/tooltip.js +6 -5
- package/package.json +3 -3
- package/dist/circular-progress/CircularProgressbar.d.ts +0 -10
- package/dist/circular-progress/CircularProgressbarWithChildren.d.ts +0 -7
- package/dist/circular-progress/Path.d.ts +0 -9
- package/dist/circular-progress/buildStyles.d.ts +0 -12
- package/dist/circular-progress/constants.d.ts +0 -5
- package/dist/circular-progress/types.d.ts +0 -50
- package/esm/circular-progress/CircularProgressbar.d.ts +0 -10
- package/esm/circular-progress/CircularProgressbar.js +0 -118
- package/esm/circular-progress/CircularProgressbarWithChildren.d.ts +0 -7
- package/esm/circular-progress/CircularProgressbarWithChildren.js +0 -32
- package/esm/circular-progress/Path.d.ts +0 -9
- package/esm/circular-progress/Path.js +0 -52
- package/esm/circular-progress/buildStyles.d.ts +0 -12
- package/esm/circular-progress/buildStyles.js +0 -45
- package/esm/circular-progress/constants.d.ts +0 -5
- package/esm/circular-progress/constants.js +0 -5
- package/esm/circular-progress/types.d.ts +0 -50
- package/esm/circular-progress/types.js +0 -1
package/esm/skeleton/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
3
3
|
import _JSXStyle from "../styled-jsx.es.js";
|
|
4
4
|
/* "use client" */
|
|
5
5
|
|
|
6
|
+
import { useTheme } from '@helpdice/theme';
|
|
6
7
|
import React, { useState } from 'react';
|
|
7
8
|
var Skeleton = function Skeleton(_ref) {
|
|
8
9
|
var width = _ref.width,
|
|
@@ -13,6 +14,7 @@ var Skeleton = function Skeleton(_ref) {
|
|
|
13
14
|
duration = _ref.duration,
|
|
14
15
|
children = _ref.children,
|
|
15
16
|
loaded = _ref.loaded;
|
|
17
|
+
var theme = useTheme();
|
|
16
18
|
var _useState = useState(false),
|
|
17
19
|
_useState2 = _slicedToArray(_useState, 2),
|
|
18
20
|
isHidden = _useState2[0],
|
|
@@ -36,13 +38,16 @@ var Skeleton = function Skeleton(_ref) {
|
|
|
36
38
|
// }
|
|
37
39
|
// }
|
|
38
40
|
|
|
41
|
+
var lightGradient = "linear-gradient(90deg, rgba(211, 211, 211, 0) 0, rgba(211, 211, 211, 0.6) 70%, rgba(211, 211, 211, 0))";
|
|
42
|
+
var darkGradient = "linear-gradient(90deg, rgba(211, 211, 211, 0) 0, rgba(42, 40, 40, 0.6) 70%, rgba(211, 211, 211, 0))";
|
|
39
43
|
return /*#__PURE__*/React.createElement("div", {
|
|
40
|
-
className: "
|
|
44
|
+
className: _JSXStyle.dynamic([["641831790", [theme.palette.background, theme.type == "dark" ? darkGradient : lightGradient]]])
|
|
41
45
|
}, loaded || isHidden ? children : /*#__PURE__*/React.createElement("div", {
|
|
42
46
|
style: skeletonStyle,
|
|
43
|
-
className: "
|
|
47
|
+
className: _JSXStyle.dynamic([["641831790", [theme.palette.background, theme.type == "dark" ? darkGradient : lightGradient]]]) + " " + "skeleton-box"
|
|
44
48
|
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
45
|
-
id: "
|
|
46
|
-
|
|
49
|
+
id: "641831790",
|
|
50
|
+
dynamic: [theme.palette.background, theme.type == "dark" ? darkGradient : lightGradient]
|
|
51
|
+
}, ".skeleton-box.__jsx-style-dynamic-selector{display:inline-block;position:relative;overflow:hidden;background-color:".concat(theme.palette.background, ";text-align:center;}.skeleton-box.__jsx-style-dynamic-selector::after{position:absolute;top:0;right:0;bottom:0;left:0;-webkit-transform:translateX(-100%);-ms-transform:translateX(-100%);transform:translateX(-100%);background-image:").concat(theme.type == "dark" ? darkGradient : lightGradient, ";-webkit-animation:shimmer-__jsx-style-dynamic-selector 1.5s infinite;animation:shimmer-__jsx-style-dynamic-selector 1.5s infinite;content:'';}@-webkit-keyframes shimmer-__jsx-style-dynamic-selector{100%{-webkit-transform:translateX(100%);-ms-transform:translateX(100%);transform:translateX(100%);}}@keyframes shimmer-__jsx-style-dynamic-selector{100%{-webkit-transform:translateX(100%);-ms-transform:translateX(100%);transform:translateX(100%);}}")));
|
|
47
52
|
};
|
|
48
53
|
export default Skeleton;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TableDataItemBase, TableOnCellClick, TableOnRowClick, TableRowClassNameHandler } from './table-types';
|
|
2
|
+
import { RowErrorMap, TableDataItemBase, TableOnCellClick, TableOnRowClick, TableRowClassNameHandler } from './table-types';
|
|
3
3
|
interface Props<TableDataItem extends TableDataItemBase> {
|
|
4
4
|
hover: boolean;
|
|
5
5
|
emptyText: string;
|
|
@@ -7,16 +7,17 @@ interface Props<TableDataItem extends TableDataItemBase> {
|
|
|
7
7
|
onCell?: TableOnCellClick<TableDataItem>;
|
|
8
8
|
data: Array<TableDataItem>;
|
|
9
9
|
className?: string;
|
|
10
|
-
|
|
10
|
+
rowErrors: RowErrorMap;
|
|
11
11
|
rowClassName: TableRowClassNameHandler<TableDataItem>;
|
|
12
12
|
rowDraggable?: boolean;
|
|
13
13
|
readOnly?: boolean;
|
|
14
|
+
isLoading: boolean;
|
|
14
15
|
onSelected?: (selected: any[]) => void;
|
|
15
16
|
}
|
|
16
17
|
type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props<any>>;
|
|
17
18
|
export type TableBodyProps<TableDataItem extends TableDataItemBase> = Props<TableDataItem> & NativeAttrs;
|
|
18
19
|
declare const TableBody: {
|
|
19
|
-
<TableDataItem extends TableDataItemBase>({ data, emptyText, onRow, onCell, rowClassName,
|
|
20
|
+
<TableDataItem extends TableDataItemBase>({ data, emptyText, onRow, onCell, rowClassName, isLoading, rowErrors, rowDraggable, readOnly, onSelected }: TableBodyProps<TableDataItem>): React.JSX.Element;
|
|
20
21
|
displayName: string;
|
|
21
22
|
};
|
|
22
23
|
export default TableBody;
|
package/esm/table/table-body.js
CHANGED
|
@@ -4,7 +4,7 @@ import _JSXStyle from "../styled-jsx.es.js";
|
|
|
4
4
|
import React, { useState } from 'react';
|
|
5
5
|
import { useTheme, useClasses } from '@helpdice/theme';
|
|
6
6
|
import _ from 'lodash';
|
|
7
|
-
import Placeholder from '../placeholder';
|
|
7
|
+
// import Placeholder from '../placeholder';
|
|
8
8
|
import TableCell from './table-cell';
|
|
9
9
|
import { useTableContext } from './table-context';
|
|
10
10
|
import { DataTable } from '@helpdice/pro';
|
|
@@ -14,7 +14,8 @@ var TableBody = function TableBody(_ref) {
|
|
|
14
14
|
onRow = _ref.onRow,
|
|
15
15
|
onCell = _ref.onCell,
|
|
16
16
|
rowClassName = _ref.rowClassName,
|
|
17
|
-
|
|
17
|
+
isLoading = _ref.isLoading,
|
|
18
|
+
rowErrors = _ref.rowErrors,
|
|
18
19
|
_ref$rowDraggable = _ref.rowDraggable,
|
|
19
20
|
rowDraggable = _ref$rowDraggable === void 0 ? false : _ref$rowDraggable,
|
|
20
21
|
_ref$readOnly = _ref.readOnly,
|
|
@@ -84,6 +85,7 @@ var TableBody = function TableBody(_ref) {
|
|
|
84
85
|
// console.log(frow);
|
|
85
86
|
var isRowSelected = selected.indexOf(row) !== -1;
|
|
86
87
|
var hoverColor = theme.palette.accents_1;
|
|
88
|
+
var rowError = rowErrors === null || rowErrors === void 0 ? void 0 : rowErrors.get(row.id);
|
|
87
89
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("tr", {
|
|
88
90
|
draggable: rowDraggable,
|
|
89
91
|
role: "checkbox",
|
|
@@ -104,27 +106,35 @@ var TableBody = function TableBody(_ref) {
|
|
|
104
106
|
}
|
|
105
107
|
}
|
|
106
108
|
},
|
|
107
|
-
className: _JSXStyle.dynamic([["
|
|
109
|
+
className: _JSXStyle.dynamic([["2988536338", [theme.palette.accents_1, theme.palette.warningLighter, theme.palette.error, theme.palette.border, rowError ? theme.type == "dark" ? theme.palette.accents_1 : theme.palette.accents_8 : theme.palette.accents_6]]]) + " " + (useClasses("".concat(rowDraggable ? 'draggable' : 'hover', " ").concat(rowError ? 'row-error' : '', " ").concat(className)) || "")
|
|
108
110
|
}, /*#__PURE__*/React.createElement(TableCell, {
|
|
109
111
|
columns: cols,
|
|
110
112
|
row: rw,
|
|
113
|
+
isLoading: isLoading,
|
|
114
|
+
errors: rowError,
|
|
111
115
|
rowIndex: index,
|
|
112
116
|
emptyText: emptyText,
|
|
113
117
|
onCellClick: onCell
|
|
114
118
|
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
115
|
-
id: "
|
|
116
|
-
dynamic: [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]
|
|
117
|
-
}, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(2.125 * var(--table-font-size));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}")));
|
|
118
|
-
}
|
|
119
|
-
if ((data === null || data === void 0 ? void 0 : data.length) === 0) {
|
|
120
|
-
return /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
121
|
-
colSpan: columns === null || columns === void 0 ? void 0 : columns.length
|
|
122
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Placeholder, {
|
|
123
|
-
empty: true,
|
|
124
|
-
textOnly: textPlaceholder,
|
|
125
|
-
msg: "No Entries Found"
|
|
126
|
-
})))));
|
|
119
|
+
id: "2988536338",
|
|
120
|
+
dynamic: [theme.palette.accents_1, theme.palette.warningLighter, theme.palette.error, theme.palette.border, rowError ? theme.type == "dark" ? theme.palette.accents_1 : theme.palette.accents_8 : theme.palette.accents_6]
|
|
121
|
+
}, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.row-error.__jsx-style-dynamic-selector{background:").concat(theme.palette.warningLighter, " !important;border:2px dashed ").concat(theme.palette.error, ";margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(rowError ? theme.type == "dark" ? theme.palette.accents_1 : theme.palette.accents_8 : theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(2.125 * var(--table-font-size));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}")));
|
|
127
122
|
}
|
|
123
|
+
|
|
124
|
+
// if (data?.length === 0) {
|
|
125
|
+
// return (
|
|
126
|
+
// <tbody>
|
|
127
|
+
// <tr>
|
|
128
|
+
// <td colSpan={columns?.length}>
|
|
129
|
+
// <div>
|
|
130
|
+
// <Placeholder empty textOnly={textPlaceholder} msg="No Entries Found" />
|
|
131
|
+
// </div>
|
|
132
|
+
// </td>
|
|
133
|
+
// </tr>
|
|
134
|
+
// </tbody>
|
|
135
|
+
// )
|
|
136
|
+
// }
|
|
137
|
+
|
|
128
138
|
return /*#__PURE__*/React.createElement("tbody", {
|
|
129
139
|
className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
|
|
130
140
|
}, data.map(function (row, index) {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TableDataItemBase, TableAbstractColumn, TableOnCellClick } from './table-types';
|
|
2
|
+
import { TableDataItemBase, TableAbstractColumn, TableOnCellClick, FieldError } from './table-types';
|
|
3
3
|
interface Props<TableDataItem extends TableDataItemBase> {
|
|
4
4
|
columns: Array<TableAbstractColumn<TableDataItem>>;
|
|
5
5
|
row: TableDataItem;
|
|
6
6
|
rowIndex: number;
|
|
7
7
|
emptyText: string;
|
|
8
|
+
errors?: FieldError;
|
|
8
9
|
onCellClick?: TableOnCellClick<TableDataItem>;
|
|
10
|
+
isLoading: boolean;
|
|
9
11
|
}
|
|
10
12
|
export type TableCellData<TableDataItem> = {
|
|
11
13
|
row: number;
|
|
@@ -14,5 +16,5 @@ export type TableCellData<TableDataItem> = {
|
|
|
14
16
|
};
|
|
15
17
|
type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props<any>>;
|
|
16
18
|
export type TableCellProps<TableDataItem extends TableDataItemBase> = Props<TableDataItem> & NativeAttrs;
|
|
17
|
-
declare const TableCell: <TableDataItem extends TableDataItemBase>({ columns, row, rowIndex, emptyText, onCellClick }: TableCellProps<TableDataItem>) => React.JSX.Element;
|
|
19
|
+
declare const TableCell: <TableDataItem extends TableDataItemBase>({ columns, row, errors, rowIndex, emptyText, onCellClick, isLoading }: TableCellProps<TableDataItem>) => React.JSX.Element;
|
|
18
20
|
export default TableCell;
|
package/esm/table/table-cell.js
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import Tooltip from '../tooltip';
|
|
4
|
+
import Skeleton from '../skeleton';
|
|
3
5
|
var TableCell = function TableCell(_ref) {
|
|
4
6
|
var columns = _ref.columns,
|
|
5
7
|
row = _ref.row,
|
|
8
|
+
_ref$errors = _ref.errors,
|
|
9
|
+
errors = _ref$errors === void 0 ? {} : _ref$errors,
|
|
6
10
|
rowIndex = _ref.rowIndex,
|
|
7
11
|
emptyText = _ref.emptyText,
|
|
8
|
-
onCellClick = _ref.onCellClick
|
|
12
|
+
onCellClick = _ref.onCellClick,
|
|
13
|
+
isLoading = _ref.isLoading;
|
|
9
14
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
10
15
|
return /*#__PURE__*/React.createElement(React.Fragment, null, columns.map(function (column, index) {
|
|
11
16
|
var _ref2, _currentRowValue$valu, _row$_id;
|
|
12
17
|
var currentRowValue = row[column.prop];
|
|
13
18
|
var cellValue = (_ref2 = (_currentRowValue$valu = currentRowValue === null || currentRowValue === void 0 ? void 0 : currentRowValue.value) !== null && _currentRowValue$valu !== void 0 ? _currentRowValue$valu : currentRowValue) !== null && _ref2 !== void 0 ? _ref2 : emptyText;
|
|
14
19
|
var shouldBeRenderElement = column.renderHandler(currentRowValue, row, rowIndex);
|
|
20
|
+
var hasError = errors[column.prop];
|
|
15
21
|
return /*#__PURE__*/React.createElement("td", {
|
|
16
22
|
style: _extends({
|
|
17
23
|
fontSize: "".concat(column === null || column === void 0 ? void 0 : column.fontSize),
|
|
@@ -20,6 +26,7 @@ var TableCell = function TableCell(_ref) {
|
|
|
20
26
|
paddingRight: '0.3rem',
|
|
21
27
|
color: "".concat(column === null || column === void 0 ? void 0 : column.color),
|
|
22
28
|
boxSizing: 'border-box',
|
|
29
|
+
border: "".concat(hasError ? '2px dashed red' : 'none'),
|
|
23
30
|
whiteSpace: column !== null && column !== void 0 && column.noWrap ? 'nowrap' : 'normal'
|
|
24
31
|
}, currentRowValue === null || currentRowValue === void 0 ? void 0 : currentRowValue.style),
|
|
25
32
|
"data-column": column.prop,
|
|
@@ -28,8 +35,17 @@ var TableCell = function TableCell(_ref) {
|
|
|
28
35
|
return onCellClick && onCellClick(currentRowValue, rowIndex, index);
|
|
29
36
|
},
|
|
30
37
|
className: column.className
|
|
31
|
-
}, /*#__PURE__*/React.createElement(
|
|
32
|
-
|
|
38
|
+
}, isLoading ? /*#__PURE__*/React.createElement(Skeleton, {
|
|
39
|
+
borderRadius: "10px",
|
|
40
|
+
style: {
|
|
41
|
+
margin: '5px 0px 5px 5px'
|
|
42
|
+
},
|
|
43
|
+
width: "95%",
|
|
44
|
+
height: 20
|
|
45
|
+
}) : /*#__PURE__*/React.createElement(Tooltip.Small, {
|
|
46
|
+
className: "cell",
|
|
47
|
+
text: hasError,
|
|
48
|
+
disabled: hasError ? false : true
|
|
33
49
|
}, shouldBeRenderElement ? shouldBeRenderElement : cellValue));
|
|
34
50
|
}));
|
|
35
51
|
/* eslint-enable */
|
|
@@ -21,3 +21,5 @@ export type TableOnRowClick<TableDataItem> = (rowData: TableDataItem, rowIndex:
|
|
|
21
21
|
export type TableOnCellClick<TableDataItem> = (cellValue: TableDataItem[keyof TableDataItem], rowIndex: number, colunmIndex: number) => void;
|
|
22
22
|
export type TableOnChange<TableDataItem> = (data: Array<TableDataItem>) => void;
|
|
23
23
|
export type TableRowClassNameHandler<TableDataItem> = (rowData: TableDataItem, rowIndex: number) => string;
|
|
24
|
+
export type FieldError = Record<string, string>;
|
|
25
|
+
export type RowErrorMap = Map<number | string, FieldError>;
|
package/esm/table/table.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TableDataItemBase, TableOnCellClick, TableOnChange, TableOnRowClick, TableRowClassNameHandler } from './table-types';
|
|
2
|
+
import { RowErrorMap, TableDataItemBase, TableOnCellClick, TableOnChange, TableOnRowClick, TableRowClassNameHandler } from './table-types';
|
|
3
3
|
import { ScaleProps } from '../use-scale';
|
|
4
4
|
interface Props<TableDataItem extends TableDataItemBase> {
|
|
5
5
|
data?: Array<TableDataItem>;
|
|
@@ -25,6 +25,10 @@ interface Props<TableDataItem extends TableDataItemBase> {
|
|
|
25
25
|
previousCursor?: string;
|
|
26
26
|
nextCursor?: string;
|
|
27
27
|
hasMore?: boolean;
|
|
28
|
+
rowErrors?: RowErrorMap;
|
|
29
|
+
containerStyle?: object;
|
|
30
|
+
loading?: string;
|
|
31
|
+
isLoading?: boolean;
|
|
28
32
|
onNextPage?: (next?: string) => void;
|
|
29
33
|
onPreviousPage?: (prev?: string) => void;
|
|
30
34
|
}
|
package/esm/table/table.js
CHANGED
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["children", "data", "initialData", "hover", "emptyText", "rowDraggable", "readOnly", "cursorPagination", "previousCursor", "nextCursor", "hasMore", "onNextPage", "onPreviousPage", "onRow", "onCell", "onChange", "onFilters", "onPageChange", "showFilters", "stickyHeader", "textPlaceholder", "onSelected", "dataLength", "viewLength", "className", "rowClassName"];
|
|
5
|
+
var _excluded = ["children", "data", "initialData", "hover", "emptyText", "rowDraggable", "readOnly", "cursorPagination", "previousCursor", "nextCursor", "hasMore", "onNextPage", "onPreviousPage", "onRow", "onCell", "onChange", "onFilters", "onPageChange", "showFilters", "stickyHeader", "textPlaceholder", "onSelected", "dataLength", "viewLength", "className", "loading", "isLoading", "containerStyle", "rowErrors", "rowClassName"];
|
|
6
6
|
import _JSXStyle from "../styled-jsx.es.js";
|
|
7
7
|
/* "use client" */
|
|
8
8
|
|
|
@@ -18,6 +18,9 @@ import { ChevronLeft, ChevronRight } from '@helpdice/icons';
|
|
|
18
18
|
import Pagination from '../pagination';
|
|
19
19
|
import Button from '../button';
|
|
20
20
|
import Tooltip from '../tooltip';
|
|
21
|
+
import Placeholder from '../placeholder';
|
|
22
|
+
import { useTheme } from '@helpdice/theme';
|
|
23
|
+
import Loading from 'components/loading';
|
|
21
24
|
function TableComponent(tableProps) {
|
|
22
25
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
23
26
|
var _ref = tableProps,
|
|
@@ -57,6 +60,13 @@ function TableComponent(tableProps) {
|
|
|
57
60
|
viewLength = _ref.viewLength,
|
|
58
61
|
_ref$className = _ref.className,
|
|
59
62
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
63
|
+
_ref$loading = _ref.loading,
|
|
64
|
+
loading = _ref$loading === void 0 ? 'default' : _ref$loading,
|
|
65
|
+
_ref$isLoading = _ref.isLoading,
|
|
66
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
67
|
+
containerStyle = _ref.containerStyle,
|
|
68
|
+
_ref$rowErrors = _ref.rowErrors,
|
|
69
|
+
rowErrors = _ref$rowErrors === void 0 ? new Map() : _ref$rowErrors,
|
|
60
70
|
_ref$rowClassName = _ref.rowClassName,
|
|
61
71
|
rowClassName = _ref$rowClassName === void 0 ? function () {
|
|
62
72
|
return '';
|
|
@@ -65,6 +75,7 @@ function TableComponent(tableProps) {
|
|
|
65
75
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
66
76
|
var _useScale = useScale(),
|
|
67
77
|
SCALES = _useScale.SCALES;
|
|
78
|
+
var theme = useTheme();
|
|
68
79
|
var ref = useRef(null);
|
|
69
80
|
var _useRealShape = useRealShape(ref),
|
|
70
81
|
_useRealShape2 = _slicedToArray(_useRealShape, 2),
|
|
@@ -115,41 +126,61 @@ function TableComponent(tableProps) {
|
|
|
115
126
|
};
|
|
116
127
|
return /*#__PURE__*/React.createElement(TableContext.Provider, {
|
|
117
128
|
value: contextValue
|
|
129
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
130
|
+
style: {
|
|
131
|
+
position: 'relative',
|
|
132
|
+
display: 'flex',
|
|
133
|
+
flexDirection: 'column',
|
|
134
|
+
borderBottom: "1px solid ".concat(theme.palette.border),
|
|
135
|
+
borderBottomLeftRadius: '5px',
|
|
136
|
+
borderBottomRightRadius: '5px'
|
|
137
|
+
},
|
|
138
|
+
className: _JSXStyle.dynamic([["1809040460", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.background]]])
|
|
139
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
140
|
+
style: _extends({
|
|
141
|
+
overflow: 'auto'
|
|
142
|
+
}, containerStyle),
|
|
143
|
+
className: _JSXStyle.dynamic([["1809040460", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.background]]])
|
|
118
144
|
}, /*#__PURE__*/React.createElement("table", _extends({
|
|
119
145
|
ref: ref
|
|
120
146
|
}, props, {
|
|
121
|
-
className: _JSXStyle.dynamic([["
|
|
147
|
+
className: _JSXStyle.dynamic([["1809040460", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.background]]]) + " " + (props && props.className != null && props.className || className || "")
|
|
122
148
|
}), /*#__PURE__*/React.createElement(TableHead, {
|
|
123
149
|
stickyHeader: stickyHeader,
|
|
124
150
|
onFilters: onFilters,
|
|
125
151
|
showFilters: showFilters,
|
|
126
152
|
columns: columns,
|
|
127
153
|
width: width
|
|
128
|
-
}), /*#__PURE__*/React.createElement(TableBody, {
|
|
154
|
+
}), !isLoading && /*#__PURE__*/React.createElement(TableBody, {
|
|
129
155
|
data: data,
|
|
130
156
|
hover: hover,
|
|
131
157
|
emptyText: emptyText,
|
|
132
158
|
onRow: onRow,
|
|
133
159
|
onCell: onCell,
|
|
134
|
-
|
|
160
|
+
isLoading: loading === "skeleton" && isLoading,
|
|
161
|
+
rowErrors: rowErrors
|
|
162
|
+
// textPlaceholder={textPlaceholder}
|
|
163
|
+
,
|
|
135
164
|
rowClassName: rowClassName,
|
|
136
165
|
rowDraggable: rowDraggable,
|
|
137
166
|
readOnly: readOnly,
|
|
138
167
|
onSelected: onSelected
|
|
139
|
-
}), children,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
168
|
+
}), children), loading === "default" && isLoading ? /*#__PURE__*/React.createElement(Loading, null) : data.length == 0 && /*#__PURE__*/React.createElement(Placeholder, {
|
|
169
|
+
empty: true,
|
|
170
|
+
textOnly: textPlaceholder,
|
|
171
|
+
msg: "No Data to show"
|
|
172
|
+
})), cursorPagination || viewLength ? /*#__PURE__*/React.createElement("div", {
|
|
173
|
+
className: _JSXStyle.dynamic([["1809040460", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.background]]]) + " " + "table-footer"
|
|
174
|
+
}, cursorPagination ? /*#__PURE__*/React.createElement("div", {
|
|
145
175
|
style: {
|
|
146
176
|
display: 'flex',
|
|
147
177
|
gap: 10,
|
|
148
178
|
margin: '10px'
|
|
149
179
|
},
|
|
150
|
-
className: _JSXStyle.dynamic([["
|
|
151
|
-
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
152
|
-
text: "Previous"
|
|
180
|
+
className: _JSXStyle.dynamic([["1809040460", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.background]]])
|
|
181
|
+
}, /*#__PURE__*/React.createElement(Tooltip.Small, {
|
|
182
|
+
text: "Previous",
|
|
183
|
+
type: "dark"
|
|
153
184
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
154
185
|
disabled: !previousCursor,
|
|
155
186
|
onClick: function onClick() {
|
|
@@ -159,8 +190,9 @@ function TableComponent(tableProps) {
|
|
|
159
190
|
px: 0.6,
|
|
160
191
|
scale: 2 / 3,
|
|
161
192
|
iconRight: /*#__PURE__*/React.createElement(ChevronLeft, null)
|
|
162
|
-
})), /*#__PURE__*/React.createElement(Tooltip, {
|
|
163
|
-
text: "Next"
|
|
193
|
+
})), /*#__PURE__*/React.createElement(Tooltip.Small, {
|
|
194
|
+
text: "Next",
|
|
195
|
+
type: "dark"
|
|
164
196
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
165
197
|
disabled: !nextCursor,
|
|
166
198
|
onClick: function onClick() {
|
|
@@ -170,12 +202,7 @@ function TableComponent(tableProps) {
|
|
|
170
202
|
px: 0.6,
|
|
171
203
|
scale: 2 / 3,
|
|
172
204
|
iconRight: /*#__PURE__*/React.createElement(ChevronRight, null)
|
|
173
|
-
})))
|
|
174
|
-
className: _JSXStyle.dynamic([["2040515329", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
175
|
-
}, /*#__PURE__*/React.createElement("td", {
|
|
176
|
-
colSpan: columns === null || columns === void 0 ? void 0 : columns.length,
|
|
177
|
-
className: _JSXStyle.dynamic([["2040515329", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
178
|
-
}, /*#__PURE__*/React.createElement(Pagination, {
|
|
205
|
+
}))) : dataLength && viewLength && onPageChange ? /*#__PURE__*/React.createElement(Pagination, {
|
|
179
206
|
style: {
|
|
180
207
|
marginLeft: '10px',
|
|
181
208
|
marginRight: '10px',
|
|
@@ -190,10 +217,10 @@ function TableComponent(tableProps) {
|
|
|
190
217
|
},
|
|
191
218
|
limit: 5,
|
|
192
219
|
count: Number(dataLength / viewLength)
|
|
193
|
-
}, /*#__PURE__*/React.createElement(Pagination.Next, null, /*#__PURE__*/React.createElement(ChevronRight, null)), /*#__PURE__*/React.createElement(Pagination.Previous, null, /*#__PURE__*/React.createElement(ChevronLeft, null))))
|
|
194
|
-
id: "
|
|
195
|
-
dynamic: [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]
|
|
196
|
-
}, "table.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;--table-font-size:".concat(SCALES.font(1), ";font-size:var(--table-font-size);width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}
|
|
220
|
+
}, /*#__PURE__*/React.createElement(Pagination.Next, null, /*#__PURE__*/React.createElement(ChevronRight, null)), /*#__PURE__*/React.createElement(Pagination.Previous, null, /*#__PURE__*/React.createElement(ChevronLeft, null))) : null) : null, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
221
|
+
id: "1809040460",
|
|
222
|
+
dynamic: [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.palette.background]
|
|
223
|
+
}, "table.__jsx-style-dynamic-selector{border-collapse:separate;border-spacing:0;--table-font-size:".concat(SCALES.font(1), ";font-size:var(--table-font-size);width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.table-footer.__jsx-style-dynamic-selector{background-color:").concat(theme.palette.background, ";width:100%;bottom:0;}"))));
|
|
197
224
|
}
|
|
198
225
|
TableComponent.displayName = 'Table';
|
|
199
226
|
TableComponent.Column = TableColumn;
|
package/esm/text/text.d.ts
CHANGED
|
@@ -19,7 +19,10 @@ interface Props {
|
|
|
19
19
|
blockquote?: boolean;
|
|
20
20
|
noWrap?: boolean;
|
|
21
21
|
className?: string;
|
|
22
|
+
display?: string;
|
|
22
23
|
color?: TextTypes;
|
|
24
|
+
alignItems?: string;
|
|
25
|
+
justify?: string;
|
|
23
26
|
align?: 'center' | 'right' | 'left';
|
|
24
27
|
}
|
|
25
28
|
type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>;
|
package/esm/text/text.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["h1", "h2", "h3", "h4", "h5", "h6", "p", "b", "small", "i", "span", "del", "em", "blockquote", "noWrap", "collapse", "children", "className"];
|
|
4
|
+
var _excluded = ["h1", "h2", "h3", "h4", "h5", "h6", "p", "b", "small", "i", "span", "del", "em", "blockquote", "noWrap", "collapse", "children", "className", "display", "alignItems", "justify"];
|
|
5
5
|
/* "use client" */;
|
|
6
6
|
import React, { useMemo, useState } from 'react';
|
|
7
7
|
import TextChild from './child';
|
|
@@ -50,6 +50,10 @@ var TextComponent = function TextComponent(_ref) {
|
|
|
50
50
|
children = _ref.children,
|
|
51
51
|
_ref$className = _ref.className,
|
|
52
52
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
53
|
+
_ref$display = _ref.display,
|
|
54
|
+
display = _ref$display === void 0 ? 'block' : _ref$display,
|
|
55
|
+
alignItems = _ref.alignItems,
|
|
56
|
+
justify = _ref.justify,
|
|
53
57
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
54
58
|
var elements = {
|
|
55
59
|
h1: h1,
|
|
@@ -104,7 +108,10 @@ var TextComponent = function TextComponent(_ref) {
|
|
|
104
108
|
}, [renderableChildElements, children]);
|
|
105
109
|
return /*#__PURE__*/React.createElement(TextChild, _extends({
|
|
106
110
|
style: {
|
|
107
|
-
textAlign: props.align
|
|
111
|
+
textAlign: props.align,
|
|
112
|
+
display: display,
|
|
113
|
+
alignItems: alignItems,
|
|
114
|
+
justifyContent: justify
|
|
108
115
|
},
|
|
109
116
|
className: "".concat(className, " ").concat(noWrap ? 'no-wrap' : ''),
|
|
110
117
|
tag: tag
|
|
@@ -14,6 +14,9 @@ interface Props {
|
|
|
14
14
|
onFocus?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
|
|
15
15
|
onBlur?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
|
|
16
16
|
className?: string;
|
|
17
|
+
error?: boolean;
|
|
18
|
+
helperText?: string;
|
|
19
|
+
label?: string;
|
|
17
20
|
resize?: TextareaResizes;
|
|
18
21
|
}
|
|
19
22
|
type NativeAttrs = Omit<React.TextareaHTMLAttributes<any>, keyof Props>;
|
package/esm/textarea/textarea.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "resize"];
|
|
4
|
+
var _excluded = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "helperText", "error", "label", "resize"];
|
|
5
5
|
import _JSXStyle from "../styled-jsx.es.js";
|
|
6
6
|
/* "use client" */
|
|
7
7
|
|
|
@@ -10,6 +10,8 @@ import { useTheme, useClasses } from '@helpdice/theme';
|
|
|
10
10
|
import { tuple } from '../utils/prop-types';
|
|
11
11
|
import { getColors } from '../input/styles';
|
|
12
12
|
import useScale, { withScale } from '../use-scale';
|
|
13
|
+
import Text from '../text';
|
|
14
|
+
import InputBlockLabel from '../input/input-block-label';
|
|
13
15
|
var resizeTypes = tuple('none', 'both', 'horizontal', 'vertical', 'initial', 'inherit');
|
|
14
16
|
var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
15
17
|
var _ref$type = _ref.type,
|
|
@@ -27,6 +29,9 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
27
29
|
onChange = _ref.onChange,
|
|
28
30
|
value = _ref.value,
|
|
29
31
|
placeholder = _ref.placeholder,
|
|
32
|
+
helperText = _ref.helperText,
|
|
33
|
+
error = _ref.error,
|
|
34
|
+
label = _ref.label,
|
|
30
35
|
_ref$resize = _ref.resize,
|
|
31
36
|
resize = _ref$resize === void 0 ? 'none' : _ref$resize,
|
|
32
37
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -83,6 +88,8 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
83
88
|
};
|
|
84
89
|
var textareaProps = _extends({}, props, controlledValue);
|
|
85
90
|
return /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
className: "with-label"
|
|
92
|
+
}, label && /*#__PURE__*/React.createElement(InputBlockLabel, null, label), /*#__PURE__*/React.createElement("div", {
|
|
86
93
|
className: _JSXStyle.dynamic([["12276481", [theme.layout.radius, borderColor, color, SCALES.font(0.875), SCALES.height(1, 'auto'), SCALES.width(1, 'initial'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBorder, theme.palette.accents_1, theme.palette.accents_2, theme.font.sans, SCALES.pt(0.5), SCALES.pr(0.5), SCALES.pb(0.5), SCALES.pl(0.5), resize, theme.palette.background]]]) + " " + (classes || "")
|
|
87
94
|
}, /*#__PURE__*/React.createElement("textarea", _extends({
|
|
88
95
|
ref: textareaRef,
|
|
@@ -97,7 +104,17 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
97
104
|
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
98
105
|
id: "12276481",
|
|
99
106
|
dynamic: [theme.layout.radius, borderColor, color, SCALES.font(0.875), SCALES.height(1, 'auto'), SCALES.width(1, 'initial'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBorder, theme.palette.accents_1, theme.palette.accents_2, theme.font.sans, SCALES.pt(0.5), SCALES.pr(0.5), SCALES.pb(0.5), SCALES.pl(0.5), resize, theme.palette.background]
|
|
100
|
-
}, ".wrapper.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:".concat(theme.layout.radius, ";border:1px solid ").concat(borderColor, ";color:").concat(color, ";-webkit-transition:border 0.2s ease 0s,color 0.2s ease 0s;transition:border 0.2s ease 0s,color 0.2s ease 0s;min-width:12.5rem;max-width:95vw;--textarea-font-size:").concat(SCALES.font(0.875), ";--textarea-height:").concat(SCALES.height(1, 'auto'), ";width:").concat(SCALES.width(1, 'initial'), ";height:var(--textarea-height);margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.wrapper.hover.__jsx-style-dynamic-selector{border-color:").concat(hoverBorder, ";}.wrapper.disabled.__jsx-style-dynamic-selector{background-color:").concat(theme.palette.accents_1, ";border-color:").concat(theme.palette.accents_2, ";cursor:not-allowed;}textarea.__jsx-style-dynamic-selector{background-color:transparent;box-shadow:none;display:block;font-family:").concat(theme.font.sans, ";font-size:var(--textarea-font-size);width:100%;height:var(--textarea-height);border:none;outline:none;padding:").concat(SCALES.pt(0.5), " ").concat(SCALES.pr(0.5), " ").concat(SCALES.pb(0.5), " ").concat(SCALES.pl(0.5), ";resize:").concat(resize, ";}.disabled.__jsx-style-dynamic-selector>textarea.__jsx-style-dynamic-selector{cursor:not-allowed;}textarea.__jsx-style-dynamic-selector:-webkit-autofill,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:hover,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:active,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:focus{-webkit-box-shadow:0 0 0 30px ").concat(theme.palette.background, " inset !important;}")))
|
|
107
|
+
}, ".wrapper.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:".concat(theme.layout.radius, ";border:1px solid ").concat(borderColor, ";color:").concat(color, ";-webkit-transition:border 0.2s ease 0s,color 0.2s ease 0s;transition:border 0.2s ease 0s,color 0.2s ease 0s;min-width:12.5rem;max-width:95vw;--textarea-font-size:").concat(SCALES.font(0.875), ";--textarea-height:").concat(SCALES.height(1, 'auto'), ";width:").concat(SCALES.width(1, 'initial'), ";height:var(--textarea-height);margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.wrapper.hover.__jsx-style-dynamic-selector{border-color:").concat(hoverBorder, ";}.wrapper.disabled.__jsx-style-dynamic-selector{background-color:").concat(theme.palette.accents_1, ";border-color:").concat(theme.palette.accents_2, ";cursor:not-allowed;}textarea.__jsx-style-dynamic-selector{background-color:transparent;box-shadow:none;display:block;font-family:").concat(theme.font.sans, ";font-size:var(--textarea-font-size);width:100%;height:var(--textarea-height);border:none;outline:none;padding:").concat(SCALES.pt(0.5), " ").concat(SCALES.pr(0.5), " ").concat(SCALES.pb(0.5), " ").concat(SCALES.pl(0.5), ";resize:").concat(resize, ";}.disabled.__jsx-style-dynamic-selector>textarea.__jsx-style-dynamic-selector{cursor:not-allowed;}textarea.__jsx-style-dynamic-selector:-webkit-autofill,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:hover,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:active,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:focus{-webkit-box-shadow:0 0 0 30px ").concat(theme.palette.background, " inset !important;}"))), helperText && /*#__PURE__*/React.createElement(Text, {
|
|
108
|
+
font: 0.8,
|
|
109
|
+
style: {
|
|
110
|
+
marginTop: 0.4,
|
|
111
|
+
marginRight: 0,
|
|
112
|
+
marginLeft: 0,
|
|
113
|
+
marginBottom: '0.4rem',
|
|
114
|
+
textAlign: 'left'
|
|
115
|
+
},
|
|
116
|
+
color: error ? "error" : 'default'
|
|
117
|
+
}, "\xA0", helperText));
|
|
101
118
|
});
|
|
102
119
|
TextareaComponent.displayName = 'Textarea';
|
|
103
120
|
var Textarea = withScale(TextareaComponent);
|
package/esm/tooltip/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import Tooltip from './tooltip';
|
|
2
2
|
export type { TooltipProps, TooltipOnVisibleChange, TooltipTypes, TooltipTriggers, TooltipPlacement, } from './tooltip';
|
|
3
|
-
import SmallTooltip from './tooltip-small';
|
|
4
3
|
export type TooltipComponentType = typeof Tooltip & {
|
|
5
|
-
Small: typeof
|
|
4
|
+
Small: typeof Tooltip;
|
|
6
5
|
};
|
|
7
6
|
declare const _default: TooltipComponentType;
|
|
8
7
|
export default _default;
|
|
@@ -20,8 +20,8 @@ var TooltipContent = function TooltipContent(_ref) {
|
|
|
20
20
|
offset = _ref.offset,
|
|
21
21
|
iconOffset = _ref.iconOffset,
|
|
22
22
|
placement = _ref.placement,
|
|
23
|
-
_ref$
|
|
24
|
-
|
|
23
|
+
_ref$color = _ref.color,
|
|
24
|
+
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
25
25
|
className = _ref.className,
|
|
26
26
|
hideArrow = _ref.hideArrow;
|
|
27
27
|
var theme = useTheme();
|
|
@@ -34,9 +34,9 @@ var TooltipContent = function TooltipContent(_ref) {
|
|
|
34
34
|
rect = _useState2[0],
|
|
35
35
|
setRect = _useState2[1];
|
|
36
36
|
var colors = useMemo(function () {
|
|
37
|
-
return getColors(
|
|
38
|
-
}, [
|
|
39
|
-
var hasShadow =
|
|
37
|
+
return getColors(color, theme.palette);
|
|
38
|
+
}, [color, theme.palette]);
|
|
39
|
+
var hasShadow = color === 'default';
|
|
40
40
|
var classes = useClasses('tooltip-content', className);
|
|
41
41
|
|
|
42
42
|
// console.log('Having Parent', parent);
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
text?: string | React.ReactNode;
|
|
5
|
-
};
|
|
6
|
-
declare const _default: React.NamedExoticComponent<SmallTooltipProps>;
|
|
2
|
+
import { TooltipProps } from './tooltip';
|
|
3
|
+
declare const _default: React.NamedExoticComponent<TooltipProps>;
|
|
7
4
|
export default _default;
|
package/esm/tooltip/tooltip.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type TooltipTriggers = TriggerTypes;
|
|
|
6
6
|
export type TooltipPlacement = Placement;
|
|
7
7
|
interface Props {
|
|
8
8
|
text: string | React.ReactNode;
|
|
9
|
-
|
|
9
|
+
color?: TooltipTypes;
|
|
10
10
|
placement?: TooltipPlacement;
|
|
11
11
|
visible?: boolean;
|
|
12
12
|
initialVisible?: boolean;
|
|
@@ -14,6 +14,7 @@ interface Props {
|
|
|
14
14
|
trigger?: TooltipTriggers;
|
|
15
15
|
enterDelay?: number;
|
|
16
16
|
leaveDelay?: number;
|
|
17
|
+
disabled?: boolean;
|
|
17
18
|
offset?: number;
|
|
18
19
|
className?: string;
|
|
19
20
|
portalClassName?: string;
|