@shiflo/ui 0.1.3 → 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.
@@ -56,7 +56,7 @@ function z({
56
56
  dragThreshold: h = 100,
57
57
  ...y
58
58
  }) {
59
- const [b, s] = R(!1), l = a(null), x = a(null), $ = a(null);
59
+ const [b, s] = R(!1), l = a(null), $ = a(null), x = a(null);
60
60
  S(f, () => l.current);
61
61
  const v = (e) => {
62
62
  e.stopPropagation(), typeof c == "function" && c(e);
@@ -74,7 +74,7 @@ function z({
74
74
  }, [t]), /* @__PURE__ */ o(
75
75
  I,
76
76
  {
77
- ref: x,
77
+ ref: $,
78
78
  open: t,
79
79
  onClose: r,
80
80
  transitionDuration: i,
@@ -95,7 +95,6 @@ function z({
95
95
  animate: {
96
96
  y: b ? 0 : "200%"
97
97
  },
98
- exit: { y: "200%" },
99
98
  transition: {
100
99
  type: "spring",
101
100
  duration: i,
@@ -104,7 +103,7 @@ function z({
104
103
  style: g,
105
104
  ...y,
106
105
  children: [
107
- !p && /* @__PURE__ */ o(A, { ref: $, children: /* @__PURE__ */ o(F, {}) }),
106
+ !p && /* @__PURE__ */ o(A, { ref: x, children: /* @__PURE__ */ o(F, {}) }),
108
107
  m
109
108
  ]
110
109
  }
@@ -1,21 +1,21 @@
1
- import { jsxs as k, jsx as m } from "@emotion/react/jsx-runtime";
2
- import { useState as f, useEffect as j } from "react";
1
+ import { jsxs as O, jsx as f } from "@emotion/react/jsx-runtime";
2
+ import { useState as b, useEffect as j } from "react";
3
3
  import { createPortal as v } from "react-dom";
4
4
  import { useTheme as x } from "@emotion/react";
5
- import r from "@emotion/styled";
6
- import { motion as n } from "motion/react";
7
- const C = r(n.div)`
5
+ import n from "@emotion/styled";
6
+ import { motion as a } from "motion/react";
7
+ const C = n(a.div)`
8
8
  position: fixed;
9
9
  top: 0;
10
10
  left: 0;
11
11
  z-index: 1;
12
- `, A = r(n.div)`
12
+ `, A = n(a.div)`
13
13
  position: fixed;
14
14
  top: 0;
15
15
  left: 0;
16
16
  width: 100%;
17
17
  height: 100%;
18
- `, w = r(n.div)`
18
+ `, w = n(a.div)`
19
19
  position: fixed;
20
20
  width: 100%;
21
21
  display: flex;
@@ -91,49 +91,53 @@ const C = r(n.div)`
91
91
  function P({
92
92
  children: o,
93
93
  open: t,
94
- onClose: p,
95
- transitionDuration: a = 0.2,
96
- placement: b,
94
+ onClose: d,
95
+ transitionDuration: s = 0.2,
96
+ placement: p,
97
97
  ref: I,
98
- onClick: d,
99
- hideOverlay: s,
100
- ...g
98
+ onClick: g,
99
+ hideOverlay: r,
100
+ ...i
101
101
  }) {
102
102
  const {
103
- palette: { common: i }
104
- } = x(), [u, c] = f(!0), [h, l] = f(!1), y = (e) => {
105
- p?.(), d?.(e);
106
- }, O = () => {
107
- t || c(!0);
103
+ palette: { common: c }
104
+ } = x(), [u, l] = b(!0), [y, m] = b(!1), h = (e) => {
105
+ d?.(), g?.(e);
106
+ }, k = () => {
107
+ t || l(!0);
108
108
  };
109
109
  return j(() => {
110
110
  let e;
111
- return t ? (c(!1), e = requestAnimationFrame(() => {
112
- l(!0);
113
- })) : l(!1), () => {
111
+ return t ? (l(!1), e = requestAnimationFrame(() => {
112
+ m(!0);
113
+ })) : m(!1), () => {
114
114
  e && cancelAnimationFrame(e);
115
115
  };
116
- }, [t, a]), u ? null : v(
117
- /* @__PURE__ */ k(C, { children: [
118
- /* @__PURE__ */ m(
116
+ }, [t, s]), u ? null : v(
117
+ /* @__PURE__ */ O(C, { children: [
118
+ /* @__PURE__ */ f(
119
119
  A,
120
120
  {
121
- initial: { opacity: 0, backgroundColor: s ? "rgba(0, 0, 0, 0)" : i.overlay },
121
+ initial: { opacity: 0, backgroundColor: r ? "rgba(0, 0, 0, 0)" : c.overlay },
122
122
  animate: {
123
- opacity: h ? 1 : 0,
124
- backgroundColor: s ? "rgba(0, 0, 0, 0)" : i.overlay
123
+ opacity: y ? 1 : 0,
124
+ backgroundColor: r ? "rgba(0, 0, 0, 0)" : c.overlay
125
125
  },
126
126
  transition: {
127
127
  type: "spring",
128
- duration: a,
128
+ duration: s,
129
129
  bounce: 0.2
130
130
  },
131
- onAnimationComplete: O,
132
- onClick: y,
133
- ...g
131
+ onAnimationComplete: k,
132
+ onClick: h,
133
+ ...i,
134
+ style: {
135
+ pointerEvents: r ? "none" : void 0,
136
+ ...i.style
137
+ }
134
138
  }
135
139
  ),
136
- /* @__PURE__ */ m(w, { placement: b, children: o })
140
+ /* @__PURE__ */ f(w, { placement: p, children: o })
137
141
  ] }),
138
142
  document.body
139
143
  );
@@ -78,7 +78,7 @@ const C = {
78
78
  common: {
79
79
  background: "#22252A",
80
80
  surface: "#30333A",
81
- overlay: "rgba(0, 0, 0, 0.7)"
81
+ overlay: "rgba(0, 0, 0, 0.3)"
82
82
  },
83
83
  text: {
84
84
  primary: "#EAECEF",
@@ -78,7 +78,7 @@ const e = {
78
78
  common: {
79
79
  background: "#FFFFFF",
80
80
  surface: "#FFFFFF",
81
- overlay: "rgba(0, 0, 0, 0.5)"
81
+ overlay: "rgba(0, 0, 0, 0.3)"
82
82
  },
83
83
  text: {
84
84
  primary: "#212529",
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.3",
4
+ "version": "0.1.4",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"