@neo4j-ndl/react 4.18.5 → 4.18.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/lib/LICENSES.txt +30 -4
  2. package/lib/cjs/_generated/style-rules/index.js +7 -1
  3. package/lib/cjs/_generated/style-rules/index.js.map +1 -1
  4. package/lib/cjs/_generated/style-rules/literal-schemas.js +32 -1
  5. package/lib/cjs/_generated/style-rules/literal-schemas.js.map +1 -1
  6. package/lib/cjs/_generated/style-rules/range-utils.js +46 -0
  7. package/lib/cjs/_generated/style-rules/range-utils.js.map +1 -0
  8. package/lib/cjs/data-grid/stories/datagrid-rule-based-styling-datetime.story.js +26 -8
  9. package/lib/cjs/data-grid/stories/datagrid-rule-based-styling-datetime.story.js.map +1 -1
  10. package/lib/cjs/data-grid/style-rules/evaluate.js +60 -55
  11. package/lib/cjs/data-grid/style-rules/evaluate.js.map +1 -1
  12. package/lib/cjs/data-grid/style-rules/index.js +2 -1
  13. package/lib/cjs/data-grid/style-rules/index.js.map +1 -1
  14. package/lib/cjs/data-grid/style-rules/types.js +20 -14
  15. package/lib/cjs/data-grid/style-rules/types.js.map +1 -1
  16. package/lib/cjs/menu/Menu.js +60 -42
  17. package/lib/cjs/menu/Menu.js.map +1 -1
  18. package/lib/cjs/menu/stories/menu-in-dialog.story.js +3 -5
  19. package/lib/cjs/menu/stories/menu-in-dialog.story.js.map +1 -1
  20. package/lib/esm/_generated/style-rules/index.js +2 -1
  21. package/lib/esm/_generated/style-rules/index.js.map +1 -1
  22. package/lib/esm/_generated/style-rules/literal-schemas.js +28 -0
  23. package/lib/esm/_generated/style-rules/literal-schemas.js.map +1 -1
  24. package/lib/esm/_generated/style-rules/range-utils.js +43 -0
  25. package/lib/esm/_generated/style-rules/range-utils.js.map +1 -0
  26. package/lib/esm/data-grid/stories/datagrid-rule-based-styling-datetime.story.js +26 -8
  27. package/lib/esm/data-grid/stories/datagrid-rule-based-styling-datetime.story.js.map +1 -1
  28. package/lib/esm/data-grid/style-rules/evaluate.js +61 -56
  29. package/lib/esm/data-grid/style-rules/evaluate.js.map +1 -1
  30. package/lib/esm/data-grid/style-rules/index.js +1 -1
  31. package/lib/esm/data-grid/style-rules/index.js.map +1 -1
  32. package/lib/esm/data-grid/style-rules/types.js +20 -14
  33. package/lib/esm/data-grid/style-rules/types.js.map +1 -1
  34. package/lib/esm/menu/Menu.js +60 -42
  35. package/lib/esm/menu/Menu.js.map +1 -1
  36. package/lib/esm/menu/stories/menu-in-dialog.story.js +3 -5
  37. package/lib/esm/menu/stories/menu-in-dialog.story.js.map +1 -1
  38. package/lib/types/_generated/style-rules/index.d.ts +3 -2
  39. package/lib/types/_generated/style-rules/index.d.ts.map +1 -1
  40. package/lib/types/_generated/style-rules/literal-schemas.d.ts +20 -0
  41. package/lib/types/_generated/style-rules/literal-schemas.d.ts.map +1 -1
  42. package/lib/types/_generated/style-rules/range-utils.d.ts +26 -0
  43. package/lib/types/_generated/style-rules/range-utils.d.ts.map +1 -0
  44. package/lib/types/data-grid/stories/datagrid-rule-based-styling-datetime.story.d.ts.map +1 -1
  45. package/lib/types/data-grid/style-rules/evaluate.d.ts.map +1 -1
  46. package/lib/types/data-grid/style-rules/index.d.ts +2 -2
  47. package/lib/types/data-grid/style-rules/index.d.ts.map +1 -1
  48. package/lib/types/data-grid/style-rules/types.d.ts +141 -28
  49. package/lib/types/data-grid/style-rules/types.d.ts.map +1 -1
  50. package/lib/types/menu/Menu.d.ts.map +1 -1
  51. package/lib/types/menu/stories/menu-in-dialog.story.d.ts.map +1 -1
  52. package/package.json +3 -3
  53. package/skills/ndl-react/SKILL.md +4 -4
  54. package/skills/ndl-react/components/ai/response.md +5 -5
  55. package/skills/ndl-react/components/color-picker.md +78 -0
  56. package/skills/ndl-react/components/data-grid.md +27 -9
  57. package/skills/ndl-react/components/menu.md +42 -41
  58. package/skills/ndl-react/components/time-picker.md +44 -0
  59. package/skills/ndl-react/components/timezone-picker.md +43 -0
@@ -111,7 +111,7 @@ Implements the keyboard interactions defined in the [WAI-ARIA menu pattern](http
111
111
  | `Space` | Activates the focused menu item |
112
112
  | `Tab` | Closes the menu and moves focus to the next focusable element on the page |
113
113
  | `Shift + Tab` | Closes the menu and moves focus to the previous focusable element on the page |
114
- | `Escape` | Closes the menu and returns focus to the trigger |
114
+ | `Escape` | Closes the full menu tree and returns focus to the trigger. The event does not propagate beyond the root menu, so enclosing overlays remain open |
115
115
  | Type-ahead | Typing a character moves focus to the next item starting with that character |
116
116
 
117
117
  ## WAI-ARIA roles and attributes
@@ -301,50 +301,51 @@ const Component = () => {
301
301
  isOpen={isModalOpen}
302
302
  onClose={handleClose}
303
303
  >
304
- <div className="n-flex n-justify-center">
305
- <FilledButton
306
- onClick={handleMenuClick}
307
- ref={anchorEl}
308
- aria-haspopup="menu"
309
- aria-expanded={isOpen}
310
- >
311
- Open Menu
312
- </FilledButton>
313
- </div>
314
- <Menu
315
- isOpen={isOpen}
316
- anchorRef={anchorEl}
317
- onClose={(event, _data) => {
318
- setIsOpen(false);
319
- event?.preventDefault();
320
- event?.stopPropagation();
321
- }}
322
- portalTarget={document.getElementById('modal-root')}
323
- htmlAttributes={{ id: 'dialog-menu' }}
324
- >
325
- <Menu.Item title="Undo" onClick={() => alert('Undo')} />
326
- <Menu.Item title="Redo" isDisabled />
327
- <Menu.Item title="Cut" description="Copy and remove" />
304
+ <Dialog.Header>Menu in Dialog</Dialog.Header>
305
+ <Dialog.Content>
306
+ <div className="n-flex n-justify-center">
307
+ <FilledButton
308
+ onClick={handleMenuClick}
309
+ ref={anchorEl}
310
+ aria-haspopup="menu"
311
+ aria-expanded={isOpen}
312
+ >
313
+ Open Menu
314
+ </FilledButton>
315
+ </div>
328
316
  <Menu
329
- title="Copy as"
330
- description="Copying as something"
331
- icon={<Square2StackIconOutline />}
317
+ isOpen={isOpen}
318
+ anchorRef={anchorEl}
319
+ onClose={(_event, _data) => {
320
+ setIsOpen(false);
321
+ }}
322
+ portalTarget={document.getElementById('modal-root')}
323
+ htmlAttributes={{ id: 'dialog-menu' }}
332
324
  >
333
- <Menu.Item title="Text" />
334
- <Menu.Item title="Video" />
335
- <Menu title="Image">
336
- <Menu.Item title=".png" />
337
- <Menu.Item title=".jpg" />
338
- <Menu.Item title=".svg" />
339
- <Menu.Item title=".gif" />
340
- </Menu>
341
- <Menu.Item title="Audio" />
342
- <Menu title="Share">
343
- <Menu.Item title="Mail" />
344
- <Menu.Item title="Instagram" />
325
+ <Menu.Item title="Undo" onClick={() => alert('Undo')} />
326
+ <Menu.Item title="Redo" isDisabled />
327
+ <Menu.Item title="Cut" description="Copy and remove" />
328
+ <Menu
329
+ title="Copy as"
330
+ description="Copying as something"
331
+ icon={<Square2StackIconOutline />}
332
+ >
333
+ <Menu.Item title="Text" />
334
+ <Menu.Item title="Video" />
335
+ <Menu title="Image">
336
+ <Menu.Item title=".png" />
337
+ <Menu.Item title=".jpg" />
338
+ <Menu.Item title=".svg" />
339
+ <Menu.Item title=".gif" />
340
+ </Menu>
341
+ <Menu.Item title="Audio" />
342
+ <Menu title="Share">
343
+ <Menu.Item title="Mail" />
344
+ <Menu.Item title="Instagram" />
345
+ </Menu>
345
346
  </Menu>
346
347
  </Menu>
347
- </Menu>
348
+ </Dialog.Content>
348
349
  </Dialog>
349
350
  </>
350
351
  );
@@ -109,6 +109,50 @@ const Component = () => {
109
109
  export default Component;
110
110
  ```
111
111
 
112
+ ### In Popover Dialog
113
+
114
+ ```tsx
115
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
116
+
117
+ import {
118
+ Dialog,
119
+ FilledButton,
120
+ type NeedleTime,
121
+ Popover,
122
+ TimePicker,
123
+ } from '@neo4j-ndl/react';
124
+ import { useState } from 'react';
125
+
126
+ const Component = () => {
127
+ const [selectedTime, setSelectedTime] = useState<NeedleTime>();
128
+
129
+ return (
130
+ <Dialog isOpen={true} aria-label="Dialog">
131
+ <Dialog.Header>
132
+ Using Time Picker inside a popover in a dialog
133
+ </Dialog.Header>
134
+ <Dialog.Description className="n-flex n-flex-col n-gap-token-32">
135
+ <Popover>
136
+ <Popover.Trigger hasButtonWrapper>
137
+ <FilledButton>Open Popover</FilledButton>
138
+ </Popover.Trigger>
139
+ <Popover.Content className="n-p-token-16">
140
+ <TimePicker
141
+ label="Select Time"
142
+ value={selectedTime}
143
+ onChange={(time) => setSelectedTime(time)}
144
+ htmlAttributes={{ id: 'time-picker-input' }}
145
+ />
146
+ </Popover.Content>
147
+ </Popover>
148
+ </Dialog.Description>
149
+ </Dialog>
150
+ );
151
+ };
152
+
153
+ export default Component;
154
+ ```
155
+
112
156
  ### With Seconds
113
157
 
114
158
  ```tsx
@@ -382,6 +382,49 @@ const Component = () => {
382
382
  export default Component;
383
383
  ```
384
384
 
385
+ ### In Popover Dialog
386
+
387
+ ```tsx
388
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
389
+
390
+ import {
391
+ Dialog,
392
+ FilledButton,
393
+ Popover,
394
+ TimeZonePicker,
395
+ } from '@neo4j-ndl/react';
396
+ import { useState } from 'react';
397
+
398
+ const Component = () => {
399
+ const [selectedTimeZone, setSelectedTimeZone] = useState<string>('UTC');
400
+
401
+ return (
402
+ <Dialog isOpen={true} aria-label="Dialog">
403
+ <Dialog.Header>
404
+ Using Timezone Picker inside a popover in a dialog
405
+ </Dialog.Header>
406
+ <Dialog.Description className="n-flex n-flex-col n-gap-token-32">
407
+ <Popover>
408
+ <Popover.Trigger hasButtonWrapper>
409
+ <FilledButton>Open Popover</FilledButton>
410
+ </Popover.Trigger>
411
+ <Popover.Content className="n-p-token-16">
412
+ <TimeZonePicker
413
+ label="Timezone"
414
+ value={selectedTimeZone}
415
+ onChange={setSelectedTimeZone}
416
+ htmlAttributes={{ id: 'time-zone-input' }}
417
+ />
418
+ </Popover.Content>
419
+ </Popover>
420
+ </Dialog.Description>
421
+ </Dialog>
422
+ );
423
+ };
424
+
425
+ export default Component;
426
+ ```
427
+
385
428
  ### Sizes
386
429
 
387
430
  ```tsx