@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.
Files changed (101) hide show
  1. package/dist/auto-complete/index.js +2147 -8
  2. package/dist/button/index.js +2 -2
  3. package/dist/carousal/index.js +2 -2
  4. package/dist/container/box.d.ts +47 -0
  5. package/dist/container/index.d.ts +2 -0
  6. package/dist/container/index.js +952 -0
  7. package/dist/copy-to-clipboard/clipboard.d.ts +13 -1
  8. package/dist/copy-to-clipboard/index.d.ts +1 -1
  9. package/dist/copy-to-clipboard/index.js +142 -157
  10. package/dist/grid/index.d.ts +2 -3
  11. package/dist/grid/index.js +0 -1
  12. package/dist/index.d.ts +3 -4
  13. package/dist/index.js +14693 -14649
  14. package/dist/input/index.d.ts +4 -0
  15. package/dist/input/index.js +2151 -9
  16. package/dist/input/phone-input/phone.d.ts +13 -0
  17. package/dist/modal/index.js +2 -2
  18. package/dist/placeholder/index.js +643 -8
  19. package/dist/table/index.js +3516 -1368
  20. package/dist/text/child.d.ts +1 -0
  21. package/dist/text/index.js +686 -8
  22. package/dist/text/text.d.ts +1 -0
  23. package/esm/button/button.js +2 -2
  24. package/esm/container/box.d.ts +47 -0
  25. package/esm/container/box.js +43 -0
  26. package/esm/container/index.d.ts +2 -0
  27. package/esm/container/index.js +2 -0
  28. package/esm/copy-to-clipboard/clipboard.d.ts +13 -1
  29. package/esm/copy-to-clipboard/clipboard.js +91 -0
  30. package/esm/copy-to-clipboard/index.d.ts +1 -1
  31. package/esm/copy-to-clipboard/index.js +1 -1
  32. package/esm/grid/index.d.ts +2 -3
  33. package/esm/grid/index.js +5 -3
  34. package/esm/index.d.ts +3 -4
  35. package/esm/index.js +4 -3
  36. package/esm/input/index.d.ts +4 -0
  37. package/esm/input/index.js +4 -0
  38. package/esm/input/phone-input/phone.d.ts +13 -0
  39. package/esm/input/phone-input/phone.js +166 -0
  40. package/esm/table/table-cell.js +2 -1
  41. package/esm/text/child.d.ts +1 -0
  42. package/esm/text/text.d.ts +1 -0
  43. package/esm/text/text.js +25 -3
  44. package/package.json +8 -15
  45. package/dist/currency-input/index.js +0 -862
  46. package/dist/phone-input/index.js +0 -2033
  47. package/dist/phone-input/phone.d.ts +0 -11
  48. package/esm/phone-input/phone.d.ts +0 -11
  49. package/esm/phone-input/phone.js +0 -161
  50. /package/dist/{currency-input → input/currency-input}/components/CurrencyInput.d.ts +0 -0
  51. /package/dist/{currency-input → input/currency-input}/components/CurrencyInputProps.d.ts +0 -0
  52. /package/dist/{currency-input → input/currency-input}/components/utils/cleanValue.d.ts +0 -0
  53. /package/dist/{currency-input → input/currency-input}/components/utils/escapeRegExp.d.ts +0 -0
  54. /package/dist/{currency-input → input/currency-input}/components/utils/fixedDecimalValue.d.ts +0 -0
  55. /package/dist/{currency-input → input/currency-input}/components/utils/formatValue.d.ts +0 -0
  56. /package/dist/{currency-input → input/currency-input}/components/utils/getLocaleConfig.d.ts +0 -0
  57. /package/dist/{currency-input → input/currency-input}/components/utils/getSuffix.d.ts +0 -0
  58. /package/dist/{currency-input → input/currency-input}/components/utils/index.d.ts +0 -0
  59. /package/dist/{currency-input → input/currency-input}/components/utils/isNumber.d.ts +0 -0
  60. /package/dist/{currency-input → input/currency-input}/components/utils/padTrimValue.d.ts +0 -0
  61. /package/dist/{currency-input → input/currency-input}/components/utils/parseAbbrValue.d.ts +0 -0
  62. /package/dist/{currency-input → input/currency-input}/components/utils/removeInvalidChars.d.ts +0 -0
  63. /package/dist/{currency-input → input/currency-input}/components/utils/removeSeparators.d.ts +0 -0
  64. /package/dist/{currency-input → input/currency-input}/components/utils/repositionCursor.d.ts +0 -0
  65. /package/dist/{currency-input → input/currency-input}/index.d.ts +0 -0
  66. /package/dist/{phone-input → input/phone-input}/index.d.ts +0 -0
  67. /package/esm/{currency-input → input/currency-input}/components/CurrencyInput.d.ts +0 -0
  68. /package/esm/{currency-input → input/currency-input}/components/CurrencyInput.js +0 -0
  69. /package/esm/{currency-input → input/currency-input}/components/CurrencyInputProps.d.ts +0 -0
  70. /package/esm/{currency-input → input/currency-input}/components/CurrencyInputProps.js +0 -0
  71. /package/esm/{currency-input → input/currency-input}/components/utils/addSeparators.js +0 -0
  72. /package/esm/{currency-input → input/currency-input}/components/utils/cleanValue.d.ts +0 -0
  73. /package/esm/{currency-input → input/currency-input}/components/utils/cleanValue.js +0 -0
  74. /package/esm/{currency-input → input/currency-input}/components/utils/escapeRegExp.d.ts +0 -0
  75. /package/esm/{currency-input → input/currency-input}/components/utils/escapeRegExp.js +0 -0
  76. /package/esm/{currency-input → input/currency-input}/components/utils/fixedDecimalValue.d.ts +0 -0
  77. /package/esm/{currency-input → input/currency-input}/components/utils/fixedDecimalValue.js +0 -0
  78. /package/esm/{currency-input → input/currency-input}/components/utils/formatValue.d.ts +0 -0
  79. /package/esm/{currency-input → input/currency-input}/components/utils/formatValue.js +0 -0
  80. /package/esm/{currency-input → input/currency-input}/components/utils/getLocaleConfig.d.ts +0 -0
  81. /package/esm/{currency-input → input/currency-input}/components/utils/getLocaleConfig.js +0 -0
  82. /package/esm/{currency-input → input/currency-input}/components/utils/getSuffix.d.ts +0 -0
  83. /package/esm/{currency-input → input/currency-input}/components/utils/getSuffix.js +0 -0
  84. /package/esm/{currency-input → input/currency-input}/components/utils/index.d.ts +0 -0
  85. /package/esm/{currency-input → input/currency-input}/components/utils/index.js +0 -0
  86. /package/esm/{currency-input → input/currency-input}/components/utils/isNumber.d.ts +0 -0
  87. /package/esm/{currency-input → input/currency-input}/components/utils/isNumber.js +0 -0
  88. /package/esm/{currency-input → input/currency-input}/components/utils/padTrimValue.d.ts +0 -0
  89. /package/esm/{currency-input → input/currency-input}/components/utils/padTrimValue.js +0 -0
  90. /package/esm/{currency-input → input/currency-input}/components/utils/parseAbbrValue.d.ts +0 -0
  91. /package/esm/{currency-input → input/currency-input}/components/utils/parseAbbrValue.js +0 -0
  92. /package/esm/{currency-input → input/currency-input}/components/utils/removeInvalidChars.d.ts +0 -0
  93. /package/esm/{currency-input → input/currency-input}/components/utils/removeInvalidChars.js +0 -0
  94. /package/esm/{currency-input → input/currency-input}/components/utils/removeSeparators.d.ts +0 -0
  95. /package/esm/{currency-input → input/currency-input}/components/utils/removeSeparators.js +0 -0
  96. /package/esm/{currency-input → input/currency-input}/components/utils/repositionCursor.d.ts +0 -0
  97. /package/esm/{currency-input → input/currency-input}/components/utils/repositionCursor.js +0 -0
  98. /package/esm/{currency-input → input/currency-input}/index.d.ts +0 -0
  99. /package/esm/{currency-input → input/currency-input}/index.js +0 -0
  100. /package/esm/{phone-input → input/phone-input}/index.d.ts +0 -0
  101. /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.1.8",
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
  ],