@indico-data/design-system 3.13.0 → 3.14.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.
- package/lib/components/floatUI/FloatUI.d.ts +1 -1
- package/lib/components/floatUI/types.d.ts +2 -0
- package/lib/index.d.ts +3 -1
- package/lib/index.esm.js +9 -4
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +9 -4
- package/lib/index.js.map +1 -1
- package/package.json +10 -11
- package/src/components/floatUI/FloatUI.tsx +8 -2
- package/src/components/floatUI/__tests__/FloatUI.test.tsx +1 -1
- package/src/components/floatUI/types.ts +2 -0
- package/src/components/table/components/HorizontalStickyHeader.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indico-data/design-system",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -40,16 +40,13 @@
|
|
|
40
40
|
"@react-types/checkbox": "^3.8.1",
|
|
41
41
|
"@react-types/radio": "^3.8.0",
|
|
42
42
|
"@tanstack/react-table": "^8.21.2",
|
|
43
|
-
"@testing-library/react": "^16.0.0",
|
|
44
43
|
"classnames": "^2.5.1",
|
|
45
44
|
"date-fns": "^3.6.0",
|
|
46
45
|
"focus-trap-react": "^10.2.3",
|
|
47
|
-
"html-webpack-plugin": "^5.6.0",
|
|
48
46
|
"prop-types": "^15.8.1",
|
|
49
47
|
"react-aria-components": "^1.2.1",
|
|
50
48
|
"react-data-table-component": "^7.6.2",
|
|
51
49
|
"react-day-picker": "9.1.3",
|
|
52
|
-
"react-docgen-typescript": "^2.4.0",
|
|
53
50
|
"react-grid-system": "^8.2.0",
|
|
54
51
|
"react-hook-form": "^7.52.1",
|
|
55
52
|
"react-modal": "^3.16.1",
|
|
@@ -57,13 +54,8 @@
|
|
|
57
54
|
"react-stately": "^3.31.0",
|
|
58
55
|
"react-toastify": "^11.0.5",
|
|
59
56
|
"react-tooltip": "5.28.0",
|
|
60
|
-
"svgo": "^3.2.2",
|
|
61
|
-
"ts-jest": "^29.3.1",
|
|
62
57
|
"tslib": "^2.6.2",
|
|
63
58
|
"uuid": "^9.0.1",
|
|
64
|
-
"webpack": "^5.98.0",
|
|
65
|
-
"webpack-cli": "^5.1.4",
|
|
66
|
-
"webpack-dev-server": "^5.2.1",
|
|
67
59
|
"zod": "^3.23.8"
|
|
68
60
|
},
|
|
69
61
|
"devDependencies": {
|
|
@@ -101,7 +93,7 @@
|
|
|
101
93
|
"@storybook/theming": "^8.0.8",
|
|
102
94
|
"@testing-library/dom": "^10.0.0",
|
|
103
95
|
"@testing-library/jest-dom": "^6.4.2",
|
|
104
|
-
"@testing-library/react": "^16.
|
|
96
|
+
"@testing-library/react": "^16.3.0",
|
|
105
97
|
"@testing-library/user-event": "^14.5.2",
|
|
106
98
|
"@types/css-modules": "^1.0.5",
|
|
107
99
|
"@types/identity-obj-proxy": "^3",
|
|
@@ -124,6 +116,7 @@
|
|
|
124
116
|
"eslint": "^8.56.0",
|
|
125
117
|
"eslint-plugin-react": "^7.33.2",
|
|
126
118
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
119
|
+
"html-webpack-plugin": "^5.6.5",
|
|
127
120
|
"identity-obj-proxy": "^3.0.0",
|
|
128
121
|
"jest": "^29.7.0",
|
|
129
122
|
"jest-environment-jsdom": "^29.7.0",
|
|
@@ -134,6 +127,7 @@
|
|
|
134
127
|
"postcss-url": "^10.1.3",
|
|
135
128
|
"prettier": "3.2.5",
|
|
136
129
|
"react": "^18.2.0",
|
|
130
|
+
"react-docgen-typescript": "^2.4.0",
|
|
137
131
|
"react-dom": "^18.2.0",
|
|
138
132
|
"react-grid-system": "^8.2.0",
|
|
139
133
|
"react-router-dom": "^6.22.1",
|
|
@@ -152,11 +146,16 @@
|
|
|
152
146
|
"storybook-css-modules": "^1.0.8",
|
|
153
147
|
"style-loader": "2.0.0",
|
|
154
148
|
"styled-components": "^6.1.8",
|
|
149
|
+
"svgo": "^4.0.0",
|
|
150
|
+
"ts-jest": "^29.4.6",
|
|
155
151
|
"ts-loader": "^9.5.1",
|
|
156
152
|
"ts-node": "^10.9.2",
|
|
157
153
|
"tsconfig-paths-webpack-plugin": "^4.1.0",
|
|
158
154
|
"typescript": "^5.3.3",
|
|
159
|
-
"webpack
|
|
155
|
+
"webpack": "^5.103.0",
|
|
156
|
+
"webpack-bundle-analyzer": "^4.10.2",
|
|
157
|
+
"webpack-cli": "^6.0.1",
|
|
158
|
+
"webpack-dev-server": "^5.2.2"
|
|
160
159
|
},
|
|
161
160
|
"resolutions": {
|
|
162
161
|
"jackspeak": "2.1.1"
|
|
@@ -29,6 +29,7 @@ export function FloatUI({
|
|
|
29
29
|
floatingOptions = defaultOptions,
|
|
30
30
|
className,
|
|
31
31
|
hover = false,
|
|
32
|
+
onOpenChange,
|
|
32
33
|
}: FloatUIProps) {
|
|
33
34
|
const [internalIsOpen, setInternalIsOpen] = useState(false);
|
|
34
35
|
|
|
@@ -56,7 +57,10 @@ export function FloatUI({
|
|
|
56
57
|
const { refs, floatingStyles, context } = useFloating({
|
|
57
58
|
...floatingOptions,
|
|
58
59
|
open: isOpen,
|
|
59
|
-
onOpenChange:
|
|
60
|
+
onOpenChange: (isOpen) => {
|
|
61
|
+
setIsOpen(isOpen);
|
|
62
|
+
onOpenChange?.(isOpen);
|
|
63
|
+
},
|
|
60
64
|
elements: {
|
|
61
65
|
reference: referenceElementRef.current,
|
|
62
66
|
},
|
|
@@ -65,7 +69,9 @@ export function FloatUI({
|
|
|
65
69
|
// Can't call hooks conditionally so this enabled option is needed.
|
|
66
70
|
const click = useClick(context, { enabled: !hover });
|
|
67
71
|
const hoverHook = useHover(context, { enabled: hover });
|
|
68
|
-
const dismiss = useDismiss(context
|
|
72
|
+
const dismiss = useDismiss(context, {
|
|
73
|
+
bubbles: true,
|
|
74
|
+
});
|
|
69
75
|
|
|
70
76
|
const { getReferenceProps, getFloatingProps } = useInteractions([click, hoverHook, dismiss]);
|
|
71
77
|
|
|
@@ -107,7 +107,7 @@ describe('FloatUI Component', () => {
|
|
|
107
107
|
);
|
|
108
108
|
|
|
109
109
|
fireEvent.click(screen.getByText('Toggle'));
|
|
110
|
-
expect(setIsOpen).toHaveBeenCalledWith(true
|
|
110
|
+
expect(setIsOpen).toHaveBeenCalledWith(true);
|
|
111
111
|
});
|
|
112
112
|
|
|
113
113
|
it('displays the FloatUI content when the trigger is hovered in hover mode', async () => {
|
|
@@ -21,4 +21,6 @@ export type FloatUIProps = {
|
|
|
21
21
|
setIsOpen?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
22
22
|
/** If true, opens on hover instead of click. Defaults to false. */
|
|
23
23
|
hover?: boolean;
|
|
24
|
+
/** Callback function to be called when the FloatUI is opened or closed. */
|
|
25
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
24
26
|
};
|
|
@@ -45,7 +45,7 @@ const HorizontalStickyHeader = ({
|
|
|
45
45
|
variant="link"
|
|
46
46
|
size="sm"
|
|
47
47
|
iconLeft="pin"
|
|
48
|
-
onClick={onPinColumn}
|
|
48
|
+
onClick={() => onPinColumn?.(`sticky-column-${position}`)}
|
|
49
49
|
ariaLabel={isPinned ? 'Unpin column' : 'Pin column'}
|
|
50
50
|
className={`table__column--${isPinned ? 'is-pinned' : 'is-not-pinned'} table__column__pin-action`}
|
|
51
51
|
/>
|