@shiflo/ui 0.0.3 → 0.0.5
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/index.d.ts +2 -2
- package/dist/components/Button/Button.typing.d.ts +3 -2
- package/dist/components/Button/index.d.ts +2 -2
- package/dist/components/Icon/Icon.mjs +16 -13
- package/dist/components/Icon/Icon.typing.d.ts +3 -2
- package/dist/components/Icon/index.d.ts +2 -2
- package/dist/components/Tag/Tag.typing.d.ts +2 -1
- package/dist/components/Typography/index.d.ts +2 -2
- package/dist/theme/ThemeProvider.mjs +1 -1
- package/dist/typings/utility.d.ts +4 -1
- package/dist/utils/getUtilityProps.mjs +16 -16
- package/dist/utils/getValueByPath.mjs +1 -1
- package/package.json +2 -2
- package/dist/typings/component.mjs +0 -1
- package/dist/typings/utility.mjs +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
import { UtilityProps } from '../../typings/utility';
|
|
3
|
+
export interface BaseButtonProps extends Pick<UtilityProps, "css"> {
|
|
3
4
|
size?: "xSmall" | "small" | "medium" | "large";
|
|
4
5
|
startIcon?: ReactNode;
|
|
5
6
|
endIcon?: ReactNode;
|
|
@@ -16,4 +17,4 @@ export interface TextButtonProps extends BaseButtonProps {
|
|
|
16
17
|
variant?: "text";
|
|
17
18
|
color?: "secondary";
|
|
18
19
|
}
|
|
19
|
-
export type ButtonProps = FilledButtonProps | GhostButtonProps | TextButtonProps
|
|
20
|
+
export type ButtonProps = (FilledButtonProps | GhostButtonProps | TextButtonProps) & ComponentPropsWithRef<"button">;
|
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Children as
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { Children as p, isValidElement as l } from "react";
|
|
3
3
|
import { S as a } from "../../assets/icons/index.ts-BL4wFg6B.js";
|
|
4
4
|
import c from "basic-styled";
|
|
5
|
-
import
|
|
6
|
-
const
|
|
5
|
+
import d from "../../utils/getValueByPath.mjs";
|
|
6
|
+
const f = c.svg`
|
|
7
7
|
transition:
|
|
8
8
|
width 0.2s,
|
|
9
9
|
height 0.2s,
|
|
10
10
|
color 0.2s;
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
width: ${({ width: t }) => t || "24px"};
|
|
13
|
+
height: ${({ height: t }) => t || "24px"};
|
|
14
|
+
color: ${({ theme: { palette: t }, color: r }) => d(t, r || "") || "inherit"};
|
|
12
15
|
`;
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
if (!
|
|
16
|
+
function v({ ref: t, name: r, width: e = 24, height: n = 24, ...s }) {
|
|
17
|
+
const h = a[r];
|
|
18
|
+
return p.map(h(), (i) => {
|
|
19
|
+
if (!l(i))
|
|
17
20
|
return null;
|
|
18
|
-
const
|
|
21
|
+
const o = {
|
|
19
22
|
...s,
|
|
20
|
-
...
|
|
23
|
+
...i.props
|
|
21
24
|
};
|
|
22
|
-
return
|
|
25
|
+
return o.width = e ?? o.width, o.height = n ?? o.height, /* @__PURE__ */ m(f, { ref: t, ...o });
|
|
23
26
|
});
|
|
24
27
|
}
|
|
25
28
|
export {
|
|
26
|
-
|
|
29
|
+
v as default
|
|
27
30
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ComponentPropsWithRef } from 'react';
|
|
2
|
-
import { RecursionPath } from '../../typings/utility';
|
|
2
|
+
import { RecursionPath, UtilityProps } from '../../typings/utility';
|
|
3
3
|
import { BasicTheme } from 'basic-styled';
|
|
4
4
|
import type * as Svgs from "../../assets/icons";
|
|
5
|
-
export interface
|
|
5
|
+
export interface BaseIconProps extends Pick<UtilityProps, "css"> {
|
|
6
6
|
name: keyof typeof Svgs;
|
|
7
7
|
color?: RecursionPath<BasicTheme["palette"]> | "inherit";
|
|
8
8
|
}
|
|
9
|
+
export type IconProps = BaseIconProps & Omit<ComponentPropsWithRef<"svg">, "children">;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithRef } from 'react';
|
|
2
|
-
|
|
2
|
+
import { UtilityProps } from '../../typings/utility';
|
|
3
|
+
export interface TagProps extends ComponentPropsWithRef<"span">, Pick<UtilityProps, "css"> {
|
|
3
4
|
color?: "primary" | "warning" | "error" | "info" | "success";
|
|
4
5
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { default as Typography } from './Typography';
|
|
2
|
-
import { TypographyProps } from './Typography.typing';
|
|
3
|
-
export type { TypographyProps };
|
|
2
|
+
import { BaseTypographyProps, TypographyProps } from './Typography.typing';
|
|
3
|
+
export type { BaseTypographyProps, TypographyProps };
|
|
4
4
|
export default Typography;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import m from "basic-styled/setup/createBuilder";
|
|
3
3
|
import i from "basic-styled/setup/ResetStyle";
|
|
4
|
-
import f from "
|
|
4
|
+
import f from "basic-styled/setup/ThemeProvider";
|
|
5
5
|
import l from "./dark.mjs";
|
|
6
6
|
import p from "./GlobalStyle.mjs";
|
|
7
7
|
import h from "./light.mjs";
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { CSS } from 'basic-styled/core/typing';
|
|
1
2
|
import { default as radius } from '../theme/radius';
|
|
2
3
|
import { default as spacing } from '../theme/spacing';
|
|
3
4
|
import { Properties } from 'csstype';
|
|
4
|
-
export type UtilityProps = Partial<Pick<Properties, "display" | "alignItems" | "justifyContent" | "flex" | "flexWrap" | "flexDirection" | "flexGrow" | "flexFlow" | "flexBasis" | "flexShrink" | "border" | "borderTop" | "borderBottom" | "borderRight" | "borderLeft"> & Record<"m" | "mt" | "mb" | "mr" | "ml" | "p" | "pt" | "pb" | "pl" | "pr" | "gap", keyof typeof spacing> & Record<"br" | "brtl" | "brtr" | "brml" | "brmr", keyof typeof radius
|
|
5
|
+
export type UtilityProps = Partial<Pick<Properties, "display" | "alignItems" | "justifyContent" | "flex" | "flexWrap" | "flexDirection" | "flexGrow" | "flexFlow" | "flexBasis" | "flexShrink" | "border" | "borderTop" | "borderBottom" | "borderRight" | "borderLeft"> & Record<"m" | "mt" | "mb" | "mr" | "ml" | "p" | "pt" | "pb" | "pl" | "pr" | "gap", keyof typeof spacing> & Record<"br" | "brtl" | "brtr" | "brml" | "brmr", keyof typeof radius>> & {
|
|
6
|
+
css?: CSS;
|
|
7
|
+
};
|
|
5
8
|
export type RecursionPath<T, Prefix extends string = ""> = Exclude<{
|
|
6
9
|
[K in keyof T & (string | number)]: T[K] extends object ? `${Prefix}${K}` | RecursionPath<T[K], `${Prefix}${K}.`> : `${Prefix}${K}`;
|
|
7
10
|
}[keyof T & (string | number)], "primary" | "secondary">;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "../theme/radius.mjs";
|
|
2
2
|
import s from "../theme/spacing.mjs";
|
|
3
3
|
function Q({
|
|
4
|
-
display:
|
|
4
|
+
display: g,
|
|
5
5
|
flex: t,
|
|
6
6
|
flexBasis: n,
|
|
7
7
|
flexDirection: c,
|
|
@@ -11,30 +11,30 @@ function Q({
|
|
|
11
11
|
flexWrap: e,
|
|
12
12
|
justifyContent: b,
|
|
13
13
|
alignItems: d,
|
|
14
|
-
m:
|
|
15
|
-
mt:
|
|
14
|
+
m: o,
|
|
15
|
+
mt: R,
|
|
16
16
|
mr: u,
|
|
17
17
|
mb: p,
|
|
18
18
|
ml: h,
|
|
19
|
-
p:
|
|
20
|
-
pt:
|
|
21
|
-
pr:
|
|
19
|
+
p: m,
|
|
20
|
+
pt: L,
|
|
21
|
+
pr: T,
|
|
22
22
|
pb: r,
|
|
23
|
-
pl:
|
|
24
|
-
border:
|
|
25
|
-
borderTop:
|
|
26
|
-
borderBottom:
|
|
27
|
-
borderRight:
|
|
28
|
-
borderLeft:
|
|
29
|
-
br:
|
|
30
|
-
brtl:
|
|
23
|
+
pl: B,
|
|
24
|
+
border: P,
|
|
25
|
+
borderTop: U,
|
|
26
|
+
borderBottom: q,
|
|
27
|
+
borderRight: v,
|
|
28
|
+
borderLeft: y,
|
|
29
|
+
br: z,
|
|
30
|
+
brtl: A,
|
|
31
31
|
brtr: E,
|
|
32
32
|
brml: H,
|
|
33
33
|
brmr: J,
|
|
34
34
|
gap: K
|
|
35
35
|
}) {
|
|
36
36
|
const i = {};
|
|
37
|
-
return
|
|
37
|
+
return g && Object.assign(i, { display: g }), t && Object.assign(i, { flex: t }), n && Object.assign(i, { flexBasis: n }), c && Object.assign(i, { flexDirection: c }), O && Object.assign(i, { flexFlow: O }), f && Object.assign(i, { flexGrow: f }), j && Object.assign(i, { flexShrink: j }), e && Object.assign(i, { flexWrap: e }), b && Object.assign(i, { justifyContent: b }), d && Object.assign(i, { alignItems: d }), o && Object.assign(i, { margin: s[o] }), R && Object.assign(i, { marginTop: s[R] }), p && Object.assign(i, { marginRight: s[p] }), h && Object.assign(i, { marginLeft: s[h] }), u && Object.assign(i, { marginRight: s[u] }), m && Object.assign(i, { padding: s[m] }), L && Object.assign(i, { paddingTop: s[L] }), r && Object.assign(i, { paddingBottom: s[r] }), B && Object.assign(i, { paddingLeft: s[B] }), T && Object.assign(i, { paddingRight: s[T] }), K && Object.assign(i, { gap: s[K] }), P && Object.assign(i, { border: P }), U && Object.assign(i, { borderTop: U }), q && Object.assign(i, { borderBottom: q }), v && Object.assign(i, { borderRight: v }), y && Object.assign(i, { borderLeft: y }), z && Object.assign(i, { borderRadius: a[z] }), A && Object.assign(i, { borderTopLeftRadius: a[A] }), E && Object.assign(i, { borderTopRightRadius: a[E] }), H && Object.assign(i, { borderBottomLeftRadius: a[H] }), J && Object.assign(i, { borderBottomRightRadius: a[J] }), i;
|
|
38
38
|
}
|
|
39
39
|
export {
|
|
40
40
|
Q as default
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shiflo/ui",
|
|
3
3
|
"description": "Shiflo React UI Components",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"vite-plugin-svgr": "^4.3.0"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"basic-styled": ">=0.1.
|
|
88
|
+
"basic-styled": ">=0.1.10",
|
|
89
89
|
"react": "^19.0.0",
|
|
90
90
|
"react-dom": "^19.0.0"
|
|
91
91
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/dist/typings/utility.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|