@helpdice/ui 2.1.5 → 2.1.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.
Files changed (124) hide show
  1. package/dist/auto-complete/index.js +2158 -17
  2. package/dist/button/button.d.ts +1 -1
  3. package/dist/button/index.js +73 -16
  4. package/dist/button/styles.d.ts +1 -0
  5. package/dist/carousal/index.js +73 -16
  6. package/dist/container/box.d.ts +42 -0
  7. package/dist/container/index.d.ts +2 -0
  8. package/dist/container/index.js +948 -0
  9. package/dist/copy-to-clipboard/clipboard.d.ts +14 -0
  10. package/dist/copy-to-clipboard/copy.d.ts +2 -0
  11. package/dist/copy-to-clipboard/index.d.ts +2 -0
  12. package/dist/copy-to-clipboard/index.js +1702 -0
  13. package/dist/copy-to-clipboard/toggle-selection.d.ts +1 -0
  14. package/dist/grid/index.d.ts +2 -3
  15. package/dist/grid/index.js +0 -1
  16. package/dist/html-renderer/index.js +35 -12
  17. package/dist/index.d.ts +6 -6
  18. package/dist/index.js +15776 -15418
  19. package/dist/input/index.d.ts +4 -0
  20. package/dist/input/index.js +2162 -18
  21. package/dist/input/input-props.d.ts +1 -0
  22. package/dist/input/phone-input/phone.d.ts +13 -0
  23. package/dist/modal/index.js +73 -16
  24. package/dist/notetip/index.js +690 -0
  25. package/{esm/notetip/index.d.ts → dist/notetip/note-tip.d.ts} +2 -2
  26. package/dist/placeholder/index.js +643 -8
  27. package/dist/table/index.js +4370 -2163
  28. package/dist/text/child.d.ts +1 -0
  29. package/dist/text/index.js +686 -8
  30. package/dist/text/text.d.ts +1 -0
  31. package/esm/button/button.d.ts +1 -1
  32. package/esm/button/button.js +51 -5
  33. package/esm/button/styles.d.ts +1 -0
  34. package/esm/button/styles.js +22 -11
  35. package/esm/container/box.d.ts +42 -0
  36. package/esm/container/box.js +39 -0
  37. package/esm/container/index.d.ts +2 -0
  38. package/esm/container/index.js +2 -0
  39. package/esm/copy-to-clipboard/clipboard.d.ts +14 -0
  40. package/esm/copy-to-clipboard/clipboard.js +91 -0
  41. package/esm/copy-to-clipboard/copy.d.ts +2 -0
  42. package/esm/copy-to-clipboard/copy.js +105 -0
  43. package/esm/copy-to-clipboard/index.d.ts +2 -0
  44. package/esm/copy-to-clipboard/index.js +2 -0
  45. package/esm/copy-to-clipboard/toggle-selection.d.ts +1 -0
  46. package/esm/copy-to-clipboard/toggle-selection.js +31 -0
  47. package/esm/grid/index.d.ts +2 -3
  48. package/esm/grid/index.js +5 -3
  49. package/esm/index.d.ts +6 -6
  50. package/esm/index.js +7 -5
  51. package/esm/input/index.d.ts +4 -0
  52. package/esm/input/index.js +4 -0
  53. package/esm/input/input-field.js +12 -10
  54. package/esm/input/input-props.d.ts +1 -0
  55. package/esm/input/phone-input/phone.d.ts +13 -0
  56. package/esm/input/phone-input/phone.js +166 -0
  57. package/esm/notetip/index.js +2 -97
  58. package/{dist/notetip/index.d.ts → esm/notetip/note-tip.d.ts} +2 -2
  59. package/esm/notetip/note-tip.js +97 -0
  60. package/esm/table/table-body.js +2 -2
  61. package/esm/table/table-cell.js +1 -1
  62. package/esm/table/table-head.js +4 -2
  63. package/esm/table/table.js +0 -1
  64. package/esm/text/child.d.ts +1 -0
  65. package/esm/text/text.d.ts +1 -0
  66. package/esm/text/text.js +25 -3
  67. package/package.json +19 -19
  68. package/dist/currency-input/index.js +0 -862
  69. package/dist/phone-input/index.js +0 -2033
  70. package/dist/phone-input/phone.d.ts +0 -11
  71. package/esm/phone-input/phone.d.ts +0 -11
  72. package/esm/phone-input/phone.js +0 -161
  73. /package/dist/{currency-input → input/currency-input}/components/CurrencyInput.d.ts +0 -0
  74. /package/dist/{currency-input → input/currency-input}/components/CurrencyInputProps.d.ts +0 -0
  75. /package/dist/{currency-input → input/currency-input}/components/utils/cleanValue.d.ts +0 -0
  76. /package/dist/{currency-input → input/currency-input}/components/utils/escapeRegExp.d.ts +0 -0
  77. /package/dist/{currency-input → input/currency-input}/components/utils/fixedDecimalValue.d.ts +0 -0
  78. /package/dist/{currency-input → input/currency-input}/components/utils/formatValue.d.ts +0 -0
  79. /package/dist/{currency-input → input/currency-input}/components/utils/getLocaleConfig.d.ts +0 -0
  80. /package/dist/{currency-input → input/currency-input}/components/utils/getSuffix.d.ts +0 -0
  81. /package/dist/{currency-input → input/currency-input}/components/utils/index.d.ts +0 -0
  82. /package/dist/{currency-input → input/currency-input}/components/utils/isNumber.d.ts +0 -0
  83. /package/dist/{currency-input → input/currency-input}/components/utils/padTrimValue.d.ts +0 -0
  84. /package/dist/{currency-input → input/currency-input}/components/utils/parseAbbrValue.d.ts +0 -0
  85. /package/dist/{currency-input → input/currency-input}/components/utils/removeInvalidChars.d.ts +0 -0
  86. /package/dist/{currency-input → input/currency-input}/components/utils/removeSeparators.d.ts +0 -0
  87. /package/dist/{currency-input → input/currency-input}/components/utils/repositionCursor.d.ts +0 -0
  88. /package/dist/{currency-input → input/currency-input}/index.d.ts +0 -0
  89. /package/dist/{phone-input → input/phone-input}/index.d.ts +0 -0
  90. /package/esm/{currency-input → input/currency-input}/components/CurrencyInput.d.ts +0 -0
  91. /package/esm/{currency-input → input/currency-input}/components/CurrencyInput.js +0 -0
  92. /package/esm/{currency-input → input/currency-input}/components/CurrencyInputProps.d.ts +0 -0
  93. /package/esm/{currency-input → input/currency-input}/components/CurrencyInputProps.js +0 -0
  94. /package/esm/{currency-input → input/currency-input}/components/utils/addSeparators.js +0 -0
  95. /package/esm/{currency-input → input/currency-input}/components/utils/cleanValue.d.ts +0 -0
  96. /package/esm/{currency-input → input/currency-input}/components/utils/cleanValue.js +0 -0
  97. /package/esm/{currency-input → input/currency-input}/components/utils/escapeRegExp.d.ts +0 -0
  98. /package/esm/{currency-input → input/currency-input}/components/utils/escapeRegExp.js +0 -0
  99. /package/esm/{currency-input → input/currency-input}/components/utils/fixedDecimalValue.d.ts +0 -0
  100. /package/esm/{currency-input → input/currency-input}/components/utils/fixedDecimalValue.js +0 -0
  101. /package/esm/{currency-input → input/currency-input}/components/utils/formatValue.d.ts +0 -0
  102. /package/esm/{currency-input → input/currency-input}/components/utils/formatValue.js +0 -0
  103. /package/esm/{currency-input → input/currency-input}/components/utils/getLocaleConfig.d.ts +0 -0
  104. /package/esm/{currency-input → input/currency-input}/components/utils/getLocaleConfig.js +0 -0
  105. /package/esm/{currency-input → input/currency-input}/components/utils/getSuffix.d.ts +0 -0
  106. /package/esm/{currency-input → input/currency-input}/components/utils/getSuffix.js +0 -0
  107. /package/esm/{currency-input → input/currency-input}/components/utils/index.d.ts +0 -0
  108. /package/esm/{currency-input → input/currency-input}/components/utils/index.js +0 -0
  109. /package/esm/{currency-input → input/currency-input}/components/utils/isNumber.d.ts +0 -0
  110. /package/esm/{currency-input → input/currency-input}/components/utils/isNumber.js +0 -0
  111. /package/esm/{currency-input → input/currency-input}/components/utils/padTrimValue.d.ts +0 -0
  112. /package/esm/{currency-input → input/currency-input}/components/utils/padTrimValue.js +0 -0
  113. /package/esm/{currency-input → input/currency-input}/components/utils/parseAbbrValue.d.ts +0 -0
  114. /package/esm/{currency-input → input/currency-input}/components/utils/parseAbbrValue.js +0 -0
  115. /package/esm/{currency-input → input/currency-input}/components/utils/removeInvalidChars.d.ts +0 -0
  116. /package/esm/{currency-input → input/currency-input}/components/utils/removeInvalidChars.js +0 -0
  117. /package/esm/{currency-input → input/currency-input}/components/utils/removeSeparators.d.ts +0 -0
  118. /package/esm/{currency-input → input/currency-input}/components/utils/removeSeparators.js +0 -0
  119. /package/esm/{currency-input → input/currency-input}/components/utils/repositionCursor.d.ts +0 -0
  120. /package/esm/{currency-input → input/currency-input}/components/utils/repositionCursor.js +0 -0
  121. /package/esm/{currency-input → input/currency-input}/index.d.ts +0 -0
  122. /package/esm/{currency-input → input/currency-input}/index.js +0 -0
  123. /package/esm/{phone-input → input/phone-input}/index.d.ts +0 -0
  124. /package/esm/{phone-input → input/phone-input}/index.js +0 -0
@@ -4,6 +4,7 @@ export interface Props {
4
4
  tag: keyof JSX.IntrinsicElements;
5
5
  color?: NormalTypes;
6
6
  className?: string;
7
+ collapse?: number;
7
8
  }
8
9
  type NativeAttrs = Omit<React.DetailsHTMLAttributes<any>, keyof Props>;
9
10
  export type TextChildProps = Props & NativeAttrs;
@@ -15,6 +15,7 @@ interface Props {
15
15
  span?: boolean;
16
16
  del?: boolean;
17
17
  em?: boolean;
18
+ collapse?: number;
18
19
  blockquote?: boolean;
19
20
  noWrap?: boolean;
20
21
  className?: string;
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.5",
3
+ "version": "2.1.9",
4
4
  "main": "dist/index.js",
5
5
  "types": "esm/index.d.ts",
6
6
  "unpkg": "dist/index.min.js",
@@ -26,7 +26,7 @@
26
26
  "build:types": "tsc -p ./scripts & tsc -p ./scripts --outDir ./esm",
27
27
  "build:package": "yarn build:rollup && yarn build:babel && yarn build:types && yarn build:after",
28
28
  "release": "yarn publish --access public --non-interactive",
29
- "release:github": "yarn publish --registry=https://npm.pkg.github.com"
29
+ "release:github": "npm publish --registry=https://npm.pkg.github.com"
30
30
  },
31
31
  "license": "MIT",
32
32
  "description": "Modern React UI library.",
@@ -63,8 +63,8 @@
63
63
  "@babel/preset-typescript": "^7.14.5",
64
64
  "@babel/standalone": "^7.28.3",
65
65
  "@helpdice/icons": "^1.2.5",
66
- "@helpdice/pro": "^1.8.0",
67
- "@helpdice/sdk": "^0.2.5",
66
+ "@helpdice/sdk": "^0.2.9",
67
+ "@helpdice/utils": "^0.1.4",
68
68
  "@mapbox/rehype-prism": "^0.9.0",
69
69
  "@mdx-js/loader": "^3.1.0",
70
70
  "@mdx-js/react": "^3.1.0",
@@ -139,7 +139,7 @@
139
139
  "tslib": "^2.8.1"
140
140
  },
141
141
  "peerDependencies": {
142
- "@helpdice/theme": "^1.0.5",
142
+ "@helpdice/theme": "^1.0.9",
143
143
  "react": "^19.2.0",
144
144
  "react-dom": "^19.2.0"
145
145
  },
@@ -215,9 +215,13 @@
215
215
  "import": "./dist/collapse/index.js",
216
216
  "types": "./dist/collapse/index.d.ts"
217
217
  },
218
- "./CurrencyInput": {
219
- "import": "./dist/currency-input/index.js",
220
- "types": "./dist/currency-input/index.d.ts"
218
+ "./Container": {
219
+ "import": "./dist/container/index.js",
220
+ "types": "./dist/container/index.d.ts"
221
+ },
222
+ "./CopyToClipboard": {
223
+ "import": "./dist/copy-to-clipboard/index.js",
224
+ "types": "./dist/copy-to-clipboard/index.d.ts"
221
225
  },
222
226
  "./Description": {
223
227
  "import": "./dist/description/index.js",
@@ -303,10 +307,6 @@
303
307
  "import": "./dist/pagination/index.js",
304
308
  "types": "./dist/pagination/index.d.ts"
305
309
  },
306
- "./PhoneInput": {
307
- "import": "./dist/phone-input/index.js",
308
- "types": "./dist/phone-input/index.d.ts"
309
- },
310
310
  "./Placeholder": {
311
311
  "import": "./dist/placeholder/index.js",
312
312
  "types": "./dist/placeholder/index.d.ts"
@@ -427,7 +427,7 @@
427
427
  "import": "./dist/use-toasts/index.js",
428
428
  "types": "./dist/use-toasts/index.d.ts"
429
429
  },
430
- "./User": {
430
+ "./user": {
431
431
  "import": "./dist/user/index.js",
432
432
  "types": "./dist/user/index.d.ts"
433
433
  }
@@ -476,8 +476,11 @@
476
476
  "Collapse": [
477
477
  "dist/collapse/index.d.ts"
478
478
  ],
479
- "CurrencyInput": [
480
- "dist/currency-input/index.d.ts"
479
+ "Container": [
480
+ "dist/container/index.d.ts"
481
+ ],
482
+ "CopyToClipboard": [
483
+ "dist/copy-to-clipboard/index.d.ts"
481
484
  ],
482
485
  "Description": [
483
486
  "dist/description/index.d.ts"
@@ -542,9 +545,6 @@
542
545
  "Pagination": [
543
546
  "dist/pagination/index.d.ts"
544
547
  ],
545
- "PhoneInput": [
546
- "dist/phone-input/index.d.ts"
547
- ],
548
548
  "Placeholder": [
549
549
  "dist/placeholder/index.d.ts"
550
550
  ],
@@ -635,7 +635,7 @@
635
635
  "useToasts": [
636
636
  "dist/use-toasts/index.d.ts"
637
637
  ],
638
- "User": [
638
+ "user": [
639
639
  "dist/user/index.d.ts"
640
640
  ]
641
641
  }