@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
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { InputTypes } from '../input';
3
- type PhoneInputProps = {
4
- onChange: (data: string) => void;
5
- value?: string;
6
- country?: string;
7
- placeholder?: string;
8
- color?: InputTypes;
9
- };
10
- declare const PhoneInput: ({ onChange, value, country, placeholder, color: _color }: PhoneInputProps) => React.JSX.Element;
11
- export default PhoneInput;
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { InputTypes } from '../input';
3
- type PhoneInputProps = {
4
- onChange: (data: string) => void;
5
- value?: string;
6
- country?: string;
7
- placeholder?: string;
8
- color?: InputTypes;
9
- };
10
- declare const PhoneInput: ({ onChange, value, country, placeholder, color: _color }: PhoneInputProps) => React.JSX.Element;
11
- export default PhoneInput;
@@ -1,161 +0,0 @@
1
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- import _JSXStyle from "../styled-jsx.es.js";
3
- import React, { useState, useRef, useEffect, useMemo } from 'react';
4
- import countries from './countries.json';
5
- import { useTheme } from '@helpdice/theme';
6
- import { getColors } from '../input/styles';
7
- var PhoneInput = function PhoneInput(_ref) {
8
- var onChange = _ref.onChange,
9
- _ref$value = _ref.value,
10
- value = _ref$value === void 0 ? '' : _ref$value,
11
- country = _ref.country,
12
- _ref$placeholder = _ref.placeholder,
13
- placeholder = _ref$placeholder === void 0 ? 'Enter phone number' : _ref$placeholder,
14
- _ref$color = _ref.color,
15
- _color = _ref$color === void 0 ? 'default' : _ref$color;
16
- var theme = useTheme();
17
- var defaultValue = country ? countries.findIndex(function (cn) {
18
- return cn.code == country;
19
- }) : 103;
20
- var _useState = useState(countries[defaultValue]),
21
- _useState2 = _slicedToArray(_useState, 2),
22
- selectedCountry = _useState2[0],
23
- setSelectedCountry = _useState2[1];
24
- var _useState3 = useState(value),
25
- _useState4 = _slicedToArray(_useState3, 2),
26
- phoneNumber = _useState4[0],
27
- setPhoneNumber = _useState4[1];
28
- var _useState5 = useState(false),
29
- _useState6 = _slicedToArray(_useState5, 2),
30
- isFocused = _useState6[0],
31
- setIsFocused = _useState6[1];
32
- var _useState7 = useState(false),
33
- _useState8 = _slicedToArray(_useState7, 2),
34
- dropdownOpen = _useState8[0],
35
- setDropdownOpen = _useState8[1];
36
- var _useState9 = useState(''),
37
- _useState10 = _slicedToArray(_useState9, 2),
38
- searchTerm = _useState10[0],
39
- setSearchTerm = _useState10[1];
40
- var dropdownRef = useRef(null);
41
- var _useMemo = useMemo(function () {
42
- return getColors(theme.palette, _color);
43
- }, [theme.palette]),
44
- borderColor = _useMemo.borderColor,
45
- hoverBorder = _useMemo.hoverBorder;
46
- var handleSelectCountry = function handleSelectCountry(country) {
47
- setSelectedCountry(country);
48
- setDropdownOpen(false);
49
- setSearchTerm('');
50
- if (onChange) onChange("".concat(country.code, ":").concat(phoneNumber));
51
- };
52
- var handlePhoneChange = function handlePhoneChange(e) {
53
- var value = e.target.value.replace(/[^\d]/g, '');
54
- setPhoneNumber(value);
55
- if (onChange) onChange("".concat(selectedCountry.phone, ",").concat(value));
56
- };
57
- var handleClickOutside = function handleClickOutside(e) {
58
- if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
59
- setDropdownOpen(false);
60
- setSearchTerm('');
61
- }
62
- };
63
- useEffect(function () {
64
- document.addEventListener('mousedown', handleClickOutside);
65
- return function () {
66
- return document.removeEventListener('mousedown', handleClickOutside);
67
- };
68
- }, []);
69
- var filteredCountries = countries.filter(function (c) {
70
- return "".concat(c.label, " ").concat(c.code, " ").concat(c.phone).toLowerCase().includes(searchTerm.toLowerCase());
71
- });
72
- return /*#__PURE__*/React.createElement("div", {
73
- ref: dropdownRef,
74
- className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "phone-input-container ".concat(isFocused ? 'focused' : '')
75
- }, /*#__PURE__*/React.createElement("div", {
76
- className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "input-wrapper"
77
- }, /*#__PURE__*/React.createElement("div", {
78
- onClick: function onClick() {
79
- return setDropdownOpen(!dropdownOpen);
80
- },
81
- className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown-toggle"
82
- }, /*#__PURE__*/React.createElement("span", {
83
- style: {
84
- display: 'flex',
85
- alignItems: 'center',
86
- gap: 5
87
- },
88
- className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
89
- }, /*#__PURE__*/React.createElement("img", {
90
- loading: "lazy",
91
- width: "23",
92
- height: "23",
93
- src: "https://flagcdn.com/w20/".concat(selectedCountry.code.toLowerCase(), ".png"),
94
- srcSet: "https://flagcdn.com/w40/".concat(selectedCountry.code.toLowerCase(), ".png 2x"),
95
- alt: "Flag of ".concat(selectedCountry.label),
96
- className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
97
- }), /*#__PURE__*/React.createElement("span", {
98
- className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
99
- }, selectedCountry.phone))), /*#__PURE__*/React.createElement("input", {
100
- type: "tel",
101
- style: {
102
- width: '100%'
103
- },
104
- placeholder: placeholder,
105
- value: phoneNumber,
106
- onChange: handlePhoneChange,
107
- onFocus: function onFocus() {
108
- return setIsFocused(true);
109
- },
110
- onBlur: function onBlur() {
111
- return setIsFocused(false);
112
- },
113
- className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "phone-input"
114
- })), dropdownOpen && /*#__PURE__*/React.createElement("div", {
115
- className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown"
116
- }, /*#__PURE__*/React.createElement("input", {
117
- type: "text",
118
- placeholder: "Search country...",
119
- value: searchTerm,
120
- onChange: function onChange(e) {
121
- return setSearchTerm(e.target.value);
122
- },
123
- className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "search-input"
124
- }), /*#__PURE__*/React.createElement("div", {
125
- className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "country-list"
126
- }, filteredCountries.length > 0 ? filteredCountries.map(function (c) {
127
- return /*#__PURE__*/React.createElement("div", {
128
- key: c.code,
129
- onClick: function onClick() {
130
- return handleSelectCountry(c);
131
- },
132
- className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown-item"
133
- }, /*#__PURE__*/React.createElement("span", {
134
- style: {
135
- display: 'flex',
136
- alignItems: 'center',
137
- gap: 5
138
- },
139
- className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
140
- }, /*#__PURE__*/React.createElement("img", {
141
- loading: "lazy",
142
- width: "23",
143
- height: "23",
144
- src: "https://flagcdn.com/w20/".concat(c.code.toLowerCase(), ".png"),
145
- srcSet: "https://flagcdn.com/w40/".concat(c.code.toLowerCase(), ".png 2x"),
146
- alt: "Flag of ".concat(c.label),
147
- className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
148
- }), c.phone, " ", /*#__PURE__*/React.createElement("span", {
149
- style: {
150
- color: 'grey'
151
- },
152
- className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
153
- }, c.label)));
154
- }) : /*#__PURE__*/React.createElement("div", {
155
- className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown-item disabled"
156
- }, "No results"))), /*#__PURE__*/React.createElement(_JSXStyle, {
157
- id: "1313692390",
158
- dynamic: [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']
159
- }, ".phone-input-container.__jsx-style-dynamic-selector{position:relative;min-width:200px;width:auto;}.phone-input-container.focused.__jsx-style-dynamic-selector{outline:1px solid ".concat(hoverBorder, ";border-radius:6px;}.input-wrapper.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:1px solid ").concat(borderColor, ";border-radius:6px;overflow:hidden;}.dropdown-toggle.__jsx-style-dynamic-selector{padding:7px 12px;border-radius:6px 0px 0px 6px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:14px;border-right:1px solid ").concat(borderColor, ";}.phone-input.__jsx-style-dynamic-selector{-webkit-flex:1;-ms-flex:1;flex:1;padding:5px 10px;height:35px;background-color:transparent;font-size:14px;border:none;}.phone-input.__jsx-style-dynamic-selector:focus{outline:none;}.dropdown.__jsx-style-dynamic-selector{position:absolute;top:100%;left:0;width:100%;background:").concat(theme.type == 'dark' ? 'black' : 'white', ";border:1px solid ").concat(borderColor, ";border-radius:6px;margin-top:4px;z-index:999;box-shadow:0 4px 10px rgba(0,0,0,0.1);}.search-input.__jsx-style-dynamic-selector{width:100%;padding:8px 10px;border:none;background-color:transparent;border-bottom:1px solid ").concat(borderColor, ";font-size:14px;}.search-input.__jsx-style-dynamic-selector:focus{outline:none;}.country-list.__jsx-style-dynamic-selector{max-height:200px;overflow-y:auto;}.dropdown-item.__jsx-style-dynamic-selector{padding:10px;cursor:pointer;font-size:14px;}.dropdown-item.__jsx-style-dynamic-selector:hover{background:").concat(theme.type == 'dark' ? '#3a3d3d' : '#efefef', ";}.dropdown-item.disabled.__jsx-style-dynamic-selector{color:#888;cursor:default;}")));
160
- };
161
- export default PhoneInput;
File without changes