@transferwise/components 40.11.7-beta-1a3d6dafef.6 → 40.12.2
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 +37 -0
- package/build/es/no-polyfill/checkboxOption/CheckboxOption.js +1 -1
- package/build/es/no-polyfill/common/historyNavigator/historyNavigator.js +1 -1
- package/build/es/no-polyfill/common/textFormat/formatWithPattern/formatWithPattern.js +1 -1
- package/build/es/no-polyfill/index.js +1 -1
- package/build/es/no-polyfill/radioOption/RadioOption.js +1 -1
- package/build/es/no-polyfill/select/Select.js +1 -1
- package/build/es/no-polyfill/select/option/Option.js +2 -1
- package/build/es/polyfill/accordion/Accordion.js +1 -1
- package/build/es/polyfill/actionButton/ActionButton.js +1 -1
- package/build/es/polyfill/actionButton/ActionButton.spec.js +1 -1
- package/build/es/polyfill/actionOption/ActionOption.js +1 -1
- package/build/es/polyfill/alert/Alert.js +1 -1
- package/build/es/polyfill/alert/inlineMarkdown/InlineMarkdown.js +1 -1
- package/build/es/polyfill/alert/withArrow/withArrow.js +1 -1
- package/build/es/polyfill/avatarWrapper/AvatarWrapper.js +1 -1
- package/build/es/polyfill/button/Button.js +1 -1
- package/build/es/polyfill/checkboxButton/CheckboxButton.js +1 -1
- package/build/es/polyfill/checkboxOption/CheckboxOption.js +1 -1
- package/build/es/polyfill/chips/Chip.js +1 -1
- package/build/es/polyfill/chips/Chips.js +1 -1
- package/build/es/polyfill/chips/Chips.spec.js +1 -1
- package/build/es/polyfill/chips/Chips.story.js +1 -1
- package/build/es/polyfill/circularButton/CircularButton.js +1 -1
- package/build/es/polyfill/common/Option/Option.js +1 -1
- package/build/es/polyfill/common/fakeEvents.js +1 -1
- package/build/es/polyfill/common/focusBoundary/utils/getFocusableElements.js +1 -1
- package/build/es/polyfill/common/historyNavigator/historyNavigator.js +1 -1
- package/build/es/polyfill/common/hocs/theme/withTheme.js +1 -1
- package/build/es/polyfill/common/hooks/useHasIntersected/useHasIntersected.js +1 -1
- package/build/es/polyfill/common/panel/Panel.js +1 -1
- package/build/es/polyfill/common/requirements.js +1 -1
- package/build/es/polyfill/common/textFormat/formatWithPattern/formatWithPattern.js +1 -1
- package/build/es/polyfill/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js +1 -1
- package/build/es/polyfill/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js +1 -1
- package/build/es/polyfill/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js +1 -1
- package/build/es/polyfill/dateLookup/DateLookup.js +1 -1
- package/build/es/polyfill/dateLookup/dayCalendar/DayCalendar.js +1 -1
- package/build/es/polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +1 -1
- package/build/es/polyfill/dateLookup/monthCalendar/MonthCalendar.js +1 -1
- package/build/es/polyfill/dateLookup/tableLink/TableLink.js +1 -1
- package/build/es/polyfill/dateLookup/yearCalendar/YearCalendar.js +1 -1
- package/build/es/polyfill/decision/Decision.js +1 -1
- package/build/es/polyfill/definitionList/DefinitionList.js +1 -1
- package/build/es/polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +1 -1
- package/build/es/polyfill/dynamicFieldDefinitionList/utils/createDefinitions.js +1 -1
- package/build/es/polyfill/emphasis/EmphasisHtmlTransformer.js +1 -1
- package/build/es/polyfill/flowNavigation/FlowNavigation.js +1 -1
- package/build/es/polyfill/header/Header.js +1 -1
- package/build/es/polyfill/index.js +1 -1
- package/build/es/polyfill/info/Info.js +1 -1
- package/build/es/polyfill/inlineAlert/InlineAlert.js +1 -1
- package/build/es/polyfill/inputWithDisplayFormat/InputWithDisplayFormat.js +1 -1
- package/build/es/polyfill/lab/mobileNav/utils/isIpadOsSafari/isIpadOsSafari.js +1 -1
- package/build/es/polyfill/lab/mobileNav/utils/isMobileSafari/isMobileSafari.js +1 -1
- package/build/es/polyfill/link/Link.spec.js +1 -1
- package/build/es/polyfill/modal/Modal.js +1 -1
- package/build/es/polyfill/modal/Modal.story.js +1 -1
- package/build/es/polyfill/moneyInput/MoneyInput.js +1 -1
- package/build/es/polyfill/moneyInput/currencyFormatting.js +1 -1
- package/build/es/polyfill/navigationOption/NavigationOption.js +1 -1
- package/build/es/polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/filterOptionsForQuery/index.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/isStringNumeric/isStringNumeric.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/longestMatchingPrefix/index.js +1 -1
- package/build/es/polyfill/processIndicator/ProcessIndicator.js +1 -1
- package/build/es/polyfill/progress/Progress.js +1 -1
- package/build/es/polyfill/provider/Provider.js +1 -1
- package/build/es/polyfill/provider/Provider.story.js +1 -1
- package/build/es/polyfill/provider/theme/ThemeProvider.js +1 -1
- package/build/es/polyfill/radio/Radio.js +1 -1
- package/build/es/polyfill/radioGroup/RadioGroup.js +1 -1
- package/build/es/polyfill/radioOption/RadioOption.js +1 -1
- package/build/es/polyfill/select/Select.js +2 -2
- package/build/es/polyfill/select/option/Option.js +2 -1
- package/build/es/polyfill/sizeSwapper/SizeSwapper.js +1 -1
- package/build/es/polyfill/slidingPanel/SlidingPanel.js +1 -1
- package/build/es/polyfill/snackbar/Snackbar.js +1 -1
- package/build/es/polyfill/snackbar/SnackbarProvider.js +1 -1
- package/build/es/polyfill/switchOption/SwitchOption.js +1 -1
- package/build/es/polyfill/tabs/Tabs.js +1 -1
- package/build/es/polyfill/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +1 -1
- package/build/es/polyfill/tooltip/Tooltip.js +1 -1
- package/build/es/polyfill/typeahead/Typeahead.js +1 -1
- package/build/es/polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
- package/build/es/polyfill/upload/Upload.js +1 -1
- package/build/es/polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
- package/build/es/polyfill/upload/utils/getSupportedSpotMimeTypes/getSupportedSpotMimeTypes.js +1 -1
- package/build/es/polyfill/upload/utils/isTypeValid/isTypeValid.js +1 -1
- package/build/es/polyfill/uploadInput/UploadInput.spec.js +1 -1
- package/build/es/polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
- package/build/es/polyfill/uploadInput/uploadButton/UploadButton.spec.js +1 -1
- package/build/es/polyfill/uploadInput/uploadButton/getAllowedFileTypes.js +1 -1
- package/build/es/polyfill/uploadInput/uploadItem/UploadItem.spec.js +1 -1
- package/build/es/polyfill/withDisplayFormat/WithDisplayFormat.js +1 -1
- package/build/es/polyfill/withNextPortal/withNextPortal.js +1 -1
- package/build/es/polyfill/withNormaliser/WithNormalizer.js +1 -1
- package/build/es/polyfill/withNormaliser/validation/event-utilities/index.js +1 -1
- package/build/main.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/styles/select/Select.css +1 -1
- package/build/types/index.d.ts +0 -2
- package/build/umd/no-polyfill/main.js +1 -1
- package/build/umd/polyfill/main.js +1 -1
- package/package.json +5 -15
- package/build/es/no-polyfill/container/Container.js +0 -13
- package/build/es/no-polyfill/container/Container.spec.js +0 -3
- package/build/es/no-polyfill/container/Container.story.js +0 -2
- package/build/es/no-polyfill/container/index.js +0 -1
- package/build/es/no-polyfill/grid/Grid.js +0 -25
- package/build/es/no-polyfill/grid/Grid.spec.js +0 -9
- package/build/es/no-polyfill/grid/Grid.story.js +0 -2
- package/build/es/no-polyfill/grid/index.js +0 -1
- package/build/es/polyfill/container/Container.js +0 -13
- package/build/es/polyfill/container/Container.spec.js +0 -3
- package/build/es/polyfill/container/Container.story.js +0 -2
- package/build/es/polyfill/container/index.js +0 -1
- package/build/es/polyfill/grid/Grid.js +0 -25
- package/build/es/polyfill/grid/Grid.spec.js +0 -9
- package/build/es/polyfill/grid/Grid.story.js +0 -2
- package/build/es/polyfill/grid/index.js +0 -1
- package/build/styles/container/Container.css +0 -1
- package/build/styles/grid/Grid.css +0 -1
- package/build/types/container/Container.d.ts +0 -29
- package/build/types/container/Container.spec.d.ts +0 -1
- package/build/types/container/Container.story.d.ts +0 -11
- package/build/types/container/index.d.ts +0 -1
- package/build/types/grid/Grid.d.ts +0 -93
- package/build/types/grid/Grid.spec.d.ts +0 -1
- package/build/types/grid/Grid.story.d.ts +0 -22
- package/build/types/grid/index.d.ts +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "40.
|
|
3
|
+
"version": "40.12.2",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/umd/polyfill/main.js",
|
|
@@ -50,11 +50,6 @@
|
|
|
50
50
|
"neptune-upgrade-util": "scripts/neptune-upgrader.js"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@babel/cli": "^7.14.8",
|
|
54
|
-
"@babel/core": "7.15.0",
|
|
55
|
-
"@babel/plugin-transform-runtime": "^7.14.5",
|
|
56
|
-
"@babel/preset-env": "^7.15.0",
|
|
57
|
-
"@babel/preset-react": "^7.14.5",
|
|
58
53
|
"@formatjs/cli": "^4.8.3",
|
|
59
54
|
"@percy/cli": "^1.1.0",
|
|
60
55
|
"@percy/storybook": "^4.2.0",
|
|
@@ -64,19 +59,14 @@
|
|
|
64
59
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
65
60
|
"@transferwise/icons": "^2.12.0",
|
|
66
61
|
"@transferwise/less-config": "^3.0.4",
|
|
67
|
-
"@transferwise/neptune-css": "^12.5.
|
|
62
|
+
"@transferwise/neptune-css": "^12.5.3",
|
|
68
63
|
"@transferwise/neptune-tokens": "7.0.0",
|
|
69
64
|
"@transferwise/test-config": "^5.0.0",
|
|
70
65
|
"@types/jest": "^26.0.20",
|
|
71
|
-
"@types/jest-axe": "^3.5.3",
|
|
72
66
|
"@types/jscodeshift": "^0.11.0",
|
|
73
67
|
"@types/node": "^14.14.31",
|
|
74
68
|
"@types/react-transition-group": "4.4.4",
|
|
75
|
-
"babel-loader": "^8.1.0",
|
|
76
|
-
"babel-plugin-react-intl": "^8.2.16",
|
|
77
|
-
"babel-preset-minify": "^0.5.1",
|
|
78
69
|
"html-loader": "^1.3.2",
|
|
79
|
-
"jest-axe": "^4.1.0",
|
|
80
70
|
"lodash.times": "^4.3.2",
|
|
81
71
|
"npm-watch": "^0.11.0",
|
|
82
72
|
"react-intl": "^5.10.0",
|
|
@@ -93,11 +83,11 @@
|
|
|
93
83
|
"react-intl": "^5.10.0 || ^6"
|
|
94
84
|
},
|
|
95
85
|
"dependencies": {
|
|
96
|
-
"@babel/runtime": "^7.
|
|
86
|
+
"@babel/runtime": "^7.18.3",
|
|
97
87
|
"@formatjs/intl-locale": "^2.4.14",
|
|
98
88
|
"@popperjs/core": "^2.6.0",
|
|
99
89
|
"@transferwise/formatting": "^2.1.0",
|
|
100
|
-
"@transferwise/neptune-validation": "^3.0.
|
|
90
|
+
"@transferwise/neptune-validation": "^3.0.5",
|
|
101
91
|
"@types/react-transition-group": "4.4.4",
|
|
102
92
|
"classnames": "^2.2.6",
|
|
103
93
|
"commonmark": "0.29.1",
|
|
@@ -118,5 +108,5 @@
|
|
|
118
108
|
"watch": {
|
|
119
109
|
"build:crowdin-source-file": "src/**/*.messages.js"
|
|
120
110
|
},
|
|
121
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "5d8abc8d96b28854b9d6a2d8edfeb53c6e2812d1"
|
|
122
112
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["children","as","isFullWidth","testId"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import React from"react";import{jsx as _jsx}from"react/jsx-runtime";/**
|
|
2
|
-
* Use `Container` as the root component of the Neptune design system.
|
|
3
|
-
*
|
|
4
|
-
* @component
|
|
5
|
-
* @example
|
|
6
|
-
* const asSection = 'section'
|
|
7
|
-
* const isFullWidth = true
|
|
8
|
-
* return (
|
|
9
|
-
* <Container as={asSection} isFullWidth={isFullWidth}>
|
|
10
|
-
* <div>Hello World!</div>
|
|
11
|
-
* </Container>
|
|
12
|
-
* )
|
|
13
|
-
*/var Container=function(a){var b=a.children,c=a.as,d=void 0===c?"div":c,e=a.isFullWidth,f=a.testId,g=_objectWithoutProperties(a,_excluded),h=classNames({"np-container":!0,"np-container--fullWidth":!!e});return/*#__PURE__*/_jsx(d,_objectSpread(_objectSpread(_objectSpread({},{className:h,"data-testid":f}),g),{},{children:b}))};export default Container;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _defineProperty from"@babel/runtime/helpers/defineProperty";import _regeneratorRuntime from"@babel/runtime/regenerator";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{axe,toHaveNoViolations}from"jest-axe";import React from"react";import{renderToString}from"react-dom/server";import{render,screen}from"../test-utils";import Container from".";import{jsx as _jsx}from"react/jsx-runtime";describe("<Container />",function(){var a={children:"Hello World!",testId:"test-container"};it(": matches snapshot",function(){var b=render(/*#__PURE__*/_jsx(Container,_objectSpread({},a))),c=b.container;expect(c.firstChild).toMatchSnapshot()}),it(": matches snapshot as an `<main>` element",function(){var b=_objectSpread(_objectSpread({},a),{},{as:"main"}),c=render(/*#__PURE__*/_jsx(Container,_objectSpread({},b))),d=c.container;expect(d.firstChild).toMatchSnapshot()}),it(": renders",function(){var b=_objectSpread(_objectSpread({},a),{},{children:"Hello World! Hello World!"}),c=render(/*#__PURE__*/_jsx(Container,_objectSpread({},a))),d=c.rerender;// Change props
|
|
2
|
-
expect(screen.getByTestId("test-container")).toBeInTheDocument(),expect(screen.getByTestId("test-container")).toHaveClass("np-container"),d(/*#__PURE__*/_jsx(Container,_objectSpread({},b))),expect(screen.getByText("Hello World! Hello World!")).toBeInTheDocument()})}),describe("<Container /> Server-side rendering>",function(){it(": renders on a server wtesthout crashing",function(){expect(function renderOnServer(){return renderToString(/*#__PURE__*/_jsx("main",{children:/*#__PURE__*/_jsx(Container,{children:"Text"})}))}).not.toThrow()}),it(": renders with the class attribute",function(){// eslint-disable-next-line testing-library/render-result-naming-convention
|
|
3
|
-
var a=renderToString(/*#__PURE__*/_jsx(Container,{children:"Text"}));expect(a).toContain("class=\"np-container\"")})}),expect.extend(toHaveNoViolations),describe("<Container /> a11y testing",function(){var a={children:"text",testId:"test-container"};it(": should not have basic accessibility issues",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function b(){var c,d,e;return _regeneratorRuntime.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return c=render(/*#__PURE__*/_jsx(Container,_objectSpread({},a))),d=c.container,b.next=3,axe(d);case 3:e=b.sent,expect(e).toHaveNoViolations();case 5:case"end":return b.stop();}},b)})))});
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import Container from"./Container";import{jsx as _jsx}from"react/jsx-runtime";export default{component:Container,title:"Container"};var boxStyle={color:"#333",display:"flex",background:"rgba(255, 105, 180, .5)",width:"100%",outline:"1px dashed rgba(255, 105, 180, .8)",outlineOffset:"-1px",padding:"24px"},Box=function(a){var b=a.children;return/*#__PURE__*/_jsx("div",{style:boxStyle,children:b})};// eslint-disable-next-line react/forbid-dom-props
|
|
2
|
-
export var Default=function(a){return/*#__PURE__*/_jsx(Container,_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx(Box,{})}))};export var FullWidth=function(a){return/*#__PURE__*/_jsx(Container,_objectSpread(_objectSpread({},a),{},{isFullWidth:!0,children:/*#__PURE__*/_jsx(Box,{})}))};export var Tag=function(a){return/*#__PURE__*/_jsx(Container,_objectSpread(_objectSpread({},a),{},{as:"main",children:/*#__PURE__*/_jsx(Box,{})}))};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./Container";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["align","children","className","id","noGutter","testId"],_excluded2=["align","children","className","span","spanXs","spanSm","spanMd","spanLg","spanXl","offset","offsetXs","offsetSm","offsetMd","offsetLg","offsetXl","testId"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}/* eslint-disable @typescript-eslint/restrict-template-expressions */import classNames from"classnames";import React,{useEffect}from"react";import{jsx as _jsx}from"react/jsx-runtime";/**
|
|
2
|
-
* Grid component.
|
|
3
|
-
*
|
|
4
|
-
* @component
|
|
5
|
-
* @example
|
|
6
|
-
* const align = 'center'
|
|
7
|
-
* const equalHeight = true
|
|
8
|
-
* return (
|
|
9
|
-
* <Grid align={align} equalHeight={equalHeight}>
|
|
10
|
-
* <div>...</div>
|
|
11
|
-
* <div>...</div>
|
|
12
|
-
* </Grid>
|
|
13
|
-
* )
|
|
14
|
-
*/var Grid=function(a){var b=a.align,c=a.children,d=a.className,e=a.id,f=a.noGutter,g=a.testId,h=_objectWithoutProperties(a,_excluded);useEffect(function(){React.Children.map(c,function(a){a&&a.type!==GridCol&&console.warn("Illegal child passed to <Grid />. Ensure to only use <Grid.Col />.")})},[c]);var i=classNames(_defineProperty({"np-grid":!0,"np-grid--alignLeft":"left"===b,"np-grid--alignRight":"right"===b,"np-grid--alignCenter":"center"===b,"np-grid--alignMiddle":"middle"===b,"np-grid--noGutter":!!f},"".concat(d),d));return/*#__PURE__*/_jsx("div",_objectSpread(_objectSpread(_objectSpread({},{className:i,"data-testid":g,id:e}),h),{},{children:c}))},GridCol=function(a){var b,c=a.align,d=a.children,e=a.className,f=a.span,g=a.spanXs,h=a.spanSm,i=a.spanMd,j=a.spanLg,k=a.spanXl,l=a.offset,m=a.offsetXs,n=a.offsetSm,o=a.offsetMd,p=a.offsetLg,q=a.offsetXl,r=a.testId,s=_objectWithoutProperties(a,_excluded2),t=classNames((b={"np-grid-col":!0},_defineProperty(b,"np-grid-col--".concat(f),"undefined"!=typeof f),_defineProperty(b,"np-xs-grid-col--".concat(g),"undefined"!=typeof g),_defineProperty(b,"np-sm-grid-col--".concat(h),"undefined"!=typeof h),_defineProperty(b,"np-md-grid-col--".concat(i),"undefined"!=typeof i),_defineProperty(b,"np-lg-grid-col--".concat(j),"undefined"!=typeof j),_defineProperty(b,"np-xl-grid-col--".concat(k),"undefined"!=typeof k),_defineProperty(b,"np-grid-col--offset-".concat(l),"undefined"!=typeof l),_defineProperty(b,"np-xs-grid-col--offset-".concat(m),"undefined"!=typeof m),_defineProperty(b,"np-sm-grid-col--offset-".concat(n),"undefined"!=typeof n),_defineProperty(b,"np-md-grid-col--offset-".concat(o),"undefined"!=typeof o),_defineProperty(b,"np-lg-grid-col--offset-".concat(p),"undefined"!=typeof p),_defineProperty(b,"np-xl-grid-col--offset-".concat(q),"undefined"!=typeof q),_defineProperty(b,"np-grid-col--alignLeft","left"===c),_defineProperty(b,"np-grid-col--alignRight","right"===c),_defineProperty(b,"np-grid-col--alignCenter","center"===c),_defineProperty(b,"np-grid-col--alignMiddle","middle"===c),_defineProperty(b,"".concat(e),e),b));return/*#__PURE__*/_jsx("div",_objectSpread(_objectSpread(_objectSpread({},{className:t,"data-testid":r}),s),{},{children:d}))};/**
|
|
15
|
-
* Grid column component.
|
|
16
|
-
*
|
|
17
|
-
* @component
|
|
18
|
-
* @example
|
|
19
|
-
* return (
|
|
20
|
-
* <Grid>
|
|
21
|
-
* <Grid.Col>...</Grid.Col>
|
|
22
|
-
* <Grid.Col>...</Grid.Col>
|
|
23
|
-
* </Grid>
|
|
24
|
-
* )
|
|
25
|
-
*/GridCol.displayName="Grid.Col",Grid.Col=GridCol;export default Grid;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _defineProperty from"@babel/runtime/helpers/defineProperty";import _regeneratorRuntime from"@babel/runtime/regenerator";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}/* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-call */import{render,screen}from"@testing-library/react";import{axe,toHaveNoViolations}from"jest-axe";import{renderToString}from"react-dom/server";import Grid from".";import{jsx as _jsx}from"react/jsx-runtime";describe("<Grid />",function(){var a={children:/*#__PURE__*/_jsx(Grid.Col,{}),testId:"test-grid"};it(": matches snapshot",function(){var b=render(/*#__PURE__*/_jsx(Grid,_objectSpread({},a))),c=b.container;// eslint-disable-next-line testing-library/no-node-access
|
|
2
|
-
expect(c.firstChild).toMatchSnapshot()}),it(": renders",function(){var b=_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx(Grid.Col,{children:"Column"})}),c=render(/*#__PURE__*/_jsx(Grid,_objectSpread({},a))),d=c.rerender;// Change props
|
|
3
|
-
expect(screen.getByTestId("test-grid")).toBeInTheDocument(),expect(screen.getByTestId("test-grid")).toHaveClass("np-grid"),d(/*#__PURE__*/_jsx(Grid,_objectSpread({},b))),expect(screen.getByText("Column")).toBeInTheDocument(),expect(screen.queryByText("Column")).toHaveClass("np-grid-col"),expect(screen.getByText("Column").parentElement).toHaveClass("np-grid")}),it(": renders with various spans",function(){var b=_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanMd:4,spanLg:3,children:"Column"})}),c=render(/*#__PURE__*/_jsx(Grid,_objectSpread({},a))),d=c.rerender;// Change props
|
|
4
|
-
expect(screen.getByTestId("test-grid")).toBeInTheDocument(),expect(screen.getByTestId("test-grid")).toHaveClass("np-grid"),d(/*#__PURE__*/_jsx(Grid,_objectSpread({},b))),expect(screen.getByText("Column")).toBeInTheDocument(),expect(screen.queryByText("Column")).toHaveClass("np-grid-col"),expect(screen.queryByText("Column")).toHaveClass("np-grid-col--12"),expect(screen.queryByText("Column")).toHaveClass("np-sm-grid-col--6"),expect(screen.queryByText("Column")).toHaveClass("np-md-grid-col--4"),expect(screen.queryByText("Column")).toHaveClass("np-lg-grid-col--3")}),it(": is set with class by the `className` prop",function(){var b=_objectSpread(_objectSpread({},a),{},{className:"np-grid--modifier"}),c=render(/*#__PURE__*/_jsx(Grid,_objectSpread({},a))),d=c.rerender;// Change props
|
|
5
|
-
expect(screen.getByTestId("test-grid")).not.toHaveClass("np-grid--modifier"),d(/*#__PURE__*/_jsx(Grid,_objectSpread({},b))),expect(screen.getByTestId("test-grid")).toHaveClass("np-grid--modifier")}),it(": renders with modifier classes",function(){var b=_objectSpread(_objectSpread({},a),{},{// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
6
|
-
align:"center",noGutter:!0,children:/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanMd:4,spanLg:3,children:"Column"})}),c=render(/*#__PURE__*/_jsx(Grid,_objectSpread({},a))),d=c.rerender;// Change props
|
|
7
|
-
expect(screen.getByTestId("test-grid")).toBeInTheDocument(),expect(screen.getByTestId("test-grid")).toHaveClass("np-grid"),d(/*#__PURE__*/_jsx(Grid,_objectSpread({},b))),expect(screen.getByTestId("test-grid")).toHaveClass("np-grid--alignCenter"),expect(screen.getByTestId("test-grid")).toHaveClass("np-grid--noGutter")}),it(": renders with column modifier classes",function(){var b=_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx(Grid.Col,{align:"center",span:12,spanSm:6,spanMd:4,spanLg:3,children:"Column"})}),c=render(/*#__PURE__*/_jsx(Grid,_objectSpread({},a))),d=c.rerender;// Change props
|
|
8
|
-
expect(screen.getByTestId("test-grid")).toBeInTheDocument(),expect(screen.getByTestId("test-grid")).toHaveClass("np-grid"),d(/*#__PURE__*/_jsx(Grid,_objectSpread({},b))),expect(screen.getByText("Column")).toBeInTheDocument(),expect(screen.queryByText("Column")).toHaveClass("np-grid-col--alignCenter")})}),describe("<Grid /> Server-side rendering>",function(){var a={children:/*#__PURE__*/_jsx(Grid.Col,{}),testId:"test-grid"};it(": renders on a server wtesthout crashing",function(){expect(function renderOnServer(){return renderToString(/*#__PURE__*/_jsx("main",{children:/*#__PURE__*/_jsx(Grid,_objectSpread({},a))}))}).not.toThrow()}),it(": renders with the class attribute",function(){// eslint-disable-next-line testing-library/render-result-naming-convention
|
|
9
|
-
var b=renderToString(/*#__PURE__*/_jsx(Grid,_objectSpread({},a)));expect(b).toContain("class=\"np-grid\"")})}),expect.extend(toHaveNoViolations),describe("<Grid /> a11y testing",function(){var a={children:/*#__PURE__*/_jsx(Grid.Col,{}),testId:"test-grid"};it(": should not have basic accessibility issues",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function b(){var c,d,e;return _regeneratorRuntime.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return c=render(/*#__PURE__*/_jsx(Grid,_objectSpread({},a))),d=c.container,b.next=3,axe(d);case 3:e=b.sent,expect(e).toHaveNoViolations();case 5:case"end":return b.stop();}},b)})))});
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import Grid from"./Grid";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:Grid,title:"Grid"};var boxStyle={color:"#333",display:"flex",background:"rgba(255, 105, 180, .5)",width:"100%",outline:"1px dashed rgba(255, 105, 180, .8)",outlineOffset:"-1px",padding:"24px"},Box=function(a){var b=a.children;return/*#__PURE__*/_jsx("div",{style:boxStyle,children:b})};// eslint-disable-next-line react/forbid-dom-props
|
|
2
|
-
export var Default=function(a){return/*#__PURE__*/_jsxs(Grid,_objectSpread(_objectSpread({},a),{},{children:[/*#__PURE__*/_jsx(Grid.Col,{children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{children:/*#__PURE__*/_jsx(Box,{})})]}))};export var Responsive=function(a){return/*#__PURE__*/_jsxs(Grid,_objectSpread(_objectSpread({},a),{},{children:[/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanLg:3,children:/*#__PURE__*/_jsx(Box,{children:"Span 3"})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanLg:3,children:/*#__PURE__*/_jsx(Box,{children:"Span 3"})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanLg:3,children:/*#__PURE__*/_jsx(Box,{children:"Span 3"})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanLg:3,children:/*#__PURE__*/_jsx(Box,{children:"Span 3"})})]}))};export var NoGutter=function(a){return/*#__PURE__*/_jsxs(Grid,_objectSpread(_objectSpread({},a),{},{noGutter:!0,children:[/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanLg:3,children:/*#__PURE__*/_jsx(Box,{children:"Span 3"})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanLg:3,children:/*#__PURE__*/_jsx(Box,{children:"Span 3"})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanLg:3,children:/*#__PURE__*/_jsx(Box,{children:"Span 3"})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanLg:3,children:/*#__PURE__*/_jsx(Box,{children:"Span 3"})})]}))};export var Offset=function(a){return/*#__PURE__*/_jsxs(Grid,_objectSpread(_objectSpread({},a),{},{children:[/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:1,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,offset:0,spanMd:2,offsetMd:9,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:2,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:8,offset:0,offsetMd:2,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:4,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:6,offset:0,offsetMd:2,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:6,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:4,offset:0,offsetMd:2,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:8,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:2,offset:0,offsetMd:2,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:1,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:9,offset:0,offsetMd:2,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:9,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:1,offset:0,offsetMd:2,children:/*#__PURE__*/_jsx(Box,{})})]}))};export var AlignLeft=function(a){return/*#__PURE__*/_jsxs(Grid,_objectSpread(_objectSpread({align:"left"},a),{},{children:[/*#__PURE__*/_jsx(Grid.Col,{span:3,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:3,children:/*#__PURE__*/_jsx(Box,{})})]}))};export var AlignRight=function(a){return/*#__PURE__*/_jsxs(Grid,_objectSpread(_objectSpread({align:"right"},a),{},{children:[/*#__PURE__*/_jsx(Grid.Col,{span:3,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:3,children:/*#__PURE__*/_jsx(Box,{})})]}))};export var AlignCenter=function(a){return/*#__PURE__*/_jsxs(Grid,_objectSpread(_objectSpread({align:"center"},a),{},{children:[/*#__PURE__*/_jsx(Grid.Col,{span:3,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:3,children:/*#__PURE__*/_jsx(Box,{})})]}))};export var AlignMiddle=function(a){return/*#__PURE__*/_jsxs(Grid,_objectSpread(_objectSpread({align:"middle"},a),{},{children:[/*#__PURE__*/_jsx(Grid.Col,{span:3,children:/*#__PURE__*/_jsx(Box,{children:/*#__PURE__*/_jsx("p",{children:"Lorem ipsum dolor, sit amet consectetur adipisicing elit. Consequuntur tempore numquam quo doloremque tempora hic nam, explicabo voluptatem consectetur assumenda iure culpa perspiciatis ipsa sit."})})}),/*#__PURE__*/_jsx(Grid.Col,{span:3,children:/*#__PURE__*/_jsx(Box,{children:/*#__PURE__*/_jsx("p",{children:"Lorem ipsum dolor sit amet consectetur adipisicing elit. Veritatis, aliquam."})})})]}))};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./Grid";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["children","as","isFullWidth","testId"];import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import React from"react";import{jsx as _jsx}from"react/jsx-runtime";/**
|
|
2
|
-
* Use `Container` as the root component of the Neptune design system.
|
|
3
|
-
*
|
|
4
|
-
* @component
|
|
5
|
-
* @example
|
|
6
|
-
* const asSection = 'section'
|
|
7
|
-
* const isFullWidth = true
|
|
8
|
-
* return (
|
|
9
|
-
* <Container as={asSection} isFullWidth={isFullWidth}>
|
|
10
|
-
* <div>Hello World!</div>
|
|
11
|
-
* </Container>
|
|
12
|
-
* )
|
|
13
|
-
*/var Container=function(a){var b=a.children,c=a.as,d=void 0===c?"div":c,e=a.isFullWidth,f=a.testId,g=_objectWithoutProperties(a,_excluded),h=classNames({"np-container":!0,"np-container--fullWidth":!!e});return/*#__PURE__*/_jsx(d,_objectSpread(_objectSpread(_objectSpread({},{className:h,"data-testid":f}),g),{},{children:b}))};export default Container;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import _regeneratorRuntime from"@babel/runtime/regenerator";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{axe,toHaveNoViolations}from"jest-axe";import React from"react";import{renderToString}from"react-dom/server";import{render,screen}from"../test-utils";import Container from".";import{jsx as _jsx}from"react/jsx-runtime";describe("<Container />",function(){var a={children:"Hello World!",testId:"test-container"};it(": matches snapshot",function(){var b=render(/*#__PURE__*/_jsx(Container,_objectSpread({},a))),c=b.container;expect(c.firstChild).toMatchSnapshot()}),it(": matches snapshot as an `<main>` element",function(){var b=_objectSpread(_objectSpread({},a),{},{as:"main"}),c=render(/*#__PURE__*/_jsx(Container,_objectSpread({},b))),d=c.container;expect(d.firstChild).toMatchSnapshot()}),it(": renders",function(){var b=_objectSpread(_objectSpread({},a),{},{children:"Hello World! Hello World!"}),c=render(/*#__PURE__*/_jsx(Container,_objectSpread({},a))),d=c.rerender;// Change props
|
|
2
|
-
expect(screen.getByTestId("test-container")).toBeInTheDocument(),expect(screen.getByTestId("test-container")).toHaveClass("np-container"),d(/*#__PURE__*/_jsx(Container,_objectSpread({},b))),expect(screen.getByText("Hello World! Hello World!")).toBeInTheDocument()})}),describe("<Container /> Server-side rendering>",function(){it(": renders on a server wtesthout crashing",function(){expect(function renderOnServer(){return renderToString(/*#__PURE__*/_jsx("main",{children:/*#__PURE__*/_jsx(Container,{children:"Text"})}))}).not.toThrow()}),it(": renders with the class attribute",function(){// eslint-disable-next-line testing-library/render-result-naming-convention
|
|
3
|
-
var a=renderToString(/*#__PURE__*/_jsx(Container,{children:"Text"}));expect(a).toContain("class=\"np-container\"")})}),expect.extend(toHaveNoViolations),describe("<Container /> a11y testing",function(){var a={children:"text",testId:"test-container"};it(": should not have basic accessibility issues",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function b(){var c,d,e;return _regeneratorRuntime.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return c=render(/*#__PURE__*/_jsx(Container,_objectSpread({},a))),d=c.container,b.next=3,axe(d);case 3:e=b.sent,expect(e).toHaveNoViolations();case 5:case"end":return b.stop();}},b)})))});
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import Container from"./Container";import{jsx as _jsx}from"react/jsx-runtime";export default{component:Container,title:"Container"};var boxStyle={color:"#333",display:"flex",background:"rgba(255, 105, 180, .5)",width:"100%",outline:"1px dashed rgba(255, 105, 180, .8)",outlineOffset:"-1px",padding:"24px"},Box=function(a){var b=a.children;return/*#__PURE__*/_jsx("div",{style:boxStyle,children:b})};// eslint-disable-next-line react/forbid-dom-props
|
|
2
|
-
export var Default=function(a){return/*#__PURE__*/_jsx(Container,_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx(Box,{})}))};export var FullWidth=function(a){return/*#__PURE__*/_jsx(Container,_objectSpread(_objectSpread({},a),{},{isFullWidth:!0,children:/*#__PURE__*/_jsx(Box,{})}))};export var Tag=function(a){return/*#__PURE__*/_jsx(Container,_objectSpread(_objectSpread({},a),{},{as:"main",children:/*#__PURE__*/_jsx(Box,{})}))};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./Container";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["align","children","className","id","noGutter","testId"],_excluded2=["align","children","className","span","spanXs","spanSm","spanMd","spanLg","spanXl","offset","offsetXs","offsetSm","offsetMd","offsetLg","offsetXl","testId"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/es.array.map.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";/* eslint-disable @typescript-eslint/restrict-template-expressions */import classNames from"classnames";import React,{useEffect}from"react";import{jsx as _jsx}from"react/jsx-runtime";/**
|
|
2
|
-
* Grid component.
|
|
3
|
-
*
|
|
4
|
-
* @component
|
|
5
|
-
* @example
|
|
6
|
-
* const align = 'center'
|
|
7
|
-
* const equalHeight = true
|
|
8
|
-
* return (
|
|
9
|
-
* <Grid align={align} equalHeight={equalHeight}>
|
|
10
|
-
* <div>...</div>
|
|
11
|
-
* <div>...</div>
|
|
12
|
-
* </Grid>
|
|
13
|
-
* )
|
|
14
|
-
*/var Grid=function(a){var b=a.align,c=a.children,d=a.className,e=a.id,f=a.noGutter,g=a.testId,h=_objectWithoutProperties(a,_excluded);useEffect(function(){React.Children.map(c,function(a){a&&a.type!==GridCol&&console.warn("Illegal child passed to <Grid />. Ensure to only use <Grid.Col />.")})},[c]);var i=classNames(_defineProperty({"np-grid":!0,"np-grid--alignLeft":"left"===b,"np-grid--alignRight":"right"===b,"np-grid--alignCenter":"center"===b,"np-grid--alignMiddle":"middle"===b,"np-grid--noGutter":!!f},"".concat(d),d));return/*#__PURE__*/_jsx("div",_objectSpread(_objectSpread(_objectSpread({},{className:i,"data-testid":g,id:e}),h),{},{children:c}))},GridCol=function(a){var b,c=a.align,d=a.children,e=a.className,f=a.span,g=a.spanXs,h=a.spanSm,i=a.spanMd,j=a.spanLg,k=a.spanXl,l=a.offset,m=a.offsetXs,n=a.offsetSm,o=a.offsetMd,p=a.offsetLg,q=a.offsetXl,r=a.testId,s=_objectWithoutProperties(a,_excluded2),t=classNames((b={"np-grid-col":!0},_defineProperty(b,"np-grid-col--".concat(f),"undefined"!=typeof f),_defineProperty(b,"np-xs-grid-col--".concat(g),"undefined"!=typeof g),_defineProperty(b,"np-sm-grid-col--".concat(h),"undefined"!=typeof h),_defineProperty(b,"np-md-grid-col--".concat(i),"undefined"!=typeof i),_defineProperty(b,"np-lg-grid-col--".concat(j),"undefined"!=typeof j),_defineProperty(b,"np-xl-grid-col--".concat(k),"undefined"!=typeof k),_defineProperty(b,"np-grid-col--offset-".concat(l),"undefined"!=typeof l),_defineProperty(b,"np-xs-grid-col--offset-".concat(m),"undefined"!=typeof m),_defineProperty(b,"np-sm-grid-col--offset-".concat(n),"undefined"!=typeof n),_defineProperty(b,"np-md-grid-col--offset-".concat(o),"undefined"!=typeof o),_defineProperty(b,"np-lg-grid-col--offset-".concat(p),"undefined"!=typeof p),_defineProperty(b,"np-xl-grid-col--offset-".concat(q),"undefined"!=typeof q),_defineProperty(b,"np-grid-col--alignLeft","left"===c),_defineProperty(b,"np-grid-col--alignRight","right"===c),_defineProperty(b,"np-grid-col--alignCenter","center"===c),_defineProperty(b,"np-grid-col--alignMiddle","middle"===c),_defineProperty(b,"".concat(e),e),b));return/*#__PURE__*/_jsx("div",_objectSpread(_objectSpread(_objectSpread({},{className:t,"data-testid":r}),s),{},{children:d}))};/**
|
|
15
|
-
* Grid column component.
|
|
16
|
-
*
|
|
17
|
-
* @component
|
|
18
|
-
* @example
|
|
19
|
-
* return (
|
|
20
|
-
* <Grid>
|
|
21
|
-
* <Grid.Col>...</Grid.Col>
|
|
22
|
-
* <Grid.Col>...</Grid.Col>
|
|
23
|
-
* </Grid>
|
|
24
|
-
* )
|
|
25
|
-
*/GridCol.displayName="Grid.Col",Grid.Col=GridCol;export default Grid;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import _regeneratorRuntime from"@babel/runtime/regenerator";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}/* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-call */import{render,screen}from"@testing-library/react";import{axe,toHaveNoViolations}from"jest-axe";import{renderToString}from"react-dom/server";import Grid from".";import{jsx as _jsx}from"react/jsx-runtime";describe("<Grid />",function(){var a={children:/*#__PURE__*/_jsx(Grid.Col,{}),testId:"test-grid"};it(": matches snapshot",function(){var b=render(/*#__PURE__*/_jsx(Grid,_objectSpread({},a))),c=b.container;// eslint-disable-next-line testing-library/no-node-access
|
|
2
|
-
expect(c.firstChild).toMatchSnapshot()}),it(": renders",function(){var b=_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx(Grid.Col,{children:"Column"})}),c=render(/*#__PURE__*/_jsx(Grid,_objectSpread({},a))),d=c.rerender;// Change props
|
|
3
|
-
expect(screen.getByTestId("test-grid")).toBeInTheDocument(),expect(screen.getByTestId("test-grid")).toHaveClass("np-grid"),d(/*#__PURE__*/_jsx(Grid,_objectSpread({},b))),expect(screen.getByText("Column")).toBeInTheDocument(),expect(screen.queryByText("Column")).toHaveClass("np-grid-col"),expect(screen.getByText("Column").parentElement).toHaveClass("np-grid")}),it(": renders with various spans",function(){var b=_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanMd:4,spanLg:3,children:"Column"})}),c=render(/*#__PURE__*/_jsx(Grid,_objectSpread({},a))),d=c.rerender;// Change props
|
|
4
|
-
expect(screen.getByTestId("test-grid")).toBeInTheDocument(),expect(screen.getByTestId("test-grid")).toHaveClass("np-grid"),d(/*#__PURE__*/_jsx(Grid,_objectSpread({},b))),expect(screen.getByText("Column")).toBeInTheDocument(),expect(screen.queryByText("Column")).toHaveClass("np-grid-col"),expect(screen.queryByText("Column")).toHaveClass("np-grid-col--12"),expect(screen.queryByText("Column")).toHaveClass("np-sm-grid-col--6"),expect(screen.queryByText("Column")).toHaveClass("np-md-grid-col--4"),expect(screen.queryByText("Column")).toHaveClass("np-lg-grid-col--3")}),it(": is set with class by the `className` prop",function(){var b=_objectSpread(_objectSpread({},a),{},{className:"np-grid--modifier"}),c=render(/*#__PURE__*/_jsx(Grid,_objectSpread({},a))),d=c.rerender;// Change props
|
|
5
|
-
expect(screen.getByTestId("test-grid")).not.toHaveClass("np-grid--modifier"),d(/*#__PURE__*/_jsx(Grid,_objectSpread({},b))),expect(screen.getByTestId("test-grid")).toHaveClass("np-grid--modifier")}),it(": renders with modifier classes",function(){var b=_objectSpread(_objectSpread({},a),{},{// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
6
|
-
align:"center",noGutter:!0,children:/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanMd:4,spanLg:3,children:"Column"})}),c=render(/*#__PURE__*/_jsx(Grid,_objectSpread({},a))),d=c.rerender;// Change props
|
|
7
|
-
expect(screen.getByTestId("test-grid")).toBeInTheDocument(),expect(screen.getByTestId("test-grid")).toHaveClass("np-grid"),d(/*#__PURE__*/_jsx(Grid,_objectSpread({},b))),expect(screen.getByTestId("test-grid")).toHaveClass("np-grid--alignCenter"),expect(screen.getByTestId("test-grid")).toHaveClass("np-grid--noGutter")}),it(": renders with column modifier classes",function(){var b=_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx(Grid.Col,{align:"center",span:12,spanSm:6,spanMd:4,spanLg:3,children:"Column"})}),c=render(/*#__PURE__*/_jsx(Grid,_objectSpread({},a))),d=c.rerender;// Change props
|
|
8
|
-
expect(screen.getByTestId("test-grid")).toBeInTheDocument(),expect(screen.getByTestId("test-grid")).toHaveClass("np-grid"),d(/*#__PURE__*/_jsx(Grid,_objectSpread({},b))),expect(screen.getByText("Column")).toBeInTheDocument(),expect(screen.queryByText("Column")).toHaveClass("np-grid-col--alignCenter")})}),describe("<Grid /> Server-side rendering>",function(){var a={children:/*#__PURE__*/_jsx(Grid.Col,{}),testId:"test-grid"};it(": renders on a server wtesthout crashing",function(){expect(function renderOnServer(){return renderToString(/*#__PURE__*/_jsx("main",{children:/*#__PURE__*/_jsx(Grid,_objectSpread({},a))}))}).not.toThrow()}),it(": renders with the class attribute",function(){// eslint-disable-next-line testing-library/render-result-naming-convention
|
|
9
|
-
var b=renderToString(/*#__PURE__*/_jsx(Grid,_objectSpread({},a)));expect(b).toContain("class=\"np-grid\"")})}),expect.extend(toHaveNoViolations),describe("<Grid /> a11y testing",function(){var a={children:/*#__PURE__*/_jsx(Grid.Col,{}),testId:"test-grid"};it(": should not have basic accessibility issues",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function b(){var c,d,e;return _regeneratorRuntime.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return c=render(/*#__PURE__*/_jsx(Grid,_objectSpread({},a))),d=c.container,b.next=3,axe(d);case 3:e=b.sent,expect(e).toHaveNoViolations();case 5:case"end":return b.stop();}},b)})))});
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import Grid from"./Grid";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:Grid,title:"Grid"};var boxStyle={color:"#333",display:"flex",background:"rgba(255, 105, 180, .5)",width:"100%",outline:"1px dashed rgba(255, 105, 180, .8)",outlineOffset:"-1px",padding:"24px"},Box=function(a){var b=a.children;return/*#__PURE__*/_jsx("div",{style:boxStyle,children:b})};// eslint-disable-next-line react/forbid-dom-props
|
|
2
|
-
export var Default=function(a){return/*#__PURE__*/_jsxs(Grid,_objectSpread(_objectSpread({},a),{},{children:[/*#__PURE__*/_jsx(Grid.Col,{children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{children:/*#__PURE__*/_jsx(Box,{})})]}))};export var Responsive=function(a){return/*#__PURE__*/_jsxs(Grid,_objectSpread(_objectSpread({},a),{},{children:[/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanLg:3,children:/*#__PURE__*/_jsx(Box,{children:"Span 3"})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanLg:3,children:/*#__PURE__*/_jsx(Box,{children:"Span 3"})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanLg:3,children:/*#__PURE__*/_jsx(Box,{children:"Span 3"})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanLg:3,children:/*#__PURE__*/_jsx(Box,{children:"Span 3"})})]}))};export var NoGutter=function(a){return/*#__PURE__*/_jsxs(Grid,_objectSpread(_objectSpread({},a),{},{noGutter:!0,children:[/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanLg:3,children:/*#__PURE__*/_jsx(Box,{children:"Span 3"})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanLg:3,children:/*#__PURE__*/_jsx(Box,{children:"Span 3"})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanLg:3,children:/*#__PURE__*/_jsx(Box,{children:"Span 3"})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanSm:6,spanLg:3,children:/*#__PURE__*/_jsx(Box,{children:"Span 3"})})]}))};export var Offset=function(a){return/*#__PURE__*/_jsxs(Grid,_objectSpread(_objectSpread({},a),{},{children:[/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:1,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,offset:0,spanMd:2,offsetMd:9,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:2,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:8,offset:0,offsetMd:2,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:4,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:6,offset:0,offsetMd:2,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:6,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:4,offset:0,offsetMd:2,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:8,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:2,offset:0,offsetMd:2,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:1,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:9,offset:0,offsetMd:2,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:9,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:12,spanMd:1,offset:0,offsetMd:2,children:/*#__PURE__*/_jsx(Box,{})})]}))};export var AlignLeft=function(a){return/*#__PURE__*/_jsxs(Grid,_objectSpread(_objectSpread({align:"left"},a),{},{children:[/*#__PURE__*/_jsx(Grid.Col,{span:3,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:3,children:/*#__PURE__*/_jsx(Box,{})})]}))};export var AlignRight=function(a){return/*#__PURE__*/_jsxs(Grid,_objectSpread(_objectSpread({align:"right"},a),{},{children:[/*#__PURE__*/_jsx(Grid.Col,{span:3,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:3,children:/*#__PURE__*/_jsx(Box,{})})]}))};export var AlignCenter=function(a){return/*#__PURE__*/_jsxs(Grid,_objectSpread(_objectSpread({align:"center"},a),{},{children:[/*#__PURE__*/_jsx(Grid.Col,{span:3,children:/*#__PURE__*/_jsx(Box,{})}),/*#__PURE__*/_jsx(Grid.Col,{span:3,children:/*#__PURE__*/_jsx(Box,{})})]}))};export var AlignMiddle=function(a){return/*#__PURE__*/_jsxs(Grid,_objectSpread(_objectSpread({align:"middle"},a),{},{children:[/*#__PURE__*/_jsx(Grid.Col,{span:3,children:/*#__PURE__*/_jsx(Box,{children:/*#__PURE__*/_jsx("p",{children:"Lorem ipsum dolor, sit amet consectetur adipisicing elit. Consequuntur tempore numquam quo doloremque tempora hic nam, explicabo voluptatem consectetur assumenda iure culpa perspiciatis ipsa sit."})})}),/*#__PURE__*/_jsx(Grid.Col,{span:3,children:/*#__PURE__*/_jsx(Box,{children:/*#__PURE__*/_jsx("p",{children:"Lorem ipsum dolor sit amet consectetur adipisicing elit. Veritatis, aliquam."})})})]}))};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./Grid";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:root{--container-width:1164px;--container-horizontal-padding:var(--size-32);--container-vertical-padding:var(--size-32)}.np-container{margin:0 auto 0 0;max-width:1164px;max-width:var(--container-width,1164px);padding:32px;padding:var(--container-vertical-padding,var(--size-32)) var(--container-horizontal-padding,var(--size-32));width:100%}.np-container--fullWidth{max-width:inherit}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:root{--grid-gap-size:var(--size-32);--grid-column-width:100%}.np-grid{align-items:unset;box-sizing:border-box;display:flex;flex-flow:row wrap;margin-left:-16px;margin-left:calc(var(--grid-gap-size, var(--size-32))/2*-1);margin-right:-16px;margin-right:calc(var(--grid-gap-size, var(--size-32))/2*-1);padding:0}.np-grid>*{box-sizing:inherit;flex-basis:100%;min-width:0}.np-grid--alignCenter{justify-content:center}.np-grid--alignRight{justify-content:flex-end}.np-grid--alignMiddle{align-items:center}.np-grid--alignBottom{align-items:flex-end}.np-grid--noGutter{margin:0}.np-grid--noGutter>.np-grid-col{padding:0}.np-grid-col{flex:1 0;margin-left:0;max-width:100%;padding:0 16px;padding:0 calc(var(--grid-gap-size, var(--size-32))/2);width:100%}.np-grid-col[class*=col--]{flex:0 0 100%;flex:0 0 var(--grid-column-width,100%);max-width:100%;max-width:var(--grid-column-width,100%)}.np-grid-col--alignCenter{justify-self:center}.np-grid-col--alignRight{justify-self:flex-end}.np-grid-col--alignMiddle{align-self:center}.np-grid-col--alignBottom{align-self:flex-end}.np-grid-col.np-grid-col--1{flex:0 0 8.33333%;max-width:8.33333%}.np-grid-col.np-grid-col--offset-1{margin-left:8.33333%}.np-grid-col.np-grid-col--2{flex:0 0 16.66667%;max-width:16.66667%}.np-grid-col.np-grid-col--offset-2{margin-left:16.66667%}.np-grid-col.np-grid-col--3{flex:0 0 25%;max-width:25%}.np-grid-col.np-grid-col--offset-3{margin-left:25%}.np-grid-col.np-grid-col--4{flex:0 0 33.33333%;max-width:33.33333%}.np-grid-col.np-grid-col--offset-4{margin-left:33.33333%}.np-grid-col.np-grid-col--5{flex:0 0 41.66667%;max-width:41.66667%}.np-grid-col.np-grid-col--offset-5{margin-left:41.66667%}.np-grid-col.np-grid-col--6{flex:0 0 50%;max-width:50%}.np-grid-col.np-grid-col--offset-6{margin-left:50%}.np-grid-col.np-grid-col--7{flex:0 0 58.33333%;max-width:58.33333%}.np-grid-col.np-grid-col--offset-7{margin-left:58.33333%}.np-grid-col.np-grid-col--8{flex:0 0 66.66667%;max-width:66.66667%}.np-grid-col.np-grid-col--offset-8{margin-left:66.66667%}.np-grid-col.np-grid-col--9{flex:0 0 75%;max-width:75%}.np-grid-col.np-grid-col--offset-9{margin-left:75%}.np-grid-col.np-grid-col--10{flex:0 0 83.33333%;max-width:83.33333%}.np-grid-col.np-grid-col--offset-10{margin-left:83.33333%}.np-grid-col.np-grid-col--11{flex:0 0 91.66667%;max-width:91.66667%}.np-grid-col.np-grid-col--offset-11{margin-left:91.66667%}.np-grid-col.np-grid-col--12{flex:0 0 100%;max-width:100%}.np-grid-col.np-grid-col--offset-12{margin-left:100%}@media (min-width:480px){.np-grid-col.np-xs-grid-col--1{flex:0 0 8.33333%;max-width:8.33333%}.np-grid-col.np-xs-grid-col--offset-1{margin-left:8.33333%}.np-grid-col.np-xs-grid-col--2{flex:0 0 16.66667%;max-width:16.66667%}.np-grid-col.np-xs-grid-col--offset-2{margin-left:16.66667%}.np-grid-col.np-xs-grid-col--3{flex:0 0 25%;max-width:25%}.np-grid-col.np-xs-grid-col--offset-3{margin-left:25%}.np-grid-col.np-xs-grid-col--4{flex:0 0 33.33333%;max-width:33.33333%}.np-grid-col.np-xs-grid-col--offset-4{margin-left:33.33333%}.np-grid-col.np-xs-grid-col--5{flex:0 0 41.66667%;max-width:41.66667%}.np-grid-col.np-xs-grid-col--offset-5{margin-left:41.66667%}.np-grid-col.np-xs-grid-col--6{flex:0 0 50%;max-width:50%}.np-grid-col.np-xs-grid-col--offset-6{margin-left:50%}.np-grid-col.np-xs-grid-col--7{flex:0 0 58.33333%;max-width:58.33333%}.np-grid-col.np-xs-grid-col--offset-7{margin-left:58.33333%}.np-grid-col.np-xs-grid-col--8{flex:0 0 66.66667%;max-width:66.66667%}.np-grid-col.np-xs-grid-col--offset-8{margin-left:66.66667%}.np-grid-col.np-xs-grid-col--9{flex:0 0 75%;max-width:75%}.np-grid-col.np-xs-grid-col--offset-9{margin-left:75%}.np-grid-col.np-xs-grid-col--10{flex:0 0 83.33333%;max-width:83.33333%}.np-grid-col.np-xs-grid-col--offset-10{margin-left:83.33333%}.np-grid-col.np-xs-grid-col--11{flex:0 0 91.66667%;max-width:91.66667%}.np-grid-col.np-xs-grid-col--offset-11{margin-left:91.66667%}.np-grid-col.np-xs-grid-col--12{flex:0 0 100%;max-width:100%}.np-grid-col.np-xs-grid-col--offset-12{margin-left:100%}}@media (min-width:576px){.np-grid-col.np-sm-grid-col--1{flex:0 0 8.33333%;max-width:8.33333%}.np-grid-col.np-sm-grid-col--offset-1{margin-left:8.33333%}.np-grid-col.np-sm-grid-col--2{flex:0 0 16.66667%;max-width:16.66667%}.np-grid-col.np-sm-grid-col--offset-2{margin-left:16.66667%}.np-grid-col.np-sm-grid-col--3{flex:0 0 25%;max-width:25%}.np-grid-col.np-sm-grid-col--offset-3{margin-left:25%}.np-grid-col.np-sm-grid-col--4{flex:0 0 33.33333%;max-width:33.33333%}.np-grid-col.np-sm-grid-col--offset-4{margin-left:33.33333%}.np-grid-col.np-sm-grid-col--5{flex:0 0 41.66667%;max-width:41.66667%}.np-grid-col.np-sm-grid-col--offset-5{margin-left:41.66667%}.np-grid-col.np-sm-grid-col--6{flex:0 0 50%;max-width:50%}.np-grid-col.np-sm-grid-col--offset-6{margin-left:50%}.np-grid-col.np-sm-grid-col--7{flex:0 0 58.33333%;max-width:58.33333%}.np-grid-col.np-sm-grid-col--offset-7{margin-left:58.33333%}.np-grid-col.np-sm-grid-col--8{flex:0 0 66.66667%;max-width:66.66667%}.np-grid-col.np-sm-grid-col--offset-8{margin-left:66.66667%}.np-grid-col.np-sm-grid-col--9{flex:0 0 75%;max-width:75%}.np-grid-col.np-sm-grid-col--offset-9{margin-left:75%}.np-grid-col.np-sm-grid-col--10{flex:0 0 83.33333%;max-width:83.33333%}.np-grid-col.np-sm-grid-col--offset-10{margin-left:83.33333%}.np-grid-col.np-sm-grid-col--11{flex:0 0 91.66667%;max-width:91.66667%}.np-grid-col.np-sm-grid-col--offset-11{margin-left:91.66667%}.np-grid-col.np-sm-grid-col--12{flex:0 0 100%;max-width:100%}.np-grid-col.np-sm-grid-col--offset-12{margin-left:100%}}@media (min-width:767px){.np-grid-col.np-md-grid-col--1{flex:0 0 8.33333%;max-width:8.33333%}.np-grid-col.np-md-grid-col--offset-1{margin-left:8.33333%}.np-grid-col.np-md-grid-col--2{flex:0 0 16.66667%;max-width:16.66667%}.np-grid-col.np-md-grid-col--offset-2{margin-left:16.66667%}.np-grid-col.np-md-grid-col--3{flex:0 0 25%;max-width:25%}.np-grid-col.np-md-grid-col--offset-3{margin-left:25%}.np-grid-col.np-md-grid-col--4{flex:0 0 33.33333%;max-width:33.33333%}.np-grid-col.np-md-grid-col--offset-4{margin-left:33.33333%}.np-grid-col.np-md-grid-col--5{flex:0 0 41.66667%;max-width:41.66667%}.np-grid-col.np-md-grid-col--offset-5{margin-left:41.66667%}.np-grid-col.np-md-grid-col--6{flex:0 0 50%;max-width:50%}.np-grid-col.np-md-grid-col--offset-6{margin-left:50%}.np-grid-col.np-md-grid-col--7{flex:0 0 58.33333%;max-width:58.33333%}.np-grid-col.np-md-grid-col--offset-7{margin-left:58.33333%}.np-grid-col.np-md-grid-col--8{flex:0 0 66.66667%;max-width:66.66667%}.np-grid-col.np-md-grid-col--offset-8{margin-left:66.66667%}.np-grid-col.np-md-grid-col--9{flex:0 0 75%;max-width:75%}.np-grid-col.np-md-grid-col--offset-9{margin-left:75%}.np-grid-col.np-md-grid-col--10{flex:0 0 83.33333%;max-width:83.33333%}.np-grid-col.np-md-grid-col--offset-10{margin-left:83.33333%}.np-grid-col.np-md-grid-col--11{flex:0 0 91.66667%;max-width:91.66667%}.np-grid-col.np-md-grid-col--offset-11{margin-left:91.66667%}.np-grid-col.np-md-grid-col--12{flex:0 0 100%;max-width:100%}.np-grid-col.np-md-grid-col--offset-12{margin-left:100%}}@media (min-width:992px){.np-grid-col.np-lg-grid-col--1{flex:0 0 8.33333%;max-width:8.33333%}.np-grid-col.np-lg-grid-col--offset-1{margin-left:8.33333%}.np-grid-col.np-lg-grid-col--2{flex:0 0 16.66667%;max-width:16.66667%}.np-grid-col.np-lg-grid-col--offset-2{margin-left:16.66667%}.np-grid-col.np-lg-grid-col--3{flex:0 0 25%;max-width:25%}.np-grid-col.np-lg-grid-col--offset-3{margin-left:25%}.np-grid-col.np-lg-grid-col--4{flex:0 0 33.33333%;max-width:33.33333%}.np-grid-col.np-lg-grid-col--offset-4{margin-left:33.33333%}.np-grid-col.np-lg-grid-col--5{flex:0 0 41.66667%;max-width:41.66667%}.np-grid-col.np-lg-grid-col--offset-5{margin-left:41.66667%}.np-grid-col.np-lg-grid-col--6{flex:0 0 50%;max-width:50%}.np-grid-col.np-lg-grid-col--offset-6{margin-left:50%}.np-grid-col.np-lg-grid-col--7{flex:0 0 58.33333%;max-width:58.33333%}.np-grid-col.np-lg-grid-col--offset-7{margin-left:58.33333%}.np-grid-col.np-lg-grid-col--8{flex:0 0 66.66667%;max-width:66.66667%}.np-grid-col.np-lg-grid-col--offset-8{margin-left:66.66667%}.np-grid-col.np-lg-grid-col--9{flex:0 0 75%;max-width:75%}.np-grid-col.np-lg-grid-col--offset-9{margin-left:75%}.np-grid-col.np-lg-grid-col--10{flex:0 0 83.33333%;max-width:83.33333%}.np-grid-col.np-lg-grid-col--offset-10{margin-left:83.33333%}.np-grid-col.np-lg-grid-col--11{flex:0 0 91.66667%;max-width:91.66667%}.np-grid-col.np-lg-grid-col--offset-11{margin-left:91.66667%}.np-grid-col.np-lg-grid-col--12{flex:0 0 100%;max-width:100%}.np-grid-col.np-lg-grid-col--offset-12{margin-left:100%}}@media (min-width:1200px){.np-grid-col.np-xl-grid-col--1{flex:0 0 8.33333%;max-width:8.33333%}.np-grid-col.np-xl-grid-col--offset-1{margin-left:8.33333%}.np-grid-col.np-xl-grid-col--2{flex:0 0 16.66667%;max-width:16.66667%}.np-grid-col.np-xl-grid-col--offset-2{margin-left:16.66667%}.np-grid-col.np-xl-grid-col--3{flex:0 0 25%;max-width:25%}.np-grid-col.np-xl-grid-col--offset-3{margin-left:25%}.np-grid-col.np-xl-grid-col--4{flex:0 0 33.33333%;max-width:33.33333%}.np-grid-col.np-xl-grid-col--offset-4{margin-left:33.33333%}.np-grid-col.np-xl-grid-col--5{flex:0 0 41.66667%;max-width:41.66667%}.np-grid-col.np-xl-grid-col--offset-5{margin-left:41.66667%}.np-grid-col.np-xl-grid-col--6{flex:0 0 50%;max-width:50%}.np-grid-col.np-xl-grid-col--offset-6{margin-left:50%}.np-grid-col.np-xl-grid-col--7{flex:0 0 58.33333%;max-width:58.33333%}.np-grid-col.np-xl-grid-col--offset-7{margin-left:58.33333%}.np-grid-col.np-xl-grid-col--8{flex:0 0 66.66667%;max-width:66.66667%}.np-grid-col.np-xl-grid-col--offset-8{margin-left:66.66667%}.np-grid-col.np-xl-grid-col--9{flex:0 0 75%;max-width:75%}.np-grid-col.np-xl-grid-col--offset-9{margin-left:75%}.np-grid-col.np-xl-grid-col--10{flex:0 0 83.33333%;max-width:83.33333%}.np-grid-col.np-xl-grid-col--offset-10{margin-left:83.33333%}.np-grid-col.np-xl-grid-col--11{flex:0 0 91.66667%;max-width:91.66667%}.np-grid-col.np-xl-grid-col--offset-11{margin-left:91.66667%}.np-grid-col.np-xl-grid-col--12{flex:0 0 100%;max-width:100%}.np-grid-col.np-xl-grid-col--offset-12{margin-left:100%}}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement } from 'react';
|
|
2
|
-
import { CommonProps } from '../common';
|
|
3
|
-
export declare type ContainerProps = CommonProps & {
|
|
4
|
-
/** Content to display inside Container. */
|
|
5
|
-
children: any;
|
|
6
|
-
/** Optional prop to specify Element Tag of the Container */
|
|
7
|
-
as?: React.ElementType;
|
|
8
|
-
/**
|
|
9
|
-
* Should the width of this Container be unconstrained (filling the viewport)?
|
|
10
|
-
*/
|
|
11
|
-
isFullWidth?: boolean;
|
|
12
|
-
/** Optional prop to specify the ID used for testing */
|
|
13
|
-
testId?: string;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Use `Container` as the root component of the Neptune design system.
|
|
17
|
-
*
|
|
18
|
-
* @component
|
|
19
|
-
* @example
|
|
20
|
-
* const asSection = 'section'
|
|
21
|
-
* const isFullWidth = true
|
|
22
|
-
* return (
|
|
23
|
-
* <Container as={asSection} isFullWidth={isFullWidth}>
|
|
24
|
-
* <div>Hello World!</div>
|
|
25
|
-
* </Container>
|
|
26
|
-
* )
|
|
27
|
-
*/
|
|
28
|
-
declare const Container: ({ children, as: ElementTag, isFullWidth, testId, ...props }: ContainerProps) => ReactElement | null;
|
|
29
|
-
export default Container;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Story } from '@storybook/react';
|
|
3
|
-
import { ContainerProps } from './Container';
|
|
4
|
-
declare const _default: {
|
|
5
|
-
component: ({ children, as: ElementTag, isFullWidth, testId, ...props }: ContainerProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
|
6
|
-
title: string;
|
|
7
|
-
};
|
|
8
|
-
export default _default;
|
|
9
|
-
export declare const Default: Story<ContainerProps>;
|
|
10
|
-
export declare const FullWidth: Story<ContainerProps>;
|
|
11
|
-
export declare const Tag: Story<ContainerProps>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './Container';
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { CommonProps } from '../common';
|
|
3
|
-
export declare type GridAlign = 'right' | 'left' | 'center' | 'middle';
|
|
4
|
-
export declare type GridCell = 'fill' | 'fit' | 'equalheight';
|
|
5
|
-
export declare type GridColSpan = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
6
|
-
export declare type GridCommon = CommonProps & {
|
|
7
|
-
/** Optional prop to align all grid cells */
|
|
8
|
-
align?: GridAlign;
|
|
9
|
-
/**
|
|
10
|
-
* Content to display in the Column.
|
|
11
|
-
*/
|
|
12
|
-
children?: ReactNode;
|
|
13
|
-
/** Optional prop to specify the ID used for testing */
|
|
14
|
-
testId?: string;
|
|
15
|
-
};
|
|
16
|
-
export declare type GridProps = GridCommon & {
|
|
17
|
-
/** Optional prop to specify the ID of the Grid */
|
|
18
|
-
id?: string;
|
|
19
|
-
/** Optional prop to remove all gutters */
|
|
20
|
-
noGutter?: boolean;
|
|
21
|
-
};
|
|
22
|
-
export declare type GridColProps = GridCommon & {
|
|
23
|
-
/**
|
|
24
|
-
* The number of columns to span on the default breakpoint and above, from 1 to 12.
|
|
25
|
-
*/
|
|
26
|
-
span?: GridColSpan;
|
|
27
|
-
/**
|
|
28
|
-
* The number of columns to span on the XS breakpoint and above, from 1 to 12.
|
|
29
|
-
*/
|
|
30
|
-
spanXs?: GridColSpan;
|
|
31
|
-
/**
|
|
32
|
-
* The number of columns to span on the S breakpoint and above, from 1 to 12.
|
|
33
|
-
*/
|
|
34
|
-
spanSm?: GridColSpan;
|
|
35
|
-
/**
|
|
36
|
-
* The number of columns to span on the M breakpoint and above, from 1 to 12.
|
|
37
|
-
*/
|
|
38
|
-
spanMd?: GridColSpan;
|
|
39
|
-
/**
|
|
40
|
-
* The number of columns to span on the L breakpoint and above, from 1 to 12.
|
|
41
|
-
*/
|
|
42
|
-
spanLg?: GridColSpan;
|
|
43
|
-
/**
|
|
44
|
-
* The number of columns to span on the XL breakpoint and above, from 1 to 12.
|
|
45
|
-
*/
|
|
46
|
-
spanXl?: GridColSpan;
|
|
47
|
-
/**
|
|
48
|
-
* The number of columns to span on the default breakpoint and above, from 1 to 12.
|
|
49
|
-
*/
|
|
50
|
-
offset?: GridColSpan;
|
|
51
|
-
/**
|
|
52
|
-
* The number of columns to offset on the XS breakpoint and above, from 1 to 12.
|
|
53
|
-
*/
|
|
54
|
-
offsetXs?: GridColSpan;
|
|
55
|
-
/**
|
|
56
|
-
* The number of columns to offset on the S breakpoint and above, from 1 to 12.
|
|
57
|
-
*/
|
|
58
|
-
offsetSm?: GridColSpan;
|
|
59
|
-
/**
|
|
60
|
-
* The number of columns to offset on the M breakpoint and above, from 1 to 12.
|
|
61
|
-
*/
|
|
62
|
-
offsetMd?: GridColSpan;
|
|
63
|
-
/**
|
|
64
|
-
* The number of columns to offset on the L breakpoint and above, from 1 to 12.
|
|
65
|
-
*/
|
|
66
|
-
offsetLg?: GridColSpan;
|
|
67
|
-
/**
|
|
68
|
-
* The number of columns to offset on the XL breakpoint and above, from 1 to 12.
|
|
69
|
-
*/
|
|
70
|
-
offsetXl?: GridColSpan;
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* Grid component.
|
|
74
|
-
*
|
|
75
|
-
* @component
|
|
76
|
-
* @example
|
|
77
|
-
* const align = 'center'
|
|
78
|
-
* const equalHeight = true
|
|
79
|
-
* return (
|
|
80
|
-
* <Grid align={align} equalHeight={equalHeight}>
|
|
81
|
-
* <div>...</div>
|
|
82
|
-
* <div>...</div>
|
|
83
|
-
* </Grid>
|
|
84
|
-
* )
|
|
85
|
-
*/
|
|
86
|
-
declare const Grid: {
|
|
87
|
-
({ align, children, className, id, noGutter, testId, ...props }: GridProps): ReactElement | null;
|
|
88
|
-
Col: {
|
|
89
|
-
({ align, children, className, span, spanXs, spanSm, spanMd, spanLg, spanXl, offset, offsetXs, offsetSm, offsetMd, offsetLg, offsetXl, testId, ...props }: GridColProps): ReactElement | null;
|
|
90
|
-
displayName: string;
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
export default Grid;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Story } from '@storybook/react';
|
|
3
|
-
import { GridProps } from './Grid';
|
|
4
|
-
declare const _default: {
|
|
5
|
-
component: {
|
|
6
|
-
({ align, children, className, id, noGutter, testId, ...props }: GridProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
|
7
|
-
Col: {
|
|
8
|
-
({ align, children, className, span, spanXs, spanSm, spanMd, spanLg, spanXl, offset, offsetXs, offsetSm, offsetMd, offsetLg, offsetXl, testId, ...props }: import("./Grid").GridColProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
|
9
|
-
displayName: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
title: string;
|
|
13
|
-
};
|
|
14
|
-
export default _default;
|
|
15
|
-
export declare const Default: Story<GridProps>;
|
|
16
|
-
export declare const Responsive: Story<GridProps>;
|
|
17
|
-
export declare const NoGutter: Story<GridProps>;
|
|
18
|
-
export declare const Offset: Story<GridProps>;
|
|
19
|
-
export declare const AlignLeft: Story<GridProps>;
|
|
20
|
-
export declare const AlignRight: Story<GridProps>;
|
|
21
|
-
export declare const AlignCenter: Story<GridProps>;
|
|
22
|
-
export declare const AlignMiddle: Story<GridProps>;
|