@neo4j-ndl/react 3.0.33 → 3.1.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 (134) hide show
  1. package/lib/cjs/_common/ConditionalWrap.js.map +1 -1
  2. package/lib/cjs/breadcrumbs/Breadcrumbs.js +10 -6
  3. package/lib/cjs/breadcrumbs/Breadcrumbs.js.map +1 -1
  4. package/lib/cjs/context-menu/ContextMenu.js +3 -2
  5. package/lib/cjs/context-menu/ContextMenu.js.map +1 -1
  6. package/lib/cjs/data-grid/Components.js +2 -4
  7. package/lib/cjs/data-grid/Components.js.map +1 -1
  8. package/lib/cjs/icons/generated/custom/BoxSelect.js +1 -1
  9. package/lib/cjs/icons/generated/custom/BoxSelect.js.map +1 -1
  10. package/lib/cjs/icons/generated/custom/CurlyBrackets.js +1 -1
  11. package/lib/cjs/icons/generated/custom/CurlyBrackets.js.map +1 -1
  12. package/lib/cjs/icons/generated/custom/DatabaseCrossed.js +1 -1
  13. package/lib/cjs/icons/generated/custom/DatabaseCrossed.js.map +1 -1
  14. package/lib/cjs/icons/generated/custom/DatabaseSignal.js +1 -1
  15. package/lib/cjs/icons/generated/custom/DatabaseSignal.js.map +1 -1
  16. package/lib/cjs/icons/generated/custom/Explore.js +1 -1
  17. package/lib/cjs/icons/generated/custom/Explore.js.map +1 -1
  18. package/lib/cjs/icons/generated/custom/Github.js +1 -1
  19. package/lib/cjs/icons/generated/custom/Github.js.map +1 -1
  20. package/lib/cjs/icons/generated/custom/Lasso.js +1 -1
  21. package/lib/cjs/icons/generated/custom/Lasso.js.map +1 -1
  22. package/lib/cjs/icons/generated/custom/Pan.js +1 -1
  23. package/lib/cjs/icons/generated/custom/Pan.js.map +1 -1
  24. package/lib/cjs/icons/generated/custom/Query.js +1 -1
  25. package/lib/cjs/icons/generated/custom/Query.js.map +1 -1
  26. package/lib/cjs/icons/generated/custom/ResetZoom.js +1 -1
  27. package/lib/cjs/icons/generated/custom/ResetZoom.js.map +1 -1
  28. package/lib/cjs/icons/generated/custom/Roles.js +1 -1
  29. package/lib/cjs/icons/generated/custom/Roles.js.map +1 -1
  30. package/lib/cjs/icons/generated/custom/Select.js +1 -1
  31. package/lib/cjs/icons/generated/custom/Select.js.map +1 -1
  32. package/lib/cjs/index.js +2 -0
  33. package/lib/cjs/index.js.map +1 -1
  34. package/lib/cjs/popover/Popover.js +3 -2
  35. package/lib/cjs/popover/Popover.js.map +1 -1
  36. package/lib/cjs/popover/use-popover.js +4 -2
  37. package/lib/cjs/popover/use-popover.js.map +1 -1
  38. package/lib/cjs/select/Overrides.js +173 -27
  39. package/lib/cjs/select/Overrides.js.map +1 -1
  40. package/lib/cjs/select/Select.js +27 -163
  41. package/lib/cjs/select/Select.js.map +1 -1
  42. package/lib/cjs/skeleton/Skeleton.js +37 -0
  43. package/lib/cjs/skeleton/Skeleton.js.map +1 -0
  44. package/lib/cjs/{toast/sonner-types.js → skeleton/index.js} +16 -18
  45. package/lib/cjs/skeleton/index.js.map +1 -0
  46. package/lib/cjs/time-picker/TimePicker.js +229 -0
  47. package/lib/cjs/time-picker/TimePicker.js.map +1 -0
  48. package/lib/cjs/time-picker/generate-time-options.js +42 -0
  49. package/lib/cjs/time-picker/generate-time-options.js.map +1 -0
  50. package/lib/cjs/time-picker/index.js +38 -0
  51. package/lib/cjs/time-picker/index.js.map +1 -0
  52. package/lib/cjs/time-picker/needle-time.js +88 -0
  53. package/lib/cjs/time-picker/needle-time.js.map +1 -0
  54. package/lib/cjs/time-picker/time-picker-hooks.js +49 -0
  55. package/lib/cjs/time-picker/time-picker-hooks.js.map +1 -0
  56. package/lib/cjs/toast/Toast.js +4 -4
  57. package/lib/cjs/toast/Toast.js.map +1 -1
  58. package/lib/esm/_common/ConditionalWrap.js.map +1 -1
  59. package/lib/esm/breadcrumbs/Breadcrumbs.js +10 -6
  60. package/lib/esm/breadcrumbs/Breadcrumbs.js.map +1 -1
  61. package/lib/esm/context-menu/ContextMenu.js +3 -2
  62. package/lib/esm/context-menu/ContextMenu.js.map +1 -1
  63. package/lib/esm/data-grid/Components.js +2 -4
  64. package/lib/esm/data-grid/Components.js.map +1 -1
  65. package/lib/esm/icons/generated/custom/BoxSelect.js +1 -1
  66. package/lib/esm/icons/generated/custom/BoxSelect.js.map +1 -1
  67. package/lib/esm/icons/generated/custom/CurlyBrackets.js +1 -1
  68. package/lib/esm/icons/generated/custom/CurlyBrackets.js.map +1 -1
  69. package/lib/esm/icons/generated/custom/DatabaseCrossed.js +1 -1
  70. package/lib/esm/icons/generated/custom/DatabaseCrossed.js.map +1 -1
  71. package/lib/esm/icons/generated/custom/DatabaseSignal.js +1 -1
  72. package/lib/esm/icons/generated/custom/DatabaseSignal.js.map +1 -1
  73. package/lib/esm/icons/generated/custom/Explore.js +1 -1
  74. package/lib/esm/icons/generated/custom/Explore.js.map +1 -1
  75. package/lib/esm/icons/generated/custom/Github.js +1 -1
  76. package/lib/esm/icons/generated/custom/Github.js.map +1 -1
  77. package/lib/esm/icons/generated/custom/Lasso.js +1 -1
  78. package/lib/esm/icons/generated/custom/Lasso.js.map +1 -1
  79. package/lib/esm/icons/generated/custom/Pan.js +1 -1
  80. package/lib/esm/icons/generated/custom/Pan.js.map +1 -1
  81. package/lib/esm/icons/generated/custom/Query.js +1 -1
  82. package/lib/esm/icons/generated/custom/Query.js.map +1 -1
  83. package/lib/esm/icons/generated/custom/ResetZoom.js +1 -1
  84. package/lib/esm/icons/generated/custom/ResetZoom.js.map +1 -1
  85. package/lib/esm/icons/generated/custom/Roles.js +1 -1
  86. package/lib/esm/icons/generated/custom/Roles.js.map +1 -1
  87. package/lib/esm/icons/generated/custom/Select.js +1 -1
  88. package/lib/esm/icons/generated/custom/Select.js.map +1 -1
  89. package/lib/esm/index.js +2 -0
  90. package/lib/esm/index.js.map +1 -1
  91. package/lib/esm/popover/Popover.js +3 -2
  92. package/lib/esm/popover/Popover.js.map +1 -1
  93. package/lib/esm/popover/use-popover.js +4 -2
  94. package/lib/esm/popover/use-popover.js.map +1 -1
  95. package/lib/esm/select/Overrides.js +165 -27
  96. package/lib/esm/select/Overrides.js.map +1 -1
  97. package/lib/esm/select/Select.js +28 -164
  98. package/lib/esm/select/Select.js.map +1 -1
  99. package/lib/esm/skeleton/Skeleton.js +31 -0
  100. package/lib/esm/skeleton/Skeleton.js.map +1 -0
  101. package/lib/esm/skeleton/index.js +22 -0
  102. package/lib/esm/skeleton/index.js.map +1 -0
  103. package/lib/esm/time-picker/TimePicker.js +223 -0
  104. package/lib/esm/time-picker/TimePicker.js.map +1 -0
  105. package/lib/esm/time-picker/generate-time-options.js +38 -0
  106. package/lib/esm/time-picker/generate-time-options.js.map +1 -0
  107. package/lib/esm/time-picker/index.js +22 -0
  108. package/lib/esm/time-picker/index.js.map +1 -0
  109. package/lib/esm/time-picker/needle-time.js +84 -0
  110. package/lib/esm/time-picker/needle-time.js.map +1 -0
  111. package/lib/esm/time-picker/time-picker-hooks.js +45 -0
  112. package/lib/esm/time-picker/time-picker-hooks.js.map +1 -0
  113. package/lib/esm/toast/Toast.js +5 -5
  114. package/lib/esm/toast/Toast.js.map +1 -1
  115. package/lib/types/_common/ConditionalWrap.d.ts +4 -3
  116. package/lib/types/banner/Banner.d.ts +2 -2
  117. package/lib/types/breadcrumbs/Breadcrumbs.d.ts +4 -4
  118. package/lib/types/context-menu/ContextMenu.d.ts +1 -0
  119. package/lib/types/index.d.ts +2 -0
  120. package/lib/types/popover/Popover.d.ts +3 -1
  121. package/lib/types/popover/use-popover.d.ts +3 -1
  122. package/lib/types/select/Overrides.d.ts +16 -6
  123. package/lib/types/skeleton/Skeleton.d.ts +35 -0
  124. package/lib/types/skeleton/index.d.ts +21 -0
  125. package/lib/types/time-picker/TimePicker.d.ts +43 -0
  126. package/lib/types/time-picker/generate-time-options.d.ts +21 -0
  127. package/lib/types/time-picker/index.d.ts +22 -0
  128. package/lib/{esm/toast/sonner-types.js → types/time-picker/needle-time.d.ts} +9 -15
  129. package/lib/types/time-picker/time-picker-hooks.d.ts +30 -0
  130. package/lib/types/toast/Toast.d.ts +1 -2
  131. package/package.json +5 -5
  132. package/lib/cjs/toast/sonner-types.js.map +0 -1
  133. package/lib/esm/toast/sonner-types.js.map +0 -1
  134. package/lib/types/toast/sonner-types.d.ts +0 -179
@@ -0,0 +1,84 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ export class NeedleTime {
22
+ constructor(hour, minute) {
23
+ this.hour = hour || 0;
24
+ this.minute = minute || 0;
25
+ }
26
+ toString(is24Hour) {
27
+ if (is24Hour) {
28
+ return `${String(this.hour).padStart(2, '0')}:${String(this.minute).padStart(2, '0')}`;
29
+ }
30
+ else {
31
+ const period = this.hour < 12 ? 'AM' : 'PM';
32
+ const adjustedHours = this.hour % 12 || 12;
33
+ return `${String(adjustedHours).padStart(2, '0')}:${String(this.minute).padStart(2, '0')} ${period}`;
34
+ }
35
+ }
36
+ static fromString(timeString) {
37
+ // Remove any whitespace and convert to lowercase
38
+ const cleanTime = timeString.toLowerCase().replace(/\s/g, '');
39
+ // Extract AM/PM if present
40
+ const isPM = cleanTime.includes('pm');
41
+ const hasAMPM = cleanTime.includes('am') || isPM;
42
+ const timeWithoutAmPm = cleanTime.replace(/[ap]m/g, '');
43
+ // Extract hours and minutes
44
+ let hours;
45
+ let minutes;
46
+ if (timeWithoutAmPm.includes(':')) {
47
+ // Format: hh:mm
48
+ const [hoursStr, minutesStr] = timeWithoutAmPm.split(':');
49
+ hours = parseInt(hoursStr, 10);
50
+ minutes = parseInt(minutesStr, 10);
51
+ }
52
+ else {
53
+ // Format: hhmm
54
+ const hoursStr = timeWithoutAmPm.slice(0, 2);
55
+ const minutesStr = timeWithoutAmPm.slice(2, 4);
56
+ hours = parseInt(hoursStr, 10);
57
+ minutes = parseInt(minutesStr, 10);
58
+ }
59
+ // Adjust hours for PM
60
+ if (isPM && hours < 12) {
61
+ hours += 12;
62
+ }
63
+ // Adjust hours for AM 12 only if we're dealing with AM/PM format
64
+ if (hasAMPM && !isPM && hours === 12) {
65
+ hours = 0;
66
+ }
67
+ return new NeedleTime(hours, minutes);
68
+ }
69
+ hourString(is24Hour) {
70
+ if (is24Hour) {
71
+ return String(this.hour).padStart(2, '0');
72
+ }
73
+ else {
74
+ return String(this.hour % 12 || 12).padStart(2, '0');
75
+ }
76
+ }
77
+ minuteString() {
78
+ return String(this.minute).padStart(2, '0');
79
+ }
80
+ periodString() {
81
+ return this.hour < 12 ? 'AM' : 'PM';
82
+ }
83
+ }
84
+ //# sourceMappingURL=needle-time.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"needle-time.js","sourceRoot":"","sources":["../../../src/time-picker/needle-time.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,UAAU;IAIrB,YAAY,IAAa,EAAE,MAAe;QACxC,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED,QAAQ,CAAC,QAAkB;QACzB,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,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
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import { useEffect, useState } from 'react';
22
+ export function useTimePickerPopover(openInitially) {
23
+ const [isPopoverOpen, setIsPopoverOpen] = useState(openInitially);
24
+ return { isPopoverOpen, setIsPopoverOpen };
25
+ }
26
+ export function useKeyboardNavigation(listRef, maxIndex) {
27
+ const [focusedIndex, setFocusedIndex] = useState(0);
28
+ const handleArrowNavigation = (key) => {
29
+ if (key === 'ArrowDown') {
30
+ setFocusedIndex((prev) => (prev + 1) % maxIndex);
31
+ }
32
+ else if (key === 'ArrowUp') {
33
+ setFocusedIndex((prev) => (prev - 1 + maxIndex) % maxIndex);
34
+ }
35
+ };
36
+ useEffect(() => {
37
+ var _a, _b;
38
+ (_b = (_a = listRef.current) === null || _a === void 0 ? void 0 : _a.children[focusedIndex]) === null || _b === void 0 ? void 0 : _b.scrollIntoView({
39
+ block: 'center',
40
+ inline: 'nearest',
41
+ });
42
+ }, [focusedIndex, listRef]);
43
+ return { focusedIndex, setFocusedIndex, handleArrowNavigation };
44
+ }
45
+ //# sourceMappingURL=time-picker-hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time-picker-hooks.js","sourceRoot":"","sources":["../../../src/time-picker/time-picker-hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,UAAU,oBAAoB,CAAC,aAAsB;IACzD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;IAClE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,OAA0C,EAC1C,QAAgB;IAEhB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEpD,MAAM,qBAAqB,GAAG,CAAC,GAAW,EAAE,EAAE;QAC5C,IAAI,GAAG,KAAK,WAAW,EAAE,CAAC;YACxB,eAAe,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC;QACnD,CAAC;aAAM,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YAC7B,eAAe,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;;QACb,MAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,QAAQ,CAAC,YAAY,CAAC,0CAAE,cAAc,CAAC;YACtD,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,SAAS;SAClB,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;IAE5B,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,qBAAqB,EAAE,CAAC;AAClE,CAAC"}
@@ -33,7 +33,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
33
33
  import React from 'react';
34
34
  import { CheckCircleIconSolid, ExclamationCircleIconSolid, XMarkIconOutline, } from '../icons';
35
35
  import { LoadingSpinner } from '../loading-spinner';
36
- import { Toaster as SonnerToaster, toast as sonnerToast } from 'sonner';
36
+ import { Toaster as SonnerToaster, toast as sonnerToast, } from 'sonner';
37
37
  import { classNames } from '../_common/defaultImports';
38
38
  import { Button, IconButton } from '../button';
39
39
  import { ProgressBar } from '../progress-bar';
@@ -77,10 +77,10 @@ const Toast = React.forwardRef(function Toast({ icon, id, text, variant, isClose
77
77
  };
78
78
  return (_jsxs("div", Object.assign({ id: String(id), className: "ndl-toast", tabIndex: -1, ref: ref, "data-variant": variant, "data-testid": "ndl-toast" }, htmlAttributes, { children: [_jsxs("div", { className: "ndl-toast-content", tabIndex: -1, children: [icon && (_jsx("div", { className: `ndl-toast-icon ndl-toast-${variant}`, children: icon })), _jsx("div", { className: "ndl-toast-text", children: text }), actionLabel && (_jsx(Button, { className: "ndl-toast-action", fill: "outlined", size: "small", onClick: handleOnAction, onKeyDown: handleOnAction, children: actionLabel })), (isCloseable || actionLabel || isProgressBar) && (_jsx(IconButton, { isClean: true, className: "ndl-toast-close-button", onKeyDown: handleOnClose, onClick: handleOnClose, ariaLabel: "Close toast", size: "small", children: _jsx(XMarkIconOutline, {}) }))] }), isProgressBar && (_jsx(ProgressBar, { size: "small", value: initialProgressBarValue !== null && initialProgressBarValue !== void 0 ? initialProgressBarValue : 0 }))] })));
79
79
  });
80
- function getProps(onClose, shouldAutoClose, onAutoClose, sonnerToastProps, variant) {
80
+ function getProps(onClose, shouldAutoClose, onAutoClose, onAction, sonnerToastProps, variant) {
81
81
  const isProgressBar = variant === 'progress-bar';
82
82
  // https://sonner.emilkowal.ski/toast#api-reference
83
- return Object.assign({ duration: !isProgressBar && shouldAutoClose ? 5000 : Infinity, unstyled: true, onDismiss: (toast) => {
83
+ return Object.assign({ duration: !isProgressBar && shouldAutoClose ? (!onAction ? 5000 : 8000) : Infinity, unstyled: true, onDismiss: (toast) => {
84
84
  onCloseCallback(onClose, toast.id);
85
85
  }, onAutoClose: (toast) => {
86
86
  if (onAutoClose)
@@ -88,7 +88,7 @@ function getProps(onClose, shouldAutoClose, onAutoClose, sonnerToastProps, varia
88
88
  } }, sonnerToastProps);
89
89
  }
90
90
  function createToast(text, props, variant, icon) {
91
- const { ref, sonnerToastProps = {}, onClose, shouldAutoClose, onAutoClose } = props, restProps = __rest(props, ["ref", "sonnerToastProps", "onClose", "shouldAutoClose", "onAutoClose"]);
91
+ const { ref, sonnerToastProps = {}, onClose, shouldAutoClose, onAutoClose, onAction } = props, restProps = __rest(props, ["ref", "sonnerToastProps", "onClose", "shouldAutoClose", "onAutoClose", "onAction"]);
92
92
  const { id: sonnerToastPropsId } = sonnerToastProps;
93
93
  sonnerToastProps.id = sonnerToastPropsId !== null && sonnerToastPropsId !== void 0 ? sonnerToastPropsId : `ndl-toast-${Date.now()}`;
94
94
  // Unfortunately calling sonnerToast.dismiss does not trigger the onDismiss
@@ -102,7 +102,7 @@ function createToast(text, props, variant, icon) {
102
102
  onClose,
103
103
  },
104
104
  };
105
- return sonnerToast.custom((id) => (_jsx(Toast, Object.assign({}, restProps, { ref: ref, id: id, text: text, variant: variant, icon: icon, onClose: onClose }))), Object.assign({}, getProps(onClose, shouldAutoClose, onAutoClose, sonnerToastProps, variant)));
105
+ return sonnerToast.custom((id) => (_jsx(Toast, Object.assign({}, restProps, { ref: ref, id: id, text: text, variant: variant, icon: icon, onClose: onClose, onAction: onAction }))), Object.assign({}, getProps(onClose, shouldAutoClose, onAutoClose, onAction, sonnerToastProps, variant)));
106
106
  }
107
107
  const toast = {
108
108
  neutral: (text, props = {}) => {
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.js","sourceRoot":"","sources":["../../../src/toast/Toast.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAyB,MAAM,OAAO,CAAC;AAE9C,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAElB,OAAO,E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@@ -18,13 +18,14 @@
18
18
  * You should have received a copy of the GNU General Public License
19
19
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
  */
21
+ import React from 'react';
21
22
  /**
22
23
  * Component to enable conditional
23
24
  * wrapping of components
24
25
  */
25
26
  export declare const ConditionalWrap: ({ shouldWrap, wrap, children, }: {
26
27
  shouldWrap: boolean;
27
- wrap: (childre: JSX.Element) => JSX.Element;
28
- children: JSX.Element;
29
- }) => JSX.Element;
28
+ wrap: (children: React.ReactNode) => React.ReactNode;
29
+ children: React.ReactNode;
30
+ }) => React.ReactNode;
30
31
  export default ConditionalWrap;
@@ -27,7 +27,7 @@ import { type PolymorphicPropsWithRef, type PolymorphicForwardRefExoticComponent
27
27
  *
28
28
  *
29
29
  */
30
- type BannerActionsProps = {
30
+ export type BannerActionsProps = {
31
31
  /** Label of the action item */
32
32
  label: string;
33
33
  disabled?: boolean;
@@ -100,7 +100,7 @@ declare const BannerNamespace: Omit<React.ForwardRefExoticComponent<BannerProps
100
100
  [key: string]: unknown;
101
101
  }>, "$$typeof"> & Omit<React.ExoticComponent<BannerProps & {
102
102
  [key: string]: unknown;
103
- }>, never> & (<InstanceT extends React.ElementType = "div">(props: PolymorphicPropsWithRef<InstanceT, BannerProps>) => React.ReactElement /** Description of the banner. Will be ignored if `children` is passed */ | null) & {
103
+ }>, never> & (<InstanceT extends React.ElementType = "div">(props: PolymorphicPropsWithRef<InstanceT, BannerProps>) => React.ReactElement | null) & {
104
104
  Actions: PolymorphicForwardRefExoticComponent<"a", BannerActionsProps>;
105
105
  };
106
106
  export { BannerNamespace as Banner };
@@ -24,9 +24,9 @@ import { type PolymorphicPropsWithRef, type PolymorphicForwardRefExoticComponent
24
24
  export interface BreadcrumbsBaseItemProps extends Omit<React.HTMLProps<HTMLLIElement>, 'as' | 'onClick'> {
25
25
  children?: React.ReactNode;
26
26
  className?: string;
27
- href: string;
27
+ href?: string;
28
28
  isCurrentPage?: boolean;
29
- onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>, href: string) => void;
29
+ onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>, href?: string) => void;
30
30
  }
31
31
  export interface BreadcrumbsGroupItemProps {
32
32
  children?: React.ReactNode;
@@ -37,9 +37,9 @@ export interface BreadcrumbsItemProps extends Omit<React.HTMLProps<HTMLLIElement
37
37
  children: React.ReactNode;
38
38
  className?: string;
39
39
  hasSeparator?: boolean;
40
- href: string;
40
+ href?: string;
41
41
  isCurrentPage?: boolean;
42
- onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>, href: string) => void;
42
+ onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>, href?: string) => void;
43
43
  }
44
44
  export interface BreadcrumbsItemMenuProps extends Omit<ContextMenuProps, 'isOpen' | 'onClick' | 'onClose'> {
45
45
  children: React.ReactNode;
@@ -52,6 +52,7 @@ export interface ContextMenuProps {
52
52
  title?: string;
53
53
  isDisabled?: boolean;
54
54
  description?: React.ReactNode;
55
+ isPortaled?: boolean;
55
56
  }
56
57
  export interface MenuItemsProps {
57
58
  children: React.ReactNode;
@@ -64,3 +64,5 @@ export * from './tree-view';
64
64
  export * from './toast';
65
65
  export * from './callout';
66
66
  export * from './tooltip';
67
+ export * from './skeleton';
68
+ export * from './time-picker';
@@ -44,12 +44,14 @@ export interface PopoverProps {
44
44
  hasAnchorPortal?: boolean;
45
45
  /** If the popover should constrain the focus inside the popover while open */
46
46
  shouldCaptureFocus?: boolean;
47
+ /** Which element to initially focus. **/
48
+ initialFocus?: number | React.MutableRefObject<HTMLElement | null>;
47
49
  /** The role of the popover */
48
50
  role?: 'tooltip' | 'dialog' | 'alertdialog' | 'menu' | 'listbox' | 'grid' | 'tree';
49
51
  }
50
52
  export declare const usePopoverContext: () => import("./use-popover").UsePopoverReturn;
51
53
  export declare const Popover: {
52
- ({ children, anchorElement, placement, isOpen, offset, anchorPosition, hasAnchorPortal, shouldCaptureFocus, onOpenChange, role, }: PopoverProps): import("react/jsx-runtime").JSX.Element;
54
+ ({ children, anchorElement, placement, isOpen, offset, anchorPosition, hasAnchorPortal, shouldCaptureFocus, initialFocus, onOpenChange, role, }: PopoverProps): import("react/jsx-runtime").JSX.Element;
53
55
  Trigger: React.ForwardRefExoticComponent<PopoverTriggerProps & React.RefAttributes<HTMLElement>>;
54
56
  Content: PolymorphicForwardRefExoticComponent<"div", PopoverContentProps>;
55
57
  };
@@ -32,6 +32,7 @@ export interface PopoverOptions {
32
32
  };
33
33
  anchorElementAsPortalAnchor?: boolean;
34
34
  shouldCaptureFocus?: boolean;
35
+ initialFocus?: number | React.MutableRefObject<HTMLElement | null>;
35
36
  role?: 'tooltip' | 'dialog' | 'alertdialog' | 'menu' | 'listbox' | 'grid' | 'tree';
36
37
  }
37
38
  export interface UsePopoverReturn extends UseInteractionsReturn, ReturnType<typeof useFloating> {
@@ -44,5 +45,6 @@ export interface UsePopoverReturn extends UseInteractionsReturn, ReturnType<type
44
45
  setDescriptionId: (descriptionId: string | undefined) => void;
45
46
  anchorElementAsPortalAnchor: boolean | undefined;
46
47
  shouldCaptureFocus: boolean | undefined;
48
+ initialFocus: number | React.MutableRefObject<HTMLElement | null> | undefined;
47
49
  }
48
- export declare function usePopover({ isInitialOpen, placement, isOpen: controlledOpen, onOpenChange: setControlledOpen, offsetOption, anchorElement, anchorPosition, anchorElementAsPortalAnchor, shouldCaptureFocus, role: roleProp, }?: PopoverOptions): UsePopoverReturn;
50
+ export declare function usePopover({ isInitialOpen, placement, isOpen: controlledOpen, onOpenChange: setControlledOpen, offsetOption, anchorElement, anchorPosition, anchorElementAsPortalAnchor, shouldCaptureFocus, initialFocus, role: roleProp, }?: PopoverOptions): UsePopoverReturn;
@@ -19,10 +19,20 @@
19
19
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
  */
21
21
 
22
- import { type ClearIndicatorProps, type DropdownIndicatorProps, type GroupBase, type MultiValueRemoveProps, type OptionProps, type PlaceholderProps } from 'react-select';
22
+ import { type ClearIndicatorProps, type ControlProps, type DropdownIndicatorProps, type GroupBase, type IndicatorsContainerProps, type InputProps, type MenuProps, type MultiValueProps, type OptionProps, type PlaceholderProps, type SingleValueProps, type ValueContainerProps } from 'react-select';
23
23
  import { type SelectOverrideCustomProps } from './types';
24
- export declare const DropdownIndicatorCurrying: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ errorText, size, }: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>) => (props: DropdownIndicatorProps<OptionType, IsMulti, GroupType>) => import("react/jsx-runtime").JSX.Element;
25
- export declare const CustomClearIndication: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ errorText, size, }: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>) => (props: ClearIndicatorProps<OptionType, IsMulti, GroupType>) => import("react/jsx-runtime").JSX.Element;
26
- export declare const CustomMultiValueRemove: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ errorText, size, }: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>) => (props: MultiValueRemoveProps<OptionType, IsMulti, GroupType>) => import("react/jsx-runtime").JSX.Element;
27
- export declare const CustomPlaceholder: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ errorText, size, }: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>) => ({ children, ...restProps }: PlaceholderProps<OptionType, IsMulti, GroupType>) => import("react/jsx-runtime").JSX.Element;
28
- export declare const CustomOption: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ errorText, size, }: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>) => ({ children, ...restProps }: OptionProps<OptionType, IsMulti, GroupType>) => import("react/jsx-runtime").JSX.Element;
24
+ import { MenuListProps, MenuPortalProps } from 'react-select/dist/declarations/src/components/Menu';
25
+ export declare const DropdownIndicatorCurrying: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ size, }: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>) => (props: DropdownIndicatorProps<OptionType, IsMulti, GroupType>) => import("react/jsx-runtime").JSX.Element;
26
+ export declare const CustomClearIndication: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ size, }: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>) => ({ className, ...restProps }: ClearIndicatorProps<OptionType, IsMulti, GroupType>) => import("react/jsx-runtime").JSX.Element;
27
+ export declare const CustomMultiValue: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ size, }: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>) => ({ children, className, ...restProps }: MultiValueProps<OptionType, IsMulti, GroupType>) => import("react/jsx-runtime").JSX.Element;
28
+ export declare const CustomPlaceholder: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ size, }: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>) => ({ children, className, ...restProps }: PlaceholderProps<OptionType, IsMulti, GroupType>) => import("react/jsx-runtime").JSX.Element;
29
+ export declare const CustomControl: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ size, hasBorder, errorText, }: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>) => ({ children, className, ...restProps }: ControlProps) => import("react/jsx-runtime").JSX.Element;
30
+ export declare const CustomIndicatorsContainer: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ size, }: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>) => ({ children, className, ...restProps }: IndicatorsContainerProps) => import("react/jsx-runtime").JSX.Element;
31
+ export declare const CustomValueContainer: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ size, }: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>) => ({ children, className, ...restProps }: ValueContainerProps) => import("react/jsx-runtime").JSX.Element;
32
+ export declare const CustomInput: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ size, }: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>) => ({ children, className, ...restProps }: InputProps) => import("react/jsx-runtime").JSX.Element;
33
+ export declare const CustomSingleValue: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ size, }: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>) => ({ className, ...restProps }: SingleValueProps) => import("react/jsx-runtime").JSX.Element;
34
+ /** Overrides that are part of the popover menu */
35
+ export declare const CustomMenu: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ size, }: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>) => ({ children, className, ...restProps }: MenuProps) => import("react/jsx-runtime").JSX.Element;
36
+ export declare const CustomMenuPortal: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ size, }: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>) => ({ children, className, ...restProps }: MenuPortalProps<OptionType, IsMulti, GroupType>) => import("react/jsx-runtime").JSX.Element;
37
+ export declare const CustomMenuList: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ size, }: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>) => ({ children, className, ...restProps }: MenuListProps<OptionType, IsMulti, GroupType>) => import("react/jsx-runtime").JSX.Element;
38
+ export declare const CustomOption: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ size, }: SelectOverrideCustomProps<OptionType, IsMulti, GroupType>) => ({ children, className, ...restProps }: OptionProps<OptionType, IsMulti, GroupType>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,35 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import React from 'react';
22
+ import { type PolymorphicForwardRefExoticComponent } from '../_common/types';
23
+ export type SkeletonProps = {
24
+ variant?: 'circular' | 'rectangular';
25
+ /** height of the skeleton */
26
+ height?: string;
27
+ /** width of the skeleton */
28
+ width?: string;
29
+ children?: React.ReactNode;
30
+ /** What background the skeleton is placed on */
31
+ onBackground?: 'weak' | 'default';
32
+ isLoading?: boolean;
33
+ count?: number;
34
+ };
35
+ export declare const Skeleton: PolymorphicForwardRefExoticComponent<'div', SkeletonProps>;
@@ -0,0 +1,21 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ export * from './Skeleton';
@@ -0,0 +1,43 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import React from 'react';
22
+ import { NeedleTime } from './needle-time';
23
+ import { type HtmlAttributes } from '../_common/types';
24
+ export type TimeFormat = 'hh:mm' | 'hh:mm aa';
25
+ export interface TimePickerProps {
26
+ selected?: NeedleTime;
27
+ format?: TimeFormat;
28
+ isFluid?: boolean;
29
+ isReadOnly?: boolean;
30
+ isRequired?: boolean;
31
+ isDisabled?: boolean;
32
+ timeInterval?: number;
33
+ label?: string;
34
+ size?: 'small' | 'medium' | 'large';
35
+ errorText?: string;
36
+ className?: string;
37
+ style?: React.CSSProperties;
38
+ onChange?: (time: NeedleTime) => void;
39
+ onError?: (error: string) => void;
40
+ /** HTML attributes */
41
+ htmlAttributes?: HtmlAttributes<'div'>;
42
+ }
43
+ export declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,21 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ export declare const generateTimeOptions: (is24Hour: boolean, interval: number) => string[];
@@ -0,0 +1,22 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ export * from './TimePicker';
22
+ export type { NeedleTime } from './needle-time';
@@ -18,19 +18,13 @@
18
18
  * You should have received a copy of the GNU General Public License
19
19
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
  */
21
- // File copied from: https://github.com/emilkowalski/sonner/blob/main/src/types.ts
22
- // https://github.com/emilkowalski/sonner/pull/400
23
- // Types are unfortunately not exported yet.
24
- // TODO: Remove once the github issue is resolved.
25
- /* eslint-disable */
26
- export function isAction(action) {
27
- return (action.label !== undefined &&
28
- typeof action.onClick === 'function');
21
+ export declare class NeedleTime {
22
+ hour: number;
23
+ minute: number;
24
+ constructor(hour?: number, minute?: number);
25
+ toString(is24Hour?: boolean): string;
26
+ static fromString(timeString: string): NeedleTime;
27
+ hourString(is24Hour?: boolean): string;
28
+ minuteString(): string;
29
+ periodString(): string;
29
30
  }
30
- export var SwipeStateTypes;
31
- (function (SwipeStateTypes) {
32
- SwipeStateTypes["SwipedOut"] = "SwipedOut";
33
- SwipeStateTypes["SwipedBack"] = "SwipedBack";
34
- SwipeStateTypes["NotSwiped"] = "NotSwiped";
35
- })(SwipeStateTypes || (SwipeStateTypes = {}));
36
- //# sourceMappingURL=sonner-types.js.map
@@ -0,0 +1,30 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+
22
+ export declare function useTimePickerPopover(openInitially: boolean): {
23
+ isPopoverOpen: boolean;
24
+ setIsPopoverOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
25
+ };
26
+ export declare function useKeyboardNavigation(listRef: React.RefObject<HTMLUListElement>, maxIndex: number): {
27
+ focusedIndex: number;
28
+ setFocusedIndex: import("react").Dispatch<import("react").SetStateAction<number>>;
29
+ handleArrowNavigation: (key: string) => void;
30
+ };
@@ -19,8 +19,7 @@
19
19
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
  */
21
21
  import React, { type ReactNode } from 'react';
22
- import { toast as sonnerToast } from 'sonner';
23
- import { type ExternalToast as SonnerExternalToast, type ToasterProps as SonnerToasterProps } from './sonner-types';
22
+ import { toast as sonnerToast, type ExternalToast as SonnerExternalToast, type ToasterProps as SonnerToasterProps } from 'sonner';
24
23
  import { type HtmlAttributes } from '../_common/types';
25
24
  type ToastVariants = 'neutral' | 'success' | 'danger' | 'loading-spinner' | 'progress-bar';
26
25
  type ToastCommandVariants = 'neutral' | 'success' | 'danger' | 'loadingSpinner' | 'progressBar';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neo4j-ndl/react",
3
- "version": "3.0.33",
3
+ "version": "3.1.0",
4
4
  "sideEffects": false,
5
5
  "description": "React implementation of Neo4j Design System",
6
6
  "keywords": [
@@ -64,7 +64,7 @@
64
64
  "@tanstack/react-table": "8.20.5",
65
65
  "react": ">=16.8.0",
66
66
  "react-dom": ">=16.8.0",
67
- "@neo4j-ndl/base": "^3.0.18"
67
+ "@neo4j-ndl/base": "^3.1.0"
68
68
  },
69
69
  "dependencies": {
70
70
  "@dnd-kit/core": "6.1.0",
@@ -82,11 +82,11 @@
82
82
  "react-datepicker": "6.9.0",
83
83
  "react-dropzone": "14.2.9",
84
84
  "react-focus-lock": "2.13.2",
85
- "react-select": "5.8.1",
85
+ "react-select": "5.9.0",
86
86
  "react-stately": "3.33.0",
87
87
  "react-syntax-highlighter": "15.5.0",
88
88
  "react-use": "17.5.1",
89
- "sonner": "1.4.41",
89
+ "sonner": "1.7.1",
90
90
  "tinycolor2": "1.6.0",
91
91
  "usehooks-ts": "3.1.0"
92
92
  },
@@ -105,7 +105,7 @@
105
105
  "format": "prettier --write 'src/**/*.{js,jsx,ts,tsx}'",
106
106
  "lint": "eslint src",
107
107
  "generate:all": "pnpm generate:custom-icons && pnpm generate:hero-icons",
108
- "generate:custom-icons": "svgr --template svgr-template.js --index-template svgr-index-template.js --icon --typescript --no-svgo --replace-attr-values '#535B66=currentColor' --svg-props className=ndl-icon-svg --jsx-runtime 'automatic' --out-dir ./src/icons/generated/custom -- ../base/src/icons",
108
+ "generate:custom-icons": "svgr --template svgr-template.js --index-template svgr-index-template.js --icon --typescript --no-svgo --replace-attr-values '#535B66=currentColor' --replace-attr-values '#4D5157=currentColor' --svg-props className=ndl-icon-svg --jsx-runtime 'automatic' --out-dir ./src/icons/generated/custom -- ../base/src/icons",
109
109
  "generate:hero-icons": "ts-node ./scripts/generatedHeroIcons.ts",
110
110
  "nuke:local": "../../scripts/cc.sh '{yellow ☢️} Nuking react! {yellow ☢️}' && pnpm dlx rimraf@5.0.5 .tsbuildinfo node_modules lib playwright-report test-results playwright/.cache",
111
111
  "test:all-package-scripts": "pnpm run build && pnpm run generate-component test-component && pnpm run pretest && pnpm run prepare && pnpm run format && pnpm run lint && pnpm run generate:custom-icons && pnpm run nuke:local"
@@ -1 +0,0 @@
1
- {"version":3,"file":"sonner-types.js","sourceRoot":"","sources":["../../../src/toast/sonner-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,kFAAkF;AAClF,kDAAkD;AAClD,4CAA4C;AAC5C,kDAAkD;AAClD,oBAAoB;;;AA4FpB,4BAKC;AALD,SAAgB,QAAQ,CAAC,MAAgC;IACvD,OAAO,CACJ,MAAiB,CAAC,KAAK,KAAK,SAAS;QACtC,OAAQ,MAAiB,CAAC,OAAO,KAAK,UAAU,CACjD,CAAC;AACJ,CAAC;AA0FD,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,0CAAuB,CAAA;IACvB,4CAAyB,CAAA;IACzB,0CAAuB,CAAA;AACzB,CAAC,EAJW,eAAe,+BAAf,eAAe,QAI1B"}