@neo4j-ndl/react 2.0.0-alpha-9fc5150 → 2.0.0-alpha-f4e6aa3
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.
- package/lib/cjs/_common/CodeBlockWrapper.js +6 -9
- package/lib/cjs/_common/CodeBlockWrapper.js.map +1 -1
- package/lib/cjs/_common/defaultImports.js +30 -0
- package/lib/cjs/_common/defaultImports.js.map +1 -0
- package/lib/cjs/_common/input/RadioAndCheckboxWrapper.js +4 -7
- package/lib/cjs/_common/input/RadioAndCheckboxWrapper.js.map +1 -1
- package/lib/cjs/accordion/Accordion.js +9 -12
- package/lib/cjs/accordion/Accordion.js.map +1 -1
- package/lib/cjs/banner/Banner.js +4 -7
- package/lib/cjs/banner/Banner.js.map +1 -1
- package/lib/cjs/button/Button.js +6 -7
- package/lib/cjs/button/Button.js.map +1 -1
- package/lib/cjs/button/IconButton.js +7 -7
- package/lib/cjs/button/IconButton.js.map +1 -1
- package/lib/cjs/button/IconButtonArray.js +4 -4
- package/lib/cjs/button/IconButtonArray.js.map +1 -1
- package/lib/cjs/checkbox/Checkbox.js +15 -3
- package/lib/cjs/checkbox/Checkbox.js.map +1 -1
- package/lib/cjs/context-menu/ContextMenu.js +6 -9
- package/lib/cjs/context-menu/ContextMenu.js.map +1 -1
- package/lib/cjs/data-grid/Components.js +18 -21
- package/lib/cjs/data-grid/Components.js.map +1 -1
- package/lib/cjs/data-grid/DataGrid.js +2 -5
- package/lib/cjs/data-grid/DataGrid.js.map +1 -1
- package/lib/cjs/date-picker/DatePicker.js +4 -4
- package/lib/cjs/date-picker/DatePicker.js.map +1 -1
- package/lib/cjs/dialog/Dialog.js +9 -12
- package/lib/cjs/dialog/Dialog.js.map +1 -1
- package/lib/cjs/drawer/Drawer.js +8 -12
- package/lib/cjs/drawer/Drawer.js.map +1 -1
- package/lib/cjs/dropdown/Dropdown.js +34 -36
- package/lib/cjs/dropdown/Dropdown.js.map +1 -1
- package/lib/cjs/dropdown/Overrides.js +26 -8
- package/lib/cjs/dropdown/Overrides.js.map +1 -1
- package/lib/cjs/dropzone/Dropzone.js +2 -2
- package/lib/cjs/dropzone/Dropzone.js.map +1 -1
- package/lib/cjs/dropzone/icons/Cloud.js +1 -1
- package/lib/cjs/dropzone/icons/Cloud.js.map +1 -1
- package/lib/cjs/graph-label/GraphLabel.js +11 -14
- package/lib/cjs/graph-label/GraphLabel.js.map +1 -1
- package/lib/cjs/helpers/types.js +2 -1
- package/lib/cjs/helpers/types.js.map +1 -1
- package/lib/cjs/label/Label.js +7 -7
- package/lib/cjs/label/Label.js.map +1 -1
- package/lib/cjs/loading-spinner/LoadingSpinner.js +4 -4
- package/lib/cjs/loading-spinner/LoadingSpinner.js.map +1 -1
- package/lib/cjs/modal/Modal.js +4 -4
- package/lib/cjs/modal/Modal.js.map +1 -1
- package/lib/cjs/popover/Popover.js +7 -7
- package/lib/cjs/popover/Popover.js.map +1 -1
- package/lib/cjs/progress-bar/ProgressBar.js +4 -4
- package/lib/cjs/progress-bar/ProgressBar.js.map +1 -1
- package/lib/cjs/segmented-control/SegmentedControl.js +7 -10
- package/lib/cjs/segmented-control/SegmentedControl.js.map +1 -1
- package/lib/cjs/side-navigation/SideNavigation.js +15 -18
- package/lib/cjs/side-navigation/SideNavigation.js.map +1 -1
- package/lib/cjs/status-indicator/StatusIndicator.js +8 -8
- package/lib/cjs/status-indicator/StatusIndicator.js.map +1 -1
- package/lib/cjs/table/Components.js +18 -21
- package/lib/cjs/table/Components.js.map +1 -1
- package/lib/cjs/table/Table.js +7 -8
- package/lib/cjs/table/Table.js.map +1 -1
- package/lib/cjs/tabs/Tabs.js +10 -13
- package/lib/cjs/tabs/Tabs.js.map +1 -1
- package/lib/cjs/tag/Tag.js +4 -7
- package/lib/cjs/tag/Tag.js.map +1 -1
- package/lib/cjs/text-input/TextInput.js +5 -8
- package/lib/cjs/text-input/TextInput.js.map +1 -1
- package/lib/cjs/text-link/TextLink.js +6 -5
- package/lib/cjs/text-link/TextLink.js.map +1 -1
- package/lib/cjs/textarea/Textarea.js +5 -8
- package/lib/cjs/textarea/Textarea.js.map +1 -1
- package/lib/cjs/theme/ThemeProvider.js +5 -8
- package/lib/cjs/theme/ThemeProvider.js.map +1 -1
- package/lib/cjs/tip/Tip.js +18 -16
- package/lib/cjs/tip/Tip.js.map +1 -1
- package/lib/cjs/tip/Tooltip.js +7 -5
- package/lib/cjs/tip/Tooltip.js.map +1 -1
- package/lib/cjs/typography/Typography.js +4 -7
- package/lib/cjs/typography/Typography.js.map +1 -1
- package/lib/cjs/widget/Widget.js +4 -4
- package/lib/cjs/widget/Widget.js.map +1 -1
- package/lib/cjs/wizard/Wizard.js +13 -16
- package/lib/cjs/wizard/Wizard.js.map +1 -1
- package/lib/esm/_common/CodeBlockWrapper.js +3 -3
- package/lib/esm/_common/CodeBlockWrapper.js.map +1 -1
- package/lib/esm/_common/defaultImports.js +24 -0
- package/lib/esm/_common/defaultImports.js.map +1 -0
- package/lib/esm/_common/input/RadioAndCheckboxWrapper.js +4 -4
- package/lib/esm/_common/input/RadioAndCheckboxWrapper.js.map +1 -1
- package/lib/esm/accordion/Accordion.js +1 -1
- package/lib/esm/accordion/Accordion.js.map +1 -1
- package/lib/esm/banner/Banner.js +4 -4
- package/lib/esm/banner/Banner.js.map +1 -1
- package/lib/esm/button/Button.js +6 -7
- package/lib/esm/button/Button.js.map +1 -1
- package/lib/esm/button/IconButton.js +7 -7
- package/lib/esm/button/IconButton.js.map +1 -1
- package/lib/esm/button/IconButtonArray.js +4 -4
- package/lib/esm/button/IconButtonArray.js.map +1 -1
- package/lib/esm/checkbox/Checkbox.js +15 -3
- package/lib/esm/checkbox/Checkbox.js.map +1 -1
- package/lib/esm/context-menu/ContextMenu.js +6 -6
- package/lib/esm/context-menu/ContextMenu.js.map +1 -1
- package/lib/esm/data-grid/Components.js +2 -2
- package/lib/esm/data-grid/Components.js.map +1 -1
- package/lib/esm/data-grid/DataGrid.js +1 -1
- package/lib/esm/data-grid/DataGrid.js.map +1 -1
- package/lib/esm/date-picker/DatePicker.js +5 -5
- package/lib/esm/date-picker/DatePicker.js.map +1 -1
- package/lib/esm/dialog/Dialog.js +9 -9
- package/lib/esm/dialog/Dialog.js.map +1 -1
- package/lib/esm/drawer/Drawer.js +4 -5
- package/lib/esm/drawer/Drawer.js.map +1 -1
- package/lib/esm/dropdown/Dropdown.js +36 -38
- package/lib/esm/dropdown/Dropdown.js.map +1 -1
- package/lib/esm/dropdown/Overrides.js +24 -4
- package/lib/esm/dropdown/Overrides.js.map +1 -1
- package/lib/esm/dropzone/Dropzone.js +2 -2
- package/lib/esm/dropzone/Dropzone.js.map +1 -1
- package/lib/esm/dropzone/icons/Cloud.js +1 -1
- package/lib/esm/dropzone/icons/Cloud.js.map +1 -1
- package/lib/esm/graph-label/GraphLabel.js +11 -11
- package/lib/esm/graph-label/GraphLabel.js.map +1 -1
- package/lib/esm/helpers/types.js +1 -0
- package/lib/esm/helpers/types.js.map +1 -1
- package/lib/esm/label/Label.js +7 -7
- package/lib/esm/label/Label.js.map +1 -1
- package/lib/esm/loading-spinner/LoadingSpinner.js +4 -4
- package/lib/esm/loading-spinner/LoadingSpinner.js.map +1 -1
- package/lib/esm/modal/Modal.js +5 -5
- package/lib/esm/modal/Modal.js.map +1 -1
- package/lib/esm/popover/Popover.js +7 -7
- package/lib/esm/popover/Popover.js.map +1 -1
- package/lib/esm/progress-bar/ProgressBar.js +4 -4
- package/lib/esm/progress-bar/ProgressBar.js.map +1 -1
- package/lib/esm/segmented-control/SegmentedControl.js +7 -7
- package/lib/esm/segmented-control/SegmentedControl.js.map +1 -1
- package/lib/esm/side-navigation/SideNavigation.js +10 -10
- package/lib/esm/side-navigation/SideNavigation.js.map +1 -1
- package/lib/esm/status-indicator/StatusIndicator.js +8 -8
- package/lib/esm/status-indicator/StatusIndicator.js.map +1 -1
- package/lib/esm/table/Components.js +2 -2
- package/lib/esm/table/Components.js.map +1 -1
- package/lib/esm/table/Table.js +7 -5
- package/lib/esm/table/Table.js.map +1 -1
- package/lib/esm/tabs/Tabs.js +10 -10
- package/lib/esm/tabs/Tabs.js.map +1 -1
- package/lib/esm/tag/Tag.js +4 -4
- package/lib/esm/tag/Tag.js.map +1 -1
- package/lib/esm/text-input/TextInput.js +5 -5
- package/lib/esm/text-input/TextInput.js.map +1 -1
- package/lib/esm/text-link/TextLink.js +7 -6
- package/lib/esm/text-link/TextLink.js.map +1 -1
- package/lib/esm/textarea/Textarea.js +5 -5
- package/lib/esm/textarea/Textarea.js.map +1 -1
- package/lib/esm/theme/ThemeProvider.js +3 -3
- package/lib/esm/theme/ThemeProvider.js.map +1 -1
- package/lib/esm/tip/Tip.js +18 -16
- package/lib/esm/tip/Tip.js.map +1 -1
- package/lib/esm/tip/Tooltip.js +7 -5
- package/lib/esm/tip/Tooltip.js.map +1 -1
- package/lib/esm/typography/Typography.js +3 -3
- package/lib/esm/typography/Typography.js.map +1 -1
- package/lib/esm/widget/Widget.js +4 -4
- package/lib/esm/widget/Widget.js.map +1 -1
- package/lib/esm/wizard/Wizard.js +13 -13
- package/lib/esm/wizard/Wizard.js.map +1 -1
- package/lib/types/_common/defaultImports.d.ts +22 -0
- package/lib/types/_common/input/types.d.ts +8 -1
- package/lib/types/banner/Banner.d.ts +1 -1
- package/lib/types/button/Button.d.ts +1 -1
- package/lib/types/drawer/Drawer.d.ts +1 -5
- package/lib/types/dropdown/Overrides.d.ts +3 -2
- package/lib/types/dropdown/types.d.ts +1 -1
- package/lib/types/helpers/types.d.ts +14 -1
- package/lib/types/modal/Modal.d.ts +4 -3
- package/lib/types/table/Table.d.ts +1 -1
- package/lib/types/text-input/TextInput.d.ts +3 -4
- package/lib/types/textarea/Textarea.d.ts +2 -2
- package/lib/types/tip/Tip.d.ts +5 -3
- package/lib/types/wizard/Wizard.d.ts +4 -4
- package/package.json +2 -2
package/lib/esm/tip/Tip.js
CHANGED
|
@@ -35,7 +35,7 @@ import Tooltip from './Tooltip';
|
|
|
35
35
|
import ConditionalWrap from '../_common/ConditionalWrap';
|
|
36
36
|
import { Typography } from '../typography';
|
|
37
37
|
import { XMarkIconOutline } from '../icons';
|
|
38
|
-
import classNames from '
|
|
38
|
+
import { classNames } from '../_common/defaultImports';
|
|
39
39
|
import { tokens } from '@neo4j-ndl/base';
|
|
40
40
|
import { IconButton } from '../button';
|
|
41
41
|
import React from 'react';
|
|
@@ -53,9 +53,10 @@ const calculateArrow = (placement) => {
|
|
|
53
53
|
return 'bottom';
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
export function useTip({ allowedPlacements = PLACEMENTS, isOpen: controlledOpen, onOpenChange: setControlledOpen, type = 'tooltip', } = {}) {
|
|
56
|
+
export function useTip({ allowedPlacements = PLACEMENTS, isOpen: controlledOpen, isDisabled = false, onOpenChange: setControlledOpen, type = 'tooltip', } = {}) {
|
|
57
57
|
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(false);
|
|
58
|
-
|
|
58
|
+
/** If `isDisabled` is passed, tip is never opened */
|
|
59
|
+
const open = isDisabled === true ? false : controlledOpen !== null && controlledOpen !== void 0 ? controlledOpen : uncontrolledOpen;
|
|
59
60
|
const setOpen = setControlledOpen !== null && setControlledOpen !== void 0 ? setControlledOpen : setUncontrolledOpen;
|
|
60
61
|
const data = useFloating({
|
|
61
62
|
placement: allowedPlacements[0],
|
|
@@ -115,28 +116,28 @@ export function Tip(_a) {
|
|
|
115
116
|
* Use `asChild` to pass any element as the trigger
|
|
116
117
|
*/
|
|
117
118
|
export const Trigger = React.forwardRef(function Trigger(_a, propRef) {
|
|
118
|
-
var { children, hasButtonWrapper = false } = _a,
|
|
119
|
+
var { children, hasButtonWrapper = false } = _a, restProps = __rest(_a, ["children", "hasButtonWrapper"]);
|
|
119
120
|
const context = useTipContext();
|
|
120
121
|
const childrenRef = children.ref;
|
|
121
122
|
const ref = useMergeRefs([context.refs.setReference, propRef, childrenRef]);
|
|
122
123
|
// `hasButtonWrapper=false` allows the user to pass any element as the anchor
|
|
123
124
|
if (!hasButtonWrapper && React.isValidElement(children)) {
|
|
124
|
-
return React.cloneElement(children, context.getReferenceProps(Object.assign(Object.assign(Object.assign({ ref },
|
|
125
|
+
return React.cloneElement(children, context.getReferenceProps(Object.assign(Object.assign(Object.assign({ ref }, restProps), children.props), { 'data-state': context.open ? 'open' : 'closed' })));
|
|
125
126
|
}
|
|
126
|
-
return (_jsx("button", Object.assign({ ref: ref, "data-state": context.open ? 'open' : 'closed' }, context.getReferenceProps(
|
|
127
|
+
return (_jsx("button", Object.assign({ ref: ref, "data-state": context.open ? 'open' : 'closed' }, context.getReferenceProps(restProps), { children: children })));
|
|
127
128
|
});
|
|
128
129
|
export const Content = React.forwardRef(function Content(_a, propRef) {
|
|
129
|
-
var { style, isPortaled = true, portalProps = {} } = _a,
|
|
130
|
+
var { style, isPortaled = true, portalProps = {}, className, children } = _a, restProps = __rest(_a, ["style", "isPortaled", "portalProps", "className", "children"]);
|
|
130
131
|
const { open, type, context, getFloatingProps, placement } = useTipContext();
|
|
131
132
|
const ref = useMergeRefs([context.refs.setFloating, propRef]);
|
|
132
133
|
if (!open)
|
|
133
134
|
return null;
|
|
134
|
-
const floatingProps = getFloatingProps(Object.assign(Object.assign({},
|
|
135
|
-
className: classNames('ndl-tip ndl-tooltip-wrapper',
|
|
135
|
+
const floatingProps = getFloatingProps(Object.assign(Object.assign({}, restProps), {
|
|
136
|
+
className: classNames('ndl-tip ndl-tooltip-wrapper', className, {
|
|
136
137
|
'ndl-toggletip': type === 'toggletip',
|
|
137
138
|
}),
|
|
138
139
|
}));
|
|
139
|
-
return (_jsx(ConditionalWrap, { condition: isPortaled, wrap: (
|
|
140
|
+
return (_jsx(ConditionalWrap, { condition: isPortaled, wrap: (wrapChildren) => (_jsx(FloatingPortal, Object.assign({ preserveTabOrder: true }, portalProps, { children: wrapChildren }))), children: _jsx(FloatingFocusManager, { context: context, disabled: type === 'tooltip', children: _jsx(Tooltip, Object.assign({ ref: ref }, floatingProps, { arrowPosition: calculateArrow(placement), style: Object.assign(Object.assign({ zIndex: tokens.zIndex.alias.tooltip }, context.floatingStyles), style), children: children })) }) }));
|
|
140
141
|
});
|
|
141
142
|
export const Header = React.forwardRef(function Content(_a, ref) {
|
|
142
143
|
var { isCloseable = true } = _a, restProps = __rest(_a, ["isCloseable"]);
|
|
@@ -149,7 +150,7 @@ export const Header = React.forwardRef(function Content(_a, ref) {
|
|
|
149
150
|
}
|
|
150
151
|
}, onClick: (event) => {
|
|
151
152
|
setOpen(false, event.nativeEvent);
|
|
152
|
-
}, "aria-label": "close-toggletip", "data-testid": "close-toggletip", children: _jsx(XMarkIconOutline, {}) }))] })));
|
|
153
|
+
}, "aria-label": "close-toggletip", "data-testid": "ndl-close-toggletip", children: _jsx(XMarkIconOutline, {}) }))] })));
|
|
153
154
|
});
|
|
154
155
|
export const Body = React.forwardRef(function Body(_a, ref) {
|
|
155
156
|
var restProps = __rest(_a, []);
|
|
@@ -161,17 +162,18 @@ export const Body = React.forwardRef(function Body(_a, ref) {
|
|
|
161
162
|
export const Actions = React.forwardRef(function Actions(_a, ref) {
|
|
162
163
|
var restProps = __rest(_a, []);
|
|
163
164
|
const { open } = useTipContext();
|
|
164
|
-
const
|
|
165
|
+
const classes = classNames('ndl-toggletip-actions', restProps.className);
|
|
165
166
|
if (!open)
|
|
166
167
|
return null;
|
|
167
|
-
return _jsx("div", Object.assign({}, restProps, { className:
|
|
168
|
+
return _jsx("div", Object.assign({}, restProps, { className: classes, ref: ref }));
|
|
168
169
|
});
|
|
169
|
-
export const Action = (
|
|
170
|
+
export const Action = (_a) => {
|
|
171
|
+
var { className } = _a, restProps = __rest(_a, ["className"]);
|
|
170
172
|
const { open } = useTipContext();
|
|
171
|
-
const
|
|
173
|
+
const classes = classNames('ndl-toggletip-action', className);
|
|
172
174
|
if (!open)
|
|
173
175
|
return null;
|
|
174
|
-
return (_jsx(Typography, Object.assign({ as: "button" },
|
|
176
|
+
return (_jsx(Typography, Object.assign({ as: "button" }, restProps, { tabIndex: 0, variant: "label", className: classes })));
|
|
175
177
|
};
|
|
176
178
|
Tip.Content = Content;
|
|
177
179
|
Tip.Trigger = Trigger;
|
package/lib/esm/tip/Tip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tip.js","sourceRoot":"","sources":["../../../src/tip/Tip.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,WAAW,EACX,UAAU,EACV,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,OAAO,EACP,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,oBAAoB,EACpB,cAAc,GACf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,eAAe,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"Tip.js","sourceRoot":"","sources":["../../../src/tip/Tip.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,WAAW,EACX,UAAU,EACV,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,OAAO,EACP,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,oBAAoB,EACpB,cAAc,GACf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,eAAe,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,M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OAAO,IAClB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC;AACtB,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC;AACtB,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC;AACpB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC;AAChB,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC;AACtB,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC"}
|
package/lib/esm/tip/Tooltip.js
CHANGED
|
@@ -31,11 +31,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
31
31
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
32
32
|
*/
|
|
33
33
|
import React from 'react';
|
|
34
|
-
import
|
|
34
|
+
import { classNames } from '../_common/defaultImports';
|
|
35
|
+
import { useNeedleTheme } from '../theme';
|
|
35
36
|
const Tooltip = React.forwardRef(function Tooltip(_a, ref) {
|
|
36
|
-
var { arrowPosition, children, className } = _a,
|
|
37
|
-
const
|
|
38
|
-
const
|
|
37
|
+
var { arrowPosition, children, className } = _a, restProps = __rest(_a, ["arrowPosition", "children", "className"]);
|
|
38
|
+
const { themeClassName } = useNeedleTheme();
|
|
39
|
+
const wrapperClasses = classNames('ndl-tooltip-wrapper', themeClassName, className);
|
|
40
|
+
const triangleClasses = classNames('ndl-tooltip-triangle', {
|
|
39
41
|
'ndl-top': arrowPosition === 'top',
|
|
40
42
|
'ndl-bottom': arrowPosition === 'bottom',
|
|
41
43
|
'ndl-left': arrowPosition === 'left',
|
|
@@ -43,7 +45,7 @@ const Tooltip = React.forwardRef(function Tooltip(_a, ref) {
|
|
|
43
45
|
'ndl-top-left': arrowPosition === 'top-left',
|
|
44
46
|
'ndl-top-right': arrowPosition === 'top-right',
|
|
45
47
|
});
|
|
46
|
-
return (_jsxs("div", Object.assign({},
|
|
48
|
+
return (_jsxs("div", Object.assign({}, restProps, { role: "tooltip", className: wrapperClasses, ref: ref, children: [children, _jsx("div", { className: triangleClasses })] })));
|
|
47
49
|
});
|
|
48
50
|
export default Tooltip;
|
|
49
51
|
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/tip/Tooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/tip/Tooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAgB1C,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,OAAO,CAC/C,EAAkE,EAClE,GAAuC;QADvC,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,OAA8B,EAAzB,SAAS,cAAlD,0CAAoD,CAAF;IAGlD,MAAM,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAAC;IAC5C,MAAM,cAAc,GAAG,UAAU,CAC/B,qBAAqB,EACrB,cAAc,EACd,SAAS,CACV,CAAC;IAEF,MAAM,eAAe,GAAG,UAAU,CAAC,sBAAsB,EAAE;QACzD,SAAS,EAAE,aAAa,KAAK,KAAK;QAClC,YAAY,EAAE,aAAa,KAAK,QAAQ;QACxC,UAAU,EAAE,aAAa,KAAK,MAAM;QACpC,WAAW,EAAE,aAAa,KAAK,OAAO;QACtC,cAAc,EAAE,aAAa,KAAK,UAAU;QAC5C,eAAe,EAAE,aAAa,KAAK,WAAW;KAC/C,CAAC,CAAC;IAEH,OAAO,CACL,+BAAS,SAAS,IAAE,IAAI,EAAC,SAAS,EAAC,SAAS,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG,aACnE,QAAQ,EACT,cAAK,SAAS,EAAE,eAAe,GAAI,KAC/B,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,OAAO,CAAC"}
|
|
@@ -30,14 +30,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
30
30
|
* You should have received a copy of the GNU General Public License
|
|
31
31
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
32
32
|
*/
|
|
33
|
-
import classNames from '
|
|
33
|
+
import { classNames } from '../_common/defaultImports';
|
|
34
34
|
import { needleWarningMessage } from '../_common/utils';
|
|
35
35
|
import { TypographyDefaultMapping, } from './types';
|
|
36
36
|
export const Typography = (props) => {
|
|
37
|
-
const { className = '', variant, as } = props,
|
|
37
|
+
const { className = '', variant, as } = props, restProps = __rest(props, ["className", "variant", "as"]);
|
|
38
38
|
const classes = classNames(`n-${variant}`, className);
|
|
39
39
|
const Component = (as || TypographyDefaultMapping[variant]);
|
|
40
|
-
return _jsx(Component, Object.assign({},
|
|
40
|
+
return _jsx(Component, Object.assign({}, restProps, { className: classes }));
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
43
43
|
* Experimental Type testing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.js","sourceRoot":"","sources":["../../../src/typography/Typography.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"Typography.js","sourceRoot":"","sources":["../../../src/typography/Typography.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EACL,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* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
32
32
|
*/
|
|
33
33
|
import { forwardRef } from 'react';
|
|
34
|
-
import
|
|
34
|
+
import { classNames } from '../_common/defaultImports';
|
|
35
35
|
import { default as ResizeCornerIcon } from '../icons/generated/custom/ResizeCorner';
|
|
36
36
|
/**
|
|
37
37
|
*
|
|
@@ -42,12 +42,12 @@ import { default as ResizeCornerIcon } from '../icons/generated/custom/ResizeCor
|
|
|
42
42
|
*/
|
|
43
43
|
const Widget = forwardRef(function Widget(_a, ref) {
|
|
44
44
|
var _b;
|
|
45
|
-
var { header, subheader, leftMenu, rightMenu, isElevated = false, isResizeable = false, resizeableProps, children, className } = _a,
|
|
46
|
-
const classes =
|
|
45
|
+
var { header, subheader, leftMenu, rightMenu, isElevated = false, isResizeable = false, resizeableProps, children, className } = _a, restProps = __rest(_a, ["header", "subheader", "leftMenu", "rightMenu", "isElevated", "isResizeable", "resizeableProps", "children", "className"]);
|
|
46
|
+
const classes = classNames('ndl-widget', className, {
|
|
47
47
|
'ndl-leftmenu': leftMenu,
|
|
48
48
|
'ndl-elevated': isElevated,
|
|
49
49
|
});
|
|
50
|
-
return (_jsxs("div", Object.assign({ className: classes, ref: ref },
|
|
50
|
+
return (_jsxs("div", Object.assign({ className: classes, ref: ref }, restProps, { children: [_jsxs("header", { className: "ndl-header-wrapper", children: [_jsxs("div", { className: "ndl-header-left", children: [leftMenu, _jsxs("div", { className: "ndl-headers n-flex n-flex-col", children: [_jsx("div", { className: "ndl-header", children: header }), _jsx("div", { className: "ndl-subheader", children: subheader })] })] }), rightMenu] }), _jsx("div", { className: "ndl-widget-content n-flex-grow", children: children }), isResizeable && (_jsx("button", Object.assign({ "aria-label": "Resizing handle" }, resizeableProps, { className: `ndl-resize-handle ${(_b = resizeableProps === null || resizeableProps === void 0 ? void 0 : resizeableProps.className) !== null && _b !== void 0 ? _b : ''}`, children: _jsx(ResizeCornerIcon, {}) })))] })));
|
|
51
51
|
});
|
|
52
52
|
export default Widget;
|
|
53
53
|
//# sourceMappingURL=Widget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Widget.js","sourceRoot":"","sources":["../../../src/widget/Widget.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAc,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAC7D,OAAO,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"Widget.js","sourceRoot":"","sources":["../../../src/widget/Widget.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAc,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAgCrF;;;;;;GAMG;AAEH,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,MAAM,CACvC,EAWc,EACd,GAAiC;;QAZjC,EACE,MAAM,EACN,SAAS,EACT,QAAQ,EACR,SAAS,EACT,UAAU,GAAG,KAAK,EAClB,YAAY,GAAG,KAAK,EACpB,eAAe,EACf,QAAQ,EACR,SAAS,OAEG,EADT,SAAS,cAVd,0HAWC,CADa;IAId,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,EAAE,SAAS,EAAE;QAClD,cAAc,EAAE,QAAQ;QACxB,cAAc,EAAE,UAAU;KAC3B,CAAC,CAAC;IAEH,OAAO,CACL,6BAAK,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,IAAM,SAAS,eAC9C,kBAAQ,SAAS,EAAC,oBAAoB,aACpC,eAAK,SAAS,EAAC,iBAAiB,aAC7B,QAAQ,EACT,eAAK,SAAS,EAAC,+BAA+B,aAC5C,cAAK,SAAS,EAAC,YAAY,YAAE,MAAM,GAAO,EAC1C,cAAK,SAAS,EAAC,eAAe,YAAE,SAAS,GAAO,IAC5C,IACF,EACL,SAAS,IACH,EACT,cAAK,SAAS,EAAC,gCAAgC,YAAE,QAAQ,GAAO,EAC/D,YAAY,IAAI,CACf,6CACa,iBAAiB,IACxB,eAAe,IACnB,SAAS,EAAE,qBAAqB,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,SAAS,mCAAI,EAAE,EAAE,YAElE,KAAC,gBAAgB,KAAG,IACb,CACV,KACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
package/lib/esm/wizard/Wizard.js
CHANGED
|
@@ -30,7 +30,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
30
30
|
* You should have received a copy of the GNU General Public License
|
|
31
31
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
32
32
|
*/
|
|
33
|
-
import
|
|
33
|
+
import { classNames } from '../_common/defaultImports';
|
|
34
34
|
import { randomId } from '../_common/utils';
|
|
35
35
|
const getStatus = (activeStep, stepIndex) => stepIndex + 1 === activeStep
|
|
36
36
|
? 'active'
|
|
@@ -38,21 +38,21 @@ const getStatus = (activeStep, stepIndex) => stepIndex + 1 === activeStep
|
|
|
38
38
|
? 'incomplete'
|
|
39
39
|
: 'complete';
|
|
40
40
|
const Circle = ({ status, number, text, type, }) => {
|
|
41
|
-
const
|
|
41
|
+
const statusClasses = classNames({
|
|
42
42
|
'ndl-active': status === 'active',
|
|
43
43
|
'ndl-complete': status === 'complete',
|
|
44
44
|
'ndl-incomplete': status === 'incomplete',
|
|
45
45
|
});
|
|
46
|
-
const
|
|
46
|
+
const typeClasses = classNames({
|
|
47
47
|
'ndl-horizontal': type === 'horizontal',
|
|
48
48
|
'ndl-vertical': type === 'vertical',
|
|
49
49
|
});
|
|
50
|
-
return (_jsxs("div", { className: "ndl-wizard-circle", children: [_jsx("div", { className: "n-relative", children: _jsx("div", { className: `ndl-text ${
|
|
50
|
+
return (_jsxs("div", { className: "ndl-wizard-circle", children: [_jsx("div", { className: "n-relative", children: _jsx("div", { className: `ndl-text ${typeClasses}`, children: text }) }), _jsxs("svg", { className: `n-h-10 n-w-10 ${statusClasses}`, children: [status === 'active' && (_jsxs("g", { children: [_jsx("circle", { className: "n-fill-palette-primary-text", cx: "20", cy: "20", r: "20" }), _jsx("circle", { className: "n-fill-neutral-10", cx: "20", cy: "20", r: "18" })] })), _jsx("circle", { className: `${status === 'complete' || status === 'active'
|
|
51
51
|
? 'n-fill-palette-primary-text'
|
|
52
52
|
: 'n-fill-palette-neutral-text-weakest'}`, cx: "20", cy: "20", r: "16" }), _jsx("text", { x: "50%", y: "50%", className: "n-fill-neutral-10", textAnchor: "middle", dy: "0.3em", children: number })] })] }));
|
|
53
53
|
};
|
|
54
54
|
const Line = ({ status, type, }) => {
|
|
55
|
-
const classes =
|
|
55
|
+
const classes = classNames('ndl-wizard-line', {
|
|
56
56
|
'ndl-active': status === 'active',
|
|
57
57
|
'ndl-complete': status === 'complete',
|
|
58
58
|
'ndl-incomplete': status === 'incomplete',
|
|
@@ -62,7 +62,7 @@ const Line = ({ status, type, }) => {
|
|
|
62
62
|
return _jsx("div", { "aria-hidden": true, className: classes });
|
|
63
63
|
};
|
|
64
64
|
export const Horizontal = (_a) => {
|
|
65
|
-
var { activeStep, steps } = _a,
|
|
65
|
+
var { activeStep, steps, className } = _a, restProps = __rest(_a, ["activeStep", "steps", "className"]);
|
|
66
66
|
const components = [];
|
|
67
67
|
for (let i = 0; i < steps.length; i++) {
|
|
68
68
|
const text = steps[i];
|
|
@@ -71,10 +71,10 @@ export const Horizontal = (_a) => {
|
|
|
71
71
|
components.push(_jsx(Line, { type: "horizontal", status: getStatus(activeStep, i) }, `line-${i}-step-${randomId(4)}`));
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
return (_jsx("div", Object.assign({},
|
|
74
|
+
return (_jsx("div", Object.assign({}, restProps, { className: classNames('ndl-horizontal-wizard', className), role: "navigation", children: components })));
|
|
75
75
|
};
|
|
76
76
|
export const Vertical = (_a) => {
|
|
77
|
-
var { activeStep, steps } = _a,
|
|
77
|
+
var { activeStep, steps, className } = _a, restProps = __rest(_a, ["activeStep", "steps", "className"]);
|
|
78
78
|
const components = [];
|
|
79
79
|
for (let i = 0; i < steps.length; i++) {
|
|
80
80
|
const text = steps[i];
|
|
@@ -82,17 +82,17 @@ export const Vertical = (_a) => {
|
|
|
82
82
|
i < steps.length - 1 &&
|
|
83
83
|
components.push(_jsx(Line, { type: "vertical", status: getStatus(activeStep, i) }, `line-${i}-step-${randomId(4)}`));
|
|
84
84
|
}
|
|
85
|
-
return (_jsx("div", Object.assign({},
|
|
85
|
+
return (_jsx("div", Object.assign({}, restProps, { className: classNames('ndl-vertical-wizard ', className), role: "navigation", children: components })));
|
|
86
86
|
};
|
|
87
87
|
export const Footer = (_a) => {
|
|
88
|
-
var { activeStep, steps } = _a,
|
|
89
|
-
return (_jsx("div", Object.assign({},
|
|
88
|
+
var { activeStep, steps, className } = _a, restProps = __rest(_a, ["activeStep", "steps", "className"]);
|
|
89
|
+
return (_jsx("div", Object.assign({}, restProps, { className: classNames('ndl-footer-wizard', className), role: "navigation", children: _jsxs("div", { className: "n-flex n-items-center", children: [_jsx("div", { className: "n-w-32 n-mr-6 n-h-[1px] n-bg-palette-neutral-border-strong" }), steps.map((v, i) => (_jsx("div", { className: "n-items-center n-justify-center n-flex n-px-[2px]", children: _jsxs("svg", { className: `n-h-2 n-w-2 footer-circle ${getStatus(activeStep, i)}`, children: [getStatus(activeStep, i) === 'active' && (_jsx("g", { children: _jsx("circle", { className: "n-fill-palette-primary-text", cx: "4", cy: "4", r: "4" }) })), _jsx("circle", { className: `${getStatus(activeStep, i) === 'active'
|
|
90
90
|
? 'n-fill-palette-primary-text'
|
|
91
91
|
: 'n-fill-palette-neutral-border-strong'}`, cx: "4", cy: "4", r: "3" })] }) }, i))), _jsx("div", { className: "n-w-32 n-ml-6 n-h-[1px] n-bg-palette-neutral-border-strong" })] }) })));
|
|
92
92
|
};
|
|
93
93
|
export const Wizard = (_a) => {
|
|
94
|
-
var { type = 'horizontal', activeStep = 0, steps = [] } = _a,
|
|
95
|
-
const allProps = Object.assign({ activeStep: activeStep, steps: steps },
|
|
94
|
+
var { type = 'horizontal', activeStep = 0, steps = [] } = _a, restProps = __rest(_a, ["type", "activeStep", "steps"]);
|
|
95
|
+
const allProps = Object.assign({ activeStep: activeStep, steps: steps }, restProps);
|
|
96
96
|
switch (type) {
|
|
97
97
|
case 'vertical':
|
|
98
98
|
return _jsx(Vertical, Object.assign({}, allProps));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Wizard.js","sourceRoot":"","sources":["../../../src/wizard/Wizard.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"Wizard.js","sourceRoot":"","sources":["../../../src/wizard/Wizard.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,SAAS,GAAG,CAAC,UAAkB,EAAE,SAAiB,EAAE,EAAE,CAC1D,SAAS,GAAG,CAAC,KAAK,UAAU;IAC1B,CAAC,CAAC,QAAQ;IACV,CAAC,CAAC,UAAU,GAAG,SAAS,GAAG,CAAC;QAC5B,CAAC,CAAC,YAAY;QACd,CAAC,CAAC,UAAU,CAAC;AAEjB,MAAM,MAAM,GAAG,CAAC,EACd,MAAM,EACN,MAAM,EACN,IAAI,EACJ,IAAI,GAML,EAAE,EAAE;IACH,MAAM,aAAa,GAAG,UAAU,CAAC;QAC/B,YAAY,EAAE,MAAM,KAAK,QAAQ;QACjC,cAAc,EAAE,MAAM,KAAK,UAAU;QACrC,gBAAgB,EAAE,MAAM,K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
|
+
*
|
|
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 classNamesDefault from 'classnames';
|
|
22
|
+
export declare const classNames: typeof classNamesDefault;
|
|
@@ -18,8 +18,10 @@
|
|
|
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 { type Tip } from '../../tip';
|
|
21
22
|
import { type ComponentPropsWithoutRef } from 'react';
|
|
22
|
-
|
|
23
|
+
import type { ComponentPropsWithoutRefAsObj } from '../../helpers';
|
|
24
|
+
export interface CommonInputProps extends Omit<ComponentPropsWithoutRef<'input'>, 'size'> {
|
|
23
25
|
/** Sets disabled state */
|
|
24
26
|
disabled?: boolean;
|
|
25
27
|
/** Sets the label */
|
|
@@ -29,3 +31,8 @@ export interface CommonInputProps extends Omit<ComponentPropsWithoutRef<'input'>
|
|
|
29
31
|
/** Ref to the `input` element */
|
|
30
32
|
ref?: React.RefObject<HTMLInputElement>;
|
|
31
33
|
}
|
|
34
|
+
export type TooltipObjectProps = {
|
|
35
|
+
tooltipRoot?: Partial<ComponentPropsWithoutRefAsObj<typeof Tip>>;
|
|
36
|
+
tooltipTrigger?: Partial<ComponentPropsWithoutRefAsObj<(typeof Tip)['Trigger']>>;
|
|
37
|
+
tooltipContent?: Partial<ComponentPropsWithoutRefAsObj<(typeof Tip)['Content']>>;
|
|
38
|
+
};
|
|
@@ -73,7 +73,7 @@ export type BannerProps = BannerCommonProps & BannerCloseProps;
|
|
|
73
73
|
export type BannerType = 'info' | 'success' | 'warning' | 'danger';
|
|
74
74
|
declare const Banner: React.ForwardRefExoticComponent<BannerProps & React.RefAttributes<HTMLDivElement>> & {
|
|
75
75
|
Actions: {
|
|
76
|
-
({ label, ...
|
|
76
|
+
({ label, ...restProps }: BannerActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
77
77
|
displayName: string;
|
|
78
78
|
};
|
|
79
79
|
};
|
|
@@ -41,7 +41,7 @@ export interface ButtonProps extends ElementBase<HTMLButtonElement> {
|
|
|
41
41
|
/** Fill type of button */
|
|
42
42
|
fill?: 'filled' | 'outlined' | 'text';
|
|
43
43
|
/** Size of button */
|
|
44
|
-
size?: '
|
|
44
|
+
size?: 'small' | 'medium' | 'large';
|
|
45
45
|
/** If the button is in floating state */
|
|
46
46
|
floating?: boolean;
|
|
47
47
|
}
|
|
@@ -36,15 +36,11 @@ export interface DrawerProps extends ElementBase<HTMLDivElement> {
|
|
|
36
36
|
isResizeable?: boolean;
|
|
37
37
|
/** To use this prop the isResizeable prop must be set to true. For overriding the third party library props: https://github.com/bokuweb/re-resizable */
|
|
38
38
|
resizeableProps?: ResizableProps;
|
|
39
|
-
/**
|
|
40
|
-
* @deprecated Use the style property instead.
|
|
41
|
-
*/
|
|
42
|
-
minWidth?: number;
|
|
43
39
|
/** Is closeable. */
|
|
44
40
|
closeable?: boolean;
|
|
45
41
|
}
|
|
46
42
|
export declare const Drawer: {
|
|
47
|
-
({ children, className, expanded, onExpandedChange, position, type, isResizeable, resizeableProps,
|
|
43
|
+
({ children, className, expanded, onExpandedChange, position, type, isResizeable, resizeableProps, closeable, ...restProps }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
48
44
|
Header: ({ children, className, ...restProps }: DrawerHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
49
45
|
Actions: ({ children, className, ...restProps }: DrawerActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
50
46
|
Body: ({ children, className, ...restProps }: DrawerBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -19,9 +19,10 @@
|
|
|
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 PlaceholderProps } from 'react-select';
|
|
22
|
+
import { type ClearIndicatorProps, type DropdownIndicatorProps, type GroupBase, type MultiValueRemoveProps, type PlaceholderProps, type OptionProps } from 'react-select';
|
|
23
23
|
import { type DropdownOverrideCustomProps } from './types';
|
|
24
24
|
export declare const DropdownIndicatorCurrying: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ errorText, size, }: DropdownOverrideCustomProps<OptionType, IsMulti, GroupType>) => (props: DropdownIndicatorProps<OptionType, IsMulti, GroupType>) => import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
export declare const CustomClearIndication: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ errorText, size, }: DropdownOverrideCustomProps<OptionType, IsMulti, GroupType>) => (props: ClearIndicatorProps<OptionType, IsMulti, GroupType>) => import("react/jsx-runtime").JSX.Element;
|
|
26
26
|
export declare const CustomMultiValueRemove: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ errorText, size, }: DropdownOverrideCustomProps<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, }: DropdownOverrideCustomProps<OptionType, IsMulti, GroupType>) => (
|
|
27
|
+
export declare const CustomPlaceholder: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ errorText, size, }: DropdownOverrideCustomProps<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, }: DropdownOverrideCustomProps<OptionType, IsMulti, GroupType>) => ({ children, ...restProps }: OptionProps<OptionType, IsMulti, GroupType>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -37,7 +37,7 @@ export interface DropdownCommonProps extends Omit<ElementBase<HTMLDivElement>, '
|
|
|
37
37
|
/** Help text */
|
|
38
38
|
helpText?: string;
|
|
39
39
|
/** Size of the component */
|
|
40
|
-
size?: '
|
|
40
|
+
size?: 'small' | 'medium' | 'large';
|
|
41
41
|
/** Displays with fluid width */
|
|
42
42
|
fluid?: boolean;
|
|
43
43
|
}
|
|
@@ -18,8 +18,21 @@
|
|
|
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
|
-
|
|
21
|
+
import { type ComponentPropsWithoutRef, type ElementType } from 'react';
|
|
22
22
|
export type ElementBase<T = HTMLElement> = Omit<React.HTMLProps<T>, 'as' | 'selected' | 'size' | 'onChange' | 'ref'> & {
|
|
23
23
|
/** Override the root element rendered for the component */
|
|
24
24
|
as?: string | React.ComponentType<any>;
|
|
25
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* This type resolves complaining TypeScript issues
|
|
28
|
+
* with arbitrary `data-*` properties when we
|
|
29
|
+
* surface component properties in object type
|
|
30
|
+
* Sources:
|
|
31
|
+
* 1. https://github.com/neo4j/neo4j-ops-manager/pull/787#discussion_r1332971991
|
|
32
|
+
* 2. https://github.com/microsoft/TypeScript/issues/28960#issuecomment-903519759
|
|
33
|
+
*/
|
|
34
|
+
type DataAttributeKey = `data-${string}`;
|
|
35
|
+
export type ComponentPropsWithoutRefAsObj<T extends ElementType> = ComponentPropsWithoutRef<T> & {
|
|
36
|
+
[dataAttribute: DataAttributeKey]: any;
|
|
37
|
+
};
|
|
38
|
+
export {};
|
|
@@ -18,7 +18,8 @@
|
|
|
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
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import { type ComponentPropsWithoutRefAsObj } from '../helpers';
|
|
22
23
|
export declare enum ModalCloseReason {
|
|
23
24
|
BACKDROP_CLICK = "backdropClick",
|
|
24
25
|
ESCAPE_KEY_DOWN = "escapeKeyDown"
|
|
@@ -35,8 +36,8 @@ export interface ModalProps {
|
|
|
35
36
|
container?: Element;
|
|
36
37
|
onClose?: (e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>, reason?: ModalCloseReason) => void;
|
|
37
38
|
/** Forwards the props to the modal container's wrapper - use with caution */
|
|
38
|
-
rootProps?:
|
|
39
|
+
rootProps?: ComponentPropsWithoutRefAsObj<'div'>;
|
|
39
40
|
/** Forwards the props to the modal container */
|
|
40
|
-
modalProps?:
|
|
41
|
+
modalProps?: ComponentPropsWithoutRefAsObj<'div'>;
|
|
41
42
|
}
|
|
42
43
|
export declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -58,6 +58,6 @@ declare const TableNameSpace: (<T extends unknown>(props: {
|
|
|
58
58
|
tableProps: TableType<T>;
|
|
59
59
|
components?: TableComponentsInterface<T> | undefined;
|
|
60
60
|
} & Omit<ElementBase<HTMLDivElement>, "as" | "controls" | "data" | "headers" | "rows"> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null) & {
|
|
61
|
-
RowActions: (
|
|
61
|
+
RowActions: ({ className, ...restProps }: ElementBase<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
62
62
|
};
|
|
63
63
|
export default TableNameSpace;
|
|
@@ -18,9 +18,8 @@
|
|
|
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 { type
|
|
22
|
-
import { type CommonInputProps } from '../_common/input/types';
|
|
23
|
-
import { Tip } from '../tip';
|
|
21
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
22
|
+
import { type CommonInputProps, type TooltipObjectProps } from '../_common/input/types';
|
|
24
23
|
export interface TextInputProperties extends Omit<CommonInputProps, 'label'> {
|
|
25
24
|
/** Label text */
|
|
26
25
|
label?: ReactNode;
|
|
@@ -41,7 +40,7 @@ export interface TextInputProperties extends Omit<CommonInputProps, 'label'> {
|
|
|
41
40
|
/** Information to be displayed in the information tooltip */
|
|
42
41
|
informationIconText?: React.ReactNode;
|
|
43
42
|
/** Pass props to the underlying Tip component */
|
|
44
|
-
tooltipProps?:
|
|
43
|
+
tooltipProps?: TooltipObjectProps;
|
|
45
44
|
}
|
|
46
45
|
/**
|
|
47
46
|
*
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
21
|
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
22
|
-
import {
|
|
22
|
+
import { type TooltipObjectProps } from '../_common/input/types';
|
|
23
23
|
/**
|
|
24
24
|
*
|
|
25
25
|
*
|
|
@@ -43,7 +43,7 @@ export interface TextareaProps extends Omit<Omit<ComponentPropsWithoutRef<'texta
|
|
|
43
43
|
/** Information to be displayed in the information tooltip */
|
|
44
44
|
informationIconText?: React.ReactNode;
|
|
45
45
|
/** Pass props to the underlying Tip component */
|
|
46
|
-
tooltipProps?:
|
|
46
|
+
tooltipProps?: TooltipObjectProps;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
*
|
package/lib/types/tip/Tip.d.ts
CHANGED
|
@@ -30,10 +30,12 @@ export interface TipProps {
|
|
|
30
30
|
allowedPlacements?: Side[];
|
|
31
31
|
/** Controlled open state */
|
|
32
32
|
isOpen?: boolean;
|
|
33
|
+
/** If the tip is disabled, to Tip.Content will not be rendered if provided */
|
|
34
|
+
isDisabled?: boolean;
|
|
33
35
|
/** For controlled open state */
|
|
34
36
|
onOpenChange?: (isOpen: boolean, event?: Event) => void;
|
|
35
37
|
}
|
|
36
|
-
export declare function useTip({ allowedPlacements, isOpen: controlledOpen, onOpenChange: setControlledOpen, type, }?: TipProps): {
|
|
38
|
+
export declare function useTip({ allowedPlacements, isOpen: controlledOpen, isDisabled, onOpenChange: setControlledOpen, type, }?: TipProps): {
|
|
37
39
|
placement: import("@floating-ui/utils").Placement;
|
|
38
40
|
strategy: import("@floating-ui/utils").Strategy;
|
|
39
41
|
middlewareData: import("@floating-ui/react").MiddlewareData;
|
|
@@ -133,7 +135,7 @@ export declare namespace Tip {
|
|
|
133
135
|
var Header: React.ForwardRefExoticComponent<HeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
134
136
|
var Body: React.ForwardRefExoticComponent<BodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
135
137
|
var Actions: React.ForwardRefExoticComponent<ActionsProps & React.RefAttributes<HTMLDivElement>>;
|
|
136
|
-
var Action: (
|
|
138
|
+
var Action: ({ className, ...restProps }: ActionProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
137
139
|
}
|
|
138
140
|
/**
|
|
139
141
|
* Wrapping the trigger in a button by default
|
|
@@ -163,4 +165,4 @@ export declare const Body: React.ForwardRefExoticComponent<BodyProps & React.Ref
|
|
|
163
165
|
export type ActionsProps = Omit<ElementBase<HTMLDivElement>, 'as'>;
|
|
164
166
|
export declare const Actions: React.ForwardRefExoticComponent<ActionsProps & React.RefAttributes<HTMLDivElement>>;
|
|
165
167
|
export type ActionProps = Omit<ComponentProps<typeof Typography>, 'variant'>;
|
|
166
|
-
export declare const Action: (
|
|
168
|
+
export declare const Action: ({ className, ...restProps }: ActionProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
*/
|
|
21
21
|
/// <reference types="react" />
|
|
22
22
|
import { type ElementBase } from '../helpers';
|
|
23
|
-
export declare const Horizontal: ({ activeStep, steps, ...
|
|
24
|
-
export declare const Vertical: ({ activeStep, steps, ...
|
|
25
|
-
export declare const Footer: ({ activeStep, steps, ...
|
|
23
|
+
export declare const Horizontal: ({ activeStep, steps, className, ...restProps }: Omit<WizardProps, 'type'>) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare const Vertical: ({ activeStep, steps, className, ...restProps }: Omit<WizardProps, 'type'>) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare const Footer: ({ activeStep, steps, className, ...restProps }: Omit<WizardProps, 'type'>) => import("react/jsx-runtime").JSX.Element;
|
|
26
26
|
export interface WizardProps extends ElementBase<HTMLDivElement> {
|
|
27
27
|
type?: 'horizontal' | 'vertical' | 'footer';
|
|
28
28
|
activeStep: number;
|
|
29
29
|
steps: (string | JSX.Element)[];
|
|
30
30
|
}
|
|
31
|
-
export declare const Wizard: ({ type, activeStep, steps, ...
|
|
31
|
+
export declare const Wizard: ({ type, activeStep, steps, ...restProps }: WizardProps) => import("react/jsx-runtime").JSX.Element;
|