musae 0.1.12 → 0.1.14
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 +37 -0
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/button.js +10 -6
- package/dist/components/button/styled.d.ts +12 -2
- package/dist/components/button/styled.js +38 -8
- package/dist/components/button/types.d.ts +7 -0
- package/dist/components/checkbox/styled.js +1 -1
- package/dist/components/col/col.d.ts +4 -0
- package/dist/components/col/col.js +10 -0
- package/dist/components/col/index.d.ts +2 -0
- package/dist/components/col/styled.d.ts +5 -0
- package/dist/components/col/styled.js +10 -0
- package/dist/components/col/types.d.ts +6 -0
- package/dist/components/divider/styled.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/input/hooks.d.ts +1 -2
- package/dist/components/input/hooks.js +1 -1
- package/dist/components/input/input.js +5 -6
- package/dist/components/input/styled.d.ts +6 -2
- package/dist/components/input/styled.js +15 -6
- package/dist/components/input/types.d.ts +1 -1
- package/dist/components/loading/loading.js +2 -2
- package/dist/components/loading/styled.d.ts +1 -1
- package/dist/components/loading/styled.js +2 -2
- package/dist/components/menu/menu.js +1 -1
- package/dist/components/radio/styled.js +1 -1
- package/dist/components/switch/styled.js +2 -2
- package/dist/components/theme/hooks.js +0 -6
- package/dist/components/theme/types.d.ts +0 -3
- package/package.json +1 -1
- package/dist/components/button/span.d.ts +0 -12
- package/dist/components/button/span.js +0 -16
- package/dist/components/input/label.d.ts +0 -7
- package/dist/components/input/label.js +0 -14
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<h1 align="center">Musae</h1>
|
|
2
|
+
|
|
3
|
+
## ✨ Features
|
|
4
|
+
|
|
5
|
+
- 🌈 Enterprise-class UI designed for web applications.
|
|
6
|
+
- 📦 A set of high-quality React components out of the box.
|
|
7
|
+
- 🛡 Written in TypeScript with predictable static types.
|
|
8
|
+
- ⚙️ Whole package of design resources and development tools.
|
|
9
|
+
- 🌍 Internationalization support for dozens of languages.
|
|
10
|
+
- 🎨 Powerful theme customization based on CSS-in-JS.
|
|
11
|
+
|
|
12
|
+
## 📦 Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install musae
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
yarn add musae
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pnpm add musae
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## 🔨 Usage
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import React from "react";
|
|
30
|
+
import { Button } from "musae";
|
|
31
|
+
|
|
32
|
+
const App = () => (
|
|
33
|
+
<>
|
|
34
|
+
<Button>PRESS ME</Button>
|
|
35
|
+
</>
|
|
36
|
+
);
|
|
37
|
+
```
|
|
@@ -6,5 +6,5 @@ import React from "react";
|
|
|
6
6
|
* @description
|
|
7
7
|
* button
|
|
8
8
|
*/
|
|
9
|
-
declare const Button: ({ children, className, onClick }: ButtonProps) => React.JSX.Element;
|
|
9
|
+
declare const Button: ({ children, className, onClick, ...props }: ButtonProps) => React.JSX.Element;
|
|
10
10
|
export default Button;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import React from 'react';
|
|
1
|
+
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import { StyledWrapper, StyledSpan } from './styled.js';
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @author murukal
|
|
@@ -8,9 +8,13 @@ import React from 'react';
|
|
|
8
8
|
* @description
|
|
9
9
|
* button
|
|
10
10
|
*/
|
|
11
|
-
const Button = (
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const Button = (_a) => {
|
|
12
|
+
var { children, className, onClick } = _a, props = __rest(_a, ["children", "className", "onClick"]);
|
|
13
|
+
/// get which variant is using
|
|
14
|
+
/// variant determin style
|
|
15
|
+
const variant = useMemo(() => props.variant || "filled", [props.variant]);
|
|
16
|
+
return (React.createElement(StyledWrapper, { onClick: onClick, className: className, variant: variant },
|
|
17
|
+
React.createElement(StyledSpan, null, children)));
|
|
14
18
|
};
|
|
15
19
|
|
|
16
20
|
export { Button as default };
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const StyledWrapper: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
4
|
as?: import("react").ElementType<any> | undefined;
|
|
5
|
-
}, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
5
|
+
} & Required<Pick<import("./types").ButtonProps, "variant">>, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
6
|
+
/**
|
|
7
|
+
* @author murukal
|
|
8
|
+
*
|
|
9
|
+
* @description
|
|
10
|
+
* content
|
|
11
|
+
*/
|
|
12
|
+
export declare const StyledSpan: import("@emotion/styled").StyledComponent<{
|
|
13
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
14
|
+
as?: import("react").ElementType<any> | undefined;
|
|
15
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
@@ -1,15 +1,45 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
2
|
import { useValidTheme } from '../theme/hooks.js';
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
var _a;
|
|
4
|
+
const StyledWrapper = styled.button(({ theme, variant }) => {
|
|
5
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
6
6
|
const validTheme = useValidTheme(theme);
|
|
7
|
-
return {
|
|
8
|
-
|
|
9
|
-
padding: "10px 16px",
|
|
10
|
-
backgroundColor: (_a = validTheme.colors) === null || _a === void 0 ? void 0 : _a.primary,
|
|
7
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({ borderRadius: 999, padding: "0.625rem 1.5rem" }, (variant === "filled" && {
|
|
8
|
+
backgroundColor: (_a = validTheme.palettes) === null || _a === void 0 ? void 0 : _a.primary[40],
|
|
11
9
|
border: "none",
|
|
12
|
-
|
|
10
|
+
span: {
|
|
11
|
+
color: (_b = validTheme.palettes) === null || _b === void 0 ? void 0 : _b.primary[100],
|
|
12
|
+
},
|
|
13
|
+
})), (variant === "outlined" && {
|
|
14
|
+
borderWidth: 1,
|
|
15
|
+
borderStyle: "solid",
|
|
16
|
+
borderColor: (_c = validTheme.palettes) === null || _c === void 0 ? void 0 : _c.neutral[50],
|
|
17
|
+
span: {
|
|
18
|
+
color: (_d = validTheme.palettes) === null || _d === void 0 ? void 0 : _d.primary[40],
|
|
19
|
+
},
|
|
20
|
+
})), (variant === "elevated" && {
|
|
21
|
+
backgroundColor: (_e = validTheme.palettes) === null || _e === void 0 ? void 0 : _e.neutral[95],
|
|
22
|
+
boxShadow: (_f = validTheme.elevations) === null || _f === void 0 ? void 0 : _f[1].boxShadow,
|
|
23
|
+
span: {
|
|
24
|
+
color: (_g = validTheme.palettes) === null || _g === void 0 ? void 0 : _g.primary[40],
|
|
25
|
+
},
|
|
26
|
+
})), (variant === "tonal" && {
|
|
27
|
+
backgroundColor: (_h = validTheme.palettes) === null || _h === void 0 ? void 0 : _h.secondary[90],
|
|
28
|
+
span: {
|
|
29
|
+
color: (_j = validTheme.palettes) === null || _j === void 0 ? void 0 : _j.secondary[10],
|
|
30
|
+
},
|
|
31
|
+
}));
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* @author murukal
|
|
35
|
+
*
|
|
36
|
+
* @description
|
|
37
|
+
* content
|
|
38
|
+
*/
|
|
39
|
+
const StyledSpan = styled.span(({ theme }) => {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
const validTheme = useValidTheme(theme);
|
|
42
|
+
return Object.assign({ marginLeft: 8, marginRight: 8 }, (_b = (_a = validTheme.typography) === null || _a === void 0 ? void 0 : _a.label) === null || _b === void 0 ? void 0 : _b.large);
|
|
13
43
|
});
|
|
14
44
|
|
|
15
|
-
export {
|
|
45
|
+
export { StyledSpan, StyledWrapper };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { MouseEventHandler, ReactNode } from "react";
|
|
2
|
+
export type Variant = "filled" | "outlined" | "text" | "elevated" | "tonal";
|
|
2
3
|
/**
|
|
3
4
|
* @author murukal
|
|
4
5
|
*
|
|
@@ -7,6 +8,12 @@ import type { MouseEventHandler, ReactNode } from "react";
|
|
|
7
8
|
*/
|
|
8
9
|
export interface ButtonProps {
|
|
9
10
|
className?: string;
|
|
11
|
+
variant?: Variant;
|
|
10
12
|
children?: ReactNode;
|
|
11
13
|
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
12
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* @description
|
|
17
|
+
* button render props
|
|
18
|
+
*/
|
|
19
|
+
export type ButtonRenderProps = Required<Pick<ButtonProps, "variant">>;
|
|
@@ -4,7 +4,7 @@ import { useValidTheme } from '../theme/hooks.js';
|
|
|
4
4
|
const Wrapper = styled.input(({ theme }) => {
|
|
5
5
|
var _a;
|
|
6
6
|
const validTheme = useValidTheme(theme);
|
|
7
|
-
const primaryColor = (_a = validTheme.
|
|
7
|
+
const primaryColor = (_a = validTheme.palettes) === null || _a === void 0 ? void 0 : _a.primary[40];
|
|
8
8
|
return {
|
|
9
9
|
margin: 0,
|
|
10
10
|
visibility: "hidden",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { StyledWrapper } from './styled.js';
|
|
3
|
+
|
|
4
|
+
const Col = (props) => {
|
|
5
|
+
/// span
|
|
6
|
+
const span = useMemo(() => { var _a; return (_a = props.span) !== null && _a !== void 0 ? _a : 8; }, [props.span]);
|
|
7
|
+
return React.createElement(StyledWrapper, { span: span }, props.children);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { Col as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledWrapper: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
} & Required<Pick<import("./types").ColProps, "span">>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
package/dist/components/index.js
CHANGED
|
@@ -9,5 +9,6 @@ export { default as Radio } from './radio/radio.js';
|
|
|
9
9
|
export { default as RadioGroup } from './radio/group.js';
|
|
10
10
|
export { default as Checkbox } from './checkbox/checkbox.js';
|
|
11
11
|
export { default as Row } from './row/row.js';
|
|
12
|
+
export { default as Col } from './col/col.js';
|
|
12
13
|
export { default as Divider } from './divider/divider.js';
|
|
13
14
|
export { useMessage } from './message/hooks.js';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { Variant } from "./types";
|
|
2
1
|
/**
|
|
3
2
|
* @description class name for input
|
|
4
3
|
*/
|
|
5
|
-
export declare const useStyles: ([
|
|
4
|
+
export declare const useStyles: ([className]: [className?: string | undefined]) => {
|
|
6
5
|
wrapperClassName: string;
|
|
7
6
|
};
|
|
@@ -4,7 +4,7 @@ import clsx from 'clsx';
|
|
|
4
4
|
/**
|
|
5
5
|
* @description class name for input
|
|
6
6
|
*/
|
|
7
|
-
const useStyles = ([
|
|
7
|
+
const useStyles = ([className]) => {
|
|
8
8
|
/// wrapper
|
|
9
9
|
const wrapperClassName = useMemo(() => {
|
|
10
10
|
return clsx(["musae-input-wrapper", className]);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef, useRef, useImperativeHandle, useMemo } from 'react';
|
|
2
2
|
import { useStyles } from './hooks.js';
|
|
3
3
|
import { useBoolean } from '@aiszlab/relax';
|
|
4
|
-
import
|
|
5
|
-
import { Wrapper, StyledInput } from './styled.js';
|
|
4
|
+
import { StyledWrapper, StyledLabel, StyledInput } from './styled.js';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* @author murukal
|
|
@@ -18,9 +17,9 @@ const Input = forwardRef((props, ref) => {
|
|
|
18
17
|
/// is focused
|
|
19
18
|
const { isOn: isFocused, turnOn: focus, turnOff: blur } = useBoolean();
|
|
20
19
|
/// variant
|
|
21
|
-
|
|
20
|
+
useMemo(() => props.variant || "outlined", [props.variant]);
|
|
22
21
|
/// style
|
|
23
|
-
const { wrapperClassName } = useStyles([
|
|
22
|
+
const { wrapperClassName } = useStyles([props.className]);
|
|
24
23
|
/// used input props
|
|
25
24
|
const inputProps = useMemo(() => {
|
|
26
25
|
return {
|
|
@@ -40,9 +39,9 @@ const Input = forwardRef((props, ref) => {
|
|
|
40
39
|
};
|
|
41
40
|
}, [focus, blur, props.type, props.onFocus, props.onBlur]);
|
|
42
41
|
/// render
|
|
43
|
-
return (React.createElement(
|
|
42
|
+
return (React.createElement(StyledWrapper, { ref: wrapperRef, className: wrapperClassName, isFocused: isFocused },
|
|
44
43
|
props.prefix,
|
|
45
|
-
!!props.label && (React.createElement(
|
|
44
|
+
!!props.label && (React.createElement(StyledLabel, { isFocused: isFocused, className: "musae-input-label" }, props.label)),
|
|
46
45
|
React.createElement(StyledInput, Object.assign({}, inputProps)),
|
|
47
46
|
props.suffix));
|
|
48
47
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { WrapperProps } from "./types";
|
|
3
|
-
export declare const
|
|
2
|
+
import type { LabelRenderProps, WrapperProps } from "./types";
|
|
3
|
+
export declare const StyledWrapper: import("@emotion/styled").StyledComponent<{
|
|
4
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
5
|
as?: import("react").ElementType<any> | undefined;
|
|
6
6
|
} & WrapperProps, import("react").DetailedHTMLProps<import("react").FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, {}>;
|
|
@@ -8,3 +8,7 @@ export declare const StyledInput: import("@emotion/styled").StyledComponent<{
|
|
|
8
8
|
theme?: import("@emotion/react").Theme | undefined;
|
|
9
9
|
as?: import("react").ElementType<any> | undefined;
|
|
10
10
|
}, import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, {}>;
|
|
11
|
+
export declare const StyledLabel: import("@emotion/styled").StyledComponent<{
|
|
12
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
13
|
+
as?: import("react").ElementType<any> | undefined;
|
|
14
|
+
} & LabelRenderProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>, {}>;
|
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
2
|
import { useValidTheme } from '../theme/hooks.js';
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
var _a;
|
|
4
|
+
const StyledWrapper = styled.fieldset(({ isFocused, theme }) => {
|
|
5
|
+
var _a, _b;
|
|
6
6
|
const validTheme = useValidTheme(theme);
|
|
7
|
-
return Object.assign({ textAlign: "start", height: 56, margin: 0, paddingTop: 0, paddingBottom: 0, display: "flex", alignItems: "center", borderColor:
|
|
8
|
-
borderColor: (
|
|
7
|
+
return Object.assign({ textAlign: "start", height: 56, margin: 0, paddingTop: 0, paddingBottom: 0, display: "flex", alignItems: "center", borderColor: (_a = validTheme.palettes) === null || _a === void 0 ? void 0 : _a.neutral[50], borderWidth: 1, borderStyle: "solid", borderRadius: 4, boxSizing: "border-box" }, (isFocused && {
|
|
8
|
+
borderColor: (_b = validTheme.palettes) === null || _b === void 0 ? void 0 : _b.primary[40],
|
|
9
9
|
borderWidth: 2,
|
|
10
10
|
}));
|
|
11
11
|
});
|
|
12
12
|
const StyledInput = styled.input(() => {
|
|
13
13
|
return {
|
|
14
|
-
padding: 0,
|
|
14
|
+
padding: "0 0.75rem",
|
|
15
15
|
backgroundColor: "transparent",
|
|
16
16
|
outline: "none",
|
|
17
17
|
border: "none",
|
|
18
18
|
height: "auto",
|
|
19
19
|
};
|
|
20
20
|
});
|
|
21
|
+
const StyledLabel = styled.legend(({ isFocused, theme }) => {
|
|
22
|
+
var _a, _b, _c;
|
|
23
|
+
const validTheme = useValidTheme(theme);
|
|
24
|
+
return Object.assign(Object.assign(Object.assign({}, (_b = (_a = validTheme.typography) === null || _a === void 0 ? void 0 : _a.body) === null || _b === void 0 ? void 0 : _b.small), {
|
|
25
|
+
// layout
|
|
26
|
+
paddingInlineStart: 4, paddingInlineEnd: 4 }), (isFocused && {
|
|
27
|
+
color: (_c = validTheme.palettes) === null || _c === void 0 ? void 0 : _c.primary[40],
|
|
28
|
+
}));
|
|
29
|
+
});
|
|
21
30
|
|
|
22
|
-
export { StyledInput,
|
|
31
|
+
export { StyledInput, StyledLabel, StyledWrapper };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { keyframes } from '@emotion/react';
|
|
3
3
|
import Circle from './circle.js';
|
|
4
|
-
import {
|
|
4
|
+
import { StyledWrapper } from './styled.js';
|
|
5
5
|
|
|
6
6
|
const large = keyframes `
|
|
7
7
|
from,
|
|
@@ -187,7 +187,7 @@ const right = keyframes `
|
|
|
187
187
|
}
|
|
188
188
|
`;
|
|
189
189
|
const Loading = () => {
|
|
190
|
-
return (React.createElement(
|
|
190
|
+
return (React.createElement(StyledWrapper, { width: "240", height: "240", viewBox: "0 0 240 240" },
|
|
191
191
|
React.createElement(Circle, { animationName: large, cx: "120", cy: "120", r: "105", stroke: "#f42f25" }),
|
|
192
192
|
React.createElement(Circle, { animationName: small, cx: "120", cy: "120", r: "35", stroke: "#f49725" }),
|
|
193
193
|
React.createElement(Circle, { animationName: left, cx: "85", cy: "120", r: "70", stroke: "#255ff4" }),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const StyledWrapper: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
4
|
as?: import("react").ElementType<any> | undefined;
|
|
5
5
|
}, import("react").SVGProps<SVGSVGElement>, {}>;
|
|
@@ -17,7 +17,7 @@ const Menu = (props) => {
|
|
|
17
17
|
setSelectedKeys([key]);
|
|
18
18
|
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, key);
|
|
19
19
|
},
|
|
20
|
-
selectedKeys
|
|
20
|
+
selectedKeys,
|
|
21
21
|
}), [props.onClick, selectedKeys]);
|
|
22
22
|
return (React.createElement(MenuContext.Provider, { value: contextValue },
|
|
23
23
|
React.createElement(Group, { items: props.items })));
|
|
@@ -25,7 +25,7 @@ const Wrapper = styled.input(({ theme }) => {
|
|
|
25
25
|
"&[aria-checked=true]": {
|
|
26
26
|
"::after": {
|
|
27
27
|
borderWidth: "0.3rem",
|
|
28
|
-
borderColor: (_a = validTheme.
|
|
28
|
+
borderColor: (_a = validTheme.palettes) === null || _a === void 0 ? void 0 : _a.primary[40],
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
};
|
|
@@ -24,8 +24,8 @@ const Wrapper = styled.div(({ theme }) => {
|
|
|
24
24
|
transition: "all .2s",
|
|
25
25
|
},
|
|
26
26
|
"&[aria-selected=true]": {
|
|
27
|
-
borderColor: (_a = validTheme.
|
|
28
|
-
backgroundColor: (_b = validTheme.
|
|
27
|
+
borderColor: (_a = validTheme.palettes) === null || _a === void 0 ? void 0 : _a.primary[40],
|
|
28
|
+
backgroundColor: (_b = validTheme.palettes) === null || _b === void 0 ? void 0 : _b.primary[40],
|
|
29
29
|
"::before": {
|
|
30
30
|
translate: "100%",
|
|
31
31
|
backgroundColor: "white",
|
|
@@ -87,12 +87,6 @@ const palettes = {
|
|
|
87
87
|
* let ui components display well
|
|
88
88
|
*/
|
|
89
89
|
const DEFAULT_THEME = {
|
|
90
|
-
colors: {
|
|
91
|
-
primary: palettes.primary[40],
|
|
92
|
-
secondary: palettes.secondary[40],
|
|
93
|
-
tertiary: palettes.tertiary[40],
|
|
94
|
-
error: palettes.error[40],
|
|
95
|
-
},
|
|
96
90
|
typography: {
|
|
97
91
|
body: {
|
|
98
92
|
small: {
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
/**
|
|
3
|
-
* @author murukal
|
|
4
|
-
*
|
|
5
|
-
* @description
|
|
6
|
-
* content
|
|
7
|
-
*/
|
|
8
|
-
declare const Span: import("@emotion/styled").StyledComponent<{
|
|
9
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
10
|
-
as?: import("react").ElementType<any> | undefined;
|
|
11
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
12
|
-
export default Span;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import styled from '@emotion/styled';
|
|
2
|
-
import { useValidTheme } from '../theme/hooks.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @author murukal
|
|
6
|
-
*
|
|
7
|
-
* @description
|
|
8
|
-
* content
|
|
9
|
-
*/
|
|
10
|
-
const Span = styled.span(({ theme }) => {
|
|
11
|
-
var _a, _b;
|
|
12
|
-
const validTheme = useValidTheme(theme);
|
|
13
|
-
return Object.assign({ marginLeft: 8, marginRight: 8, color: "#fff" }, (_b = (_a = validTheme.typography) === null || _a === void 0 ? void 0 : _a.label) === null || _b === void 0 ? void 0 : _b.large);
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export { Span as default };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { LabelProps } from "./types";
|
|
3
|
-
declare const Label: import("@emotion/styled").StyledComponent<{
|
|
4
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
-
as?: import("react").ElementType<any> | undefined;
|
|
6
|
-
} & LabelProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>, {}>;
|
|
7
|
-
export default Label;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import styled from '@emotion/styled';
|
|
2
|
-
import { useValidTheme } from '../theme/hooks.js';
|
|
3
|
-
|
|
4
|
-
const Label = styled.legend(({ isFocused, theme }) => {
|
|
5
|
-
var _a, _b, _c;
|
|
6
|
-
const validTheme = useValidTheme(theme);
|
|
7
|
-
return Object.assign(Object.assign(Object.assign({}, (_b = (_a = validTheme.typography) === null || _a === void 0 ? void 0 : _a.body) === null || _b === void 0 ? void 0 : _b.small), {
|
|
8
|
-
// layout
|
|
9
|
-
paddingInlineStart: 4, paddingInlineEnd: 4 }), (isFocused && {
|
|
10
|
-
color: (_c = validTheme.colors) === null || _c === void 0 ? void 0 : _c.primary,
|
|
11
|
-
}));
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export { Label as default };
|