@neo4j-ndl/react 4.18.6 → 4.18.8

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 (54) hide show
  1. package/lib/cjs/_generated/style-rules/index.js +7 -1
  2. package/lib/cjs/_generated/style-rules/index.js.map +1 -1
  3. package/lib/cjs/_generated/style-rules/literal-schemas.js +32 -1
  4. package/lib/cjs/_generated/style-rules/literal-schemas.js.map +1 -1
  5. package/lib/cjs/_generated/style-rules/range-utils.js +46 -0
  6. package/lib/cjs/_generated/style-rules/range-utils.js.map +1 -0
  7. package/lib/cjs/ai/user-bubble/UserBubble.js +39 -2
  8. package/lib/cjs/ai/user-bubble/UserBubble.js.map +1 -1
  9. package/lib/cjs/ai/user-bubble/stories/user-bubble.story.js +1 -5
  10. package/lib/cjs/ai/user-bubble/stories/user-bubble.story.js.map +1 -1
  11. package/lib/cjs/data-grid/stories/datagrid-rule-based-styling-datetime.story.js +26 -8
  12. package/lib/cjs/data-grid/stories/datagrid-rule-based-styling-datetime.story.js.map +1 -1
  13. package/lib/cjs/data-grid/style-rules/evaluate.js +60 -55
  14. package/lib/cjs/data-grid/style-rules/evaluate.js.map +1 -1
  15. package/lib/cjs/data-grid/style-rules/index.js +2 -1
  16. package/lib/cjs/data-grid/style-rules/index.js.map +1 -1
  17. package/lib/cjs/data-grid/style-rules/types.js +20 -14
  18. package/lib/cjs/data-grid/style-rules/types.js.map +1 -1
  19. package/lib/esm/_generated/style-rules/index.js +2 -1
  20. package/lib/esm/_generated/style-rules/index.js.map +1 -1
  21. package/lib/esm/_generated/style-rules/literal-schemas.js +28 -0
  22. package/lib/esm/_generated/style-rules/literal-schemas.js.map +1 -1
  23. package/lib/esm/_generated/style-rules/range-utils.js +43 -0
  24. package/lib/esm/_generated/style-rules/range-utils.js.map +1 -0
  25. package/lib/esm/ai/user-bubble/UserBubble.js +41 -4
  26. package/lib/esm/ai/user-bubble/UserBubble.js.map +1 -1
  27. package/lib/esm/ai/user-bubble/stories/user-bubble.story.js +1 -5
  28. package/lib/esm/ai/user-bubble/stories/user-bubble.story.js.map +1 -1
  29. package/lib/esm/data-grid/stories/datagrid-rule-based-styling-datetime.story.js +26 -8
  30. package/lib/esm/data-grid/stories/datagrid-rule-based-styling-datetime.story.js.map +1 -1
  31. package/lib/esm/data-grid/style-rules/evaluate.js +61 -56
  32. package/lib/esm/data-grid/style-rules/evaluate.js.map +1 -1
  33. package/lib/esm/data-grid/style-rules/index.js +1 -1
  34. package/lib/esm/data-grid/style-rules/index.js.map +1 -1
  35. package/lib/esm/data-grid/style-rules/types.js +20 -14
  36. package/lib/esm/data-grid/style-rules/types.js.map +1 -1
  37. package/lib/types/_generated/style-rules/index.d.ts +3 -2
  38. package/lib/types/_generated/style-rules/index.d.ts.map +1 -1
  39. package/lib/types/_generated/style-rules/literal-schemas.d.ts +20 -0
  40. package/lib/types/_generated/style-rules/literal-schemas.d.ts.map +1 -1
  41. package/lib/types/_generated/style-rules/range-utils.d.ts +26 -0
  42. package/lib/types/_generated/style-rules/range-utils.d.ts.map +1 -0
  43. package/lib/types/ai/user-bubble/UserBubble.d.ts +7 -1
  44. package/lib/types/ai/user-bubble/UserBubble.d.ts.map +1 -1
  45. package/lib/types/ai/user-bubble/stories/user-bubble.story.d.ts.map +1 -1
  46. package/lib/types/data-grid/stories/datagrid-rule-based-styling-datetime.story.d.ts.map +1 -1
  47. package/lib/types/data-grid/style-rules/evaluate.d.ts.map +1 -1
  48. package/lib/types/data-grid/style-rules/index.d.ts +2 -2
  49. package/lib/types/data-grid/style-rules/index.d.ts.map +1 -1
  50. package/lib/types/data-grid/style-rules/types.d.ts +141 -28
  51. package/lib/types/data-grid/style-rules/types.d.ts.map +1 -1
  52. package/package.json +2 -2
  53. package/skills/ndl-react/components/ai/user-bubble.md +1 -0
  54. package/skills/ndl-react/components/data-grid.md +27 -9
@@ -18,7 +18,7 @@ Import: `import { DataGrid } from '@neo4j-ndl/react'`
18
18
  | `ref` | `Ref<HTMLDivElement>` | | | A ref to apply to the root element. |
19
19
  | `rootProps` | `HtmlAttributes<"div">` | | | @deprecated Use htmlAttributes, className and style on the root element instead |
20
20
  | `skeletonProps` | `(SkeletonProps & { as?: ElementType<any, keyof IntrinsicElements>; } & BaseProps<ElementType<any, keyof IntrinsicElements>>)` | | | |
21
- | `styleRules` | `{ apply: { color?: { value: string; isDisabled?: boolean; }; colorRange?: { maxColor: string; maxValue: number \| bigint \| { bigint: string; }; minColor: string; minValue: number \| ... 1 more ... \| { ...; }; onColumn: string; isDisabled?: boolean \| undefined; midColor?: string \| undefined; mid...` | | | Rule-based conditional styling for cells and rows. |
21
+ | `styleRules` | `{ apply: { color?: { value: string; isDisabled?: boolean; }; colorRange?: { maxColor: string; maxValue: number \| bigint \| { bigint: string; } \| { datetime: string; } \| { ...; } \| { ...; }; ... 5 more ...; midValue?: number \| ... 5 more ... \| undefined; } \| undefined; textColor?: { ...; } \| un...` | | | Rule-based conditional styling for cells and rows. |
22
22
  | `styleRuleValueConverters` | `DataGridStyleRuleValueConverters` | | | Per-column converters that teach the style-rule engine how to interpret complex cell values. |
23
23
  | `styling` | `Partial<{ hasZebraStriping: boolean; borderStyle: "all-sides" \| "horizontal" \| "vertical" \| "none"; headerStyle: "filled" \| "clean"; hasHoverEffects: boolean; isCompact: boolean; }>` | | `{}` | |
24
24
  | `tableInstance` | `Table<T>` | ✅ | | Table instance created from `useTable` |
@@ -1959,16 +1959,13 @@ const data: EventRow[] = [
1959
1959
  // 13:15 Paris CEST (+02:00) = 11:15 UTC
1960
1960
  scheduledDate: new Date('2026-07-08T13:15:00+02:00'),
1961
1961
  scheduledTimeMs: 11 * 3_600_000 + 15 * 60_000,
1962
- status: 'cancelled',
1962
+ status: 'confirmed',
1963
1963
  },
1964
- // ── Far future (after 2026-07-15T00:00 Stockholm / CEST = 2026-07-14T22:00Z)
1965
1964
  {
1966
1965
  event: 'Architecture summit',
1967
1966
  localTimeDisplay: '08:00 CEST (+02:00)',
1968
- // 08:00 Amsterdam CEST (+02:00) = 06:00 UTC.
1969
- // Although the calendar date is "July 15", 08:00 CEST is still within the
1970
- // same UTC day as July 14 22:00Z, so it crosses the far-future boundary.
1971
- scheduledDate: new Date('2026-07-15T08:00:00+02:00'),
1967
+ // 08:00 Amsterdam CEST (+02:00) = 06:00 UTC
1968
+ scheduledDate: new Date('2026-07-11T08:00:00+02:00'),
1972
1969
  scheduledTimeMs: 6 * 3_600_000,
1973
1970
  status: 'confirmed',
1974
1971
  },
@@ -1976,17 +1973,18 @@ const data: EventRow[] = [
1976
1973
  event: 'Annual conference',
1977
1974
  localTimeDisplay: '09:00 PDT (-07:00)',
1978
1975
  // 09:00 San Francisco PDT (-07:00) = 16:00 UTC — after Stockholm closes
1979
- scheduledDate: new Date('2026-08-03T09:00:00-07:00'),
1976
+ scheduledDate: new Date('2026-07-13T09:00:00-07:00'),
1980
1977
  scheduledTimeMs: 16 * 3_600_000,
1981
1978
  status: 'confirmed',
1982
1979
  },
1980
+ // ── Far future (after 2026-07-15T00:00 Stockholm / CEST = 2026-07-14T22:00Z)
1983
1981
  {
1984
1982
  event: 'Year-end planning',
1985
1983
  localTimeDisplay: '09:00 JST (+09:00)',
1986
1984
  // 09:00 Tokyo JST (+09:00) = 00:00 UTC — midnight, well before Stockholm opens
1987
1985
  scheduledDate: new Date('2026-11-20T09:00:00+09:00'),
1988
1986
  scheduledTimeMs: 0,
1989
- status: 'confirmed',
1987
+ status: 'cancelled',
1990
1988
  },
1991
1989
  ];
1992
1990
 
@@ -2008,6 +2006,26 @@ const data: EventRow[] = [
2008
2006
  * { time: '17:00:00+02:00' } resolves to 15:00 UTC (54 000 000 ms)
2009
2007
  */
2010
2008
  const styleRules: DataGridStyleRule[] = [
2009
+ // Near-future date cells use temporal literals directly as gradient
2010
+ // boundaries. Several rows are spread across this interval so the progression
2011
+ // from amber to blue is easy to see.
2012
+ {
2013
+ apply: {
2014
+ colorRange: {
2015
+ maxColor: '#dbeafe',
2016
+ maxValue: {
2017
+ datetime: '2026-07-15T00:00:00[Europe/Stockholm]',
2018
+ },
2019
+ minColor: '#fef3c7',
2020
+ minValue: {
2021
+ datetime: '2026-06-26T00:00:00[Europe/Stockholm]',
2022
+ },
2023
+ onColumn: 'scheduledDate',
2024
+ },
2025
+ },
2026
+ column: 'scheduledDate',
2027
+ priority: 0,
2028
+ },
2011
2029
  // Past events — entire row in muted red
2012
2030
  {
2013
2031
  apply: {