@indico-data/design-system 2.45.1 → 2.45.3
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/README.md +23 -4
- package/lib/components/forms/date/datePicker/contants.d.ts +1 -1
- package/lib/components/icons/Icon.stories.d.ts +1 -0
- package/lib/components/icons/indicons.d.ts +3 -1
- package/lib/components/icons/types.d.ts +2 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.esm.js +216 -166
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +214 -164
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/button/Button.stories.tsx +5 -0
- package/src/components/icons/Icon.mdx +26 -5
- package/src/components/icons/Icon.stories.tsx +21 -3
- package/src/components/icons/Icon.tsx +10 -14
- package/src/components/icons/__tests__/Icon.test.tsx +8 -8
- package/src/components/icons/indicons.tsx +296 -351
- package/src/components/icons/types.ts +2 -2
- package/src/legacy/components/modals/ModalBase/ModalBase.stories.tsx +2 -4
- package/src/legacy/components/modals/ModalBase/ModalBase.styles.tsx +8 -2
- package/src/setup/setupIcons.ts +5 -1
- package/src/storybook/iconNames.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MouseEventHandler } from 'react';
|
|
1
|
+
import { MouseEventHandler, CSSProperties } from 'react';
|
|
2
2
|
import { PermafrostComponent } from '../../types';
|
|
3
3
|
import { IconName as FAIconName } from '@fortawesome/fontawesome-svg-core';
|
|
4
4
|
import { indicons } from './indicons';
|
|
@@ -13,6 +13,6 @@ export type IconProps = PermafrostComponent & {
|
|
|
13
13
|
name: IconName;
|
|
14
14
|
ariaLabel?: string;
|
|
15
15
|
size?: IconSizes;
|
|
16
|
-
style?:
|
|
16
|
+
style?: CSSProperties;
|
|
17
17
|
onClick?: MouseEventHandler<SVGElement>;
|
|
18
18
|
};
|
|
@@ -28,10 +28,8 @@ function StoryRender(props: any) {
|
|
|
28
28
|
open modal
|
|
29
29
|
</button>
|
|
30
30
|
|
|
31
|
-
<ModalBase {...props} open={isOpen} clickToDismiss={handleClose}>
|
|
32
|
-
|
|
33
|
-
There is nothing to this modal at all. It is completely up to you to style its contents.
|
|
34
|
-
</p>
|
|
31
|
+
<ModalBase {...props} open={isOpen} width="300px" clickToDismiss={handleClose}>
|
|
32
|
+
There is nothing to this modal at all. It is completely up to you to style its contents.
|
|
35
33
|
</ModalBase>
|
|
36
34
|
</>
|
|
37
35
|
);
|
|
@@ -17,12 +17,18 @@ function ModalAdapter(props: any): React.ReactElement {
|
|
|
17
17
|
closeTimeoutMS={120}
|
|
18
18
|
appElement={document.getElementById(props.node || 'root')}
|
|
19
19
|
>
|
|
20
|
-
{props.children}
|
|
20
|
+
<div className="modal-content">{props.children}</div>
|
|
21
21
|
</ReactModal>
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export const StyledModalBase = styled(ModalAdapter)`
|
|
26
|
+
.modal-content {
|
|
27
|
+
background-color: var(--pf-primary-color-600);
|
|
28
|
+
padding: var(--pf-padding-4);
|
|
29
|
+
border-radius: var(--pf-rounded-lg);
|
|
30
|
+
}
|
|
31
|
+
|
|
26
32
|
.${(props) => props.className}__content {
|
|
27
33
|
position: absolute;
|
|
28
34
|
top: 70px;
|
|
@@ -51,7 +57,7 @@ export const StyledModalBase = styled(ModalAdapter)`
|
|
|
51
57
|
|
|
52
58
|
.ReactModal__Overlay {
|
|
53
59
|
opacity: 0;
|
|
54
|
-
|
|
60
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
55
61
|
transition: opacity 120ms ease-in-out;
|
|
56
62
|
}
|
|
57
63
|
|
package/src/setup/setupIcons.ts
CHANGED
|
@@ -23,8 +23,9 @@ import {
|
|
|
23
23
|
faQuestionCircle,
|
|
24
24
|
faCopy,
|
|
25
25
|
} from '@fortawesome/free-solid-svg-icons';
|
|
26
|
+
import { indiconDefinitions } from '@/components/icons/indicons';
|
|
26
27
|
|
|
27
|
-
// Utility for registering
|
|
28
|
+
// Utility for registering Font Awesome icons
|
|
28
29
|
export const registerFontAwesomeIcons = (...icons: IconDefinition[]) => {
|
|
29
30
|
library.add(...icons);
|
|
30
31
|
};
|
|
@@ -51,4 +52,7 @@ registerFontAwesomeIcons(
|
|
|
51
52
|
faFileDownload,
|
|
52
53
|
faQuestionCircle,
|
|
53
54
|
faCopy,
|
|
55
|
+
// backwards compat, don't require registration of custom indicons
|
|
56
|
+
// might want to consider doing so in the future
|
|
57
|
+
...indiconDefinitions,
|
|
54
58
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// NOTE: This file imports the full list of
|
|
1
|
+
// NOTE: This file imports the full list of Font Awesome icons, and is only intended for use in Storybook.
|
|
2
2
|
// Avoid importing this file into the design system code to keep bundle size at a minimum.
|
|
3
3
|
|
|
4
4
|
import { fas } from '@fortawesome/free-solid-svg-icons';
|