@helpdice/ui 2.1.8 → 2.2.2
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 +2147 -8
- package/dist/button/index.js +2 -2
- package/dist/carousal/index.js +2 -2
- package/dist/container/box.d.ts +47 -0
- package/dist/container/index.d.ts +2 -0
- package/dist/container/index.js +952 -0
- package/dist/copy-to-clipboard/clipboard.d.ts +13 -1
- package/dist/copy-to-clipboard/index.d.ts +1 -1
- package/dist/copy-to-clipboard/index.js +142 -157
- package/dist/grid/index.d.ts +2 -3
- package/dist/grid/index.js +0 -1
- package/dist/index.d.ts +3 -4
- package/dist/index.js +14693 -14649
- package/dist/input/index.d.ts +4 -0
- package/dist/input/index.js +2151 -9
- package/dist/input/phone-input/phone.d.ts +13 -0
- package/dist/modal/index.js +2 -2
- package/dist/placeholder/index.js +643 -8
- package/dist/table/index.js +3516 -1368
- package/dist/text/child.d.ts +1 -0
- package/dist/text/index.js +686 -8
- package/dist/text/text.d.ts +1 -0
- package/esm/button/button.js +2 -2
- package/esm/container/box.d.ts +47 -0
- package/esm/container/box.js +43 -0
- package/esm/container/index.d.ts +2 -0
- package/esm/container/index.js +2 -0
- package/esm/copy-to-clipboard/clipboard.d.ts +13 -1
- package/esm/copy-to-clipboard/clipboard.js +91 -0
- package/esm/copy-to-clipboard/index.d.ts +1 -1
- package/esm/copy-to-clipboard/index.js +1 -1
- package/esm/grid/index.d.ts +2 -3
- package/esm/grid/index.js +5 -3
- package/esm/index.d.ts +3 -4
- package/esm/index.js +4 -3
- package/esm/input/index.d.ts +4 -0
- package/esm/input/index.js +4 -0
- package/esm/input/phone-input/phone.d.ts +13 -0
- package/esm/input/phone-input/phone.js +166 -0
- package/esm/table/table-cell.js +2 -1
- package/esm/text/child.d.ts +1 -0
- package/esm/text/text.d.ts +1 -0
- package/esm/text/text.js +25 -3
- package/package.json +8 -15
- package/dist/currency-input/index.js +0 -862
- package/dist/phone-input/index.js +0 -2033
- package/dist/phone-input/phone.d.ts +0 -11
- package/esm/phone-input/phone.d.ts +0 -11
- package/esm/phone-input/phone.js +0 -161
- /package/dist/{currency-input → input/currency-input}/components/CurrencyInput.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/CurrencyInputProps.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/cleanValue.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/escapeRegExp.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/fixedDecimalValue.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/formatValue.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/getLocaleConfig.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/getSuffix.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/index.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/isNumber.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/padTrimValue.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/parseAbbrValue.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/removeInvalidChars.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/removeSeparators.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/repositionCursor.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/index.d.ts +0 -0
- /package/dist/{phone-input → input/phone-input}/index.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/CurrencyInput.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/CurrencyInput.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/CurrencyInputProps.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/CurrencyInputProps.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/addSeparators.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/cleanValue.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/cleanValue.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/escapeRegExp.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/escapeRegExp.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/fixedDecimalValue.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/fixedDecimalValue.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/formatValue.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/formatValue.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/getLocaleConfig.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/getLocaleConfig.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/getSuffix.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/getSuffix.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/index.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/index.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/isNumber.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/isNumber.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/padTrimValue.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/padTrimValue.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/parseAbbrValue.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/parseAbbrValue.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/removeInvalidChars.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/removeInvalidChars.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/removeSeparators.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/removeSeparators.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/repositionCursor.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/repositionCursor.js +0 -0
- /package/esm/{currency-input → input/currency-input}/index.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/index.js +0 -0
- /package/esm/{phone-input → input/phone-input}/index.d.ts +0 -0
- /package/esm/{phone-input → input/phone-input}/index.js +0 -0
package/esm/text/text.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
3
|
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", "noWrap", "children", "className"];
|
|
4
|
+
var _excluded = ["h1", "h2", "h3", "h4", "h5", "h6", "p", "b", "small", "i", "span", "del", "em", "blockquote", "noWrap", "collapse", "children", "className"];
|
|
4
5
|
/* "use client" */;
|
|
5
|
-
import React, { useMemo } from 'react';
|
|
6
|
+
import React, { useMemo, useState } from 'react';
|
|
6
7
|
import TextChild from './child';
|
|
7
8
|
import { withScale } from '../use-scale';
|
|
9
|
+
import Button from '../button';
|
|
8
10
|
var _getModifierChild = function getModifierChild(tags, children) {
|
|
9
11
|
if (!tags.length) return children;
|
|
10
12
|
var nextTag = tags.slice(1, tags.length);
|
|
@@ -43,6 +45,8 @@ var TextComponent = function TextComponent(_ref) {
|
|
|
43
45
|
blockquote = _ref$blockquote === void 0 ? false : _ref$blockquote,
|
|
44
46
|
_ref$noWrap = _ref.noWrap,
|
|
45
47
|
noWrap = _ref$noWrap === void 0 ? false : _ref$noWrap,
|
|
48
|
+
_ref$collapse = _ref.collapse,
|
|
49
|
+
collapse = _ref$collapse === void 0 ? 0 : _ref$collapse,
|
|
46
50
|
children = _ref.children,
|
|
47
51
|
_ref$className = _ref.className,
|
|
48
52
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
@@ -82,6 +86,10 @@ var TextComponent = function TextComponent(_ref) {
|
|
|
82
86
|
*
|
|
83
87
|
*/
|
|
84
88
|
|
|
89
|
+
var _useState = useState(false),
|
|
90
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
91
|
+
expand = _useState2[0],
|
|
92
|
+
setExpand = _useState2[1];
|
|
85
93
|
var tag = useMemo(function () {
|
|
86
94
|
if (names[0]) return names[0];
|
|
87
95
|
if (inlineNames[0]) return inlineNames[0];
|
|
@@ -100,7 +108,21 @@ var TextComponent = function TextComponent(_ref) {
|
|
|
100
108
|
},
|
|
101
109
|
className: "".concat(className, " ").concat(noWrap ? 'no-wrap' : ''),
|
|
102
110
|
tag: tag
|
|
103
|
-
}, props), modifers)
|
|
111
|
+
}, props), typeof children === 'string' && collapse > 50 ? /*#__PURE__*/React.createElement(React.Fragment, null, expand ? modifers : (modifers === null || modifers === void 0 ? void 0 : modifers.toString().substring(0, collapse)) + '...', /*#__PURE__*/React.createElement(Button, {
|
|
112
|
+
margin: 0,
|
|
113
|
+
onClick: function onClick() {
|
|
114
|
+
return setExpand(!expand);
|
|
115
|
+
},
|
|
116
|
+
style: {
|
|
117
|
+
textTransform: 'lowercase'
|
|
118
|
+
},
|
|
119
|
+
effect: false,
|
|
120
|
+
color: "abort",
|
|
121
|
+
scale: 2 / 3,
|
|
122
|
+
px: 0.2,
|
|
123
|
+
py: 0,
|
|
124
|
+
auto: true
|
|
125
|
+
}, /*#__PURE__*/React.createElement("b", null, expand ? 'less' : 'more'))) : modifers);
|
|
104
126
|
};
|
|
105
127
|
TextComponent.displayName = 'Text';
|
|
106
128
|
var Text = withScale(TextComponent);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helpdice/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "esm/index.d.ts",
|
|
6
6
|
"unpkg": "dist/index.min.js",
|
|
@@ -215,14 +215,14 @@
|
|
|
215
215
|
"import": "./dist/collapse/index.js",
|
|
216
216
|
"types": "./dist/collapse/index.d.ts"
|
|
217
217
|
},
|
|
218
|
+
"./Container": {
|
|
219
|
+
"import": "./dist/container/index.js",
|
|
220
|
+
"types": "./dist/container/index.d.ts"
|
|
221
|
+
},
|
|
218
222
|
"./CopyToClipboard": {
|
|
219
223
|
"import": "./dist/copy-to-clipboard/index.js",
|
|
220
224
|
"types": "./dist/copy-to-clipboard/index.d.ts"
|
|
221
225
|
},
|
|
222
|
-
"./CurrencyInput": {
|
|
223
|
-
"import": "./dist/currency-input/index.js",
|
|
224
|
-
"types": "./dist/currency-input/index.d.ts"
|
|
225
|
-
},
|
|
226
226
|
"./Description": {
|
|
227
227
|
"import": "./dist/description/index.js",
|
|
228
228
|
"types": "./dist/description/index.d.ts"
|
|
@@ -307,10 +307,6 @@
|
|
|
307
307
|
"import": "./dist/pagination/index.js",
|
|
308
308
|
"types": "./dist/pagination/index.d.ts"
|
|
309
309
|
},
|
|
310
|
-
"./PhoneInput": {
|
|
311
|
-
"import": "./dist/phone-input/index.js",
|
|
312
|
-
"types": "./dist/phone-input/index.d.ts"
|
|
313
|
-
},
|
|
314
310
|
"./Placeholder": {
|
|
315
311
|
"import": "./dist/placeholder/index.js",
|
|
316
312
|
"types": "./dist/placeholder/index.d.ts"
|
|
@@ -480,12 +476,12 @@
|
|
|
480
476
|
"Collapse": [
|
|
481
477
|
"dist/collapse/index.d.ts"
|
|
482
478
|
],
|
|
479
|
+
"Container": [
|
|
480
|
+
"dist/container/index.d.ts"
|
|
481
|
+
],
|
|
483
482
|
"CopyToClipboard": [
|
|
484
483
|
"dist/copy-to-clipboard/index.d.ts"
|
|
485
484
|
],
|
|
486
|
-
"CurrencyInput": [
|
|
487
|
-
"dist/currency-input/index.d.ts"
|
|
488
|
-
],
|
|
489
485
|
"Description": [
|
|
490
486
|
"dist/description/index.d.ts"
|
|
491
487
|
],
|
|
@@ -549,9 +545,6 @@
|
|
|
549
545
|
"Pagination": [
|
|
550
546
|
"dist/pagination/index.d.ts"
|
|
551
547
|
],
|
|
552
|
-
"PhoneInput": [
|
|
553
|
-
"dist/phone-input/index.d.ts"
|
|
554
|
-
],
|
|
555
548
|
"Placeholder": [
|
|
556
549
|
"dist/placeholder/index.d.ts"
|
|
557
550
|
],
|