@reltio/design 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/charts/SetOverlapChart/SetOverlapChart.d.ts +33 -0
  2. package/charts/SetOverlapChart/SetOverlapChart.js +79 -0
  3. package/charts/SetOverlapChart/SetOverlapChart.module.css.d.ts +2 -0
  4. package/charts/SetOverlapChart/SetOverlapChart.module.css.js +36 -0
  5. package/charts/SetOverlapChart/SetOverlapChart.module.css.json +1 -0
  6. package/charts/SetOverlapChart/SetOverlapChart.types.d.ts +117 -0
  7. package/charts/SetOverlapChart/SetOverlapChart.types.js +1 -0
  8. package/charts/SetOverlapChart/components/IntersectionsChart/IntersectionsChart.d.ts +2 -0
  9. package/charts/SetOverlapChart/components/IntersectionsChart/IntersectionsChart.js +36 -0
  10. package/charts/SetOverlapChart/components/IntersectionsChart/IntersectionsChart.module.css.d.ts +2 -0
  11. package/charts/SetOverlapChart/components/IntersectionsChart/IntersectionsChart.module.css.js +40 -0
  12. package/charts/SetOverlapChart/components/IntersectionsChart/IntersectionsChart.module.css.json +1 -0
  13. package/charts/SetOverlapChart/components/IntersectionsChart/IntersectionsChart.types.d.ts +15 -0
  14. package/charts/SetOverlapChart/components/IntersectionsChart/IntersectionsChart.types.js +1 -0
  15. package/charts/SetOverlapChart/components/IntersectionsChart/helpers.d.ts +4 -0
  16. package/charts/SetOverlapChart/components/IntersectionsChart/helpers.js +4 -0
  17. package/charts/SetOverlapChart/components/IntersectionsChart/index.d.ts +1 -0
  18. package/charts/SetOverlapChart/components/IntersectionsChart/index.js +1 -0
  19. package/charts/SetOverlapChart/components/IntersectionsChartAxis/IntersectionsChartAxis.d.ts +2 -0
  20. package/charts/SetOverlapChart/components/IntersectionsChartAxis/IntersectionsChartAxis.js +30 -0
  21. package/charts/SetOverlapChart/components/IntersectionsChartAxis/IntersectionsChartAxis.module.css.d.ts +2 -0
  22. package/charts/SetOverlapChart/components/IntersectionsChartAxis/IntersectionsChartAxis.module.css.js +36 -0
  23. package/charts/SetOverlapChart/components/IntersectionsChartAxis/IntersectionsChartAxis.module.css.json +1 -0
  24. package/charts/SetOverlapChart/components/IntersectionsChartAxis/IntersectionsChartAxis.types.d.ts +8 -0
  25. package/charts/SetOverlapChart/components/IntersectionsChartAxis/IntersectionsChartAxis.types.js +1 -0
  26. package/charts/SetOverlapChart/components/IntersectionsChartAxis/helpers.d.ts +1 -0
  27. package/charts/SetOverlapChart/components/IntersectionsChartAxis/helpers.js +3 -0
  28. package/charts/SetOverlapChart/components/IntersectionsChartAxis/index.d.ts +1 -0
  29. package/charts/SetOverlapChart/components/IntersectionsChartAxis/index.js +1 -0
  30. package/charts/SetOverlapChart/components/IntersectionsMatrix/IntersectionsMatrix.d.ts +2 -0
  31. package/charts/SetOverlapChart/components/IntersectionsMatrix/IntersectionsMatrix.js +13 -0
  32. package/charts/SetOverlapChart/components/IntersectionsMatrix/IntersectionsMatrix.module.css.d.ts +2 -0
  33. package/charts/SetOverlapChart/components/IntersectionsMatrix/IntersectionsMatrix.module.css.js +29 -0
  34. package/charts/SetOverlapChart/components/IntersectionsMatrix/IntersectionsMatrix.module.css.json +1 -0
  35. package/charts/SetOverlapChart/components/IntersectionsMatrix/IntersectionsMatrix.types.d.ts +22 -0
  36. package/charts/SetOverlapChart/components/IntersectionsMatrix/IntersectionsMatrix.types.js +1 -0
  37. package/charts/SetOverlapChart/components/IntersectionsMatrix/helpers.d.ts +7 -0
  38. package/charts/SetOverlapChart/components/IntersectionsMatrix/helpers.js +25 -0
  39. package/charts/SetOverlapChart/components/IntersectionsMatrix/index.d.ts +1 -0
  40. package/charts/SetOverlapChart/components/IntersectionsMatrix/index.js +1 -0
  41. package/charts/SetOverlapChart/components/SetsChart/SetsChart.d.ts +2 -0
  42. package/charts/SetOverlapChart/components/SetsChart/SetsChart.js +54 -0
  43. package/charts/SetOverlapChart/components/SetsChart/SetsChart.module.css.d.ts +2 -0
  44. package/charts/SetOverlapChart/components/SetsChart/SetsChart.module.css.js +55 -0
  45. package/charts/SetOverlapChart/components/SetsChart/SetsChart.module.css.json +1 -0
  46. package/charts/SetOverlapChart/components/SetsChart/SetsChart.types.d.ts +16 -0
  47. package/charts/SetOverlapChart/components/SetsChart/SetsChart.types.js +1 -0
  48. package/charts/SetOverlapChart/components/SetsChart/index.d.ts +1 -0
  49. package/charts/SetOverlapChart/components/SetsChart/index.js +1 -0
  50. package/charts/SetOverlapChart/components/SetsChartAxis/SetsChartAxis.d.ts +2 -0
  51. package/charts/SetOverlapChart/components/SetsChartAxis/SetsChartAxis.js +9 -0
  52. package/charts/SetOverlapChart/components/SetsChartAxis/SetsChartAxis.module.css.d.ts +2 -0
  53. package/charts/SetOverlapChart/components/SetsChartAxis/SetsChartAxis.module.css.js +24 -0
  54. package/charts/SetOverlapChart/components/SetsChartAxis/SetsChartAxis.module.css.json +1 -0
  55. package/charts/SetOverlapChart/components/SetsChartAxis/SetsChartAxis.types.d.ts +4 -0
  56. package/charts/SetOverlapChart/components/SetsChartAxis/SetsChartAxis.types.js +1 -0
  57. package/charts/SetOverlapChart/components/SetsChartAxis/index.d.ts +1 -0
  58. package/charts/SetOverlapChart/components/SetsChartAxis/index.js +1 -0
  59. package/charts/SetOverlapChart/constants.d.ts +14 -0
  60. package/charts/SetOverlapChart/constants.js +16 -0
  61. package/charts/SetOverlapChart/helpers.d.ts +15 -0
  62. package/charts/SetOverlapChart/helpers.js +52 -0
  63. package/charts/SetOverlapChart/index.d.ts +2 -0
  64. package/charts/SetOverlapChart/index.js +1 -0
  65. package/charts/SetOverlapChart/useSetOverlapChartSizes.d.ts +19 -0
  66. package/charts/SetOverlapChart/useSetOverlapChartSizes.js +35 -0
  67. package/charts/index.d.ts +1 -0
  68. package/charts/index.js +1 -0
  69. package/components/AppSelector/AppSelector.d.ts +5 -0
  70. package/components/AppSelector/AppSelector.js +20 -0
  71. package/components/AppSelector/AppSelector.module.css.d.ts +2 -0
  72. package/components/AppSelector/AppSelector.module.css.js +61 -0
  73. package/components/AppSelector/AppSelector.module.css.json +1 -0
  74. package/components/AppSelector/AppSelector.types.d.ts +29 -0
  75. package/components/AppSelector/AppSelector.types.js +1 -0
  76. package/components/AppSelector/index.d.ts +2 -0
  77. package/components/AppSelector/index.js +1 -0
  78. package/components/Button/Button.d.ts +3 -0
  79. package/components/Button/Button.js +9 -3
  80. package/components/Button/Button.module.css.js +9 -3
  81. package/components/Button/Button.module.css.json +1 -1
  82. package/components/Divider/Divider.d.ts +2 -0
  83. package/components/Divider/Divider.js +6 -0
  84. package/components/Divider/Divider.module.css.d.ts +2 -0
  85. package/components/Divider/Divider.module.css.js +40 -0
  86. package/components/Divider/Divider.module.css.json +1 -0
  87. package/components/Divider/Divider.types.d.ts +11 -0
  88. package/components/Divider/Divider.types.js +1 -0
  89. package/components/Divider/index.d.ts +2 -0
  90. package/components/Divider/index.js +1 -0
  91. package/components/Popover/Popover.d.ts +36 -0
  92. package/components/Popover/Popover.js +62 -0
  93. package/components/Popover/Popover.module.css.d.ts +2 -0
  94. package/components/Popover/Popover.module.css.js +62 -0
  95. package/components/Popover/Popover.module.css.json +1 -0
  96. package/components/Popover/Popover.types.d.ts +18 -0
  97. package/components/Popover/Popover.types.js +1 -0
  98. package/components/Popover/index.d.ts +2 -0
  99. package/components/Popover/index.js +1 -0
  100. package/components/index.d.ts +1 -0
  101. package/components/index.js +1 -0
  102. package/package.json +1 -1
@@ -0,0 +1,40 @@
1
+ import styleInject from 'style-inject';
2
+ import json from './Divider.module.css.json';
3
+ styleInject(`
4
+ .Divider_root__L29wd {
5
+ width: 100%;
6
+ margin: 0;
7
+ padding: 0;
8
+ }
9
+
10
+ .Divider_plain__L29wd {
11
+ height: 1px;
12
+ background-color: var(--reltio-color-surface-3);
13
+ }
14
+
15
+ .Divider_labeled__L29wd {
16
+ display: flex;
17
+ align-items: center;
18
+ gap: 8px;
19
+ font-size: 14px;
20
+ font-weight: 600;
21
+ color: var(--reltio-color-text-secondary);
22
+ }
23
+
24
+ .Divider_labeled__L29wd::before,
25
+ .Divider_labeled__L29wd::after {
26
+ content: "";
27
+ flex: 1;
28
+ height: 1px;
29
+ background-color: var(--reltio-color-surface-3);
30
+ }
31
+
32
+ .Divider_start__L29wd::before {
33
+ display: none;
34
+ }
35
+
36
+ .Divider_end__L29wd::after {
37
+ display: none;
38
+ }
39
+ `);
40
+ export default json;
@@ -0,0 +1 @@
1
+ { "root": "Divider_root__L29wd", "plain": "Divider_plain__L29wd", "labeled": "Divider_labeled__L29wd", "start": "Divider_start__L29wd", "end": "Divider_end__L29wd" }
@@ -0,0 +1,11 @@
1
+ import type React from "react";
2
+ import type { HtmlProps } from "../../utils/types";
3
+ export type DividerAlign = "start" | "center" | "end";
4
+ export type DividerProps = HtmlProps<"div", {
5
+ /** Position of the label text relative to the line.
6
+ * @default "start"
7
+ */
8
+ align?: DividerAlign;
9
+ /** Optional label text displayed alongside the divider line. */
10
+ children?: React.ReactNode;
11
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./Divider";
2
+ export type * from "./Divider.types";
@@ -0,0 +1 @@
1
+ export * from "./Divider";
@@ -0,0 +1,36 @@
1
+ import type { PopoverProps } from "./Popover.types";
2
+ /**
3
+ * Uncontrolled anchored popover built on the native Popover API and CSS Anchor Positioning.
4
+ *
5
+ * Use the `trigger` prop to provide the element that toggles the popover.
6
+ * Positioning is handled automatically via CSS Anchor Positioning relative
7
+ * to the trigger. Light dismiss (Esc + click outside) is built in.
8
+ *
9
+ * Optional `header` and `footer` props render in fixed areas — only `children`
10
+ * scroll when content overflows.
11
+ *
12
+ * **Auto-close on content click:** clicking any element inside the popover
13
+ * closes it (click bubbles to the root and triggers toggle). This is the
14
+ * expected behavior for menus and action lists. For interactive content
15
+ * (inputs, forms), call `e.stopPropagation()` on the container to prevent
16
+ * auto-close.
17
+ *
18
+ * **Focus management:** add a `data-autofocus` attribute to an element inside
19
+ * the popover to focus it when the popover opens.
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * <Popover trigger={<Button>Actions</Button>}>
24
+ * <button onClick={handleEdit}>Edit</button>
25
+ * <button onClick={handleDelete}>Delete</button>
26
+ * </Popover>
27
+ *
28
+ * // With form content — stopPropagation prevents auto-close
29
+ * <Popover trigger={<Button>Add Note</Button>} header="New Note">
30
+ * <div onClick={e => e.stopPropagation()}>
31
+ * <TextArea label="Note" data-autofocus />
32
+ * </div>
33
+ * </Popover>
34
+ * ```
35
+ */
36
+ export declare const Popover: ({ trigger, positionArea, onToggle, header, footer, children, className, style, ...rest }: PopoverProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,62 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRef } from "react";
3
+ import { classNames } from "../../utils/classNames";
4
+ import styles from "./Popover.module.css";
5
+ /**
6
+ * Uncontrolled anchored popover built on the native Popover API and CSS Anchor Positioning.
7
+ *
8
+ * Use the `trigger` prop to provide the element that toggles the popover.
9
+ * Positioning is handled automatically via CSS Anchor Positioning relative
10
+ * to the trigger. Light dismiss (Esc + click outside) is built in.
11
+ *
12
+ * Optional `header` and `footer` props render in fixed areas — only `children`
13
+ * scroll when content overflows.
14
+ *
15
+ * **Auto-close on content click:** clicking any element inside the popover
16
+ * closes it (click bubbles to the root and triggers toggle). This is the
17
+ * expected behavior for menus and action lists. For interactive content
18
+ * (inputs, forms), call `e.stopPropagation()` on the container to prevent
19
+ * auto-close.
20
+ *
21
+ * **Focus management:** add a `data-autofocus` attribute to an element inside
22
+ * the popover to focus it when the popover opens.
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * <Popover trigger={<Button>Actions</Button>}>
27
+ * <button onClick={handleEdit}>Edit</button>
28
+ * <button onClick={handleDelete}>Delete</button>
29
+ * </Popover>
30
+ *
31
+ * // With form content — stopPropagation prevents auto-close
32
+ * <Popover trigger={<Button>Add Note</Button>} header="New Note">
33
+ * <div onClick={e => e.stopPropagation()}>
34
+ * <TextArea label="Note" data-autofocus />
35
+ * </div>
36
+ * </Popover>
37
+ * ```
38
+ */
39
+ export const Popover = ({ trigger, positionArea = "bottom", onToggle, header, footer, children, className, style, ...rest }) => {
40
+ const contentRef = useRef(null);
41
+ const isOpen = useRef(false);
42
+ const handleToggle = (e) => {
43
+ isOpen.current = e.newState === "open";
44
+ if (isOpen.current) {
45
+ const target = contentRef.current?.querySelector("[data-autofocus]");
46
+ target?.focus();
47
+ }
48
+ onToggle?.(e);
49
+ };
50
+ const handleClick = () => {
51
+ if (isOpen.current) {
52
+ contentRef.current?.hidePopover();
53
+ }
54
+ else {
55
+ contentRef.current?.showPopover();
56
+ }
57
+ };
58
+ return (
59
+ // biome-ignore lint/a11y/useKeyWithClickEvents: trigger child handles its own keyboard interaction
60
+ // biome-ignore lint/a11y/noStaticElementInteractions: wrapper delegates to interactive trigger child
61
+ _jsxs("span", { className: classNames(styles.root), onClick: handleClick, children: [trigger, _jsxs("div", { ref: contentRef, popover: "auto", className: classNames(styles.container, className), style: { ...style, positionArea }, onToggle: handleToggle, ...rest, children: [header && _jsx("div", { className: classNames(styles.header), children: header }), _jsx("div", { className: classNames(styles.body), children: children }), footer && _jsx("div", { className: classNames(styles.footer), children: footer })] })] }));
62
+ };
@@ -0,0 +1,2 @@
1
+ import json from './Popover.module.css.json';
2
+ export default json;
@@ -0,0 +1,62 @@
1
+ import styleInject from 'style-inject';
2
+ import json from './Popover.module.css.json';
3
+ styleInject(`
4
+ .Popover_root__L29wd {
5
+ display: inline-flex;
6
+ width: fit-content;
7
+ anchor-scope: --trigger;
8
+ anchor-name: --trigger;
9
+ }
10
+
11
+ .Popover_container__L29wd {
12
+ position-anchor: --trigger;
13
+ box-sizing: border-box;
14
+ margin: 8px;
15
+ padding: 0;
16
+ border: 1px solid var(--reltio-color-border-2);
17
+ border-radius: 12px;
18
+ background: var(--reltio-color-surface-1);
19
+ color: var(--reltio-color-text);
20
+ box-shadow:
21
+ 0 4px 16px var(--reltio-color-shadow-2),
22
+ 0 1px 4px var(--reltio-color-shadow-1);
23
+ inset: auto;
24
+ max-width: calc(100vw - 16px);
25
+ max-height: calc(100vh - 16px);
26
+ }
27
+
28
+ .Popover_container__L29wd:popover-open {
29
+ display: flex;
30
+ flex-direction: column;
31
+ }
32
+
33
+ .Popover_header__L29wd {
34
+ display: flex;
35
+ align-items: center;
36
+ gap: 8px;
37
+ padding: 4px 12px;
38
+ border-bottom: 1px solid var(--reltio-color-border-1);
39
+ font-weight: 600;
40
+ font-size: 14px;
41
+ flex-shrink: 0;
42
+ min-height: 32px;
43
+ }
44
+
45
+ .Popover_body__L29wd {
46
+ flex: 1 1 auto;
47
+ overflow-y: auto;
48
+ min-height: 0;
49
+ padding: 0;
50
+ }
51
+
52
+ .Popover_footer__L29wd {
53
+ display: flex;
54
+ align-items: center;
55
+ justify-content: flex-end;
56
+ gap: 8px;
57
+ padding: 12px;
58
+ border-top: 1px solid var(--reltio-color-border-1);
59
+ flex-shrink: 0;
60
+ }
61
+ `);
62
+ export default json;
@@ -0,0 +1 @@
1
+ { "root": "Popover_root__L29wd", "container": "Popover_container__L29wd", "header": "Popover_header__L29wd", "body": "Popover_body__L29wd", "footer": "Popover_footer__L29wd" }
@@ -0,0 +1,18 @@
1
+ import type React from "react";
2
+ import type { HtmlProps } from "../../utils/types";
3
+ export type PopoverProps = HtmlProps<"div", {
4
+ /** The element that toggles the popover on click. Clicks on content also bubble to the root and close the popover — use `e.stopPropagation()` to prevent this for interactive content. */
5
+ trigger: React.ReactElement;
6
+ /** CSS `position-area` value controlling placement relative to the trigger.
7
+ * Common values: `"bottom"`, `"top"`, `"left"`, `"right"`, `"bottom span-right"`, `"top span-left"`.
8
+ * See https://developer.mozilla.org/en-US/docs/Web/CSS/position-area for more details.
9
+ * @default "bottom"
10
+ */
11
+ positionArea?: string;
12
+ /** Called when the popover opens or closes. Forwards the native `toggle` event — check `event.newState` for `"open"` or `"closed"`. */
13
+ onToggle?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
14
+ /** Content rendered in a fixed header area at the top, with a bottom border separator */
15
+ header?: React.ReactNode;
16
+ /** Content rendered in a fixed footer area at the bottom, right-aligned by default, with a top border separator */
17
+ footer?: React.ReactNode;
18
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./Popover";
2
+ export type * from "./Popover.types";
@@ -0,0 +1 @@
1
+ export * from "./Popover";
@@ -1,3 +1,4 @@
1
+ export * from "./AppSelector";
1
2
  export * from "./AssistantLoader";
2
3
  export * from "./Button";
3
4
  export * from "./Chat";
@@ -1,3 +1,4 @@
1
+ export * from "./AppSelector";
1
2
  export * from "./AssistantLoader";
2
3
  export * from "./Button";
3
4
  export * from "./Chat";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reltio/design",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Reltio Design Platform",
5
5
  "peerDependencies": {
6
6
  "react": ">=17 <20",