@helpdice/ui 1.7.5 → 1.7.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.
Files changed (304) hide show
  1. package/dist/CurrencyInput/index.js +2981 -0
  2. package/dist/LinearProgress/index.d.ts +2 -0
  3. package/dist/{css-baseline → LinearProgress}/index.js +25 -317
  4. package/dist/LinearProgress/linear-progress.d.ts +9 -0
  5. package/dist/Loadable/index.js +570 -0
  6. package/dist/PhoneInput/index.js +2136 -314
  7. package/dist/Placeholder/index.js +2116 -254
  8. package/dist/auto-complete/index.js +2145 -652
  9. package/dist/avatar/index.js +2119 -333
  10. package/dist/badge/index.js +2117 -331
  11. package/dist/breadcrumbs/index.js +2126 -340
  12. package/dist/button/button.compact.d.ts +2 -0
  13. package/dist/button/index.js +2214 -342
  14. package/dist/button-dropdown/index.js +2120 -291
  15. package/dist/button-group/index.js +2117 -331
  16. package/dist/capacity/index.js +2117 -331
  17. package/dist/card/index.js +2127 -298
  18. package/dist/checkbox/index.js +2119 -290
  19. package/dist/code/index.js +2116 -297
  20. package/dist/collapse/index.js +2117 -475
  21. package/dist/description/index.js +2117 -331
  22. package/dist/display/index.js +2117 -331
  23. package/dist/divider/index.js +2118 -332
  24. package/dist/dot/index.js +2117 -331
  25. package/dist/drawer/index.js +2129 -439
  26. package/dist/fieldset/index.js +2121 -354
  27. package/dist/grid/index.js +2119 -333
  28. package/dist/image/index.js +2122 -336
  29. package/dist/index.d.ts +2 -14
  30. package/dist/index.js +3175 -1879
  31. package/dist/input/index.js +2125 -296
  32. package/dist/keyboard/index.js +2116 -297
  33. package/dist/link/index.js +2117 -331
  34. package/dist/list/index.js +2119 -333
  35. package/dist/loading/index.js +2117 -331
  36. package/dist/menu/index.js +77 -45
  37. package/dist/modal/index.js +2145 -452
  38. package/dist/note/index.js +2117 -331
  39. package/dist/page/index.js +2117 -331
  40. package/dist/pagination/index.js +2118 -351
  41. package/dist/popover/index.js +2123 -354
  42. package/dist/progress/index.js +2117 -331
  43. package/dist/radio/index.js +2120 -334
  44. package/dist/rating/index.js +2118 -332
  45. package/dist/row/index.js +2115 -296
  46. package/dist/select/index.js +2151 -688
  47. package/dist/slider/index.js +2123 -356
  48. package/dist/snippet/index.js +2118 -421
  49. package/dist/spacer/index.js +2115 -296
  50. package/dist/spinner/index.js +2117 -331
  51. package/dist/table/index.js +2341 -754
  52. package/dist/tabs/index.js +2123 -344
  53. package/dist/tag/index.js +2116 -254
  54. package/dist/text/index.js +2116 -297
  55. package/dist/textarea/index.js +2117 -288
  56. package/dist/toggle/index.js +2117 -331
  57. package/dist/tooltip/index.js +2120 -351
  58. package/dist/tree/index.js +2123 -459
  59. package/dist/use-input/index.js +2122 -24
  60. package/dist/use-modal/index.js +2122 -24
  61. package/dist/use-network-status/index.d.ts +2 -0
  62. package/dist/{use-current-state → use-network-status}/index.js +22 -15
  63. package/dist/use-network-status/use-netowork-status.d.ts +4 -0
  64. package/dist/use-scale/index.js +2115 -296
  65. package/dist/use-tabs/index.js +2122 -24
  66. package/dist/user/index.js +2123 -337
  67. package/esm/CurrencyInput/components/CurrencyInput.js +342 -0
  68. package/esm/CurrencyInput/components/CurrencyInputProps.js +1 -0
  69. package/esm/CurrencyInput/components/utils/addSeparators.js +7 -0
  70. package/esm/CurrencyInput/components/utils/cleanValue.js +69 -0
  71. package/esm/CurrencyInput/components/utils/escapeRegExp.js +8 -0
  72. package/esm/CurrencyInput/components/utils/fixedDecimalValue.js +29 -0
  73. package/esm/CurrencyInput/components/utils/formatValue.js +124 -0
  74. package/esm/CurrencyInput/components/utils/getLocaleConfig.js +47 -0
  75. package/esm/CurrencyInput/components/utils/getSuffix.js +10 -0
  76. package/esm/CurrencyInput/components/utils/index.js +8 -0
  77. package/esm/CurrencyInput/components/utils/isNumber.js +3 -0
  78. package/esm/CurrencyInput/components/utils/padTrimValue.js +27 -0
  79. package/esm/CurrencyInput/components/utils/parseAbbrValue.js +43 -0
  80. package/esm/CurrencyInput/components/utils/removeInvalidChars.js +10 -0
  81. package/esm/CurrencyInput/components/utils/removeSeparators.js +10 -0
  82. package/esm/CurrencyInput/components/utils/repositionCursor.js +35 -0
  83. package/esm/CurrencyInput/index.js +4 -0
  84. package/esm/LinearProgress/index.d.ts +2 -0
  85. package/esm/LinearProgress/index.js +2 -0
  86. package/esm/LinearProgress/linear-progress.d.ts +9 -0
  87. package/esm/LinearProgress/linear-progress.js +28 -0
  88. package/esm/Loadable/index.js +2 -0
  89. package/esm/PhoneInput/phone.js +22 -19
  90. package/esm/auto-complete/auto-complete-dropdown.js +1 -3
  91. package/esm/auto-complete/auto-complete-item.js +1 -3
  92. package/esm/auto-complete/auto-complete-searching.js +1 -1
  93. package/esm/auto-complete/auto-complete.js +1 -1
  94. package/esm/avatar/avatar-group.js +1 -2
  95. package/esm/avatar/avatar.js +1 -2
  96. package/esm/badge/badge.js +1 -2
  97. package/esm/breadcrumbs/breadcrumbs-item.js +1 -1
  98. package/esm/breadcrumbs/breadcrumbs-separator.js +1 -1
  99. package/esm/breadcrumbs/breadcrumbs.js +1 -1
  100. package/esm/button/button-icon.js +1 -1
  101. package/esm/button/button.compact.d.ts +2 -0
  102. package/esm/button/button.compact.js +94 -50
  103. package/esm/button/button.js +1 -2
  104. package/esm/button/utils.js +1 -1
  105. package/esm/button-dropdown/button-dropdown-item.js +1 -1
  106. package/esm/button-dropdown/button-dropdown.js +1 -2
  107. package/esm/button-group/button-group.js +1 -2
  108. package/esm/capacity/capacity.js +1 -2
  109. package/esm/card/card-content.js +1 -1
  110. package/esm/card/card-footer.js +1 -2
  111. package/esm/card/card.js +1 -2
  112. package/esm/carousal/Arrow.js +18 -0
  113. package/esm/carousal/Indicator.js +20 -0
  114. package/esm/carousal/Thumbs.js +302 -0
  115. package/esm/carousal/animations.js +162 -0
  116. package/esm/carousal/index.js +683 -0
  117. package/esm/carousal/types.js +1 -0
  118. package/esm/carousal/utils.js +49 -0
  119. package/esm/checkbox/checkbox-group.js +1 -1
  120. package/esm/checkbox/checkbox.icon.js +1 -1
  121. package/esm/checkbox/checkbox.js +1 -2
  122. package/esm/code/code.js +1 -1
  123. package/esm/collapse/collapse-group.js +1 -2
  124. package/esm/collapse/collapse.js +1 -4
  125. package/esm/description/description.js +1 -2
  126. package/esm/display/display.js +1 -2
  127. package/esm/divider/divider.js +1 -2
  128. package/esm/dot/dot.js +1 -2
  129. package/esm/drawer/drawer-wrapper.js +1 -3
  130. package/esm/drawer/drawer.js +1 -1
  131. package/esm/fieldset/fieldset-content.js +1 -1
  132. package/esm/fieldset/fieldset-footer.js +1 -1
  133. package/esm/fieldset/fieldset-group.js +1 -3
  134. package/esm/fieldset/fieldset-title.js +1 -1
  135. package/esm/fieldset/fieldset.js +1 -2
  136. package/esm/grid/basic-item.js +1 -2
  137. package/esm/grid/grid-container.js +1 -1
  138. package/esm/grid/grid.js +1 -1
  139. package/esm/image/image-browser.js +1 -2
  140. package/esm/image/image.js +1 -2
  141. package/esm/image/image.skeleton.js +1 -1
  142. package/esm/index.d.ts +2 -14
  143. package/esm/index.js +5 -9
  144. package/esm/input/input-block-label.js +1 -1
  145. package/esm/input/input-icon-clear.js +1 -2
  146. package/esm/input/input-label.js +1 -1
  147. package/esm/input/input.js +1 -2
  148. package/esm/keyboard/keyboard.js +1 -1
  149. package/esm/link/link.js +1 -2
  150. package/esm/list/list-item.js +1 -2
  151. package/esm/loading/loading.js +1 -2
  152. package/esm/modal/modal-action.js +1 -2
  153. package/esm/modal/modal-actions.js +1 -1
  154. package/esm/modal/modal-content.js +1 -1
  155. package/esm/modal/modal-subtitle.js +1 -1
  156. package/esm/modal/modal-title.js +1 -1
  157. package/esm/modal/modal-wrapper.js +1 -3
  158. package/esm/modal/modal.js +1 -1
  159. package/esm/note/note.js +1 -2
  160. package/esm/page/page-header.js +1 -1
  161. package/esm/page/page.js +1 -1
  162. package/esm/pagination/pagination-item.js +1 -2
  163. package/esm/pagination/pagination.js +1 -1
  164. package/esm/popover/popover-item.js +1 -2
  165. package/esm/popover/popover.js +1 -1
  166. package/esm/progress/progress.js +1 -2
  167. package/esm/radio/radio-description.js +1 -1
  168. package/esm/radio/radio-group.js +1 -1
  169. package/esm/radio/radio.js +1 -2
  170. package/esm/rating/rating.js +1 -2
  171. package/esm/row/row.js +1 -1
  172. package/esm/select/select-dropdown.js +1 -3
  173. package/esm/select/select-icon-clear.js +1 -1
  174. package/esm/select/select-multiple-value.js +1 -1
  175. package/esm/select/select-option.js +1 -3
  176. package/esm/select/select.js +9 -12
  177. package/esm/slider/slider-dot.js +1 -2
  178. package/esm/slider/slider-mark.js +1 -1
  179. package/esm/slider/slider.js +1 -3
  180. package/esm/snippet/snippet.js +1 -3
  181. package/esm/spinner/spinner.js +1 -2
  182. package/esm/table/table-body.js +1 -2
  183. package/esm/table/table-head.js +3 -2
  184. package/esm/tabs/tabs-item.js +1 -2
  185. package/esm/tabs/tabs.js +1 -3
  186. package/esm/tag/tag.js +1 -1
  187. package/esm/text/child.js +1 -1
  188. package/esm/textarea/textarea.js +1 -2
  189. package/esm/toggle/toggle.js +1 -2
  190. package/esm/tooltip/tooltip-content.js +1 -3
  191. package/esm/tooltip/tooltip-icon.js +1 -1
  192. package/esm/tooltip/tooltip.js +1 -1
  193. package/esm/tree/tree-file-icon.js +1 -1
  194. package/esm/tree/tree-file.js +1 -2
  195. package/esm/tree/tree-folder-icon.js +1 -1
  196. package/esm/tree/tree-folder.js +1 -3
  197. package/esm/tree/tree-status-icon.js +1 -1
  198. package/esm/tree/tree.js +1 -1
  199. package/esm/use-input/use-input.js +1 -1
  200. package/esm/use-modal/use-modal.js +1 -1
  201. package/esm/use-network-status/index.d.ts +2 -0
  202. package/esm/use-network-status/index.js +2 -0
  203. package/esm/use-network-status/use-netowork-status.d.ts +4 -0
  204. package/esm/use-network-status/use-netowork-status.js +29 -0
  205. package/esm/use-scale/with-scale.js +1 -1
  206. package/esm/use-tabs/use-tabs.js +1 -1
  207. package/esm/user/user.js +1 -2
  208. package/esm/utils/use-context-state/use-context-state.js +1 -1
  209. package/esm/utils/use-drag.js +1 -1
  210. package/package.json +12 -4
  211. package/dist/css-baseline/css-baseline.d.ts +0 -9
  212. package/dist/css-baseline/index.d.ts +0 -1
  213. package/dist/shared/backdrop.d.ts +0 -14
  214. package/dist/shared/css-transition.d.ts +0 -13
  215. package/dist/shared/dropdown.d.ts +0 -9
  216. package/dist/shared/ellipsis.d.ts +0 -6
  217. package/dist/shared/expand.d.ts +0 -7
  218. package/dist/shared/highlight.d.ts +0 -13
  219. package/dist/ui-provider/index.d.ts +0 -3
  220. package/dist/ui-provider/index.js +0 -2186
  221. package/dist/ui-provider/theme-provider.d.ts +0 -8
  222. package/dist/ui-provider/ui-provider.d.ts +0 -8
  223. package/dist/use-all-themes/all-themes-context.d.ts +0 -7
  224. package/dist/use-all-themes/index.d.ts +0 -3
  225. package/dist/use-all-themes/index.js +0 -311
  226. package/dist/use-classes/index.d.ts +0 -2
  227. package/dist/use-classes/index.js +0 -48
  228. package/dist/use-classes/use-classes.d.ts +0 -4
  229. package/dist/use-current-state/index.d.ts +0 -2
  230. package/dist/use-current-state/use-current-state.d.ts +0 -4
  231. package/dist/use-media-query/index.d.ts +0 -3
  232. package/dist/use-media-query/index.js +0 -444
  233. package/dist/use-media-query/use-media-query.d.ts +0 -12
  234. package/dist/use-theme/index.d.ts +0 -2
  235. package/dist/use-theme/index.js +0 -309
  236. package/dist/use-theme/theme-context.d.ts +0 -4
  237. package/dist/use-toasts/helpers.d.ts +0 -18
  238. package/dist/use-toasts/index.d.ts +0 -3
  239. package/dist/use-toasts/index.js +0 -204
  240. package/dist/use-toasts/toast-container.d.ts +0 -3
  241. package/dist/use-toasts/toast-item.d.ts +0 -8
  242. package/dist/use-toasts/use-toast.d.ts +0 -40
  243. package/dist/utils/use-current-state.d.ts +0 -2
  244. package/dist/utils/use-dom-observer.d.ts +0 -3
  245. package/dist/utils/use-hd-ui-context.d.ts +0 -16
  246. package/dist/utils/use-previous.d.ts +0 -2
  247. package/esm/captcha/index.js +0 -128
  248. package/esm/css-baseline/css-baseline.d.ts +0 -9
  249. package/esm/css-baseline/css-baseline.js +0 -23
  250. package/esm/css-baseline/index.d.ts +0 -1
  251. package/esm/css-baseline/index.js +0 -2
  252. package/esm/shared/backdrop.d.ts +0 -14
  253. package/esm/shared/backdrop.js +0 -66
  254. package/esm/shared/css-transition.d.ts +0 -13
  255. package/esm/shared/css-transition.js +0 -65
  256. package/esm/shared/dropdown.d.ts +0 -9
  257. package/esm/shared/dropdown.js +0 -99
  258. package/esm/shared/ellipsis.d.ts +0 -6
  259. package/esm/shared/ellipsis.js +0 -13
  260. package/esm/shared/expand.d.ts +0 -7
  261. package/esm/shared/expand.js +0 -86
  262. package/esm/shared/highlight.d.ts +0 -13
  263. package/esm/shared/highlight.js +0 -46
  264. package/esm/ui-provider/index.d.ts +0 -3
  265. package/esm/ui-provider/index.js +0 -4
  266. package/esm/ui-provider/theme-provider.d.ts +0 -8
  267. package/esm/ui-provider/theme-provider.js +0 -45
  268. package/esm/ui-provider/ui-provider.d.ts +0 -8
  269. package/esm/ui-provider/ui-provider.js +0 -55
  270. package/esm/use-all-themes/all-themes-context.d.ts +0 -7
  271. package/esm/use-all-themes/all-themes-context.js +0 -11
  272. package/esm/use-all-themes/index.d.ts +0 -3
  273. package/esm/use-all-themes/index.js +0 -2
  274. package/esm/use-classes/index.d.ts +0 -2
  275. package/esm/use-classes/index.js +0 -2
  276. package/esm/use-classes/use-classes.d.ts +0 -4
  277. package/esm/use-classes/use-classes.js +0 -34
  278. package/esm/use-current-state/index.d.ts +0 -2
  279. package/esm/use-current-state/index.js +0 -2
  280. package/esm/use-current-state/use-current-state.d.ts +0 -4
  281. package/esm/use-current-state/use-current-state.js +0 -23
  282. package/esm/use-media-query/index.d.ts +0 -3
  283. package/esm/use-media-query/index.js +0 -2
  284. package/esm/use-media-query/use-media-query.d.ts +0 -12
  285. package/esm/use-media-query/use-media-query.js +0 -81
  286. package/esm/use-theme/index.d.ts +0 -2
  287. package/esm/use-theme/index.js +0 -2
  288. package/esm/use-theme/theme-context.d.ts +0 -4
  289. package/esm/use-theme/theme-context.js +0 -9
  290. package/esm/use-toasts/helpers.d.ts +0 -18
  291. package/esm/use-toasts/helpers.js +0 -68
  292. package/esm/use-toasts/index.d.ts +0 -3
  293. package/esm/use-toasts/index.js +0 -2
  294. package/esm/use-toasts/toast-container.d.ts +0 -3
  295. package/esm/use-toasts/toast-container.js +0 -120
  296. package/esm/use-toasts/toast-item.d.ts +0 -8
  297. package/esm/use-toasts/toast-item.js +0 -45
  298. package/esm/use-toasts/use-toast.d.ts +0 -40
  299. package/esm/use-toasts/use-toast.js +0 -103
  300. package/esm/utils/use-current-state.d.ts +0 -2
  301. package/esm/utils/use-current-state.js +0 -2
  302. package/esm/utils/use-dom-observer.d.ts +0 -3
  303. package/esm/utils/use-hd-ui-context.d.ts +0 -16
  304. package/esm/utils/use-previous.d.ts +0 -2
@@ -1,309 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
-
7
- function _defineProperty(e, r, t) {
8
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
9
- value: t,
10
- enumerable: true,
11
- configurable: true,
12
- writable: true
13
- }) : e[r] = t, e;
14
- }
15
- function ownKeys(e, r) {
16
- var t = Object.keys(e);
17
- if (Object.getOwnPropertySymbols) {
18
- var o = Object.getOwnPropertySymbols(e);
19
- r && (o = o.filter(function (r) {
20
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
21
- })), t.push.apply(t, o);
22
- }
23
- return t;
24
- }
25
- function _objectSpread2(e) {
26
- for (var r = 1; r < arguments.length; r++) {
27
- var t = null != arguments[r] ? arguments[r] : {};
28
- r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
29
- _defineProperty(e, r, t[r]);
30
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
31
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
32
- });
33
- }
34
- return e;
35
- }
36
- function _toPrimitive(t, r) {
37
- if ("object" != typeof t || !t) return t;
38
- var e = t[Symbol.toPrimitive];
39
- if (void 0 !== e) {
40
- var i = e.call(t, r);
41
- if ("object" != typeof i) return i;
42
- throw new TypeError("@@toPrimitive must return a primitive value.");
43
- }
44
- return ("string" === r ? String : Number)(t);
45
- }
46
- function _toPropertyKey(t) {
47
- var i = _toPrimitive(t, "string");
48
- return "symbol" == typeof i ? i : i + "";
49
- }
50
- function _typeof(o) {
51
- "@babel/helpers - typeof";
52
-
53
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
54
- return typeof o;
55
- } : function (o) {
56
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
57
- }, _typeof(o);
58
- }
59
-
60
- var defaultFont = {
61
- sans: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',
62
- mono: 'Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace',
63
- prism: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,"Liberation Mono", "Courier New", monospace'
64
- };
65
- var defaultBreakpoints = {
66
- xs: {
67
- min: '0',
68
- max: '650px'
69
- },
70
- sm: {
71
- min: '650px',
72
- max: '900px'
73
- },
74
- md: {
75
- min: '900px',
76
- max: '1280px'
77
- },
78
- lg: {
79
- min: '1280px',
80
- max: '1920px'
81
- },
82
- xl: {
83
- min: '1920px',
84
- max: '10000px'
85
- }
86
- };
87
- var defaultLayout = {
88
- gap: '16pt',
89
- gapNegative: '-16pt',
90
- gapHalf: '8pt',
91
- gapHalfNegative: '-8pt',
92
- gapQuarter: '4pt',
93
- gapQuarterNegative: '-4pt',
94
- pageMargin: '16pt',
95
- pageWidth: '750pt',
96
- pageWidthWithMargin: '782pt',
97
- breakpointMobile: defaultBreakpoints.xs.max,
98
- breakpointTablet: defaultBreakpoints.sm.max,
99
- radius: '6px',
100
- unit: '16px'
101
- };
102
-
103
- var palette$1 = {
104
- accents_1: '#fafafa',
105
- accents_2: '#eaeaea',
106
- accents_3: '#999',
107
- accents_4: '#888',
108
- accents_5: '#666',
109
- accents_6: '#444',
110
- accents_7: '#333',
111
- accents_8: '#111',
112
- background: '#fff',
113
- foreground: '#000',
114
- selection: '#79ffe1',
115
- secondary: '#666',
116
- code: '#f81ce5',
117
- border: '#eaeaea',
118
- error: '#e00',
119
- errorLight: '#ff1a1a',
120
- errorLighter: '#f7d4d6',
121
- errorDark: '#c50000',
122
- success: '#0070f3',
123
- successLight: '#3291ff',
124
- successLighter: '#d3e5ff',
125
- successDark: '#0761d1',
126
- warning: '#f5a623',
127
- warningLight: '#f7b955',
128
- warningLighter: '#ffefcf',
129
- warningDark: '#ab570a',
130
- cyan: '#50e3c2',
131
- cyanLighter: '#aaffec',
132
- cyanLight: '#79ffe1',
133
- cyanDark: '#29bc9b',
134
- violet: '#7928ca',
135
- violetLighter: '#e3d7fc',
136
- violetLight: '#8a63d2',
137
- violetDark: '#4c2889',
138
- purple: '#f81ce5',
139
- alert: '#ff0080',
140
- magenta: '#eb367f',
141
- link: '#0070f3'
142
- };
143
- var expressiveness$1 = {
144
- linkStyle: 'none',
145
- linkHoverStyle: 'none',
146
- dropdownBoxShadow: '0 4px 4px 0 rgba(0, 0, 0, 0.02)',
147
- scrollerStart: 'rgba(255, 255, 255, 1)',
148
- scrollerEnd: 'rgba(255, 255, 255, 0)',
149
- shadowSmall: '0 5px 10px rgba(0, 0, 0, 0.12)',
150
- shadowMedium: '0 8px 30px rgba(0, 0, 0, 0.12)',
151
- shadowLarge: '0 30px 60px rgba(0, 0, 0, 0.12)',
152
- portalOpacity: 0.25
153
- };
154
- var font$1 = defaultFont;
155
- var breakpoints$1 = defaultBreakpoints;
156
- var layout$1 = defaultLayout;
157
- var themes$1 = {
158
- type: 'light',
159
- font: font$1,
160
- layout: layout$1,
161
- palette: palette$1,
162
- breakpoints: breakpoints$1,
163
- expressiveness: expressiveness$1
164
- };
165
-
166
- var palette = {
167
- accents_1: '#111',
168
- accents_2: '#333',
169
- accents_3: '#444',
170
- accents_4: '#666',
171
- accents_5: '#888',
172
- accents_6: '#999',
173
- accents_7: '#eaeaea',
174
- accents_8: '#fafafa',
175
- background: '#000',
176
- foreground: '#fff',
177
- selection: '#f81ce5',
178
- secondary: '#888',
179
- code: '#79ffe1',
180
- border: '#333',
181
- error: '#e00',
182
- errorLighter: '#f7d4d6',
183
- errorLight: '#ff1a1a',
184
- errorDark: '#c50000',
185
- success: '#0070f3',
186
- successLighter: '#d3e5ff',
187
- successLight: '#3291ff',
188
- successDark: '#0761d1',
189
- warning: '#f5a623',
190
- warningLighter: '#ffefcf',
191
- warningLight: '#f7b955',
192
- warningDark: '#ab570a',
193
- cyan: '#50e3c2',
194
- cyanLighter: '#aaffec',
195
- cyanLight: '#79ffe1',
196
- cyanDark: '#29bc9b',
197
- violet: '#7928ca',
198
- violetLighter: '#e3d7fc',
199
- violetLight: '#8a63d2',
200
- violetDark: '#4c2889',
201
- purple: '#f81ce5',
202
- alert: '#ff0080',
203
- magenta: '#eb367f',
204
- link: '#3291ff'
205
- };
206
- var expressiveness = {
207
- linkStyle: 'none',
208
- linkHoverStyle: 'none',
209
- dropdownBoxShadow: '0 0 0 1px #333',
210
- scrollerStart: 'rgba(255, 255, 255, 1)',
211
- scrollerEnd: 'rgba(255, 255, 255, 0)',
212
- shadowSmall: '0 0 0 1px #333',
213
- shadowMedium: '0 0 0 1px #333',
214
- shadowLarge: '0 0 0 1px #333',
215
- portalOpacity: 0.75
216
- };
217
- var font = defaultFont;
218
- var breakpoints = defaultBreakpoints;
219
- var layout = defaultLayout;
220
- var themes = {
221
- type: 'dark',
222
- font: font,
223
- layout: layout,
224
- palette: palette,
225
- breakpoints: breakpoints,
226
- expressiveness: expressiveness
227
- };
228
-
229
- var isObject = function isObject(target) {
230
- return target && _typeof(target) === 'object';
231
- };
232
- var _deepDuplicable = function deepDuplicable(source, target) {
233
- if (!isObject(target) || !isObject(source)) return source;
234
- var sourceKeys = Object.keys(source);
235
- var result = {};
236
- for (var _i = 0, _sourceKeys = sourceKeys; _i < _sourceKeys.length; _i++) {
237
- var key = _sourceKeys[_i];
238
- var sourceValue = source[key];
239
- var targetValue = target[key];
240
- if (Array.isArray(sourceValue) && Array.isArray(targetValue)) {
241
- result[key] = targetValue.concat(sourceValue);
242
- } else if (isObject(sourceValue) && isObject(targetValue)) {
243
- result[key] = _deepDuplicable(sourceValue, _objectSpread2({}, targetValue));
244
- } else if (targetValue) {
245
- result[key] = targetValue;
246
- } else {
247
- result[key] = sourceValue;
248
- }
249
- }
250
- return result;
251
- };
252
- var getPresets = function getPresets() {
253
- return [themes$1, themes];
254
- };
255
- var getPresetStaticTheme = function getPresetStaticTheme() {
256
- return themes$1;
257
- };
258
- var isAvailableThemeType = function isAvailableThemeType(type) {
259
- if (!type) return false;
260
- var presetThemes = getPresets();
261
- var hasType = presetThemes.find(function (theme) {
262
- return theme.type === type;
263
- });
264
- return !hasType;
265
- };
266
- var isPresetTheme = function isPresetTheme(themeOrType) {
267
- if (!themeOrType) return false;
268
- var isType = typeof themeOrType === 'string';
269
- var type = isType ? themeOrType : themeOrType.type;
270
- return !isAvailableThemeType(type);
271
- };
272
- var hasUserCustomTheme = function hasUserCustomTheme() {
273
- var themes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
274
- return !!themes.find(function (item) {
275
- return isAvailableThemeType(item.type);
276
- });
277
- };
278
- var create = function create(base, custom) {
279
- if (!isAvailableThemeType(custom.type)) {
280
- throw new Error('Duplicate or unavailable theme type');
281
- }
282
- return _deepDuplicable(base, custom);
283
- };
284
- var createFromDark = function createFromDark(custom) {
285
- return create(themes, custom);
286
- };
287
- var createFromLight = function createFromLight(custom) {
288
- return create(themes$1, custom);
289
- };
290
- var Themes = {
291
- isPresetTheme: isPresetTheme,
292
- isAvailableThemeType: isAvailableThemeType,
293
- hasUserCustomTheme: hasUserCustomTheme,
294
- getPresets: getPresets,
295
- getPresetStaticTheme: getPresetStaticTheme,
296
- create: create,
297
- createFromDark: createFromDark,
298
- createFromLight: createFromLight
299
- };
300
-
301
- /* "use client" */
302
-
303
- var defaultTheme = Themes.getPresetStaticTheme();
304
- var ThemeContext = /*#__PURE__*/React.createContext(defaultTheme);
305
- var useTheme = function useTheme() {
306
- return React.useContext(ThemeContext);
307
- };
308
-
309
- exports.default = useTheme;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { HUIThemes } from '../themes/presets';
3
- export declare const ThemeContext: React.Context<HUIThemes>;
4
- export declare const useTheme: () => HUIThemes;
@@ -1,18 +0,0 @@
1
- import { Toast } from './use-toast';
2
- import React from 'react';
3
- import { HUIThemesPalette } from '../themes';
4
- import { NormalTypes } from '../utils/prop-types';
5
- export declare const makeToastActions: (actions: Toast["actions"], cancelHandle: () => void) => React.JSX.Element[] | null;
6
- export declare const getColors: (palette: HUIThemesPalette, type?: NormalTypes) => {
7
- bgColor: string;
8
- color: string;
9
- };
10
- declare const toastPlacement: ["topLeft", "topRight", "bottomLeft", "bottomRight"];
11
- export type ToastPlacement = typeof toastPlacement[number];
12
- export declare const isTopPlacement: (placement: ToastPlacement) => boolean;
13
- export declare const isLeftPlacement: (placement: ToastPlacement) => boolean;
14
- export declare const getTranslateByPlacement: (placement: ToastPlacement) => {
15
- enter: string;
16
- leave: string;
17
- };
18
- export {};
@@ -1,3 +0,0 @@
1
- import useToasts from './use-toast';
2
- export type { ToastAction, Toast, ToastTypes, ToastInput, ToastLayout } from './use-toast';
3
- export default useToasts;
@@ -1,204 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
-
7
- function _arrayLikeToArray(r, a) {
8
- (null == a || a > r.length) && (a = r.length);
9
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
10
- return n;
11
- }
12
- function _arrayWithoutHoles(r) {
13
- if (Array.isArray(r)) return _arrayLikeToArray(r);
14
- }
15
- function _defineProperty(e, r, t) {
16
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
17
- value: t,
18
- enumerable: true,
19
- configurable: true,
20
- writable: true
21
- }) : e[r] = t, e;
22
- }
23
- function _iterableToArray(r) {
24
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
25
- }
26
- function _nonIterableSpread() {
27
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
28
- }
29
- function ownKeys(e, r) {
30
- var t = Object.keys(e);
31
- if (Object.getOwnPropertySymbols) {
32
- var o = Object.getOwnPropertySymbols(e);
33
- r && (o = o.filter(function (r) {
34
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
35
- })), t.push.apply(t, o);
36
- }
37
- return t;
38
- }
39
- function _objectSpread2(e) {
40
- for (var r = 1; r < arguments.length; r++) {
41
- var t = null != arguments[r] ? arguments[r] : {};
42
- r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
43
- _defineProperty(e, r, t[r]);
44
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
45
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
46
- });
47
- }
48
- return e;
49
- }
50
- function _toConsumableArray(r) {
51
- return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
52
- }
53
- function _toPrimitive(t, r) {
54
- if ("object" != typeof t || !t) return t;
55
- var e = t[Symbol.toPrimitive];
56
- if (void 0 !== e) {
57
- var i = e.call(t, r);
58
- if ("object" != typeof i) return i;
59
- throw new TypeError("@@toPrimitive must return a primitive value.");
60
- }
61
- return ("string" === r ? String : Number)(t);
62
- }
63
- function _toPropertyKey(t) {
64
- var i = _toPrimitive(t, "string");
65
- return "symbol" == typeof i ? i : i + "";
66
- }
67
- function _unsupportedIterableToArray(r, a) {
68
- if (r) {
69
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
70
- var t = {}.toString.call(r).slice(8, -1);
71
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
72
- }
73
- }
74
-
75
- var defaultToastLayout = {
76
- padding: '12px 16px',
77
- margin: '8px 0',
78
- width: '420px',
79
- maxWidth: '90vw',
80
- maxHeight: '75px',
81
- placement: 'bottomRight'
82
- };
83
- var defaultParams = {
84
- toasts: [],
85
- toastLayout: defaultToastLayout,
86
- updateToastLayout: function updateToastLayout(t) {
87
- return t;
88
- },
89
- updateToasts: function updateToasts(t) {
90
- return t;
91
- },
92
- lastUpdateToastId: null,
93
- updateLastToastId: function updateLastToastId() {
94
- return null;
95
- }
96
- };
97
- var HUIContent = /*#__PURE__*/React.createContext(defaultParams);
98
- var useHUIContext = function useHUIContext() {
99
- return React.useContext(HUIContent);
100
- };
101
-
102
- /* "use client" */
103
-
104
- var getId = function getId() {
105
- return Math.random().toString(32).slice(2, 10);
106
- };
107
-
108
- var defaultToast = {
109
- delay: 2000,
110
- type: 'default'
111
- };
112
- var useToasts = function useToasts(layout) {
113
- var _useHUIContext = useHUIContext(),
114
- updateToasts = _useHUIContext.updateToasts,
115
- toasts = _useHUIContext.toasts,
116
- updateToastLayout = _useHUIContext.updateToastLayout,
117
- updateLastToastId = _useHUIContext.updateLastToastId;
118
- React.useEffect(function () {
119
- if (!layout) return;
120
- updateToastLayout(function () {
121
- return layout ? _objectSpread2(_objectSpread2({}, defaultToastLayout), layout) : defaultToastLayout;
122
- });
123
- }, []);
124
- var _cancel = function cancel(internalId) {
125
- updateToasts(function (currentToasts) {
126
- return currentToasts.map(function (item) {
127
- if (item._internalIdent !== internalId) return item;
128
- return _objectSpread2(_objectSpread2({}, item), {}, {
129
- visible: false
130
- });
131
- });
132
- });
133
- updateLastToastId(function () {
134
- return internalId;
135
- });
136
- };
137
- var removeAll = function removeAll() {
138
- updateToasts(function (last) {
139
- return last.map(function (toast) {
140
- return _objectSpread2(_objectSpread2({}, toast), {}, {
141
- visible: false
142
- });
143
- });
144
- });
145
- };
146
- var findToastOneByID = function findToastOneByID(id) {
147
- return toasts.find(function (t) {
148
- return t.id === id;
149
- });
150
- };
151
- var removeToastOneByID = function removeToastOneByID(id) {
152
- updateToasts(function (last) {
153
- return last.map(function (toast) {
154
- if (toast.id !== id) return toast;
155
- return _objectSpread2(_objectSpread2({}, toast), {}, {
156
- visible: false
157
- });
158
- });
159
- });
160
- };
161
- var setToast = function setToast(toast) {
162
- var internalIdent = "toast-".concat(getId());
163
- var delay = toast.delay || defaultToast.delay;
164
- if (toast.id) {
165
- var hasIdent = toasts.find(function (t) {
166
- return t.id === toast.id;
167
- });
168
- if (hasIdent) {
169
- throw new Error('Toast: Already have the same key: "ident"');
170
- }
171
- }
172
- updateToasts(function (last) {
173
- var newToast = {
174
- delay: delay,
175
- text: toast.text,
176
- visible: true,
177
- type: toast.type || defaultToast.type,
178
- id: toast.id || internalIdent,
179
- actions: toast.actions || [],
180
- _internalIdent: internalIdent,
181
- _timeout: window.setTimeout(function () {
182
- _cancel(internalIdent);
183
- if (newToast._timeout) {
184
- window.clearTimeout(newToast._timeout);
185
- newToast._timeout = null;
186
- }
187
- }, delay),
188
- cancel: function cancel() {
189
- return _cancel(internalIdent);
190
- }
191
- };
192
- return [].concat(_toConsumableArray(last), [newToast]);
193
- });
194
- };
195
- return {
196
- toasts: toasts,
197
- setToast: setToast,
198
- removeAll: removeAll,
199
- findToastOneByID: findToastOneByID,
200
- removeToastOneByID: removeToastOneByID
201
- };
202
- };
203
-
204
- exports.default = useToasts;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const ToastContainer: React.FC<React.PropsWithChildren<unknown>>;
3
- export default ToastContainer;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import type { Toast, ToastLayout } from './use-toast';
3
- export interface ToastItemProps {
4
- toast: Toast;
5
- layout: Required<ToastLayout>;
6
- }
7
- declare const ToastItem: React.FC<ToastItemProps>;
8
- export default ToastItem;
@@ -1,40 +0,0 @@
1
- import React, { CSSProperties } from 'react';
2
- import type { NormalTypes } from '../utils/prop-types';
3
- import { ToastPlacement } from '../use-toasts/helpers';
4
- export interface ToastAction {
5
- name: string;
6
- handler: (event: React.MouseEvent<HTMLButtonElement>, cancel: () => void) => void;
7
- passive?: boolean;
8
- }
9
- export type ToastTypes = NormalTypes;
10
- export type ToastLayout = {
11
- padding?: CSSProperties['padding'];
12
- margin?: CSSProperties['margin'];
13
- width?: CSSProperties['width'];
14
- maxWidth?: CSSProperties['maxWidth'];
15
- maxHeight?: CSSProperties['maxHeight'];
16
- placement?: ToastPlacement;
17
- };
18
- export interface ToastInput {
19
- text: string | React.ReactNode;
20
- type?: ToastTypes;
21
- id?: string;
22
- delay?: number;
23
- actions?: Array<ToastAction>;
24
- }
25
- export type ToastInstance = {
26
- visible: boolean;
27
- cancel: () => void;
28
- _timeout: null | number;
29
- _internalIdent: string;
30
- };
31
- export type Toast = Required<ToastInput> & ToastInstance;
32
- export type ToastHooksResult = {
33
- toasts: Array<Toast>;
34
- setToast: (toast: ToastInput) => void;
35
- removeAll: () => void;
36
- findToastOneByID: (ident: string) => Toast | undefined;
37
- removeToastOneByID: (ident: string) => void;
38
- };
39
- declare const useToasts: (layout?: ToastLayout) => ToastHooksResult;
40
- export default useToasts;
@@ -1,2 +0,0 @@
1
- import useCurrentState from '../use-current-state';
2
- export default useCurrentState;
@@ -1,3 +0,0 @@
1
- import { MutableRefObject } from 'react';
2
- declare const useDOMObserver: (ref: MutableRefObject<HTMLElement | null> | undefined, callback?: MutationCallback) => void;
3
- export default useDOMObserver;
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- import type { ToastLayout, Toast } from '../use-toasts/use-toast';
3
- export declare const defaultToastLayout: Required<ToastLayout>;
4
- export type UpdateToastsFunction = (fn: (toasts: Array<Toast>) => Array<Toast>) => any;
5
- export type UpdateToastsLayoutFunction = (fn: (layout: Required<ToastLayout>) => Required<ToastLayout>) => any;
6
- export type UpdateToastsIDFunction = (fn: () => string | null) => any;
7
- export interface HUIContextParams {
8
- toasts: Array<Toast>;
9
- updateToasts: UpdateToastsFunction;
10
- toastLayout: Required<ToastLayout>;
11
- updateToastLayout: UpdateToastsLayoutFunction;
12
- lastUpdateToastId: string | null;
13
- updateLastToastId: UpdateToastsIDFunction;
14
- }
15
- export declare const HUIContent: React.Context<HUIContextParams>;
16
- export declare const useHUIContext: () => HUIContextParams;
@@ -1,2 +0,0 @@
1
- declare const usePrevious: <T>(state: T) => T | undefined | null;
2
- export default usePrevious;