@mrshmllw/smores-react 2.19.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion/Accordion.d.ts +1 -0
- package/dist/Accordion/Accordion.js +16 -12
- package/dist/Accordion/Accordion.js.map +1 -1
- package/dist/Accordion/Accordion.stories.d.ts +1 -2
- package/dist/Accordion/Accordion.stories.js +2 -8
- package/dist/Accordion/Accordion.stories.js.map +1 -1
- package/dist/Accordion/Collection.d.ts +2 -0
- package/dist/Accordion/Collection.js +52 -0
- package/dist/Accordion/Collection.js.map +1 -0
- package/dist/Accordion/__tests__/Accordion.js +9 -0
- package/dist/Accordion/__tests__/Accordion.js.map +1 -0
- package/dist/ActionDropdown/ActionDropdown.js +7 -7
- package/dist/ActionDropdown/ActionDropdown.js.map +1 -1
- package/dist/ActionDropdown/ActionDropdown.stories.js +1 -1
- package/dist/ActionDropdown/Container.js +16 -10
- package/dist/ActionDropdown/Container.js.map +1 -1
- package/dist/ActionDropdown/List.js +3 -3
- package/dist/ActionDropdown/List.js.map +1 -1
- package/dist/ActionDropdown/__tests__/ActionDropdown.js +3 -3
- package/dist/ActionDropdown/__tests__/ActionDropdown.js.map +1 -1
- package/dist/Banner/Banner.stories.d.ts +9 -0
- package/dist/Banner/Banner.stories.js +86 -0
- package/dist/Banner/Banner.stories.js.map +1 -0
- package/dist/Banner/BannerContainer.d.ts +7 -0
- package/dist/Banner/BannerContainer.js +40 -0
- package/dist/Banner/BannerContainer.js.map +1 -0
- package/dist/Banner/BannerItem.d.ts +7 -0
- package/dist/Banner/BannerItem.js +64 -0
- package/dist/Banner/BannerItem.js.map +1 -0
- package/dist/Banner/hooks.d.ts +3 -0
- package/dist/Banner/hooks.js +6 -0
- package/dist/Banner/hooks.js.map +1 -0
- package/dist/Banner/index.d.ts +2 -0
- package/dist/Banner/index.js +3 -0
- package/dist/Banner/index.js.map +1 -0
- package/dist/Banner/types.d.ts +18 -0
- package/dist/Banner/types.js +2 -0
- package/dist/Banner/types.js.map +1 -0
- package/dist/Box/Box.stories.js +2 -2
- package/dist/Box/Box.stories.js.map +1 -1
- package/dist/BrandCard/BrandCard.d.ts +27 -0
- package/dist/BrandCard/BrandCard.js +60 -0
- package/dist/BrandCard/BrandCard.js.map +1 -0
- package/dist/BrandCard/BrandCard.stories.d.ts +11 -0
- package/dist/BrandCard/BrandCard.stories.js +54 -0
- package/dist/BrandCard/BrandCard.stories.js.map +1 -0
- package/dist/BrandCard/__tests__/BrandCard.js +9 -0
- package/dist/BrandCard/__tests__/BrandCard.js.map +1 -0
- package/dist/BrandCard/index.d.ts +1 -0
- package/dist/BrandCard/index.js +2 -0
- package/dist/BrandCard/index.js.map +1 -0
- package/dist/Button/Button.d.ts +4 -6
- package/dist/Button/Button.js +52 -54
- package/dist/Button/Button.js.map +1 -1
- package/dist/Button/Button.stories.js +1 -1
- package/dist/Button/Collection.d.ts +2 -0
- package/dist/Button/Collection.js +4 -2
- package/dist/Button/Collection.js.map +1 -1
- package/dist/Button/LegacyButton.js +6 -6
- package/dist/Button/LegacyButton.js.map +1 -1
- package/dist/Button/__tests__/Button.js.map +1 -1
- package/dist/Card/Card.d.ts +19 -1
- package/dist/Card/Card.js +42 -10
- package/dist/Card/Card.js.map +1 -1
- package/dist/Card/Card.stories.d.ts +8 -4
- package/dist/Card/Card.stories.js +74 -18
- package/dist/Card/Card.stories.js.map +1 -1
- package/dist/CheckBox/CheckBox.js +39 -16
- package/dist/CheckBox/CheckBox.js.map +1 -1
- package/dist/Chip/Chip.js +15 -9
- package/dist/Chip/Chip.js.map +1 -1
- package/dist/Datepicker/Datepicker.d.ts +3 -0
- package/dist/Datepicker/Datepicker.js +34 -20
- package/dist/Datepicker/Datepicker.js.map +1 -1
- package/dist/Datepicker/DatesList.js +18 -10
- package/dist/Datepicker/DatesList.js.map +1 -1
- package/dist/Divider/Divider.js +1 -1
- package/dist/Divider/Divider.js.map +1 -1
- package/dist/Dropdown/Collection.d.ts +2 -0
- package/dist/Dropdown/Collection.js +91 -0
- package/dist/Dropdown/Collection.js.map +1 -0
- package/dist/Dropdown/Dropdown.d.ts +2 -1
- package/dist/Dropdown/Dropdown.js +24 -30
- package/dist/Dropdown/Dropdown.js.map +1 -1
- package/dist/Dropdown/Dropdown.stories.d.ts +2 -16
- package/dist/Dropdown/Dropdown.stories.js +7 -156
- package/dist/Dropdown/Dropdown.stories.js.map +1 -1
- package/dist/Icon/Icon.js +1 -1
- package/dist/Icon/Icon.stories.js +2 -2
- package/dist/IconStrict/IconStrict.d.ts +20 -0
- package/dist/IconStrict/IconStrict.js +50 -0
- package/dist/IconStrict/IconStrict.js.map +1 -0
- package/dist/IconStrict/IconStrict.stories.d.ts +11 -0
- package/dist/IconStrict/IconStrict.stories.js +33 -0
- package/dist/IconStrict/IconStrict.stories.js.map +1 -0
- package/dist/IconStrict/__tests__/IconStrict.js +9 -0
- package/dist/IconStrict/__tests__/IconStrict.js.map +1 -0
- package/dist/IconStrict/index.d.ts +1 -0
- package/dist/IconStrict/index.js +2 -0
- package/dist/IconStrict/index.js.map +1 -0
- package/dist/IconWrapper/IconWrapper.js +2 -2
- package/dist/IconWrapper/IconWrapper.js.map +1 -1
- package/dist/LabelledText/LabelledText.js +1 -1
- package/dist/LabelledText/LabelledText.js.map +1 -1
- package/dist/Link/Link.d.ts +3 -0
- package/dist/Link/Link.js +10 -13
- package/dist/Link/Link.js.map +1 -1
- package/dist/Link/Link.stories.d.ts +2 -0
- package/dist/Link/Link.stories.js +5 -1
- package/dist/Link/Link.stories.js.map +1 -1
- package/dist/Loader/Loader.js +1 -1
- package/dist/Loader/Loader.js.map +1 -1
- package/dist/Loader/Loader.stories.d.ts +1 -1
- package/dist/Loader/Loader.stories.js +3 -3
- package/dist/Loader/Loader.stories.js.map +1 -1
- package/dist/Loader/__tests__/Loader.js +1 -1
- package/dist/Loader/__tests__/Loader.js.map +1 -1
- package/dist/Modal/Modal.js +6 -23
- package/dist/Modal/Modal.js.map +1 -1
- package/dist/NumberInput/Collection.d.ts +2 -0
- package/dist/NumberInput/Collection.js +97 -0
- package/dist/NumberInput/Collection.js.map +1 -0
- package/dist/NumberInput/NumberInput.d.ts +1 -6
- package/dist/NumberInput/NumberInput.js +13 -89
- package/dist/NumberInput/NumberInput.js.map +1 -1
- package/dist/NumberInput/NumberInput.stories.d.ts +2 -7
- package/dist/NumberInput/NumberInput.stories.js +5 -73
- package/dist/NumberInput/NumberInput.stories.js.map +1 -1
- package/dist/Pagination/Pagination.js +43 -12
- package/dist/Pagination/Pagination.js.map +1 -1
- package/dist/Pagination/Pagination.stories.js +8 -1
- package/dist/Pagination/Pagination.stories.js.map +1 -1
- package/dist/RadioGroup/RadioElement.js +4 -4
- package/dist/RadioGroup/RadioElement.js.map +1 -1
- package/dist/RadioGroup/RadioGroup.d.ts +4 -0
- package/dist/RadioGroup/RadioGroup.js +2 -2
- package/dist/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/RadioGroup/RadioGroup.stories.d.ts +3 -0
- package/dist/RadioGroup/RadioGroup.stories.js +2 -0
- package/dist/RadioGroup/RadioGroup.stories.js.map +1 -1
- package/dist/RadioGroup/RadioItem.d.ts +2 -0
- package/dist/RadioGroup/RadioItem.js +25 -9
- package/dist/RadioGroup/RadioItem.js.map +1 -1
- package/dist/Row/Row.js +14 -8
- package/dist/Row/Row.js.map +1 -1
- package/dist/Row/Row.stories.js +1 -1
- package/dist/SearchInput/Container.js +2 -2
- package/dist/SearchInput/Container.js.map +1 -1
- package/dist/SearchInput/SearchInput.d.ts +0 -2
- package/dist/SearchInput/SearchInput.js +8 -55
- package/dist/SearchInput/SearchInput.js.map +1 -1
- package/dist/SearchInput/SearchInput.stories.d.ts +0 -1
- package/dist/SearchInput/SearchInput.stories.js +0 -5
- package/dist/SearchInput/SearchInput.stories.js.map +1 -1
- package/dist/SearchInput/SearchOptions.d.ts +0 -2
- package/dist/SearchInput/SearchOptions.js +12 -16
- package/dist/SearchInput/SearchOptions.js.map +1 -1
- package/dist/Snackbar/SnackbarContainer.js +1 -1
- package/dist/Snackbar/SnackbarItem.js +5 -5
- package/dist/Snackbar/SnackbarItem.js.map +1 -1
- package/dist/SupportMessage/Collection.js +6 -1
- package/dist/SupportMessage/Collection.js.map +1 -1
- package/dist/SupportMessage/SupportMessage.d.ts +1 -1
- package/dist/SupportMessage/SupportMessage.js +27 -26
- package/dist/SupportMessage/SupportMessage.js.map +1 -1
- package/dist/Tag/Collection.d.ts +2 -0
- package/dist/Tag/Collection.js +77 -0
- package/dist/Tag/Collection.js.map +1 -0
- package/dist/Tag/Tag.d.ts +3 -13
- package/dist/Tag/Tag.js +7 -8
- package/dist/Tag/Tag.js.map +1 -1
- package/dist/Tag/Tag.stories.d.ts +1 -1
- package/dist/Tag/Tag.stories.js +5 -9
- package/dist/Tag/Tag.stories.js.map +1 -1
- package/dist/Tag/__tests__/Tag.js +1 -1
- package/dist/Tag/__tests__/Tag.js.map +1 -1
- package/dist/Text/Text.js +1 -1
- package/dist/Text/Text.stories.js +4 -4
- package/dist/Text/Text.stories.js.map +1 -1
- package/dist/Text/fontMapping.js +1 -1
- package/dist/TextInput/Collection.d.ts +2 -0
- package/dist/TextInput/Collection.js +69 -0
- package/dist/TextInput/Collection.js.map +1 -0
- package/dist/TextInput/TextInput.d.ts +0 -3
- package/dist/TextInput/TextInput.js +7 -60
- package/dist/TextInput/TextInput.js.map +1 -1
- package/dist/TextInput/TextInput.stories.d.ts +2 -10
- package/dist/TextInput/TextInput.stories.js +5 -111
- package/dist/TextInput/TextInput.stories.js.map +1 -1
- package/dist/Textarea/Container.js +1 -1
- package/dist/Textarea/Container.js.map +1 -1
- package/dist/Textarea/Textarea.d.ts +1 -0
- package/dist/Textarea/Textarea.js +10 -16
- package/dist/Textarea/Textarea.js.map +1 -1
- package/dist/Textarea/Textarea.stories.js +2 -0
- package/dist/Textarea/Textarea.stories.js.map +1 -1
- package/dist/Toggle/Toggle.js +19 -13
- package/dist/Toggle/Toggle.js.map +1 -1
- package/dist/Tooltip/Tooltip.d.ts +3 -3
- package/dist/Tooltip/Tooltip.js +16 -13
- package/dist/Tooltip/Tooltip.js.map +1 -1
- package/dist/Tooltip/Tooltip.stories.d.ts +1 -0
- package/dist/Tooltip/Tooltip.stories.js +15 -4
- package/dist/Tooltip/Tooltip.stories.js.map +1 -1
- package/dist/colors.stories.js +37 -11
- package/dist/colors.stories.js.map +1 -1
- package/dist/fields/Field/Field.d.ts +0 -1
- package/dist/fields/Field/Field.js.map +1 -1
- package/dist/fields/Fieldset/Fieldset.js +1 -1
- package/dist/fields/Fieldset/Fieldset.js.map +1 -1
- package/dist/fields/commonFieldTypes.d.ts +4 -3
- package/dist/fields/components/CommonInput.d.ts +18 -0
- package/dist/fields/components/CommonInput.js +64 -0
- package/dist/fields/components/CommonInput.js.map +1 -0
- package/dist/fields/components/InternalField.d.ts +3 -3
- package/dist/fields/components/InternalField.js +7 -7
- package/dist/fields/components/InternalField.js.map +1 -1
- package/dist/fields/components/Placeholder.js +3 -3
- package/dist/fields/components/Placeholder.js.map +1 -1
- package/dist/fontStyle.js +2 -2
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/theme.d.ts +58 -28
- package/dist/theme.js +34 -18
- package/dist/theme.js.map +1 -1
- package/dist/utils/focusOutline.d.ts +1 -0
- package/dist/utils/focusOutline.js +7 -1
- package/dist/utils/focusOutline.js.map +1 -1
- package/package.json +2 -1
- package/dist/ConfirmationRadioButtons/Confirmation.d.ts +0 -17
- package/dist/ConfirmationRadioButtons/Confirmation.js +0 -100
- package/dist/ConfirmationRadioButtons/Confirmation.js.map +0 -1
- package/dist/ConfirmationRadioButtons/Confirmation.stories.d.ts +0 -21
- package/dist/ConfirmationRadioButtons/Confirmation.stories.js +0 -76
- package/dist/ConfirmationRadioButtons/Confirmation.stories.js.map +0 -1
- package/dist/ConfirmationRadioButtons/Container.d.ts +0 -2
- package/dist/ConfirmationRadioButtons/Container.js +0 -8
- package/dist/ConfirmationRadioButtons/Container.js.map +0 -1
- package/dist/ConfirmationRadioButtons/RadioButtonStyled.d.ts +0 -17
- package/dist/ConfirmationRadioButtons/RadioButtonStyled.js +0 -41
- package/dist/ConfirmationRadioButtons/RadioButtonStyled.js.map +0 -1
- package/dist/ConfirmationRadioButtons/__tests__/Confirmation.js +0 -8
- package/dist/ConfirmationRadioButtons/__tests__/Confirmation.js.map +0 -1
- package/dist/ConfirmationRadioButtons/index.d.ts +0 -1
- package/dist/ConfirmationRadioButtons/index.js +0 -2
- package/dist/ConfirmationRadioButtons/index.js.map +0 -1
- package/dist/Message/Message.d.ts +0 -21
- package/dist/Message/Message.js +0 -45
- package/dist/Message/Message.js.map +0 -1
- package/dist/Message/Message.stories.d.ts +0 -13
- package/dist/Message/Message.stories.js +0 -38
- package/dist/Message/Message.stories.js.map +0 -1
- package/dist/Message/__tests__/Message.js +0 -26
- package/dist/Message/__tests__/Message.js.map +0 -1
- package/dist/Message/index.d.ts +0 -1
- package/dist/Message/index.js +0 -2
- package/dist/Message/index.js.map +0 -1
- package/dist/RadioButton/Container.d.ts +0 -2
- package/dist/RadioButton/Container.js +0 -9
- package/dist/RadioButton/Container.js.map +0 -1
- package/dist/RadioButton/RadioButton.d.ts +0 -10
- package/dist/RadioButton/RadioButton.js +0 -68
- package/dist/RadioButton/RadioButton.js.map +0 -1
- package/dist/RadioButton/RadioButton.stories.d.ts +0 -15
- package/dist/RadioButton/RadioButton.stories.js +0 -29
- package/dist/RadioButton/RadioButton.stories.js.map +0 -1
- package/dist/RadioButton/__tests__/RadioButton.js +0 -13
- package/dist/RadioButton/__tests__/RadioButton.js.map +0 -1
- package/dist/RadioButton/index.d.ts +0 -1
- package/dist/RadioButton/index.js +0 -2
- package/dist/RadioButton/index.js.map +0 -1
- /package/dist/{ConfirmationRadioButtons/__tests__/Confirmation.d.ts → Accordion/__tests__/Accordion.d.ts} +0 -0
- /package/dist/{Message/__tests__/Message.d.ts → BrandCard/__tests__/BrandCard.d.ts} +0 -0
- /package/dist/{RadioButton/__tests__/RadioButton.d.ts → IconStrict/__tests__/IconStrict.d.ts} +0 -0
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { render } from '@testing-library/react';
|
3
|
+
import 'jest-styled-components';
|
4
|
+
import { IconStrict } from '../IconStrict';
|
5
|
+
test('renders', () => {
|
6
|
+
const { container } = render(React.createElement(IconStrict, { render: "at", size: "48" }));
|
7
|
+
expect(container.firstChild).toMatchSnapshot();
|
8
|
+
});
|
9
|
+
//# sourceMappingURL=IconStrict.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"IconStrict.js","sourceRoot":"","sources":["../../../src/IconStrict/__tests__/IconStrict.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,wBAAwB,CAAA;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;IACnB,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,oBAAC,UAAU,IAAC,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,IAAI,GAAG,CAAC,CAAA;IAClE,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,eAAe,EAAE,CAAA;AAChD,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './IconStrict';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/IconStrict/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
@@ -18,8 +18,8 @@ export const IconWrapper = (_a) => {
|
|
18
18
|
return (React.createElement(Container, Object.assign({ className: className }, marginProps),
|
19
19
|
children,
|
20
20
|
React.createElement(IconContainer, { size: size, t: t, r: r, b: b, l: l },
|
21
|
-
render === 'included' && (React.createElement(Icon, { render: "included", size: size, color: "
|
22
|
-
render === 'excluded' && (React.createElement(Icon, { render: "excluded", size: size, color: "
|
21
|
+
render === 'included' && (React.createElement(Icon, { render: "included", size: size, color: "apple" })),
|
22
|
+
render === 'excluded' && (React.createElement(Icon, { render: "excluded", size: size, color: "strawberry" })))));
|
23
23
|
};
|
24
24
|
const Container = styled(Box) `
|
25
25
|
position: relative;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"IconWrapper.js","sourceRoot":"","sources":["../../src/IconWrapper/IconWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAwB,MAAM,OAAO,CAAA;AAC5C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAmB9B,MAAM,CAAC,MAAM,WAAW,GAAyB,CAAC,EAUjD,EAAE,EAAE;QAV6C,EAChD,SAAS,GAAG,EAAE,EACd,QAAQ,EACR,IAAI,GAAG,EAAE,EACT,MAAM,GAAG,UAAU,EACnB,CAAC,GAAG,MAAM,EACV,CAAC,GAAG,MAAM,EACV,CAAC,GAAG,MAAM,EACV,CAAC,GAAG,MAAM,OAEX,EADI,WAAW,cATkC,+DAUjD,CADe;IACV,OAAA,CACJ,oBAAC,SAAS,kBAAC,SAAS,EAAE,SAAS,IAAM,WAAW;QAC7C,QAAQ;QACT,oBAAC,aAAa,IAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;YAC9C,MAAM,KAAK,UAAU,IAAI,CACxB,oBAAC,IAAI,IAAC,MAAM,EAAC,UAAU,EAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAC,
|
1
|
+
{"version":3,"file":"IconWrapper.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AC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;;;iBAGd,IAAI;cACP,IAAI;WACP,CAAC;aACC,CAAC;cACA,CAAC;YACH,CAAC;GACV,CACF,CAAA"}
|
@@ -16,7 +16,7 @@ import { Box } from '../Box';
|
|
16
16
|
export const LabelledText = (_a) => {
|
17
17
|
var { label, children } = _a, marginProps = __rest(_a, ["label", "children"]);
|
18
18
|
return (React.createElement(Container, Object.assign({}, marginProps),
|
19
|
-
React.createElement(Text, { tag: "label", color: "
|
19
|
+
React.createElement(Text, { tag: "label", color: "sesame", typo: "label" }, label),
|
20
20
|
children));
|
21
21
|
};
|
22
22
|
const Container = styled(Box) `
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LabelledText.js","sourceRoot":"","sources":["../../src/LabelledText/LabelledText.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAwB,MAAM,OAAO,CAAA;AAC5C,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAGtC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAO5B,MAAM,CAAC,MAAM,YAAY,GAA0B,CAAC,EAInD,EAAE,EAAE;QAJ+C,EAClD,KAAK,EACL,QAAQ,OAET,EADI,WAAW,cAHoC,qBAInD,CADe;IACV,OAAA,CACJ,oBAAC,SAAS,oBAAK,WAAW;QACxB,oBAAC,IAAI,IAAC,GAAG,EAAC,OAAO,EAAC,KAAK,EAAC,
|
1
|
+
{"version":3,"file":"LabelledText.js","sourceRoot":"","sources":["../../src/LabelledText/LabelledText.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAwB,MAAM,OAAO,CAAA;AAC5C,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAGtC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAO5B,MAAM,CAAC,MAAM,YAAY,GAA0B,CAAC,EAInD,EAAE,EAAE;QAJ+C,EAClD,KAAK,EACL,QAAQ,OAET,EADI,WAAW,cAHoC,qBAInD,CADe;IACV,OAAA,CACJ,oBAAC,SAAS,oBAAK,WAAW;QACxB,oBAAC,IAAI,IAAC,GAAG,EAAC,OAAO,EAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,IAC1C,KAAK,CACD;QAEN,QAAQ,CACC,CACb,CAAA;CAAA,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;;;;;CAO5B,CAAA"}
|
package/dist/Link/Link.d.ts
CHANGED
package/dist/Link/Link.js
CHANGED
@@ -4,15 +4,16 @@ import { darken } from 'polished';
|
|
4
4
|
import { focusOutline } from '../utils/focusOutline';
|
5
5
|
import { theme } from '../theme';
|
6
6
|
import { Icon } from '../Icon';
|
7
|
-
export const Link = ({ className, href, onClick, openInNewTab, download, children, typo = 'regular', }) => {
|
8
|
-
return (React.createElement(LinkWrapper, Object.assign({ href: href, className: className, onClick: onClick, download: download, typo: typo }, (openInNewTab && {
|
7
|
+
export const Link = ({ className, href, onClick, openInNewTab, download, children, typo = 'regular', highlight = false, iconToRender = openInNewTab ? 'new-window' : '', isTrailingIcon = true, }) => {
|
8
|
+
return (React.createElement(LinkWrapper, Object.assign({ href: href, className: className, onClick: onClick, download: download, typo: typo, highlight: highlight }, (openInNewTab && {
|
9
9
|
rel: 'noopener noreferrer',
|
10
10
|
target: '_blank',
|
11
11
|
})),
|
12
|
+
iconToRender && !isTrailingIcon && (React.createElement(Icon, { mt: { custom: '3px' }, mr: { custom: '4px' }, render: iconToRender, size: typo === 'regular' ? 14 : 12, color: highlight ? 'lollipop' : 'liquorice' })),
|
12
13
|
children,
|
13
|
-
|
14
|
+
iconToRender && isTrailingIcon && (React.createElement(Icon, { mt: { custom: '3px' }, ml: { custom: '4px' }, render: iconToRender, size: typo === 'regular' ? 14 : 12, color: highlight ? 'lollipop' : 'liquorice' }))));
|
14
15
|
};
|
15
|
-
const LinkWrapper = styled.a(({ typo }) => css `
|
16
|
+
const LinkWrapper = styled.a(({ typo, highlight }) => css `
|
16
17
|
${focusOutline()}
|
17
18
|
display: inline-flex;
|
18
19
|
flex-direction: row;
|
@@ -31,24 +32,24 @@ const LinkWrapper = styled.a(({ typo }) => css `
|
|
31
32
|
|
32
33
|
font-weight: ${theme.font.weight.medium};
|
33
34
|
text-decoration: underline;
|
34
|
-
color: ${theme.colors.
|
35
|
+
color: ${highlight ? theme.colors.lollipop : theme.colors.liquorice};
|
35
36
|
|
36
37
|
background: none;
|
37
38
|
cursor: pointer;
|
38
39
|
|
39
40
|
&:hover {
|
40
|
-
color: ${
|
41
|
+
color: ${theme.colors.sesame};
|
41
42
|
|
42
43
|
path {
|
43
|
-
fill: ${
|
44
|
+
fill: ${theme.colors.sesame};
|
44
45
|
}
|
45
46
|
}
|
46
47
|
|
47
48
|
&:active {
|
48
|
-
color: ${theme.colors.
|
49
|
+
color: ${theme.colors.liquorice};
|
49
50
|
|
50
51
|
path {
|
51
|
-
fill: ${theme.colors.
|
52
|
+
fill: ${theme.colors.liquorice};
|
52
53
|
}
|
53
54
|
}
|
54
55
|
`);
|
@@ -73,8 +74,4 @@ export const linkStyleOverride = ({ color }) => css `
|
|
73
74
|
}
|
74
75
|
}
|
75
76
|
`;
|
76
|
-
const StyledIcon = styled(Icon) `
|
77
|
-
margin-left: 4px;
|
78
|
-
margin-top: 3px;
|
79
|
-
`;
|
80
77
|
//# sourceMappingURL=Link.js.map
|
package/dist/Link/Link.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../../src/Link/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAA;AAC/D,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE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AAE,KAAK,EAAqB,EAAE,EAAE,CAAC,GAAG,CAAA;MAChE,WAAW;aACJ,KAAK;;;cAGJ,KAAK;;;;eAIJ,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC;;;gBAGjB,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC;;;;CAIjC,CAAA"}
|
@@ -14,7 +14,11 @@ const linkArgs = {
|
|
14
14
|
};
|
15
15
|
export const Playground = Link.bind({});
|
16
16
|
Playground.args = linkArgs;
|
17
|
-
const
|
17
|
+
export const Highlighted = Link.bind({});
|
18
|
+
Highlighted.args = Object.assign(Object.assign({}, linkArgs), { highlight: true });
|
19
|
+
export const LeadingIcon = Link.bind({});
|
20
|
+
LeadingIcon.args = Object.assign(Object.assign({}, linkArgs), { iconToRender: 'new-window', isTrailingIcon: false });
|
21
|
+
const ParagraphDemo = (props) => (React.createElement(Text, { tag: "p", color: "apple" },
|
18
22
|
"Lorem Ipsum is simply dummy text of the printing and typesetting industry, more details ",
|
19
23
|
React.createElement(Link, Object.assign({}, props)),
|
20
24
|
". Lorem Ipsum has been the industrys standard dummy text ever since the 1500s."));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Link.stories.js","sourceRoot":"","sources":["../../src/Link/Link.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,OAAO,EAAE,IAAI,EAAa,MAAM,QAAQ,CAAA;AAExC,eAAe;IACb,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;CAC7C,CAAA;AAED,MAAM,QAAQ,GAAG;IACf,IAAI,EAAE,wBAAwB;IAC9B,YAAY,EAAE,IAAI;IAClB,QAAQ,EAAE,aAAa;IACvB,IAAI,EAAE,SAAS;CAChB,CAAA;AAED,MAAM,CAAC,MAAM,UA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IAAC,GAAG,EAAC,GAAG,EAAC,KAAK,EAAC,OAAO;;IAEZ,oBAAC,IAAI,oBAAK,KAAK,EAAI;qFAE3B,CACR,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACjD,WAAW,CAAC,IAAI,mCACX,QAAQ,KACX,IAAI,EAAE,2CAA2C,EACjD,QAAQ,EAAE,MAAM,GACjB,CAAA"}
|
package/dist/Loader/Loader.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import styled from 'styled-components';
|
3
3
|
import { theme } from '../theme';
|
4
|
-
export const Loader = ({ height, color = '
|
4
|
+
export const Loader = ({ height, color = 'marshmallowPink', }) => (React.createElement(LoaderSvg, { viewBox: "0 0 60 32", height: height, color: color },
|
5
5
|
React.createElement("g", { transform: "translate(30,18.5455) translate(-30,-9)" },
|
6
6
|
React.createElement(MarshOne, { id: "Marshmallow1", d: "M73.999,81.9767L73.6592,70.6087C73.6352,69.8071,73.1892,69.0806,72.4916,68.707C71.1747,68.0014,69.0105,67.648,66.0001,67.6467C62.9894,67.648,60.8254,68.0014,59.5084,68.707C58.8109,69.0806,58.3648,69.8071,58.3408,70.6087L58.001,81.9767C57.983,82.5754,58.2138,83.1538,58.6366,83.5705C60.0408,84.9546,62.4906,85.6467,65.986,85.6467C65.9907,85.6467,65.9953,85.6467,66.0001,85.6467C66.0047,85.6467,66.0094,85.6467,66.014,85.6467C69.5095,85.6467,71.9593,84.9546,73.3634,83.5705C73.7863,83.1538,74.0169,82.5754,73.999,81.9767", transform: "translate(-58,-67.6467)" }),
|
7
7
|
React.createElement(MarshTwo, { id: "Marshmallow2", d: "M73.999,81.9767L73.6592,70.6087C73.6352,69.8071,73.1892,69.0806,72.4916,68.707C71.1747,68.0014,69.0105,67.648,66.0001,67.6467C62.9894,67.648,60.8254,68.0014,59.5084,68.707C58.8109,69.0806,58.3648,69.8071,58.3408,70.6087L58.001,81.9767C57.983,82.5754,58.2138,83.1538,58.6366,83.5705C60.0408,84.9546,62.4906,85.6467,65.986,85.6467C65.9907,85.6467,65.9953,85.6467,66.0001,85.6467C66.0047,85.6467,66.0094,85.6467,66.014,85.6467C69.5095,85.6467,71.9593,84.9546,73.3634,83.5705C73.7863,83.1538,74.0169,82.5754,73.999,81.9767", transform: "translate(-36,-67.6467)" }),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Loader.js","sourceRoot":"","sources":["../../src/Loader/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAS,KAAK,EAAE,MAAM,UAAU,CAAA;AAOvC,MAAM,CAAC,MAAM,MAAM,GAAoB,CAAC,
|
1
|
+
{"version":3,"file":"Loader.js","sourceRoot":"","sources":["../../src/Loader/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAS,KAAK,EAAE,MAAM,UAAU,CAAA;AAOvC,MAAM,CAAC,MAAM,MAAM,GAAoB,CAAC,EACtC,MAAM,EACN,KAAK,GAAG,iBAAiB,GAC1B,EAAE,EAAE,CAAC,CACJ,oBAAC,SAAS,IAAC,OAAO,EAAC,WAAW,EAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK;IACzD,2BAAG,SAAS,EAAC,yCAAyC;QAEpD,oBAAC,QAAQ,IACP,EAAE,EAAC,cAAc,EACjB,CAAC,EAAC,wgBAAwgB,EAC1gB,SAAS,EAAC,yBAAyB,GACnC;QAEF,oBAAC,QAAQ,IACP,EAAE,EAAC,cAAc,EACjB,CAAC,EAAC,wgBAAwgB,EAC1gB,SAAS,EAAC,yBAAyB,GACnC;QAEF,oBAAC,UAAU,IACT,EAAE,EAAC,cAAc,EACjB,CAAC,EAAC,wgBAAwgB,EAC1gB,SAAS,EAAC,yBAAyB,GACnC,CACA,CACM,CACb,CAAA;AAQD,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAM;YACtB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM;;;YAGf,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8NvC,CAAA;AAED,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAA;;;CAG3B,CAAA;AAED,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAA;;;CAG3B,CAAA;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAA;;;CAG7B,CAAA"}
|
@@ -9,9 +9,9 @@ export const Default = Template.bind({});
|
|
9
9
|
Default.args = {
|
10
10
|
height: 32,
|
11
11
|
};
|
12
|
-
export const
|
13
|
-
|
12
|
+
export const BigLoader = Template.bind({});
|
13
|
+
BigLoader.args = {
|
14
14
|
height: 54,
|
15
|
-
color: '
|
15
|
+
color: 'liquorice',
|
16
16
|
};
|
17
17
|
//# sourceMappingURL=Loader.stories.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Loader.stories.js","sourceRoot":"","sources":["../../src/Loader/Loader.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,EAAe,MAAM,UAAU,CAAA;AAE9C,eAAe;IACb,KAAK,EAAE,QAAQ;IACf,SAAS,EAAE,MAAM;CAClB,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,KAAkB,EAAE,EAAE,CAAC,oBAAC,MAAM,oBAAK,KAAK,EAAI,CAAA;AAE9D,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAExC,OAAO,CAAC,IAAI,GAAG;IACb,MAAM,EAAE,EAAE;CACX,CAAA;AAED,MAAM,CAAC,MAAM,
|
1
|
+
{"version":3,"file":"Loader.stories.js","sourceRoot":"","sources":["../../src/Loader/Loader.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,EAAe,MAAM,UAAU,CAAA;AAE9C,eAAe;IACb,KAAK,EAAE,QAAQ;IACf,SAAS,EAAE,MAAM;CAClB,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,KAAkB,EAAE,EAAE,CAAC,oBAAC,MAAM,oBAAK,KAAK,EAAI,CAAA;AAE9D,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAExC,OAAO,CAAC,IAAI,GAAG;IACb,MAAM,EAAE,EAAE;CACX,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAE1C,SAAS,CAAC,IAAI,GAAG;IACf,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,WAAW;CACnB,CAAA"}
|
@@ -3,7 +3,7 @@ import { render } from '@testing-library/react';
|
|
3
3
|
import 'jest-styled-components';
|
4
4
|
import { Loader } from '../Loader';
|
5
5
|
test('renders', () => {
|
6
|
-
const { container } = render(React.createElement(Loader, { color: "
|
6
|
+
const { container } = render(React.createElement(Loader, { color: "marshmallowPink" }));
|
7
7
|
expect(container.firstChild).toMatchSnapshot();
|
8
8
|
});
|
9
9
|
//# sourceMappingURL=Loader.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Loader.js","sourceRoot":"","sources":["../../../src/Loader/__tests__/Loader.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,wBAAwB,CAAA;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;IACnB,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,oBAAC,MAAM,IAAC,KAAK,EAAC,
|
1
|
+
{"version":3,"file":"Loader.js","sourceRoot":"","sources":["../../../src/Loader/__tests__/Loader.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,wBAAwB,CAAA;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;IACnB,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,oBAAC,MAAM,IAAC,KAAK,EAAC,iBAAiB,GAAG,CAAC,CAAA;IAChE,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,eAAe,EAAE,CAAA;AAChD,CAAC,CAAC,CAAA"}
|
package/dist/Modal/Modal.js
CHANGED
@@ -3,10 +3,10 @@ import styled, { css } from 'styled-components';
|
|
3
3
|
import { theme } from '../theme';
|
4
4
|
import { createPortal } from 'react-dom';
|
5
5
|
import { Box } from '../Box';
|
6
|
-
import { Icon } from '../Icon';
|
7
6
|
import { Text } from '../Text';
|
8
7
|
import useBodyScrollLock from './useBodyScrollLock';
|
9
|
-
|
8
|
+
import { IconStrict } from '../IconStrict';
|
9
|
+
export const Modal = ({ title = '', children, showModal = false, handleClick, drawer = true, cross = true, width, containerClass, portalContainer = document.body, }) => {
|
10
10
|
const modalRef = useRef(null);
|
11
11
|
useBodyScrollLock({ node: modalRef.current, showModal });
|
12
12
|
return createPortal(React.createElement(Wrapper, { showModal: showModal, ref: modalRef },
|
@@ -14,10 +14,8 @@ export const Modal = ({ title = '', icon = '', children, showModal = false, hand
|
|
14
14
|
React.createElement(Container, { drawer: drawer, width: width || '460px', className: containerClass },
|
15
15
|
React.createElement(Box, { flex: true, alignItems: "flex-start", justifyContent: "space-between", mb: "8px" },
|
16
16
|
React.createElement(TitleElements, { flex: true, direction: "column" },
|
17
|
-
icon !== '' && (React.createElement(Icon, { render: icon, size: 42, color: "secondary", mb: "16px" })),
|
18
17
|
React.createElement(Text, { tag: "h2", typo: "heading-small", align: "left" }, title)),
|
19
|
-
cross && (React.createElement(
|
20
|
-
React.createElement(Icon, { render: "cross", color: "secondary", size: 32 })))),
|
18
|
+
cross && (React.createElement(IconStrict, { render: "cross", backgroundColor: "oatmeal", handleClick: handleClick, size: 36 }))),
|
21
19
|
React.createElement(Box, { flex: true, direction: "column" }, children))), portalContainer);
|
22
20
|
};
|
23
21
|
const Wrapper = styled(Box)(({ showModal }) => css `
|
@@ -33,7 +31,7 @@ const Wrapper = styled(Box)(({ showModal }) => css `
|
|
33
31
|
`);
|
34
32
|
const Overlay = styled.div `
|
35
33
|
position: fixed;
|
36
|
-
background: ${theme.colors.
|
34
|
+
background: ${theme.colors.liquorice};
|
37
35
|
cursor: pointer;
|
38
36
|
opacity: 0.4;
|
39
37
|
top: 0;
|
@@ -42,10 +40,9 @@ const Overlay = styled.div `
|
|
42
40
|
right: 0;
|
43
41
|
`;
|
44
42
|
const Container = styled.div(({ drawer, width }) => css `
|
45
|
-
background: ${theme.colors.
|
46
|
-
border: 1px solid ${theme.colors.outline};
|
43
|
+
background: ${theme.colors.coconut};
|
47
44
|
box-sizing: border-box;
|
48
|
-
border-radius:
|
45
|
+
border-radius: 16px;
|
49
46
|
padding: 24px;
|
50
47
|
width: 100%;
|
51
48
|
max-width: ${width};
|
@@ -68,20 +65,6 @@ const Container = styled.div(({ drawer, width }) => css `
|
|
68
65
|
}
|
69
66
|
`}
|
70
67
|
`);
|
71
|
-
const IconContainer = styled.div `
|
72
|
-
cursor: pointer;
|
73
|
-
background: ${theme.colors.background};
|
74
|
-
border-radius: 32px;
|
75
|
-
margin-right: 8px;
|
76
|
-
|
77
|
-
&:hover {
|
78
|
-
background: ${theme.colors.background};
|
79
|
-
}
|
80
|
-
|
81
|
-
svg {
|
82
|
-
padding: 3px;
|
83
|
-
}
|
84
|
-
`;
|
85
68
|
const TitleElements = styled(Box) `
|
86
69
|
align-self: center;
|
87
70
|
`;
|
package/dist/Modal/Modal.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,MAAM,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,
|
1
|
+
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,MAAM,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,iBAA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,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CACzB,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;eACT,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;;;;;;;;;GASvC,CACF,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAA;;gBAEV,KAAK,CAAC,MAAM,CAAC,SAAS;;;;;;;CAOrC,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAC1B,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;kBACV,KAAK,CAAC,MAAM,CAAC,OAAO;;;;;iBAKrB,KAAK;;;;;MAKhB,MAAM,KAAK,IAAI;IACjB,GAAG,CAAA;;;;;;;;;;;;KAYF;GACF,CACF,CAAA;AAED,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;CAEhC,CAAA"}
|
@@ -0,0 +1,97 @@
|
|
1
|
+
import React, { useState } from 'react';
|
2
|
+
import styled from 'styled-components';
|
3
|
+
import { Text } from '../Text';
|
4
|
+
import { Box } from '../Box';
|
5
|
+
import { NumberInput } from './NumberInput';
|
6
|
+
import { noop } from '../utils/noop';
|
7
|
+
import { SupportMessage } from '../SupportMessage';
|
8
|
+
const variationList = [
|
9
|
+
{
|
10
|
+
id: 'days',
|
11
|
+
placeholder: '+44 7123 456789',
|
12
|
+
errorMsg: 'This field is required',
|
13
|
+
label: 'Phone number',
|
14
|
+
onChange: noop,
|
15
|
+
onInputChange: noop,
|
16
|
+
onBlur: noop,
|
17
|
+
value: '',
|
18
|
+
},
|
19
|
+
];
|
20
|
+
export const CollectionPage = () => {
|
21
|
+
const [, setValue] = useState('');
|
22
|
+
return (React.createElement(Box, { flex: true, direction: "column" }, variationList.map(({ id, placeholder, errorMsg, label }) => {
|
23
|
+
return (React.createElement(Box, { key: id, flex: true, direction: "column", mb: "32px" },
|
24
|
+
React.createElement(Title, { tag: "span", typo: "header-medium" }, "NumberInput variations"),
|
25
|
+
React.createElement(Row, { label: "Generic" },
|
26
|
+
React.createElement(NumberInput, { id: id, label: label, value: "", placeholder: placeholder, error: false, errorMsg: errorMsg,
|
27
|
+
// @ts-expect-error onChange type is too broad and should be handled differently
|
28
|
+
onChange: setValue })),
|
29
|
+
React.createElement(Row, { label: "Fallback" },
|
30
|
+
React.createElement(NumberInput, { id: id, label: label, value: "", placeholder: placeholder, fallback: true, error: false, errorMsg: errorMsg,
|
31
|
+
// @ts-expect-error onChange type is too broad and should be handled differently
|
32
|
+
onChange: setValue })),
|
33
|
+
React.createElement(Row, { label: "Disabled" },
|
34
|
+
React.createElement(NumberInput, { id: id, label: label, value: "", placeholder: placeholder, disabled: true, error: false, errorMsg: errorMsg,
|
35
|
+
// @ts-expect-error onChange type is too broad and should be handled differently
|
36
|
+
onChange: setValue })),
|
37
|
+
React.createElement(Row, { label: "Required" },
|
38
|
+
React.createElement(NumberInput, { id: id, label: label, value: "", required: true, placeholder: placeholder, error: false, errorMsg: errorMsg,
|
39
|
+
// @ts-expect-error onChange type is too broad and should be handled differently
|
40
|
+
onChange: setValue })),
|
41
|
+
React.createElement(Row, { label: "Leading Icon" },
|
42
|
+
React.createElement(NumberInput, { id: id, label: label, frontIcon: "iphone", value: "", placeholder: placeholder, error: false, errorMsg: errorMsg,
|
43
|
+
// @ts-expect-error onChange type is too broad and should be handled differently
|
44
|
+
onChange: setValue })),
|
45
|
+
React.createElement(Row, { label: "Trailing Icon" },
|
46
|
+
React.createElement(NumberInput, { id: id, label: label, trailingIcon: "iphone", value: "", placeholder: placeholder, error: false, errorMsg: errorMsg,
|
47
|
+
// @ts-expect-error onChange type is too broad and should be handled differently
|
48
|
+
onChange: setValue })),
|
49
|
+
React.createElement(Row, { label: "Stepper" },
|
50
|
+
React.createElement(NumberInput, { id: id, label: label, step: 10, value: "", placeholder: placeholder, error: false, errorMsg: errorMsg,
|
51
|
+
// @ts-expect-error onChange type is too broad and should be handled differently
|
52
|
+
onChange: setValue })),
|
53
|
+
React.createElement(Row, { label: "Assistive text" },
|
54
|
+
React.createElement(NumberInput, { id: id, label: label, value: "", placeholder: placeholder, assistiveText: "Some assistive text", error: false, errorMsg: errorMsg,
|
55
|
+
// @ts-expect-error onChange type is too broad and should be handled differently
|
56
|
+
onChange: setValue })),
|
57
|
+
React.createElement(Row, { label: "Completed" },
|
58
|
+
React.createElement(NumberInput, { id: id, label: label, value: "", placeholder: placeholder, error: false, completed: true, errorMsg: errorMsg,
|
59
|
+
// @ts-expect-error onChange type is too broad and should be handled differently
|
60
|
+
onChange: setValue })),
|
61
|
+
React.createElement(Row, { label: "As title" },
|
62
|
+
React.createElement(NumberInput, { id: id, label: label, value: "", renderAsTitle: true, placeholder: placeholder, error: false, errorMsg: errorMsg,
|
63
|
+
// @ts-expect-error onChange type is too broad and should be handled differently
|
64
|
+
onChange: setValue })),
|
65
|
+
React.createElement(Row, { label: "Error" },
|
66
|
+
React.createElement(NumberInput, { id: id, label: label, value: "", required: true, placeholder: placeholder, assistiveText: "Some assistive text", error: true, errorMsg: errorMsg,
|
67
|
+
// @ts-expect-error onChange type is too broad and should be handled differently
|
68
|
+
onChange: setValue })),
|
69
|
+
React.createElement(Row, { label: "React element error" },
|
70
|
+
React.createElement(NumberInput, { id: id, label: label, required: true, value: "", placeholder: placeholder, error: true, errorMsg: React.createElement(SupportMessage, { type: "warning", description: "error!!" }),
|
71
|
+
// @ts-expect-error onChange type is too broad and should be handled differently
|
72
|
+
onChange: setValue })),
|
73
|
+
React.createElement(Row, { label: "Fallback Error" },
|
74
|
+
React.createElement(NumberInput, { id: id, label: label, required: true, value: "", placeholder: placeholder, fallback: true, error: true, errorMsg: errorMsg,
|
75
|
+
// @ts-expect-error onChange type is too broad and should be handled differently
|
76
|
+
onChange: setValue }))));
|
77
|
+
})));
|
78
|
+
};
|
79
|
+
const Row = ({ label, children, }) => {
|
80
|
+
return (React.createElement(RowWrapper, { mt: "32px" },
|
81
|
+
React.createElement(Box, { width: "140px" },
|
82
|
+
React.createElement(Text, { tag: "span", typo: "label-large" }, label)),
|
83
|
+
children));
|
84
|
+
};
|
85
|
+
const RowWrapper = styled(Box) `
|
86
|
+
display: flex;
|
87
|
+
flex-direction: row;
|
88
|
+
gap: 16px;
|
89
|
+
`;
|
90
|
+
const LABEL_WIDTH = '140px';
|
91
|
+
const Title = styled(Text) `
|
92
|
+
margin-bottom: 12px;
|
93
|
+
font-size: 18px;
|
94
|
+
line-height: 20px;
|
95
|
+
margin-left: ${LABEL_WIDTH};
|
96
|
+
`;
|
97
|
+
//# sourceMappingURL=Collection.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Collection.js","sourceRoot":"","sources":["../../src/NumberInput/Collection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,QAAQ,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,WAAW,EAAoB,MAAM,eAAe,CAAA;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,MAAM,aAAa,GAAuB;IACxC;QACE,EAAE,EAAE,MAAM;QACV,WAAW,EAAE,iBAAiB;QAC9B,QAAQ,EAAE,wBAAwB;QAClC,KAAK,EAAE,cAAc;QACrB,QAAQ,EAAE,IAAI;QACd,aAAa,EAAE,IAAI;QACnB,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,EAAE;KACV;CACF,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAO,GAAG,EAAE;IACrC,MAAM,CAAC,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CA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AK,EAAE,IAAI,EACX,QAAQ,EACN,oBAAC,cAAc,IAAC,IAAI,EAAC,SAAS,EAAC,WAAW,EAAC,SAAS,GAAG;oBAEzD,gFAAgF;oBAChF,QAAQ,EAAE,QAAQ,GAClB,CACE;YACN,oBAAC,GAAG,IAAC,KAAK,EAAC,gBAAgB;gBACzB,oBAAC,WAAW,IACV,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,IAAI,EACd,KAAK,EAAC,EAAE,EACR,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,IAAI,EACd,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,QAAQ;oBAClB,gFAAgF;oBAChF,QAAQ,EAAE,QAAQ,GAClB,CACE,CACF,CACP,CAAA;IACH,CAAC,CAAC,CACE,CACP,CAAA;AACH,CAAC,CAAA;AAED,MAAM,GAAG,GAAgD,CAAC,EACxD,KAAK,EACL,QAAQ,GACT,EAAE,EAAE;IACH,OAAO,CACL,oBAAC,UAAU,IAAC,EAAE,EAAC,MAAM;QACnB,oBAAC,GAAG,IAAC,KAAK,EAAC,OAAO;YAChB,oBAAC,IAAI,IAAC,GAAG,EAAC,MAAM,EAAC,IAAI,EAAC,aAAa,IAChC,KAAK,CACD,CACH;QACL,QAAQ,CACE,CACd,CAAA;AACH,CAAC,CAAA;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;;CAI7B,CAAA;AAED,MAAM,WAAW,GAAG,OAAO,CAAA;AAE3B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;iBAIT,WAAW;CAC3B,CAAA"}
|
@@ -1,21 +1,16 @@
|
|
1
1
|
import React, { FocusEvent, FormEvent } from 'react';
|
2
2
|
import { CommonFieldProps } from '../fields/commonFieldTypes';
|
3
3
|
export interface Props extends CommonFieldProps {
|
4
|
-
type?: 'number'
|
4
|
+
type?: 'number';
|
5
5
|
placeholder: string;
|
6
6
|
name?: string;
|
7
7
|
value: string;
|
8
8
|
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
9
|
-
trailingIcon?: string;
|
10
|
-
prefix?: string;
|
11
|
-
suffix?: string;
|
12
9
|
min?: number;
|
13
10
|
max?: number;
|
14
11
|
strict?: boolean;
|
15
12
|
roundCurrency?: boolean;
|
16
13
|
step?: number;
|
17
|
-
disabled?: boolean;
|
18
|
-
outlined?: boolean;
|
19
14
|
}
|
20
15
|
/** on change or on input required */
|
21
16
|
type InputProps = {
|
@@ -12,13 +12,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
12
12
|
import React, { forwardRef, } from 'react';
|
13
13
|
import styled from 'styled-components';
|
14
14
|
import { Box } from '../Box';
|
15
|
-
import { Text } from '../Text';
|
16
15
|
import { Icon } from '../Icon';
|
17
16
|
import { Field } from '../fields/Field';
|
18
|
-
import { theme } from '../theme';
|
19
17
|
import { useUniqueId } from '../utils/id';
|
18
|
+
import { Input, StyledFrontIcon, StyledTrailingIcon, } from '../fields/components/CommonInput';
|
20
19
|
export const NumberInput = forwardRef(function NumberInput(_a, ref) {
|
21
|
-
var { id: idProp, type = 'number', placeholder, name, value,
|
20
|
+
var { id: idProp, type = 'number', placeholder, name, value, onChange, onInputChange, onBlur, roundCurrency, min = -999999, max = 999999, strict, step = 0, disabled = false, error = false, frontIcon, trailingIcon, fallback } = _a, fieldProps = __rest(_a, ["id", "type", "placeholder", "name", "value", "onChange", "onInputChange", "onBlur", "roundCurrency", "min", "max", "strict", "step", "disabled", "error", "frontIcon", "trailingIcon", "fallback"]);
|
22
21
|
const id = useUniqueId(idProp);
|
23
22
|
// Check whether the min/max value exists is within the specified range
|
24
23
|
const isInRange = (value) => {
|
@@ -92,100 +91,25 @@ export const NumberInput = forwardRef(function NumberInput(_a, ref) {
|
|
92
91
|
onChange(roundNumber(currentValue));
|
93
92
|
}
|
94
93
|
};
|
95
|
-
return (React.createElement(Field, Object.assign({}, fieldProps, { htmlFor: id, error: error
|
96
|
-
React.createElement(Box, { flex: true },
|
97
|
-
|
98
|
-
React.createElement(Input, {
|
94
|
+
return (React.createElement(Field, Object.assign({}, fieldProps, { htmlFor: id, error: error }),
|
95
|
+
React.createElement(Box, { flex: true, alignItems: "center", justifyContent: "flex-start" },
|
96
|
+
frontIcon && (React.createElement(StyledFrontIcon, { disabled: disabled, render: frontIcon, color: "sesame" })),
|
97
|
+
React.createElement(Input, { ref: ref, error: error, disabled: disabled, type: type, id: id, name: name, placeholder: placeholder, value: value, frontIcon: frontIcon, step: step, fallback: fallback, onChange: (e) => {
|
99
98
|
onChange && handleChange(e.currentTarget.value);
|
100
99
|
onInputChange && onInputChange(e);
|
101
100
|
}, onBlur: onBlur }),
|
102
|
-
|
103
|
-
onChange && step > 0 && (React.createElement(Spinner, { outlined: outlined },
|
101
|
+
onChange && step > 0 && (React.createElement(Spinner, null,
|
104
102
|
React.createElement(SpinnerButton, { onClick: incrementValue, disabled: disabled },
|
105
|
-
React.createElement(Icon, { render: "caret", rotate: 180, color: "
|
103
|
+
React.createElement(Icon, { render: "caret", rotate: 180, color: "sesame", size: 24 })),
|
106
104
|
React.createElement(SpinnerButton, { onClick: decrementValue, disabled: disabled },
|
107
|
-
React.createElement(Icon, { render: "caret", color: "
|
108
|
-
trailingIcon && React.createElement(
|
105
|
+
React.createElement(Icon, { render: "caret", color: "sesame", size: 24 })))),
|
106
|
+
trailingIcon && !step && (React.createElement(StyledTrailingIcon, { disabled: disabled, render: trailingIcon, color: "sesame" })))));
|
109
107
|
});
|
110
|
-
const Input = styled.input `
|
111
|
-
font-family: 'Circular', san-serif;
|
112
|
-
border: none;
|
113
|
-
border-bottom: 1px solid;
|
114
|
-
border-color: ${({ error }) => theme.colors[`${error ? 'error' : 'outline'}`]};
|
115
|
-
color: ${({ error }) => theme.colors[`${error ? 'error' : 'secondary'}`]};
|
116
|
-
font-size: 16px;
|
117
|
-
width: 100%;
|
118
|
-
outline: none;
|
119
|
-
cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
|
120
|
-
opacity: ${({ disabled }) => (disabled ? '0.5' : '1')};
|
121
|
-
padding: ${({ outlined }) => (outlined ? '17px 14px' : '1px 2px')};
|
122
|
-
padding-right: 60px;
|
123
|
-
|
124
|
-
&::placeholder {
|
125
|
-
color: ${theme.colors.subtext};
|
126
|
-
}
|
127
|
-
|
128
|
-
/* Remove the spinner on Firefox and Webkit browsers */
|
129
|
-
-moz-appearance: textfield;
|
130
|
-
|
131
|
-
&::-webkit-outer-spin-button,
|
132
|
-
&::-webkit-inner-spin-button {
|
133
|
-
-webkit-appearance: none;
|
134
|
-
margin: 0;
|
135
|
-
}
|
136
|
-
|
137
|
-
&:hover,
|
138
|
-
&:focus-within {
|
139
|
-
border-color: ${({ error }) => theme.colors[`${error ? 'error' : 'outline'}`]};
|
140
|
-
}
|
141
|
-
|
142
|
-
${({ outlined, error }) => outlined &&
|
143
|
-
`
|
144
|
-
border: 2px solid ${error ? theme.colors.error : theme.colors.outline};
|
145
|
-
border-radius: 8px;
|
146
|
-
height: auto;
|
147
|
-
`}
|
148
|
-
|
149
|
-
${({ value }) => value &&
|
150
|
-
value !== '' &&
|
151
|
-
`
|
152
|
-
border-color: ${theme.colors.outline};
|
153
|
-
`}
|
154
|
-
|
155
|
-
${({ prefix }) => prefix &&
|
156
|
-
`
|
157
|
-
padding-left: 12px;
|
158
|
-
left: -10px;
|
159
|
-
position: relative;
|
160
|
-
`}
|
161
|
-
`;
|
162
|
-
const StyledIcon = styled(Icon) `
|
163
|
-
position: relative;
|
164
|
-
left: -24px;
|
165
|
-
`;
|
166
|
-
const SymbolText = styled(Text) `
|
167
|
-
font-family: 'Circular', san-serif;
|
168
|
-
font-size: 16px;
|
169
|
-
line-height: 19px;
|
170
|
-
position: relative;
|
171
|
-
z-index: 1;
|
172
|
-
|
173
|
-
${({ outlined, prefix }) => outlined &&
|
174
|
-
`
|
175
|
-
top: 20px;
|
176
|
-
left: ${prefix ? '1px' : '0'};
|
177
|
-
`}
|
178
|
-
|
179
|
-
${({ suffix, outlined }) => suffix &&
|
180
|
-
`
|
181
|
-
left: ${outlined ? '-25px' : '-10px'};
|
182
|
-
`}
|
183
|
-
`;
|
184
108
|
const Spinner = styled.div `
|
185
|
-
display: flex;
|
186
109
|
position: relative;
|
187
|
-
|
188
|
-
|
110
|
+
display: flex;
|
111
|
+
right: 58px;
|
112
|
+
margin-right: -58px;
|
189
113
|
`;
|
190
114
|
const SpinnerButton = styled.button `
|
191
115
|
width: 24px;
|