@indico-data/design-system 2.46.0 → 2.47.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.
Files changed (45) hide show
  1. package/lib/components/index.d.ts +1 -0
  2. package/lib/components/modal/Modal.d.ts +2 -0
  3. package/lib/components/modal/Modal.stories.d.ts +7 -0
  4. package/lib/components/modal/__tests__/Modal.test.d.ts +1 -0
  5. package/lib/components/modal/index.d.ts +1 -0
  6. package/lib/components/modal/types.d.ts +16 -0
  7. package/lib/index.css +87 -0
  8. package/lib/index.d.ts +28 -48
  9. package/lib/index.esm.css +87 -0
  10. package/lib/index.esm.js +11223 -11386
  11. package/lib/index.esm.js.map +1 -1
  12. package/lib/index.js +11221 -11385
  13. package/lib/index.js.map +1 -1
  14. package/lib/legacy/components/index.d.ts +0 -1
  15. package/package.json +1 -1
  16. package/src/components/index.ts +1 -0
  17. package/src/components/modal/Modal.mdx +121 -0
  18. package/src/components/modal/Modal.stories.tsx +286 -0
  19. package/src/components/modal/Modal.tsx +63 -0
  20. package/src/components/modal/__tests__/Modal.test.tsx +60 -0
  21. package/src/components/modal/index.ts +1 -0
  22. package/src/components/modal/styles/Modal.scss +100 -0
  23. package/src/components/modal/types.ts +16 -0
  24. package/src/index.ts +2 -8
  25. package/src/legacy/components/index.ts +0 -1
  26. package/src/setup/setupIcons.ts +2 -0
  27. package/src/styles/index.scss +1 -0
  28. package/lib/legacy/components/modals/ConfirmModal/ConfirmModal.d.ts +0 -17
  29. package/lib/legacy/components/modals/ConfirmModal/ConfirmModal.stories.d.ts +0 -44
  30. package/lib/legacy/components/modals/ConfirmModal/ConfirmModal.styles.d.ts +0 -1
  31. package/lib/legacy/components/modals/ConfirmModal/index.d.ts +0 -1
  32. package/lib/legacy/components/modals/ModalBase/ModalBase.d.ts +0 -26
  33. package/lib/legacy/components/modals/ModalBase/ModalBase.stories.d.ts +0 -9
  34. package/lib/legacy/components/modals/ModalBase/ModalBase.styles.d.ts +0 -4
  35. package/lib/legacy/components/modals/ModalBase/index.d.ts +0 -2
  36. package/lib/legacy/components/modals/index.d.ts +0 -2
  37. package/src/legacy/components/modals/ConfirmModal/ConfirmModal.stories.tsx +0 -76
  38. package/src/legacy/components/modals/ConfirmModal/ConfirmModal.styles.ts +0 -27
  39. package/src/legacy/components/modals/ConfirmModal/ConfirmModal.tsx +0 -79
  40. package/src/legacy/components/modals/ConfirmModal/index.ts +0 -1
  41. package/src/legacy/components/modals/ModalBase/ModalBase.stories.tsx +0 -45
  42. package/src/legacy/components/modals/ModalBase/ModalBase.styles.tsx +0 -72
  43. package/src/legacy/components/modals/ModalBase/ModalBase.tsx +0 -79
  44. package/src/legacy/components/modals/ModalBase/index.ts +0 -2
  45. package/src/legacy/components/modals/index.ts +0 -2
@@ -18,4 +18,5 @@ export { DatePicker } from './forms/date/datePicker/DatePicker';
18
18
  export { IconTriggerDatePicker } from './forms/date/iconTriggerDatePicker';
19
19
  export { SingleInputDatePicker } from './forms/date/inputDatePicker';
20
20
  export { InputDateRangePicker } from './forms/date/inputDateRangePicker';
21
+ export { Modal } from './modal';
21
22
  export { Badge } from './badge';
@@ -0,0 +1,2 @@
1
+ import { ModalProps } from './types';
2
+ export declare const Modal: ({ className, children, isOpen, onRequestClose, portalClassName, overlayClassName, appElement, shouldCloseOnOverlayClick, shouldCloseOnEsc, testId, contentElement, overlayElement, position, parentSelector, ...rest }: ModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Modal } from './Modal';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Modal>;
6
+ export declare const Default: Story;
7
+ export declare const ConfirmationModal: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { Modal } from './Modal';
@@ -0,0 +1,16 @@
1
+ export interface ModalProps {
2
+ className?: string;
3
+ children?: React.ReactNode;
4
+ isOpen: boolean;
5
+ onRequestClose?: () => void;
6
+ portalClassName?: string;
7
+ overlayClassName?: string;
8
+ appElement?: HTMLElement;
9
+ shouldCloseOnOverlayClick?: boolean;
10
+ shouldCloseOnEsc?: boolean;
11
+ testId?: string;
12
+ contentElement?: (props: any, children: React.ReactNode) => React.ReactElement;
13
+ overlayElement?: (props: any, contentElement: React.ReactElement) => React.ReactElement;
14
+ position?: 'top' | 'center';
15
+ parentSelector?: () => HTMLElement;
16
+ }
package/lib/index.css CHANGED
@@ -1822,6 +1822,93 @@ form {
1822
1822
  font-size: var(--pf-font-size-h1);
1823
1823
  }
1824
1824
 
1825
+ :root {
1826
+ --pf-modal-rounded: var(--pf-rounded-lg);
1827
+ }
1828
+
1829
+ :root [data-theme=light] {
1830
+ --pf-modal-background-color: var(--pf-white-color);
1831
+ --pf-modal-border-color: var(--pf-border-color);
1832
+ }
1833
+
1834
+ :root [data-theme=dark],
1835
+ :root {
1836
+ --pf-modal-background-color: var(--pf-primary-color-600);
1837
+ --pf-modal-border-color: var(--pf-border-color);
1838
+ }
1839
+
1840
+ .ReactModal__Overlay {
1841
+ position: fixed;
1842
+ top: 0;
1843
+ left: 0;
1844
+ right: 0;
1845
+ bottom: 0;
1846
+ background-color: rgba(0, 0, 0, 0.5);
1847
+ display: flex;
1848
+ align-items: center;
1849
+ justify-content: center;
1850
+ }
1851
+
1852
+ .ReactModal__Overlay {
1853
+ opacity: 0;
1854
+ transition: opacity 100ms ease-in-out;
1855
+ }
1856
+
1857
+ .ReactModal__Overlay--after-open {
1858
+ opacity: 1;
1859
+ }
1860
+
1861
+ .ReactModal__Overlay--before-close {
1862
+ opacity: 0;
1863
+ }
1864
+
1865
+ .modal {
1866
+ position: absolute;
1867
+ left: 50%;
1868
+ transform: translateX(-50%);
1869
+ background: var(--pf-background-color);
1870
+ border-radius: var(--pf-modal-rounded);
1871
+ outline: none;
1872
+ }
1873
+ .modal--center {
1874
+ top: 50%;
1875
+ transform: translate(-50%, -50%);
1876
+ }
1877
+ .modal--top {
1878
+ top: 50px;
1879
+ }
1880
+ .modal .modal-content {
1881
+ background-color: var(--pf-modal-background-color);
1882
+ border: var(--pf-border-sm) solid var(--pf-modal-border-color);
1883
+ border-radius: var(--pf-modal-rounded);
1884
+ }
1885
+ .modal .modal-content .modal-body {
1886
+ padding: var(--pf-padding-8);
1887
+ padding-top: 0;
1888
+ }
1889
+ .modal .modal-content .modal-body h2 {
1890
+ font-size: var(--pf-font-size-h1);
1891
+ }
1892
+ .modal .modal-content .modal-body h1,
1893
+ .modal .modal-content .modal-body h2,
1894
+ .modal .modal-content .modal-body h3,
1895
+ .modal .modal-content .modal-body h4,
1896
+ .modal .modal-content .modal-body h5,
1897
+ .modal .modal-content .modal-body h6 {
1898
+ margin-bottom: var(--pf-margin-4);
1899
+ }
1900
+ .modal .modal-content .modal-body p {
1901
+ margin-bottom: var(--pf-margin-4);
1902
+ }
1903
+ .modal .modal-content .modal-body hr {
1904
+ margin-top: var(--pf-margin-8);
1905
+ margin-bottom: var(--pf-margin-8);
1906
+ border: var(--pf-border-sm) solid var(--pf-border-color);
1907
+ }
1908
+ .modal .modal-content .modal-close {
1909
+ text-align: right;
1910
+ }
1911
+
1825
1912
  :root [data-theme=light] {
1826
1913
  --pf-pill-primary-background-color: var(--pf-primary-color);
1827
1914
  --pf-pill-primary-font-color: var(--pf-white-color);
package/lib/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import React$1, { CSSProperties, MouseEventHandler, ReactElement } from 'react';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { ContainerProps, RowProps, ColProps } from 'react-grid-system';
7
7
  import { TableProps as TableProps$1, Direction as Direction$1, Alignment as Alignment$1 } from 'react-data-table-component';
8
- import { Props as Props$8 } from 'react-select';
8
+ import { Props as Props$7 } from 'react-select';
9
9
  import { DateRange, OnSelectHandler, Mode, CustomComponents, Matcher, Formatters, MonthChangeEventHandler, DayEventHandler } from 'react-day-picker';
10
10
 
11
11
  declare const registerFontAwesomeIcons: (...icons: IconDefinition[]) => void;
@@ -211,65 +211,26 @@ type PermafrostComponent = {
211
211
 
212
212
  type SemanticColor = 'primary' | 'secondary' | 'warning' | 'error' | 'success' | 'info';
213
213
 
214
- type Props$7 = PermafrostComponent & {
214
+ type Props$6 = PermafrostComponent & {
215
215
  ariaLabel?: string;
216
216
  size?: IconSizes;
217
217
  style?: React$1.CSSProperties;
218
218
  fill?: string;
219
219
  };
220
- declare function CircleSpinner(props: Props$7): React$1.ReactElement;
220
+ declare function CircleSpinner(props: Props$6): React$1.ReactElement;
221
221
 
222
- type Props$6 = PermafrostComponent & {
222
+ type Props$5 = PermafrostComponent & {
223
223
  width?: string;
224
224
  };
225
- declare function BarSpinner(props: Props$6): React$1.ReactElement;
225
+ declare function BarSpinner(props: Props$5): React$1.ReactElement;
226
226
 
227
- type Props$5 = PermafrostComponent & {
227
+ type Props$4 = PermafrostComponent & {
228
228
  color?: string;
229
229
  overallSize?: string | number;
230
230
  rippleSize?: string | number;
231
231
  showRandomMessage?: boolean;
232
232
  };
233
- declare function CirclePulse(props: Props$5): React$1.ReactElement;
234
-
235
- type ModalBaseProps = PermafrostComponent & {
236
- children: React$1.ReactNode | React$1.ReactNode[];
237
- clickToDismiss?(): void;
238
- describedBy?: string;
239
- node?: string;
240
- open: boolean;
241
- preventEscDismiss?: boolean;
242
- preventReturnFocus?: boolean;
243
- maxWidth?: string;
244
- } & ({
245
- labelElement: string;
246
- } | {
247
- labelText: string;
248
- });
249
- /**
250
- * Base modal component, powered by [react-modal](http://reactcommunity.org/react-modal/#usage)
251
- *
252
- * (Also see `ModalAdapter` in the styles file)
253
- *
254
- * Accessible element label must be included either as a string passed to `labelText`, or
255
- * the id of one of the children passed to `labelElement`. If a description is available,
256
- * pass that element’s id to the `describedBy` prop.
257
- */
258
- declare function ModalBase(props: ModalBaseProps): react_jsx_runtime.JSX.Element;
259
-
260
- type Props$4 = PermafrostComponent & Pick<ModalBaseProps, 'open'> & {
261
- describedBy?: string;
262
- clickOutsideHandler(e?: React$1.SyntheticEvent): void;
263
- confirmText?: string;
264
- message?: string | React$1.ReactNode;
265
- modalNode?: string;
266
- processing?: boolean;
267
- rejectText?: string;
268
- responseHandler(response: boolean, event: React$1.SyntheticEvent): void;
269
- title?: string | React$1.ReactNode;
270
- width?: number;
271
- };
272
- declare function ConfirmModal(props: Props$4): react_jsx_runtime.JSX.Element;
233
+ declare function CirclePulse(props: Props$4): React$1.ReactElement;
273
234
 
274
235
  type Props$3 = PermafrostComponent & {
275
236
  questionMark?: boolean;
@@ -418,7 +379,7 @@ interface PasswordInputProps extends LabelProps {
418
379
  }
419
380
  declare const LabeledPasswordInput: React$1.ForwardRefExoticComponent<Omit<Omit<PasswordInputProps, "ref"> & React$1.RefAttributes<HTMLInputElement> & LabelProps, "ref"> & React$1.RefAttributes<any>>;
420
381
 
421
- interface SelectProps<OptionType extends SelectOption> extends Props$8<OptionType> {
382
+ interface SelectProps<OptionType extends SelectOption> extends Props$7<OptionType> {
422
383
  options: OptionType[];
423
384
  }
424
385
  declare const Select: <OptionType extends SelectOption>({ classNamePrefix, className, components: customComponents, ...props }: SelectProps<OptionType>) => react_jsx_runtime.JSX.Element;
@@ -558,4 +519,23 @@ interface BadgeProps {
558
519
 
559
520
  declare const Badge: ({ className, children, size, string, ...rest }: BadgeProps) => react_jsx_runtime.JSX.Element;
560
521
 
561
- export { Badge, BarSpinner, Button, Card, Checkbox, CirclePulse, CircleSpinner, Col, ConfirmModal, Container, DatePicker, FloatUI, Form, Icon, IconTriggerDatePicker, LabeledInput as Input, Menu, ModalBase, LabeledPasswordInput as PasswordInput, Pill, Radio as RadioInput, Row, Select as SelectInput, SingleInputDatePicker, Skeleton, Table, LabeledTextarea as Textarea, Toggle as ToggleInput, Tooltip, registerFontAwesomeIcons };
522
+ interface ModalProps {
523
+ className?: string;
524
+ children?: React.ReactNode;
525
+ isOpen: boolean;
526
+ onRequestClose?: () => void;
527
+ portalClassName?: string;
528
+ overlayClassName?: string;
529
+ appElement?: HTMLElement;
530
+ shouldCloseOnOverlayClick?: boolean;
531
+ shouldCloseOnEsc?: boolean;
532
+ testId?: string;
533
+ contentElement?: (props: any, children: React.ReactNode) => React.ReactElement;
534
+ overlayElement?: (props: any, contentElement: React.ReactElement) => React.ReactElement;
535
+ position?: 'top' | 'center';
536
+ parentSelector?: () => HTMLElement;
537
+ }
538
+
539
+ declare const Modal: ({ className, children, isOpen, onRequestClose, portalClassName, overlayClassName, appElement, shouldCloseOnOverlayClick, shouldCloseOnEsc, testId, contentElement, overlayElement, position, parentSelector, ...rest }: ModalProps) => react_jsx_runtime.JSX.Element;
540
+
541
+ export { Badge, BarSpinner, Button, Card, Checkbox, CirclePulse, CircleSpinner, Col, Container, DatePicker, FloatUI, Form, Icon, IconTriggerDatePicker, LabeledInput as Input, Menu, Modal, LabeledPasswordInput as PasswordInput, Pill, Radio as RadioInput, Row, Select as SelectInput, SingleInputDatePicker, Skeleton, Table, LabeledTextarea as Textarea, Toggle as ToggleInput, Tooltip, registerFontAwesomeIcons };
package/lib/index.esm.css CHANGED
@@ -1822,6 +1822,93 @@ form {
1822
1822
  font-size: var(--pf-font-size-h1);
1823
1823
  }
1824
1824
 
1825
+ :root {
1826
+ --pf-modal-rounded: var(--pf-rounded-lg);
1827
+ }
1828
+
1829
+ :root [data-theme=light] {
1830
+ --pf-modal-background-color: var(--pf-white-color);
1831
+ --pf-modal-border-color: var(--pf-border-color);
1832
+ }
1833
+
1834
+ :root [data-theme=dark],
1835
+ :root {
1836
+ --pf-modal-background-color: var(--pf-primary-color-600);
1837
+ --pf-modal-border-color: var(--pf-border-color);
1838
+ }
1839
+
1840
+ .ReactModal__Overlay {
1841
+ position: fixed;
1842
+ top: 0;
1843
+ left: 0;
1844
+ right: 0;
1845
+ bottom: 0;
1846
+ background-color: rgba(0, 0, 0, 0.5);
1847
+ display: flex;
1848
+ align-items: center;
1849
+ justify-content: center;
1850
+ }
1851
+
1852
+ .ReactModal__Overlay {
1853
+ opacity: 0;
1854
+ transition: opacity 100ms ease-in-out;
1855
+ }
1856
+
1857
+ .ReactModal__Overlay--after-open {
1858
+ opacity: 1;
1859
+ }
1860
+
1861
+ .ReactModal__Overlay--before-close {
1862
+ opacity: 0;
1863
+ }
1864
+
1865
+ .modal {
1866
+ position: absolute;
1867
+ left: 50%;
1868
+ transform: translateX(-50%);
1869
+ background: var(--pf-background-color);
1870
+ border-radius: var(--pf-modal-rounded);
1871
+ outline: none;
1872
+ }
1873
+ .modal--center {
1874
+ top: 50%;
1875
+ transform: translate(-50%, -50%);
1876
+ }
1877
+ .modal--top {
1878
+ top: 50px;
1879
+ }
1880
+ .modal .modal-content {
1881
+ background-color: var(--pf-modal-background-color);
1882
+ border: var(--pf-border-sm) solid var(--pf-modal-border-color);
1883
+ border-radius: var(--pf-modal-rounded);
1884
+ }
1885
+ .modal .modal-content .modal-body {
1886
+ padding: var(--pf-padding-8);
1887
+ padding-top: 0;
1888
+ }
1889
+ .modal .modal-content .modal-body h2 {
1890
+ font-size: var(--pf-font-size-h1);
1891
+ }
1892
+ .modal .modal-content .modal-body h1,
1893
+ .modal .modal-content .modal-body h2,
1894
+ .modal .modal-content .modal-body h3,
1895
+ .modal .modal-content .modal-body h4,
1896
+ .modal .modal-content .modal-body h5,
1897
+ .modal .modal-content .modal-body h6 {
1898
+ margin-bottom: var(--pf-margin-4);
1899
+ }
1900
+ .modal .modal-content .modal-body p {
1901
+ margin-bottom: var(--pf-margin-4);
1902
+ }
1903
+ .modal .modal-content .modal-body hr {
1904
+ margin-top: var(--pf-margin-8);
1905
+ margin-bottom: var(--pf-margin-8);
1906
+ border: var(--pf-border-sm) solid var(--pf-border-color);
1907
+ }
1908
+ .modal .modal-content .modal-close {
1909
+ text-align: right;
1910
+ }
1911
+
1825
1912
  :root [data-theme=light] {
1826
1913
  --pf-pill-primary-background-color: var(--pf-primary-color);
1827
1914
  --pf-pill-primary-font-color: var(--pf-white-color);