@shiflo/ui 0.1.5 → 0.1.7

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.
@@ -10,7 +10,7 @@ const O = n(I.div)`
10
10
  overflow-y: auto;
11
11
  margin: ${({ theme: { spacing: t } }) => t[400]};
12
12
  margin-bottom: ${({ theme: { spacing: t } }) => `calc(${t[400]} + var(--safe-area-inset-bottom, 0px))`};
13
- border-radius: ${({ theme: { radius: t } }) => t[150]};
13
+ border-radius: ${({ theme: { radius: t } }) => t[350]};
14
14
  background-color: ${({
15
15
  theme: {
16
16
  palette: { common: t }
@@ -10,7 +10,7 @@ const y = u(h.div)`
10
10
  overflow-y: auto;
11
11
  margin: ${({ theme: { spacing: e } }) => e[400]};
12
12
  margin-bottom: ${({ theme: { spacing: e } }) => `calc(${e[400]} + var(--safe-area-inset-bottom, 0px))`};
13
- border-radius: ${({ theme: { radius: e } }) => e[150]};
13
+ border-radius: ${({ theme: { radius: e } }) => e[350]};
14
14
  background-color: ${({
15
15
  theme: {
16
16
  palette: { common: e }
@@ -6,7 +6,7 @@ import { motion as k } from "motion/react";
6
6
  const A = n(k.div)`
7
7
  position: fixed;
8
8
  left: 50%;
9
- bottom: ${({ theme: { spacing: e } }) => `calc(${e[800]} + var(--safe-area-inset-bottom, 0px))`};
9
+ bottom: ${({ theme: { spacing: e }, bottom: t }) => `calc(${t || e[800]} + var(--safe-area-inset-bottom, 0px))`};
10
10
  display: flex;
11
11
  align-items: center;
12
12
  gap: ${({ theme: { spacing: e } }) => e[400]};
@@ -9,4 +9,5 @@ export interface SnackbarProps extends PropsWithChildren<HTMLMotionProps<"div">>
9
9
  maxWidth?: string;
10
10
  autoHideDuration?: number;
11
11
  disableAutoHide?: boolean;
12
+ bottom?: string;
12
13
  }
@@ -1,74 +1,35 @@
1
- import { jsx as l } from "@emotion/react/jsx-runtime";
2
- import g from "@emotion/styled";
3
- import { motion as b } from "motion/react";
4
- const k = g(b.span)`
1
+ import { jsx as n } from "@emotion/react/jsx-runtime";
2
+ import a from "@emotion/styled";
3
+ import { motion as m } from "motion/react";
4
+ import o from "../../utils/getValueByPath.mjs";
5
+ const s = a(m.span)`
5
6
  transition: all 0.3s;
6
7
  cursor: default;
7
8
 
8
- padding: ${({ theme: { spacing: r } }) => r[100]};
9
- border-radius: ${({ theme: { radius: r } }) => r[200]};
9
+ padding: ${({ theme: { spacing: t } }) => t[100]};
10
+ border-radius: ${({ theme: { radius: t } }) => t[200]};
10
11
 
11
- ${({
12
- theme: {
13
- mode: r,
14
- palette: {
15
- primary: e,
16
- secondary: o,
17
- text: i,
18
- feedback: { warning: n, error: t, info: s, success: c }
19
- }
20
- },
21
- color: m
22
- }) => {
23
- const a = {};
24
- switch (m) {
25
- case "warning":
26
- Object.assign(a, {
27
- backgroundColor: n.main,
28
- color: r === "dark" ? o.main : i.primary
29
- });
30
- break;
31
- case "error":
32
- Object.assign(a, {
33
- backgroundColor: t.main,
34
- color: r === "dark" ? o.main : i.primary
35
- });
36
- break;
37
- case "info":
38
- Object.assign(a, {
39
- backgroundColor: s.main,
40
- color: r === "dark" ? o.main : i.primary
41
- });
42
- break;
43
- case "success":
44
- Object.assign(a, {
45
- backgroundColor: c.main,
46
- color: r === "dark" ? o.main : i.primary
47
- });
48
- break;
49
- default:
50
- Object.assign(a, {
51
- backgroundColor: e.main,
52
- color: o.main
53
- });
54
- break;
55
- }
56
- return a;
12
+ ${({ theme: { palette: t }, color: r, textColor: i }) => {
13
+ const e = {};
14
+ return Object.assign(e, {
15
+ backgroundColor: o(t, r) || "inherit",
16
+ color: o(t, i) || "inherit"
17
+ }), e;
57
18
  }}
58
19
 
59
20
  ${({
60
21
  theme: {
61
- typography: { small2: r }
22
+ typography: { small2: t }
62
23
  }
63
24
  }) => ({
64
- fontSize: r.fontSize,
25
+ fontSize: t.fontSize,
65
26
  fontWeight: 700,
66
- lineHeight: r.lineHeight
27
+ lineHeight: t.lineHeight
67
28
  })};
68
29
  `;
69
- function f(r) {
70
- return /* @__PURE__ */ l(k, { ...r });
30
+ function l(t) {
31
+ return /* @__PURE__ */ n(s, { ...t });
71
32
  }
72
33
  export {
73
- f as default
34
+ l as default
74
35
  };
@@ -1,5 +1,7 @@
1
- import { UtilityProps } from '../../typings/utility';
1
+ import { ShifloTheme } from '../../theme/typing';
2
+ import { RecursionPath, UtilityProps } from '../../typings/utility';
2
3
  import { HTMLMotionProps } from 'motion/react';
3
4
  export interface TagProps extends HTMLMotionProps<"span">, Pick<UtilityProps, "css"> {
4
- color?: "primary" | "warning" | "error" | "info" | "success";
5
+ color?: RecursionPath<ShifloTheme["palette"]> | "inherit";
6
+ textColor?: RecursionPath<ShifloTheme["palette"]> | "inherit";
5
7
  }
@@ -1,3 +1,3 @@
1
1
  import { TextFieldProps } from './TextField.typing';
2
- declare function TextField({ variant, size, fullWidth, disabled, startIcon, endIcon, onFocus, onBlur, ...props }: TextFieldProps): import("@emotion/react/jsx-runtime").JSX.Element;
2
+ declare function TextField({ variant, size, fullWidth, disabled, startIcon, endIcon, onFocus, onBlur, css, ...props }: TextFieldProps): import("@emotion/react/jsx-runtime").JSX.Element;
3
3
  export default TextField;
@@ -1,8 +1,8 @@
1
- import { jsxs as m, jsx as a } from "@emotion/react/jsx-runtime";
2
- import { useState as p } from "react";
1
+ import { jsxs as p, jsx as a } from "@emotion/react/jsx-runtime";
2
+ import { useState as b } from "react";
3
3
  import l from "@emotion/styled";
4
4
  import { motion as c } from "motion/react";
5
- const b = l(c.div)`
5
+ const w = l(c.div)`
6
6
  display: flex;
7
7
  align-items: center;
8
8
  gap: ${({ theme: { spacing: e } }) => e[200]};
@@ -119,7 +119,7 @@ const b = l(c.div)`
119
119
  color: e[500],
120
120
  cursor: "not-allowed"
121
121
  } : {}};
122
- `, w = l(c.input)`
122
+ `, S = l(c.input)`
123
123
  flex-grow: 1;
124
124
  border: none;
125
125
  outline: none;
@@ -136,18 +136,18 @@ const b = l(c.div)`
136
136
  &:disabled {
137
137
  cursor: not-allowed;
138
138
  }
139
- `, S = l.div`
139
+ `, $ = l.div`
140
140
  display: flex;
141
141
  align-items: center;
142
142
  justify-content: center;
143
143
  white-space: nowrap;
144
- `, $ = l.div`
144
+ `, x = l.div`
145
145
  display: flex;
146
146
  align-items: center;
147
147
  justify-content: center;
148
148
  white-space: nowrap;
149
149
  `;
150
- function H({
150
+ function O({
151
151
  variant: e = "outlined",
152
152
  size: n = "medium",
153
153
  fullWidth: o,
@@ -156,29 +156,31 @@ function H({
156
156
  endIcon: i,
157
157
  onFocus: h,
158
158
  onBlur: u,
159
- ...f
159
+ css: f,
160
+ ...g
160
161
  }) {
161
- const [g, d] = p(!1);
162
- return /* @__PURE__ */ m(
163
- b,
162
+ const [m, d] = b(!1);
163
+ return /* @__PURE__ */ p(
164
+ w,
164
165
  {
165
166
  variant: e,
166
167
  size: n,
167
- focused: g,
168
+ focused: m,
168
169
  fullWidth: o,
169
170
  disabled: t,
171
+ css: f,
170
172
  children: [
171
- r && /* @__PURE__ */ a(S, { children: r }),
172
- /* @__PURE__ */ a(w, { ...f, onFocus: (s) => {
173
+ r && /* @__PURE__ */ a($, { children: r }),
174
+ /* @__PURE__ */ a(S, { ...g, onFocus: (s) => {
173
175
  d(!0), h?.(s);
174
176
  }, onBlur: (s) => {
175
177
  d(!1), u?.(s);
176
178
  }, disabled: t }),
177
- i && /* @__PURE__ */ a($, { children: i })
179
+ i && /* @__PURE__ */ a(x, { children: i })
178
180
  ]
179
181
  }
180
182
  );
181
183
  }
182
184
  export {
183
- H as default
185
+ O as default
184
186
  };
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
+ import { UtilityProps } from '../../typings/utility';
2
3
  import { HTMLMotionProps } from 'motion/react';
3
- export interface TextFieldProps extends Omit<HTMLMotionProps<"input">, "size"> {
4
+ export interface TextFieldProps extends Omit<HTMLMotionProps<"input">, "size">, Pick<UtilityProps, "css"> {
4
5
  variant?: "contained" | "outlined";
5
6
  startIcon?: ReactNode;
6
7
  endIcon?: ReactNode;
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.1.5",
4
+ "version": "0.1.7",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -51,14 +51,14 @@
51
51
  "prepublishOnly": "pnpm build"
52
52
  },
53
53
  "devDependencies": {
54
- "@chromatic-com/storybook": "^4.1.1",
54
+ "@chromatic-com/storybook": "^4.1.2",
55
55
  "@emotion/react": "^11.14.0",
56
56
  "@emotion/serialize": "^1.3.3",
57
57
  "@emotion/styled": "^11.14.1",
58
58
  "@eslint/js": "^9.22.0",
59
- "@storybook/addon-docs": "^9.1.7",
60
- "@storybook/addon-onboarding": "^9.1.7",
61
- "@storybook/react-vite": "^9.1.7",
59
+ "@storybook/addon-docs": "^10.0.2",
60
+ "@storybook/addon-onboarding": "^10.0.2",
61
+ "@storybook/react-vite": "^10.0.2",
62
62
  "@types/node": "^24.5.2",
63
63
  "@types/react": "^19.1.13",
64
64
  "@types/react-dom": "^19.1.9",
@@ -71,14 +71,14 @@
71
71
  "eslint-plugin-prettier": "^5.5.4",
72
72
  "eslint-plugin-react": "^7.37.5",
73
73
  "eslint-plugin-react-hooks": "^5.2.0",
74
- "eslint-plugin-storybook": "^9.1.7",
74
+ "eslint-plugin-storybook": "^10.0.2",
75
75
  "glob": "^11.0.1",
76
76
  "globals": "^16.0.0",
77
77
  "husky": "^9.1.7",
78
78
  "lint-staged": "^15.4.3",
79
79
  "motion": "^12.23.12",
80
80
  "prettier": "^3.5.3",
81
- "storybook": "^9.1.7",
81
+ "storybook": "^10.0.2",
82
82
  "typescript": "^5.7.3",
83
83
  "typescript-eslint": "^8.26.0",
84
84
  "vite": "^7.1.6",