@shiflo/ui 0.0.0 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Box/Box.d.ts +2 -2
- package/dist/components/Box/Box.mjs +8 -11
- package/dist/components/Box/Box.typing.d.ts +5 -2
- package/dist/components/Box/index.d.ts +2 -2
- package/dist/components/Typography/Typography.d.ts +2 -2
- package/dist/components/Typography/Typography.mjs +13 -16
- package/dist/components/Typography/Typography.typing.d.ts +5 -2
- package/dist/components/Typography/index.d.ts +2 -2
- package/dist/typings/component.d.ts +7 -0
- package/dist/typings/component.mjs +1 -0
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare
|
|
1
|
+
import { BoxComponent } from './Box.typing';
|
|
2
|
+
declare const Box: BoxComponent;
|
|
3
3
|
export default Box;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import d from "basic-styled";
|
|
3
3
|
import a from "../../utils/getUtilityProps.mjs";
|
|
4
|
-
import
|
|
5
|
-
const
|
|
4
|
+
import s from "../../utils/getValueByPath.mjs";
|
|
5
|
+
const m = d.div`
|
|
6
6
|
transition:
|
|
7
7
|
background-color 0.2s,
|
|
8
8
|
border-width 0.2s,
|
|
@@ -10,20 +10,17 @@ const f = d.div`
|
|
|
10
10
|
border-color 0.2s,
|
|
11
11
|
color 0.2s;
|
|
12
12
|
|
|
13
|
-
${({ theme: { palette: o }, backgroundColor:
|
|
13
|
+
${({ theme: { palette: o }, backgroundColor: t, borderColor: i, color: e, ...n }) => {
|
|
14
14
|
const r = {};
|
|
15
|
-
return Object.assign(r, a(n)),
|
|
16
|
-
backgroundColor:
|
|
15
|
+
return Object.assign(r, a(n)), t && Object.assign(r, {
|
|
16
|
+
backgroundColor: s(o, t)
|
|
17
17
|
}), i && Object.assign(r, {
|
|
18
|
-
borderColor:
|
|
18
|
+
borderColor: s(o, i)
|
|
19
19
|
}), e && Object.assign(r, {
|
|
20
|
-
color:
|
|
20
|
+
color: s(o, e)
|
|
21
21
|
}), r;
|
|
22
22
|
}}
|
|
23
|
-
|
|
24
|
-
function u(o) {
|
|
25
|
-
return /* @__PURE__ */ c(f, { ...o });
|
|
26
|
-
}
|
|
23
|
+
`, u = (o) => /* @__PURE__ */ c(m, { ...o });
|
|
27
24
|
export {
|
|
28
25
|
u as default
|
|
29
26
|
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ElementType, ReactNode } from 'react';
|
|
2
|
+
import { PolymorphicComponentProps } from '../../typings/component';
|
|
2
3
|
import { RecursionPath, UtilityProps } from '../../typings/utility';
|
|
3
4
|
import { BasicTheme } from 'basic-styled';
|
|
4
|
-
export interface
|
|
5
|
+
export interface BaseBoxProps extends UtilityProps {
|
|
5
6
|
backgroundColor?: RecursionPath<BasicTheme["palette"]>;
|
|
6
7
|
color?: RecursionPath<BasicTheme["palette"]> | "inherit";
|
|
7
8
|
borderColor?: RecursionPath<BasicTheme["palette"]>;
|
|
8
9
|
}
|
|
10
|
+
export type BoxProps<T extends ElementType> = BaseBoxProps & PolymorphicComponentProps<T>;
|
|
11
|
+
export type BoxComponent<DT extends ElementType = "div"> = <T extends ElementType = DT>(props: BoxProps<T>) => ReactNode;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare
|
|
1
|
+
import { TypographyComponent } from './Typography.typing';
|
|
2
|
+
declare const Typography: TypographyComponent;
|
|
3
3
|
export default Typography;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import b from "basic-styled";
|
|
3
3
|
import f from "../../utils/getUtilityProps.mjs";
|
|
4
|
-
import
|
|
5
|
-
const
|
|
4
|
+
import i from "../../utils/getValueByPath.mjs";
|
|
5
|
+
const h = b.div`
|
|
6
6
|
transition:
|
|
7
7
|
font-size 0.2s,
|
|
8
8
|
line-height 0.2s,
|
|
@@ -11,17 +11,17 @@ const y = p.div`
|
|
|
11
11
|
border-color 0.2s,
|
|
12
12
|
color 0.2s;
|
|
13
13
|
|
|
14
|
-
${({ theme: { typography: o, palette:
|
|
15
|
-
const { fontSize: a, lineHeight:
|
|
14
|
+
${({ theme: { typography: o, palette: e }, variant: s, color: n, fontWeight: l, borderColor: r, ...d }) => {
|
|
15
|
+
const { fontSize: a, lineHeight: c } = o[s || "body2"], t = {
|
|
16
16
|
fontSize: a,
|
|
17
|
-
lineHeight:
|
|
17
|
+
lineHeight: c,
|
|
18
18
|
fontWeight: l
|
|
19
19
|
};
|
|
20
|
-
return Object.assign(
|
|
21
|
-
borderColor:
|
|
22
|
-
}), Object.assign(
|
|
23
|
-
color:
|
|
24
|
-
}),
|
|
20
|
+
return Object.assign(t, f(d)), r && Object.assign(t, {
|
|
21
|
+
borderColor: i(e, r)
|
|
22
|
+
}), Object.assign(t, {
|
|
23
|
+
color: i(e, n)
|
|
24
|
+
}), t;
|
|
25
25
|
}};
|
|
26
26
|
|
|
27
27
|
${({ noWrap: o }) => o ? {
|
|
@@ -36,10 +36,7 @@ const y = p.div`
|
|
|
36
36
|
"-webkit-line-clamp": o,
|
|
37
37
|
"-webkit-box-orient": "vertical"
|
|
38
38
|
} : {}};
|
|
39
|
-
|
|
40
|
-
function u({ ref: o, variant: t = "body2", fontWeight: i = 400, ...r }) {
|
|
41
|
-
return /* @__PURE__ */ c(y, { ref: o, variant: t, fontWeight: i, ...r });
|
|
42
|
-
}
|
|
39
|
+
`, u = (o) => /* @__PURE__ */ p(h, { ...o });
|
|
43
40
|
export {
|
|
44
41
|
u as default
|
|
45
42
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ComponentPropsWithRef } from 'react';
|
|
1
|
+
import { ComponentPropsWithRef, ReactNode, ElementType } from 'react';
|
|
2
|
+
import { PolymorphicComponentProps } from '../../typings/component';
|
|
2
3
|
import { UtilityProps, RecursionPath } from '../../typings/utility';
|
|
3
4
|
import { BasicTheme } from 'basic-styled';
|
|
4
|
-
export interface
|
|
5
|
+
export interface BaseTypographyProps extends ComponentPropsWithRef<"div">, UtilityProps {
|
|
5
6
|
variant?: keyof BasicTheme["typography"];
|
|
6
7
|
fontWeight?: 400 | 500 | 700;
|
|
7
8
|
color?: RecursionPath<BasicTheme["palette"]> | "inherit";
|
|
@@ -10,3 +11,5 @@ export interface TypographyProps extends ComponentPropsWithRef<"div">, UtilityPr
|
|
|
10
11
|
noWrap?: boolean;
|
|
11
12
|
lineClamp?: number;
|
|
12
13
|
}
|
|
14
|
+
export type TypographyProps<T extends ElementType> = BaseTypographyProps & PolymorphicComponentProps<T>;
|
|
15
|
+
export type TypographyComponent<DT extends ElementType = "div"> = <T extends ElementType = DT>(props: TypographyProps<T>) => ReactNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { default as Typography } from './Typography';
|
|
2
|
-
import {
|
|
3
|
-
export type {
|
|
2
|
+
import { BaseTypographyProps } from './Typography.typing';
|
|
3
|
+
export type { BaseTypographyProps };
|
|
4
4
|
export default Typography;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentPropsWithRef, ComponentPropsWithoutRef, ElementType } from 'react';
|
|
2
|
+
export type PolymorphicComponentProps<T extends ElementType> = {
|
|
3
|
+
as?: T | ElementType;
|
|
4
|
+
} & ComponentPropsWithoutRef<T> & {
|
|
5
|
+
ref?: PolymorphicRef<T>;
|
|
6
|
+
};
|
|
7
|
+
export type PolymorphicRef<T extends ElementType> = ComponentPropsWithRef<T>["ref"];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|