@transferwise/components 41.2.1-inter.1 → 41.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/build/es/no-polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
- package/build/es/no-polyfill/actionButton/ActionButton.js +1 -1
- package/build/es/no-polyfill/alert/Alert.js +1 -1
- package/build/es/no-polyfill/avatar/Avatar.js +1 -1
- package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.js +1 -1
- package/build/es/no-polyfill/card/Card.js +1 -1
- package/build/es/no-polyfill/checkbox/Checkbox.js +1 -1
- package/build/es/no-polyfill/chips/Chip.js +1 -1
- package/build/es/no-polyfill/circularButton/CircularButton.js +1 -1
- package/build/es/no-polyfill/common/Option/Option.js +1 -1
- package/build/es/no-polyfill/common/index.js +1 -1
- package/build/es/no-polyfill/dateLookup/dateHeader/DateHeader.js +1 -1
- package/build/es/no-polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +1 -1
- package/build/es/no-polyfill/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
- package/build/es/no-polyfill/dateLookup/tableLink/TableLink.js +1 -1
- package/build/es/no-polyfill/drawer/Drawer.js +1 -1
- package/build/es/no-polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
- package/build/es/no-polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +1 -1
- package/build/es/no-polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
- package/build/es/no-polyfill/header/Header.js +2 -2
- package/build/es/no-polyfill/index.js +2 -2
- package/build/es/no-polyfill/instructionsList/InstructionsList.js +3 -3
- package/build/es/no-polyfill/link/Link.js +3 -2
- package/build/es/no-polyfill/link/Link.story.js +1 -1
- package/build/es/no-polyfill/modal/Modal.js +1 -1
- package/build/es/no-polyfill/moneyInput/MoneyInput.js +1 -1
- package/build/es/no-polyfill/nudge/Nudge.js +1 -1
- package/build/es/no-polyfill/popover/Popover.js +1 -1
- package/build/es/no-polyfill/progressBar/ProgressBar.js +1 -1
- package/build/es/no-polyfill/radio/Radio.js +1 -1
- package/build/es/no-polyfill/select/Select.js +4 -4
- package/build/es/no-polyfill/select/option/Option.js +1 -1
- package/build/es/no-polyfill/snackbar/Snackbar.js +1 -1
- package/build/es/no-polyfill/stepper/Stepper.js +1 -1
- package/build/es/no-polyfill/summary/Summary.js +1 -1
- package/build/es/no-polyfill/tabs/Tab.js +1 -1
- package/build/es/no-polyfill/tile/Tile.js +1 -1
- package/build/es/no-polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
- package/build/es/no-polyfill/upload/Upload.js +1 -1
- package/build/es/no-polyfill/upload/steps/completeStep/completeStep.js +1 -1
- package/build/es/no-polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
- package/build/es/no-polyfill/upload/steps/processingStep/processingStep.js +1 -1
- package/build/es/no-polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
- package/build/es/no-polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
- package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
- package/build/es/polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
- package/build/es/polyfill/actionButton/ActionButton.js +1 -1
- package/build/es/polyfill/alert/Alert.js +1 -1
- package/build/es/polyfill/avatar/Avatar.js +1 -1
- package/build/es/polyfill/avatarWrapper/AvatarWrapper.js +1 -1
- package/build/es/polyfill/card/Card.js +1 -1
- package/build/es/polyfill/checkbox/Checkbox.js +1 -1
- package/build/es/polyfill/chips/Chip.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/index.js +1 -1
- package/build/es/polyfill/dateLookup/dateHeader/DateHeader.js +1 -1
- package/build/es/polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +1 -1
- package/build/es/polyfill/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
- package/build/es/polyfill/dateLookup/tableLink/TableLink.js +1 -1
- package/build/es/polyfill/drawer/Drawer.js +1 -1
- package/build/es/polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
- package/build/es/polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +1 -1
- package/build/es/polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
- package/build/es/polyfill/header/Header.js +2 -2
- package/build/es/polyfill/index.js +2 -2
- package/build/es/polyfill/instructionsList/InstructionsList.js +3 -3
- package/build/es/polyfill/link/Link.js +3 -2
- package/build/es/polyfill/link/Link.story.js +1 -1
- package/build/es/polyfill/modal/Modal.js +1 -1
- package/build/es/polyfill/moneyInput/MoneyInput.js +1 -1
- package/build/es/polyfill/nudge/Nudge.js +1 -1
- package/build/es/polyfill/popover/Popover.js +1 -1
- package/build/es/polyfill/progressBar/ProgressBar.js +1 -1
- package/build/es/polyfill/radio/Radio.js +1 -1
- package/build/es/polyfill/select/Select.js +4 -4
- package/build/es/polyfill/select/option/Option.js +1 -1
- package/build/es/polyfill/snackbar/Snackbar.js +1 -1
- package/build/es/polyfill/stepper/Stepper.js +1 -1
- package/build/es/polyfill/summary/Summary.js +1 -1
- package/build/es/polyfill/tabs/Tab.js +1 -1
- package/build/es/polyfill/tile/Tile.js +1 -1
- package/build/es/polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
- package/build/es/polyfill/upload/Upload.js +1 -1
- package/build/es/polyfill/upload/steps/completeStep/completeStep.js +1 -1
- package/build/es/polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
- package/build/es/polyfill/upload/steps/processingStep/processingStep.js +1 -1
- package/build/es/polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
- package/build/es/polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
- package/build/es/polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
- package/build/main.css +1 -1
- package/build/styles/accordion/Accordion.css +1 -1
- package/build/styles/actionButton/ActionButton.css +1 -1
- package/build/styles/actionOption/ActionOption.css +1 -0
- package/build/styles/avatar/Avatar.css +1 -1
- package/build/styles/chips/Chip.css +1 -1
- package/build/styles/circularButton/CircularButton.css +1 -1
- package/build/styles/common/Option/Option.css +1 -1
- package/build/styles/dateLookup/DateLookup.css +1 -1
- package/build/styles/drawer/Drawer.css +1 -1
- package/build/styles/flowNavigation/animatedLabel/AnimatedLabel.css +1 -1
- package/build/styles/header/Header.css +1 -1
- package/build/styles/lab/mobileNav/MobileNav.css +1 -1
- package/build/styles/link/Link.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/styles/modal/Modal.css +1 -1
- package/build/styles/navigationOption/NavigationOption.css +1 -1
- package/build/styles/nudge/Nudge.css +1 -1
- package/build/styles/popover/Popover.css +1 -1
- package/build/styles/progressBar/ProgressBar.css +1 -0
- package/build/styles/select/Select.css +1 -1
- package/build/styles/snackbar/Snackbar.css +1 -1
- package/build/styles/stepper/Stepper.css +1 -1
- package/build/styles/summary/Summary.css +1 -1
- package/build/styles/tabs/Tabs.css +1 -1
- package/build/styles/tile/Tile.css +1 -1
- package/build/styles/typeahead/Typeahead.css +1 -1
- package/build/styles/uploadInput/uploadButton/UploadButton.css +1 -1
- package/build/styles/uploadInput/uploadItem/UploadItem.css +1 -1
- package/build/types/checkboxButton/CheckboxButton.d.ts +1 -1
- package/build/types/checkboxButton/CheckboxButton.story.d.ts +1 -1
- package/build/types/common/index.d.ts +0 -1
- package/build/types/common/panel/Panel.d.ts +1 -1
- package/build/types/common/responsivePanel/ResponsivePanel.d.ts +1 -1
- package/build/types/header/Header.d.ts +1 -1
- package/build/types/header/Header.story.d.ts +1 -1
- package/build/types/index.d.ts +2 -4
- package/build/types/link/Link.d.ts +5 -6
- package/build/types/link/Link.story.d.ts +2 -2
- package/build/types/select/searchBox/SearchBox.d.ts +1 -1
- package/build/types/tooltip/Tooltip.story.d.ts +1 -1
- package/build/umd/no-polyfill/main.js +1 -1
- package/build/umd/polyfill/main.js +1 -1
- package/package.json +5 -5
- package/build/es/no-polyfill/body/Body.js +0 -1
- package/build/es/no-polyfill/body/Body.spec.js +0 -1
- package/build/es/no-polyfill/body/Body.story.js +0 -1
- package/build/es/no-polyfill/body/index.js +0 -1
- package/build/es/no-polyfill/common/propsValues/typography.js +0 -1
- package/build/es/no-polyfill/title/Title.js +0 -1
- package/build/es/no-polyfill/title/Title.spec.js +0 -1
- package/build/es/no-polyfill/title/Title.story.js +0 -1
- package/build/es/no-polyfill/title/index.js +0 -1
- package/build/es/polyfill/body/Body.js +0 -1
- package/build/es/polyfill/body/Body.spec.js +0 -1
- package/build/es/polyfill/body/Body.story.js +0 -1
- package/build/es/polyfill/body/index.js +0 -1
- package/build/es/polyfill/common/propsValues/typography.js +0 -1
- package/build/es/polyfill/title/Title.js +0 -1
- package/build/es/polyfill/title/Title.spec.js +0 -1
- package/build/es/polyfill/title/Title.story.js +0 -1
- package/build/es/polyfill/title/index.js +0 -1
- package/build/types/body/Body.d.ts +0 -14
- package/build/types/body/Body.spec.d.ts +0 -1
- package/build/types/body/Body.story.d.ts +0 -8
- package/build/types/body/index.d.ts +0 -1
- package/build/types/common/propsValues/typography.d.ts +0 -27
- package/build/types/title/Title.d.ts +0 -14
- package/build/types/title/Title.spec.d.ts +0 -1
- package/build/types/title/Title.story.d.ts +0 -8
- package/build/types/title/index.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "41.2.1
|
|
3
|
+
"version": "41.2.1",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/umd/polyfill/main.js",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
60
60
|
"@transferwise/icons": "^3.0.6",
|
|
61
61
|
"@transferwise/less-config": "^3.0.6",
|
|
62
|
-
"@transferwise/neptune-css": "^12.5.
|
|
63
|
-
"@transferwise/neptune-tokens": "
|
|
62
|
+
"@transferwise/neptune-css": "^12.5.8",
|
|
63
|
+
"@transferwise/neptune-tokens": "7.0.0",
|
|
64
64
|
"@transferwise/test-config": "^5.0.0",
|
|
65
65
|
"@types/jest": "^26.0.20",
|
|
66
66
|
"@types/jscodeshift": "^0.11.0",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"rollup-plugin-uglify": "^6.0.4"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
|
-
"@transferwise/icons": "^3.0.
|
|
77
|
+
"@transferwise/icons": "^3.0.6",
|
|
78
78
|
"@transferwise/neptune-css": "^12",
|
|
79
79
|
"currency-flags": "^2.1.1",
|
|
80
80
|
"prop-types": "^15.7.2",
|
|
@@ -121,5 +121,5 @@
|
|
|
121
121
|
"**/chokidar/glob-parent": "5.1.2",
|
|
122
122
|
"**/fast-glob/glob-parent": "5.1.2"
|
|
123
123
|
},
|
|
124
|
-
"gitHead": "
|
|
124
|
+
"gitHead": "68318c7a3bc33a642c106ac166a187efb74d3b71"
|
|
125
125
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["as","type","className"];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{Typography}from"../common/propsValues/typography";import{jsx as _jsx}from"react/jsx-runtime";var DEFAULT_TYPE=Typography.BODY_DEFAULT,bodyTypes=new Set([Typography.BODY_DEFAULT,Typography.BODY_DEFAULT_BOLD,Typography.BODY_LARGE,Typography.BODY_LARGE_BOLD]);function Body(a){var b=a.as,c=void 0===b?"span":b,d=a.type,e=void 0===d?DEFAULT_TYPE:d,f=a.className,g=_objectWithoutProperties(a,_excluded),h=bodyTypes.has(e);return/*#__PURE__*/_jsx(c,_objectSpread(_objectSpread({},g),{},{className:classNames("np-text-".concat(h?e:DEFAULT_TYPE),f)}))}export default Body;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Typography}from"../common";import{render,screen}from"../test-utils";import Body from".";import{jsx as _jsx}from"react/jsx-runtime";describe("Body",function(){it("testing default state",function(){render(/*#__PURE__*/_jsx(Body,{children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("SPAN"),expect(a).toHaveClass("np-text-".concat(Typography.BODY_DEFAULT))}),it("enforces tag via `as` prop",function(){render(/*#__PURE__*/_jsx(Body,{as:"p",children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("P"),expect(a).toHaveClass("np-text-".concat(Typography.BODY_DEFAULT))}),it("supports native HTML attrs",function(){render(/*#__PURE__*/_jsx(Body,{id:"test-id",role:"banner",children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a).toHaveAttribute("id","test-id"),expect(a).toHaveAttribute("role","banner")}),it("handles unsupported typography type",function(){render(/*#__PURE__*/_jsx(Body,{type:Typography.SCREEN_TITLE,children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("SPAN"),expect(a).toHaveClass("np-text-".concat(Typography.BODY_DEFAULT))})});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Typography}from"../common/propsValues/typography";import Title from"../title";import Body from"./Body";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export default{component:Body,title:"Typography | Body"};export var Basic=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.SUBSECTION_TITLE,children:"Body Large Bold"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.SUBSECTION_TITLE,children:"Body Default"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.SUBSECTION_TITLE,children:"Body Default Bold"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.SUBSECTION_TITLE,children:"Body Large"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs(Title,{type:Typography.SUBSECTION_TITLE,children:["Copy Example without ",/*#__PURE__*/_jsx("code",{children:"<Body />"})," component"]}),/*#__PURE__*/_jsx("p",{children:"Lorem ipsum dolor sit amet consectetur adipisicing elit. Explicabo saepe repellendus accusantium eveniet temporibus perspiciatis iure ut, pariatur nihil totam iusto, delectus, modi possimus soluta. Et iusto odio autem debitis!"}),/*#__PURE__*/_jsx(Title,{type:Typography.SUBSECTION_TITLE,children:"Copy Example without any HTML tag"}),"Lorem ipsum dolor sit amet consectetur adipisicing elit. Explicabo saepe repellendus accusantium eveniet temporibus perspiciatis iure ut, pariatur nihil totam iusto, delectus, modi possimus soluta. Et iusto odio autem debitis!"]})};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./Body";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var Typography;(function(a){a.SCREEN_TITLE="screen-title",a.SECTION_TITLE="section-title",a.SUBSECTION_TITLE="subsection-title",a.BODY_TITLE="body-title",a.GROUP_TITLE="group-title",a.BODY_LARGE="body-large",a.BODY_DEFAULT="body-default",a.BODY_DEFAULT_BOLD="body-default-bold",a.BODY_LARGE_BOLD="body-large-bold",a.LINK_LARGE="link-large",a.LINK_DEFAULT="link-default"})(Typography||(Typography={}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _titleTypeMapping,_excluded=["as","type","className"];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{Typography}from"../common";import{jsx as _jsx}from"react/jsx-runtime";var DEFAULT_TYPE=Typography.GROUP_TITLE,titleTypeMapping=(_titleTypeMapping={},_defineProperty(_titleTypeMapping,Typography.SCREEN_TITLE,"h1"),_defineProperty(_titleTypeMapping,Typography.SECTION_TITLE,"h2"),_defineProperty(_titleTypeMapping,Typography.SUBSECTION_TITLE,"h3"),_defineProperty(_titleTypeMapping,Typography.BODY_TITLE,"h4"),_defineProperty(_titleTypeMapping,Typography.GROUP_TITLE,"h5"),_titleTypeMapping);function Title(a){var b=a.as,c=a.type,d=void 0===c?DEFAULT_TYPE:c,e=a.className,f=_objectWithoutProperties(a,_excluded),g=titleTypeMapping[d];if(g!==void 0){var i=null!==b&&void 0!==b?b:"".concat(g);return/*#__PURE__*/_jsx(i,_objectSpread(_objectSpread({},f),{},{className:classNames("np-text-".concat(d),e)}))}var h=null!==b&&void 0!==b?b:"".concat(titleTypeMapping[DEFAULT_TYPE]);return/*#__PURE__*/_jsx(h,_objectSpread(_objectSpread({},f),{},{className:classNames("np-text-".concat(DEFAULT_TYPE),e)}))}export default Title;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Typography}from"../common";import{render,screen}from"../test-utils";import Title from".";import{jsx as _jsx}from"react/jsx-runtime";describe("Title",function(){it("testing default state",function(){render(/*#__PURE__*/_jsx(Title,{children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("H5"),expect(a).toHaveClass("np-text-".concat(Typography.GROUP_TITLE))}),it("enforces tag via `as` prop",function(){render(/*#__PURE__*/_jsx(Title,{as:"span",children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("SPAN"),expect(a).toHaveClass("np-text-".concat(Typography.GROUP_TITLE))}),it("supports native HTML attrs",function(){render(/*#__PURE__*/_jsx(Title,{id:"test-id",role:"banner",children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a).toHaveAttribute("id","test-id"),expect(a).toHaveAttribute("role","banner")}),it("handles unsupported typography type",function(){render(/*#__PURE__*/_jsx(Title,{type:Typography.BODY_LARGE_BOLD,children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("H5"),expect(a).toHaveClass("np-text-".concat(Typography.GROUP_TITLE))})});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Typography}from"../common/propsValues/typography";import Title from"./Title";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:Title,title:"Typography | Title"};export var Basic=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Title,{type:Typography.SCREEN_TITLE,children:"Screen Title"}),/*#__PURE__*/_jsx(Title,{type:Typography.SECTION_TITLE,className:"m-t-3",children:"Section Title"}),/*#__PURE__*/_jsx(Title,{type:Typography.SUBSECTION_TITLE,className:"m-t-3",children:"Subsection Title"}),/*#__PURE__*/_jsx(Title,{type:Typography.BODY_TITLE,className:"m-t-3",children:"Body Title"}),/*#__PURE__*/_jsx(Title,{type:Typography.GROUP_TITLE,className:"m-t-3",children:"Group Title"})]})};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./Title";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["as","type","className"];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.iterator.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.set.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/web.dom-collections.iterator.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";import classNames from"classnames";import{Typography}from"../common/propsValues/typography";import{jsx as _jsx}from"react/jsx-runtime";var DEFAULT_TYPE=Typography.BODY_DEFAULT,bodyTypes=new Set([Typography.BODY_DEFAULT,Typography.BODY_DEFAULT_BOLD,Typography.BODY_LARGE,Typography.BODY_LARGE_BOLD]);function Body(a){var b=a.as,c=void 0===b?"span":b,d=a.type,e=void 0===d?DEFAULT_TYPE:d,f=a.className,g=_objectWithoutProperties(a,_excluded),h=bodyTypes.has(e);return/*#__PURE__*/_jsx(c,_objectSpread(_objectSpread({},g),{},{className:classNames("np-text-".concat(h?e:DEFAULT_TYPE),f)}))}export default Body;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Typography}from"../common";import{render,screen}from"../test-utils";import Body from".";import{jsx as _jsx}from"react/jsx-runtime";describe("Body",function(){it("testing default state",function(){render(/*#__PURE__*/_jsx(Body,{children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("SPAN"),expect(a).toHaveClass("np-text-".concat(Typography.BODY_DEFAULT))}),it("enforces tag via `as` prop",function(){render(/*#__PURE__*/_jsx(Body,{as:"p",children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("P"),expect(a).toHaveClass("np-text-".concat(Typography.BODY_DEFAULT))}),it("supports native HTML attrs",function(){render(/*#__PURE__*/_jsx(Body,{id:"test-id",role:"banner",children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a).toHaveAttribute("id","test-id"),expect(a).toHaveAttribute("role","banner")}),it("handles unsupported typography type",function(){render(/*#__PURE__*/_jsx(Body,{type:Typography.SCREEN_TITLE,children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("SPAN"),expect(a).toHaveClass("np-text-".concat(Typography.BODY_DEFAULT))})});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Typography}from"../common/propsValues/typography";import Title from"../title";import Body from"./Body";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export default{component:Body,title:"Typography | Body"};export var Basic=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.SUBSECTION_TITLE,children:"Body Large Bold"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.SUBSECTION_TITLE,children:"Body Default"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.SUBSECTION_TITLE,children:"Body Default Bold"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.SUBSECTION_TITLE,children:"Body Large"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs(Title,{type:Typography.SUBSECTION_TITLE,children:["Copy Example without ",/*#__PURE__*/_jsx("code",{children:"<Body />"})," component"]}),/*#__PURE__*/_jsx("p",{children:"Lorem ipsum dolor sit amet consectetur adipisicing elit. Explicabo saepe repellendus accusantium eveniet temporibus perspiciatis iure ut, pariatur nihil totam iusto, delectus, modi possimus soluta. Et iusto odio autem debitis!"}),/*#__PURE__*/_jsx(Title,{type:Typography.SUBSECTION_TITLE,children:"Copy Example without any HTML tag"}),"Lorem ipsum dolor sit amet consectetur adipisicing elit. Explicabo saepe repellendus accusantium eveniet temporibus perspiciatis iure ut, pariatur nihil totam iusto, delectus, modi possimus soluta. Et iusto odio autem debitis!"]})};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./Body";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var Typography;(function(a){a.SCREEN_TITLE="screen-title",a.SECTION_TITLE="section-title",a.SUBSECTION_TITLE="subsection-title",a.BODY_TITLE="body-title",a.GROUP_TITLE="group-title",a.BODY_LARGE="body-large",a.BODY_DEFAULT="body-default",a.BODY_DEFAULT_BOLD="body-default-bold",a.BODY_LARGE_BOLD="body-large-bold",a.LINK_LARGE="link-large",a.LINK_DEFAULT="link-default"})(Typography||(Typography={}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";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.to-string.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";var _titleTypeMapping,_excluded=["as","type","className"];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{Typography}from"../common";import{jsx as _jsx}from"react/jsx-runtime";var DEFAULT_TYPE=Typography.GROUP_TITLE,titleTypeMapping=(_titleTypeMapping={},_defineProperty(_titleTypeMapping,Typography.SCREEN_TITLE,"h1"),_defineProperty(_titleTypeMapping,Typography.SECTION_TITLE,"h2"),_defineProperty(_titleTypeMapping,Typography.SUBSECTION_TITLE,"h3"),_defineProperty(_titleTypeMapping,Typography.BODY_TITLE,"h4"),_defineProperty(_titleTypeMapping,Typography.GROUP_TITLE,"h5"),_titleTypeMapping);function Title(a){var b=a.as,c=a.type,d=void 0===c?DEFAULT_TYPE:c,e=a.className,f=_objectWithoutProperties(a,_excluded),g=titleTypeMapping[d];if(g!==void 0){var i=null!==b&&void 0!==b?b:"".concat(g);return/*#__PURE__*/_jsx(i,_objectSpread(_objectSpread({},f),{},{className:classNames("np-text-".concat(d),e)}))}var h=null!==b&&void 0!==b?b:"".concat(titleTypeMapping[DEFAULT_TYPE]);return/*#__PURE__*/_jsx(h,_objectSpread(_objectSpread({},f),{},{className:classNames("np-text-".concat(DEFAULT_TYPE),e)}))}export default Title;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Typography}from"../common";import{render,screen}from"../test-utils";import Title from".";import{jsx as _jsx}from"react/jsx-runtime";describe("Title",function(){it("testing default state",function(){render(/*#__PURE__*/_jsx(Title,{children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("H5"),expect(a).toHaveClass("np-text-".concat(Typography.GROUP_TITLE))}),it("enforces tag via `as` prop",function(){render(/*#__PURE__*/_jsx(Title,{as:"span",children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("SPAN"),expect(a).toHaveClass("np-text-".concat(Typography.GROUP_TITLE))}),it("supports native HTML attrs",function(){render(/*#__PURE__*/_jsx(Title,{id:"test-id",role:"banner",children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a).toHaveAttribute("id","test-id"),expect(a).toHaveAttribute("role","banner")}),it("handles unsupported typography type",function(){render(/*#__PURE__*/_jsx(Title,{type:Typography.BODY_LARGE_BOLD,children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("H5"),expect(a).toHaveClass("np-text-".concat(Typography.GROUP_TITLE))})});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Typography}from"../common/propsValues/typography";import Title from"./Title";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:Title,title:"Typography | Title"};export var Basic=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Title,{type:Typography.SCREEN_TITLE,children:"Screen Title"}),/*#__PURE__*/_jsx(Title,{type:Typography.SECTION_TITLE,className:"m-t-3",children:"Section Title"}),/*#__PURE__*/_jsx(Title,{type:Typography.SUBSECTION_TITLE,className:"m-t-3",children:"Subsection Title"}),/*#__PURE__*/_jsx(Title,{type:Typography.BODY_TITLE,className:"m-t-3",children:"Body Title"}),/*#__PURE__*/_jsx(Title,{type:Typography.GROUP_TITLE,className:"m-t-3",children:"Group Title"})]})};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./Title";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
2
|
-
import { BodyTypes } from '../common/propsValues/typography';
|
|
3
|
-
declare type Props = HTMLAttributes<HTMLSpanElement | HTMLParagraphElement> & {
|
|
4
|
-
/**
|
|
5
|
-
* Default value: {@link DEFAULT_TYPE}
|
|
6
|
-
*/
|
|
7
|
-
type?: BodyTypes;
|
|
8
|
-
/**
|
|
9
|
-
* Default value: `span`
|
|
10
|
-
*/
|
|
11
|
-
as?: 'span' | 'p';
|
|
12
|
-
};
|
|
13
|
-
declare function Body({ as: Element, type, className, ...props }: Props): JSX.Element;
|
|
14
|
-
export default Body;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './Body';
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export declare enum Typography {
|
|
2
|
-
SCREEN_TITLE = "screen-title",
|
|
3
|
-
SECTION_TITLE = "section-title",
|
|
4
|
-
SUBSECTION_TITLE = "subsection-title",
|
|
5
|
-
BODY_TITLE = "body-title",
|
|
6
|
-
GROUP_TITLE = "group-title",
|
|
7
|
-
BODY_LARGE = "body-large",
|
|
8
|
-
BODY_DEFAULT = "body-default",
|
|
9
|
-
BODY_DEFAULT_BOLD = "body-default-bold",
|
|
10
|
-
BODY_LARGE_BOLD = "body-large-bold",
|
|
11
|
-
LINK_LARGE = "link-large",
|
|
12
|
-
LINK_DEFAULT = "link-default"
|
|
13
|
-
}
|
|
14
|
-
export declare type ScreenTitle = 'screen-title';
|
|
15
|
-
export declare type SectionTitle = 'section-title';
|
|
16
|
-
export declare type SubsectionTitle = 'subsection-title';
|
|
17
|
-
export declare type BodyTitle = 'body-title';
|
|
18
|
-
export declare type GroupTitle = 'group-title';
|
|
19
|
-
export declare type TitleTypes = ScreenTitle | SectionTitle | SubsectionTitle | BodyTitle | GroupTitle;
|
|
20
|
-
export declare type BodyTypes = BodyLargeBold | BodyDefault | BodyLarge | BodyDefaultBold;
|
|
21
|
-
export declare type BodyDefault = 'body-default';
|
|
22
|
-
export declare type BodyLargeBold = 'body-large-bold';
|
|
23
|
-
export declare type BodyDefaultBold = 'body-default-bold';
|
|
24
|
-
export declare type BodyLarge = 'body-large';
|
|
25
|
-
export declare type LinkDefault = 'link-default';
|
|
26
|
-
export declare type LinkLarge = 'link-large';
|
|
27
|
-
export declare type TypographyTypes = ScreenTitle | SectionTitle | SubsectionTitle | BodyTitle | GroupTitle | BodyDefault | BodyLargeBold | BodyDefaultBold | BodyLarge | LinkDefault | LinkLarge;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { LabelHTMLAttributes, LiHTMLAttributes } from 'react';
|
|
2
|
-
import { TitleTypes, Heading } from '../common';
|
|
3
|
-
declare type Props = LabelHTMLAttributes<HTMLHeadingElement | HTMLSpanElement | HTMLLabelElement> & LiHTMLAttributes<HTMLLIElement> & {
|
|
4
|
-
/**
|
|
5
|
-
* Default value will based one `type` prop
|
|
6
|
-
*/
|
|
7
|
-
as?: 'span' | 'label' | 'li' | Heading;
|
|
8
|
-
/**
|
|
9
|
-
* Default value: {@link DEFAULT_TYPE}
|
|
10
|
-
*/
|
|
11
|
-
type?: TitleTypes;
|
|
12
|
-
};
|
|
13
|
-
declare function Title({ as, type, className, ...props }: Props): JSX.Element;
|
|
14
|
-
export default Title;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './Title';
|