@vertigis/react-ui 9.14.0 → 10.0.0

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 (105) hide show
  1. package/AdapterDateFns/index.d.ts +3 -0
  2. package/AdapterDateFns/index.js +3 -0
  3. package/AdapterLuxon/index.d.ts +3 -0
  4. package/AdapterLuxon/index.js +3 -0
  5. package/AdapterMoment/index.d.ts +3 -0
  6. package/AdapterMoment/index.js +3 -0
  7. package/Checkbox/Checkbox.d.ts +3 -2
  8. package/ColorInput/ColorInput.d.ts +57 -0
  9. package/ColorInput/ColorInput.js +122 -0
  10. package/ColorInput/index.d.ts +2 -0
  11. package/ColorInput/index.js +2 -0
  12. package/CopyableText/CopyableText.d.ts +35 -0
  13. package/CopyableText/CopyableText.js +80 -0
  14. package/CopyableText/index.d.ts +2 -0
  15. package/CopyableText/index.js +2 -0
  16. package/DataGrid/index.d.ts +1 -0
  17. package/DataGrid/index.js +1 -0
  18. package/DatePicker/index.d.ts +3 -0
  19. package/DatePicker/index.js +3 -0
  20. package/DateRangePicker/index.d.ts +3 -0
  21. package/DateRangePicker/index.js +3 -0
  22. package/DateTimePicker/index.d.ts +3 -0
  23. package/DateTimePicker/index.js +3 -0
  24. package/FormControl/FormControl.d.ts +42 -0
  25. package/FormControl/FormControl.js +30 -0
  26. package/FormControl/index.d.ts +2 -2
  27. package/FormControl/index.js +2 -2
  28. package/FormLabel/FormLabel.d.ts +1 -1
  29. package/FormLabel/FormLabel.js +2 -2
  30. package/FormLabelTextField/FormLabelTextField.d.ts +15 -0
  31. package/FormLabelTextField/FormLabelTextField.js +34 -0
  32. package/FormLabelTextField/index.d.ts +2 -0
  33. package/FormLabelTextField/index.js +2 -0
  34. package/IconButton/IconButton.d.ts +1 -1
  35. package/IconMenu/IconMenu.d.ts +37 -0
  36. package/IconMenu/IconMenu.js +21 -0
  37. package/IconMenu/index.d.ts +2 -0
  38. package/IconMenu/index.js +2 -0
  39. package/InlineFormControl/InlineFormControl.d.ts +38 -0
  40. package/InlineFormControl/InlineFormControl.js +44 -0
  41. package/InlineFormControl/index.d.ts +2 -0
  42. package/InlineFormControl/index.js +2 -0
  43. package/InlineHelp/InlineHelp.d.ts +48 -0
  44. package/InlineHelp/InlineHelp.js +41 -0
  45. package/InlineHelp/index.d.ts +2 -0
  46. package/InlineHelp/index.js +2 -0
  47. package/LicenseInfo/index.d.ts +1 -0
  48. package/LicenseInfo/index.js +1 -0
  49. package/LicenseInfo/index.ts +1 -0
  50. package/Link/Link.d.ts +4 -7
  51. package/Link/Link.js +2 -3
  52. package/Loader/Loader.d.ts +33 -0
  53. package/Loader/Loader.js +75 -0
  54. package/Loader/index.d.ts +2 -0
  55. package/Loader/index.js +2 -0
  56. package/LocalizationProvider/index.d.ts +3 -0
  57. package/LocalizationProvider/index.js +3 -0
  58. package/Markdown/Markdown.d.ts +9 -10
  59. package/Markdown/Markdown.js +2 -1
  60. package/MenuItemSecondaryAction/MenuItemSecondaryAction.d.ts +2 -2
  61. package/MenuItemSecondaryAction/MenuItemSecondaryAction.js +4 -5
  62. package/Radio/Radio.d.ts +3 -2
  63. package/Switch/Switch.d.ts +1 -1
  64. package/Tab/Tab.d.ts +3 -3
  65. package/Tab/Tab.js +1 -1
  66. package/TableCell/TableCell.d.ts +1 -1
  67. package/Tabs/Tabs.d.ts +1 -1
  68. package/Tabs/Tabs.js +1 -1
  69. package/TimePicker/index.d.ts +3 -0
  70. package/TimePicker/index.js +3 -0
  71. package/ToggleButton/ToggleButton.d.ts +1 -1
  72. package/colors/blue.d.ts +1 -1
  73. package/colors/burntOrange.d.ts +1 -1
  74. package/colors/darkBurntOrange.d.ts +1 -1
  75. package/colors/darkRed.d.ts +1 -1
  76. package/colors/green.d.ts +1 -1
  77. package/colors/grey.d.ts +1 -1
  78. package/colors/orange.d.ts +1 -1
  79. package/colors/purple.d.ts +1 -1
  80. package/colors/red.d.ts +1 -1
  81. package/colors/teal.d.ts +1 -1
  82. package/colors/woodlandGreen.d.ts +1 -1
  83. package/icons/utils/createSvgIcon.d.ts +5 -4
  84. package/icons/utils/createSvgIcon.js +4 -3
  85. package/package.json +13 -4
  86. package/styles/CacheProvider.d.ts +1 -1
  87. package/styles/createTheme.js +27 -3
  88. package/styles/index.js +1 -1
  89. package/styles/themeAugmentation.d.ts +22 -0
  90. package/utils/color.d.ts +11 -0
  91. package/utils/color.js +39 -0
  92. package/utils/generateId.d.ts +1 -0
  93. package/utils/generateId.js +1 -0
  94. package/utils/html.d.ts +16 -0
  95. package/utils/html.js +105 -0
  96. package/utils/intl.d.ts +9 -6
  97. package/utils/intl.js +9 -6
  98. package/utils/markdown.d.ts +11 -3
  99. package/utils/markdown.js +11 -1
  100. package/utils/react.d.ts +15 -0
  101. package/utils/react.js +42 -0
  102. package/utils/url.d.ts +19 -0
  103. package/utils/url.js +74 -0
  104. package/CircularProgress/CircularProgress.d.ts +0 -2
  105. package/CircularProgress/CircularProgress.js +0 -2
package/utils/react.js ADDED
@@ -0,0 +1,42 @@
1
+ import { useState } from "react";
2
+ /**
3
+ * Generate a random 10 digit id.
4
+ *
5
+ * @param prefix An optional prefix to prepend to the generated id.
6
+ * @internal
7
+ */
8
+ export function _generateId(prefix) {
9
+ const randomId = Math.random().toString(36).substr(2, 10);
10
+ if (!prefix) {
11
+ return randomId;
12
+ }
13
+ return `${prefix}-${randomId}`;
14
+ }
15
+ /**
16
+ * Produces a unique ID that can be used for the HTML `id` attribute. Will use
17
+ * the provided value if defined (typically obtained from the calling
18
+ * component's `id` prop), otherwise one will be generated. The ID will remain
19
+ * the same between renders (even if `idProp` changes).
20
+ */
21
+ export function useId(idProp) {
22
+ const [id] = useState(() => idProp ?? _generateId());
23
+ return id;
24
+ }
25
+ /**
26
+ * Combines multiple refs into a single ref.
27
+ *
28
+ * Useful when a component needs a ref to one of its own elements, but also
29
+ * supports forwarding a ref from its parent component.
30
+ */
31
+ export function mergeRefs(...refs) {
32
+ return (value) => {
33
+ refs.forEach(ref => {
34
+ if (typeof ref === "function") {
35
+ ref(value);
36
+ }
37
+ else if (ref) {
38
+ ref.current = value;
39
+ }
40
+ });
41
+ };
42
+ }
package/utils/url.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Clears the hash string.
3
+ */
4
+ export declare function clearHashParams(): void;
5
+ /**
6
+ * Returns the decoded hash parameter value for a given key.
7
+ *
8
+ * @param key The key used to return a value.
9
+ */
10
+ export declare function getHashParam(key: string): string | undefined;
11
+ export declare function getQueryStringParam(key: string): string | undefined;
12
+ /**
13
+ * Builds and sets the hash string.
14
+ *
15
+ * @param kvp An object with hash parameters as key/value pairs.
16
+ */
17
+ export declare function setHashParams(kvp: {
18
+ [key: string]: string;
19
+ }): void;
package/utils/url.js ADDED
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Clears the hash string.
3
+ */
4
+ export function clearHashParams() {
5
+ history.replaceState(null, document.title, getUrlWithoutHash());
6
+ }
7
+ /**
8
+ * Returns the decoded hash parameter value for a given key.
9
+ *
10
+ * @param key The key used to return a value.
11
+ */
12
+ export function getHashParam(key) {
13
+ return getKeyValuePairs()[key];
14
+ }
15
+ export function getQueryStringParam(key) {
16
+ const params = new URL(window.location.href).searchParams;
17
+ const value = params.get(key);
18
+ // Prefer undefined over null
19
+ return typeof value === "string" ? value : undefined;
20
+ }
21
+ /**
22
+ * Returns the hash string.
23
+ */
24
+ function getHashParamString() {
25
+ return location.hash.substring(1);
26
+ }
27
+ /**
28
+ * Returns an object with hash parameters as key/value pairs.
29
+ */
30
+ function getKeyValuePairs() {
31
+ const kvp = {};
32
+ if (hasHashParams()) {
33
+ const params = getHashParamString().split("&");
34
+ for (const param of params) {
35
+ const keyPair = param.split("=");
36
+ kvp[decodeURIComponent(keyPair[0])] = decodeURIComponent(keyPair[1]);
37
+ }
38
+ }
39
+ return kvp;
40
+ }
41
+ /**
42
+ * Returns the URL without the hash string.
43
+ */
44
+ function getUrlWithoutHash() {
45
+ return `${location.protocol}//${location.host}${location.pathname}${location.search}`;
46
+ }
47
+ /**
48
+ * Whether the window currently has a hash string.
49
+ */
50
+ function hasHashParams() {
51
+ return !!location.hash;
52
+ }
53
+ /**
54
+ * Builds and sets the hash string.
55
+ *
56
+ * @param kvp An object with hash parameters as key/value pairs.
57
+ */
58
+ export function setHashParams(kvp) {
59
+ const hashParamList = [];
60
+ for (const key of Object.keys(kvp)) {
61
+ hashParamList.push(`${encodeURIComponent(key)}=${encodeURIComponent(kvp[key])}`);
62
+ }
63
+ const hashParamString = `#${hashParamList.join("&")}`;
64
+ setHashParamsString(hashParamString);
65
+ }
66
+ /**
67
+ * Sets the hash string.
68
+ *
69
+ * @param paramsString The string to be set as the hash string.
70
+ */
71
+ function setHashParamsString(paramsString) {
72
+ paramsString = paramsString.startsWith("#") ? paramsString : `#${paramsString}`;
73
+ history.replaceState(null, document.title, getUrlWithoutHash() + paramsString);
74
+ }
@@ -1,2 +0,0 @@
1
- export { default } from "@mui/material/CircularProgress";
2
- export * from "@mui/material/CircularProgress";
@@ -1,2 +0,0 @@
1
- export { default } from "@mui/material/CircularProgress";
2
- export * from "@mui/material/CircularProgress";