@mrshmllw/smores-react 2.1.26 → 2.1.27
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/Tag/Tag.d.ts +11 -2
- package/dist/Tag/Tag.js +6 -4
- package/dist/Tag/Tag.js.map +1 -1
- package/dist/Tag/Tag.stories.d.ts +1 -0
- package/dist/Tag/Tag.stories.js +6 -0
- package/dist/Tag/Tag.stories.js.map +1 -1
- package/package.json +2 -2
package/dist/Tag/Tag.d.ts
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { Color } from '../theme';
|
|
3
|
-
export declare type
|
|
3
|
+
export declare type DefaultProps = {
|
|
4
4
|
label: string;
|
|
5
5
|
className?: string;
|
|
6
6
|
color: Color;
|
|
7
|
+
typo?: string;
|
|
8
|
+
};
|
|
9
|
+
declare type GradientProps = {
|
|
7
10
|
bgColor: Color;
|
|
8
11
|
borderColor: Color;
|
|
9
|
-
|
|
12
|
+
bgGradient?: boolean;
|
|
13
|
+
} | {
|
|
14
|
+
bgColor?: Color;
|
|
15
|
+
borderColor?: Color;
|
|
16
|
+
bgGradient: boolean;
|
|
10
17
|
};
|
|
18
|
+
export declare type TagProps = DefaultProps & GradientProps;
|
|
11
19
|
export declare const Tag: FC<TagProps>;
|
|
20
|
+
export {};
|
package/dist/Tag/Tag.js
CHANGED
|
@@ -2,15 +2,17 @@ import React from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { Text } from '../Text';
|
|
4
4
|
import { theme } from '../theme';
|
|
5
|
-
export const Tag = ({ label, color, borderColor, bgColor, className, typo, }) => (React.createElement(Wrapper, { bgColor: bgColor, className: className, borderColor: borderColor },
|
|
5
|
+
export const Tag = ({ label, color, borderColor, bgColor, className, typo, bgGradient = false, }) => (React.createElement(Wrapper, { bgColor: bgColor, className: className, borderColor: borderColor, bgGradient: bgGradient },
|
|
6
6
|
React.createElement(TagText, { tag: "span", typo: typo !== null && typo !== void 0 ? typo : 'label', color: color }, label)));
|
|
7
7
|
const Wrapper = styled.div `
|
|
8
|
-
background-color: ${({ bgColor }) => theme.colors[bgColor]};
|
|
8
|
+
background-color: ${({ bgColor }) => bgColor && theme.colors[bgColor]};
|
|
9
|
+
background: ${({ bgGradient }) => bgGradient &&
|
|
10
|
+
`linear-gradient(90deg, rgba(247, 46, 73, 1) 0%, rgba(246, 148, 210, 1) 100%)`};
|
|
9
11
|
border-radius: 8px;
|
|
10
|
-
border:
|
|
12
|
+
border: ${({ borderColor }) => borderColor && `1px solid ${theme.colors[borderColor]}`};
|
|
11
13
|
box-sizing: border-box;
|
|
12
14
|
display: inline-flex;
|
|
13
|
-
height: 23px;
|
|
15
|
+
height: ${({ borderColor }) => (borderColor ? '23px' : '25px')};
|
|
14
16
|
padding: 5px 12px;
|
|
15
17
|
`;
|
|
16
18
|
const TagText = styled(Text) `
|
package/dist/Tag/Tag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../src/Tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAS,KAAK,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../src/Tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAS,KAAK,EAAE,MAAM,UAAU,CAAA;AAyBvC,MAAM,CAAC,MAAM,GAAG,GAAiB,CAAC,EAChC,KAAK,EACL,KAAK,EACL,WAAW,EACX,OAAO,EACP,SAAS,EACT,IAAI,EACJ,UAAU,GAAG,KAAK,GACnB,EAAE,EAAE,CAAC,CACJ,oBAAC,OAAO,IACN,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU;IAEtB,oBAAC,OAAO,IAAC,GAAG,EAAC,MAAM,EAAC,IAAI,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,OAAO,EAAE,KAAK,EAAE,KAAK,IACpD,KAAK,CACE,CACF,CACX,CAAA;AAID,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAc;sBAClB,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;gBACvD,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAC/B,UAAU;IACV,8EAA8E;;YAEtE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAC5B,WAAW,IAAI,aAAa,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE;;;YAG/C,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;;CAE/D,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;;CAK3B,CAAA"}
|
package/dist/Tag/Tag.stories.js
CHANGED
|
@@ -17,4 +17,10 @@ Default.argTypes = {
|
|
|
17
17
|
as: { table: { disable: true } },
|
|
18
18
|
forwardedAs: { table: { disable: true } },
|
|
19
19
|
};
|
|
20
|
+
export const BgGradient = Template.bind({});
|
|
21
|
+
BgGradient.args = {
|
|
22
|
+
label: 'This is a gradient background tag',
|
|
23
|
+
bgGradient: true,
|
|
24
|
+
color: 'white',
|
|
25
|
+
};
|
|
20
26
|
//# sourceMappingURL=Tag.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.stories.js","sourceRoot":"","sources":["../../src/Tag/Tag.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,GAAG,EAAY,MAAM,OAAO,CAAA;AAErC,eAAe;IACb,KAAK,EAAE,KAAK;IACZ,SAAS,EAAE,GAAG;CACf,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,KAAe,EAAE,EAAE,CAAC,oBAAC,GAAG,oBAAK,KAAK,EAAI,CAAA;AAExD,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAExC,OAAO,CAAC,IAAI,GAAG;IACb,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,SAAS;IACtB,KAAK,EAAE,OAAO;CACf,CAAA;AAED,OAAO,CAAC,QAAQ,GAAG;IACjB,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACnC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAChC,WAAW,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;CAC1C,CAAA"}
|
|
1
|
+
{"version":3,"file":"Tag.stories.js","sourceRoot":"","sources":["../../src/Tag/Tag.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,GAAG,EAAY,MAAM,OAAO,CAAA;AAErC,eAAe;IACb,KAAK,EAAE,KAAK;IACZ,SAAS,EAAE,GAAG;CACf,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,KAAe,EAAE,EAAE,CAAC,oBAAC,GAAG,oBAAK,KAAK,EAAI,CAAA;AAExD,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAExC,OAAO,CAAC,IAAI,GAAG;IACb,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,SAAS;IACtB,KAAK,EAAE,OAAO;CACf,CAAA;AAED,OAAO,CAAC,QAAQ,GAAG;IACjB,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACnC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAChC,WAAW,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;CAC1C,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAE3C,UAAU,CAAC,IAAI,GAAG;IAChB,KAAK,EAAE,mCAAmC;IAC1C,UAAU,EAAE,IAAI;IAChB,KAAK,EAAE,OAAO;CACf,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrshmllw/smores-react",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.27",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"description": "Collection of React components used by Marshmallow Technology",
|
|
6
6
|
"keywords": [
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@testing-library/react": "^12.0.0",
|
|
42
42
|
"@testing-library/react-hooks": "^8.0.0",
|
|
43
43
|
"@types/jest": "^28.1.1",
|
|
44
|
-
"@types/node": "^
|
|
44
|
+
"@types/node": "^18.0.0",
|
|
45
45
|
"@types/react": "^17.0.0",
|
|
46
46
|
"@types/react-dom": "^17.0.9",
|
|
47
47
|
"@types/styled-components": "^5.1.3",
|