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,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as RadixSwitch from '@radix-ui/react-switch';
|
|
3
|
+
export type StyledSwitchProps = {
|
|
4
|
+
thumbColor: string;
|
|
5
|
+
thumbHoverColor: string;
|
|
6
|
+
thumbActiveColor: string;
|
|
7
|
+
trackColor: string;
|
|
8
|
+
trackHoverColor: string;
|
|
9
|
+
trackActiveColor: string;
|
|
10
|
+
width: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const SwitchContainer: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<RadixSwitch.SwitchProps & import("react").RefAttributes<HTMLButtonElement>>, any, StyledSwitchProps, never>;
|
|
13
|
+
export declare const SwitchThumb: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<RadixSwitch.SwitchThumbProps & import("react").RefAttributes<HTMLSpanElement>>, any, StyledSwitchProps, never>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import * as RadixSwitch from '@radix-ui/react-switch';
|
|
3
|
+
import { COLORS } from '@/colors';
|
|
4
|
+
export const SwitchContainer = styled(RadixSwitch.Root) `
|
|
5
|
+
all: unset;
|
|
6
|
+
position: relative;
|
|
7
|
+
|
|
8
|
+
width: ${(props) => props.width};
|
|
9
|
+
aspect-ratio: 2/1;
|
|
10
|
+
|
|
11
|
+
background-color: ${(props) => props.trackColor};
|
|
12
|
+
border-radius: ${(props) => props.width};
|
|
13
|
+
|
|
14
|
+
:focus {
|
|
15
|
+
outline: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&[data-state='checked'] {
|
|
19
|
+
background-color: ${(props) => props.trackActiveColor};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:disabled {
|
|
23
|
+
background-color: ${COLORS.NEUTRAL_LIGHT};
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
export const SwitchThumb = styled(RadixSwitch.Thumb) `
|
|
27
|
+
display: block;
|
|
28
|
+
|
|
29
|
+
width: calc(${(props) => props.width} * 0.4);
|
|
30
|
+
aspect-ratio: 1/1;
|
|
31
|
+
|
|
32
|
+
border-radius: 50%;
|
|
33
|
+
background-color: ${(props) => props.thumbColor};
|
|
34
|
+
|
|
35
|
+
transition: transform 100ms;
|
|
36
|
+
transform: translateX(calc(${(props) => props.width} * 0.05));
|
|
37
|
+
will-change: transform;
|
|
38
|
+
|
|
39
|
+
&[data-state='checked'] {
|
|
40
|
+
transform: translateX(
|
|
41
|
+
calc(
|
|
42
|
+
(${(props) => props.width} * 0.95) - (${(props) => props.width} * 0.4)
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
//# sourceMappingURL=Switch.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.styles.js","sourceRoot":"","sources":["../../../../src/components/react/Switch/Switch.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,KAAK,WAAW,MAAM,wBAAwB,CAAA;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAYjC,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAmB;;;;WAI/D,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK;;;sBAGX,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU;mBAC9B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK;;;;;;;wBAOjB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,gBAAgB;;;;wBAIjC,MAAM,CAAC,aAAa;;CAE3C,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAmB;;;gBAGvD,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK;;;;sBAIhB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU;;;+BAGlB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK;;;;;;WAM1C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,eAAe,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK;;;;CAIrE,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const DEFAULT_SWITCH_VARIANTS: {
|
|
2
|
+
color: {
|
|
3
|
+
primary: {
|
|
4
|
+
thumbColor: string;
|
|
5
|
+
thumbHoverColor: string;
|
|
6
|
+
thumbActiveColor: string;
|
|
7
|
+
trackColor: string;
|
|
8
|
+
trackHoverColor: string;
|
|
9
|
+
trackActiveColor: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
size: {
|
|
13
|
+
MD: {
|
|
14
|
+
width: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { COLORS } from '@/colors';
|
|
2
|
+
export const DEFAULT_SWITCH_VARIANTS = {
|
|
3
|
+
color: {
|
|
4
|
+
primary: {
|
|
5
|
+
thumbColor: COLORS.NEUTRAL_HIGH,
|
|
6
|
+
thumbHoverColor: COLORS.GROWTH_MID,
|
|
7
|
+
thumbActiveColor: COLORS.GROWTH_MID,
|
|
8
|
+
trackColor: COLORS.GROWTH_MID,
|
|
9
|
+
trackHoverColor: COLORS.GROWTH_MID,
|
|
10
|
+
trackActiveColor: COLORS.GROWTH_MID,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
MD: {
|
|
15
|
+
width: '42px',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=Switch.variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.variants.js","sourceRoot":"","sources":["../../../../src/components/react/Switch/Switch.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,KAAK,EAAE;QACL,OAAO,EAAE;YACP,UAAU,EAAE,MAAM,CAAC,YAAY;YAC/B,eAAe,EAAE,MAAM,CAAC,UAAU;YAClC,gBAAgB,EAAE,MAAM,CAAC,UAAU;YACnC,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,eAAe,EAAE,MAAM,CAAC,UAAU;YAClC,gBAAgB,EAAE,MAAM,CAAC,UAAU;SACpC;KACF;IACD,IAAI,EAAE;QACJ,EAAE,EAAE;YACF,KAAK,EAAE,MAAM;SACd;KACF;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Switch';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/react/Switch/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const TransparentButton: React.ForwardRefExoticComponent<{
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
variant?: "primary" | "light" | "dark" | undefined;
|
|
5
|
+
size?: "SM" | "MD" | undefined;
|
|
6
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export default TransparentButton;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
import { StyledButtonContainer } from './TransparentButton.styles';
|
|
4
|
+
import { TRANSPARENT_BUTTON_VARIANTS } from './TransparentButton.variants';
|
|
5
|
+
const TransparentButton = forwardRef((_a, ref) => {
|
|
6
|
+
var { children, variant = 'primary', size = 'MD' } = _a, props = __rest(_a, ["children", "variant", "size"]);
|
|
7
|
+
const variantProps = TRANSPARENT_BUTTON_VARIANTS.color[variant];
|
|
8
|
+
const sizeProps = TRANSPARENT_BUTTON_VARIANTS.size[size];
|
|
9
|
+
return (React.createElement(StyledButtonContainer, Object.assign({ type: "button" }, props, variantProps, sizeProps, { ref: ref }), children));
|
|
10
|
+
});
|
|
11
|
+
TransparentButton.displayName = 'TransparentButton';
|
|
12
|
+
export default TransparentButton;
|
|
13
|
+
//# sourceMappingURL=TransparentButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransparentButton.js","sourceRoot":"","sources":["../../../../src/components/react/TransparentButton/TransparentButton.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAA;AAQ1E,MAAM,iBAAiB,GAAG,UAAU,CAClC,CACE,EAKyB,EACzB,GAAQ,EACR,EAAE;QAPF,EACE,QAAQ,EACR,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,IAAI,OAEY,EADpB,KAAK,cAJV,+BAKC,CADS;IAIV,MAAM,YAAY,GAAG,2BAA2B,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IAC/D,MAAM,SAAS,GAAG,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAExD,OAAO,CACL,oBAAC,qBAAqB,kBACpB,IAAI,EAAC,QAAQ,IACT,KAAK,EACL,YAAY,EACZ,SAAS,IACb,GAAG,EAAE,GAAG,KAEP,QAAQ,CACa,CACzB,CAAA;AACH,CAAC,CACF,CAAA;AAED,iBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAEnD,eAAe,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta } from '@storybook/react/types-6-0';
|
|
3
|
+
import ButtonComponent from './TransparentButton';
|
|
4
|
+
type Props = React.ComponentProps<typeof ButtonComponent>;
|
|
5
|
+
export declare const TransparentButton: (props: Props) => JSX.Element;
|
|
6
|
+
declare const _default: Meta;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ButtonComponent from './TransparentButton';
|
|
3
|
+
import { TRANSPARENT_BUTTON_VARIANTS } from './TransparentButton.variants';
|
|
4
|
+
export const TransparentButton = (props) => {
|
|
5
|
+
return React.createElement(ButtonComponent, Object.assign({}, props));
|
|
6
|
+
};
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Buttons/TransparentButton',
|
|
9
|
+
parameters: {
|
|
10
|
+
component: TransparentButton,
|
|
11
|
+
},
|
|
12
|
+
args: {
|
|
13
|
+
children: 'Button',
|
|
14
|
+
variant: 'primary',
|
|
15
|
+
size: 'MD',
|
|
16
|
+
disabled: false,
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
children: {
|
|
20
|
+
control: {
|
|
21
|
+
type: 'text',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
variant: {
|
|
25
|
+
control: {
|
|
26
|
+
type: 'select',
|
|
27
|
+
options: Object.keys(TRANSPARENT_BUTTON_VARIANTS.color),
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
size: {
|
|
31
|
+
control: {
|
|
32
|
+
type: 'select',
|
|
33
|
+
options: Object.keys(TRANSPARENT_BUTTON_VARIANTS.size),
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
disabled: {
|
|
37
|
+
control: {
|
|
38
|
+
type: 'boolean',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
onClick: {
|
|
42
|
+
control: {
|
|
43
|
+
action: 'clicked',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=TransparentButton.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransparentButton.stories.js","sourceRoot":"","sources":["../../../../src/components/react/TransparentButton/TransparentButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,eAAe,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAA;AAI1E,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAY,EAAE,EAAE;IAChD,OAAO,oBAAC,eAAe,oBAAK,KAAK,EAAI,CAAA;AACvC,CAAC,CAAA;AAED,eAAe;IACb,KAAK,EAAE,2BAA2B;IAClC,UAAU,EAAE;QACV,SAAS,EAAE,iBAAiB;KAC7B;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,QAAQ;QAClB,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,KAAK;KAChB;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE;YACR,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;aACb;SACF;QACD,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,KAAK,CAAC;aACxD;SACF;QACD,IAAI,EAAE;YACJ,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC;aACvD;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,10 @@
|
|
|
1
|
+
type StyledButtonProps = {
|
|
2
|
+
padding: string;
|
|
3
|
+
color: string;
|
|
4
|
+
fontSize: string;
|
|
5
|
+
gap: string;
|
|
6
|
+
hoverColor: string;
|
|
7
|
+
activeColor: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const StyledButtonContainer: import("styled-components").StyledComponent<"button", any, StyledButtonProps, never>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { COLORS } from '@/colors';
|
|
3
|
+
export const StyledButtonContainer = styled.button `
|
|
4
|
+
all: unset;
|
|
5
|
+
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: row;
|
|
8
|
+
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
|
|
12
|
+
transition: 0.05s ease-in-out;
|
|
13
|
+
|
|
14
|
+
padding: ${(props) => props.padding};
|
|
15
|
+
gap: ${(props) => props.gap};
|
|
16
|
+
|
|
17
|
+
color: ${(props) => props.color};
|
|
18
|
+
font-size: ${(props) => props.fontSize};
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
|
|
21
|
+
* {
|
|
22
|
+
color: ${(props) => props.color};
|
|
23
|
+
font-size: ${(props) => props.fontSize};
|
|
24
|
+
font-weight: 600;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
padding: ${(props) => props.padding};
|
|
28
|
+
|
|
29
|
+
:hover {
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
transform: scale(1.01);
|
|
32
|
+
|
|
33
|
+
color: ${(props) => props.hoverColor};
|
|
34
|
+
|
|
35
|
+
* {
|
|
36
|
+
color: ${(props) => props.hoverColor};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:active {
|
|
41
|
+
transform: scale(0.98);
|
|
42
|
+
|
|
43
|
+
color: ${(props) => props.activeColor};
|
|
44
|
+
|
|
45
|
+
* {
|
|
46
|
+
color: ${(props) => props.activeColor};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:disabled {
|
|
51
|
+
color: ${COLORS.NEUTRAL_LIGHT};
|
|
52
|
+
border-color: ${COLORS.NEUTRAL_LIGHT};
|
|
53
|
+
background-color: ${COLORS.NEUTRAL_HIGH};
|
|
54
|
+
|
|
55
|
+
:hover {
|
|
56
|
+
cursor: default;
|
|
57
|
+
transform: scale(1);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:active {
|
|
61
|
+
transform: scale(1);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
//# sourceMappingURL=TransparentButton.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransparentButton.styles.js","sourceRoot":"","sources":["../../../../src/components/react/TransparentButton/TransparentButton.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAWjC,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAmB;;;;;;;;;;;aAWxD,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;;;;aAI3B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK;iBAClB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ;;;;aAI7B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO;;;;;;aAMxB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU;;;eAGzB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU;;;;;;;aAO7B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW;;;eAG1B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW;;;;;aAK9B,MAAM,CAAC,aAAa;oBACb,MAAM,CAAC,aAAa;wBAChB,MAAM,CAAC,YAAY;;;;;;;;;;;CAW1C,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const TRANSPARENT_BUTTON_VARIANTS: {
|
|
2
|
+
color: {
|
|
3
|
+
primary: {
|
|
4
|
+
color: string;
|
|
5
|
+
hoverColor: string;
|
|
6
|
+
activeColor: string;
|
|
7
|
+
};
|
|
8
|
+
light: {
|
|
9
|
+
color: string;
|
|
10
|
+
hoverColor: string;
|
|
11
|
+
activeColor: string;
|
|
12
|
+
};
|
|
13
|
+
dark: {
|
|
14
|
+
color: string;
|
|
15
|
+
hoverColor: string;
|
|
16
|
+
activeColor: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
size: {
|
|
20
|
+
SM: {
|
|
21
|
+
fontSize: string;
|
|
22
|
+
padding: string;
|
|
23
|
+
gap: string;
|
|
24
|
+
iconSize: string;
|
|
25
|
+
};
|
|
26
|
+
MD: {
|
|
27
|
+
fontSize: string;
|
|
28
|
+
gap: string;
|
|
29
|
+
padding: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { COLORS } from '@/colors';
|
|
2
|
+
import { FONT } from '@/web';
|
|
3
|
+
export const TRANSPARENT_BUTTON_VARIANTS = {
|
|
4
|
+
color: {
|
|
5
|
+
primary: {
|
|
6
|
+
color: COLORS.GROWTH_MID,
|
|
7
|
+
hoverColor: COLORS.GROWTH_LIGHT,
|
|
8
|
+
activeColor: COLORS.GROWTH_DARK,
|
|
9
|
+
},
|
|
10
|
+
light: {
|
|
11
|
+
color: COLORS.NEUTRAL_LIGHTER,
|
|
12
|
+
hoverColor: COLORS.NEUTRAL_HIGH,
|
|
13
|
+
activeColor: COLORS.NEUTRAL_LIGHT,
|
|
14
|
+
},
|
|
15
|
+
dark: {
|
|
16
|
+
color: COLORS.NEUTRAL_DARKER,
|
|
17
|
+
hoverColor: COLORS.NEUTRAL_DARK,
|
|
18
|
+
activeColor: COLORS.NEUTRAL_LOW,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
size: {
|
|
22
|
+
SM: {
|
|
23
|
+
fontSize: FONT.SIZE.SM,
|
|
24
|
+
padding: '6px 12px',
|
|
25
|
+
gap: '4px',
|
|
26
|
+
iconSize: '16px',
|
|
27
|
+
},
|
|
28
|
+
MD: {
|
|
29
|
+
fontSize: FONT.SIZE.MD,
|
|
30
|
+
gap: '8px',
|
|
31
|
+
padding: '10px 20px',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=TransparentButton.variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransparentButton.variants.js","sourceRoot":"","sources":["../../../../src/components/react/TransparentButton/TransparentButton.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAE5B,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,KAAK,EAAE;QACL,OAAO,EAAE;YACP,KAAK,EAAE,MAAM,CAAC,UAAU;YACxB,UAAU,EAAE,MAAM,CAAC,YAAY;YAC/B,WAAW,EAAE,MAAM,CAAC,WAAW;SAChC;QACD,KAAK,EAAE;YACL,KAAK,EAAE,MAAM,CAAC,eAAe;YAC7B,UAAU,EAAE,MAAM,CAAC,YAAY;YAC/B,WAAW,EAAE,MAAM,CAAC,aAAa;SAClC;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM,CAAC,cAAc;YAC5B,UAAU,EAAE,MAAM,CAAC,YAAY;YAC/B,WAAW,EAAE,MAAM,CAAC,WAAW;SAChC;KACF;IACD,IAAI,EAAE;QACJ,EAAE,EAAE;YACF,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE;YACtB,OAAO,EAAE,UAAU;YACnB,GAAG,EAAE,KAAK;YACV,QAAQ,EAAE,MAAM;SACjB;QACD,EAAE,EAAE;YACF,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE;YACtB,GAAG,EAAE,KAAK;YACV,OAAO,EAAE,WAAW;SACrB;KACF;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TransparentButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/react/TransparentButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as Loader } from './Loader';
|
|
2
|
+
export { default as DefaultButton } from './DefaultButton';
|
|
3
|
+
export { default as IconButton } from './IconButton';
|
|
4
|
+
export { default as OutlineButton } from './OutlineButton';
|
|
5
|
+
export { default as TransparentButton } from './TransparentButton';
|
|
6
|
+
export { default as Switch } from './Switch';
|
|
7
|
+
export { default as Checkbox } from './Checkbox';
|
|
8
|
+
export { default as RadioInput } from './RadioInput';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as Loader } from './Loader';
|
|
2
|
+
export { default as DefaultButton } from './DefaultButton';
|
|
3
|
+
export { default as IconButton } from './IconButton';
|
|
4
|
+
export { default as OutlineButton } from './OutlineButton';
|
|
5
|
+
export { default as TransparentButton } from './TransparentButton';
|
|
6
|
+
export { default as Switch } from './Switch';
|
|
7
|
+
export { default as Checkbox } from './Checkbox';
|
|
8
|
+
export { default as RadioInput } from './RadioInput';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAA;AAE5C,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAElE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AAExB,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { COLORS } from '@/colors/base-colors';
|
|
3
|
+
import { BaseColorsContainer, StyledSquare } from './base-colors.stories.styles';
|
|
4
|
+
const getColorValue = (color) => {
|
|
5
|
+
const colorParts = color.split('.');
|
|
6
|
+
let colorValue = COLORS;
|
|
7
|
+
colorParts.forEach((colorPart) => {
|
|
8
|
+
colorValue = colorValue[colorPart];
|
|
9
|
+
});
|
|
10
|
+
return colorValue;
|
|
11
|
+
};
|
|
12
|
+
const handleCopyToClipboard = (hex) => {
|
|
13
|
+
navigator.clipboard.writeText(hex);
|
|
14
|
+
};
|
|
15
|
+
export const BaseColors = () => {
|
|
16
|
+
const flattenedColors = Object.entries(COLORS).reduce((acc, [key, value]) => {
|
|
17
|
+
if (typeof value === 'object') {
|
|
18
|
+
const newKeys = Object.keys(value).map((k) => `${key}.${k}`);
|
|
19
|
+
const newValues = Object.values(value);
|
|
20
|
+
return Object.assign(Object.assign({}, acc), Object.fromEntries(newKeys.map((k, i) => [k, newValues[i]])));
|
|
21
|
+
}
|
|
22
|
+
return Object.assign(Object.assign({}, acc), { [key]: value });
|
|
23
|
+
}, {});
|
|
24
|
+
const uniqueFlattenedColors = Object.entries(flattenedColors).reduce((acc, [key, value]) => {
|
|
25
|
+
if (Object.values(acc).includes(value)) {
|
|
26
|
+
return acc;
|
|
27
|
+
}
|
|
28
|
+
return Object.assign(Object.assign({}, acc), { [key]: value });
|
|
29
|
+
}, {});
|
|
30
|
+
return (React.createElement(BaseColorsContainer, null, Object.keys(uniqueFlattenedColors).map((key) => {
|
|
31
|
+
const colorHex = getColorValue(key);
|
|
32
|
+
const aliases = Object.entries(flattenedColors)
|
|
33
|
+
.filter(([k, v]) => v === colorHex && k !== key)
|
|
34
|
+
.map(([k]) => k)
|
|
35
|
+
.join(', ');
|
|
36
|
+
return (React.createElement("button", { key: key, className: "color-item", onClick: () => handleCopyToClipboard(colorHex) },
|
|
37
|
+
React.createElement(StyledSquare, { color: colorHex, title: colorHex }),
|
|
38
|
+
React.createElement("div", { title: key, className: "color-item__name" },
|
|
39
|
+
React.createElement("span", { className: "color-item__name__hex" }, colorHex.toUpperCase()),
|
|
40
|
+
React.createElement("span", { className: "color-item__name__key" }, key),
|
|
41
|
+
React.createElement("span", { className: "color-item__name__aliases" }, aliases))));
|
|
42
|
+
})));
|
|
43
|
+
};
|
|
44
|
+
export default {
|
|
45
|
+
title: 'Fundation/Colors',
|
|
46
|
+
parameters: {
|
|
47
|
+
component: BaseColors,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=base-colors.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-colors.stories.js","sourceRoot":"","sources":["../../../src/stories/base-colors/base-colors.stories.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
export const BaseColorsContainer = styled.div `
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-wrap: wrap;
|
|
5
|
+
justify-content: space-around;
|
|
6
|
+
width: 100%;
|
|
7
|
+
margin: 0 auto;
|
|
8
|
+
|
|
9
|
+
gap: 16px;
|
|
10
|
+
|
|
11
|
+
.color-item {
|
|
12
|
+
all: unset;
|
|
13
|
+
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
width: 100%;
|
|
17
|
+
max-width: 400px;
|
|
18
|
+
|
|
19
|
+
background-color: #fff;
|
|
20
|
+
border-radius: 4px;
|
|
21
|
+
|
|
22
|
+
transition: 0.2s ease-in-out;
|
|
23
|
+
padding-right: 8px;
|
|
24
|
+
|
|
25
|
+
gap: 16px;
|
|
26
|
+
box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
|
|
27
|
+
|
|
28
|
+
:hover {
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
|
|
31
|
+
transform: scale(1.02);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.color-item__name {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
font-size: 1rem;
|
|
39
|
+
font-weight: 700;
|
|
40
|
+
|
|
41
|
+
color: #454545;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
text-overflow: ellipsis;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.color-item__name__hex {
|
|
47
|
+
font-size: 0.75em;
|
|
48
|
+
font-weight: 700;
|
|
49
|
+
color: #8e96a2;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.color-item__name__aliases {
|
|
53
|
+
font-size: 0.75em;
|
|
54
|
+
font-weight: 700;
|
|
55
|
+
color: #8e96a2;
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
export const StyledSquare = styled.div `
|
|
59
|
+
min-width: 75px;
|
|
60
|
+
min-height: 75px;
|
|
61
|
+
border-radius: 4px;
|
|
62
|
+
background: ${(props) => props.color};
|
|
63
|
+
`;
|
|
64
|
+
//# sourceMappingURL=base-colors.stories.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-colors.stories.styles.js","sourceRoot":"","sources":["../../../src/stories/base-colors/base-colors.stories.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuD5C,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAK;;;;gBAI3B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK;CACrC,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GRADIENTS } from '@/colors/gradients';
|
|
3
|
+
import { BaseColorsContainer, StyledSquare } from './gradients.stories.styles';
|
|
4
|
+
const handleCopyToClipboard = (hex) => {
|
|
5
|
+
navigator.clipboard.writeText(hex);
|
|
6
|
+
};
|
|
7
|
+
export const Gradients = () => {
|
|
8
|
+
return (React.createElement(BaseColorsContainer, null, Object.entries(GRADIENTS).map(([key, value]) => {
|
|
9
|
+
return (React.createElement("button", { key: key, className: "color-item", onClick: () => handleCopyToClipboard(value) },
|
|
10
|
+
React.createElement(StyledSquare, { gradient: value }),
|
|
11
|
+
React.createElement("div", { title: key, className: "color-item__name" },
|
|
12
|
+
React.createElement("span", { className: "color-item__name__key" }, key),
|
|
13
|
+
React.createElement("span", { className: "color-item__name__value" }, value))));
|
|
14
|
+
})));
|
|
15
|
+
};
|
|
16
|
+
export default {
|
|
17
|
+
title: 'Fundation/Colors',
|
|
18
|
+
parameters: {
|
|
19
|
+
component: Gradients,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=gradients.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gradients.stories.js","sourceRoot":"","sources":["../../../src/stories/gradients/gradients.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE9C,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAE9E,MAAM,qBAAqB,GAAG,CAAC,GAAW,EAAE,EAAE;IAC5C,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,OAAO,CACL,oBAAC,mBAAmB,QACjB,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC9C,OAAO,CACL,gCACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAC,YAAY,EACtB,OAAO,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,KAAK,CAAC;YAE3C,oBAAC,YAAY,IAAC,QAAQ,EAAE,KAAK,GAAI;YACjC,6BAAK,KAAK,EAAE,GAAG,EAAE,SAAS,EAAC,kBAAkB;gBAC3C,8BAAM,SAAS,EAAC,uBAAuB,IAAE,GAAG,CAAQ;gBACpD,8BAAM,SAAS,EAAC,yBAAyB,IAAE,KAAK,CAAQ,CACpD,CACC,CACV,CAAA;IACH,CAAC,CAAC,CACkB,CACvB,CAAA;AACH,CAAC,CAAA;AAED,eAAe;IACb,KAAK,EAAE,kBAAkB;IACzB,UAAU,EAAE;QACV,SAAS,EAAE,SAAS;KACrB;CACM,CAAA"}
|