@rio-cloud/rio-uikit 1.7.1 → 1.9.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 (248) hide show
  1. package/BarList.d.ts +2 -0
  2. package/BarList.js +2 -0
  3. package/README.md +4 -0
  4. package/SaveableDateInput.d.ts +2 -0
  5. package/SaveableDateInput.js +2 -0
  6. package/SvgImage.d.ts +2 -0
  7. package/SvgImage.js +2 -0
  8. package/TableCol.d.ts +2 -0
  9. package/TableCol.js +2 -0
  10. package/TableHead.d.ts +2 -0
  11. package/TableHead.js +2 -0
  12. package/components/actionBarItem/ActionBarItemIcon.js +1 -1
  13. package/components/actionBarItem/ActionBarOverlay.js +1 -1
  14. package/components/activity/Activity.d.ts +2 -2
  15. package/components/applicationHeader/CollapsedNavItem.js +1 -0
  16. package/components/assetTree/Tree.d.ts +20 -0
  17. package/components/assetTree/Tree.js +75 -38
  18. package/components/assetTree/TreeLeaf.js +1 -1
  19. package/components/assetTree/TreeNodeContainer.d.ts +1 -1
  20. package/components/assetTree/TreeSearch.js +1 -1
  21. package/components/assetTree/TreeSummary.js +1 -1
  22. package/components/assetTree/TypeCounter.d.ts +2 -0
  23. package/components/assetTree/TypeCounter.js +1 -1
  24. package/components/assetTree/useTreeExpansion.d.ts +4 -0
  25. package/components/assetTree/useTreeExpansion.js +25 -0
  26. package/components/assetTree/useTreeHeight.d.ts +1 -0
  27. package/components/assetTree/useTreeHeight.js +60 -0
  28. package/components/assetTree/useTreeScrollPosition.d.ts +3 -0
  29. package/components/assetTree/useTreeScrollPosition.js +19 -0
  30. package/components/assetTree/useTreeVirtualization.d.ts +17 -0
  31. package/components/assetTree/useTreeVirtualization.js +71 -0
  32. package/components/autosuggest/AutoSuggest.js +2 -1
  33. package/components/barList/BarList.d.ts +97 -0
  34. package/components/barList/BarList.js +42 -0
  35. package/components/barList/useSortedBars.d.ts +2 -0
  36. package/components/barList/useSortedBars.js +14 -0
  37. package/components/button/ButtonToolbar.d.ts +1 -1
  38. package/components/button/ButtonToolbar.js +1 -1
  39. package/components/button/ToggleButton.js +0 -1
  40. package/components/charts/PieChart.js +1 -1
  41. package/components/clearableInput/ClearableInput.d.ts +20 -7
  42. package/components/clearableInput/ClearableInput.js +68 -8
  43. package/components/dialog/Dialog.js +1 -1
  44. package/components/dialog/FrameDialog.js +1 -1
  45. package/components/dropdown/ButtonDropdown.d.ts +11 -3
  46. package/components/dropdown/ButtonDropdown.js +79 -64
  47. package/components/dropdown/DropdownToggleButton.d.ts +7 -4
  48. package/components/dropdown/DropdownToggleButton.js +11 -3
  49. package/components/formLabel/FormLabel.d.ts +2 -2
  50. package/components/formLabel/FormLabel.js +1 -1
  51. package/components/listMenu/ListMenu.js +4 -1
  52. package/components/map/components/Map.js +21 -6
  53. package/components/map/components/constants.d.ts +2 -0
  54. package/components/map/components/constants.js +3 -0
  55. package/components/map/components/features/basics/InfoBubble.js +1 -1
  56. package/components/map/components/features/layers/overlayLayers/IncidentsLayer.js +1 -1
  57. package/components/map/utils/mapTypes.d.ts +5 -0
  58. package/components/map/utils/rendering.d.ts +5 -2
  59. package/components/map/utils/rendering.js +46 -39
  60. package/components/menuItems/MenuItem.js +1 -1
  61. package/components/notification/Notification.js +1 -1
  62. package/components/overlay/OverlayTrigger.js +3 -3
  63. package/components/saveableInput/SaveableDateInput.d.ts +83 -0
  64. package/components/saveableInput/SaveableDateInput.js +122 -0
  65. package/components/selects/BaseSelectDropdown.js +1 -1
  66. package/components/selects/Multiselect.d.ts +8 -0
  67. package/components/selects/Multiselect.js +4 -4
  68. package/components/smoothScrollbars/SmoothScrollbars.d.ts +1 -0
  69. package/components/smoothScrollbars/SmoothScrollbars.js +3 -3
  70. package/components/statsWidget/StatsWidget.d.ts +2 -2
  71. package/components/statsWidget/StatsWidgets.d.ts +2 -2
  72. package/components/svgImage/SvgElement.d.ts +8 -0
  73. package/components/svgImage/SvgElement.js +11 -0
  74. package/components/svgImage/SvgImage.d.ts +30 -0
  75. package/components/svgImage/SvgImage.js +20 -0
  76. package/components/svgImage/svgConverter.d.ts +17 -0
  77. package/components/svgImage/svgConverter.js +78 -0
  78. package/components/svgImage/useSvgLoader.d.ts +9 -0
  79. package/components/svgImage/useSvgLoader.js +43 -0
  80. package/components/switch/Switch.d.ts +4 -0
  81. package/components/switch/Switch.js +5 -6
  82. package/components/table/TableCardsSorting.d.ts +0 -1
  83. package/components/table/TableCol.d.ts +18 -0
  84. package/components/table/TableCol.js +11 -0
  85. package/components/table/TableHead.d.ts +33 -0
  86. package/components/table/TableHead.js +11 -0
  87. package/components/table/TableSettingsDialog.js +1 -1
  88. package/components/tag/Tag.js +1 -1
  89. package/components/timepicker/TimePicker.d.ts +1 -2
  90. package/components/timepicker/TimePicker.js +35 -8
  91. package/components/tooltip/SimpleTooltip.d.ts +1 -1
  92. package/components/virtualList/VirtualList.js +1 -1
  93. package/hooks/useIsFocusWithin.d.ts +33 -0
  94. package/hooks/useIsFocusWithin.js +55 -0
  95. package/hooks/useLocationSuggestions.d.ts +27 -0
  96. package/hooks/useLocationSuggestions.js +94 -0
  97. package/hooks/useOnboarding.d.ts +17 -5
  98. package/hooks/useOnboarding.js +7 -1
  99. package/hooks/usePostMessage.js +0 -1
  100. package/hooks/useSearch.d.ts +63 -0
  101. package/hooks/useSearch.js +73 -0
  102. package/hooks/useSorting.d.ts +6 -0
  103. package/hooks/useSorting.js +7 -4
  104. package/hooks/useTableExport.d.ts +49 -0
  105. package/hooks/useTableExport.js +57 -0
  106. package/hooks/useTableSelection.d.ts +166 -0
  107. package/hooks/useTableSelection.js +201 -0
  108. package/lib/es/BarList.d.ts +2 -0
  109. package/lib/es/BarList.js +7 -0
  110. package/lib/es/SaveableDateInput.d.ts +2 -0
  111. package/lib/es/SaveableDateInput.js +7 -0
  112. package/lib/es/SvgImage.d.ts +2 -0
  113. package/lib/es/SvgImage.js +7 -0
  114. package/lib/es/TableCol.d.ts +2 -0
  115. package/lib/es/TableCol.js +7 -0
  116. package/lib/es/TableHead.d.ts +2 -0
  117. package/lib/es/TableHead.js +7 -0
  118. package/lib/es/components/actionBarItem/ActionBarItemIcon.js +1 -1
  119. package/lib/es/components/actionBarItem/ActionBarOverlay.js +1 -1
  120. package/lib/es/components/activity/Activity.d.ts +2 -2
  121. package/lib/es/components/applicationHeader/CollapsedNavItem.js +1 -0
  122. package/lib/es/components/assetTree/Tree.d.ts +20 -0
  123. package/lib/es/components/assetTree/Tree.js +74 -37
  124. package/lib/es/components/assetTree/TreeLeaf.js +1 -1
  125. package/lib/es/components/assetTree/TreeNodeContainer.d.ts +1 -1
  126. package/lib/es/components/assetTree/TreeSearch.js +1 -1
  127. package/lib/es/components/assetTree/TreeSummary.js +1 -1
  128. package/lib/es/components/assetTree/TypeCounter.d.ts +2 -0
  129. package/lib/es/components/assetTree/TypeCounter.js +1 -1
  130. package/lib/es/components/assetTree/useTreeExpansion.d.ts +4 -0
  131. package/lib/es/components/assetTree/useTreeExpansion.js +29 -0
  132. package/lib/es/components/assetTree/useTreeHeight.d.ts +1 -0
  133. package/lib/es/components/assetTree/useTreeHeight.js +64 -0
  134. package/lib/es/components/assetTree/useTreeScrollPosition.d.ts +3 -0
  135. package/lib/es/components/assetTree/useTreeScrollPosition.js +23 -0
  136. package/lib/es/components/assetTree/useTreeVirtualization.d.ts +17 -0
  137. package/lib/es/components/assetTree/useTreeVirtualization.js +76 -0
  138. package/lib/es/components/autosuggest/AutoSuggest.js +2 -1
  139. package/lib/es/components/barList/BarList.d.ts +97 -0
  140. package/lib/es/components/barList/BarList.js +45 -0
  141. package/lib/es/components/barList/useSortedBars.d.ts +2 -0
  142. package/lib/es/components/barList/useSortedBars.js +17 -0
  143. package/lib/es/components/button/ButtonToolbar.d.ts +1 -1
  144. package/lib/es/components/button/ButtonToolbar.js +1 -1
  145. package/lib/es/components/button/ToggleButton.js +0 -1
  146. package/lib/es/components/charts/PieChart.js +1 -1
  147. package/lib/es/components/clearableInput/ClearableInput.d.ts +20 -7
  148. package/lib/es/components/clearableInput/ClearableInput.js +67 -7
  149. package/lib/es/components/dialog/Dialog.js +1 -1
  150. package/lib/es/components/dialog/FrameDialog.js +1 -1
  151. package/lib/es/components/dropdown/ButtonDropdown.d.ts +11 -3
  152. package/lib/es/components/dropdown/ButtonDropdown.js +79 -64
  153. package/lib/es/components/dropdown/DropdownToggleButton.d.ts +7 -4
  154. package/lib/es/components/dropdown/DropdownToggleButton.js +11 -3
  155. package/lib/es/components/formLabel/FormLabel.d.ts +2 -2
  156. package/lib/es/components/formLabel/FormLabel.js +1 -1
  157. package/lib/es/components/listMenu/ListMenu.js +4 -1
  158. package/lib/es/components/map/components/Map.js +20 -5
  159. package/lib/es/components/map/components/constants.d.ts +2 -0
  160. package/lib/es/components/map/components/constants.js +4 -1
  161. package/lib/es/components/map/components/features/basics/InfoBubble.js +1 -1
  162. package/lib/es/components/map/components/features/layers/overlayLayers/IncidentsLayer.js +1 -1
  163. package/lib/es/components/map/utils/mapTypes.d.ts +5 -0
  164. package/lib/es/components/map/utils/rendering.d.ts +5 -2
  165. package/lib/es/components/map/utils/rendering.js +46 -39
  166. package/lib/es/components/menuItems/MenuItem.js +1 -1
  167. package/lib/es/components/notification/Notification.js +1 -1
  168. package/lib/es/components/overlay/OverlayTrigger.js +3 -3
  169. package/lib/es/components/saveableInput/SaveableDateInput.d.ts +83 -0
  170. package/lib/es/components/saveableInput/SaveableDateInput.js +125 -0
  171. package/lib/es/components/selects/BaseSelectDropdown.js +1 -1
  172. package/lib/es/components/selects/Multiselect.d.ts +8 -0
  173. package/lib/es/components/selects/Multiselect.js +4 -4
  174. package/lib/es/components/smoothScrollbars/SmoothScrollbars.d.ts +1 -0
  175. package/lib/es/components/smoothScrollbars/SmoothScrollbars.js +3 -3
  176. package/lib/es/components/statsWidget/StatsWidget.d.ts +2 -2
  177. package/lib/es/components/statsWidget/StatsWidgets.d.ts +2 -2
  178. package/lib/es/components/svgImage/SvgElement.d.ts +8 -0
  179. package/lib/es/components/svgImage/SvgElement.js +14 -0
  180. package/lib/es/components/svgImage/SvgImage.d.ts +30 -0
  181. package/lib/es/components/svgImage/SvgImage.js +23 -0
  182. package/lib/es/components/svgImage/svgConverter.d.ts +17 -0
  183. package/lib/es/components/svgImage/svgConverter.js +84 -0
  184. package/lib/es/components/svgImage/useSvgLoader.d.ts +9 -0
  185. package/lib/es/components/svgImage/useSvgLoader.js +48 -0
  186. package/lib/es/components/switch/Switch.d.ts +4 -0
  187. package/lib/es/components/switch/Switch.js +5 -6
  188. package/lib/es/components/table/TableCardsSorting.d.ts +0 -1
  189. package/lib/es/components/table/TableCol.d.ts +18 -0
  190. package/lib/es/components/table/TableCol.js +13 -0
  191. package/lib/es/components/table/TableHead.d.ts +33 -0
  192. package/lib/es/components/table/TableHead.js +14 -0
  193. package/lib/es/components/table/TableSettingsDialog.js +1 -1
  194. package/lib/es/components/tag/Tag.js +1 -1
  195. package/lib/es/components/timepicker/TimePicker.d.ts +1 -2
  196. package/lib/es/components/timepicker/TimePicker.js +35 -8
  197. package/lib/es/components/tooltip/SimpleTooltip.d.ts +1 -1
  198. package/lib/es/components/virtualList/VirtualList.js +1 -1
  199. package/lib/es/hooks/useIsFocusWithin.d.ts +33 -0
  200. package/lib/es/hooks/useIsFocusWithin.js +57 -0
  201. package/lib/es/hooks/useLocationSuggestions.d.ts +27 -0
  202. package/lib/es/hooks/useLocationSuggestions.js +97 -0
  203. package/lib/es/hooks/useOnboarding.d.ts +17 -5
  204. package/lib/es/hooks/useOnboarding.js +7 -1
  205. package/lib/es/hooks/usePostMessage.js +0 -1
  206. package/lib/es/hooks/useSearch.d.ts +63 -0
  207. package/lib/es/hooks/useSearch.js +75 -0
  208. package/lib/es/hooks/useSorting.d.ts +6 -0
  209. package/lib/es/hooks/useSorting.js +7 -4
  210. package/lib/es/hooks/useTableExport.d.ts +49 -0
  211. package/lib/es/hooks/useTableExport.js +59 -0
  212. package/lib/es/hooks/useTableSelection.d.ts +166 -0
  213. package/lib/es/hooks/useTableSelection.js +210 -0
  214. package/lib/es/themes/Volkswagen/components/applicationHeader/VolkswagenApplicationHeader.js +1 -1
  215. package/lib/es/useIsFocusWithin.d.ts +2 -0
  216. package/lib/es/useIsFocusWithin.js +7 -0
  217. package/lib/es/useLocationSuggestions.d.ts +2 -0
  218. package/lib/es/useLocationSuggestions.js +7 -0
  219. package/lib/es/useSearch.d.ts +2 -0
  220. package/lib/es/useSearch.js +7 -0
  221. package/lib/es/useTableExport.d.ts +2 -0
  222. package/lib/es/useTableExport.js +7 -0
  223. package/lib/es/useTableSelection.d.ts +2 -0
  224. package/lib/es/useTableSelection.js +7 -0
  225. package/lib/es/utils/storageUtils.d.ts +2 -2
  226. package/lib/es/utils/storageUtils.js +2 -0
  227. package/lib/es/utils/urlFeatureToggles.d.ts +12 -6
  228. package/lib/es/utils/urlFeatureToggles.js +14 -8
  229. package/lib/es/utils/useDropDirection.js +1 -0
  230. package/lib/es/version.json +1 -1
  231. package/package.json +48 -40
  232. package/themes/Volkswagen/components/applicationHeader/VolkswagenApplicationHeader.js +1 -1
  233. package/useIsFocusWithin.d.ts +2 -0
  234. package/useIsFocusWithin.js +2 -0
  235. package/useLocationSuggestions.d.ts +2 -0
  236. package/useLocationSuggestions.js +2 -0
  237. package/useSearch.d.ts +2 -0
  238. package/useSearch.js +2 -0
  239. package/useTableExport.d.ts +2 -0
  240. package/useTableExport.js +2 -0
  241. package/useTableSelection.d.ts +2 -0
  242. package/useTableSelection.js +2 -0
  243. package/utils/storageUtils.d.ts +2 -2
  244. package/utils/storageUtils.js +2 -0
  245. package/utils/urlFeatureToggles.d.ts +12 -6
  246. package/utils/urlFeatureToggles.js +10 -7
  247. package/utils/useDropDirection.js +1 -0
  248. package/version.json +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rio-cloud/rio-uikit",
3
- "version": "1.7.1",
3
+ "version": "1.9.0",
4
4
  "description": "The RIO UIKIT component library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,8 +27,10 @@
27
27
  "build:rioglyph": "svgo -f rioglyph/svgs && vite build --mode rioglyph",
28
28
  "fixCssMinified": "node tools/fixCssMinified.mjs",
29
29
  "format-code": "npm run format-code:uikit && npm run format-code:demo",
30
- "format-code:uikit": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,md}\"",
31
- "format-code:demo": "prettier --write \"uikit-demo/src/**/*.{js,jsx,ts,tsx,json,md}\"",
30
+ "format-code:uikit": "biome format --write src",
31
+ "format-code:demo": "biome format --write uikit-demo",
32
+ "lint": "biome check src",
33
+ "lint-fix": "biome check src --write",
32
34
  "copy-to-package": "copyfiles package.json README.md LICENSE package",
33
35
  "test": "vitest run",
34
36
  "test:ci": "vitest run --reporter=junit --outputFile.junit=./results/jest/junit.xml",
@@ -36,9 +38,7 @@
36
38
  "test:ui": "node tools/testUI.js && backstop reference --config='test/backstop/config.js' && backstop test --config='test/backstop/config.js'",
37
39
  "coverage": "vitest run --coverage",
38
40
  "check-licenses": "node tools/check-licenses.mjs .",
39
- "license-check": "license-checker --production --json --onlyAllow \"`cat whitelist.txt`\" --excludePackages \"@rio-cloud/rio-uikit\" --out licenses.txt",
40
- "lint": "eslint src",
41
- "lint-fix": "npm run lint -- --fix"
41
+ "license-check": "license-checker --production --json --onlyAllow \"`cat whitelist.txt`\" --excludePackages \"@rio-cloud/rio-uikit\" --out licenses.txt"
42
42
  },
43
43
  "author": "TB Digital Services GmbH",
44
44
  "license": "Apache-2.0",
@@ -46,47 +46,47 @@
46
46
  "module": "index.js",
47
47
  "types": "index.d.ts",
48
48
  "less": "./styles/css/rio-uikit.less",
49
- "files": ["**/*.*"],
49
+ "files": [
50
+ "**/*.*"
51
+ ],
52
+ "exports": {
53
+ ".": {
54
+ "import": "./index.js",
55
+ "types": "./index.d.ts"
56
+ },
57
+ "./*": {
58
+ "import": "./*.js",
59
+ "types": "./*.d.ts"
60
+ }
61
+ },
50
62
  "devDependencies": {
63
+ "@biomejs/biome": "2.0.5",
51
64
  "@testing-library/dom": "10.4.0",
52
65
  "@testing-library/jest-dom": "6.6.3",
53
- "@testing-library/react": "16.2.0",
66
+ "@testing-library/react": "16.3.0",
54
67
  "@testing-library/react-hooks": "8.0.1",
55
68
  "@testing-library/user-event": "14.6.1",
56
69
  "@types/heremaps": "3.1.14",
57
- "@types/lodash": "4.17.14",
58
- "@types/qs": "6.9.18",
70
+ "@types/lodash": "4.17.18",
71
+ "@types/qs": "6.14.0",
59
72
  "@types/react": "18.3.18",
60
73
  "@types/react-dom": "18.3.5",
61
- "@types/react-input-mask": "3.0.6",
62
74
  "@types/react-redux": "7.1.34",
63
75
  "@types/resize-observer-browser": "0.1.11",
64
- "@typescript-eslint/eslint-plugin": "6.13.2",
65
- "@typescript-eslint/parser": "6.13.2",
66
- "@vitejs/plugin-react": "4.3.4",
76
+ "@vitejs/plugin-react": "4.6.0",
67
77
  "@vitest/coverage-c8": "0.33.0",
68
- "autoprefixer": "10.4.20",
78
+ "autoprefixer": "10.4.21",
69
79
  "backstopjs": "6.3.25",
70
80
  "copyfiles": "2.4.1",
71
- "dotenv": "16.4.7",
72
- "eslint": "8.55.0",
73
- "eslint-config-prettier": "9.1.0",
74
- "eslint-plugin-compat": "4.2.0",
75
- "eslint-plugin-getsentry": "2.0.0",
76
- "eslint-plugin-import": "2.31.0",
77
- "eslint-plugin-prefer-arrow": "1.2.3",
78
- "eslint-plugin-prettier": "5.2.3",
79
- "eslint-plugin-react": "7.37.4",
80
- "eslint-plugin-react-hooks": "4.6.2",
81
- "jsdom": "26.0.0",
81
+ "dotenv": "16.5.0",
82
+ "jsdom": "26.1.0",
82
83
  "jsdom-global": "3.0.2",
83
- "less": "4.2.2",
84
+ "less": "4.3.0",
84
85
  "license-checker": "25.0.1",
85
- "postcss": "8.5.1",
86
+ "postcss": "8.5.6",
86
87
  "postcss-preset-env": "8.5.1",
87
88
  "postcss-short": "5.0.0",
88
89
  "pre-commit": "1.2.2",
89
- "prettier": "3.4.2",
90
90
  "react": "18.0.0",
91
91
  "react-dom": "18.0.0",
92
92
  "react-intl": "6.6.8",
@@ -94,10 +94,11 @@
94
94
  "strip-ansi": "7.1.0",
95
95
  "svgo": "3.3.2",
96
96
  "tiny-invariant": "1.3.3",
97
- "typescript": "5.7.3",
98
- "vite": "6.0.11",
97
+ "typescript": "5.8.3",
98
+ "vite": "6.3.5",
99
99
  "vite-plugin-zip-pack": "1.2.4",
100
- "vitest": "3.0.4"
100
+ "vitest": "3.2.4",
101
+ "vitest-fetch-mock": "^0.4.5"
101
102
  },
102
103
  "peerDependencies": {
103
104
  "react": "^18.0.0 || ^19.0.0",
@@ -109,8 +110,9 @@
109
110
  "@dnd-kit/sortable": "7.0.2",
110
111
  "@formkit/auto-animate": "0.8.2",
111
112
  "@popperjs/core": "2.11.8",
113
+ "@tanstack/react-virtual": "^3.13.11",
112
114
  "classnames": "2.5.1",
113
- "driver.js": "1.3.1",
115
+ "driver.js": "1.3.6",
114
116
  "events": "3.3.0",
115
117
  "framer-motion": "4.1.17",
116
118
  "iframe-resizer-react": "1.1.0",
@@ -124,19 +126,25 @@
124
126
  "react-content-loader": "7.0.2",
125
127
  "react-custom-scrollbars-2": "4.5.0",
126
128
  "react-datetime": "github:rio-cloud/react-datetime#v3.1.1-1-merged",
127
- "react-dropzone": "14.3.5",
128
- "react-input-mask": "3.0.0-alpha.2",
129
+ "react-dropzone": "14.3.8",
130
+ "react-imask": "7.6.1",
129
131
  "react-notifications": "1.7.4",
130
- "react-onclickoutside": "6.13.1",
132
+ "react-onclickoutside": "6.13.2",
131
133
  "react-popper": "2.3.0",
132
134
  "react-shadow-root": "6.2.0",
133
- "react-toastify": "11.0.3",
134
- "recharts": "2.15.0",
135
+ "react-toastify": "11.0.5",
136
+ "recharts": "2.15.3",
135
137
  "tslib": "2.8.1"
136
138
  },
137
139
  "overrides": {
138
140
  "iframe-resizer": "4.3.11"
139
141
  },
140
- "pre-commit": ["format-code"],
141
- "browserslist": ["> 0.5%", "Firefox ESR", "not dead"]
142
+ "pre-commit": [
143
+ "format-code"
144
+ ],
145
+ "browserslist": [
146
+ "> 0.5%",
147
+ "Firefox ESR",
148
+ "not dead"
149
+ ]
142
150
  }
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // @ts-ignore-next-line importsNotUsedAsValues
2
+ // biome-ignore lint/style/useImportType: required for JSX runtime compatibility with older toolchains
3
3
  import { forwardRef } from 'react';
4
4
  import isEmpty from 'lodash/fp/isEmpty';
5
5
  import classNames from 'classnames';
@@ -0,0 +1,2 @@
1
+ export { default } from './hooks/useIsFocusWithin';
2
+ export * from './hooks/useIsFocusWithin';
@@ -0,0 +1,2 @@
1
+ export { default } from './hooks/useIsFocusWithin';
2
+ export * from './hooks/useIsFocusWithin';
@@ -0,0 +1,2 @@
1
+ export { default } from './hooks/useLocationSuggestions';
2
+ export * from './hooks/useLocationSuggestions';
@@ -0,0 +1,2 @@
1
+ export { default } from './hooks/useLocationSuggestions';
2
+ export * from './hooks/useLocationSuggestions';
package/useSearch.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from './hooks/useSearch';
2
+ export * from './hooks/useSearch';
package/useSearch.js ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from './hooks/useSearch';
2
+ export * from './hooks/useSearch';
@@ -0,0 +1,2 @@
1
+ export { default } from './hooks/useTableExport';
2
+ export * from './hooks/useTableExport';
@@ -0,0 +1,2 @@
1
+ export { default } from './hooks/useTableExport';
2
+ export * from './hooks/useTableExport';
@@ -0,0 +1,2 @@
1
+ export { default } from './hooks/useTableSelection';
2
+ export * from './hooks/useTableSelection';
@@ -0,0 +1,2 @@
1
+ export { default } from './hooks/useTableSelection';
2
+ export * from './hooks/useTableSelection';
@@ -1,5 +1,5 @@
1
1
  export declare const storage: {
2
- save: (key: string, value: string | boolean, prefix?: string) => string | boolean | undefined;
3
- load: (key: string, prefix?: string) => string | undefined;
2
+ save: (key: string, value: string, prefix?: string) => string | null;
3
+ load: (key: string, prefix?: string) => string | null;
4
4
  removeItem: (key: string, prefix?: string) => void;
5
5
  };
@@ -8,6 +8,7 @@ const save = (key, value, prefix = STORAGE_PREFIX) => {
8
8
  catch (_) {
9
9
  // Intentionally left blank
10
10
  }
11
+ return null;
11
12
  };
12
13
  const removeItem = (key, prefix = STORAGE_PREFIX) => {
13
14
  try {
@@ -25,5 +26,6 @@ const load = (key, prefix = STORAGE_PREFIX) => {
25
26
  catch (_) {
26
27
  // Intentionally left blank
27
28
  }
29
+ return null;
28
30
  };
29
31
  export const storage = { save, load, removeItem };
@@ -1,9 +1,15 @@
1
1
  export declare const DEFAULT_PREFIX = "featureToggle.";
2
2
  export type ToggleType = string | boolean | number;
3
3
  export declare const cleanupOldToggles: (oldToggles: string[], prefix: string) => void;
4
- export declare const asBoolean: (urlParamName: string) => (prefix: string) => ToggleType | undefined;
5
- export declare const asString: (urlParamName: string) => (prefix: string) => ToggleType | undefined;
6
- export declare const asNumber: (urlParamName: string) => (prefix: string) => ToggleType | undefined;
7
- export declare const detectFeatureToggles: (toggleDefinitions: {
8
- [key: string]: (paramName: string) => ToggleType | undefined;
9
- }, oldToggles?: string[], prefix?: string) => import("lodash").Dictionary<ToggleType | undefined>;
4
+ export declare const asBoolean: (urlParamName: string) => (prefix: string) => boolean | null;
5
+ export declare const asBooleanWithDefault: (urlParamName: string, defaultValue: boolean) => (prefix: string) => boolean;
6
+ export declare const asString: (urlParamName: string) => (prefix: string) => string | null;
7
+ export declare const asStringWithDefault: (urlParamName: string, defaultValue: string) => (prefix: string) => string;
8
+ export declare const asNumber: (urlParamName: string) => (prefix: string) => number | null;
9
+ export declare const asNumberWithDefault: (urlParamName: string, defaultValue: number) => (prefix: string) => number;
10
+ type ToggleValueExtractor = (prefix: string) => ToggleType | null;
11
+ type ToggleValues<TOGGLE_DEFS> = TOGGLE_DEFS extends Record<string, ToggleValueExtractor> ? {
12
+ [K in keyof TOGGLE_DEFS]: ReturnType<TOGGLE_DEFS[K]>;
13
+ } : never;
14
+ export declare const detectFeatureToggles: <TOGGLE_DEFS extends Record<string, ToggleValueExtractor>>(toggleDefinitions: TOGGLE_DEFS, oldToggles?: string[], prefix?: string) => ToggleValues<TOGGLE_DEFS>;
15
+ export {};
@@ -12,19 +12,22 @@ export const cleanupOldToggles = (oldToggles, prefix) => {
12
12
  console.error(error);
13
13
  }
14
14
  };
15
- const detectToggle = (param, prefix, transformFn) => {
15
+ const detectToggle = (param, prefix, transformFn, defaultValue) => {
16
16
  const [_, searchParams = ''] = window.location.hash.split('?');
17
17
  const urlSearchParams = qs.parse(searchParams);
18
18
  const urlValue = get(param, urlSearchParams)?.toString() || '';
19
19
  const storageValue = urlValue ? storage.save(param, urlValue, prefix) : storage.load(param, prefix);
20
- return storageValue && transformFn(storageValue);
20
+ return storageValue ? transformFn(storageValue) : defaultValue;
21
21
  };
22
22
  const transformBoolean = (value) => value === 'true' || value === '1';
23
- const transformString = (value) => value || '';
24
- const transformNumber = (value) => (value !== null ? Number.parseFloat(value) : 0);
25
- export const asBoolean = (urlParamName) => (prefix) => detectToggle(urlParamName, prefix, transformBoolean);
26
- export const asString = (urlParamName) => (prefix) => detectToggle(urlParamName, prefix, transformString);
27
- export const asNumber = (urlParamName) => (prefix) => detectToggle(urlParamName, prefix, transformNumber);
23
+ const transformString = (value) => value;
24
+ const transformNumber = (value) => Number.parseFloat(value);
25
+ export const asBoolean = (urlParamName) => (prefix) => detectToggle(urlParamName, prefix, transformBoolean, null);
26
+ export const asBooleanWithDefault = (urlParamName, defaultValue) => (prefix) => detectToggle(urlParamName, prefix, transformBoolean, defaultValue);
27
+ export const asString = (urlParamName) => (prefix) => detectToggle(urlParamName, prefix, transformString, null);
28
+ export const asStringWithDefault = (urlParamName, defaultValue) => (prefix) => detectToggle(urlParamName, prefix, transformString, defaultValue);
29
+ export const asNumber = (urlParamName) => (prefix) => detectToggle(urlParamName, prefix, transformNumber, null);
30
+ export const asNumberWithDefault = (urlParamName, defaultValue) => (prefix) => detectToggle(urlParamName, prefix, transformNumber, defaultValue);
28
31
  export const detectFeatureToggles = (toggleDefinitions, oldToggles = [], prefix = DEFAULT_PREFIX) => {
29
32
  cleanupOldToggles(oldToggles, prefix);
30
33
  return mapValues(toggleFn => toggleFn(prefix), toggleDefinitions);
@@ -1,3 +1,4 @@
1
+ // biome-ignore lint/style/useImportType: required for JSX runtime compatibility with older toolchains
1
2
  import { useEffect, useState } from 'react';
2
3
  import getDropDirection from './getDropDirection';
3
4
  export const useDropDirection = ({ pullRight = false, dropup = false, autoDropDirection = false, dropdownMenuRef }, dependencies) => {
package/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "1.7.1"
2
+ "version": "1.9.0"
3
3
  }