@indico-data/design-system 2.20.0 → 2.21.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/index.css +3 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.esm.css +3 -3
- package/lib/index.esm.js +6 -6
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +5 -5
- package/lib/index.js.map +1 -1
- package/lib/src/components/button/Button.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/button/Button.tsx +6 -5
- package/src/components/popper/Popper.stories.tsx +9 -10
- package/src/styles/_typography.scss +1 -1
- package/src/styles/variables/_typography.scss +2 -4
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { ButtonProps } from './types';
|
|
2
|
-
export declare const Button:
|
|
3
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
1
2
|
import classNames from 'classnames';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
import { Icon } from '@/components';
|
|
4
4
|
|
|
5
5
|
import { ButtonProps } from './types';
|
|
6
6
|
|
|
7
|
-
export const Button = (props
|
|
7
|
+
export const Button = forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => {
|
|
8
8
|
const {
|
|
9
9
|
ariaLabel,
|
|
10
10
|
children,
|
|
@@ -37,13 +37,14 @@ export const Button = (props: ButtonProps) => {
|
|
|
37
37
|
);
|
|
38
38
|
|
|
39
39
|
const handleOnClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
40
|
-
if (!isLoading &&
|
|
41
|
-
|
|
40
|
+
if (!isLoading && onClick) {
|
|
41
|
+
onClick(event);
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
return (
|
|
46
46
|
<button
|
|
47
|
+
ref={ref}
|
|
47
48
|
disabled={isLoading || isDisabled}
|
|
48
49
|
className={buttonClasses}
|
|
49
50
|
role="button"
|
|
@@ -84,4 +85,4 @@ export const Button = (props: ButtonProps) => {
|
|
|
84
85
|
)}
|
|
85
86
|
</button>
|
|
86
87
|
);
|
|
87
|
-
};
|
|
88
|
+
});
|
|
@@ -111,17 +111,16 @@ type Story = StoryObj<PopperProps>;
|
|
|
111
111
|
export const Default: Story = {
|
|
112
112
|
render: (args) => {
|
|
113
113
|
const [isOpen, setIsOpen] = useState(false);
|
|
114
|
-
const buttonRef = useRef<
|
|
114
|
+
const buttonRef = useRef<HTMLButtonElement | null>(null);
|
|
115
115
|
|
|
116
116
|
return (
|
|
117
|
-
|
|
118
|
-
<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
</div>
|
|
117
|
+
<>
|
|
118
|
+
<Button
|
|
119
|
+
ref={buttonRef}
|
|
120
|
+
onClick={() => setIsOpen((prev) => !prev)}
|
|
121
|
+
iconName="kabob"
|
|
122
|
+
ariaLabel="Toggle Popper"
|
|
123
|
+
/>
|
|
125
124
|
<Popper
|
|
126
125
|
{...args}
|
|
127
126
|
referenceElement={buttonRef.current}
|
|
@@ -155,7 +154,7 @@ export const Default: Story = {
|
|
|
155
154
|
</Button>
|
|
156
155
|
</Menu>
|
|
157
156
|
</Popper>
|
|
158
|
-
|
|
157
|
+
</>
|
|
159
158
|
);
|
|
160
159
|
},
|
|
161
160
|
};
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
// Family
|
|
5
5
|
--pf-font-family-base: 'Mulish', sans-serif;
|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
// Sizes
|
|
9
8
|
--pf-font-size-base: 1rem;
|
|
10
9
|
--pf-font-size-h1: calc(1.5 * var(--pf-font-size-base));
|
|
@@ -18,7 +17,7 @@
|
|
|
18
17
|
--pf-font-size-subtitle: var(--pf-font-size-base);
|
|
19
18
|
--pf-font-size-subtitle2: calc(0.875 * var(--pf-font-size-base));
|
|
20
19
|
--pf-font-size-button: var(--pf-font-size-base);
|
|
21
|
-
--pf-font-size-
|
|
20
|
+
--pf-font-size-overline: calc(0.75 * var(--pf-font-size-base));
|
|
22
21
|
|
|
23
22
|
// Weights
|
|
24
23
|
--pf-font-weight-thin: 100;
|
|
@@ -27,5 +26,4 @@
|
|
|
27
26
|
--pf-font-weight-medium: 500;
|
|
28
27
|
--pf-font-weight-bold: 700;
|
|
29
28
|
--pf-font-weight-heavy: 900;
|
|
30
|
-
|
|
31
|
-
}
|
|
29
|
+
}
|