@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,444 +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 _arrayWithHoles(r) {
13
- if (Array.isArray(r)) return 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 _iterableToArrayLimit(r, l) {
24
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
25
- if (null != t) {
26
- var e,
27
- n,
28
- i,
29
- u,
30
- a = [],
31
- f = true,
32
- o = false;
33
- try {
34
- if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
35
- } catch (r) {
36
- o = true, n = r;
37
- } finally {
38
- try {
39
- if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
40
- } finally {
41
- if (o) throw n;
42
- }
43
- }
44
- return a;
45
- }
46
- }
47
- function _nonIterableRest() {
48
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
49
- }
50
- function ownKeys(e, r) {
51
- var t = Object.keys(e);
52
- if (Object.getOwnPropertySymbols) {
53
- var o = Object.getOwnPropertySymbols(e);
54
- r && (o = o.filter(function (r) {
55
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
56
- })), t.push.apply(t, o);
57
- }
58
- return t;
59
- }
60
- function _objectSpread2(e) {
61
- for (var r = 1; r < arguments.length; r++) {
62
- var t = null != arguments[r] ? arguments[r] : {};
63
- r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
64
- _defineProperty(e, r, t[r]);
65
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
66
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
67
- });
68
- }
69
- return e;
70
- }
71
- function _slicedToArray(r, e) {
72
- return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
73
- }
74
- function _toPrimitive(t, r) {
75
- if ("object" != typeof t || !t) return t;
76
- var e = t[Symbol.toPrimitive];
77
- if (void 0 !== e) {
78
- var i = e.call(t, r);
79
- if ("object" != typeof i) return i;
80
- throw new TypeError("@@toPrimitive must return a primitive value.");
81
- }
82
- return ("string" === r ? String : Number)(t);
83
- }
84
- function _toPropertyKey(t) {
85
- var i = _toPrimitive(t, "string");
86
- return "symbol" == typeof i ? i : i + "";
87
- }
88
- function _typeof(o) {
89
- "@babel/helpers - typeof";
90
-
91
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
92
- return typeof o;
93
- } : function (o) {
94
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
95
- }, _typeof(o);
96
- }
97
- function _unsupportedIterableToArray(r, a) {
98
- if (r) {
99
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
100
- var t = {}.toString.call(r).slice(8, -1);
101
- 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;
102
- }
103
- }
104
-
105
- var defaultFont = {
106
- sans: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',
107
- mono: 'Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace',
108
- prism: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,"Liberation Mono", "Courier New", monospace'
109
- };
110
- var defaultBreakpoints = {
111
- xs: {
112
- min: '0',
113
- max: '650px'
114
- },
115
- sm: {
116
- min: '650px',
117
- max: '900px'
118
- },
119
- md: {
120
- min: '900px',
121
- max: '1280px'
122
- },
123
- lg: {
124
- min: '1280px',
125
- max: '1920px'
126
- },
127
- xl: {
128
- min: '1920px',
129
- max: '10000px'
130
- }
131
- };
132
- var defaultLayout = {
133
- gap: '16pt',
134
- gapNegative: '-16pt',
135
- gapHalf: '8pt',
136
- gapHalfNegative: '-8pt',
137
- gapQuarter: '4pt',
138
- gapQuarterNegative: '-4pt',
139
- pageMargin: '16pt',
140
- pageWidth: '750pt',
141
- pageWidthWithMargin: '782pt',
142
- breakpointMobile: defaultBreakpoints.xs.max,
143
- breakpointTablet: defaultBreakpoints.sm.max,
144
- radius: '6px',
145
- unit: '16px'
146
- };
147
-
148
- var palette$1 = {
149
- accents_1: '#fafafa',
150
- accents_2: '#eaeaea',
151
- accents_3: '#999',
152
- accents_4: '#888',
153
- accents_5: '#666',
154
- accents_6: '#444',
155
- accents_7: '#333',
156
- accents_8: '#111',
157
- background: '#fff',
158
- foreground: '#000',
159
- selection: '#79ffe1',
160
- secondary: '#666',
161
- code: '#f81ce5',
162
- border: '#eaeaea',
163
- error: '#e00',
164
- errorLight: '#ff1a1a',
165
- errorLighter: '#f7d4d6',
166
- errorDark: '#c50000',
167
- success: '#0070f3',
168
- successLight: '#3291ff',
169
- successLighter: '#d3e5ff',
170
- successDark: '#0761d1',
171
- warning: '#f5a623',
172
- warningLight: '#f7b955',
173
- warningLighter: '#ffefcf',
174
- warningDark: '#ab570a',
175
- cyan: '#50e3c2',
176
- cyanLighter: '#aaffec',
177
- cyanLight: '#79ffe1',
178
- cyanDark: '#29bc9b',
179
- violet: '#7928ca',
180
- violetLighter: '#e3d7fc',
181
- violetLight: '#8a63d2',
182
- violetDark: '#4c2889',
183
- purple: '#f81ce5',
184
- alert: '#ff0080',
185
- magenta: '#eb367f',
186
- link: '#0070f3'
187
- };
188
- var expressiveness$1 = {
189
- linkStyle: 'none',
190
- linkHoverStyle: 'none',
191
- dropdownBoxShadow: '0 4px 4px 0 rgba(0, 0, 0, 0.02)',
192
- scrollerStart: 'rgba(255, 255, 255, 1)',
193
- scrollerEnd: 'rgba(255, 255, 255, 0)',
194
- shadowSmall: '0 5px 10px rgba(0, 0, 0, 0.12)',
195
- shadowMedium: '0 8px 30px rgba(0, 0, 0, 0.12)',
196
- shadowLarge: '0 30px 60px rgba(0, 0, 0, 0.12)',
197
- portalOpacity: 0.25
198
- };
199
- var font$1 = defaultFont;
200
- var breakpoints$1 = defaultBreakpoints;
201
- var layout$1 = defaultLayout;
202
- var themes$1 = {
203
- type: 'light',
204
- font: font$1,
205
- layout: layout$1,
206
- palette: palette$1,
207
- breakpoints: breakpoints$1,
208
- expressiveness: expressiveness$1
209
- };
210
-
211
- var palette = {
212
- accents_1: '#111',
213
- accents_2: '#333',
214
- accents_3: '#444',
215
- accents_4: '#666',
216
- accents_5: '#888',
217
- accents_6: '#999',
218
- accents_7: '#eaeaea',
219
- accents_8: '#fafafa',
220
- background: '#000',
221
- foreground: '#fff',
222
- selection: '#f81ce5',
223
- secondary: '#888',
224
- code: '#79ffe1',
225
- border: '#333',
226
- error: '#e00',
227
- errorLighter: '#f7d4d6',
228
- errorLight: '#ff1a1a',
229
- errorDark: '#c50000',
230
- success: '#0070f3',
231
- successLighter: '#d3e5ff',
232
- successLight: '#3291ff',
233
- successDark: '#0761d1',
234
- warning: '#f5a623',
235
- warningLighter: '#ffefcf',
236
- warningLight: '#f7b955',
237
- warningDark: '#ab570a',
238
- cyan: '#50e3c2',
239
- cyanLighter: '#aaffec',
240
- cyanLight: '#79ffe1',
241
- cyanDark: '#29bc9b',
242
- violet: '#7928ca',
243
- violetLighter: '#e3d7fc',
244
- violetLight: '#8a63d2',
245
- violetDark: '#4c2889',
246
- purple: '#f81ce5',
247
- alert: '#ff0080',
248
- magenta: '#eb367f',
249
- link: '#3291ff'
250
- };
251
- var expressiveness = {
252
- linkStyle: 'none',
253
- linkHoverStyle: 'none',
254
- dropdownBoxShadow: '0 0 0 1px #333',
255
- scrollerStart: 'rgba(255, 255, 255, 1)',
256
- scrollerEnd: 'rgba(255, 255, 255, 0)',
257
- shadowSmall: '0 0 0 1px #333',
258
- shadowMedium: '0 0 0 1px #333',
259
- shadowLarge: '0 0 0 1px #333',
260
- portalOpacity: 0.75
261
- };
262
- var font = defaultFont;
263
- var breakpoints = defaultBreakpoints;
264
- var layout = defaultLayout;
265
- var themes = {
266
- type: 'dark',
267
- font: font,
268
- layout: layout,
269
- palette: palette,
270
- breakpoints: breakpoints,
271
- expressiveness: expressiveness
272
- };
273
-
274
- var isObject = function isObject(target) {
275
- return target && _typeof(target) === 'object';
276
- };
277
- var _deepDuplicable = function deepDuplicable(source, target) {
278
- if (!isObject(target) || !isObject(source)) return source;
279
- var sourceKeys = Object.keys(source);
280
- var result = {};
281
- for (var _i = 0, _sourceKeys = sourceKeys; _i < _sourceKeys.length; _i++) {
282
- var key = _sourceKeys[_i];
283
- var sourceValue = source[key];
284
- var targetValue = target[key];
285
- if (Array.isArray(sourceValue) && Array.isArray(targetValue)) {
286
- result[key] = targetValue.concat(sourceValue);
287
- } else if (isObject(sourceValue) && isObject(targetValue)) {
288
- result[key] = _deepDuplicable(sourceValue, _objectSpread2({}, targetValue));
289
- } else if (targetValue) {
290
- result[key] = targetValue;
291
- } else {
292
- result[key] = sourceValue;
293
- }
294
- }
295
- return result;
296
- };
297
- var getPresets = function getPresets() {
298
- return [themes$1, themes];
299
- };
300
- var getPresetStaticTheme = function getPresetStaticTheme() {
301
- return themes$1;
302
- };
303
- var isAvailableThemeType = function isAvailableThemeType(type) {
304
- if (!type) return false;
305
- var presetThemes = getPresets();
306
- var hasType = presetThemes.find(function (theme) {
307
- return theme.type === type;
308
- });
309
- return !hasType;
310
- };
311
- var isPresetTheme = function isPresetTheme(themeOrType) {
312
- if (!themeOrType) return false;
313
- var isType = typeof themeOrType === 'string';
314
- var type = isType ? themeOrType : themeOrType.type;
315
- return !isAvailableThemeType(type);
316
- };
317
- var hasUserCustomTheme = function hasUserCustomTheme() {
318
- var themes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
319
- return !!themes.find(function (item) {
320
- return isAvailableThemeType(item.type);
321
- });
322
- };
323
- var create = function create(base, custom) {
324
- if (!isAvailableThemeType(custom.type)) {
325
- throw new Error('Duplicate or unavailable theme type');
326
- }
327
- return _deepDuplicable(base, custom);
328
- };
329
- var createFromDark = function createFromDark(custom) {
330
- return create(themes, custom);
331
- };
332
- var createFromLight = function createFromLight(custom) {
333
- return create(themes$1, custom);
334
- };
335
- var Themes = {
336
- isPresetTheme: isPresetTheme,
337
- isAvailableThemeType: isAvailableThemeType,
338
- hasUserCustomTheme: hasUserCustomTheme,
339
- getPresets: getPresets,
340
- getPresetStaticTheme: getPresetStaticTheme,
341
- create: create,
342
- createFromDark: createFromDark,
343
- createFromLight: createFromLight
344
- };
345
-
346
- /* "use client" */
347
-
348
- var defaultTheme = Themes.getPresetStaticTheme();
349
- var ThemeContext = /*#__PURE__*/React.createContext(defaultTheme);
350
- var useTheme = function useTheme() {
351
- return React.useContext(ThemeContext);
352
- };
353
-
354
- var tuple = function tuple() {
355
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
356
- args[_key] = arguments[_key];
357
- }
358
- return args;
359
- };
360
- tuple('default', 'secondary', 'success', 'warning', 'error', 'abort', 'secondary-light', 'success-light', 'warning-light', 'error-light');
361
- tuple('default', 'secondary', 'success', 'warning', 'error');
362
- tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite');
363
- tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite', 'alert', 'purple', 'violet', 'cyan');
364
- tuple('default', 'silent', 'prevent');
365
- tuple('hover', 'click');
366
- tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
367
- tuple('start', 'center', 'end', 'left', 'right');
368
-
369
- tuple('xs', 'sm', 'md', 'lg', 'xl', 'mobile');
370
- tuple('up', 'down', 'default');
371
- var defaultResponsiveOptions = {
372
- match: 'default'
373
- };
374
- var makeQueries = function makeQueries(bp, up, down) {
375
- var queryString = function queryString(item) {
376
- var upQuery = "(min-width: ".concat(item.min, ")");
377
- var downQuery = "(max-width: ".concat(item.max, ")");
378
- return up ? upQuery : down ? downQuery : "".concat(upQuery, " and ").concat(downQuery);
379
- };
380
- var xs = queryString(bp.xs);
381
- return {
382
- xs: xs,
383
- mobile: xs,
384
- sm: queryString(bp.sm),
385
- md: queryString(bp.md),
386
- lg: queryString(bp.lg),
387
- xl: queryString(bp.xl)
388
- };
389
- };
390
- var useMediaQuery = function useMediaQuery(breakpoint) {
391
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultResponsiveOptions;
392
- var _options$match = options.match,
393
- matchType = _options$match === void 0 ? 'default' : _options$match,
394
- _options$ssrMatchMedi = options.ssrMatchMedia,
395
- ssrMatchMedia = _options$ssrMatchMedi === void 0 ? null : _options$ssrMatchMedi;
396
- var supportMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
397
- var theme = useTheme();
398
- var mediaQueries = React.useMemo(function () {
399
- var up = matchType === 'up';
400
- var down = matchType === 'down';
401
- return makeQueries(theme.breakpoints, up, down);
402
- }, [theme.breakpoints, options]);
403
- var query = React.useMemo(function () {
404
- return mediaQueries[breakpoint];
405
- }, [mediaQueries, breakpoint]);
406
- var matchQuery = function matchQuery(q) {
407
- return window.matchMedia(q);
408
- };
409
-
410
- /**
411
- * Do nothing in the server-side rendering.
412
- * If server match query fucntion is simulated, return user-defined value first.
413
- */
414
- var _useState = React.useState(function () {
415
- if (supportMedia) return matchQuery(query).matches;
416
- if (ssrMatchMedia && typeof ssrMatchMedia === 'function') {
417
- return ssrMatchMedia(query).matches;
418
- }
419
- return false;
420
- }),
421
- _useState2 = _slicedToArray(_useState, 2),
422
- state = _useState2[0],
423
- setState = _useState2[1];
424
- React.useEffect(function () {
425
- if (!supportMedia) return;
426
- var queryList = matchQuery(query);
427
- var update = function update() {
428
- return setState(matchQuery(query).matches);
429
- };
430
- update();
431
-
432
- /**
433
- * addListener is deprecated. EventTarget.addEventListener is recommended.
434
- * But in some old browsers, MediaQueryList does not inherit from EventTarget.
435
- */
436
- queryList.addListener(update);
437
- return function () {
438
- queryList.removeListener(update);
439
- };
440
- }, [supportMedia]);
441
- return state;
442
- };
443
-
444
- exports.default = useMediaQuery;
@@ -1,12 +0,0 @@
1
- declare const breakpoints: ["xs", "sm", "md", "lg", "xl", "mobile"];
2
- export type ResponsiveBreakpoint = typeof breakpoints[number];
3
- declare const matchType: ["up", "down", "default"];
4
- export type ResponsiveMatchType = typeof matchType[number];
5
- export type ResponsiveOptions = {
6
- match?: ResponsiveMatchType;
7
- ssrMatchMedia?: (query: string) => {
8
- matches: boolean;
9
- };
10
- };
11
- declare const useMediaQuery: (breakpoint: ResponsiveBreakpoint, options?: ResponsiveOptions) => boolean;
12
- export default useMediaQuery;
@@ -1,2 +0,0 @@
1
- import { useTheme } from './theme-context';
2
- export default useTheme;