@nypl/design-system-react-components 0.26.1 → 0.27.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/CHANGELOG.md +17 -0
- package/dist/components/Modal/Modal.d.ts +28 -8
- package/dist/design-system-react-components.cjs.development.js +159 -96
- package/dist/design-system-react-components.cjs.development.js.map +1 -1
- package/dist/design-system-react-components.cjs.production.min.js +1 -1
- package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
- package/dist/design-system-react-components.esm.js +160 -98
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme/components/select.d.ts +1 -7
- package/package.json +13 -14
- package/src/components/Link/Link.stories.mdx +0 -14
- package/src/components/Link/Link.test.tsx +0 -22
- package/src/components/Modal/Modal.stories.mdx +246 -139
- package/src/components/Modal/Modal.test.tsx +151 -9
- package/src/components/Modal/Modal.tsx +140 -20
- package/src/components/Modal/__snapshots__/Modal.test.tsx.snap +25 -0
- package/src/components/Pagination/Pagination.stories.mdx +1 -2
- package/src/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap +1 -1
- package/src/components/Select/Select.stories.mdx +3 -3
- package/src/components/Select/Select.tsx +15 -9
- package/src/components/Select/__snapshots__/Select.test.tsx.snap +24 -24
- package/src/index.ts +1 -1
- package/src/styles.scss +0 -1
- package/src/theme/components/select.ts +1 -5
- package/src/components/Modal/_Modal.scss +0 -18
package/dist/index.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export { default as List } from "./components/List/List";
|
|
|
34
34
|
export { ListTypes } from "./components/List/ListTypes";
|
|
35
35
|
export { default as Logo } from "./components/Logo/Logo";
|
|
36
36
|
export { LogoColors, LogoNames, LogoSizes } from "./components/Logo/LogoTypes";
|
|
37
|
-
export {
|
|
37
|
+
export { ModalTrigger, useModal } from "./components/Modal/Modal";
|
|
38
38
|
export { default as Notification } from "./components/Notification/Notification";
|
|
39
39
|
export { NotificationTypes } from "./components/Notification/NotificationTypes";
|
|
40
40
|
export { default as Pagination } from "./components/Pagination/Pagination";
|
package/dist/styles.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */@import "~react-datepicker/dist/react-datepicker.css";html{-webkit-text-size-adjust:100%;line-height:1.15}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}
|
|
2
2
|
|
|
3
|
-
/*! system-font.css v2.0.2 | CC0-1.0 License | github.com/jonathantneal/system-font-css */@font-face{font-family:system-ui;font-style:normal;font-weight:300;src:local(".SFNSText-Light"),local(".HelveticaNeueDeskInterface-Light"),local(".LucidaGrandeUI"),local("Segoe UI Light"),local("Ubuntu Light"),local("Roboto-Light"),local("DroidSans"),local("Tahoma")}@font-face{font-family:system-ui;font-style:italic;font-weight:300;src:local(".SFNSText-LightItalic"),local(".HelveticaNeueDeskInterface-Italic"),local(".LucidaGrandeUI"),local("Segoe UI Light Italic"),local("Ubuntu Light Italic"),local("Roboto-LightItalic"),local("DroidSans"),local("Tahoma")}@font-face{font-family:system-ui;font-style:normal;font-weight:400;src:local(".SFNSText-Regular"),local(".HelveticaNeueDeskInterface-Regular"),local(".LucidaGrandeUI"),local("Segoe UI"),local("Ubuntu"),local("Roboto-Regular"),local("DroidSans"),local("Tahoma")}@font-face{font-family:system-ui;font-style:italic;font-weight:400;src:local(".SFNSText-Italic"),local(".HelveticaNeueDeskInterface-Italic"),local(".LucidaGrandeUI"),local("Segoe UI Italic"),local("Ubuntu Italic"),local("Roboto-Italic"),local("DroidSans"),local("Tahoma")}@font-face{font-family:system-ui;font-style:normal;font-weight:500;src:local(".SFNSText-Medium"),local(".HelveticaNeueDeskInterface-MediumP4"),local(".LucidaGrandeUI"),local("Segoe UI Semibold"),local("Ubuntu Medium"),local("Roboto-Medium"),local("DroidSans-Bold"),local("Tahoma Bold")}@font-face{font-family:system-ui;font-style:italic;font-weight:500;src:local(".SFNSText-MediumItalic"),local(".HelveticaNeueDeskInterface-MediumItalicP4"),local(".LucidaGrandeUI"),local("Segoe UI Semibold Italic"),local("Ubuntu Medium Italic"),local("Roboto-MediumItalic"),local("DroidSans-Bold"),local("Tahoma Bold")}@font-face{font-family:system-ui;font-style:normal;font-weight:700;src:local(".SFNSText-Bold"),local(".HelveticaNeueDeskInterface-Bold"),local(".LucidaGrandeUI"),local("Segoe UI Bold"),local("Ubuntu Bold"),local("Roboto-Bold"),local("DroidSans-Bold"),local("Tahoma Bold")}@font-face{font-family:system-ui;font-style:italic;font-weight:700;src:local(".SFNSText-BoldItalic"),local(".HelveticaNeueDeskInterface-BoldItalic"),local(".LucidaGrandeUI"),local("Segoe UI Bold Italic"),local("Ubuntu Bold Italic"),local("Roboto-BoldItalic"),local("DroidSans-Bold"),local("Tahoma Bold")}:root{--nypl-breakpoint-small:320px;--nypl-breakpoint-medium:600px;--nypl-breakpoint-large:960px;--nypl-breakpoint-xl:1280px}.container{padding:var(--nypl-space-s)}.placeholder{--color-place-holder:var(--nypl-colors-ui-gray-dark);align-items:center;border:4px dashed var(--color-place-holder);color:var(--color-place-holder);display:flex;font-size:3rem;justify-content:center;line-height:1.4;margin-bottom:var(--nypl-space-l);padding:4rem 1rem;width:100%}@media (min-width:960px){.placeholder{margin-bottom:var(--nypl-space-l)}}.placeholder--full{margin-bottom:var(--nypl-space-xxl)}@media (min-width:960px){.placeholder--full{margin-bottom:var(--nypl-space-xxxl)}}.placeholder--short{padding:1rem}.react-autosuggest__container{display:inline;position:relative;width:100%}.react-autosuggest__input--focused{outline:none}.react-autosuggest__input--open{border-bottom-left-radius:0;border-bottom-right-radius:0;width:100%}.react-autosuggest__suggestions-container{display:none;width:100%}.react-autosuggest__suggestions-container--open{background-color:var(--nypl-colors-ui-white);display:block;font-weight:300;margin-top:1px;outline:1px solid var(--nypl-colors-ui-gray-light-cool);position:relative;width:100%;z-index:2}.react-autosuggest__suggestions-list{list-style-type:none;margin:0;padding:0}.react-autosuggest__suggestion{cursor:pointer;padding:var(--nypl-space-xs)}.react-autosuggest__suggestion--highlighted{background-color:var(--nypl-colors-ui-gray-light-cool)}.auto-suggest-bottom{padding:var(--nypl-space-xs)}.date-picker-calendar{font-family:var(--nypl-fonts-body)}.date-picker-calendar .react-datepicker{border-color:var(--nypl-colors-ui-gray-medium)}.date-picker-calendar .react-datepicker__triangle{transform:translate(32px)!important}.date-picker-calendar .react-datepicker__triangle:before{border-bottom-color:var(--nypl-colors-ui-gray-medium)!important}.date-picker-calendar .react-datepicker__triangle:after{border-bottom-color:var(--nypl-colors-ui-gray-x-light-cool)!important}.date-picker-calendar .react-datepicker__navigation-icon{top:5px;width:0}.date-picker-calendar .react-datepicker__navigation-icon:before{border-color:var(--nypl-colors-ui-gray-medium)}.date-picker-calendar .react-datepicker__navigation:hover .react-datepicker__navigation-icon:before{border-color:var(--nypl-colors-ui-gray-dark)}.date-picker-calendar .react-datepicker__header{background-color:var(--nypl-colors-ui-gray-x-light-cool);border-color:var(--nypl-colors-ui-gray-medium)}.date-picker-calendar .react-datepicker__year-wrapper{max-width:220px}.date-picker-calendar .react-datepicker__day--keyboard-selected,.date-picker-calendar .react-datepicker__day:hover,.date-picker-calendar .react-datepicker__month-text:hover,.date-picker-calendar .react-datepicker__year-text:not(.react-datepicker__year-text--disabled):hover{background-color:var(--nypl-colors-ui-gray-x-light-cool);border-radius:0;color:var(--nypl-colors-ui-black)}.date-picker-calendar .react-datepicker__day--in-range.react-datepicker__day--in-range,.date-picker-calendar .react-datepicker__day--keyboard-selected,.date-picker-calendar .react-datepicker__month--in-range.react-datepicker__day--in-range,.date-picker-calendar .react-datepicker__year--in-range.react-datepicker__day--in-range{opacity:1}.date-picker-calendar .react-datepicker__day--in-range,.date-picker-calendar .react-datepicker__day--in-selecting-range,.date-picker-calendar .react-datepicker__day--keyboard-selected,.date-picker-calendar .react-datepicker__day-text--keyboard-selected,.date-picker-calendar .react-datepicker__month--in-range,.date-picker-calendar .react-datepicker__month--in-selecting-range,.date-picker-calendar .react-datepicker__month--keyboard-selected,.date-picker-calendar .react-datepicker__month-text--keyboard-selected,.date-picker-calendar .react-datepicker__year--in-range,.date-picker-calendar .react-datepicker__year--in-selecting-range,.date-picker-calendar .react-datepicker__year--keyboard-selected,.date-picker-calendar .react-datepicker__year-text--keyboard-selected{background-color:var(--nypl-colors-ui-gray-x-light-cool);border-radius:0;color:var(--nypl-colors-ui-black)}.date-picker-calendar .react-datepicker__day--today,.date-picker-calendar .react-datepicker__day--today:hover,.date-picker-calendar .react-datepicker__day-text--today,.date-picker-calendar .react-datepicker__day-text--today:hover,.date-picker-calendar .react-datepicker__month--today,.date-picker-calendar .react-datepicker__month--today:hover,.date-picker-calendar .react-datepicker__month-text--today,.date-picker-calendar .react-datepicker__month-text--today:hover,.date-picker-calendar .react-datepicker__year--today,.date-picker-calendar .react-datepicker__year--today:hover,.date-picker-calendar .react-datepicker__year-text--today,.date-picker-calendar .react-datepicker__year-text--today:hover{background-color:var(--nypl-colors-ui-gray-light-cool);color:var(--nypl-colors-ui-black)}.date-picker-calendar .react-datepicker__day--selected,.date-picker-calendar .react-datepicker__day-text--selected,.date-picker-calendar .react-datepicker__month--selected,.date-picker-calendar .react-datepicker__month-text--selected,.date-picker-calendar .react-datepicker__year--selected,.date-picker-calendar .react-datepicker__year-text--selected{background-color:var(--nypl-colors-ui-focus);border-radius:0;color:var(--nypl-colors-ui-white);font-weight:700;opacity:1}.date-picker-calendar .react-datepicker__day--selected:hover,.date-picker-calendar .react-datepicker__day-text--selected:hover,.date-picker-calendar .react-datepicker__month--selected:hover,.date-picker-calendar .react-datepicker__month-text--selected:hover,.date-picker-calendar .react-datepicker__year--selected:hover,.date-picker-calendar .react-datepicker__year-text--selected:hover{background-color:var(--nypl-colors-ui-focus);color:var(--nypl-colors-ui-white)}
|
|
3
|
+
/*! system-font.css v2.0.2 | CC0-1.0 License | github.com/jonathantneal/system-font-css */@font-face{font-family:system-ui;font-style:normal;font-weight:300;src:local(".SFNSText-Light"),local(".HelveticaNeueDeskInterface-Light"),local(".LucidaGrandeUI"),local("Segoe UI Light"),local("Ubuntu Light"),local("Roboto-Light"),local("DroidSans"),local("Tahoma")}@font-face{font-family:system-ui;font-style:italic;font-weight:300;src:local(".SFNSText-LightItalic"),local(".HelveticaNeueDeskInterface-Italic"),local(".LucidaGrandeUI"),local("Segoe UI Light Italic"),local("Ubuntu Light Italic"),local("Roboto-LightItalic"),local("DroidSans"),local("Tahoma")}@font-face{font-family:system-ui;font-style:normal;font-weight:400;src:local(".SFNSText-Regular"),local(".HelveticaNeueDeskInterface-Regular"),local(".LucidaGrandeUI"),local("Segoe UI"),local("Ubuntu"),local("Roboto-Regular"),local("DroidSans"),local("Tahoma")}@font-face{font-family:system-ui;font-style:italic;font-weight:400;src:local(".SFNSText-Italic"),local(".HelveticaNeueDeskInterface-Italic"),local(".LucidaGrandeUI"),local("Segoe UI Italic"),local("Ubuntu Italic"),local("Roboto-Italic"),local("DroidSans"),local("Tahoma")}@font-face{font-family:system-ui;font-style:normal;font-weight:500;src:local(".SFNSText-Medium"),local(".HelveticaNeueDeskInterface-MediumP4"),local(".LucidaGrandeUI"),local("Segoe UI Semibold"),local("Ubuntu Medium"),local("Roboto-Medium"),local("DroidSans-Bold"),local("Tahoma Bold")}@font-face{font-family:system-ui;font-style:italic;font-weight:500;src:local(".SFNSText-MediumItalic"),local(".HelveticaNeueDeskInterface-MediumItalicP4"),local(".LucidaGrandeUI"),local("Segoe UI Semibold Italic"),local("Ubuntu Medium Italic"),local("Roboto-MediumItalic"),local("DroidSans-Bold"),local("Tahoma Bold")}@font-face{font-family:system-ui;font-style:normal;font-weight:700;src:local(".SFNSText-Bold"),local(".HelveticaNeueDeskInterface-Bold"),local(".LucidaGrandeUI"),local("Segoe UI Bold"),local("Ubuntu Bold"),local("Roboto-Bold"),local("DroidSans-Bold"),local("Tahoma Bold")}@font-face{font-family:system-ui;font-style:italic;font-weight:700;src:local(".SFNSText-BoldItalic"),local(".HelveticaNeueDeskInterface-BoldItalic"),local(".LucidaGrandeUI"),local("Segoe UI Bold Italic"),local("Ubuntu Bold Italic"),local("Roboto-BoldItalic"),local("DroidSans-Bold"),local("Tahoma Bold")}:root{--nypl-breakpoint-small:320px;--nypl-breakpoint-medium:600px;--nypl-breakpoint-large:960px;--nypl-breakpoint-xl:1280px}.container{padding:var(--nypl-space-s)}.placeholder{--color-place-holder:var(--nypl-colors-ui-gray-dark);align-items:center;border:4px dashed var(--color-place-holder);color:var(--color-place-holder);display:flex;font-size:3rem;justify-content:center;line-height:1.4;margin-bottom:var(--nypl-space-l);padding:4rem 1rem;width:100%}@media (min-width:960px){.placeholder{margin-bottom:var(--nypl-space-l)}}.placeholder--full{margin-bottom:var(--nypl-space-xxl)}@media (min-width:960px){.placeholder--full{margin-bottom:var(--nypl-space-xxxl)}}.placeholder--short{padding:1rem}.react-autosuggest__container{display:inline;position:relative;width:100%}.react-autosuggest__input--focused{outline:none}.react-autosuggest__input--open{border-bottom-left-radius:0;border-bottom-right-radius:0;width:100%}.react-autosuggest__suggestions-container{display:none;width:100%}.react-autosuggest__suggestions-container--open{background-color:var(--nypl-colors-ui-white);display:block;font-weight:300;margin-top:1px;outline:1px solid var(--nypl-colors-ui-gray-light-cool);position:relative;width:100%;z-index:2}.react-autosuggest__suggestions-list{list-style-type:none;margin:0;padding:0}.react-autosuggest__suggestion{cursor:pointer;padding:var(--nypl-space-xs)}.react-autosuggest__suggestion--highlighted{background-color:var(--nypl-colors-ui-gray-light-cool)}.auto-suggest-bottom{padding:var(--nypl-space-xs)}.date-picker-calendar{font-family:var(--nypl-fonts-body)}.date-picker-calendar .react-datepicker{border-color:var(--nypl-colors-ui-gray-medium)}.date-picker-calendar .react-datepicker__triangle{transform:translate(32px)!important}.date-picker-calendar .react-datepicker__triangle:before{border-bottom-color:var(--nypl-colors-ui-gray-medium)!important}.date-picker-calendar .react-datepicker__triangle:after{border-bottom-color:var(--nypl-colors-ui-gray-x-light-cool)!important}.date-picker-calendar .react-datepicker__navigation-icon{top:5px;width:0}.date-picker-calendar .react-datepicker__navigation-icon:before{border-color:var(--nypl-colors-ui-gray-medium)}.date-picker-calendar .react-datepicker__navigation:hover .react-datepicker__navigation-icon:before{border-color:var(--nypl-colors-ui-gray-dark)}.date-picker-calendar .react-datepicker__header{background-color:var(--nypl-colors-ui-gray-x-light-cool);border-color:var(--nypl-colors-ui-gray-medium)}.date-picker-calendar .react-datepicker__year-wrapper{max-width:220px}.date-picker-calendar .react-datepicker__day--keyboard-selected,.date-picker-calendar .react-datepicker__day:hover,.date-picker-calendar .react-datepicker__month-text:hover,.date-picker-calendar .react-datepicker__year-text:not(.react-datepicker__year-text--disabled):hover{background-color:var(--nypl-colors-ui-gray-x-light-cool);border-radius:0;color:var(--nypl-colors-ui-black)}.date-picker-calendar .react-datepicker__day--in-range.react-datepicker__day--in-range,.date-picker-calendar .react-datepicker__day--keyboard-selected,.date-picker-calendar .react-datepicker__month--in-range.react-datepicker__day--in-range,.date-picker-calendar .react-datepicker__year--in-range.react-datepicker__day--in-range{opacity:1}.date-picker-calendar .react-datepicker__day--in-range,.date-picker-calendar .react-datepicker__day--in-selecting-range,.date-picker-calendar .react-datepicker__day--keyboard-selected,.date-picker-calendar .react-datepicker__day-text--keyboard-selected,.date-picker-calendar .react-datepicker__month--in-range,.date-picker-calendar .react-datepicker__month--in-selecting-range,.date-picker-calendar .react-datepicker__month--keyboard-selected,.date-picker-calendar .react-datepicker__month-text--keyboard-selected,.date-picker-calendar .react-datepicker__year--in-range,.date-picker-calendar .react-datepicker__year--in-selecting-range,.date-picker-calendar .react-datepicker__year--keyboard-selected,.date-picker-calendar .react-datepicker__year-text--keyboard-selected{background-color:var(--nypl-colors-ui-gray-x-light-cool);border-radius:0;color:var(--nypl-colors-ui-black)}.date-picker-calendar .react-datepicker__day--today,.date-picker-calendar .react-datepicker__day--today:hover,.date-picker-calendar .react-datepicker__day-text--today,.date-picker-calendar .react-datepicker__day-text--today:hover,.date-picker-calendar .react-datepicker__month--today,.date-picker-calendar .react-datepicker__month--today:hover,.date-picker-calendar .react-datepicker__month-text--today,.date-picker-calendar .react-datepicker__month-text--today:hover,.date-picker-calendar .react-datepicker__year--today,.date-picker-calendar .react-datepicker__year--today:hover,.date-picker-calendar .react-datepicker__year-text--today,.date-picker-calendar .react-datepicker__year-text--today:hover{background-color:var(--nypl-colors-ui-gray-light-cool);color:var(--nypl-colors-ui-black)}.date-picker-calendar .react-datepicker__day--selected,.date-picker-calendar .react-datepicker__day-text--selected,.date-picker-calendar .react-datepicker__month--selected,.date-picker-calendar .react-datepicker__month-text--selected,.date-picker-calendar .react-datepicker__year--selected,.date-picker-calendar .react-datepicker__year-text--selected{background-color:var(--nypl-colors-ui-focus);border-radius:0;color:var(--nypl-colors-ui-white);font-weight:700;opacity:1}.date-picker-calendar .react-datepicker__day--selected:hover,.date-picker-calendar .react-datepicker__day-text--selected:hover,.date-picker-calendar .react-datepicker__month--selected:hover,.date-picker-calendar .react-datepicker__month-text--selected:hover,.date-picker-calendar .react-datepicker__year--selected:hover,.date-picker-calendar .react-datepicker__year-text--selected:hover{background-color:var(--nypl-colors-ui-focus);color:var(--nypl-colors-ui-white)}
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
declare const Select: {
|
|
2
2
|
parts: string[];
|
|
3
|
-
baseStyle: ({ labelPosition
|
|
3
|
+
baseStyle: ({ labelPosition }: {
|
|
4
4
|
labelPosition: any;
|
|
5
|
-
labelWidth: any;
|
|
6
5
|
}) => {
|
|
7
6
|
marginBottom: string;
|
|
8
7
|
".chakra-select__icon-wrapper": {
|
|
9
8
|
zIndex: string;
|
|
10
9
|
};
|
|
11
|
-
helperText: {
|
|
12
|
-
marginLeft: {
|
|
13
|
-
md: string;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
10
|
inline: {
|
|
17
11
|
display: {
|
|
18
12
|
md: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nypl/design-system-react-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "NYPL Reservoir Design System React Components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -57,27 +57,28 @@
|
|
|
57
57
|
}
|
|
58
58
|
],
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@chakra-ui/react": ">=1.
|
|
61
|
-
"@chakra-ui/system": ">=1.
|
|
62
|
-
"@emotion/react": "11.4.1",
|
|
63
|
-
"@emotion/styled": "11.3.0",
|
|
64
|
-
"framer-motion": "4.1.17",
|
|
60
|
+
"@chakra-ui/react": ">=1.8.5",
|
|
61
|
+
"@chakra-ui/system": ">=1.11.0",
|
|
62
|
+
"@emotion/react": ">=11.4.1",
|
|
63
|
+
"@emotion/styled": ">=11.3.0",
|
|
64
|
+
"framer-motion": "^4.1.17",
|
|
65
65
|
"he": "1.2.0",
|
|
66
66
|
"react-datepicker": "4.1.1",
|
|
67
67
|
"system-font-css": "2.0.2",
|
|
68
68
|
"typescript": "4.3.5"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@chakra-ui/react": ">=1.
|
|
72
|
-
"@chakra-ui/system": ">=1.
|
|
71
|
+
"@chakra-ui/react": ">=1.8.0",
|
|
72
|
+
"@chakra-ui/system": ">=1.10.0",
|
|
73
73
|
"@emotion/react": ">=11.4.1",
|
|
74
74
|
"@emotion/styled": ">=11.3.0",
|
|
75
|
-
"framer-motion": "
|
|
75
|
+
"framer-motion": "^4.1.17",
|
|
76
76
|
"react": ">=16.13.0",
|
|
77
77
|
"react-dom": ">=16.13.0"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@babel/core": "7.14.6",
|
|
81
|
+
"@chakra-ui/storybook-addon": "1.0.3",
|
|
81
82
|
"@mdx-js/react": "1.6.22",
|
|
82
83
|
"@size-limit/preset-small-lib": "5.0.1",
|
|
83
84
|
"@storybook/addon-a11y": "6.4.19",
|
|
@@ -86,7 +87,6 @@
|
|
|
86
87
|
"@storybook/addon-essentials": "6.4.19",
|
|
87
88
|
"@storybook/addon-jest": "6.4.19",
|
|
88
89
|
"@storybook/addon-links": "6.4.19",
|
|
89
|
-
"@storybook/addon-queryparams": "6.2.9",
|
|
90
90
|
"@storybook/addons": "6.4.19",
|
|
91
91
|
"@storybook/react": "6.4.19",
|
|
92
92
|
"@svgr/rollup": "5.5.0",
|
|
@@ -124,12 +124,11 @@
|
|
|
124
124
|
"node-sass-glob-importer": "5.3.2",
|
|
125
125
|
"normalize.css": "8.0.1",
|
|
126
126
|
"prettier": "2.4.1",
|
|
127
|
-
"react": "
|
|
127
|
+
"react": "17.0.2",
|
|
128
128
|
"react-autosuggest": "10.0.2",
|
|
129
129
|
"react-docgen-typescript-loader": "3.1.0",
|
|
130
|
-
"react-dom": "
|
|
131
|
-
"react-
|
|
132
|
-
"react-test-renderer": "16.14.0",
|
|
130
|
+
"react-dom": "17.0.2",
|
|
131
|
+
"react-test-renderer": "17.0.2",
|
|
133
132
|
"rollup-plugin-postcss": "4.0.0",
|
|
134
133
|
"rollup-plugin-svg": "2.0.0",
|
|
135
134
|
"sass": "1.35.1",
|
|
@@ -6,10 +6,6 @@ import {
|
|
|
6
6
|
Meta,
|
|
7
7
|
Story,
|
|
8
8
|
} from "@storybook/addon-docs";
|
|
9
|
-
import {
|
|
10
|
-
BrowserRouter as Router,
|
|
11
|
-
Link as ReactRouterLink,
|
|
12
|
-
} from "react-router-dom";
|
|
13
9
|
import { withDesign } from "storybook-addon-designs";
|
|
14
10
|
|
|
15
11
|
import Link from "./Link";
|
|
@@ -258,16 +254,6 @@ import DS from "@nypl/design-system-react-components";
|
|
|
258
254
|
</DS.Link>;
|
|
259
255
|
```
|
|
260
256
|
|
|
261
|
-
<Canvas>
|
|
262
|
-
<DSProvider>
|
|
263
|
-
<Router>
|
|
264
|
-
<Link type={LinkTypes.Action}>
|
|
265
|
-
<ReactRouterLink to="#">Next Page</ReactRouterLink>
|
|
266
|
-
</Link>
|
|
267
|
-
</Router>
|
|
268
|
-
</DSProvider>
|
|
269
|
-
</Canvas>
|
|
270
|
-
|
|
271
257
|
### NextJS
|
|
272
258
|
|
|
273
259
|
NextJS's `Link` component should wrap the Design System's `Link` component.
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { render, screen } from "@testing-library/react";
|
|
2
2
|
import { axe } from "jest-axe";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import {
|
|
5
|
-
BrowserRouter as Router,
|
|
6
|
-
Link as ReactRouterLink,
|
|
7
|
-
} from "react-router-dom";
|
|
8
4
|
import renderer from "react-test-renderer";
|
|
9
5
|
|
|
10
6
|
import Link from "./Link";
|
|
@@ -106,24 +102,6 @@ describe("Link", () => {
|
|
|
106
102
|
expect(screen.getByRole("link")).toBeInTheDocument();
|
|
107
103
|
});
|
|
108
104
|
|
|
109
|
-
it("Can pass in a ReactRouter Link", () => {
|
|
110
|
-
render(
|
|
111
|
-
<Router>
|
|
112
|
-
<Link type={LinkTypes.Action}>
|
|
113
|
-
<ReactRouterLink to="#">
|
|
114
|
-
<Icon
|
|
115
|
-
name={IconNames.Download}
|
|
116
|
-
align={IconAlign.Left}
|
|
117
|
-
iconRotation={IconRotationTypes.Rotate0}
|
|
118
|
-
/>
|
|
119
|
-
Download
|
|
120
|
-
</ReactRouterLink>
|
|
121
|
-
</Link>
|
|
122
|
-
</Router>
|
|
123
|
-
);
|
|
124
|
-
expect(screen.getByRole("link")).toBeInTheDocument();
|
|
125
|
-
});
|
|
126
|
-
|
|
127
105
|
it("throws an error if text is passed but no url is passed", () => {
|
|
128
106
|
expect(() => render(<Link>Test</Link>)).toThrowError(
|
|
129
107
|
"`Link` needs the `href` prop."
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ButtonGroup } from "@chakra-ui/react";
|
|
2
2
|
import {
|
|
3
3
|
ArgsTable,
|
|
4
4
|
Canvas,
|
|
@@ -6,22 +6,18 @@ import {
|
|
|
6
6
|
Meta,
|
|
7
7
|
Story,
|
|
8
8
|
} from "@storybook/addon-docs";
|
|
9
|
+
import { useState } from "react";
|
|
9
10
|
|
|
10
|
-
import Modal from "./Modal";
|
|
11
11
|
import Button from "../Button/Button";
|
|
12
|
+
import { ButtonTypes } from "../Button/ButtonTypes";
|
|
13
|
+
import Heading from "../Heading/Heading";
|
|
14
|
+
import Link from "../Link/Link";
|
|
15
|
+
import { ModalTrigger, useModal } from "./Modal";
|
|
12
16
|
import { getCategory } from "../../utils/componentCategories";
|
|
13
17
|
|
|
14
18
|
<Meta
|
|
15
19
|
title={getCategory("Modal")}
|
|
16
20
|
component={Modal}
|
|
17
|
-
argTypes={{
|
|
18
|
-
blockName: { control: false },
|
|
19
|
-
children: { table: { disable: true } },
|
|
20
|
-
className: { control: false },
|
|
21
|
-
id: { control: false },
|
|
22
|
-
modifiers: { control: false },
|
|
23
|
-
open: { description: "Only used in Storybook." },
|
|
24
|
-
}}
|
|
25
21
|
parameters={{
|
|
26
22
|
jest: ["Modal.test.tsx"],
|
|
27
23
|
}}
|
|
@@ -32,164 +28,275 @@ import { getCategory } from "../../utils/componentCategories";
|
|
|
32
28
|
| Component Version | DS Version |
|
|
33
29
|
| ----------------- | ---------- |
|
|
34
30
|
| Added | `0.1.0` |
|
|
35
|
-
| Latest | `0.
|
|
31
|
+
| Latest | `0.27.0` |
|
|
36
32
|
|
|
37
33
|
## Table of Contents
|
|
38
34
|
|
|
39
35
|
- [Overview](#overview)
|
|
40
|
-
- [
|
|
41
|
-
- [
|
|
36
|
+
- [Accessibility](#accessibility)
|
|
37
|
+
- [ModalTrigger](#modaltrigger)
|
|
38
|
+
- [ModalTrigger Component Props](#modaltrigger-component-props)
|
|
39
|
+
- [useModal](#usemodal)
|
|
40
|
+
- [useModal Component Props](#usemodal-component-props)
|
|
41
|
+
- [Content Window Scrolling](#content-window-scrolling)
|
|
42
42
|
|
|
43
43
|
## Overview
|
|
44
44
|
|
|
45
45
|
_Note: This component is going through an accessibility review and is not
|
|
46
46
|
recommended for use until it is updated._
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
## Accessibility
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const closeModal = () => setIsModalOpen(false);
|
|
54
|
-
return (
|
|
55
|
-
<>
|
|
56
|
-
<Button id="1" onClick={openModal}>
|
|
57
|
-
Open Modal
|
|
58
|
-
</Button>
|
|
59
|
-
<p>
|
|
60
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
|
|
61
|
-
tempor incididunt ut labore et dolore magna aliqua. Tempus quam
|
|
62
|
-
pellentesque nec nam. Sit amet purus gravida quis blandit turpis cursus.
|
|
63
|
-
Est ante in nibh mauris. Ut faucibus pulvinar elementum integer. Mattis
|
|
64
|
-
ullamcorper velit sed ullamcorper morbi tincidunt ornare massa.
|
|
65
|
-
Consectetur purus ut faucibus pulvinar elementum integer enim. Accumsan
|
|
66
|
-
sit amet nulla facilisi morbi. Sagittis vitae et leo duis. Elit
|
|
67
|
-
scelerisque mauris pellentesque pulvinar pellentesque. Ullamcorper velit
|
|
68
|
-
sed ullamcorper morbi. Tellus in hac habitasse platea dictumst.
|
|
69
|
-
Fermentum leo vel orci porta non. Pulvinar mattis nunc sed blandit
|
|
70
|
-
libero volutpat sed. Cras semper auctor neque vitae tempus. Turpis
|
|
71
|
-
egestas sed tempus urna et pharetra pharetra massa. Metus aliquam
|
|
72
|
-
eleifend mi in nulla posuere sollicitudin aliquam. Sit amet risus nullam
|
|
73
|
-
eget felis eget nunc. Pharetra et ultrices neque ornare.
|
|
74
|
-
</p>
|
|
75
|
-
<p>
|
|
76
|
-
Pellentesque massa placerat duis ultricies. Viverra suspendisse potenti
|
|
77
|
-
nullam ac tortor vitae purus faucibus ornare. Pulvinar neque laoreet
|
|
78
|
-
suspendisse interdum consectetur libero. Amet mauris commodo quis
|
|
79
|
-
imperdiet massa tincidunt nunc pulvinar sapien. Quisque sagittis purus
|
|
80
|
-
sit amet. Duis ut diam quam nulla porttitor massa id. Quis enim lobortis
|
|
81
|
-
scelerisque fermentum dui faucibus in ornare. At lectus urna duis
|
|
82
|
-
convallis. In mollis nunc sed id semper risus. Dolor sed viverra ipsum
|
|
83
|
-
nunc aliquet bibendum enim facilisis.
|
|
84
|
-
</p>
|
|
85
|
-
{isModalOpen && (
|
|
86
|
-
<Modal>
|
|
87
|
-
<Button id="2" onClick={closeModal}>
|
|
88
|
-
Close Modal
|
|
89
|
-
</Button>
|
|
90
|
-
<p>
|
|
91
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
92
|
-
eiusmod tempor incididunt ut labore et dolore magna aliqua. Tempus
|
|
93
|
-
quam pellentesque nec nam. Sit amet purus gravida quis blandit
|
|
94
|
-
turpis cursus. Est ante in nibh mauris. Ut faucibus pulvinar
|
|
95
|
-
elementum integer. Mattis ullamcorper velit sed ullamcorper morbi
|
|
96
|
-
tincidunt ornare massa. Consectetur purus ut faucibus pulvinar
|
|
97
|
-
elementum integer enim. Accumsan sit amet nulla facilisi morbi.
|
|
98
|
-
Sagittis vitae et leo duis. Elit scelerisque mauris pellentesque
|
|
99
|
-
pulvinar pellentesque. Ullamcorper velit sed ullamcorper morbi.
|
|
100
|
-
Tellus in hac habitasse platea dictumst. Fermentum leo vel orci
|
|
101
|
-
porta non. Pulvinar mattis nunc sed blandit libero volutpat sed.
|
|
102
|
-
Cras semper auctor neque vitae tempus. Turpis egestas sed tempus
|
|
103
|
-
urna et pharetra pharetra massa. Metus aliquam eleifend mi in nulla
|
|
104
|
-
posuere sollicitudin aliquam. Sit amet risus nullam eget felis eget
|
|
105
|
-
nunc. Pharetra et ultrices neque ornare.
|
|
106
|
-
</p>
|
|
107
|
-
<p>
|
|
108
|
-
Pellentesque massa placerat duis ultricies. Viverra suspendisse
|
|
109
|
-
potenti nullam ac tortor vitae purus faucibus ornare. Pulvinar neque
|
|
110
|
-
laoreet suspendisse interdum consectetur libero. Amet mauris commodo
|
|
111
|
-
quis imperdiet massa tincidunt nunc pulvinar sapien. Quisque
|
|
112
|
-
sagittis purus sit amet. Duis ut diam quam nulla porttitor massa id.
|
|
113
|
-
Quis enim lobortis scelerisque fermentum dui faucibus in ornare. At
|
|
114
|
-
lectus urna duis convallis. In mollis nunc sed id semper risus.
|
|
115
|
-
Dolor sed viverra ipsum nunc aliquet bibendum enim facilisis.
|
|
116
|
-
</p>
|
|
117
|
-
<p>
|
|
118
|
-
Eget felis eget nunc lobortis mattis aliquam faucibus. Orci dapibus
|
|
119
|
-
ultrices in iaculis nunc sed. Vel elit scelerisque mauris
|
|
120
|
-
pellentesque pulvinar. Ultrices neque ornare aenean euismod
|
|
121
|
-
elementum nisi. Sollicitudin ac orci phasellus egestas tellus rutrum
|
|
122
|
-
tellus pellentesque. Lorem ipsum dolor sit amet. Tempus imperdiet
|
|
123
|
-
nulla malesuada pellentesque elit eget gravida cum. Pellentesque
|
|
124
|
-
massa placerat duis ultricies lacus sed turpis tincidunt. Donec et
|
|
125
|
-
odio pellentesque diam volutpat. Augue ut lectus arcu bibendum at
|
|
126
|
-
varius vel pharetra vel. Sit amet justo donec enim diam vulputate ut
|
|
127
|
-
pharetra sit. Felis eget nunc lobortis mattis aliquam faucibus.
|
|
128
|
-
Tincidunt praesent semper feugiat nibh sed pulvinar proin. Facilisi
|
|
129
|
-
nullam vehicula ipsum a. Ut sem nulla pharetra diam sit amet nisl
|
|
130
|
-
suscipit adipiscing.
|
|
131
|
-
</p>
|
|
132
|
-
</Modal>
|
|
133
|
-
)}
|
|
134
|
-
</>
|
|
135
|
-
);
|
|
136
|
-
};
|
|
50
|
+
TBD
|
|
51
|
+
|
|
52
|
+
## ModalTrigger
|
|
137
53
|
|
|
138
|
-
|
|
54
|
+
<Description of={ModalTrigger} />
|
|
55
|
+
|
|
56
|
+
```jsx
|
|
57
|
+
import { ModalTrigger } from "@nypl/design-system-react-components";
|
|
58
|
+
|
|
59
|
+
//...
|
|
60
|
+
<ModalTrigger
|
|
61
|
+
buttonText="Button Text"
|
|
62
|
+
id="modal-trigger"
|
|
63
|
+
modalProps={{
|
|
64
|
+
bodyContent="body text"
|
|
65
|
+
closeButtonLabel="Close Button"
|
|
66
|
+
headingText="Modal Heading Text"
|
|
67
|
+
onClose={() => {
|
|
68
|
+
console.log("custom close");
|
|
69
|
+
}}
|
|
70
|
+
}}
|
|
71
|
+
/>;
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## ModalTrigger Component Props
|
|
139
75
|
|
|
140
76
|
<Canvas withToolbar>
|
|
141
77
|
<Story
|
|
142
|
-
name="
|
|
78
|
+
name="ModalTrigger"
|
|
143
79
|
args={{
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
80
|
+
buttonText: "Button Text",
|
|
81
|
+
id: "modal-trigger",
|
|
82
|
+
modalProps: {
|
|
83
|
+
bodyContent: "body text",
|
|
84
|
+
closeButtonLabel: "Close Button",
|
|
85
|
+
headingText: "Modal Heading Text",
|
|
86
|
+
onClose: () => {
|
|
87
|
+
console.log("custom close");
|
|
88
|
+
},
|
|
89
|
+
},
|
|
149
90
|
}}
|
|
150
91
|
>
|
|
151
|
-
{(args) => <
|
|
92
|
+
{(args) => <ModalTrigger {...args} />}
|
|
152
93
|
</Story>
|
|
153
94
|
</Canvas>
|
|
154
95
|
|
|
155
|
-
<ArgsTable story="
|
|
96
|
+
<ArgsTable story="ModalTrigger" />
|
|
97
|
+
|
|
98
|
+
## useModal
|
|
156
99
|
|
|
157
|
-
|
|
100
|
+
<Description of={useModal} />
|
|
158
101
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
the
|
|
162
|
-
|
|
102
|
+
You can retrieve the DS `Modal` component and the `onOpen` and `onClose` function
|
|
103
|
+
handlers when calling the `useModal` function. The `onOpen` function handler is
|
|
104
|
+
used to open the `Modal` React component. This function can be passed to any
|
|
105
|
+
number of elements that use the `onClick` attribute. The `onClose` function can
|
|
106
|
+
be used on any element that uses the `onClick` attribute.
|
|
163
107
|
|
|
164
|
-
|
|
165
|
-
|
|
108
|
+
**NOTE: in this case, the `buttonText` prop is not necessary since you have to
|
|
109
|
+
create and render your own button.**
|
|
166
110
|
|
|
167
|
-
|
|
111
|
+
```jsx
|
|
112
|
+
import { useModal } from "@nypl/design-system-react-components";
|
|
168
113
|
|
|
169
|
-
|
|
170
|
-
export const
|
|
171
|
-
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
114
|
+
// ...
|
|
115
|
+
export const ModalStory = (args) => {
|
|
116
|
+
const { onClose, onOpen, Modal } = useModal();
|
|
117
|
+
const modalProps = {
|
|
118
|
+
bodyContent: (
|
|
119
|
+
<>
|
|
120
|
+
<Button id="custom-close" onClick={onClose}>
|
|
121
|
+
Go back
|
|
122
|
+
</Button>
|
|
123
|
+
<p>This is the body content.</p>
|
|
124
|
+
<Button id="custom-close2" onClick={onClose}>
|
|
125
|
+
This is a custom close button.
|
|
126
|
+
</Button>
|
|
127
|
+
</>
|
|
128
|
+
),
|
|
129
|
+
closeButtonLabel: "Close Button",
|
|
130
|
+
headingText: "Modal Heading Text",
|
|
131
|
+
onClose: () => {
|
|
132
|
+
console.log("custom close");
|
|
133
|
+
onClose();
|
|
134
|
+
},
|
|
135
|
+
};
|
|
176
136
|
return (
|
|
177
137
|
<>
|
|
178
|
-
<
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
)}
|
|
138
|
+
<ButtonGroup>
|
|
139
|
+
<Button id="1" onClick={onOpen}>
|
|
140
|
+
Open Modal
|
|
141
|
+
</Button>
|
|
142
|
+
<Button buttonType={ButtonTypes.Secondary} id="2" onClick={onOpen}>
|
|
143
|
+
I can open the modal, too
|
|
144
|
+
</Button>
|
|
145
|
+
</ButtonGroup>
|
|
146
|
+
<div onClick={onOpen}>
|
|
147
|
+
I'm just a div and shouldn't be used in production but this is just an
|
|
148
|
+
example
|
|
149
|
+
</div>
|
|
150
|
+
<Modal {...modalProps} />
|
|
192
151
|
</>
|
|
193
152
|
);
|
|
194
153
|
};
|
|
195
154
|
```
|
|
155
|
+
|
|
156
|
+
export const ModalStory = (args) => {
|
|
157
|
+
const { onClose, onOpen, Modal } = useModal();
|
|
158
|
+
const modalProps = {
|
|
159
|
+
bodyContent: (
|
|
160
|
+
<>
|
|
161
|
+
<Button id="custom-close" onClick={onClose}>
|
|
162
|
+
Go back
|
|
163
|
+
</Button>
|
|
164
|
+
<p>This is the body content.</p>
|
|
165
|
+
<Button id="custom-close2" onClick={onClose}>
|
|
166
|
+
This is a custom close button.
|
|
167
|
+
</Button>
|
|
168
|
+
</>
|
|
169
|
+
),
|
|
170
|
+
closeButtonLabel: "Close Button",
|
|
171
|
+
headingText: "Modal Heading Text",
|
|
172
|
+
onClose: () => {
|
|
173
|
+
console.log("custom close");
|
|
174
|
+
onClose();
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
return (
|
|
178
|
+
<>
|
|
179
|
+
<ButtonGroup>
|
|
180
|
+
<Button id="1" onClick={onOpen}>
|
|
181
|
+
Open Modal
|
|
182
|
+
</Button>
|
|
183
|
+
<Button buttonType={ButtonTypes.Secondary} id="2" onClick={onOpen}>
|
|
184
|
+
I can open the modal, too
|
|
185
|
+
</Button>
|
|
186
|
+
</ButtonGroup>
|
|
187
|
+
<div onClick={onOpen}>
|
|
188
|
+
I'm just a div and shouldn't be used in production but this is just an
|
|
189
|
+
example
|
|
190
|
+
</div>
|
|
191
|
+
<Modal {...modalProps} />
|
|
192
|
+
</>
|
|
193
|
+
);
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
## useModal Component Props
|
|
197
|
+
|
|
198
|
+
<Canvas withToolbar>
|
|
199
|
+
<Story name="Modal">
|
|
200
|
+
<ModalStory />
|
|
201
|
+
</Story>
|
|
202
|
+
</Canvas>
|
|
203
|
+
|
|
204
|
+
## Content Window Scrolling
|
|
205
|
+
|
|
206
|
+
In either `Modal` pattern, the main content inside the `Modal` component will
|
|
207
|
+
scroll while the `Modal`'s header and footer still stay static. Check the
|
|
208
|
+
example below with a lot of content inside the `Modal`.
|
|
209
|
+
|
|
210
|
+
<Canvas withToolbar>
|
|
211
|
+
<Story
|
|
212
|
+
name="Content Window Scrolling"
|
|
213
|
+
args={{
|
|
214
|
+
buttonText: "Button Text",
|
|
215
|
+
id: "modal-scrolling",
|
|
216
|
+
modalProps: {
|
|
217
|
+
bodyContent: (
|
|
218
|
+
<>
|
|
219
|
+
<Heading text="Content Title" />
|
|
220
|
+
<p>
|
|
221
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
222
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
223
|
+
Pellentesque massa placerat duis ultricies lacus sed turpis
|
|
224
|
+
tincidunt.
|
|
225
|
+
<Link href="http://nypl.org">Porttitor eget dolor</Link> morbi non
|
|
226
|
+
arcu risus quis varius. Faucibus in ornare quam viverra orci sagittis.
|
|
227
|
+
</p>
|
|
228
|
+
<p>
|
|
229
|
+
Nisl vel pretium lectus quam id leo in. Etiam dignissim diam quis
|
|
230
|
+
enim lobortis scelerisque fermentum. Diam maecenas sed enim ut sem
|
|
231
|
+
viverra. Diam quam nulla porttitor massa id neque. Sed faucibus
|
|
232
|
+
turpis in eu mi.
|
|
233
|
+
</p>
|
|
234
|
+
<p>
|
|
235
|
+
Ornare lectus sit amet est placerat in. Quis blandit turpis cursus
|
|
236
|
+
in. Aliquam ut porttitor leo a diam sollicitudin tempor id eu.
|
|
237
|
+
Pellentesque eu tincidunt tortor aliquam nulla facilisi cras
|
|
238
|
+
fermentum. Porttitor leo a diam sollicitudin tempor id eu nisl
|
|
239
|
+
nunc. Feugiat nisl pretium fusce id velit ut tortor. Porttitor leo
|
|
240
|
+
a diam sollicitudin tempor id eu nisl nunc.
|
|
241
|
+
</p>
|
|
242
|
+
<p>
|
|
243
|
+
Mauris nunc congue nisi vitae suscipit tellus mauris a diam. Purus
|
|
244
|
+
gravida quis blandit turpis cursus in hac. Morbi tempus iaculis
|
|
245
|
+
urna id volutpat. Lectus nulla at volutpat diam ut venenatis.
|
|
246
|
+
Donec ac odio tempor orci dapibus ultrices in iaculis. Dui vivamus
|
|
247
|
+
arcu felis bibendum ut tristique. Cras semper auctor neque vitae
|
|
248
|
+
tempus quam pellentesque. Placerat orci nulla pellentesque
|
|
249
|
+
dignissim enim sit amet. Feugiat pretium nibh ipsum consequat.
|
|
250
|
+
Placerat orci nulla pellentesque dignissim. Suspendisse faucibus
|
|
251
|
+
interdum posuere lorem. Nullam non nisi est sit. Turpis egestas
|
|
252
|
+
integer eget aliquet nibh praesent. Tortor at risus 'viverra
|
|
253
|
+
adipiscing at. Eu augue ut lectus arcu bibendum at varius vel'
|
|
254
|
+
pharetra.
|
|
255
|
+
</p>
|
|
256
|
+
<Heading text="Another Title" />
|
|
257
|
+
<p>
|
|
258
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
259
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
260
|
+
Pellentesque massa placerat duis ultricies lacus sed turpis
|
|
261
|
+
tincidunt.
|
|
262
|
+
<Link href="http://nypl.org">Porttitor eget dolor</Link> morbi non
|
|
263
|
+
arcu risus quis varius. Faucibus in ornare quam viverra orci sagittis.
|
|
264
|
+
</p>
|
|
265
|
+
<p>
|
|
266
|
+
Nisl vel pretium lectus quam id leo in. Etiam dignissim diam quis
|
|
267
|
+
enim lobortis scelerisque fermentum. Diam maecenas sed enim ut sem
|
|
268
|
+
viverra. Diam quam nulla porttitor massa id neque. Sed faucibus
|
|
269
|
+
turpis in eu mi.
|
|
270
|
+
</p>
|
|
271
|
+
<p>
|
|
272
|
+
Ornare lectus sit amet est placerat in. Quis blandit turpis cursus
|
|
273
|
+
in. Aliquam ut porttitor leo a diam sollicitudin tempor id eu.
|
|
274
|
+
Pellentesque eu tincidunt tortor aliquam nulla facilisi cras
|
|
275
|
+
fermentum. Porttitor leo a diam sollicitudin tempor id eu nisl
|
|
276
|
+
nunc. Feugiat nisl pretium fusce id velit ut tortor. Porttitor leo
|
|
277
|
+
a diam sollicitudin tempor id eu nisl nunc.
|
|
278
|
+
</p>
|
|
279
|
+
<p>
|
|
280
|
+
Mauris nunc congue nisi vitae suscipit tellus mauris a diam. Purus
|
|
281
|
+
gravida quis blandit turpis cursus in hac. Morbi tempus iaculis
|
|
282
|
+
urna id volutpat. Lectus nulla at volutpat diam ut venenatis.
|
|
283
|
+
Donec ac odio tempor orci dapibus ultrices in iaculis. Dui vivamus
|
|
284
|
+
arcu felis bibendum ut tristique. Cras semper auctor neque vitae
|
|
285
|
+
tempus quam pellentesque. Placerat orci nulla pellentesque
|
|
286
|
+
dignissim enim sit amet. Feugiat pretium nibh ipsum consequat.
|
|
287
|
+
Placerat orci nulla pellentesque dignissim. Suspendisse faucibus
|
|
288
|
+
interdum posuere lorem. Nullam non nisi est sit. Turpis egestas
|
|
289
|
+
integer eget aliquet nibh praesent. Tortor at risus 'viverra
|
|
290
|
+
adipiscing at. Eu augue ut lectus arcu bibendum at varius vel'
|
|
291
|
+
pharetra.
|
|
292
|
+
</p>
|
|
293
|
+
</>
|
|
294
|
+
),
|
|
295
|
+
closeButtonLabel: "Close Button",
|
|
296
|
+
headingText: "Modal Heading Text",
|
|
297
|
+
},
|
|
298
|
+
}}
|
|
299
|
+
>
|
|
300
|
+
{(args) => <ModalTrigger {...args} />}
|
|
301
|
+
</Story>
|
|
302
|
+
</Canvas>
|