@neo4j-ndl/react 4.21.2 → 4.22.1
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/form-control/FormFieldLabel.js +52 -0
- package/lib/cjs/_common/form-control/FormFieldLabel.js.map +1 -0
- package/lib/cjs/_common/form-control/FormFieldMessage.js +72 -0
- package/lib/cjs/_common/form-control/FormFieldMessage.js.map +1 -0
- package/lib/cjs/_common/form-control/form-control-types.js +23 -0
- package/lib/cjs/_common/form-control/form-control-types.js.map +1 -0
- package/lib/cjs/_common/form-control/index.js +39 -0
- package/lib/cjs/_common/form-control/index.js.map +1 -0
- package/lib/cjs/_common/form-control/use-form-field.js +76 -0
- package/lib/cjs/_common/form-control/use-form-field.js.map +1 -0
- package/lib/cjs/_common/form-control/use-inline-field-label.js +76 -0
- package/lib/cjs/_common/form-control/use-inline-field-label.js.map +1 -0
- package/lib/cjs/checkbox/Checkbox.js +9 -21
- package/lib/cjs/checkbox/Checkbox.js.map +1 -1
- package/lib/cjs/combobox/Combobox.js +61 -45
- package/lib/cjs/combobox/Combobox.js.map +1 -1
- package/lib/cjs/combobox/combobox-types.js.map +1 -1
- package/lib/cjs/date-picker/DatePicker.js.map +1 -1
- package/lib/cjs/dropzone/stories/dropzone-full.story.js +5 -5
- package/lib/cjs/dropzone/stories/dropzone-full.story.js.map +1 -1
- package/lib/cjs/helpers/index.js +1 -0
- package/lib/cjs/helpers/index.js.map +1 -1
- package/lib/cjs/helpers/platform.js +59 -0
- package/lib/cjs/helpers/platform.js.map +1 -0
- package/lib/cjs/kbd/kbd-utils.js +6 -22
- package/lib/cjs/kbd/kbd-utils.js.map +1 -1
- package/lib/cjs/next/tree-view/TreeView.js +384 -66
- package/lib/cjs/next/tree-view/TreeView.js.map +1 -1
- package/lib/cjs/next/tree-view/selection.js +181 -0
- package/lib/cjs/next/tree-view/selection.js.map +1 -0
- package/lib/cjs/next/tree-view/stories/index.js +13 -1
- package/lib/cjs/next/tree-view/stories/index.js.map +1 -1
- package/lib/cjs/next/tree-view/stories/tree-view-large.story.js +57 -0
- package/lib/cjs/next/tree-view/stories/tree-view-large.story.js.map +1 -0
- package/lib/cjs/next/tree-view/stories/tree-view-lazy.story.js +1 -0
- package/lib/cjs/next/tree-view/stories/tree-view-lazy.story.js.map +1 -1
- package/lib/cjs/next/tree-view/stories/tree-view-multi.story.js +16 -40
- package/lib/cjs/next/tree-view/stories/tree-view-multi.story.js.map +1 -1
- package/lib/cjs/next/tree-view/stories/tree-view-multiple-replace.story.js +38 -0
- package/lib/cjs/next/tree-view/stories/tree-view-multiple-replace.story.js.map +1 -0
- package/lib/cjs/next/tree-view/stories/tree-view-non-selectable-folders.story.js +7 -4
- package/lib/cjs/next/tree-view/stories/tree-view-non-selectable-folders.story.js.map +1 -1
- package/lib/cjs/next/tree-view/stories/tree-view-root-selection.story.js +125 -0
- package/lib/cjs/next/tree-view/stories/tree-view-root-selection.story.js.map +1 -0
- package/lib/cjs/radio/Radio.js +12 -22
- package/lib/cjs/radio/Radio.js.map +1 -1
- package/lib/cjs/select/Select.js +14 -5
- package/lib/cjs/select/Select.js.map +1 -1
- package/lib/cjs/select/types.js.map +1 -1
- package/lib/cjs/switch/Switch.js +9 -21
- package/lib/cjs/switch/Switch.js.map +1 -1
- package/lib/cjs/text-area/TextArea.js +8 -21
- package/lib/cjs/text-area/TextArea.js.map +1 -1
- package/lib/cjs/text-input/TextInput.js +15 -38
- package/lib/cjs/text-input/TextInput.js.map +1 -1
- package/lib/cjs/text-input/stories/text-input-sizes.story.js +1 -1
- package/lib/cjs/text-input/stories/text-input-sizes.story.js.map +1 -1
- package/lib/cjs/time-picker/TimePicker.js +13 -7
- package/lib/cjs/time-picker/TimePicker.js.map +1 -1
- package/lib/cjs/timezone-picker/TimeZonePicker.js +13 -7
- package/lib/cjs/timezone-picker/TimeZonePicker.js.map +1 -1
- package/lib/cjs/toast/ToastControlled.js +1 -1
- package/lib/cjs/toast/ToastControlled.js.map +1 -1
- package/lib/esm/_common/form-control/FormFieldLabel.js +45 -0
- package/lib/esm/_common/form-control/FormFieldLabel.js.map +1 -0
- package/lib/esm/_common/form-control/FormFieldMessage.js +65 -0
- package/lib/esm/_common/form-control/FormFieldMessage.js.map +1 -0
- package/lib/esm/_common/form-control/form-control-types.js +22 -0
- package/lib/esm/_common/form-control/form-control-types.js.map +1 -0
- package/lib/esm/_common/form-control/index.js +32 -0
- package/lib/esm/_common/form-control/index.js.map +1 -0
- package/lib/esm/_common/form-control/use-form-field.js +72 -0
- package/lib/esm/_common/form-control/use-form-field.js.map +1 -0
- package/lib/esm/_common/form-control/use-inline-field-label.js +69 -0
- package/lib/esm/_common/form-control/use-inline-field-label.js.map +1 -0
- package/lib/esm/checkbox/Checkbox.js +10 -22
- package/lib/esm/checkbox/Checkbox.js.map +1 -1
- package/lib/esm/combobox/Combobox.js +62 -46
- package/lib/esm/combobox/Combobox.js.map +1 -1
- package/lib/esm/combobox/combobox-types.js.map +1 -1
- package/lib/esm/date-picker/DatePicker.js.map +1 -1
- package/lib/esm/dropzone/stories/dropzone-full.story.js +5 -5
- package/lib/esm/dropzone/stories/dropzone-full.story.js.map +1 -1
- package/lib/esm/helpers/index.js +1 -0
- package/lib/esm/helpers/index.js.map +1 -1
- package/lib/esm/helpers/platform.js +55 -0
- package/lib/esm/helpers/platform.js.map +1 -0
- package/lib/esm/kbd/kbd-utils.js +2 -18
- package/lib/esm/kbd/kbd-utils.js.map +1 -1
- package/lib/esm/next/tree-view/TreeView.js +385 -67
- package/lib/esm/next/tree-view/TreeView.js.map +1 -1
- package/lib/esm/next/tree-view/selection.js +175 -0
- package/lib/esm/next/tree-view/selection.js.map +1 -0
- package/lib/esm/next/tree-view/stories/index.js +9 -0
- package/lib/esm/next/tree-view/stories/index.js.map +1 -1
- package/lib/esm/next/tree-view/stories/tree-view-large.story.js +55 -0
- package/lib/esm/next/tree-view/stories/tree-view-large.story.js.map +1 -0
- package/lib/esm/next/tree-view/stories/tree-view-lazy.story.js +1 -0
- package/lib/esm/next/tree-view/stories/tree-view-lazy.story.js.map +1 -1
- package/lib/esm/next/tree-view/stories/tree-view-multi.story.js +16 -40
- package/lib/esm/next/tree-view/stories/tree-view-multi.story.js.map +1 -1
- package/lib/esm/next/tree-view/stories/tree-view-multiple-replace.story.js +36 -0
- package/lib/esm/next/tree-view/stories/tree-view-multiple-replace.story.js.map +1 -0
- package/lib/esm/next/tree-view/stories/tree-view-non-selectable-folders.story.js +7 -4
- package/lib/esm/next/tree-view/stories/tree-view-non-selectable-folders.story.js.map +1 -1
- package/lib/esm/next/tree-view/stories/tree-view-root-selection.story.js +123 -0
- package/lib/esm/next/tree-view/stories/tree-view-root-selection.story.js.map +1 -0
- package/lib/esm/radio/Radio.js +12 -22
- package/lib/esm/radio/Radio.js.map +1 -1
- package/lib/esm/select/Select.js +14 -5
- package/lib/esm/select/Select.js.map +1 -1
- package/lib/esm/select/types.js.map +1 -1
- package/lib/esm/switch/Switch.js +10 -22
- package/lib/esm/switch/Switch.js.map +1 -1
- package/lib/esm/text-area/TextArea.js +9 -22
- package/lib/esm/text-area/TextArea.js.map +1 -1
- package/lib/esm/text-input/TextInput.js +15 -38
- package/lib/esm/text-input/TextInput.js.map +1 -1
- package/lib/esm/text-input/stories/text-input-sizes.story.js +1 -1
- package/lib/esm/text-input/stories/text-input-sizes.story.js.map +1 -1
- package/lib/esm/time-picker/TimePicker.js +13 -7
- package/lib/esm/time-picker/TimePicker.js.map +1 -1
- package/lib/esm/timezone-picker/TimeZonePicker.js +13 -7
- package/lib/esm/timezone-picker/TimeZonePicker.js.map +1 -1
- package/lib/esm/toast/ToastControlled.js +1 -1
- package/lib/esm/toast/ToastControlled.js.map +1 -1
- package/lib/types/_common/form-control/FormFieldLabel.d.ts +58 -0
- package/lib/types/_common/form-control/FormFieldLabel.d.ts.map +1 -0
- package/lib/types/_common/form-control/FormFieldMessage.d.ts +46 -0
- package/lib/types/_common/form-control/FormFieldMessage.d.ts.map +1 -0
- package/lib/types/_common/form-control/form-control-types.d.ts +92 -0
- package/lib/types/_common/form-control/form-control-types.d.ts.map +1 -0
- package/lib/types/_common/form-control/index.d.ts +33 -0
- package/lib/types/_common/form-control/index.d.ts.map +1 -0
- package/lib/types/_common/form-control/use-form-field.d.ts +53 -0
- package/lib/types/_common/form-control/use-form-field.d.ts.map +1 -0
- package/lib/types/_common/form-control/use-inline-field-label.d.ts +69 -0
- package/lib/types/_common/form-control/use-inline-field-label.d.ts.map +1 -0
- package/lib/types/checkbox/Checkbox.d.ts.map +1 -1
- package/lib/types/combobox/Combobox.d.ts.map +1 -1
- package/lib/types/combobox/combobox-types.d.ts +1 -1
- package/lib/types/combobox/combobox-types.d.ts.map +1 -1
- package/lib/types/helpers/index.d.ts +1 -0
- package/lib/types/helpers/index.d.ts.map +1 -1
- package/lib/types/helpers/platform.d.ts +29 -0
- package/lib/types/helpers/platform.d.ts.map +1 -0
- package/lib/types/kbd/kbd-utils.d.ts +2 -5
- package/lib/types/kbd/kbd-utils.d.ts.map +1 -1
- package/lib/types/next/tree-view/TreeView.d.ts +29 -5
- package/lib/types/next/tree-view/TreeView.d.ts.map +1 -1
- package/lib/types/next/tree-view/selection.d.ts +78 -0
- package/lib/types/next/tree-view/selection.d.ts.map +1 -0
- package/lib/types/next/tree-view/stories/index.d.ts +6 -0
- package/lib/types/next/tree-view/stories/index.d.ts.map +1 -1
- package/lib/types/next/tree-view/stories/tree-view-large.story.d.ts +24 -0
- package/lib/types/next/tree-view/stories/tree-view-large.story.d.ts.map +1 -0
- package/lib/types/next/tree-view/stories/tree-view-lazy.story.d.ts.map +1 -1
- package/lib/types/next/tree-view/stories/tree-view-multi.story.d.ts +10 -0
- package/lib/types/next/tree-view/stories/tree-view-multi.story.d.ts.map +1 -1
- package/lib/types/next/tree-view/stories/tree-view-multiple-replace.story.d.ts +29 -0
- package/lib/types/next/tree-view/stories/tree-view-multiple-replace.story.d.ts.map +1 -0
- package/lib/types/next/tree-view/stories/tree-view-non-selectable-folders.story.d.ts +5 -0
- package/lib/types/next/tree-view/stories/tree-view-non-selectable-folders.story.d.ts.map +1 -1
- package/lib/types/next/tree-view/stories/tree-view-root-selection.story.d.ts +24 -0
- package/lib/types/next/tree-view/stories/tree-view-root-selection.story.d.ts.map +1 -0
- package/lib/types/radio/Radio.d.ts.map +1 -1
- package/lib/types/select/Select.d.ts.map +1 -1
- package/lib/types/select/types.d.ts.map +1 -1
- package/lib/types/switch/Switch.d.ts.map +1 -1
- package/lib/types/text-area/TextArea.d.ts.map +1 -1
- package/lib/types/text-input/TextInput.d.ts.map +1 -1
- package/lib/types/text-input/stories/text-input-sizes.story.d.ts.map +1 -1
- package/lib/types/time-picker/TimePicker.d.ts +3 -1
- package/lib/types/time-picker/TimePicker.d.ts.map +1 -1
- package/lib/types/timezone-picker/TimeZonePicker.d.ts +4 -1
- package/lib/types/timezone-picker/TimeZonePicker.d.ts.map +1 -1
- package/package.json +2 -2
- package/skills/ndl-react/SKILL.md +1 -1
- package/skills/ndl-react/components/color-picker.md +32 -32
- package/skills/ndl-react/components/combobox.md +2 -2
- package/skills/ndl-react/components/dropzone.md +5 -5
- package/skills/ndl-react/components/next/tree-view.md +444 -104
- package/skills/ndl-react/components/text-input.md +6 -0
- package/skills/ndl-react/components/time-picker.md +1 -0
- package/skills/ndl-react/components/timezone-picker.md +1 -0
|
@@ -0,0 +1,46 @@
|
|
|
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 type React from 'react';
|
|
22
|
+
import { type FormFieldSize, type FormFieldState } from './form-control-types';
|
|
23
|
+
type FormFieldMessageProps = {
|
|
24
|
+
field: FormFieldState;
|
|
25
|
+
size: FormFieldSize;
|
|
26
|
+
/** Extra class names for the message container */
|
|
27
|
+
className?: string;
|
|
28
|
+
/** Wraps the message content, so a component can put it inside a Skeleton. */
|
|
29
|
+
wrap?: (content: React.ReactNode) => React.ReactNode;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The message below a form field: the help text, or the error that replaces
|
|
33
|
+
* it. The container is rendered whether or not there is a message, so the
|
|
34
|
+
* `aria-live` region exists in the document before any text arrives and a
|
|
35
|
+
* validation error is reliably announced. The stylesheet collapses it while
|
|
36
|
+
* it is empty.
|
|
37
|
+
*
|
|
38
|
+
* The region is polite rather than an assertive `role="alert"`, since
|
|
39
|
+
* validation that runs on blur or on change would otherwise interrupt
|
|
40
|
+
* whatever is being read. `aria-atomic` makes the whole message announce as
|
|
41
|
+
* one, matching `role="status"` without presenting plain help text as a
|
|
42
|
+
* status message.
|
|
43
|
+
*/
|
|
44
|
+
export declare const FormFieldMessage: ({ field, size, className, wrap, }: FormFieldMessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=FormFieldMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormFieldMessage.d.ts","sourceRoot":"","sources":["../../../../src/_common/form-control/FormFieldMessage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAsB9B,KAAK,qBAAqB,GAAG;IAC3B,KAAK,EAAE,cAAc,CAAC;IACtB,IAAI,EAAE,aAAa,CAAC;IACpB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS,CAAC;CACtD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,GAAI,mCAK9B,qBAAqB,4CAgDvB,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
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 type React from 'react';
|
|
22
|
+
/** Sizes shared by the form field parts, matching the input sizes. */
|
|
23
|
+
type FormFieldSize = 'small' | 'medium' | 'large';
|
|
24
|
+
/**
|
|
25
|
+
* Severity of the message shown below a form control. An error replaces the
|
|
26
|
+
* help text whenever both are provided.
|
|
27
|
+
*
|
|
28
|
+
* Deliberately a union rather than an error boolean: future severities such
|
|
29
|
+
* as `info` and `warning`, or new ways of presenting a message, only extend
|
|
30
|
+
* this union and the severity presentation map in `FormFieldMessage`.
|
|
31
|
+
*/
|
|
32
|
+
type FormFieldMessageSeverity = 'help' | 'error';
|
|
33
|
+
/**
|
|
34
|
+
* The field-related props a form input component maps onto the internal form
|
|
35
|
+
* field. Components pick from these internally so wording, types and behavior
|
|
36
|
+
* stay aligned, while their external prop names stay untouched (for example
|
|
37
|
+
* both TextInput's `showRequiredOrOptionalLabel` and TextArea's `isOptional`
|
|
38
|
+
* map onto `hasRequiredIndicator` here).
|
|
39
|
+
*/
|
|
40
|
+
type FormFieldProps = {
|
|
41
|
+
/** The label displayed above the control */
|
|
42
|
+
label?: React.ReactNode;
|
|
43
|
+
/** Assistive text displayed below the control */
|
|
44
|
+
helpText?: React.ReactNode;
|
|
45
|
+
/** Error message displayed below the control. When provided, it overrides `helpText` and shows an error icon */
|
|
46
|
+
errorText?: React.ReactNode;
|
|
47
|
+
/** Whether the control is required */
|
|
48
|
+
isRequired?: boolean;
|
|
49
|
+
/** Whether Required or Optional is shown at the end of the label row */
|
|
50
|
+
hasRequiredIndicator?: boolean;
|
|
51
|
+
/** Whether the label is clipped out of the layout, leaving it to screen readers only */
|
|
52
|
+
hasVisuallyHiddenLabel?: boolean;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* The resolved state of a form field: the ids that tie the label and the
|
|
56
|
+
* message to the control, and which message is currently displayed. Built by
|
|
57
|
+
* `useFormField` and consumed by `FormFieldLabel` and `FormFieldMessage`, so
|
|
58
|
+
* a component never wires ids or picks between help and error itself.
|
|
59
|
+
*/
|
|
60
|
+
type FormFieldState = {
|
|
61
|
+
label?: React.ReactNode;
|
|
62
|
+
/** Id of the label element, for `aria-labelledby` on ARIA widgets. */
|
|
63
|
+
labelId: string;
|
|
64
|
+
/** Id of the control, which an explicit label points at with `htmlFor`. */
|
|
65
|
+
controlId: string;
|
|
66
|
+
/** Id the help text renders with, referenced while it is displayed. */
|
|
67
|
+
helpTextId: string;
|
|
68
|
+
/** Id the error text renders with, referenced while it is displayed. */
|
|
69
|
+
errorTextId: string;
|
|
70
|
+
helpText?: React.ReactNode;
|
|
71
|
+
errorText?: React.ReactNode;
|
|
72
|
+
/** The displayed message. The error text while there is one, else the help text. */
|
|
73
|
+
message?: React.ReactNode;
|
|
74
|
+
/** Id of the displayed message; `undefined` while there is no message. */
|
|
75
|
+
messageId?: string;
|
|
76
|
+
/** Severity of the displayed message; `undefined` while there is no message. */
|
|
77
|
+
messageSeverity?: FormFieldMessageSeverity;
|
|
78
|
+
hasError: boolean;
|
|
79
|
+
isRequired: boolean;
|
|
80
|
+
hasRequiredIndicator: boolean;
|
|
81
|
+
hasVisuallyHiddenLabel: boolean;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* ARIA attributes for the control the field describes. Spread onto the input
|
|
85
|
+
* or the ARIA widget acting as one.
|
|
86
|
+
*/
|
|
87
|
+
type FormFieldControlProps = {
|
|
88
|
+
'aria-describedby': string | undefined;
|
|
89
|
+
'aria-invalid': true | undefined;
|
|
90
|
+
};
|
|
91
|
+
export type { FormFieldControlProps, FormFieldMessageSeverity, FormFieldProps, FormFieldSize, FormFieldState, };
|
|
92
|
+
//# sourceMappingURL=form-control-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-control-types.d.ts","sourceRoot":"","sources":["../../../../src/_common/form-control/form-control-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,sEAAsE;AACtE,KAAK,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElD;;;;;;;GAOG;AACH,KAAK,wBAAwB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEjD;;;;;;GAMG;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wBAAwB,EACxB,cAAc,EACd,aAAa,EACb,cAAc,GACf,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
* The internal form control layer (DES-1772): one implementation of the
|
|
23
|
+
* label, the required indicator, the help text and the error message shared
|
|
24
|
+
* by the form input components, plus the ARIA wiring that ties them to the
|
|
25
|
+
* control. Internal only - not exported from the package index - so a future
|
|
26
|
+
* public field API can be built on top without being constrained by it.
|
|
27
|
+
*/
|
|
28
|
+
export { FormFieldLabel } from './FormFieldLabel';
|
|
29
|
+
export { FormFieldMessage } from './FormFieldMessage';
|
|
30
|
+
export type { FormFieldControlProps, FormFieldMessageSeverity, FormFieldProps, FormFieldSize, FormFieldState, } from './form-control-types';
|
|
31
|
+
export { useFormField } from './use-form-field';
|
|
32
|
+
export { useInlineFieldLabel } from './use-inline-field-label';
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/_common/form-control/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,qBAAqB,EACrB,wBAAwB,EACxB,cAAc,EACd,aAAa,EACb,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
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 { type FormFieldControlProps, type FormFieldProps, type FormFieldState } from './form-control-types';
|
|
22
|
+
type UseFormFieldOptions = FormFieldProps & {
|
|
23
|
+
/**
|
|
24
|
+
* Base for the generated ids, so a component that mints sibling ids of its
|
|
25
|
+
* own (like the Combobox listbox and panel ids) can share one base.
|
|
26
|
+
* Defaults to a generated id.
|
|
27
|
+
*/
|
|
28
|
+
baseId?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Overrides the generated control id, for controls that already name their
|
|
31
|
+
* id (the Combobox trigger is `${baseId}-trigger`).
|
|
32
|
+
*/
|
|
33
|
+
controlId?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Ids referenced by `aria-describedby` before the message id, skipping
|
|
36
|
+
* falsy entries (such as the TextInput clear/loading hint).
|
|
37
|
+
*/
|
|
38
|
+
extraDescribedByIds?: (string | false | undefined)[];
|
|
39
|
+
};
|
|
40
|
+
type UseFormFieldResult = {
|
|
41
|
+
field: FormFieldState;
|
|
42
|
+
/** ARIA attributes to spread onto the control the field describes. */
|
|
43
|
+
controlProps: FormFieldControlProps;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Resolves the shared form field state: id generation, which of help and
|
|
47
|
+
* error is displayed - an error always replaces the help text - and the ARIA
|
|
48
|
+
* wiring of the control. The parts are rendered by `FormFieldLabel` and
|
|
49
|
+
* `FormFieldMessage`.
|
|
50
|
+
*/
|
|
51
|
+
export declare const useFormField: ({ baseId, controlId, label, helpText, errorText, isRequired, hasRequiredIndicator, hasVisuallyHiddenLabel, extraDescribedByIds, }: UseFormFieldOptions) => UseFormFieldResult;
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=use-form-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-form-field.d.ts","sourceRoot":"","sources":["../../../../src/_common/form-control/use-form-field.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,EACL,KAAK,qBAAqB,EAE1B,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAE9B,KAAK,mBAAmB,GAAG,cAAc,GAAG;IAC1C;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,CAAC,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC,EAAE,CAAC;CACtD,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,cAAc,CAAC;IACtB,sEAAsE;IACtE,YAAY,EAAE,qBAAqB,CAAC;CACrC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,mIAU1B,mBAAmB,KAAG,kBAiDxB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
type UseInlineFieldLabelOptions = {
|
|
22
|
+
/** Component name used in the missing-label console warning. */
|
|
23
|
+
componentName: string;
|
|
24
|
+
/** The label rendered next to the control, inside its wrapping `<label>`. */
|
|
25
|
+
label: React.ReactNode;
|
|
26
|
+
/** The aria label naming the control when the label is not a string. */
|
|
27
|
+
ariaLabel: string | undefined;
|
|
28
|
+
/** Dims the label and the control it belongs to. */
|
|
29
|
+
isDisabled?: boolean;
|
|
30
|
+
/** Lets the field take the full available width of its container. */
|
|
31
|
+
isFluid?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Truncates an overflowing string label to one line with an ellipsis (the
|
|
34
|
+
* `title` set on the span keeps the full text reachable). Radio behavior
|
|
35
|
+
* today; a candidate to unify across all selection controls in v5.
|
|
36
|
+
*/
|
|
37
|
+
isTruncated?: boolean;
|
|
38
|
+
};
|
|
39
|
+
type UseInlineFieldLabelResult = {
|
|
40
|
+
/** The label, rendered next to the control. */
|
|
41
|
+
labelContent: React.ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* Classes for the `<label>` that wraps the control and the label, which the
|
|
44
|
+
* adopting component renders. Owned here so that the shared classes stay an
|
|
45
|
+
* implementation detail of this module.
|
|
46
|
+
*/
|
|
47
|
+
fieldClassName: string;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* The inline label of a selection control (Checkbox, Radio, Switch): the
|
|
51
|
+
* control and its label text sit side by side inside one wrapping `<label>`.
|
|
52
|
+
* A string label is wrapped in a titled span so a truncated label stays
|
|
53
|
+
* readable through its tooltip; a custom node is rendered as given, which is
|
|
54
|
+
* also why it needs `ariaLabel` to name the control. Warns when neither a
|
|
55
|
+
* label nor an aria label is provided.
|
|
56
|
+
*
|
|
57
|
+
* Returns the classes of the wrapping label along with its content, so that
|
|
58
|
+
* an adopting component never names a shared class itself. Typography and
|
|
59
|
+
* color sit on that wrapper rather than on the span here, so that a custom
|
|
60
|
+
* node inherits them too.
|
|
61
|
+
*
|
|
62
|
+
* TODO v5: wrap a custom node as well, once the DOM of a custom label can
|
|
63
|
+
* change. This would own all label styling, and the difference between the
|
|
64
|
+
* full-strength inline label and the weaker label above a control could then
|
|
65
|
+
* become a prop here instead of living in two stylesheet classes.
|
|
66
|
+
*/
|
|
67
|
+
export declare const useInlineFieldLabel: ({ componentName, label, ariaLabel, isDisabled, isFluid, isTruncated, }: UseInlineFieldLabelOptions) => UseInlineFieldLabelResult;
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=use-inline-field-label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-inline-field-label.d.ts","sourceRoot":"","sources":["../../../../src/_common/form-control/use-inline-field-label.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAOH,KAAK,0BAA0B,GAAG;IAChC,gEAAgE;IAChE,aAAa,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IAIvB,wEAAwE;IACxE,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,oDAAoD;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qEAAqE;IACrE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,+CAA+C;IAC/C,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,mBAAmB,GAAI,wEAOjC,0BAA0B,KAAG,yBAsC/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAOH,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGzE,KAAK,aAAa,GAAG;IACnB,sCAAsC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uDAAuD;IACvD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,4CAA4C;IAC5C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uCAAuC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yFAAyF;IACzF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gCAAgC;IAChC,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;IACzC,gEAAgE;IAChE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,sEAAsE;IACtE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAChE,mEAAmE;IACnE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAC/D,GAAG,CACA;IACE,6EAA6E;IAC7E,SAAS,EAAE,MAAM,CAAC;IAMlB,kGAAkG;IAClG,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,GACD;IACE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB,CACJ,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,yLAiBtB,WAAW,CAAC,OAAO,EAAE,aAAa,CAAC,4CAiDrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../src/combobox/Combobox.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../src/combobox/Combobox.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAiBH,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAkBpD,OAAO,EAOL,KAAK,cAAc,EAKnB,KAAK,aAAa,EAGnB,MAAM,kBAAkB,CAAC;AA4F1B,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,cAAc,GAAG,cAAc,EAAE,mlBAgDvE,WAAW,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,4CAszB5C,CAAC"}
|
|
@@ -91,7 +91,7 @@ type ComboboxBaseProps<TOption extends ComboboxOption = ComboboxOption> = {
|
|
|
91
91
|
* provided, enables native form validation.
|
|
92
92
|
*/
|
|
93
93
|
isRequired?: boolean;
|
|
94
|
-
/** Whether Required or Optional is shown at the end of the label row
|
|
94
|
+
/** Whether Required or Optional is shown at the end of the label row, based on the `isRequired` prop */
|
|
95
95
|
hasRequiredIndicator?: boolean;
|
|
96
96
|
/** The options to display in the combobox. Either an array of options or an array of option groups. */
|
|
97
97
|
options: TOption[] | ComboboxOptionGroup<TOption>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-types.d.ts","sourceRoot":"","sources":["../../../src/combobox/combobox-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oFAAoF;IACpF,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,KAAK,mBAAmB,CAAC,OAAO,SAAS,cAAc,GAAG,cAAc,IAAI;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,EAAE,CAAC;CACpB,CAAC;AAEF,KAAK,oBAAoB,CAAC,OAAO,SAAS,cAAc,GAAG,cAAc,IACrE,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,GACnD,KAAK,CAAC;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c,EACd,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,0BAA0B,EAC1B,cAAc,EACd,mBAAmB,EACnB,YAAY,GACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 type OperatingSystem = 'mac' | 'windows' | 'linux';
|
|
22
|
+
/** Detects the operating system the keyboard is attached to. */
|
|
23
|
+
export declare function detectOS(): OperatingSystem;
|
|
24
|
+
/**
|
|
25
|
+
* Apple platforms take `Cmd` where the rest take `Ctrl`, since `Ctrl` + click
|
|
26
|
+
* is the macOS context menu gesture.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isApplePlatform(): boolean;
|
|
29
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../src/helpers/platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,CAAC;AAsB1D,gEAAgE;AAChE,wBAAgB,QAAQ,IAAI,eAAe,CAS1C;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAEzC"}
|
|
@@ -19,12 +19,9 @@
|
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
21
|
import type { ReactNode } from 'react';
|
|
22
|
-
|
|
22
|
+
import { detectOS, type OperatingSystem } from '../helpers/platform';
|
|
23
|
+
export { detectOS, type OperatingSystem };
|
|
23
24
|
export type KbdKey = 'meta' | 'shift' | 'ctrl' | 'enter' | 'delete' | 'escape' | 'tab' | 'capslock' | 'up' | 'right' | 'down' | 'left' | 'pageup' | 'pagedown' | 'home' | 'end' | 'space' | 'fn' | 'alt';
|
|
24
|
-
/**
|
|
25
|
-
* Detects the operating system based on the user agent
|
|
26
|
-
*/
|
|
27
|
-
export declare function detectOS(): OperatingSystem;
|
|
28
25
|
/**
|
|
29
26
|
* Returns OS-aware keyboard key symbols
|
|
30
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kbd-utils.d.ts","sourceRoot":"","sources":["../../../src/kbd/kbd-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,
|
|
1
|
+
{"version":3,"file":"kbd-utils.d.ts","sourceRoot":"","sources":["../../../src/kbd/kbd-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAErE,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,CAAC;AAE1C,MAAM,MAAM,MAAM,GACd,MAAM,GACN,OAAO,GACP,MAAM,GACN,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,UAAU,GACV,IAAI,GACJ,OAAO,GACP,MAAM,GACN,MAAM,GACN,QAAQ,GACR,UAAU,GACV,MAAM,GACN,KAAK,GACL,OAAO,GACP,IAAI,GACJ,KAAK,CAAC;AAEV;;GAEG;AACH,wBAAgB,aAAa,CAC3B,EAAE,GAAE,eAA4B,GAC/B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAwBxB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,EAAE,GAAE,eAA4B,GAC/B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAsBxB;AAkBD,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GAAG,SAAS,EACjD,YAAY,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAC3C,EAAE,GAAE,eAA4B,GAC/B,MAAM,CAcR"}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import { type CommonProps, type TooltipObjectProps } from '../../_common/types';
|
|
22
22
|
import { Menu } from '../../menu';
|
|
23
|
-
type SelectionMode
|
|
23
|
+
import { type SelectionMode } from './selection';
|
|
24
24
|
type RootProps = {
|
|
25
25
|
/** The aria-label for the tree. Required for accessibility, unless using ariaLabelledby. Pass null to omit. */
|
|
26
26
|
ariaLabel: string | null;
|
|
@@ -28,8 +28,14 @@ type RootProps = {
|
|
|
28
28
|
ariaLabelledby?: string;
|
|
29
29
|
/** The children of the tree. Should be TreeView.Item components or TreeView.SkeletonItem components only. */
|
|
30
30
|
children?: React.ReactNode;
|
|
31
|
+
/** Initially selected item ids for an uncontrolled root-managed selection. */
|
|
32
|
+
defaultSelectedIds?: string[];
|
|
33
|
+
/** Selected item ids. Makes the tree manage selection itself, instead of each item managing its own. */
|
|
34
|
+
selectedIds?: string[];
|
|
31
35
|
/** Selection mode for the tree. Defaults to "single". */
|
|
32
36
|
selectionMode?: SelectionMode;
|
|
37
|
+
/** Callback called with the complete next selection whenever the tree manages selection. Fires once per interaction. */
|
|
38
|
+
onSelectedIdsChange?: (selectedIds: string[]) => void;
|
|
33
39
|
};
|
|
34
40
|
type ItemProps = {
|
|
35
41
|
/** Nested TreeView.Item or TreeView.SkeletonItem elements rendered as sub-items in a collapsible group. */
|
|
@@ -40,6 +46,8 @@ type ItemProps = {
|
|
|
40
46
|
defaultExpanded?: boolean;
|
|
41
47
|
/** Whether the item has children. Decides if the item should render a chevron for expansion. Needed for lazy loading. */
|
|
42
48
|
hasChildren?: boolean;
|
|
49
|
+
/** Identifies the item. Required when the tree manages selection via `selectedIds`. */
|
|
50
|
+
id?: string;
|
|
43
51
|
/** Whether the item is disabled */
|
|
44
52
|
isDisabled?: boolean;
|
|
45
53
|
/** Whether the item is expanded. Makes the item controlled. */
|
|
@@ -48,7 +56,9 @@ type ItemProps = {
|
|
|
48
56
|
isIndeterminate?: boolean;
|
|
49
57
|
/** Whether the item is loading. Applies aria-busy="true" to the item. */
|
|
50
58
|
isLoading?: boolean;
|
|
51
|
-
/** Whether the item
|
|
59
|
+
/** Whether the item can be selected. Defaults to true when the tree manages selection, and otherwise to whether `onSelectedChange` is set. */
|
|
60
|
+
isSelectable?: boolean;
|
|
61
|
+
/** Whether the item is selected. Ignored when the tree manages selection via `selectedIds`. */
|
|
52
62
|
isSelected?: boolean;
|
|
53
63
|
/** Leading visual for the item. */
|
|
54
64
|
leadingVisual?: React.ReactNode;
|
|
@@ -64,15 +74,29 @@ type ItemProps = {
|
|
|
64
74
|
tooltipProps?: TooltipObjectProps;
|
|
65
75
|
/** Callback called when the item is expanded/collapsed. */
|
|
66
76
|
onExpandedChange?: (isExpanded: boolean) => void;
|
|
67
|
-
/** Callback called when the item is selected/deselected. */
|
|
77
|
+
/** Callback called when the item is selected/deselected. Receives the new selected state. Ignored when the tree manages selection via `selectedIds`. */
|
|
68
78
|
onSelectedChange?: (isSelected: boolean) => void;
|
|
69
79
|
};
|
|
70
80
|
type SkeletonItemProps = {
|
|
71
81
|
/** The number of rows to render. */
|
|
72
82
|
rows?: number;
|
|
73
83
|
};
|
|
74
|
-
|
|
75
|
-
|
|
84
|
+
/**
|
|
85
|
+
* @remarks
|
|
86
|
+
* Selection can be managed per item, with `isSelected` and `onSelectedChange`
|
|
87
|
+
* on each `TreeView.Item`, or by the tree itself, by passing `selectedIds` (or
|
|
88
|
+
* `defaultSelectedIds`) together with `onSelectedIdsChange`. When the tree
|
|
89
|
+
* manages selection, every item needs an `id`, and each item's own
|
|
90
|
+
* `isSelected` and `onSelectedChange` are ignored.
|
|
91
|
+
*
|
|
92
|
+
* The available selection modes are:
|
|
93
|
+
*
|
|
94
|
+
* - `single` — one item at a time. An unmodified click selects the clicked item and never clears it.
|
|
95
|
+
* - `multiple` — multi-select with checkboxes. An unmodified click toggles an item, and `Shift` repeats that across a range without clearing anything outside it.
|
|
96
|
+
* - `multiple-replace` — multi-select without checkboxes. An unmodified click selects only that item, `Cmd`/`Ctrl` toggles it and moves the anchor, and `Shift` extends from that anchor while retaining its selection snapshot. `Shift` + arrow extends the range.
|
|
97
|
+
*/
|
|
98
|
+
declare const TreeView: (({ children, defaultSelectedIds, selectedIds: selectedIdsProp, selectionMode, ariaLabel, ariaLabelledby, className, style, htmlAttributes, onSelectedIdsChange, ref, ...restProps }: CommonProps<"div", RootProps>) => import("react/jsx-runtime").JSX.Element) & {
|
|
99
|
+
Item: ({ actionMenuItems, children, defaultExpanded, hasChildren: hasChildrenProp, id: idProp, isDisabled, isExpanded: isExpandedProp, isIndeterminate, isLoading, isSelectable: isSelectableProp, isSelected: isSelectedProp, leadingVisual, title, tooltipContent, tooltipProps, trailingContent, onExpandedChange, onSelectedChange, actionMenuProps, className, style, htmlAttributes, ref, ...restProps }: CommonProps<"div", ItemProps>) => import("react/jsx-runtime").JSX.Element;
|
|
76
100
|
SkeletonItem: ({ rows, className, style, htmlAttributes, ref, ...restProps }: CommonProps<"div", SkeletonItemProps>) => import("react/jsx-runtime").JSX.Element;
|
|
77
101
|
};
|
|
78
102
|
export { TreeView };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeView.d.ts","sourceRoot":"","sources":["../../../../src/next/tree-view/TreeView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"TreeView.d.ts","sourceRoot":"","sources":["../../../../src/next/tree-view/TreeView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAoBH,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAShF,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGlC,OAAO,EAQL,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AA8KrB,KAAK,SAAS,GAAG;IACf,+GAA+G;IAC/G,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,8GAA8G;IAC9G,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6GAA6G;IAC7G,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,8EAA8E;IAC9E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,CAAC,EAAE,kBAAkB,CAAC;IAClC,2DAA2D;IAC3D,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,wJAAwJ;IACxJ,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAClD,CAAC;AAyZF,KAAK,iBAAiB,GAAG;IACvB,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AA0CF;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,QAAQ,wLAl8BX,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC;oZA+hB7B,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC;kFAmY7B,WAAW,CAAC,KAAK,EAAE,iBAAiB,CAAC;CAgCoB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
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 type SelectionMode = 'single' | 'multiple' | 'multiple-replace';
|
|
22
|
+
export type SelectionEdge = 'top' | 'middle' | 'bottom';
|
|
23
|
+
/** Modifier keys resolved from a pointer or keyboard event. */
|
|
24
|
+
export type SelectionIntent = {
|
|
25
|
+
/** Shift: extend from the anchor to the target. */
|
|
26
|
+
isRange: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Cmd on Apple platforms, Ctrl elsewhere. Ignored in `multiple`, where an
|
|
29
|
+
* unmodified click already toggles.
|
|
30
|
+
*/
|
|
31
|
+
isToggle: boolean;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Where a range is measured from.
|
|
35
|
+
*
|
|
36
|
+
* `baseSelectedIds` is the selection as it stood immediately after the anchor
|
|
37
|
+
* was placed. A `multiple-replace` range unions its visible members with the
|
|
38
|
+
* range so it can be grown and shrunk without losing earlier picks.
|
|
39
|
+
* `isSelected` is the state the anchor row was placed into, which a `multiple`
|
|
40
|
+
* range paints across its members.
|
|
41
|
+
*/
|
|
42
|
+
export type SelectionAnchor = {
|
|
43
|
+
baseSelectedIds: ReadonlySet<string>;
|
|
44
|
+
id: string;
|
|
45
|
+
isSelected: boolean;
|
|
46
|
+
} | null;
|
|
47
|
+
type ComputeNextSelectionInput = {
|
|
48
|
+
anchor: SelectionAnchor;
|
|
49
|
+
intent: SelectionIntent;
|
|
50
|
+
/** Ids of every selectable, non-disabled item, visible or not. */
|
|
51
|
+
selectableIds: ReadonlySet<string>;
|
|
52
|
+
/** Currently selected ids, including items inside collapsed groups. */
|
|
53
|
+
selectedIds: ReadonlySet<string>;
|
|
54
|
+
selectionMode: SelectionMode;
|
|
55
|
+
targetId: string;
|
|
56
|
+
/** Ids of the items the user can currently see, in visual order. */
|
|
57
|
+
visibleIds: readonly string[];
|
|
58
|
+
/** Maps an item id to the id of the item that owns its group. */
|
|
59
|
+
parentIdById: ReadonlyMap<string, string>;
|
|
60
|
+
};
|
|
61
|
+
type ComputeNextSelectionResult = {
|
|
62
|
+
anchor: SelectionAnchor;
|
|
63
|
+
selectedIds: Set<string>;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Resolves a selection gesture into the complete next selection. Pure: the
|
|
67
|
+
* caller supplies the current state and applies the result.
|
|
68
|
+
*/
|
|
69
|
+
export declare function computeNextSelection({ anchor, intent, parentIdById, selectableIds, selectedIds, selectionMode, targetId, visibleIds, }: ComputeNextSelectionInput): ComputeNextSelectionResult;
|
|
70
|
+
/**
|
|
71
|
+
* Marks each selected item's position within its run of adjacent selected
|
|
72
|
+
* items, so a run can be styled as one block.
|
|
73
|
+
*/
|
|
74
|
+
export declare function computeSelectionEdges(visibleIds: readonly string[], selectedIds: ReadonlySet<string>): Map<string, SelectionEdge>;
|
|
75
|
+
export declare function countChangedIds(previous: ReadonlySet<string>, next: ReadonlySet<string>): number;
|
|
76
|
+
export declare function formatSelectionAnnouncement(selectedCount: number): string;
|
|
77
|
+
export {};
|
|
78
|
+
//# sourceMappingURL=selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../../../src/next/tree-view/selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,UAAU,GAAG,kBAAkB,CAAC;AAEvE,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAExD,+DAA+D;AAC/D,MAAM,MAAM,eAAe,GAAG;IAC5B,mDAAmD;IACnD,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,OAAO,CAAC;CACrB,GAAG,IAAI,CAAC;AAET,KAAK,yBAAyB,GAAG;IAC/B,MAAM,EAAE,eAAe,CAA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