beyond-system 0.1.2 → 0.1.4
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 +38 -0
- package/dist/colors/base-colors.d.ts +50 -0
- package/dist/colors/base-colors.js +54 -0
- package/dist/colors/base-colors.js.map +1 -0
- package/dist/colors/gradients.d.ts +7 -0
- package/dist/colors/gradients.js +8 -0
- package/dist/colors/gradients.js.map +1 -0
- package/dist/colors/index.d.ts +3 -0
- package/dist/colors/index.js +4 -0
- package/dist/colors/index.js.map +1 -0
- package/dist/colors/shadows.d.ts +7 -0
- package/dist/colors/shadows.js +8 -0
- package/dist/colors/shadows.js.map +1 -0
- package/dist/components/react/Checkbox/Checkbox.d.ts +11 -0
- package/dist/components/react/Checkbox/Checkbox.js +15 -0
- package/dist/components/react/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/react/Checkbox/Checkbox.stories.d.ts +7 -0
- package/dist/components/react/Checkbox/Checkbox.stories.js +54 -0
- package/dist/components/react/Checkbox/Checkbox.stories.js.map +1 -0
- package/dist/components/react/Checkbox/Checkbox.styles.d.ts +19 -0
- package/dist/components/react/Checkbox/Checkbox.styles.js +60 -0
- package/dist/components/react/Checkbox/Checkbox.styles.js.map +1 -0
- package/dist/components/react/Checkbox/Checkbox.variants.d.ts +25 -0
- package/dist/components/react/Checkbox/Checkbox.variants.js +27 -0
- package/dist/components/react/Checkbox/Checkbox.variants.js.map +1 -0
- package/dist/components/react/Checkbox/index.d.ts +1 -0
- package/dist/components/react/Checkbox/index.js +2 -0
- package/dist/components/react/Checkbox/index.js.map +1 -0
- package/dist/components/react/DefaultButton/DefaultButton.d.ts +12 -0
- package/dist/components/react/DefaultButton/DefaultButton.js +21 -0
- package/dist/components/react/DefaultButton/DefaultButton.js.map +1 -0
- package/dist/components/react/DefaultButton/DefaultButton.stories.d.ts +7 -0
- package/dist/components/react/DefaultButton/DefaultButton.stories.js +85 -0
- package/dist/components/react/DefaultButton/DefaultButton.stories.js.map +1 -0
- package/dist/components/react/DefaultButton/DefaultButton.styles.d.ts +15 -0
- package/dist/components/react/DefaultButton/DefaultButton.styles.js +92 -0
- package/dist/components/react/DefaultButton/DefaultButton.styles.js.map +1 -0
- package/dist/components/react/DefaultButton/DefaultButton.variants.d.ts +45 -0
- package/dist/components/react/DefaultButton/DefaultButton.variants.js +48 -0
- package/dist/components/react/DefaultButton/DefaultButton.variants.js.map +1 -0
- package/dist/components/react/DefaultButton/index.d.ts +1 -0
- package/dist/components/react/DefaultButton/index.js +2 -0
- package/dist/components/react/DefaultButton/index.js.map +1 -0
- package/dist/components/react/IconButton/IconButton.d.ts +10 -0
- package/dist/components/react/IconButton/IconButton.js +18 -0
- package/dist/components/react/IconButton/IconButton.js.map +1 -0
- package/dist/components/react/IconButton/IconButton.stories.d.ts +7 -0
- package/dist/components/react/IconButton/IconButton.stories.js +63 -0
- package/dist/components/react/IconButton/IconButton.stories.js.map +1 -0
- package/dist/components/react/IconButton/IconButton.styles.d.ts +13 -0
- package/dist/components/react/IconButton/IconButton.styles.js +86 -0
- package/dist/components/react/IconButton/IconButton.styles.js.map +1 -0
- package/dist/components/react/IconButton/IconButton.variants.d.ts +36 -0
- package/dist/components/react/IconButton/IconButton.variants.js +39 -0
- package/dist/components/react/IconButton/IconButton.variants.js.map +1 -0
- package/dist/components/react/IconButton/index.d.ts +1 -0
- package/dist/components/react/IconButton/index.js +2 -0
- package/dist/components/react/IconButton/index.js.map +1 -0
- package/dist/components/react/Loader/Loader.d.ts +11 -0
- package/dist/components/react/Loader/Loader.js +33 -0
- package/dist/components/react/Loader/Loader.js.map +1 -0
- package/dist/components/react/Loader/Loader.stories.d.ts +7 -0
- package/dist/components/react/Loader/Loader.stories.js +31 -0
- package/dist/components/react/Loader/Loader.stories.js.map +1 -0
- package/dist/components/react/Loader/index.d.ts +3 -0
- package/dist/components/react/Loader/index.js +4 -0
- package/dist/components/react/Loader/index.js.map +1 -0
- package/dist/components/react/OutlineButton/OutlineButton.d.ts +12 -0
- package/dist/components/react/OutlineButton/OutlineButton.js +21 -0
- package/dist/components/react/OutlineButton/OutlineButton.js.map +1 -0
- package/dist/components/react/OutlineButton/OutlineButton.stories.d.ts +7 -0
- package/dist/components/react/OutlineButton/OutlineButton.stories.js +85 -0
- package/dist/components/react/OutlineButton/OutlineButton.stories.js.map +1 -0
- package/dist/components/react/OutlineButton/OutlineButton.styles.d.ts +12 -0
- package/dist/components/react/OutlineButton/OutlineButton.styles.js +86 -0
- package/dist/components/react/OutlineButton/OutlineButton.styles.js.map +1 -0
- package/dist/components/react/OutlineButton/OutlineButton.variants.d.ts +36 -0
- package/dist/components/react/OutlineButton/OutlineButton.variants.js +39 -0
- package/dist/components/react/OutlineButton/OutlineButton.variants.js.map +1 -0
- package/dist/components/react/OutlineButton/index.d.ts +1 -0
- package/dist/components/react/OutlineButton/index.js +2 -0
- package/dist/components/react/OutlineButton/index.js.map +1 -0
- package/dist/components/react/RadioInput/RadioInput.d.ts +7 -0
- package/dist/components/react/RadioInput/RadioInput.js +12 -0
- package/dist/components/react/RadioInput/RadioInput.js.map +1 -0
- package/dist/components/react/RadioInput/RadioInput.stories.d.ts +7 -0
- package/dist/components/react/RadioInput/RadioInput.stories.js +48 -0
- package/dist/components/react/RadioInput/RadioInput.stories.js.map +1 -0
- package/dist/components/react/RadioInput/RadioInput.styles.d.ts +14 -0
- package/dist/components/react/RadioInput/RadioInput.styles.js +52 -0
- package/dist/components/react/RadioInput/RadioInput.styles.js.map +1 -0
- package/dist/components/react/RadioInput/RadioInput.variants.d.ts +21 -0
- package/dist/components/react/RadioInput/RadioInput.variants.js +23 -0
- package/dist/components/react/RadioInput/RadioInput.variants.js.map +1 -0
- package/dist/components/react/RadioInput/index.d.ts +1 -0
- package/dist/components/react/RadioInput/index.js +2 -0
- package/dist/components/react/RadioInput/index.js.map +1 -0
- package/dist/components/react/Switch/Switch.d.ts +10 -0
- package/dist/components/react/Switch/Switch.js +13 -0
- package/dist/components/react/Switch/Switch.js.map +1 -0
- package/dist/components/react/Switch/Switch.stories.d.ts +7 -0
- package/dist/components/react/Switch/Switch.stories.js +48 -0
- package/dist/components/react/Switch/Switch.stories.js.map +1 -0
- package/dist/components/react/Switch/Switch.styles.d.ts +13 -0
- package/dist/components/react/Switch/Switch.styles.js +47 -0
- package/dist/components/react/Switch/Switch.styles.js.map +1 -0
- package/dist/components/react/Switch/Switch.variants.d.ts +17 -0
- package/dist/components/react/Switch/Switch.variants.js +19 -0
- package/dist/components/react/Switch/Switch.variants.js.map +1 -0
- package/dist/components/react/Switch/index.d.ts +1 -0
- package/dist/components/react/Switch/index.js +2 -0
- package/dist/components/react/Switch/index.js.map +1 -0
- package/dist/components/react/TransparentButton/TransparentButton.d.ts +7 -0
- package/dist/components/react/TransparentButton/TransparentButton.js +13 -0
- package/dist/components/react/TransparentButton/TransparentButton.js.map +1 -0
- package/dist/components/react/TransparentButton/TransparentButton.stories.d.ts +7 -0
- package/dist/components/react/TransparentButton/TransparentButton.stories.js +48 -0
- package/dist/components/react/TransparentButton/TransparentButton.stories.js.map +1 -0
- package/dist/components/react/TransparentButton/TransparentButton.styles.d.ts +10 -0
- package/dist/components/react/TransparentButton/TransparentButton.styles.js +65 -0
- package/dist/components/react/TransparentButton/TransparentButton.styles.js.map +1 -0
- package/dist/components/react/TransparentButton/TransparentButton.variants.d.ts +32 -0
- package/dist/components/react/TransparentButton/TransparentButton.variants.js +35 -0
- package/dist/components/react/TransparentButton/TransparentButton.variants.js.map +1 -0
- package/dist/components/react/TransparentButton/index.d.ts +1 -0
- package/dist/components/react/TransparentButton/index.js +2 -0
- package/dist/components/react/TransparentButton/index.js.map +1 -0
- package/dist/components/react/index.d.ts +8 -0
- package/dist/components/react/index.js +9 -0
- package/dist/components/react/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/stories/base-colors/base-colors.stories.d.ts +5 -0
- package/dist/stories/base-colors/base-colors.stories.js +50 -0
- package/dist/stories/base-colors/base-colors.stories.js.map +1 -0
- package/dist/stories/base-colors/base-colors.stories.styles.d.ts +2 -0
- package/dist/stories/base-colors/base-colors.stories.styles.js +64 -0
- package/dist/stories/base-colors/base-colors.stories.styles.js.map +1 -0
- package/dist/stories/gradients/gradients.stories.d.ts +5 -0
- package/dist/stories/gradients/gradients.stories.js +22 -0
- package/dist/stories/gradients/gradients.stories.js.map +1 -0
- package/dist/stories/gradients/gradients.stories.styles.d.ts +2 -0
- package/dist/stories/gradients/gradients.stories.styles.js +59 -0
- package/dist/stories/gradients/gradients.stories.styles.js.map +1 -0
- package/dist/stories/shadows/shadows.stories.d.ts +5 -0
- package/dist/stories/shadows/shadows.stories.js +20 -0
- package/dist/stories/shadows/shadows.stories.js.map +1 -0
- package/dist/stories/shadows/shadows.stories.styles.d.ts +2 -0
- package/dist/stories/shadows/shadows.stories.styles.js +58 -0
- package/dist/stories/shadows/shadows.stories.styles.js.map +1 -0
- package/dist/web/border.d.ts +12 -0
- package/dist/web/border.js +13 -0
- package/dist/web/border.js.map +1 -0
- package/dist/web/font.d.ts +34 -0
- package/dist/web/font.js +35 -0
- package/dist/web/font.js.map +1 -0
- package/dist/web/index.d.ts +2 -0
- package/dist/web/index.js +3 -0
- package/dist/web/index.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
import { Loader } from '@/components/react/Loader';
|
|
4
|
+
import { StyledButtonContainer } from './OutlineButton.styles';
|
|
5
|
+
import { OUTLINE_BUTTON_VARIANTS } from './OutlineButton.variants';
|
|
6
|
+
const OutlineButton = forwardRef((_a, ref) => {
|
|
7
|
+
var { text, variant = 'primary', size = 'MD', shape = 'square', fullWidth = false, leftIcon: LeftIcon, rightIcon: RightIcon, loading = false } = _a, props = __rest(_a, ["text", "variant", "size", "shape", "fullWidth", "leftIcon", "rightIcon", "loading"]);
|
|
8
|
+
const colorProps = OUTLINE_BUTTON_VARIANTS.color[variant];
|
|
9
|
+
const sizeProps = OUTLINE_BUTTON_VARIANTS.size[size];
|
|
10
|
+
const shapeProps = OUTLINE_BUTTON_VARIANTS.shape[shape];
|
|
11
|
+
const loaderColor = colorProps.color;
|
|
12
|
+
return (React.createElement(StyledButtonContainer, Object.assign({ type: "button" }, props, colorProps, sizeProps, shapeProps, { fullWidth: fullWidth, loading: loading, ref: ref }),
|
|
13
|
+
loading && (React.createElement("span", { className: "default-btn-loader" },
|
|
14
|
+
React.createElement(Loader, { size: size, color: loaderColor }))),
|
|
15
|
+
LeftIcon && React.createElement("span", { className: "default-btn-icon" }, LeftIcon),
|
|
16
|
+
React.createElement("span", { className: "default-btn-text" }, text),
|
|
17
|
+
RightIcon && React.createElement("span", { className: "default-btn-icon" }, RightIcon)));
|
|
18
|
+
});
|
|
19
|
+
OutlineButton.displayName = 'OutlineButton';
|
|
20
|
+
export default OutlineButton;
|
|
21
|
+
//# sourceMappingURL=OutlineButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OutlineButton.js","sourceRoot":"","sources":["../../../../src/components/react/OutlineButton/OutlineButton.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAGzC,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAElD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAalE,MAAM,aAAa,GAAG,UAAU,CAC9B,CACE,EAUqB,EACrB,GAAQ,EACR,EAAE;QAZF,EACE,IAAI,EACJ,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,IAAI,EACX,KAAK,GAAG,QAAQ,EAChB,SAAS,GAAG,KAAK,EACjB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,OAAO,GAAG,KAAK,OAEI,EADhB,KAAK,cATV,qFAUC,CADS;IAIV,MAAM,UAAU,GAAG,uBAAuB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACzD,MAAM,SAAS,GAAG,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACpD,MAAM,UAAU,GAAG,uBAAuB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAEvD,MAAM,WAAW,GAAG,UAAU,CAAC,KAA4B,CAAA;IAE3D,OAAO,CACL,oBAAC,qBAAqB,kBACpB,IAAI,EAAC,QAAQ,IACT,KAAK,EACL,UAAU,EACV,SAAS,EACT,UAAU,IACd,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,GAAG;QAEP,OAAO,IAAI,CACV,8BAAM,SAAS,EAAC,oBAAoB;YAClC,oBAAC,MAAM,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,GAAI,CACrC,CACR;QACA,QAAQ,IAAI,8BAAM,SAAS,EAAC,kBAAkB,IAAE,QAAQ,CAAQ;QACjE,8BAAM,SAAS,EAAC,kBAAkB,IAAE,IAAI,CAAQ;QAC/C,SAAS,IAAI,8BAAM,SAAS,EAAC,kBAAkB,IAAE,SAAS,CAAQ,CAC7C,CACzB,CAAA;AACH,CAAC,CACF,CAAA;AAED,aAAa,CAAC,WAAW,GAAG,eAAe,CAAA;AAE3C,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta } from '@storybook/react/types-6-0';
|
|
3
|
+
import ButtonComponent from './OutlineButton';
|
|
4
|
+
type Props = React.ComponentProps<typeof ButtonComponent>;
|
|
5
|
+
export declare const OutlineButton: (props: Props) => JSX.Element;
|
|
6
|
+
declare const _default: Meta;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { MdCheck } from 'react-icons/md';
|
|
4
|
+
import ButtonComponent from './OutlineButton';
|
|
5
|
+
import { OUTLINE_BUTTON_VARIANTS } from './OutlineButton.variants';
|
|
6
|
+
const Container = styled.div `
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
align-items: flex-start;
|
|
10
|
+
gap: 1rem;
|
|
11
|
+
`;
|
|
12
|
+
export const OutlineButton = (props) => {
|
|
13
|
+
return (React.createElement(Container, null,
|
|
14
|
+
React.createElement(ButtonComponent, Object.assign({}, props)),
|
|
15
|
+
React.createElement(ButtonComponent, Object.assign({}, props, { leftIcon: React.createElement(MdCheck, null) })),
|
|
16
|
+
React.createElement(ButtonComponent, Object.assign({}, props, { rightIcon: React.createElement(MdCheck, null) })),
|
|
17
|
+
React.createElement(ButtonComponent, Object.assign({}, props, { leftIcon: React.createElement(MdCheck, null), rightIcon: React.createElement(MdCheck, null) }))));
|
|
18
|
+
};
|
|
19
|
+
export default {
|
|
20
|
+
title: 'Buttons/OutlineButton',
|
|
21
|
+
parameters: {
|
|
22
|
+
component: OutlineButton,
|
|
23
|
+
},
|
|
24
|
+
args: {
|
|
25
|
+
text: 'Button',
|
|
26
|
+
variant: 'primary',
|
|
27
|
+
size: 'MD',
|
|
28
|
+
shape: 'square',
|
|
29
|
+
fullWidth: false,
|
|
30
|
+
disabled: false,
|
|
31
|
+
loading: false,
|
|
32
|
+
},
|
|
33
|
+
argTypes: {
|
|
34
|
+
text: {
|
|
35
|
+
control: {
|
|
36
|
+
type: 'text',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
leftIcon: {
|
|
40
|
+
control: {},
|
|
41
|
+
},
|
|
42
|
+
rightIcon: {
|
|
43
|
+
control: {},
|
|
44
|
+
},
|
|
45
|
+
variant: {
|
|
46
|
+
control: {
|
|
47
|
+
type: 'select',
|
|
48
|
+
options: Object.keys(OUTLINE_BUTTON_VARIANTS.color),
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
size: {
|
|
52
|
+
control: {
|
|
53
|
+
type: 'select',
|
|
54
|
+
options: Object.keys(OUTLINE_BUTTON_VARIANTS.size),
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
shape: {
|
|
58
|
+
control: {
|
|
59
|
+
type: 'select',
|
|
60
|
+
options: Object.keys(OUTLINE_BUTTON_VARIANTS.shape),
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
loading: {
|
|
64
|
+
control: {
|
|
65
|
+
type: 'boolean',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
fullWidth: {
|
|
69
|
+
control: {
|
|
70
|
+
type: 'boolean',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
disabled: {
|
|
74
|
+
control: {
|
|
75
|
+
type: 'boolean',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
onClick: {
|
|
79
|
+
control: {
|
|
80
|
+
action: 'clicked',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=OutlineButton.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OutlineButton.stories.js","sourceRoot":"","sources":["../../../../src/components/react/OutlineButton/OutlineButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,OAAO,eAAe,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAIlE,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;CAK3B,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAY,EAAE,EAAE;IAC5C,OAAO,CACL,oBAAC,SAAS;QACR,oBAAC,eAAe,oBAAK,KAAK,EAAI;QAC9B,oBAAC,eAAe,oBAAK,KAAK,IAAE,QAAQ,EAAE,oBAAC,OAAO,OAAG,IAAI;QACrD,oBAAC,eAAe,oBAAK,KAAK,IAAE,SAAS,EAAE,oBAAC,OAAO,OAAG,IAAI;QACtD,oBAAC,eAAe,oBACV,KAAK,IACT,QAAQ,EAAE,oBAAC,OAAO,OAAG,EACrB,SAAS,EAAE,oBAAC,OAAO,OAAG,IACtB,CACQ,CACb,CAAA;AACH,CAAC,CAAA;AAED,eAAe;IACb,KAAK,EAAE,uBAAuB;IAC9B,UAAU,EAAE;QACV,SAAS,EAAE,aAAa;KACzB;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,QAAQ;QACf,SAAS,EAAE,KAAK;QAChB,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,KAAK;KACf;IACD,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;aACb;SACF;QACD,QAAQ,EAAE;YACR,OAAO,EAAE,EAAE;SACZ;QACD,SAAS,EAAE;YACT,OAAO,EAAE,EAAE;SACZ;QACD,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC;aACpD;SACF;QACD,IAAI,EAAE;YACJ,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC;aACnD;SACF;QACD,KAAK,EAAE;YACL,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC;aACpD;SACF;QACD,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;aAChB;SACF;QACD,SAAS,EAAE;YACT,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;aAChB;SACF;QACD,QAAQ,EAAE;YACR,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;aAChB;SACF;QACD,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,MAAM,EAAE,SAAS;aAClB;SACF;KACF;CACM,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type StyledButtonProps = {
|
|
2
|
+
padding: string;
|
|
3
|
+
color: string;
|
|
4
|
+
borderRadius: string;
|
|
5
|
+
borderColor: string;
|
|
6
|
+
fontSize: string;
|
|
7
|
+
gap: string;
|
|
8
|
+
fullWidth: boolean;
|
|
9
|
+
loading: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const StyledButtonContainer: import("styled-components").StyledComponent<"button", any, StyledButtonProps, never>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { COLORS } from '@/colors';
|
|
3
|
+
export const StyledButtonContainer = styled.button `
|
|
4
|
+
all: unset;
|
|
5
|
+
position: relative;
|
|
6
|
+
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: row;
|
|
9
|
+
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
|
|
13
|
+
width: ${(props) => (props.fullWidth ? '100%' : 'auto')};
|
|
14
|
+
|
|
15
|
+
transition: 0.05s ease-in-out;
|
|
16
|
+
|
|
17
|
+
padding: ${(props) => props.padding};
|
|
18
|
+
gap: ${(props) => props.gap};
|
|
19
|
+
|
|
20
|
+
color: ${(props) => props.color};
|
|
21
|
+
font-size: ${(props) => props.fontSize};
|
|
22
|
+
font-weight: 600;
|
|
23
|
+
|
|
24
|
+
.default-btn-icon {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
font-size: ${(props) => props.fontSize};
|
|
28
|
+
opacity: ${(props) => (props.loading ? 0 : 1)};
|
|
29
|
+
|
|
30
|
+
* {
|
|
31
|
+
color: ${(props) => props.color};
|
|
32
|
+
font-size: ${(props) => props.fontSize};
|
|
33
|
+
font-weight: 600;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.default-btn-text {
|
|
38
|
+
opacity: ${(props) => (props.loading ? 0 : 1)};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.default-btn-loader {
|
|
42
|
+
position: absolute;
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
height: 100%;
|
|
47
|
+
width: 100%;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
background-color: transparent;
|
|
51
|
+
border: 1px solid ${(props) => props.borderColor};
|
|
52
|
+
border-radius: ${(props) => props.borderRadius};
|
|
53
|
+
|
|
54
|
+
padding: ${(props) => props.padding};
|
|
55
|
+
|
|
56
|
+
pointer-events: ${(props) => (props.loading ? 'none' : 'auto')};
|
|
57
|
+
|
|
58
|
+
:hover {
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
transform: scale(1.01);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:active {
|
|
64
|
+
transform: scale(0.98);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:disabled {
|
|
68
|
+
color: ${COLORS.NEUTRAL_LIGHT};
|
|
69
|
+
border-color: ${COLORS.NEUTRAL_LIGHT};
|
|
70
|
+
background-color: ${COLORS.NEUTRAL_HIGH};
|
|
71
|
+
|
|
72
|
+
* {
|
|
73
|
+
color: ${COLORS.NEUTRAL_LIGHT};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:hover {
|
|
77
|
+
cursor: default;
|
|
78
|
+
transform: scale(1);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:active {
|
|
82
|
+
transform: scale(1);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
`;
|
|
86
|
+
//# sourceMappingURL=OutlineButton.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OutlineButton.styles.js","sourceRoot":"","sources":["../../../../src/components/react/OutlineButton/OutlineButton.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAajC,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAmB;;;;;;;;;;WAU1D,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;;;;aAI5C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO;SAC5B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG;;WAElB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK;eAClB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ;;;;;;iBAMvB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ;eAC3B,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;eAGlC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK;mBAClB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ;;;;;;eAM7B,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;;;sBAa3B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW;mBAC/B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY;;aAEnC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO;;oBAEjB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;;;;;;;;;;;;aAYnD,MAAM,CAAC,aAAa;oBACb,MAAM,CAAC,aAAa;wBAChB,MAAM,CAAC,YAAY;;;eAG5B,MAAM,CAAC,aAAa;;;;;;;;;;;;CAYlC,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const OUTLINE_BUTTON_VARIANTS: {
|
|
2
|
+
color: {
|
|
3
|
+
primary: {
|
|
4
|
+
color: string;
|
|
5
|
+
borderColor: string;
|
|
6
|
+
};
|
|
7
|
+
light: {
|
|
8
|
+
color: string;
|
|
9
|
+
borderColor: string;
|
|
10
|
+
};
|
|
11
|
+
dark: {
|
|
12
|
+
color: string;
|
|
13
|
+
borderColor: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
size: {
|
|
17
|
+
SM: {
|
|
18
|
+
fontSize: string;
|
|
19
|
+
padding: string;
|
|
20
|
+
gap: string;
|
|
21
|
+
};
|
|
22
|
+
MD: {
|
|
23
|
+
fontSize: string;
|
|
24
|
+
padding: string;
|
|
25
|
+
gap: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
shape: {
|
|
29
|
+
square: {
|
|
30
|
+
borderRadius: string;
|
|
31
|
+
};
|
|
32
|
+
round: {
|
|
33
|
+
borderRadius: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { COLORS } from '@/colors';
|
|
2
|
+
import { FONT, BORDER } from '@/web';
|
|
3
|
+
export const OUTLINE_BUTTON_VARIANTS = {
|
|
4
|
+
color: {
|
|
5
|
+
primary: {
|
|
6
|
+
color: COLORS.GROWTH_MID,
|
|
7
|
+
borderColor: COLORS.GROWTH_MID,
|
|
8
|
+
},
|
|
9
|
+
light: {
|
|
10
|
+
color: COLORS.NEUTRAL_LIGHTER,
|
|
11
|
+
borderColor: COLORS.NEUTRAL_LIGHTER,
|
|
12
|
+
},
|
|
13
|
+
dark: {
|
|
14
|
+
color: COLORS.NEUTRAL_DARKER,
|
|
15
|
+
borderColor: COLORS.NEUTRAL_DARKER,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
SM: {
|
|
20
|
+
fontSize: FONT.SIZE.SM,
|
|
21
|
+
padding: '5px 6px',
|
|
22
|
+
gap: '6px',
|
|
23
|
+
},
|
|
24
|
+
MD: {
|
|
25
|
+
fontSize: FONT.SIZE.MD,
|
|
26
|
+
padding: '6px 10px',
|
|
27
|
+
gap: '8px',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
shape: {
|
|
31
|
+
square: {
|
|
32
|
+
borderRadius: BORDER.RADIUS.MD,
|
|
33
|
+
},
|
|
34
|
+
round: {
|
|
35
|
+
borderRadius: '55px',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=OutlineButton.variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OutlineButton.variants.js","sourceRoot":"","sources":["../../../../src/components/react/OutlineButton/OutlineButton.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAEpC,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,KAAK,EAAE;QACL,OAAO,EAAE;YACP,KAAK,EAAE,MAAM,CAAC,UAAU;YACxB,WAAW,EAAE,MAAM,CAAC,UAAU;SAC/B;QACD,KAAK,EAAE;YACL,KAAK,EAAE,MAAM,CAAC,eAAe;YAC7B,WAAW,EAAE,MAAM,CAAC,eAAe;SACpC;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM,CAAC,cAAc;YAC5B,WAAW,EAAE,MAAM,CAAC,cAAc;SACnC;KACF;IACD,IAAI,EAAE;QACJ,EAAE,EAAE;YACF,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE;YACtB,OAAO,EAAE,SAAS;YAClB,GAAG,EAAE,KAAK;SACX;QACD,EAAE,EAAE;YACF,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE;YACtB,OAAO,EAAE,UAAU;YACnB,GAAG,EAAE,KAAK;SACX;KACF;IAED,KAAK,EAAE;QACL,MAAM,EAAE;YACN,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE;SAC/B;QACD,KAAK,EAAE;YACL,YAAY,EAAE,MAAM;SACrB;KACF;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './OutlineButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/react/OutlineButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DEFAULT_RADIO_VARIANTS } from './RadioInput.variants';
|
|
3
|
+
type RadioInputProps = {
|
|
4
|
+
variant?: keyof typeof DEFAULT_RADIO_VARIANTS.color;
|
|
5
|
+
} & React.InputHTMLAttributes<HTMLInputElement>;
|
|
6
|
+
declare const RadioInput: ({ variant, ...props }: RadioInputProps) => JSX.Element;
|
|
7
|
+
export default RadioInput;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { DEFAULT_RADIO_VARIANTS } from './RadioInput.variants';
|
|
4
|
+
import { StyledRadioInput } from './RadioInput.styles';
|
|
5
|
+
const RadioInput = (_a) => {
|
|
6
|
+
var { variant = 'primary' } = _a, props = __rest(_a, ["variant"]);
|
|
7
|
+
const colorProps = DEFAULT_RADIO_VARIANTS.color[variant];
|
|
8
|
+
const sizeProps = DEFAULT_RADIO_VARIANTS.size['MD'];
|
|
9
|
+
return (React.createElement(StyledRadioInput, Object.assign({}, props, colorProps, sizeProps, { type: "radio" })));
|
|
10
|
+
};
|
|
11
|
+
export default RadioInput;
|
|
12
|
+
//# sourceMappingURL=RadioInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioInput.js","sourceRoot":"","sources":["../../../../src/components/react/RadioInput/RadioInput.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAMtD,MAAM,UAAU,GAAG,CAAC,EAAkD,EAAE,EAAE;QAAtD,EAAE,OAAO,GAAG,SAAS,OAA6B,EAAxB,KAAK,cAA/B,WAAiC,CAAF;IACjD,MAAM,UAAU,GAAG,sBAAsB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACxD,MAAM,SAAS,GAAG,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAEnD,OAAO,CACL,oBAAC,gBAAgB,oBAAK,KAAK,EAAM,UAAU,EAAM,SAAS,IAAE,IAAI,EAAC,OAAO,IAAG,CAC5E,CAAA;AACH,CAAC,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta } from '@storybook/react/types-6-0';
|
|
3
|
+
import RadioInputComponent from './RadioInput';
|
|
4
|
+
type Props = React.ComponentProps<typeof RadioInputComponent>;
|
|
5
|
+
export declare const RadioInput: (props: Props) => JSX.Element;
|
|
6
|
+
declare const _default: Meta;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import RadioInputComponent from './RadioInput';
|
|
3
|
+
import { DEFAULT_RADIO_VARIANTS } from './RadioInput.variants';
|
|
4
|
+
export const RadioInput = (props) => {
|
|
5
|
+
return React.createElement(RadioInputComponent, Object.assign({}, props));
|
|
6
|
+
};
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Inputs/RadioInput',
|
|
9
|
+
parameters: {
|
|
10
|
+
component: RadioInput,
|
|
11
|
+
},
|
|
12
|
+
args: {
|
|
13
|
+
variant: 'primary',
|
|
14
|
+
size: 'MD',
|
|
15
|
+
checked: false,
|
|
16
|
+
disabled: false,
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
variant: {
|
|
20
|
+
control: {
|
|
21
|
+
type: 'select',
|
|
22
|
+
options: Object.keys(DEFAULT_RADIO_VARIANTS.color),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
control: {
|
|
27
|
+
type: 'select',
|
|
28
|
+
options: Object.keys(DEFAULT_RADIO_VARIANTS.size),
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
checked: {
|
|
32
|
+
control: {
|
|
33
|
+
type: 'boolean',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
disabled: {
|
|
37
|
+
control: {
|
|
38
|
+
type: 'boolean',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
onCheckedChange: {
|
|
42
|
+
control: {
|
|
43
|
+
action: 'changed',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=RadioInput.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioInput.stories.js","sourceRoot":"","sources":["../../../../src/components/react/RadioInput/RadioInput.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,mBAAmB,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAI9D,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAY,EAAE,EAAE;IACzC,OAAO,oBAAC,mBAAmB,oBAAK,KAAK,EAAI,CAAA;AAC3C,CAAC,CAAA;AAED,eAAe;IACb,KAAK,EAAE,mBAAmB;IAC1B,UAAU,EAAE;QACV,SAAS,EAAE,UAAU;KACtB;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,KAAK;KAChB;IACD,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC;aACnD;SACF;QACD,IAAI,EAAE;YACJ,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC;aAClD;SACF;QACD,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;aAChB;SACF;QACD,QAAQ,EAAE;YACR,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;aAChB;SACF;QACD,eAAe,EAAE;YACf,OAAO,EAAE;gBACP,MAAM,EAAE,SAAS;aAClB;SACF;KACF;CACM,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type StyledRadioInput = {
|
|
2
|
+
indicatorColor: string;
|
|
3
|
+
indicatorHoverColor: string;
|
|
4
|
+
boxColor: string;
|
|
5
|
+
boxHoverColor: string;
|
|
6
|
+
boxActiveColor: string;
|
|
7
|
+
boxActiveHoverColor: string;
|
|
8
|
+
borderColor: string;
|
|
9
|
+
borderHoverColor: string;
|
|
10
|
+
borderActiveColor: string;
|
|
11
|
+
borderActiveHoverColor: string;
|
|
12
|
+
width: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const StyledRadioInput: import("styled-components").StyledComponent<"input", any, StyledRadioInput, never>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { COLORS } from '@/colors';
|
|
3
|
+
export const StyledRadioInput = styled.input `
|
|
4
|
+
transition: 0.1s ease-in-out;
|
|
5
|
+
width: ${(props) => props.width};
|
|
6
|
+
aspect-ratio: 1/1;
|
|
7
|
+
appearance: none;
|
|
8
|
+
-webkit-appearance: none;
|
|
9
|
+
|
|
10
|
+
border-radius: 50%;
|
|
11
|
+
border: 1px solid ${(props) => props.borderColor};
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
|
|
16
|
+
:hover {
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
background-color: ${(props) => props.boxHoverColor};
|
|
19
|
+
border-color: ${(props) => props.borderHoverColor};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:checked {
|
|
23
|
+
background-color: ${(props) => props.boxActiveColor};
|
|
24
|
+
border-color: ${(props) => props.borderActiveColor};
|
|
25
|
+
|
|
26
|
+
:hover {
|
|
27
|
+
background-color: ${(props) => props.boxActiveHoverColor};
|
|
28
|
+
border-color: ${(props) => props.borderActiveHoverColor};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:after {
|
|
32
|
+
content: '';
|
|
33
|
+
width: 100%;
|
|
34
|
+
aspect-ratio: 1/1;
|
|
35
|
+
border-radius: 50%;
|
|
36
|
+
border: 3px solid ${(props) => props.boxActiveColor};
|
|
37
|
+
background-color: ${(props) => props.indicatorColor};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:hover:after {
|
|
41
|
+
background-color: ${(props) => props.indicatorHoverColor};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:disabled {
|
|
46
|
+
background-color: ${COLORS.NEUTRAL_LIGHT};
|
|
47
|
+
border-color: ${COLORS.NEUTRAL_MID};
|
|
48
|
+
|
|
49
|
+
pointer-events: none;
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
//# sourceMappingURL=RadioInput.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioInput.styles.js","sourceRoot":"","sources":["../../../../src/components/react/RadioInput/RadioInput.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAgBjC,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,KAAK,CAAkB;;WAEnD,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK;;;;;;sBAMX,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW;;;;;;;wBAO1B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,aAAa;oBAClC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,gBAAgB;;;;wBAI7B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc;oBACnC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,iBAAiB;;;0BAG5B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,mBAAmB;sBACxC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,sBAAsB;;;;;;;;0BAQnC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc;0BAC/B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc;;;;0BAI/B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,mBAAmB;;;;;wBAKtC,MAAM,CAAC,aAAa;oBACxB,MAAM,CAAC,WAAW;;;;CAIrC,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const DEFAULT_RADIO_VARIANTS: {
|
|
2
|
+
color: {
|
|
3
|
+
primary: {
|
|
4
|
+
indicatorColor: string;
|
|
5
|
+
indicatorHoverColor: string;
|
|
6
|
+
boxColor: string;
|
|
7
|
+
boxHoverColor: string;
|
|
8
|
+
boxActiveColor: string;
|
|
9
|
+
boxActiveHoverColor: string;
|
|
10
|
+
borderColor: string;
|
|
11
|
+
borderHoverColor: string;
|
|
12
|
+
borderActiveColor: string;
|
|
13
|
+
borderActiveHoverColor: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
size: {
|
|
17
|
+
MD: {
|
|
18
|
+
width: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { COLORS } from '@/colors';
|
|
2
|
+
export const DEFAULT_RADIO_VARIANTS = {
|
|
3
|
+
color: {
|
|
4
|
+
primary: {
|
|
5
|
+
indicatorColor: COLORS.GROWTH_MID,
|
|
6
|
+
indicatorHoverColor: COLORS.GROWTH_DARK,
|
|
7
|
+
boxColor: COLORS.NEUTRAL_HIGH,
|
|
8
|
+
boxHoverColor: COLORS.NEUTRAL_LIGHT,
|
|
9
|
+
boxActiveColor: COLORS.NEUTRAL_HIGH,
|
|
10
|
+
boxActiveHoverColor: COLORS.NEUTRAL_HIGH,
|
|
11
|
+
borderColor: COLORS.NEUTRAL_DARK,
|
|
12
|
+
borderHoverColor: COLORS.NEUTRAL_DARK,
|
|
13
|
+
borderActiveColor: COLORS.NEUTRAL_DARK,
|
|
14
|
+
borderActiveHoverColor: COLORS.NEUTRAL_DARK,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
MD: {
|
|
19
|
+
width: '15px',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=RadioInput.variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioInput.variants.js","sourceRoot":"","sources":["../../../../src/components/react/RadioInput/RadioInput.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,KAAK,EAAE;QACL,OAAO,EAAE;YACP,cAAc,EAAE,MAAM,CAAC,UAAU;YACjC,mBAAmB,EAAE,MAAM,CAAC,WAAW;YACvC,QAAQ,EAAE,MAAM,CAAC,YAAY;YAC7B,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,cAAc,EAAE,MAAM,CAAC,YAAY;YACnC,mBAAmB,EAAE,MAAM,CAAC,YAAY;YACxC,WAAW,EAAE,MAAM,CAAC,YAAY;YAChC,gBAAgB,EAAE,MAAM,CAAC,YAAY;YACrC,iBAAiB,EAAE,MAAM,CAAC,YAAY;YACtC,sBAAsB,EAAE,MAAM,CAAC,YAAY;SAC5C;KACF;IACD,IAAI,EAAE;QACJ,EAAE,EAAE;YACF,KAAK,EAAE,MAAM;SACd;KACF;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './RadioInput';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/react/RadioInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as RadixSwitch from '@radix-ui/react-switch';
|
|
3
|
+
import { DEFAULT_SWITCH_VARIANTS } from './Switch.variants';
|
|
4
|
+
type RootSwitchProps = React.ComponentProps<typeof RadixSwitch.Root>;
|
|
5
|
+
type SwitchProps = {
|
|
6
|
+
variant?: keyof typeof DEFAULT_SWITCH_VARIANTS.color;
|
|
7
|
+
size?: keyof typeof DEFAULT_SWITCH_VARIANTS.size;
|
|
8
|
+
} & RootSwitchProps;
|
|
9
|
+
declare const Switch: ({ variant, size, ...props }: SwitchProps) => JSX.Element;
|
|
10
|
+
export default Switch;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { DEFAULT_SWITCH_VARIANTS } from './Switch.variants';
|
|
4
|
+
import { SwitchContainer, SwitchThumb } from './Switch.styles';
|
|
5
|
+
const Switch = (_a) => {
|
|
6
|
+
var { variant = 'primary', size = 'MD' } = _a, props = __rest(_a, ["variant", "size"]);
|
|
7
|
+
const colorProps = DEFAULT_SWITCH_VARIANTS.color[variant];
|
|
8
|
+
const sizeProps = DEFAULT_SWITCH_VARIANTS.size[size];
|
|
9
|
+
return (React.createElement(SwitchContainer, Object.assign({}, props, colorProps, sizeProps),
|
|
10
|
+
React.createElement(SwitchThumb, Object.assign({}, colorProps, sizeProps))));
|
|
11
|
+
};
|
|
12
|
+
export default Switch;
|
|
13
|
+
//# sourceMappingURL=Switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../../../src/components/react/Switch/Switch.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAQ9D,MAAM,MAAM,GAAG,CAAC,EAIF,EAAE,EAAE;QAJF,EACd,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,IAAI,OAEC,EADT,KAAK,cAHM,mBAIf,CADS;IAER,MAAM,UAAU,GAAG,uBAAuB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACzD,MAAM,SAAS,GAAG,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAEpD,OAAO,CACL,oBAAC,eAAe,oBAAK,KAAK,EAAM,UAAU,EAAM,SAAS;QACvD,oBAAC,WAAW,oBAAK,UAAU,EAAM,SAAS,EAAI,CAC9B,CACnB,CAAA;AACH,CAAC,CAAA;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta } from '@storybook/react/types-6-0';
|
|
3
|
+
import SwitchComponent from './Switch';
|
|
4
|
+
type Props = React.ComponentProps<typeof SwitchComponent>;
|
|
5
|
+
export declare const Switch: (props: Props) => JSX.Element;
|
|
6
|
+
declare const _default: Meta;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import SwitchComponent from './Switch';
|
|
3
|
+
import { DEFAULT_SWITCH_VARIANTS } from './Switch.variants';
|
|
4
|
+
export const Switch = (props) => {
|
|
5
|
+
return React.createElement(SwitchComponent, Object.assign({}, props));
|
|
6
|
+
};
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Inputs/Switch',
|
|
9
|
+
parameters: {
|
|
10
|
+
component: Switch,
|
|
11
|
+
},
|
|
12
|
+
args: {
|
|
13
|
+
variant: 'primary',
|
|
14
|
+
size: 'MD',
|
|
15
|
+
checked: false,
|
|
16
|
+
disabled: false,
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
variant: {
|
|
20
|
+
control: {
|
|
21
|
+
type: 'select',
|
|
22
|
+
options: Object.keys(DEFAULT_SWITCH_VARIANTS.color),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
control: {
|
|
27
|
+
type: 'select',
|
|
28
|
+
options: Object.keys(DEFAULT_SWITCH_VARIANTS.size),
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
checked: {
|
|
32
|
+
control: {
|
|
33
|
+
type: 'boolean',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
disabled: {
|
|
37
|
+
control: {
|
|
38
|
+
type: 'boolean',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
onCheckedChange: {
|
|
42
|
+
control: {
|
|
43
|
+
action: 'changed',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=Switch.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.stories.js","sourceRoot":"","sources":["../../../../src/components/react/Switch/Switch.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,eAAe,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAI3D,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAY,EAAE,EAAE;IACrC,OAAO,oBAAC,eAAe,oBAAK,KAAK,EAAI,CAAA;AACvC,CAAC,CAAA;AAED,eAAe;IACb,KAAK,EAAE,eAAe;IACtB,UAAU,EAAE;QACV,SAAS,EAAE,MAAM;KAClB;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,KAAK;KAChB;IACD,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC;aACpD;SACF;QACD,IAAI,EAAE;YACJ,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC;aACnD;SACF;QACD,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;aAChB;SACF;QACD,QAAQ,EAAE;YACR,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;aAChB;SACF;QACD,eAAe,EAAE;YACf,OAAO,EAAE;gBACP,MAAM,EAAE,SAAS;aAClB;SACF;KACF;CACM,CAAA"}
|