@mrshmllw/smores-react 3.0.5 → 3.1.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/dist/Accordion/Accordion.d.ts +2 -2
- package/dist/Accordion/Accordion.js +3 -15
- package/dist/Accordion/Accordion.js.map +1 -1
- package/dist/Accordion/Accordion.stories.js +1 -1
- package/dist/Accordion/Accordion.stories.js.map +1 -1
- package/dist/Accordion/Collection.js +3 -3
- package/dist/Accordion/Collection.js.map +1 -1
- package/dist/ActionDropdown/ActionDropdown.js +4 -17
- package/dist/ActionDropdown/ActionDropdown.js.map +1 -1
- package/dist/Banner/BannerContainer.js +5 -2
- package/dist/Banner/BannerContainer.js.map +1 -1
- package/dist/Box/Box.stories.js +1 -1
- package/dist/Box/Box.stories.js.map +1 -1
- package/dist/BrandCard/BrandCard.js +2 -14
- package/dist/BrandCard/BrandCard.js.map +1 -1
- package/dist/BrandCard/BrandCard.stories.js +1 -1
- package/dist/BrandCard/BrandCard.stories.js.map +1 -1
- package/dist/Button/Button.js +2 -13
- package/dist/Button/Button.js.map +1 -1
- package/dist/Button/Button.stories.js +2 -2
- package/dist/Button/Button.stories.js.map +1 -1
- package/dist/Button/Collection.js +6 -6
- package/dist/Button/Collection.js.map +1 -1
- package/dist/Button/InteractivePlayground.js +3 -12
- package/dist/Button/InteractivePlayground.js.map +1 -1
- package/dist/Button/LegacyButton.d.ts +15 -0
- package/dist/Button/LegacyButton.js +50 -0
- package/dist/Button/LegacyButton.js.map +1 -0
- package/dist/Card/Card.js +2 -14
- package/dist/Card/Card.js.map +1 -1
- package/dist/Card/Card.stories.js +1 -1
- package/dist/Card/Card.stories.js.map +1 -1
- package/dist/CheckBox/CheckBox.stories.js +1 -1
- package/dist/CheckBox/CheckBox.stories.js.map +1 -1
- package/dist/CheckBox/index.d.ts +1 -1
- package/dist/CheckBox/index.js.map +1 -1
- package/dist/CheckBoxGroup/CheckBoxGroup.js +1 -15
- package/dist/CheckBoxGroup/CheckBoxGroup.js.map +1 -1
- package/dist/Chip/Chip.js +3 -17
- package/dist/Chip/Chip.js.map +1 -1
- package/dist/Chip/Chip.stories.js +1 -1
- package/dist/Chip/Chip.stories.js.map +1 -1
- package/dist/ConfirmationRadioButtons/Confirmation.d.ts +17 -0
- package/dist/ConfirmationRadioButtons/Confirmation.js +100 -0
- package/dist/ConfirmationRadioButtons/Confirmation.js.map +1 -0
- package/dist/ConfirmationRadioButtons/Confirmation.stories.d.ts +21 -0
- package/dist/ConfirmationRadioButtons/Confirmation.stories.js +76 -0
- package/dist/ConfirmationRadioButtons/Confirmation.stories.js.map +1 -0
- package/dist/ConfirmationRadioButtons/Container.d.ts +2 -0
- package/dist/ConfirmationRadioButtons/Container.js +8 -0
- package/dist/ConfirmationRadioButtons/Container.js.map +1 -0
- package/dist/ConfirmationRadioButtons/RadioButtonStyled.d.ts +17 -0
- package/dist/ConfirmationRadioButtons/RadioButtonStyled.js +41 -0
- package/dist/ConfirmationRadioButtons/RadioButtonStyled.js.map +1 -0
- package/dist/ConfirmationRadioButtons/__tests__/Confirmation.d.ts +1 -0
- package/dist/ConfirmationRadioButtons/__tests__/Confirmation.js +8 -0
- package/dist/ConfirmationRadioButtons/__tests__/Confirmation.js.map +1 -0
- package/dist/ConfirmationRadioButtons/index.d.ts +1 -0
- package/dist/ConfirmationRadioButtons/index.js +2 -0
- package/dist/ConfirmationRadioButtons/index.js.map +1 -0
- package/dist/Datepicker/Datepicker.js +4 -16
- package/dist/Datepicker/Datepicker.js.map +1 -1
- package/dist/Datepicker/Datepicker.stories.js +1 -1
- package/dist/Datepicker/Datepicker.stories.js.map +1 -1
- package/dist/Datepicker/DatesList.js +1 -1
- package/dist/Datepicker/DatesList.js.map +1 -1
- package/dist/Divider/Divider.js +2 -14
- package/dist/Divider/Divider.js.map +1 -1
- package/dist/Divider/Divier.stories.js +1 -1
- package/dist/Divider/Divier.stories.js.map +1 -1
- package/dist/Dropdown/Dropdown.js +7 -23
- package/dist/Dropdown/Dropdown.js.map +1 -1
- package/dist/Dropdown/Dropdown.stories.js +1 -1
- package/dist/Dropdown/Dropdown.stories.js.map +1 -1
- package/dist/Emoji/Emoji.js +1 -15
- package/dist/Emoji/Emoji.js.map +1 -1
- package/dist/Emoji/Emoji.stories.js +1 -1
- package/dist/Emoji/Emoji.stories.js.map +1 -1
- package/dist/Icon/Icon.js +834 -848
- package/dist/Icon/Icon.js.map +1 -1
- package/dist/Icon/Icon.stories.js +1 -1
- package/dist/Icon/Icon.stories.js.map +1 -1
- package/dist/IconStrict/IconStrict.js +2 -16
- package/dist/IconStrict/IconStrict.js.map +1 -1
- package/dist/IconStrict/IconStrict.stories.js +1 -1
- package/dist/IconStrict/IconStrict.stories.js.map +1 -1
- package/dist/IconWrapper/IconWrapper.js +5 -19
- package/dist/IconWrapper/IconWrapper.js.map +1 -1
- package/dist/IconWrapper/IconWrapper.stories.js +1 -1
- package/dist/IconWrapper/IconWrapper.stories.js.map +1 -1
- package/dist/IconWrapper/__tests__/IconWrapper.js +1 -1
- package/dist/IconWrapper/__tests__/IconWrapper.js.map +1 -1
- package/dist/LabelledText/LabelledText.js +3 -17
- package/dist/LabelledText/LabelledText.js.map +1 -1
- package/dist/LabelledText/LabelledText.stories.js +1 -1
- package/dist/LabelledText/LabelledText.stories.js.map +1 -1
- package/dist/Link/Link.js +4 -4
- package/dist/Link/Link.js.map +1 -1
- package/dist/Link/Link.stories.js +15 -4
- package/dist/Link/Link.stories.js.map +1 -1
- package/dist/Link/index.d.ts +1 -1
- package/dist/Link/index.js.map +1 -1
- package/dist/Loader/Loader.stories.js +1 -1
- package/dist/Loader/Loader.stories.js.map +1 -1
- package/dist/Message/Message.d.ts +21 -0
- package/dist/Message/Message.js +45 -0
- package/dist/Message/Message.js.map +1 -0
- package/dist/Message/Message.stories.d.ts +13 -0
- package/dist/Message/Message.stories.js +38 -0
- package/dist/Message/Message.stories.js.map +1 -0
- package/dist/Message/__tests__/Message.d.ts +1 -0
- package/dist/Message/__tests__/Message.js +26 -0
- package/dist/Message/__tests__/Message.js.map +1 -0
- package/dist/Message/index.d.ts +1 -0
- package/dist/Message/index.js +2 -0
- package/dist/Message/index.js.map +1 -0
- package/dist/Modal/Modal.stories.js +1 -1
- package/dist/Modal/Modal.stories.js.map +1 -1
- package/dist/NumberInput/NumberInput.js +2 -14
- package/dist/NumberInput/NumberInput.js.map +1 -1
- package/dist/NumberInput/NumberInput.stories.js +1 -1
- package/dist/NumberInput/NumberInput.stories.js.map +1 -1
- package/dist/Pagination/Pagination.js +2 -14
- package/dist/Pagination/Pagination.js.map +1 -1
- package/dist/Pagination/Pagination.stories.js +1 -1
- package/dist/Pagination/Pagination.stories.js.map +1 -1
- package/dist/RadioButton/Container.d.ts +2 -0
- package/dist/RadioButton/Container.js +9 -0
- package/dist/RadioButton/Container.js.map +1 -0
- package/dist/RadioButton/RadioButton.d.ts +10 -0
- package/dist/RadioButton/RadioButton.js +68 -0
- package/dist/RadioButton/RadioButton.js.map +1 -0
- package/dist/RadioButton/RadioButton.stories.d.ts +15 -0
- package/dist/RadioButton/RadioButton.stories.js +29 -0
- package/dist/RadioButton/RadioButton.stories.js.map +1 -0
- package/dist/RadioButton/__tests__/RadioButton.d.ts +1 -0
- package/dist/RadioButton/__tests__/RadioButton.js +13 -0
- package/dist/RadioButton/__tests__/RadioButton.js.map +1 -0
- package/dist/RadioButton/index.d.ts +1 -0
- package/dist/RadioButton/index.js +2 -0
- package/dist/RadioButton/index.js.map +1 -0
- package/dist/RadioGroup/RadioElement.js +2 -14
- package/dist/RadioGroup/RadioElement.js.map +1 -1
- package/dist/RadioGroup/RadioGroup.js +3 -16
- package/dist/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/RadioGroup/RadioGroup.stories.js +38 -8
- package/dist/RadioGroup/RadioGroup.stories.js.map +1 -1
- package/dist/Row/Row.js +2 -14
- package/dist/Row/Row.js.map +1 -1
- package/dist/Row/Row.stories.js +1 -1
- package/dist/Row/Row.stories.js.map +1 -1
- package/dist/SearchInput/SearchInput.js +4 -17
- package/dist/SearchInput/SearchInput.js.map +1 -1
- package/dist/SearchInput/SearchInput.stories.js +1 -1
- package/dist/SearchInput/SearchInput.stories.js.map +1 -1
- package/dist/Snackbar/SnackbarContainer.js +5 -2
- package/dist/Snackbar/SnackbarContainer.js.map +1 -1
- package/dist/SupportMessage/SupportMessage.js +8 -22
- package/dist/SupportMessage/SupportMessage.js.map +1 -1
- package/dist/SupportMessage/SupportMessage.stories.js +1 -1
- package/dist/SupportMessage/SupportMessage.stories.js.map +1 -1
- package/dist/SupportMessage/SupportMessage.test.js +9 -18
- package/dist/SupportMessage/SupportMessage.test.js.map +1 -1
- package/dist/Tag/Tag.js +2 -16
- package/dist/Tag/Tag.js.map +1 -1
- package/dist/Tag/Tag.stories.js +1 -1
- package/dist/Tag/Tag.stories.js.map +1 -1
- package/dist/Text/Text.js +1 -15
- package/dist/Text/Text.js.map +1 -1
- package/dist/Text/Text.stories.js +1 -1
- package/dist/Text/Text.stories.js.map +1 -1
- package/dist/TextInput/TextInput.d.ts +1 -1
- package/dist/TextInput/TextInput.js +2 -14
- package/dist/TextInput/TextInput.js.map +1 -1
- package/dist/TextInput/TextInput.stories.js +1 -1
- package/dist/TextInput/TextInput.stories.js.map +1 -1
- package/dist/Textarea/Textarea.js +4 -16
- package/dist/Textarea/Textarea.js.map +1 -1
- package/dist/Textarea/Textarea.stories.js +1 -1
- package/dist/Textarea/Textarea.stories.js.map +1 -1
- package/dist/Toggle/Toggle.js +2 -14
- package/dist/Toggle/Toggle.js.map +1 -1
- package/dist/Tooltip/Tooltip.js +1 -2
- package/dist/Tooltip/Tooltip.js.map +1 -1
- package/dist/Tooltip/Tooltip.stories.js +1 -1
- package/dist/Tooltip/Tooltip.stories.js.map +1 -1
- package/dist/fields/Field/Field.js +2 -14
- package/dist/fields/Field/Field.js.map +1 -1
- package/dist/fields/Field/index.d.ts +1 -1
- package/dist/fields/Field/index.js.map +1 -1
- package/dist/fields/Fieldset/Fieldset.js +2 -14
- package/dist/fields/Fieldset/Fieldset.js.map +1 -1
- package/dist/fields/Fieldset/Fieldset.stories.js +14 -4
- package/dist/fields/Fieldset/Fieldset.stories.js.map +1 -1
- package/dist/fields/Fieldset/index.d.ts +1 -1
- package/dist/fields/Fieldset/index.js.map +1 -1
- package/dist/fields/components/InternalField.js +2 -14
- package/dist/fields/components/InternalField.js.map +1 -1
- package/dist/utils/id.test.js +6 -15
- package/dist/utils/id.test.js.map +1 -1
- package/package.json +5 -3
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/CheckBox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/CheckBox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA"}
|
@@ -1,22 +1,8 @@
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
-
var t = {};
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
-
t[p] = s[p];
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
-
t[p[i]] = s[p[i]];
|
9
|
-
}
|
10
|
-
return t;
|
11
|
-
};
|
12
1
|
import React from 'react';
|
13
2
|
import styled from 'styled-components';
|
14
3
|
import { Box } from '../Box';
|
15
4
|
import { CheckBox } from '../CheckBox';
|
16
|
-
export const CheckBoxGroup = (
|
17
|
-
var { list, onToggle } = _a, marginProps = __rest(_a, ["list", "onToggle"]);
|
18
|
-
return (React.createElement(Container, null, list.map((item) => (React.createElement(CheckBox, Object.assign({ key: item.id, id: String(item.id), checked: item.checked, toggle: () => onToggle(item.id) }, marginProps), item.label)))));
|
19
|
-
};
|
5
|
+
export const CheckBoxGroup = ({ list, onToggle, ...marginProps }) => (React.createElement(Container, null, list.map((item) => (React.createElement(CheckBox, { key: item.id, id: String(item.id), checked: item.checked, toggle: () => onToggle(item.id), ...marginProps }, item.label)))));
|
20
6
|
const Container = styled(Box) `
|
21
7
|
display: flex;
|
22
8
|
flex-direction: column;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CheckBoxGroup.js","sourceRoot":"","sources":["../../src/CheckBoxGroup/CheckBoxGroup.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"CheckBoxGroup.js","sourceRoot":"","sources":["../../src/CheckBoxGroup/CheckBoxGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AActC,MAAM,CAAC,MAAM,aAAa,GAA2B,CAAC,EACpD,IAAI,EACJ,QAAQ,EACR,GAAG,WAAW,EACf,EAAE,EAAE,CAAC,CACJ,oBAAC,SAAS,QACP,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAClB,oBAAC,QAAQ,IACP,GAAG,EAAE,IAAI,CAAC,EAAE,EACZ,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EACnB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,KAC3B,WAAW,IAEd,IAAI,CAAC,KAAK,CACF,CACZ,CAAC,CACQ,CACb,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;;CAI5B,CAAA"}
|
package/dist/Chip/Chip.js
CHANGED
@@ -1,14 +1,3 @@
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
-
var t = {};
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
-
t[p] = s[p];
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
-
t[p[i]] = s[p[i]];
|
9
|
-
}
|
10
|
-
return t;
|
11
|
-
};
|
12
1
|
import React, { forwardRef } from 'react';
|
13
2
|
import styled, { css } from 'styled-components';
|
14
3
|
import { theme } from '../theme';
|
@@ -16,12 +5,9 @@ import { Box } from '../Box';
|
|
16
5
|
import { Icon as IconComponent } from '../Icon';
|
17
6
|
import { Loader } from '../Loader';
|
18
7
|
import { focusOutline } from '../utils/focusOutline';
|
19
|
-
export const Chip = forwardRef((
|
20
|
-
|
21
|
-
|
22
|
-
icon && (React.createElement(IconComponent, { render: icon, size: 20, color: primary ? 'liquorice' : 'cream' })),
|
23
|
-
React.createElement(ChildrenContainer, null, children)))));
|
24
|
-
});
|
8
|
+
export const Chip = forwardRef(({ children, handleClick, primary = false, secondary = false, disabled = false, loading = false, icon = '', ...props }, ref) => (React.createElement(Container, { as: "button", primary: primary, secondary: secondary, disabled: disabled || loading, "$loading": loading, onClick: handleClick, icon: icon, ...props, ref: ref }, loading ? (React.createElement(Loader, { color: primary ? 'liquorice' : 'cream', height: "16" })) : (React.createElement(React.Fragment, null,
|
9
|
+
icon && (React.createElement(IconComponent, { render: icon, size: 20, color: primary ? 'liquorice' : 'cream' })),
|
10
|
+
React.createElement(ChildrenContainer, null, children))))));
|
25
11
|
Chip.displayName = 'Chip';
|
26
12
|
const Container = styled(Box)(({ primary, secondary, icon, $loading, disabled }) => css `
|
27
13
|
${focusOutline()}
|
package/dist/Chip/Chip.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Chip.js","sourceRoot":"","sources":["../../src/Chip/Chip.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"Chip.js","sourceRoot":"","sources":["../../src/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAuC,UAAU,EAAE,MAAM,OAAO,CAAA;AAC9E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAuBpD,MAAM,CAAC,MAAM,IAAI,GAAkB,UAAU,CAC3C,CACE,EACE,QAAQ,EACR,WAAW,EACX,OAAO,GAAG,KAAK,EACf,SAAS,GAAG,KAAK,EACjB,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,KAAK,EACf,IAAI,GAAG,EAAE,EACT,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE,CAAC,CACH,oBAAC,SAAS,IACR,EAAE,EAAC,QAAQ,EACX,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,IAAI,OAAO,cACnB,OAAO,EACjB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,IAAI,KACN,KAAK,EACT,GAAG,EAAE,GAAG,IAEP,OAAO,CAAC,CAAC,CAAC,CACT,oBAAC,MAAM,IAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,EAAC,IAAI,GAAG,CAC/D,CAAC,CAAC,CAAC,CACF;IACG,IAAI,IAAI,CACP,o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AAa,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE;4BACd,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM;;KAErE;GACF,CACF,CAAA;AAED,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEnC,CAAA"}
|
@@ -5,7 +5,7 @@ export default {
|
|
5
5
|
component: Chip,
|
6
6
|
argTypes: { handleClick: { action: 'clicked' } },
|
7
7
|
};
|
8
|
-
const Template = (props) => React.createElement(Chip,
|
8
|
+
const Template = (props) => React.createElement(Chip, { ...props });
|
9
9
|
export const Primary = Template.bind({});
|
10
10
|
Primary.args = {
|
11
11
|
primary: true,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Chip.stories.js","sourceRoot":"","sources":["../../src/Chip/Chip.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAa,MAAM,QAAQ,CAAA;AAExC,eAAe;IACb,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;CACjD,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,KAAgB,EAAE,EAAE,CAAC,oBAAC,IAAI,
|
1
|
+
{"version":3,"file":"Chip.stories.js","sourceRoot":"","sources":["../../src/Chip/Chip.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAa,MAAM,QAAQ,CAAA;AAExC,eAAe;IACb,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;CACjD,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,KAAgB,EAAE,EAAE,CAAC,oBAAC,IAAI,OAAK,KAAK,GAAI,CAAA;AAE1D,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAExC,OAAO,CAAC,IAAI,GAAG;IACb,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,MAAM;IACZ,aAAa,EAAE,QAAQ;CACxB,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAE1C,SAAS,CAAC,IAAI,GAAG;IACf,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,OAAO;IACjB,IAAI,EAAE,MAAM;CACb,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAExC,OAAO,CAAC,IAAI,GAAG;IACb,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;CACd,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAElD,iBAAiB,CAAC,IAAI,GAAG;IACvB,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,MAAM;CACb,CAAA"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { FC, FocusEvent, ReactElement } from 'react';
|
2
|
+
import { MarginProps } from '../utils/space';
|
3
|
+
export type ConfirmationProps = {
|
4
|
+
onChange(value?: boolean): void;
|
5
|
+
checked?: boolean;
|
6
|
+
id?: string;
|
7
|
+
error?: boolean;
|
8
|
+
errorMsg?: string;
|
9
|
+
label?: string;
|
10
|
+
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
11
|
+
sublabel?: string | ReactElement;
|
12
|
+
yesLabel?: string | ReactElement;
|
13
|
+
noLabel?: string | ReactElement;
|
14
|
+
required?: boolean;
|
15
|
+
disabled?: boolean;
|
16
|
+
} & MarginProps;
|
17
|
+
export declare const Confirmation: FC<ConfirmationProps>;
|
@@ -0,0 +1,100 @@
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
+
var t = {};
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
+
t[p] = s[p];
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
+
t[p[i]] = s[p[i]];
|
9
|
+
}
|
10
|
+
return t;
|
11
|
+
};
|
12
|
+
import React from 'react';
|
13
|
+
import styled, { css } from 'styled-components';
|
14
|
+
import { theme } from '../theme';
|
15
|
+
import { Box } from '../Box';
|
16
|
+
import { Text } from '../Text';
|
17
|
+
import { RadioButton } from './RadioButtonStyled';
|
18
|
+
import { useUniqueId } from '../utils/id';
|
19
|
+
import { useDeprecatedWarning } from '../utils/deprecated';
|
20
|
+
export const Confirmation = (props) => {
|
21
|
+
const { checked, onChange, id: idProp, error = false, errorMsg = '', label, onBlur, sublabel, yesLabel = 'Yes', noLabel = 'No', required = false, disabled = false } = props, marginProps = __rest(props, ["checked", "onChange", "id", "error", "errorMsg", "label", "onBlur", "sublabel", "yesLabel", "noLabel", "required", "disabled"]);
|
22
|
+
useDeprecatedWarning({
|
23
|
+
title: 'Confirmation',
|
24
|
+
message: 'The Confirmation component has been deprecated. Please use the new RadioGroup component instead.',
|
25
|
+
componentProps: props,
|
26
|
+
});
|
27
|
+
const id = useUniqueId(idProp);
|
28
|
+
return (React.createElement(ConfirmationWrapper, Object.assign({}, marginProps),
|
29
|
+
(label || sublabel) && (React.createElement(TextWrapper, null,
|
30
|
+
label && (React.createElement(SectionHeadingText, { tag: "h3" },
|
31
|
+
label,
|
32
|
+
required && React.createElement(Asterisk, null, "*"))),
|
33
|
+
sublabel && (React.createElement(Text, { tag: "p", typo: "base-small", color: "subtext" }, sublabel)))),
|
34
|
+
React.createElement(RadioButtonGroupWrapper, null,
|
35
|
+
React.createElement(RadioButtonGroup, null,
|
36
|
+
React.createElement(RadioButtonWrapper, { checked: checked === true, error: error, disabled: disabled },
|
37
|
+
React.createElement(RadioButton, { id: id, label: yesLabel, checked: checked === true, onChange: () => onChange(true), value: id, onBlur: onBlur, disabled: disabled })),
|
38
|
+
React.createElement(RadioButtonWrapper, { checked: checked === false, error: error, disabled: disabled },
|
39
|
+
React.createElement(RadioButton, { id: `${id}-1`, label: noLabel, checked: checked === false, onChange: () => onChange(false), value: `${id}-1`, onBlur: onBlur, disabled: disabled }))),
|
40
|
+
error && React.createElement(ErrorBox, null, errorMsg))));
|
41
|
+
};
|
42
|
+
const RadioButtonGroupWrapper = styled.div `
|
43
|
+
display: flex;
|
44
|
+
flex-direction: column;
|
45
|
+
`;
|
46
|
+
const RadioButtonGroup = styled.div `
|
47
|
+
display: flex;
|
48
|
+
flex-direction: row;
|
49
|
+
`;
|
50
|
+
const getColor = (checked, error) => {
|
51
|
+
if (error) {
|
52
|
+
return `2px solid ${theme.colors.error}`;
|
53
|
+
}
|
54
|
+
else if (checked) {
|
55
|
+
return `2px solid ${theme.colors.secondary}`;
|
56
|
+
}
|
57
|
+
else {
|
58
|
+
return 'none';
|
59
|
+
}
|
60
|
+
};
|
61
|
+
const RadioButtonWrapper = styled.div `
|
62
|
+
background-color: ${({ checked }) => !checked && `${theme.colors.background}`};
|
63
|
+
border: ${({ checked, error }) => getColor(checked, error)};
|
64
|
+
margin-right: 10px;
|
65
|
+
width: 139px;
|
66
|
+
display: flex;
|
67
|
+
align-items: center;
|
68
|
+
height: 56px;
|
69
|
+
padding-left: 12px;
|
70
|
+
border-radius: 5px;
|
71
|
+
font-weight: bold;
|
72
|
+
${({ disabled }) => disabled &&
|
73
|
+
css `
|
74
|
+
border-color: ${theme.colors.secondary};
|
75
|
+
opacity: 0.5;
|
76
|
+
`}
|
77
|
+
`;
|
78
|
+
const ErrorBox = styled.span `
|
79
|
+
margin-top: 7px;
|
80
|
+
margin-left: 12px;
|
81
|
+
font-size: 12px;
|
82
|
+
color: ${theme.colors.error};
|
83
|
+
`;
|
84
|
+
const ConfirmationWrapper = styled(Box) `
|
85
|
+
display: flex;
|
86
|
+
flex-direction: column;
|
87
|
+
`;
|
88
|
+
const SectionHeadingText = styled(Text) `
|
89
|
+
font-weight: bold;
|
90
|
+
`;
|
91
|
+
const TextWrapper = styled.div `
|
92
|
+
display: flex;
|
93
|
+
flex-direction: column;
|
94
|
+
margin-bottom: 8px;
|
95
|
+
`;
|
96
|
+
const Asterisk = styled.span `
|
97
|
+
font-size: 14px;
|
98
|
+
color: ${theme.colors.error};
|
99
|
+
`;
|
100
|
+
//# sourceMappingURL=Confirmation.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Confirmation.js","sourceRoot":"","sources":["../../src/ConfirmationRadioButtons/Confirmation.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAuC,MAAM,OAAO,CAAA;AAC3D,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAa,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAiB1D,MAAM,CAAC,MAAM,YAAY,GAA0B,CAAC,KAAK,EAAE,EAAE;IAC3D,MAAM,EACJ,OAAO,EACP,QAAQ,EACR,EAAE,EAAE,MAAM,EACV,KAAK,GAAG,KAAK,EACb,QA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MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAA;;;;WAIjB,KAAK,CAAC,MAAM,CAAC,KAAK;CAC5B,CAAA;AAED,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;CAGtC,CAAA;AAED,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAEtC,CAAA;AAED,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAI7B,CAAA;AAED,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAA;;WAEjB,KAAK,CAAC,MAAM,CAAC,KAAK;CAC5B,CAAA"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ConfirmationProps } from './Confirmation';
|
3
|
+
declare const _default: {
|
4
|
+
title: string;
|
5
|
+
component: React.FC<ConfirmationProps>;
|
6
|
+
argTypes: {
|
7
|
+
onChange: {
|
8
|
+
action: string;
|
9
|
+
};
|
10
|
+
};
|
11
|
+
};
|
12
|
+
export default _default;
|
13
|
+
export declare const Default: any;
|
14
|
+
export declare const WithError: any;
|
15
|
+
export declare const WithSublabel: any;
|
16
|
+
export declare const WorkingExample: any;
|
17
|
+
export declare const WithCustomLabel: any;
|
18
|
+
export declare const WithNoLabel: any;
|
19
|
+
export declare const Required: any;
|
20
|
+
export declare const RequiredWithLongLabel: any;
|
21
|
+
export declare const Disabled: any;
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { noop } from '../utils/noop';
|
3
|
+
import { Confirmation } from './Confirmation';
|
4
|
+
import { Container } from './Container';
|
5
|
+
export default {
|
6
|
+
title: 'Confirmation Radio Button',
|
7
|
+
component: Confirmation,
|
8
|
+
argTypes: { onChange: { action: 'clicked' } },
|
9
|
+
};
|
10
|
+
const Template = (props) => React.createElement(Confirmation, Object.assign({}, props));
|
11
|
+
export const Default = Template.bind({});
|
12
|
+
Default.args = {
|
13
|
+
id: 'radioButton',
|
14
|
+
onChange: noop,
|
15
|
+
checked: false,
|
16
|
+
label: 'Do you like marshmallows?',
|
17
|
+
};
|
18
|
+
export const WithError = Template.bind({});
|
19
|
+
WithError.args = {
|
20
|
+
id: 'radioButton',
|
21
|
+
onChange: noop,
|
22
|
+
checked: undefined,
|
23
|
+
label: 'Do you like marshmallows?',
|
24
|
+
error: true,
|
25
|
+
errorMsg: 'This field is required.',
|
26
|
+
};
|
27
|
+
export const WithSublabel = Template.bind({});
|
28
|
+
WithSublabel.args = {
|
29
|
+
id: 'radioButton',
|
30
|
+
onChange: noop,
|
31
|
+
checked: undefined,
|
32
|
+
label: 'Do you like marshmallows?',
|
33
|
+
sublabel: 'This includes smores and hot chocolate topped with marshmallows.',
|
34
|
+
};
|
35
|
+
const ContainerTemplate = () => React.createElement(Container, null);
|
36
|
+
export const WorkingExample = ContainerTemplate.bind({});
|
37
|
+
export const WithCustomLabel = Template.bind({});
|
38
|
+
WithCustomLabel.args = {
|
39
|
+
id: 'radioButton',
|
40
|
+
onChange: noop,
|
41
|
+
checked: undefined,
|
42
|
+
label: 'Do you like marshmallows?',
|
43
|
+
yesLabel: 'Correct',
|
44
|
+
};
|
45
|
+
export const WithNoLabel = Template.bind({});
|
46
|
+
WithNoLabel.args = {
|
47
|
+
id: 'radioButton',
|
48
|
+
onChange: noop,
|
49
|
+
checked: undefined,
|
50
|
+
yesLabel: 'Yes',
|
51
|
+
};
|
52
|
+
export const Required = Template.bind({});
|
53
|
+
Required.args = {
|
54
|
+
id: 'radioButton',
|
55
|
+
label: 'Do you like ice cream?',
|
56
|
+
onChange: noop,
|
57
|
+
checked: undefined,
|
58
|
+
required: true,
|
59
|
+
};
|
60
|
+
export const RequiredWithLongLabel = Template.bind({});
|
61
|
+
RequiredWithLongLabel.args = {
|
62
|
+
id: 'radioButton',
|
63
|
+
label: 'This is a really long label to test the placement of the required asterisk. Do you like ice cream, pie, marshmallows, smores, cupcakes, cookies, and muffins?',
|
64
|
+
onChange: noop,
|
65
|
+
checked: undefined,
|
66
|
+
required: true,
|
67
|
+
};
|
68
|
+
export const Disabled = Template.bind({});
|
69
|
+
Disabled.args = {
|
70
|
+
id: 'radioButton',
|
71
|
+
label: 'Do you like marshmallows?',
|
72
|
+
onChange: noop,
|
73
|
+
checked: true,
|
74
|
+
disabled: true,
|
75
|
+
};
|
76
|
+
//# sourceMappingURL=Confirmation.stories.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Confirmation.stories.js","sourceRoot":"","sources":["../../src/ConfirmationRadioButtons/Confirmation.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,YAAY,EAAqB,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,eAAe;IACb,KAAK,EAAE,2BAA2B;IAClC,SAAS,EAAE,YAAY;IACvB,QAAQ,EAAE,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;CAC9C,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,KAAwB,EAAE,EAAE,CAAC,oBAAC,YAAY,oBAAK,KAAK,EAAI,CAAA;AAE1E,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAExC,OAAO,CAAC,IAAI,GAAG;IACb,EAAE,EAAE,aAAa;IACjB,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,2BAA2B;CACnC,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAE1C,SAAS,CAAC,IAAI,GAAG;IACf,EAAE,EAAE,aAAa;IACjB,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,2BAA2B;IAClC,KAAK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CAAC,CAAA;AAEtD,qBAAqB,CAAC,IAAI,GAAG;IAC3B,EAAE,EAAE,aAAa;IACjB,KAAK,EACH,+JAA+J;IACjK,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,IAAI;CACf,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAEzC,QAAQ,CAAC,IAAI,GAAG;IACd,EAAE,EAAE,aAAa;IACjB,KAAK,EAAE,2BAA2B;IAClC,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;CACf,CAAA"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React, { useState } from 'react';
|
2
|
+
import { Confirmation } from './Confirmation';
|
3
|
+
export const Container = () => {
|
4
|
+
const [checked, setChecked] = useState(undefined);
|
5
|
+
return (React.createElement("form", null,
|
6
|
+
React.createElement(Confirmation, { id: "radioButton", onChange: (selection) => setChecked(selection), checked: checked, label: 'Do you like marshmallows?', error: checked === undefined, errorMsg: "This field is required." })));
|
7
|
+
};
|
8
|
+
//# sourceMappingURL=Container.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Container.js","sourceRoot":"","sources":["../../src/ConfirmationRadioButtons/Container.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAsB,SAAS,CAAC,CAAA;IAEtE,OAAO,CACL;QACE,oBAAC,YAAY,IACX,EAAE,EAAC,aAAa,EAChB,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAC9C,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,2BAA2B,EAClC,KAAK,EAAE,OAAO,KAAK,SAAS,EAC5B,QAAQ,EAAC,yBAAyB,GAClC,CACG,CACR,CAAA;AACH,CAAC,CAAA"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { FC, ChangeEvent, FocusEvent, ReactElement } from 'react';
|
2
|
+
export interface FakeInput {
|
3
|
+
checked?: boolean;
|
4
|
+
error?: boolean;
|
5
|
+
disabled?: boolean;
|
6
|
+
}
|
7
|
+
type RadioButtonProps = {
|
8
|
+
id: string;
|
9
|
+
label: string | ReactElement;
|
10
|
+
checked?: boolean;
|
11
|
+
value: string;
|
12
|
+
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
13
|
+
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
14
|
+
disabled?: boolean;
|
15
|
+
};
|
16
|
+
export declare const RadioButton: FC<RadioButtonProps>;
|
17
|
+
export {};
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import styled from 'styled-components';
|
3
|
+
import { theme } from '../theme';
|
4
|
+
import { Box } from '../Box';
|
5
|
+
export const RadioButton = ({ id, label, checked, value, onChange, onBlur, disabled = false, }) => (React.createElement(Box, { flex: true, alignItems: "center" },
|
6
|
+
React.createElement(RadioInput, { id: id, type: "radio", checked: checked, value: value, onChange: onChange, onBlur: onBlur, disabled: disabled }),
|
7
|
+
React.createElement(RadioLabel, { htmlFor: id },
|
8
|
+
React.createElement(FakeInput, { checked: checked }),
|
9
|
+
React.createElement(Text, null, label))));
|
10
|
+
const FakeInput = styled.div `
|
11
|
+
width: 24px;
|
12
|
+
height: 24px;
|
13
|
+
border-radius: 50%;
|
14
|
+
background-color: ${theme.colors.white};
|
15
|
+
margin-right: 10px;
|
16
|
+
border: ${({ checked }) => checked
|
17
|
+
? `8px solid ${theme.colors.secondary}`
|
18
|
+
: `1px solid ${theme.colors.secondary}`};
|
19
|
+
`;
|
20
|
+
const RadioInput = styled.input `
|
21
|
+
position: absolute;
|
22
|
+
opacity: 0;
|
23
|
+
height: 0;
|
24
|
+
width: 0;
|
25
|
+
`;
|
26
|
+
const RadioLabel = styled.label `
|
27
|
+
font-family: 'Gordita', sans-serif;
|
28
|
+
text-transform: none;
|
29
|
+
font-size: 16px;
|
30
|
+
line-height: 17px;
|
31
|
+
color: ${theme.colors.secondary};
|
32
|
+
margin-bottom: 0;
|
33
|
+
display: flex;
|
34
|
+
cursor: pointer;
|
35
|
+
`;
|
36
|
+
// needed because the text is top aligned in its viewbox
|
37
|
+
const Text = styled.span `
|
38
|
+
position: relative;
|
39
|
+
bottom: -5px;
|
40
|
+
`;
|
41
|
+
//# sourceMappingURL=RadioButtonStyled.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"RadioButtonStyled.js","sourceRoot":"","sources":["../../src/ConfirmationRadioButtons/RadioButtonStyled.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAA;AACxE,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAkB5B,MAAM,CAAC,MAAM,WAAW,GAAyB,CAAC,EAChD,EAAE,EACF,KAAK,EACL,OAAO,EACP,KAAK,EACL,QAAQ,EACR,MAAM,EACN,QAAQ,GAAG,KAAK,GACC,EAAE,EAAE,CAAC,CACtB,oBAAC,GAAG,IAAC,IAAI,QAAC,UAAU,EAAC,QAAQ;IAC3B,oBAAC,UAAU,IACT,EAAE,EAAE,EAAE,EACN,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,GAClB;IACF,oBAAC,UAAU,IAAC,OAAO,EAAE,EAAE;QACrB,oBAAC,SAAS,IAAC,OAAO,EAAE,OAAO,GAAI;QAC/B,oBAAC,IAAI,QAAE,KAAK,CAAQ,CACT,CACT,CACP,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAW;;;;sBAIjB,KAAK,CAAC,MAAM,CAAC,KAAK;;YAE5B,CAAC,EAAE,OAAO,EAAa,EAAE,EAAE,CACnC,OAAO;IACL,CAAC,CAAC,aAAa,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE;IACvC,CAAC,CAAC,aAAa,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE;CAC5C,CAAA;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAA;;;;;CAK9B,CAAA;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAA;;;;;WAKpB,KAAK,CAAC,MAAM,CAAC,SAAS;;;;CAIhC,CAAA;AAED,wDAAwD;AACxD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAA;;;CAGvB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { render } from '@testing-library/react';
|
3
|
+
import { Confirmation } from '../Confirmation';
|
4
|
+
test('renders', () => {
|
5
|
+
const { container } = render(React.createElement(Confirmation, null));
|
6
|
+
expect(container.firstChild).toMatchSnapshot();
|
7
|
+
});
|
8
|
+
//# sourceMappingURL=Confirmation.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Confirmation.js","sourceRoot":"","sources":["../../../src/ConfirmationRadioButtons/__tests__/Confirmation.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;IACnB,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,oBAAC,YAAY,OAAG,CAAC,CAAA;IAC9C,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,eAAe,EAAE,CAAA;AAChD,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Confirmation } from './Confirmation';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ConfirmationRadioButtons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA"}
|
@@ -1,14 +1,3 @@
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
-
var t = {};
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
-
t[p] = s[p];
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
-
t[p[i]] = s[p[i]];
|
9
|
-
}
|
10
|
-
return t;
|
11
|
-
};
|
12
1
|
import React, { useState } from 'react';
|
13
2
|
import styled from 'styled-components';
|
14
3
|
import { format, addDays, getMonth, getYear, eachMonthOfInterval, isSameDay, isWithinInterval, getDaysInMonth, isWeekend, isSameMonth, } from 'date-fns';
|
@@ -30,14 +19,13 @@ const getAvailableMonths = (startDate, endDate) => {
|
|
30
19
|
label: format(monthDate, 'MMMM'),
|
31
20
|
}));
|
32
21
|
};
|
33
|
-
export const Datepicker = (
|
34
|
-
var { showDayLabels = false, disableWeekend = true, range = 14, fromDate = new Date(), endingDate, showYear = false, showSelectedDate = false, onDateSelect, onChange, value } = _a, marginProps = __rest(_a, ["showDayLabels", "disableWeekend", "range", "fromDate", "endingDate", "showYear", "showSelectedDate", "onDateSelect", "onChange", "value"]);
|
22
|
+
export const Datepicker = ({ showDayLabels = false, disableWeekend = true, range = 14, fromDate = new Date(), endingDate, showYear = false, showSelectedDate = false, onDateSelect, onChange, value, ...marginProps }) => {
|
35
23
|
// We want to make sure that the date is in the UK timezone,
|
36
24
|
// this might need to be revisit when opening up to new countries
|
37
25
|
const startDate = convertToUkDate(fromDate);
|
38
26
|
const endDate = endingDate ? endingDate : addDays(startDate, range);
|
39
27
|
const availableMonths = getAvailableMonths(startDate, endDate);
|
40
|
-
const selectedDate = value
|
28
|
+
const selectedDate = value ?? new Date();
|
41
29
|
const [activeDay, setActiveDay] = useControllableState({
|
42
30
|
initialState: undefined,
|
43
31
|
stateProp: value,
|
@@ -47,7 +35,7 @@ export const Datepicker = (_a) => {
|
|
47
35
|
: 0);
|
48
36
|
const handleSelectEvent = (date) => {
|
49
37
|
setActiveDay(date);
|
50
|
-
onChange
|
38
|
+
onChange?.(date);
|
51
39
|
onDateSelect(format(date, 'yyyy-MM-dd'));
|
52
40
|
};
|
53
41
|
const generateDaysForMonth = (monthDate) => {
|
@@ -67,7 +55,7 @@ export const Datepicker = (_a) => {
|
|
67
55
|
}
|
68
56
|
return filteredDays;
|
69
57
|
};
|
70
|
-
return (React.createElement(Container,
|
58
|
+
return (React.createElement(Container, { id: "datepicker", ...marginProps },
|
71
59
|
React.createElement(Header, { flex: true, alignItems: "center", justifyContent: "space-between", direction: "row" },
|
72
60
|
React.createElement(Circle, { type: "button", disabled: activeMonthIndex === 0, onClick: () => setActiveMonth(activeMonthIndex - 1), onKeyDown: (e) => {
|
73
61
|
if (e.key === 'Enter') {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Datepicker.js","sourceRoot":"","sources":["../../src/Datepicker/Datepicker.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"Datepicker.js","sourceRoot":"","sources":["../../src/Datepicker/Datepicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,MAAM,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AGX,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;CACxC,CAAA;AAED,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;sBACN,KAAK,CAAC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;IAgBxC,iBAAiB;CACpB,CAAA"}
|
@@ -5,7 +5,7 @@ export default {
|
|
5
5
|
component: Datepicker,
|
6
6
|
argTypes: { onDateSelect: { action: 'date selected' } },
|
7
7
|
};
|
8
|
-
const Template = (props) => React.createElement(Datepicker,
|
8
|
+
const Template = (props) => React.createElement(Datepicker, { ...props });
|
9
9
|
export const Default = Template.bind({});
|
10
10
|
Default.args = {
|
11
11
|
showDayLabels: false,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Datepicker.stories.js","sourceRoot":"","sources":["../../src/Datepicker/Datepicker.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAA;AAE1D,eAAe;IACb,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,UAAU;IACrB,QAAQ,EAAE,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,EAAE;CACxD,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,KAAsB,EAAE,EAAE,CAAC,oBAAC,UAAU,
|
1
|
+
{"version":3,"file":"Datepicker.stories.js","sourceRoot":"","sources":["../../src/Datepicker/Datepicker.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAA;AAE1D,eAAe;IACb,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,UAAU;IACrB,QAAQ,EAAE,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,EAAE;CACxD,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,KAAsB,EAAE,EAAE,CAAC,oBAAC,UAAU,OAAK,KAAK,GAAI,CAAA;AAEtE,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAExC,OAAO,CAAC,IAAI,GAAG;IACb,aAAa,EAAE,KAAK;IACpB,cAAc,EAAE,KAAK;IACrB,aAAa,EAAE,IAAI;IACnB,KAAK,EAAE,EAAE;IACT,QAAQ,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC;CACjC,CAAA"}
|
@@ -18,7 +18,7 @@ export const DatesList = ({ items, handleDateSelect, showDayLabels, }) => {
|
|
18
18
|
Array(getBlankDaysCount(items[0].date))
|
19
19
|
.fill(null)
|
20
20
|
.map((_, index) => (React.createElement(ListButton, { key: `blankItem-${index}`, disabled: true }))),
|
21
|
-
items.map((item, i) => (React.createElement(ListButton, { key: i, disabled: item.disabled, className: `ListButton ${item.active ? 'active' : ''}`, onClick: () => handleDateSelect(item.date), onKeyDown: (e) => {
|
21
|
+
items.map((item, i) => (React.createElement(ListButton, { key: i, type: "button", disabled: item.disabled, className: `ListButton ${item.active ? 'active' : ''}`, onClick: () => handleDateSelect(item.date), onKeyDown: (e) => {
|
22
22
|
if (e.key === 'Enter') {
|
23
23
|
handleDateSelect(item.date);
|
24
24
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DatesList.js","sourceRoot":"","sources":["../../src/Datepicker/DatesList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAGhC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAQzD,MAAM,iBAAiB,GAAG,CAAC,kBAAwB,EAAE,EAAE;IACrD,MAAM,YAAY,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,CAAC,CAAC,EAAE,EAAE;gBACf,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE;oBACrB,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;iBAC5B;YACH,CAAC,iBACY,IAAI,CAAC,KAAK,IAEtB,IAAI,CAAC,KAAK,CACA,CACd,CAAC,CACQ,CACb,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;CAiB3B,CAAA;AAMD,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAa;;;;;;;;iBAQ5B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;;;WAG9B,KAAK,CAAC,MAAM,CAAC,SAAS;;oBAEb,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;aACjD,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;;;;aAI1C,KAAK,CAAC,MAAM,CAAC,OAAO;wBACT,KAAK,CAAC,MAAM,CAAC,SAAS;;;;aAIjC,KAAK,CAAC,MAAM,CAAC,OAAO;wBACT,KAAK,CAAC,MAAM,CAAC,SAAS;;;;IAI1C,iBAAiB;CACpB,CAAA"}
|
package/dist/Divider/Divider.js
CHANGED
@@ -1,21 +1,9 @@
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
-
var t = {};
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
-
t[p] = s[p];
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
-
t[p[i]] = s[p[i]];
|
9
|
-
}
|
10
|
-
return t;
|
11
|
-
};
|
12
1
|
import React, { memo } from 'react';
|
13
2
|
import styled, { css } from 'styled-components';
|
14
3
|
import { Box } from '../Box';
|
15
4
|
import { theme } from '../theme';
|
16
|
-
export const Divider = memo(function Divider(
|
17
|
-
|
18
|
-
return (React.createElement(Line, Object.assign({ maxWidth: maxWidth, height: height, color: color }, marginProps)));
|
5
|
+
export const Divider = memo(function Divider({ maxWidth = 'none', height = '1px', color = 'oatmeal', ...marginProps }) {
|
6
|
+
return (React.createElement(Line, { maxWidth: maxWidth, height: height, color: color, ...marginProps }));
|
19
7
|
});
|
20
8
|
const Line = styled(Box) `
|
21
9
|
${({ color }) => color
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Divider.js","sourceRoot":"","sources":["../../src/Divider/Divider.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"Divider.js","sourceRoot":"","sources":["../../src/Divider/Divider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,IAAI,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAS,KAAK,EAAE,MAAM,UAAU,CAAA;AAQvC,MAAM,CAAC,MAAM,OAAO,GAAqB,IAAI,CAAC,SAAS,OAAO,CAAC,EAC7D,QAAQ,GAAG,MAAM,EACjB,MAAM,GAAG,KAAK,EACd,KAAK,GAAG,SAAS,EACjB,GAAG,WAAW,EACf;IACC,OAAO,CACL,oBAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAM,WAAW,GAAI,CAC5E,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAkB;IACtC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CACd,KAAK;IACH,CAAC,CAAC,GAAG,CAAA;wBACa,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;SAClC;IACH,CAAC,CAAC,EAAE;;YAEE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM;eACnB,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ;;CAExC,CAAA"}
|
@@ -4,7 +4,7 @@ export default {
|
|
4
4
|
title: 'Divider',
|
5
5
|
component: Divider,
|
6
6
|
};
|
7
|
-
const Template = (props) => React.createElement(Divider,
|
7
|
+
const Template = (props) => React.createElement(Divider, { ...props });
|
8
8
|
export const Default = Template.bind({});
|
9
9
|
Default.args = {};
|
10
10
|
//# sourceMappingURL=Divier.stories.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Divier.stories.js","sourceRoot":"","sources":["../../src/Divider/Divier.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAgB,MAAM,WAAW,CAAA;AAEjD,eAAe;IACb,KAAK,EAAE,SAAS;IAChB,SAAS,EAAE,OAAO;CACnB,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,KAAmB,EAAE,EAAE,CAAC,oBAAC,OAAO,
|
1
|
+
{"version":3,"file":"Divier.stories.js","sourceRoot":"","sources":["../../src/Divider/Divier.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAgB,MAAM,WAAW,CAAA;AAEjD,eAAe;IACb,KAAK,EAAE,SAAS;IAChB,SAAS,EAAE,OAAO;CACnB,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,KAAmB,EAAE,EAAE,CAAC,oBAAC,OAAO,OAAK,KAAK,GAAI,CAAA;AAEhE,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAExC,OAAO,CAAC,IAAI,GAAG,EAAE,CAAA"}
|