@mrshmllw/smores-react 6.2.1 → 7.0.0-crumbs-sc-v6.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/README.md +20 -6
- package/dist/Accordion/Accordion.js +12 -12
- package/dist/Accordion/Accordion.js.map +1 -1
- package/dist/ActionDropdown/ActionDropdown.js +4 -4
- package/dist/ActionDropdown/ActionDropdown.js.map +1 -1
- package/dist/Banner/BannerItem.js +5 -5
- package/dist/Banner/BannerItem.js.map +1 -1
- package/dist/Box/Box.d.ts +8 -5
- package/dist/Box/Box.js +8 -2
- package/dist/Box/Box.js.map +1 -1
- package/dist/BrandCard/BrandCard.d.ts +2 -2
- package/dist/BrandCard/BrandCard.js +12 -12
- package/dist/BrandCard/BrandCard.js.map +1 -1
- package/dist/Button/Button.js +14 -14
- package/dist/Button/Button.js.map +1 -1
- package/dist/Card/Card.js +15 -15
- package/dist/Card/Card.js.map +1 -1
- package/dist/CheckBox/CheckBox.js +2 -2
- package/dist/CheckBox/CheckBox.js.map +1 -1
- package/dist/Chip/Chip.js +6 -6
- package/dist/Chip/Chip.js.map +1 -1
- package/dist/CurrencyInput/CurrencyInput.js +3 -3
- package/dist/CurrencyInput/CurrencyInput.js.map +1 -1
- package/dist/Datepicker/Datepicker.js +3 -3
- package/dist/Datepicker/Datepicker.js.map +1 -1
- package/dist/Divider/Divider.d.ts +1 -1
- package/dist/Divider/Divider.js +7 -8
- package/dist/Divider/Divider.js.map +1 -1
- package/dist/Dropdown/Dropdown.js +7 -7
- package/dist/Dropdown/Dropdown.js.map +1 -1
- package/dist/Emoji/Emoji.js +3 -3
- package/dist/Emoji/Emoji.js.map +1 -1
- package/dist/Icon/Icon.js +1 -1
- package/dist/Icon/Icon.js.map +1 -1
- package/dist/Icon/iconFiles/Bullets.js +1 -1
- package/dist/Icon/iconFiles/Bullets.js.map +1 -1
- package/dist/IconStrict/IconStrict.js +8 -8
- package/dist/IconStrict/IconStrict.js.map +1 -1
- package/dist/IconWrapper/IconWrapper.js +8 -8
- package/dist/IconWrapper/IconWrapper.js.map +1 -1
- package/dist/LabelledText/LabelledText.d.ts +1 -1
- package/dist/LabelledText/LabelledText.js +2 -2
- package/dist/LabelledText/LabelledText.js.map +1 -1
- package/dist/Link/Link.d.ts +1 -1
- package/dist/Link/Link.js +5 -5
- package/dist/Link/Link.js.map +1 -1
- package/dist/Loader/Loader.js +7 -4
- package/dist/Loader/Loader.js.map +1 -1
- package/dist/Modal/Modal.js +9 -9
- package/dist/Modal/Modal.js.map +1 -1
- package/dist/NumberInput/NumberInput.js +4 -4
- package/dist/NumberInput/NumberInput.js.map +1 -1
- package/dist/Pagination/Pagination.js +6 -6
- package/dist/Pagination/Pagination.js.map +1 -1
- package/dist/RadioGroup/RadioElement.js +6 -6
- package/dist/RadioGroup/RadioElement.js.map +1 -1
- package/dist/RadioGroup/RadioGroup.js +3 -3
- package/dist/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/RadioGroup/RadioItem.js +15 -14
- package/dist/RadioGroup/RadioItem.js.map +1 -1
- package/dist/RichTextEditor/plugins/ToolbarPlugin.js +3 -1
- package/dist/RichTextEditor/plugins/ToolbarPlugin.js.map +1 -1
- package/dist/Row/Row.js +9 -9
- package/dist/Row/Row.js.map +1 -1
- package/dist/SearchInput/SearchInput.js +1 -1
- package/dist/SearchInput/SearchInput.js.map +1 -1
- package/dist/SearchInput/SearchOptions.js +6 -6
- package/dist/SearchInput/SearchOptions.js.map +1 -1
- package/dist/SupportMessage/SupportMessage.js +4 -4
- package/dist/SupportMessage/SupportMessage.js.map +1 -1
- package/dist/Table/Table.js +1 -1
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/components/RowActions.js +4 -4
- package/dist/Table/components/RowActions.js.map +1 -1
- package/dist/Table/components/TableHeader.js +2 -2
- package/dist/Table/components/TableHeader.js.map +1 -1
- package/dist/Table/components/TableRow.js +2 -2
- package/dist/Table/components/TableRow.js.map +1 -1
- package/dist/Table/components/commonComponents.d.ts +6 -4
- package/dist/Table/components/commonComponents.js +35 -35
- package/dist/Table/components/commonComponents.js.map +1 -1
- package/dist/Tag/Tag.js +4 -4
- package/dist/Tag/Tag.js.map +1 -1
- package/dist/Text/Text.js +20 -20
- package/dist/Text/Text.js.map +1 -1
- package/dist/TextInput/TextInput.js +5 -5
- package/dist/TextInput/TextInput.js.map +1 -1
- package/dist/Textarea/Textarea.js +6 -6
- package/dist/Textarea/Textarea.js.map +1 -1
- package/dist/Toggle/Toggle.js +1 -1
- package/dist/Toggle/Toggle.js.map +1 -1
- package/dist/Tooltip/Tooltip.d.ts +10 -10
- package/dist/Tooltip/Tooltip.js +16 -16
- package/dist/Tooltip/Tooltip.js.map +1 -1
- package/dist/fields/components/CommonInput.d.ts +20 -8
- package/dist/fields/components/CommonInput.js +9 -9
- package/dist/fields/components/CommonInput.js.map +1 -1
- package/dist/fields/components/InternalField.js +5 -5
- package/dist/fields/components/InternalField.js.map +1 -1
- package/dist/fontStyle.d.ts +2 -1
- package/dist/utils/flex.d.ts +3 -1
- package/dist/utils/flex.js +18 -18
- package/dist/utils/flex.js.map +1 -1
- package/dist/utils/focusOutline.d.ts +2 -2
- package/dist/utils/measure.d.ts +3 -1
- package/dist/utils/measure.js +7 -7
- package/dist/utils/measure.js.map +1 -1
- package/dist/utils/space.d.ts +5 -2
- package/dist/utils/space.js +30 -30
- package/dist/utils/space.js.map +1 -1
- package/dist/utils/utilTypes.d.ts +7 -0
- package/dist/utils/utilTypes.js +2 -0
- package/dist/utils/utilTypes.js.map +1 -0
- package/package.json +2 -3
package/README.md
CHANGED
@@ -41,19 +41,33 @@ So to ensure our CHANGELOG.md is updated automatically and gets the changes we h
|
|
41
41
|
#### Preview
|
42
42
|
Before releasing, you may want to see the changes that will be included in the next version deployed on NPM, you can do so by:
|
43
43
|
|
44
|
-
1.
|
45
|
-
2.
|
44
|
+
1. Goto our [github workflows](https://github.com/marshmallow-insurance/smores-react/actions)
|
45
|
+
2. Click `Preview Bump and Publish`
|
46
|
+
3. Press `Run workflow` and select the `main` branch.
|
47
|
+
4. Wait for the `Generate preview CHANGELOG.md` and look at the results!
|
46
48
|
|
47
49
|
#### Releasing & Publishing
|
48
50
|
When you're happy with your changes, you can release & publish your changes to NPM in one fell swoop by:
|
49
51
|
|
50
|
-
1. Goto
|
51
|
-
2. Click `
|
52
|
-
3.
|
53
|
-
4. Wait for
|
52
|
+
1. Goto our [github workflows](https://github.com/marshmallow-insurance/smores-react/actions)
|
53
|
+
2. Click `Bump and Publish`
|
54
|
+
3. Press `Run workflow` and select the `main` branch.
|
55
|
+
4. Wait for release!
|
54
56
|
|
55
57
|
Note: this workflow will fail if the package version is already on the latest, so you dont have to worry about deploying the same changes multiple times.
|
56
58
|
|
59
|
+
#### Pre-Releases
|
60
|
+
Not too different to your usual workflow!
|
61
|
+
|
62
|
+
1. Checkout a new branch with the prefix `crumbs-<your-branch-name>`
|
63
|
+
2. Open a PR and create your changes as normal using semantic-commits!
|
64
|
+
3. Goto our [github workflows](https://github.com/marshmallow-insurance/smores-react/actions)
|
65
|
+
4. Click `Bump and Publish` or `Preview Bump and Publish`
|
66
|
+
5. Press `Run workflow` and select `crumbs-<your-branch-name>` branch.
|
67
|
+
6. Wait for release!
|
68
|
+
7. This can be done multiple times and it will increment your pre-release package version!
|
69
|
+
8. When you're happy with the changes, simply squash and merge the PR and release `main`!
|
70
|
+
|
57
71
|
###### Tokens
|
58
72
|
|
59
73
|
The `MARSHMALLOW_CI_PAT` has been created from the internal @marshmallow-ci GH account, it is due to expire on `27th November 2024` so will need regenerating once it does.
|
@@ -2,8 +2,8 @@ import React, { useState } from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
3
3
|
import { Box } from '../Box';
|
4
4
|
import { Icon } from '../Icon';
|
5
|
-
import { theme } from '../theme';
|
6
5
|
import { Text } from '../Text';
|
6
|
+
import { theme } from '../theme';
|
7
7
|
export const Accordion = ({ title, children, onToggle, filledBackground, defaultIsOpen = false, borderTop = false, borderColor = 'oatmeal', backgroundColor = 'custard', subTitle, fullBorder = false, ...marginProps }) => {
|
8
8
|
const [isOpen, setIsOpen] = useState(defaultIsOpen);
|
9
9
|
const px = fullBorder ? '16px' : '0';
|
@@ -12,27 +12,27 @@ export const Accordion = ({ title, children, onToggle, filledBackground, default
|
|
12
12
|
onToggle?.(nextOpenState);
|
13
13
|
setIsOpen(nextOpenState);
|
14
14
|
};
|
15
|
-
return (React.createElement(Wrapper, { borderTop: borderTop, fullBorder: fullBorder, filledBackground: filledBackground, borderColor: borderColor, backgroundColor: backgroundColor, ...marginProps },
|
15
|
+
return (React.createElement(Wrapper, { "$borderTop": borderTop, "$fullBorder": fullBorder, "$filledBackground": filledBackground, "$borderColor": borderColor, "$backgroundColor": backgroundColor, ...marginProps },
|
16
16
|
React.createElement(TopContainer, { flex: true, alignItems: "center", justifyContent: "space-between", onClick: handleToggle, py: "16px", pr: "16px", pl: px },
|
17
17
|
React.createElement(TitleContainer, null,
|
18
18
|
React.createElement(Text, { tag: "h2", typo: "headline-regular", color: "liquorice" }, title),
|
19
19
|
subTitle && (React.createElement(Text, { tag: "label", color: "liquorice", typo: "label", mt: { custom: 4 } }, subTitle))),
|
20
|
-
React.createElement(CaretIcon, { render: "caret", size: 24, color: "marzipan", isOpen: isOpen, borderTop: borderTop })),
|
20
|
+
React.createElement(CaretIcon, { render: "caret", size: 24, color: "marzipan", "$isOpen": isOpen, "$borderTop": borderTop })),
|
21
21
|
isOpen && (React.createElement(Box, { pt: "12px", pb: "16px", px: px }, children))));
|
22
22
|
};
|
23
|
-
const Wrapper = styled(Box)(({ borderTop, fullBorder, filledBackground, borderColor = 'oatmeal', backgroundColor = 'custard', }) => css `
|
24
|
-
border-bottom: 1px solid ${theme.colors[borderColor]};
|
25
|
-
${borderTop && `border-top: 1px solid ${theme.colors[borderColor]};`}
|
23
|
+
const Wrapper = styled(Box)(({ $borderTop, $fullBorder, $filledBackground, $borderColor = 'oatmeal', $backgroundColor = 'custard', }) => css `
|
24
|
+
border-bottom: 1px solid ${theme.colors[$borderColor]};
|
25
|
+
${$borderTop && `border-top: 1px solid ${theme.colors[$borderColor]};`}
|
26
26
|
|
27
|
-
${fullBorder &&
|
27
|
+
${$fullBorder &&
|
28
28
|
css `
|
29
|
-
border: 1px solid ${theme.colors[borderColor]};
|
29
|
+
border: 1px solid ${theme.colors[$borderColor]};
|
30
30
|
border-radius: 16px;
|
31
31
|
`}
|
32
32
|
|
33
|
-
${filledBackground &&
|
33
|
+
${$filledBackground &&
|
34
34
|
css `
|
35
|
-
background-color: ${theme.colors[backgroundColor]};
|
35
|
+
background-color: ${theme.colors[$backgroundColor]};
|
36
36
|
`}
|
37
37
|
`);
|
38
38
|
const TitleContainer = styled.div `
|
@@ -42,8 +42,8 @@ const TitleContainer = styled.div `
|
|
42
42
|
const TopContainer = styled(Box) `
|
43
43
|
cursor: pointer;
|
44
44
|
`;
|
45
|
-
const CaretIcon = styled(Icon)(({ isOpen }) => css `
|
46
|
-
transform: ${isOpen ? 'rotate(180deg)' : 'rotate(0deg)'};
|
45
|
+
const CaretIcon = styled(Icon)(({ $isOpen }) => css `
|
46
|
+
transform: ${$isOpen ? 'rotate(180deg)' : 'rotate(0deg)'};
|
47
47
|
transition: transform 0.6s ease;
|
48
48
|
`);
|
49
49
|
//# sourceMappingURL=Accordion.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../src/Accordion/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,QAAQ,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;
|
1
|
+
{"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../src/Accordion/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,QAAQ,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,MAAM,EAAE,EAAE,G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AAC,gBAAgB,CAAC,CAAC,CAAC,cAAc;;GAEzD,CACF,CAAA"}
|
@@ -9,15 +9,15 @@ export const ActionDropdown = ({ id, className = '', label, value, list, onSelec
|
|
9
9
|
const [open, setOpen] = useState(false);
|
10
10
|
return (React.createElement(Container, { id: id, className: className, onClick: () => setOpen((currentOpen) => !currentOpen), ...marginProps },
|
11
11
|
label && (React.createElement(Text, { tag: "label", color: "sesame", typo: "label" }, label)),
|
12
|
-
React.createElement(Label, { text: value.textColor ?? 'liquorice', bg: value.bgColor ?? 'sesame' },
|
12
|
+
React.createElement(Label, { "$text": value.textColor ?? 'liquorice', "$bg": value.bgColor ?? 'sesame' },
|
13
13
|
React.createElement(SelectedOption, null, value.label),
|
14
14
|
React.createElement(Icon, { render: "caret", color: value.textColor ?? 'sesame', size: 24, rotate: open ? 180 : 0 })),
|
15
15
|
React.createElement(OuterContainer, { open: open },
|
16
16
|
React.createElement(List, { options: list, selectOption: onSelect }))));
|
17
17
|
};
|
18
|
-
const Label = styled.div(({ text, bg }) => css `
|
19
|
-
color: ${theme.colors[text]};
|
20
|
-
background-color: ${theme.colors[bg]};
|
18
|
+
const Label = styled.div(({ $text, $bg }) => css `
|
19
|
+
color: ${theme.colors[$text]};
|
20
|
+
background-color: ${theme.colors[$bg]};
|
21
21
|
position: relative;
|
22
22
|
width: 100%;
|
23
23
|
height: 48px;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ActionDropdown.js","sourceRoot":"","sources":["../../src/ActionDropdown/ActionDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,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;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CA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AAI,CAAA;;;;;;CAMjC,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;;;;;;;CAS5B,CAAA;AAMD,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAC/B,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;;;;;eAKJ,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;kBACpB,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;wBACjB,KAAK,CAAC,MAAM,CAAC,OAAO;kBAC1B,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ;;;GAGvC,CACF,CAAA"}
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import { Box } from '../Box';
|
2
1
|
import React from 'react';
|
3
2
|
import styled, { css } from 'styled-components';
|
3
|
+
import { Box } from '../Box';
|
4
4
|
import { Icon } from '../Icon';
|
5
|
-
import { theme } from '../theme';
|
6
5
|
import { Text } from '../Text';
|
7
6
|
import { useTimeout } from '../hooks';
|
7
|
+
import { theme } from '../theme';
|
8
8
|
const styles = {
|
9
9
|
upsell: {
|
10
10
|
iconColor: 'liquorice',
|
@@ -40,7 +40,7 @@ export const BannerItem = ({ type, autoCloseTime = 4, id, message, topOffset, ex
|
|
40
40
|
useTimeout(() => autoCloseBaner(), autoCloseTime * 1000);
|
41
41
|
const textColor = styles[type].textColor;
|
42
42
|
const iconColor = styles[type].iconColor;
|
43
|
-
return (React.createElement(BannerWrapper, { p: "24px", mt: { custom: topOffset }, key: id, flex: true, justifyContent: "space-between", type: type },
|
43
|
+
return (React.createElement(BannerWrapper, { p: "24px", mt: { custom: topOffset }, key: id, flex: true, justifyContent: "space-between", "$type": type },
|
44
44
|
React.createElement(Box, { flex: true, alignItems: "center" },
|
45
45
|
leadingIcon && (React.createElement(Icon, { mr: "12px", render: leadingIcon, size: 24, color: iconColor })),
|
46
46
|
React.createElement(Text, { typo: "headline-small", color: textColor }, message)),
|
@@ -51,9 +51,9 @@ export const BannerItem = ({ type, autoCloseTime = 4, id, message, topOffset, ex
|
|
51
51
|
showExploreText && (React.createElement(UnderlinedText, { ml: "12px", tag: "span", typo: "desc-medium", color: textColor }, "Explore")),
|
52
52
|
showExploreIcon && (React.createElement(Icon, { render: "arrow", ml: "12px", size: 24, color: iconColor, rotate: 180 }))))))));
|
53
53
|
};
|
54
|
-
const BannerWrapper = styled(Box)(({ type }) => css `
|
54
|
+
const BannerWrapper = styled(Box)(({ $type }) => css `
|
55
55
|
border-radius: 0px 0px 16px 16px;
|
56
|
-
background-color: ${styles[type].backgroundColor};
|
56
|
+
background-color: ${styles[$type].backgroundColor};
|
57
57
|
`);
|
58
58
|
const GenericButton = styled.button `
|
59
59
|
cursor: pointer;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BannerItem.js","sourceRoot":"","sources":["../../src/Banner/BannerItem.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"BannerItem.js","sourceRoot":"","sources":["../../src/Banner/BannerItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,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;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAS,KAAK,EAAE,MAAM,UAAU,CAAA;AAWvC,MAAM,MAAM,GAAmC;IAC7C,MAAM,EAAE;QACN,SAAS,EAAE,WAAW;QACtB,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe;QAC7C,SAAS,EAAE,WAAW;KACvB;IACD,QAAQ,EAAE;QACR,SAAS,EA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E,EAAE,CAAC,GAAG,CAAA;;wBAEI,MAAM,CAAC,KAAK,CAAC,CAAC,eAAe;GAClD,CACF,CAAA;AAED,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAA;;CAElC,CAAA;AAED,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAElC,CAAA"}
|
package/dist/Box/Box.d.ts
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
|
5
|
-
export
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
2
|
+
import { FlexProps, TransientFlexProps } from '../utils/flex';
|
3
|
+
import { MeasureProps, TransientMeasureProps } from '../utils/measure';
|
4
|
+
import { MarginProps, PaddingProps, TransientMarginProps, TransientPaddingProps } from '../utils/space';
|
5
|
+
export type BoxProps = MarginProps & PaddingProps & FlexProps & MeasureProps & HTMLAttributes<HTMLElement>;
|
6
|
+
export type TransientBoxProps = TransientMarginProps & TransientPaddingProps & TransientFlexProps & TransientMeasureProps;
|
7
|
+
export declare const Box: React.ForwardRefExoticComponent<MarginProps & PaddingProps & FlexProps & MeasureProps & React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLDivElement>>;
|
8
|
+
export declare const CustomBox: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, TransientBoxProps>>;
|
package/dist/Box/Box.js
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
import styled from 'styled-components';
|
2
|
+
import React, { forwardRef } from 'react';
|
2
3
|
import { flex } from '../utils/flex';
|
3
4
|
import { measure } from '../utils/measure';
|
4
|
-
import { margin, padding } from '../utils/space';
|
5
|
-
export const Box =
|
5
|
+
import { margin, padding, } from '../utils/space';
|
6
|
+
export const Box = forwardRef((props, ref) => {
|
7
|
+
const { m, mx, my, ml, mr, mt, mb, p, px, py, pl, pr, pt, pb, direction, wrap, flex, flow, justifyContent, alignItems, alignContent, gap, rowGap, columnGap, width, maxWidth, minWidth, height, maxHeight, minHeight, ...otherProps } = props;
|
8
|
+
return (React.createElement(CustomBox, { ref: ref, "$m": m, "$mx": mx, "$my": my, "$ml": ml, "$mr": mr, "$mt": mt, "$mb": mb, "$p": p, "$px": px, "$py": py, "$pl": pl, "$pr": pr, "$pt": pt, "$pb": pb, "$direction": direction, "$wrap": wrap, "$flex": flex, "$flow": flow, "$justifyContent": justifyContent, "$alignItems": alignItems, "$alignContent": alignContent, "$gap": gap, "$rowGap": rowGap, "$columnGap": columnGap, "$width": width, "$maxWidth": maxWidth, "$minWidth": minWidth, "$height": height, "$maxHeight": maxHeight, "$minHeight": minHeight, ...otherProps }, props.children));
|
9
|
+
});
|
10
|
+
Box.displayName = 'Box';
|
11
|
+
export const CustomBox = styled.div `
|
6
12
|
${margin};
|
7
13
|
${padding};
|
8
14
|
${flex};
|
package/dist/Box/Box.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Box.js","sourceRoot":"","sources":["../../src/Box/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,IAAI,
|
1
|
+
{"version":3,"file":"Box.js","sourceRoot":"","sources":["../../src/Box/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,KAAK,EAAE,EAAkB,UAAU,EAAE,MAAM,OAAO,CAAA;AACzD,OAAO,EAAiC,IAAI,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAuC,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC/E,OAAO,EAKL,MAAM,EACN,OAAO,GACR,MAAM,gBAAgB,CAAA;AAavB,MAAM,CAAC,MAAM,GAAG,GAAG,UAAU,CAA2B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACrE,MAAM,EACJ,CAAC,EACD,EAAE,EACF,EAAE,EACF,EAAE,EACF,EAAE,EACF,EAAE,EACF,EAAE,EACF,CAAC,EACD,EAAE,EACF,EAAE,EACF,EAAE,EACF,EAAE,EACF,EAAE,EACF,EAAE,EACF,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,cAAc,EACd,UAAU,EACV,YAAY,EACZ,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,SAAS,EACT,SAAS,EACT,GAAG,UAAU,EACd,GAAG,KAAK,CAAA;IAET,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,GAAG,QACJ,CAAC,SACA,EAAE,SACF,EAAE,SACF,EAAE,SACF,EAAE,SACF,EAAE,SACF,EAAE,QACH,CAAC,SACA,EAAE,SACF,EAAE,SACF,EAAE,SACF,EAAE,SACF,EAAE,SACF,EAAE,gBACK,SAAS,WACd,IAAI,WACJ,IAAI,WACJ,IAAI,qBACM,cAAc,iBAClB,UAAU,mBACR,YAAY,UACrB,GAAG,aACA,MAAM,gBACH,SAAS,YACb,KAAK,eACF,QAAQ,eACR,QAAQ,aACV,MAAM,gBACH,SAAS,gBACT,SAAS,KACjB,UAAU,IAEb,KAAK,CAAC,QAAQ,CACL,CACb,CAAA;AACH,CAAC,CAAC,CAAA;AACF,GAAG,CAAC,WAAW,GAAG,KAAK,CAAA;AAEvB,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAmB;IAClD,MAAM;IACN,OAAO;IACP,IAAI;IACJ,OAAO;CACV,CAAA"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
2
|
-
import { MarginProps } from '../utils/space';
|
3
2
|
import { Color } from '../theme';
|
3
|
+
import { MarginProps } from '../utils/space';
|
4
4
|
export type BrandCardProps = {
|
5
5
|
/** generic card title */
|
6
6
|
title: string;
|
@@ -14,7 +14,7 @@ export type BrandCardProps = {
|
|
14
14
|
visualHeight?: string;
|
15
15
|
/** render image at bottom of card */
|
16
16
|
visualBottom?: boolean;
|
17
|
-
|
17
|
+
bgColor: Color;
|
18
18
|
/** card tag */
|
19
19
|
tag?: ReactNode;
|
20
20
|
/** primary button */
|
@@ -1,24 +1,24 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import styled from 'styled-components';
|
3
|
-
import { theme } from '../theme';
|
4
3
|
import { Box } from '../Box';
|
5
4
|
import { Text } from '../Text';
|
6
|
-
|
7
|
-
|
5
|
+
import { theme } from '../theme';
|
6
|
+
export const BrandCard = ({ title, body, visual, visualHeight = '', alignVisual, visualBottom, tag, buttonAction, fallbackStyle = false, bgColor = 'matcha', maxWidth = '', ...otherProps }) => {
|
7
|
+
return (React.createElement(Container, { maxWidth: maxWidth, "$fallbackStyle": fallbackStyle, "$bgColor": bgColor, ...otherProps },
|
8
8
|
tag && React.createElement(TagWrapper, null, tag),
|
9
|
-
visual && !visualBottom && (React.createElement(VisualWrapper, { visualHeight: visualHeight },
|
10
|
-
React.createElement(Visual, { visualUrl: visual, visualHeight: visualHeight, alignVisual: alignVisual }))),
|
9
|
+
visual && !visualBottom && (React.createElement(VisualWrapper, { "$visualHeight": visualHeight },
|
10
|
+
React.createElement(Visual, { "$visualUrl": visual, "$visualHeight": visualHeight, "$alignVisual": alignVisual }))),
|
11
11
|
React.createElement(Box, { flex: true, alignItems: "center", justifyContent: "space-between", mt: "16px" },
|
12
12
|
React.createElement(Box, { flex: true, alignItems: "center" },
|
13
13
|
React.createElement(Box, null,
|
14
14
|
title && (React.createElement(Text, { typo: "hero-alternate", color: "liquorice" }, title)),
|
15
15
|
body && (React.createElement(Text, { typo: "body-regular", color: "liquorice" }, body))))),
|
16
16
|
buttonAction && React.createElement(Box, { mt: "16px" }, buttonAction),
|
17
|
-
visual && visualBottom && (React.createElement(VisualWrapper, { visualHeight: visualHeight, mt: "16px" },
|
18
|
-
React.createElement(Visual, { visualUrl: visual, visualHeight: visualHeight, alignVisual: alignVisual })))));
|
17
|
+
visual && visualBottom && (React.createElement(VisualWrapper, { "$visualHeight": visualHeight, mt: "16px" },
|
18
|
+
React.createElement(Visual, { "$visualUrl": visual, "$visualHeight": visualHeight, "$alignVisual": alignVisual })))));
|
19
19
|
};
|
20
20
|
const Container = styled(Box) `
|
21
|
-
background: ${({ fallbackStyle, bgColor }) => fallbackStyle ? theme.colors.cream : theme.colors[bgColor]};
|
21
|
+
background: ${({ $fallbackStyle, $bgColor }) => $fallbackStyle ? theme.colors.cream : theme.colors[$bgColor]};
|
22
22
|
box-sizing: border-box;
|
23
23
|
border-radius: 16px 16px 0px 0px;
|
24
24
|
|
@@ -34,15 +34,15 @@ const TagWrapper = styled(Box) `
|
|
34
34
|
const VisualWrapper = styled(Box) `
|
35
35
|
width: 100%;
|
36
36
|
|
37
|
-
${({ visualHeight }) => visualHeight && `height: ${visualHeight};`}
|
37
|
+
${({ $visualHeight }) => $visualHeight && `height: ${$visualHeight};`}
|
38
38
|
`;
|
39
39
|
const Visual = styled(Box) `
|
40
40
|
width: 100%;
|
41
|
-
background-image: url('${(p) => p
|
41
|
+
background-image: url('${(p) => p.$visualUrl}');
|
42
42
|
background-size: contain;
|
43
43
|
background-repeat: no-repeat;
|
44
|
-
background-position: ${({ alignVisual }) => alignVisual ? alignVisual : 'left'};
|
44
|
+
background-position: ${({ $alignVisual }) => $alignVisual ? $alignVisual : 'left'};
|
45
45
|
|
46
|
-
${({ visualHeight }) => visualHeight ? `height: ${visualHeight};` : 'padding-top: 100%;'}
|
46
|
+
${({ $visualHeight }) => $visualHeight ? `height: ${$visualHeight};` : 'padding-top: 100%;'}
|
47
47
|
`;
|
48
48
|
//# sourceMappingURL=BrandCard.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BrandCard.js","sourceRoot":"","sources":["../../src/BrandCard/BrandCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAA;AAC5C,OAAO,MAAM,MAAM,mBAAmB,CAAA;
|
1
|
+
{"version":3,"file":"B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F,CACF;QACL,YAAY,IAAI,oBAAC,GAAG,IAAC,EAAE,EAAC,MAAM,IAAE,YAAY,CAAO;QACnD,MAAM,IAAI,YAAY,IAAI,CACzB,oBAAC,aAAa,qBAAgB,YAAY,EAAE,EAAE,EAAC,MAAM;YACnD,oBAAC,MAAM,kBACO,MAAM,mBACH,YAAY,kBACb,WAAW,GACzB,CACY,CACjB,CACS,CACb,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAG3B;gBACc,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE,EAAE,CAC7C,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;;;;;;;CAO/D,CAAA;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;;CAI7B,CAAA;AAED,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAA2B;;;IAGxD,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,aAAa,IAAI,WAAW,aAAa,GAAG;CACtE,CAAA;AAED,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAIxB;;2BAEyB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU;;;yBAGrB,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAC1C,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM;;IAEpC,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,CACtB,aAAa,CAAC,CAAC,CAAC,WAAW,aAAa,GAAG,CAAC,CAAC,CAAC,oBAAoB;CACrE,CAAA"}
|
package/dist/Button/Button.js
CHANGED
@@ -7,16 +7,16 @@ import { theme } from '../theme';
|
|
7
7
|
import { focusOutlineStyle } from '../utils/focusOutline';
|
8
8
|
export const Button = forwardRef((props, ref) => {
|
9
9
|
const { children, id, className = '', disabled = false, handleClick, loading = false, primary = false, secondary = false, fallbackStyle = false, textBtn = false, smallButton = false, icon, trailingIcon = false, forcedWidth = '', form, type, ...otherProps } = props;
|
10
|
-
return (React.createElement(Container, {
|
10
|
+
return (React.createElement(Container, { forwardedAs: "button", id: id, className: className, disabled: disabled || loading, onClick: handleClick, "$loading": loading, "$primary": primary, "$secondary": secondary, "$fallbackStyle": fallbackStyle, "$textBtn": textBtn, "$smallButton": smallButton, "$trailingIcon": trailingIcon, "$forcedWidth": forcedWidth, ...(form ? { form } : {}), type: type, ...otherProps, ref: ref },
|
11
11
|
loading && (React.createElement(LoaderContainer, null,
|
12
12
|
React.createElement(Loader, { color: 'liquorice', height: "16" }))),
|
13
|
-
React.createElement(ContentContainer, { icon: icon, "$loading": loading },
|
14
|
-
!trailingIcon && icon && (React.createElement(IconContainer, { trailingIcon: trailingIcon, render: icon, size: smallButton ? 16 : 24, color: 'liquorice' })),
|
13
|
+
React.createElement(ContentContainer, { "$icon": icon, "$loading": loading },
|
14
|
+
!trailingIcon && icon && (React.createElement(IconContainer, { "$trailingIcon": trailingIcon, render: icon, size: smallButton ? 16 : 24, color: 'liquorice' })),
|
15
15
|
React.createElement(ChildrenContainer, { className: "childrenContainer" }, children),
|
16
|
-
trailingIcon && icon && textBtn && (React.createElement(IconContainer, { trailingIcon: trailingIcon, render: icon, size: smallButton ? 16 : 24, color: 'liquorice', className: "iconContainer" })))));
|
16
|
+
trailingIcon && icon && textBtn && (React.createElement(IconContainer, { "$trailingIcon": trailingIcon, render: icon, size: smallButton ? 16 : 24, color: 'liquorice', className: "iconContainer" })))));
|
17
17
|
});
|
18
18
|
Button.displayName = 'Button';
|
19
|
-
const Container = styled(Box)(({ disabled, $loading, primary, secondary, forcedWidth, fallbackStyle, textBtn, smallButton, }) => css `
|
19
|
+
const Container = styled(Box)(({ disabled, $loading, $primary, $secondary, $forcedWidth, $fallbackStyle, $textBtn, $smallButton, }) => css `
|
20
20
|
position: relative;
|
21
21
|
background-color: ${theme.colors.marshmallowPink};
|
22
22
|
box-shadow: none;
|
@@ -29,11 +29,11 @@ const Container = styled(Box)(({ disabled, $loading, primary, secondary, forcedW
|
|
29
29
|
line-height: 100%;
|
30
30
|
font-size: 16px;
|
31
31
|
opacity: ${disabled ? '0.5' : '1'};
|
32
|
-
width: ${forcedWidth ? forcedWidth : 'auto'};
|
32
|
+
width: ${$forcedWidth ? $forcedWidth : 'auto'};
|
33
33
|
|
34
34
|
${focusOutlineStyle}
|
35
35
|
|
36
|
-
${primary &&
|
36
|
+
${$primary &&
|
37
37
|
css `
|
38
38
|
color: ${theme.colors.liquorice};
|
39
39
|
|
@@ -44,7 +44,7 @@ const Container = styled(Box)(({ disabled, $loading, primary, secondary, forcedW
|
|
44
44
|
background-color: ${theme.colors.lollipop};
|
45
45
|
}
|
46
46
|
`}
|
47
|
-
${secondary &&
|
47
|
+
${$secondary &&
|
48
48
|
css `
|
49
49
|
background-color: ${theme.colors.oatmeal};
|
50
50
|
|
@@ -55,7 +55,7 @@ const Container = styled(Box)(({ disabled, $loading, primary, secondary, forcedW
|
|
55
55
|
background-color: ${theme.colors.custard};
|
56
56
|
}
|
57
57
|
`}
|
58
|
-
${fallbackStyle &&
|
58
|
+
${$fallbackStyle &&
|
59
59
|
css `
|
60
60
|
background-color: ${theme.colors.cream};
|
61
61
|
|
@@ -66,7 +66,7 @@ const Container = styled(Box)(({ disabled, $loading, primary, secondary, forcedW
|
|
66
66
|
background-color: ${theme.colors.mascarpone};
|
67
67
|
}
|
68
68
|
`}
|
69
|
-
${smallButton &&
|
69
|
+
${$smallButton &&
|
70
70
|
css `
|
71
71
|
padding: 0 10px;
|
72
72
|
min-width: 54px;
|
@@ -80,7 +80,7 @@ const Container = styled(Box)(({ disabled, $loading, primary, secondary, forcedW
|
|
80
80
|
margin: 0 5px 0 0;
|
81
81
|
}
|
82
82
|
`}
|
83
|
-
${textBtn &&
|
83
|
+
${$textBtn &&
|
84
84
|
css `
|
85
85
|
background-color: transparent;
|
86
86
|
padding: 0;
|
@@ -109,11 +109,11 @@ const LoaderContainer = styled.div `
|
|
109
109
|
const ContentContainer = styled.div `
|
110
110
|
display: flex;
|
111
111
|
align-items: center;
|
112
|
-
justify-content: ${({ icon }) => (icon ? 'space-evenly' : 'center')};
|
112
|
+
justify-content: ${({ $icon }) => ($icon ? 'space-evenly' : 'center')};
|
113
113
|
opacity: ${({ $loading }) => ($loading ? '0' : '1')};
|
114
114
|
`;
|
115
|
-
const IconContainer = styled(IconComponent)(({ trailingIcon }) => css `
|
116
|
-
margin: ${trailingIcon ? '0 0 0 10px' : '0 10px 0 0'};
|
115
|
+
const IconContainer = styled(IconComponent)(({ $trailingIcon }) => css `
|
116
|
+
margin: ${$trailingIcon ? '0 0 0 10px' : '0 10px 0 0'};
|
117
117
|
`);
|
118
118
|
const ChildrenContainer = styled.div `
|
119
119
|
padding: 16px 0;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAuC,UAAU,EAAE,MAAM,OAAO,CAAA;AAC9E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAuC,UAAU,EAAE,MAAM,OAAO,CAAA;AAC9E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAG/C,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,SAAS,CAAA;AAG/C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAA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
export const Card = ({ children, leadingIcon, title, body, visual, tag, cardOnClickAction, rightAction, buttonAction, fallbackStyle = false, visualHeight = '', className = '', maxWidth = '', marginX = '', marginY = '', narrow = false, wide = false, ...otherProps }) => {
|
10
10
|
const addChildMargin = (!!leadingIcon || !!title || !!body) && children;
|
11
11
|
const isNotClickable = !cardOnClickAction;
|
12
|
-
return (React.createElement(Container, { className: className, maxWidth: maxWidth, marginX: marginX, marginY: marginY, narrow: narrow, wide: wide, visual: visual, fallbackStyle: fallbackStyle, isNotClickable: isNotClickable, onClick: cardOnClickAction, tabIndex: isNotClickable ? undefined : 0, ...otherProps },
|
12
|
+
return (React.createElement(Container, { className: className, "$maxWidth": maxWidth, "$marginX": marginX, "$marginY": marginY, "$narrow": narrow, "$wide": wide, "$visual": visual, "$fallbackStyle": fallbackStyle, "$isNotClickable": isNotClickable, onClick: cardOnClickAction, tabIndex: isNotClickable ? undefined : 0, ...otherProps },
|
13
13
|
tag && visual && React.createElement(TagWrapper, null, tag),
|
14
|
-
visual && (React.createElement(VisualWrapper, { visualHeight: visualHeight },
|
15
|
-
React.createElement(Visual, { visualUrl: visual, visualHeight: visualHeight }))),
|
14
|
+
visual && (React.createElement(VisualWrapper, { "$visualHeight": visualHeight },
|
15
|
+
React.createElement(Visual, { "$visualUrl": visual, "$visualHeight": visualHeight }))),
|
16
16
|
React.createElement(Box, { p: visual ? '16px' : { custom: '0px' } },
|
17
17
|
React.createElement(Box, { flex: true, alignItems: "center", justifyContent: "space-between" },
|
18
18
|
React.createElement(Box, { flex: true, alignItems: "center" },
|
@@ -25,25 +25,25 @@ export const Card = ({ children, leadingIcon, title, body, visual, tag, cardOnCl
|
|
25
25
|
buttonAction && React.createElement(Box, { mt: "16px" }, buttonAction))));
|
26
26
|
};
|
27
27
|
const Container = styled(Box) `
|
28
|
-
background: ${({ fallbackStyle }) => fallbackStyle ? theme.colors.cream : theme.colors.custard};
|
28
|
+
background: ${({ $fallbackStyle }) => $fallbackStyle ? theme.colors.cream : theme.colors.custard};
|
29
29
|
box-sizing: border-box;
|
30
30
|
border-radius: 16px;
|
31
31
|
|
32
|
-
max-width: ${(p) => p
|
33
|
-
margin-top: ${(p) => p
|
34
|
-
margin-right: ${(p) => p
|
35
|
-
margin-bottom: ${(p) => p
|
36
|
-
margin-left: ${(p) => p
|
32
|
+
max-width: ${(p) => p.$maxWidth};
|
33
|
+
margin-top: ${(p) => p.$marginY};
|
34
|
+
margin-right: ${(p) => p.$marginX};
|
35
|
+
margin-bottom: ${(p) => p.$marginY};
|
36
|
+
margin-left: ${(p) => p.$marginX};
|
37
37
|
|
38
|
-
padding: ${({ visual }) => (visual ? '0px' : '16px')};
|
38
|
+
padding: ${({ $visual }) => ($visual ? '0px' : '16px')};
|
39
39
|
position: relative;
|
40
40
|
overflow: hidden;
|
41
41
|
|
42
|
-
${({ isNotClickable, fallbackStyle }) =>
|
42
|
+
${({ $isNotClickable, $fallbackStyle }) => !$isNotClickable &&
|
43
43
|
css `
|
44
44
|
cursor: pointer;
|
45
45
|
&:hover {
|
46
|
-
background: ${darken(0.1, fallbackStyle ? theme.colors.cream : theme.colors.custard)};
|
46
|
+
background: ${darken(0.1, $fallbackStyle ? theme.colors.cream : theme.colors.custard)};
|
47
47
|
}
|
48
48
|
|
49
49
|
${focusOutlineStyle}
|
@@ -58,15 +58,15 @@ const VisualWrapper = styled(Box) `
|
|
58
58
|
width: 100%;
|
59
59
|
margin-top: -16px;
|
60
60
|
|
61
|
-
${({ visualHeight }) => visualHeight && `height: ${visualHeight};`}
|
61
|
+
${({ $visualHeight }) => $visualHeight && `height: ${$visualHeight};`}
|
62
62
|
`;
|
63
63
|
const Visual = styled(Box) `
|
64
64
|
width: 100%;
|
65
|
-
background-image: url('${(p) => p
|
65
|
+
background-image: url('${(p) => p.$visualUrl}');
|
66
66
|
background-size: cover;
|
67
67
|
background-repeat: no-repeat;
|
68
68
|
background-position: center;
|
69
69
|
|
70
|
-
${({ visualHeight }) => visualHeight ? `height: ${visualHeight};` : 'padding-top: 100%;'}
|
70
|
+
${({ $visualHeight }) => $visualHeight ? `height: ${$visualHeight};` : 'padding-top: 100%;'}
|
71
71
|
`;
|
72
72
|
//# sourceMappingURL=Card.js.map
|
package/dist/Card/Card.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../src/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,KAA2C,MAAM,OAAO,CAAA;AAC/D,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../src/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,KAA2C,MAAM,OAAO,CAAA;AAC/D,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;AAG9B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAsCzD,MAAM,CAAC,MAAM,IAAI,GAAkB,CAAC,EAClC,QAAQ,EACR,WAAW,EACX,KAAK,EACL,IAAI,EACJ,MAAM,EACN,GAAG,EACH,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,aAAa,GAAG,KAAK,EACrB,YAAY,GAAG,EAAE,EACjB,SAAS,GAAG,EAAE,EACd,QAAQ,GAAG,EAAE,EACb,OAAO,GAAG,EAAE,EACZ,OAAO,GAAG,EAAE,EACZ,MAAM,GAAG,KAAK,EACd,IAAI,GAAG,KAAK,EACZ,GAAG,UAAU,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AAA;;;;CAI7B,CAAA;AAED,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAA2B;;;;IAIxD,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,aAAa,IAAI,WAAW,aAAa,GAAG;CACtE,CAAA;AAED,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAA+C;;2BAE9C,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU;;;;;IAK1C,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,CACtB,aAAa,CAAC,CAAC,CAAC,WAAW,aAAa,GAAG,CAAC,CAAC,CAAC,oBAAoB;CACrE,CAAA"}
|
@@ -10,7 +10,7 @@ export const CheckBox = forwardRef(function CheckBox({ id: idProp, checked, chil
|
|
10
10
|
React.createElement(BoxContainer, { id: id },
|
11
11
|
React.createElement(Text, { tag: "span", typo: "base", color: error ? 'strawberry' : 'liquorice' }, children),
|
12
12
|
React.createElement("input", { ref: ref, type: "checkbox", checked: checked, onChange: toggle }),
|
13
|
-
React.createElement(Checkmark, { error: error })),
|
13
|
+
React.createElement(Checkmark, { "$error": error })),
|
14
14
|
error && errorMsg && React.createElement(ErrorBox, null, errorMsg)));
|
15
15
|
});
|
16
16
|
const Checkmark = styled.span `
|
@@ -18,7 +18,7 @@ const Checkmark = styled.span `
|
|
18
18
|
left: 0;
|
19
19
|
width: 24px;
|
20
20
|
height: 24px;
|
21
|
-
border: ${({ error }) => error
|
21
|
+
border: ${({ $error }) => $error
|
22
22
|
? `solid 2px ${theme.colors.strawberry}`
|
23
23
|
: `solid 2px ${theme.colors.liquorice}`};
|
24
24
|
box-sizing: border-box;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CheckBox.js","sourceRoot":"","sources":["../../src/CheckBox/CheckBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAa,MAAM,OAAO,CAAA;AACpD,OAAO,MAAM,MAAM,mBAAmB,CAA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AqB,SAAS,EAAE,EAAE,CAAC;;;;MAI5D,SAAS;0BACW,KAAK,CAAC,MAAM,CAAC,OAAO;0BACpB,KAAK,CAAC,MAAM,CAAC,SAAS;;;;;;;;;;;CAW/C,CAAA;AAED,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAA;;;WAGjB,KAAK,CAAC,MAAM,CAAC,UAAU;CACjC,CAAA"}
|
package/dist/Chip/Chip.js
CHANGED
@@ -5,11 +5,11 @@ import { Icon as IconComponent } from '../Icon';
|
|
5
5
|
import { Loader } from '../Loader';
|
6
6
|
import { theme } from '../theme';
|
7
7
|
import { focusOutline } from '../utils/focusOutline';
|
8
|
-
export const Chip = forwardRef(({ children, handleClick, primary = false, secondary = false, disabled = false, loading = false, icon, ...props }, ref) => (React.createElement(Container, {
|
8
|
+
export const Chip = forwardRef(({ children, handleClick, primary = false, secondary = false, disabled = false, loading = false, icon, ...props }, ref) => (React.createElement(Container, { forwardedAs: "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
9
|
icon && (React.createElement(IconComponent, { render: icon, size: 20, color: primary ? 'liquorice' : 'cream' })),
|
10
10
|
React.createElement(ChildrenContainer, null, children))))));
|
11
11
|
Chip.displayName = 'Chip';
|
12
|
-
const Container = styled(Box)(({ primary, secondary, icon, $loading, disabled }) => css `
|
12
|
+
const Container = styled(Box)(({ $primary, $secondary, $icon, $loading, disabled }) => css `
|
13
13
|
${focusOutline()}
|
14
14
|
|
15
15
|
align-items: center;
|
@@ -19,15 +19,15 @@ const Container = styled(Box)(({ primary, secondary, icon, $loading, disabled })
|
|
19
19
|
color: ${theme.colors.liquorice};
|
20
20
|
display: flex;
|
21
21
|
font-size: 16px;
|
22
|
-
justify-content: ${icon ? 'space-evenly' : 'center'};
|
22
|
+
justify-content: ${$icon ? 'space-evenly' : 'center'};
|
23
23
|
line-height: 100%;
|
24
|
-
padding: 8px 16px 8px ${icon ? '8px' : '16px'};
|
24
|
+
padding: 8px 16px 8px ${$icon ? '8px' : '16px'};
|
25
25
|
width: 98px;
|
26
26
|
min-height: 40px;
|
27
27
|
cursor: ${disabled || $loading ? 'not-allowed' : 'pointer'};
|
28
28
|
opacity: ${disabled ? '0.5' : '1'};
|
29
29
|
|
30
|
-
${primary &&
|
30
|
+
${$primary &&
|
31
31
|
css `
|
32
32
|
&:hover {
|
33
33
|
border: ${!(disabled || $loading) &&
|
@@ -35,7 +35,7 @@ const Container = styled(Box)(({ primary, secondary, icon, $loading, disabled })
|
|
35
35
|
background-color: ${!(disabled || $loading) && theme.colors.mascarpone};
|
36
36
|
}
|
37
37
|
`}
|
38
|
-
${secondary &&
|
38
|
+
${$secondary &&
|
39
39
|
css `
|
40
40
|
color: ${theme.colors.cream};
|
41
41
|
background-color: ${theme.colors.liquorice};
|