@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.
@@ -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?: React.CSSProperties;
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
- <p>
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
 
@@ -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 FontAwesome icons
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 FontAwesome icons, and is only intended for use in Storybook.
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';