rechtspilot-ui 1.2.0 → 1.2.2
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/chunks-native.cjs +1 -6
- package/dist/chunks-native.js +313 -488
- package/dist/chunks.cjs +1 -6
- package/dist/chunks.js +768 -885
- package/dist/icons.cjs +1 -1
- package/dist/icons.d.ts +2 -0
- package/dist/icons.es.js +2 -4
- package/dist/icons.native.es.js +2 -4
- package/dist/index.cjs +148 -72
- package/dist/index.d.ts +26 -1
- package/dist/index.es.js +2222 -2074
- package/dist/index.native.cjs +5 -5
- package/dist/index.native.es.js +153 -143
- package/package.json +1 -1
package/dist/index.native.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./chunks-native.cjs`);let t=require(`react`);t=e.
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./chunks-native.cjs`);let t=require(`react`);t=e.z(t,1);let n=require(`react-native`),r=require(`react/jsx-runtime`),i=require(`styled-components`);var a=({size:i=20,color:a=e.L.primary[600],style:o})=>{let s=t.default.useRef(new n.Animated.Value(0)).current;t.default.useEffect(()=>{let e=()=>{s.setValue(0),n.Animated.timing(s,{toValue:1,duration:1e3,easing:n.Easing.linear,useNativeDriver:!0}).start(()=>e())};e()},[s]);let c=s.interpolate({inputRange:[0,1],outputRange:[`0deg`,`360deg`]});return(0,r.jsx)(n.View,{style:[{width:i,height:i},o],children:(0,r.jsx)(n.Animated.View,{style:{width:i,height:i,borderRadius:i/2,borderWidth:2,borderColor:`transparent`,borderTopColor:a,transform:[{rotate:c}]}})})},o=t=>{let n={alignItems:`center`,borderRadius:12,borderWidth:1,flexDirection:`row`,height:48,justifyContent:`center`,paddingHorizontal:16},r={fontSize:15,fontWeight:`500`,textAlign:`center`};switch(t){case`primary`:return{container:{...n,backgroundColor:e.L.primary[500],borderColor:e.L.neutral[`800-A16`]},text:{...r,color:e.L.primary[900]}};case`secondary`:return{container:{...n,backgroundColor:e.L.primary[900],borderColor:e.L.neutral[`800-A16`]},text:{...r,color:e.L.white}};case`tertiary`:return{container:{...n,backgroundColor:e.L.neutral[`800-A04`],borderColor:e.L.neutral[`800-A08`]},text:{...r,color:e.L.primary[900]}};case`destructive`:return{container:{...n,backgroundColor:e.L.fg.accent.error,borderColor:e.L.fg.accent.error},text:{...r,color:e.L.white}};case`destructiveSubtle`:return{container:{...n,backgroundColor:e.L.cream,borderColor:e.L.palePeach},text:{...r,color:e.L.fg.accent.error}}}};function s({variant:t=`primary`,fullWidth:i=!1,children:s,loading:c=!1,disabled:l=!1,onPress:u,...d}){let f=o(t);return(0,r.jsxs)(n.TouchableOpacity,{style:n.StyleSheet.flatten([f.container,i&&{width:`100%`},(l||c)&&{opacity:.4}]),onPress:u,disabled:l||c,activeOpacity:.7,...d,children:[typeof s==`string`?(0,r.jsx)(n.Text,{style:f.text,children:s}):s,c&&(0,r.jsx)(a,{size:16,color:t===`secondary`?e.L.primary[600]:t===`destructiveSubtle`?e.L.fg.accent.error:e.L.white})]})}var c=n.StyleSheet.create({container:{marginBottom:8},fieldContainer:{height:49,paddingHorizontal:12,borderRadius:12,flexDirection:`row`,alignItems:`center`,backgroundColor:e.L.bg.secondary,borderWidth:2,borderColor:e.L.bg.tertiary},fieldContainerError:{borderColor:e.L.fg.accent.error},fieldContainerFocused:{borderColor:e.L.fg.base},fieldContainerFocusedError:{borderColor:e.L.fg.accent.error},formGroup:{position:`relative`,paddingVertical:14,width:`100%`,height:`100%`,justifyContent:`center`},input:{width:`100%`,paddingTop:4,backgroundColor:`transparent`,fontSize:15,fontWeight:`500`,color:e.L.primary[900],paddingBottom:0},label:{position:`absolute`,left:0,fontSize:15,fontWeight:`500`,color:e.L.fg.tertiary},labelFloating:{top:2,fontSize:12,color:e.L.fg.secondary},labelNormal:{top:`50%`,transform:[{translateY:-7.5}]},helper:{marginTop:4,fontSize:12,paddingHorizontal:4},helperError:{color:e.L.fg.accent.error},helperNormal:{color:e.L.fg.secondary}});function l({label:i,value:a=``,onChange:o,error:s,helperText:l,placeholder:u,secureTextEntry:d=!1,keyboardType:f=`default`,autoCapitalize:p=`sentences`,editable:m=!0,multiline:h=!1,numberOfLines:g=1,..._}){let[v,y]=(0,t.useState)(!1),b=a.length>0,x=v||b,S=[c.fieldContainer,s&&c.fieldContainerError,v&&!s&&c.fieldContainerFocused,v&&s&&c.fieldContainerFocusedError],C=[c.label,x?c.labelFloating:c.labelNormal],w=n.StyleSheet.flatten([c.input,h&&{height:g*20,textAlignVertical:`top`}]);return(0,r.jsxs)(n.View,{style:c.container,children:[(0,r.jsx)(n.View,{style:S,children:(0,r.jsxs)(n.View,{style:c.formGroup,children:[(0,r.jsx)(n.TextInput,{style:w,value:a,onChangeText:o,onFocus:()=>y(!0),onBlur:()=>y(!1),placeholder:x?u:``,placeholderTextColor:e.L.fg.tertiary,secureTextEntry:d,keyboardType:f,autoCapitalize:p,editable:m,multiline:h,numberOfLines:g,..._}),(0,r.jsx)(n.Text,{style:C,children:i})]})}),(s||l)&&(0,r.jsx)(n.Text,{style:[c.helper,s?c.helperError:c.helperNormal],children:s||l})]})}var u=i.styled.div`
|
|
2
2
|
margin: 0 auto;
|
|
3
3
|
vertical-align: middle;
|
|
4
4
|
position: relative;
|
|
@@ -45,7 +45,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
45
45
|
transform: translate(-50%, -50%) scale(0);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
`;function d({size:t=`4rem`,color:n=e.
|
|
48
|
+
`;function d({size:t=`4rem`,color:n=e.L.fg.primary}){return(0,r.jsx)(u,{$size:t,$color:n})}var f=i.styled.svg`
|
|
49
49
|
animation: spin 1s linear infinite;
|
|
50
50
|
|
|
51
51
|
@keyframes spin {
|
|
@@ -57,9 +57,9 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
57
57
|
transform: rotate(360deg);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
`;function p({variant:t=`primary`,dark:n}){return(0,
|
|
60
|
+
`;function p({variant:t=`primary`,dark:n}){return(0,r.jsxs)(f,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,r.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8`,stroke:n?e.L.neutral[`0-A8`]:e.L.neutral[`800-A8`],strokeOpacity:`0.08`,strokeWidth:`3`}),(0,r.jsx)(`path`,{d:`M12 4C16.4183 4 20 7.58172 20 12C20 14.1304 19.1672 16.0663 17.8095 17.5`,stroke:(()=>{switch(t){case`secondary`:return e.L.fg.secondary;case`error`:return e.L.fg.accent.error;default:return n?e.L.white:e.L.fg.primary}})(),strokeWidth:`3`,strokeLinecap:`round`})]})}var m=i.styled.div`
|
|
61
61
|
height: 0.063rem;
|
|
62
62
|
width: 100%;
|
|
63
|
-
background-color: ${e.
|
|
63
|
+
background-color: ${e.L.border.default};
|
|
64
64
|
margin: 0.75rem 0;
|
|
65
|
-
`;function h({...e}){return(0,
|
|
65
|
+
`;function h({...e}){return(0,r.jsx)(m,{...e})}var g=()=>{let[e,n]=(0,t.useState)(window.innerWidth<=768),r=(0,t.useRef)(window.innerWidth);return(0,t.useEffect)(()=>{let e=()=>{let e=window.innerWidth;e<=768&&r.current>768?n(!0):e>768&&r.current<=768&&n(!1),r.current=e};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e},_=1,v=1e6,y=0;function b(){return y=(y+1)%(2**53-1),y.toString()}var x=new Map,S=e=>{if(x.has(e))return;let t=setTimeout(()=>{x.delete(e),E({type:`REMOVE_TOAST`,toastId:e})},v);x.set(e,t)},C=(e,t)=>{switch(t.type){case`ADD_TOAST`:return{...e,toasts:[t.toast,...e.toasts].slice(0,_)};case`UPDATE_TOAST`:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case`DISMISS_TOAST`:{let{toastId:n}=t;return n?S(n):e.toasts.forEach(e=>{S(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===n||n===void 0?{...e,open:!1}:e)}}case`REMOVE_TOAST`:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},w=[],T={toasts:[]};function E(e){T=C(T,e),w.forEach(e=>{e(T)})}function D({...e}){let t=b(),n=e=>E({type:`UPDATE_TOAST`,toast:{...e,id:t}}),r=()=>E({type:`DISMISS_TOAST`,toastId:t});return E({type:`ADD_TOAST`,toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:n}}function O(){let[e,n]=t.useState(T);return t.useEffect(()=>(w.push(n),()=>{let e=w.indexOf(n);e>-1&&w.splice(e,1)}),[e]),{...e,toast:D,dismiss:e=>E({type:`DISMISS_TOAST`,toastId:e})}}exports.Button=s,exports.Divider=h,exports.Input=l,exports.Loading=d,exports.Spinner=p,exports.colors=e.L,Object.defineProperty(exports,`icons`,{enumerable:!0,get:function(){return e.t}}),exports.typography=e.R,exports.useIsMobile=g,exports.useToast=O;
|
package/dist/index.native.es.js
CHANGED
|
@@ -1,45 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { Animated as u, Easing as d, StyleSheet as f, Text as p, TextInput as m, TouchableOpacity as h, View as g } from "react-native";
|
|
1
|
+
import { L as e, R as t, t as n } from "./chunks-native.js";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import i, { useEffect as a, useRef as o, useState as s } from "react";
|
|
4
|
+
import { Animated as c, Easing as l, StyleSheet as u, Text as d, TextInput as f, TouchableOpacity as p, View as m } from "react-native";
|
|
5
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
7
6
|
import { styled as _ } from "styled-components";
|
|
8
7
|
//#region src/components/Spinner/Spinner.native.tsx
|
|
9
|
-
var v =
|
|
10
|
-
let
|
|
11
|
-
|
|
8
|
+
var v = ({ size: t = 20, color: n = e.primary[600], style: r }) => {
|
|
9
|
+
let a = i.useRef(new c.Value(0)).current;
|
|
10
|
+
i.useEffect(() => {
|
|
12
11
|
let e = () => {
|
|
13
|
-
|
|
12
|
+
a.setValue(0), c.timing(a, {
|
|
14
13
|
toValue: 1,
|
|
15
14
|
duration: 1e3,
|
|
16
|
-
easing:
|
|
15
|
+
easing: l.linear,
|
|
17
16
|
useNativeDriver: !0
|
|
18
17
|
}).start(() => e());
|
|
19
18
|
};
|
|
20
19
|
e();
|
|
21
|
-
}, [
|
|
22
|
-
let
|
|
20
|
+
}, [a]);
|
|
21
|
+
let o = a.interpolate({
|
|
23
22
|
inputRange: [0, 1],
|
|
24
23
|
outputRange: ["0deg", "360deg"]
|
|
25
24
|
});
|
|
26
|
-
return /* @__PURE__ */ (
|
|
25
|
+
return /* @__PURE__ */ h(m, {
|
|
27
26
|
style: [{
|
|
28
|
-
width:
|
|
29
|
-
height:
|
|
27
|
+
width: t,
|
|
28
|
+
height: t
|
|
30
29
|
}, r],
|
|
31
|
-
children: /* @__PURE__ */ (
|
|
32
|
-
width:
|
|
33
|
-
height:
|
|
34
|
-
borderRadius:
|
|
30
|
+
children: /* @__PURE__ */ h(c.View, { style: {
|
|
31
|
+
width: t,
|
|
32
|
+
height: t,
|
|
33
|
+
borderRadius: t / 2,
|
|
35
34
|
borderWidth: 2,
|
|
36
35
|
borderColor: "transparent",
|
|
37
|
-
borderTopColor:
|
|
38
|
-
transform: [{ rotate:
|
|
36
|
+
borderTopColor: n,
|
|
37
|
+
transform: [{ rotate: o }]
|
|
39
38
|
} })
|
|
40
39
|
});
|
|
41
|
-
},
|
|
42
|
-
let
|
|
40
|
+
}, y = (t) => {
|
|
41
|
+
let n = {
|
|
43
42
|
alignItems: "center",
|
|
44
43
|
borderRadius: 12,
|
|
45
44
|
borderWidth: 1,
|
|
@@ -52,77 +51,88 @@ var v = t(), y = ({ size: e = 20, color: t = n.primary[600], style: r }) => {
|
|
|
52
51
|
fontWeight: "500",
|
|
53
52
|
textAlign: "center"
|
|
54
53
|
};
|
|
55
|
-
switch (
|
|
54
|
+
switch (t) {
|
|
56
55
|
case "primary": return {
|
|
57
56
|
container: {
|
|
58
|
-
...
|
|
59
|
-
backgroundColor:
|
|
60
|
-
borderColor:
|
|
57
|
+
...n,
|
|
58
|
+
backgroundColor: e.primary[500],
|
|
59
|
+
borderColor: e.neutral["800-A16"]
|
|
61
60
|
},
|
|
62
61
|
text: {
|
|
63
62
|
...r,
|
|
64
|
-
color:
|
|
63
|
+
color: e.primary[900]
|
|
65
64
|
}
|
|
66
65
|
};
|
|
67
66
|
case "secondary": return {
|
|
68
67
|
container: {
|
|
69
|
-
...
|
|
70
|
-
backgroundColor:
|
|
71
|
-
borderColor:
|
|
68
|
+
...n,
|
|
69
|
+
backgroundColor: e.primary[900],
|
|
70
|
+
borderColor: e.neutral["800-A16"]
|
|
72
71
|
},
|
|
73
72
|
text: {
|
|
74
73
|
...r,
|
|
75
|
-
color:
|
|
74
|
+
color: e.white
|
|
76
75
|
}
|
|
77
76
|
};
|
|
78
77
|
case "tertiary": return {
|
|
79
78
|
container: {
|
|
80
|
-
...
|
|
81
|
-
backgroundColor:
|
|
82
|
-
borderColor:
|
|
79
|
+
...n,
|
|
80
|
+
backgroundColor: e.neutral["800-A04"],
|
|
81
|
+
borderColor: e.neutral["800-A08"]
|
|
83
82
|
},
|
|
84
83
|
text: {
|
|
85
84
|
...r,
|
|
86
|
-
color:
|
|
85
|
+
color: e.primary[900]
|
|
87
86
|
}
|
|
88
87
|
};
|
|
89
88
|
case "destructive": return {
|
|
90
89
|
container: {
|
|
91
|
-
...
|
|
92
|
-
backgroundColor:
|
|
93
|
-
borderColor:
|
|
90
|
+
...n,
|
|
91
|
+
backgroundColor: e.fg.accent.error,
|
|
92
|
+
borderColor: e.fg.accent.error
|
|
94
93
|
},
|
|
95
94
|
text: {
|
|
96
95
|
...r,
|
|
97
|
-
color:
|
|
96
|
+
color: e.white
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
case "destructiveSubtle": return {
|
|
100
|
+
container: {
|
|
101
|
+
...n,
|
|
102
|
+
backgroundColor: e.cream,
|
|
103
|
+
borderColor: e.palePeach
|
|
104
|
+
},
|
|
105
|
+
text: {
|
|
106
|
+
...r,
|
|
107
|
+
color: e.fg.accent.error
|
|
98
108
|
}
|
|
99
109
|
};
|
|
100
110
|
}
|
|
101
111
|
};
|
|
102
|
-
function
|
|
103
|
-
let c =
|
|
104
|
-
return /* @__PURE__ */ (
|
|
105
|
-
style:
|
|
112
|
+
function b({ variant: t = "primary", fullWidth: n = !1, children: r, loading: i = !1, disabled: a = !1, onPress: o, ...s }) {
|
|
113
|
+
let c = y(t);
|
|
114
|
+
return /* @__PURE__ */ g(p, {
|
|
115
|
+
style: u.flatten([
|
|
106
116
|
c.container,
|
|
107
|
-
|
|
117
|
+
n && { width: "100%" },
|
|
108
118
|
(a || i) && { opacity: .4 }
|
|
109
119
|
]),
|
|
110
120
|
onPress: o,
|
|
111
121
|
disabled: a || i,
|
|
112
122
|
activeOpacity: .7,
|
|
113
123
|
...s,
|
|
114
|
-
children: [typeof r == "string" ? /* @__PURE__ */ (
|
|
124
|
+
children: [typeof r == "string" ? /* @__PURE__ */ h(d, {
|
|
115
125
|
style: c.text,
|
|
116
126
|
children: r
|
|
117
|
-
}) : r, i && /* @__PURE__ */ (
|
|
127
|
+
}) : r, i && /* @__PURE__ */ h(v, {
|
|
118
128
|
size: 16,
|
|
119
|
-
color:
|
|
129
|
+
color: t === "secondary" ? e.primary[600] : t === "destructiveSubtle" ? e.fg.accent.error : e.white
|
|
120
130
|
})]
|
|
121
131
|
});
|
|
122
132
|
}
|
|
123
133
|
//#endregion
|
|
124
134
|
//#region src/components/Input/Input.native.tsx
|
|
125
|
-
var
|
|
135
|
+
var x = u.create({
|
|
126
136
|
container: { marginBottom: 8 },
|
|
127
137
|
fieldContainer: {
|
|
128
138
|
height: 49,
|
|
@@ -130,13 +140,13 @@ var S = f.create({
|
|
|
130
140
|
borderRadius: 12,
|
|
131
141
|
flexDirection: "row",
|
|
132
142
|
alignItems: "center",
|
|
133
|
-
backgroundColor:
|
|
143
|
+
backgroundColor: e.bg.secondary,
|
|
134
144
|
borderWidth: 2,
|
|
135
|
-
borderColor:
|
|
145
|
+
borderColor: e.bg.tertiary
|
|
136
146
|
},
|
|
137
|
-
fieldContainerError: { borderColor:
|
|
138
|
-
fieldContainerFocused: { borderColor:
|
|
139
|
-
fieldContainerFocusedError: { borderColor:
|
|
147
|
+
fieldContainerError: { borderColor: e.fg.accent.error },
|
|
148
|
+
fieldContainerFocused: { borderColor: e.fg.base },
|
|
149
|
+
fieldContainerFocusedError: { borderColor: e.fg.accent.error },
|
|
140
150
|
formGroup: {
|
|
141
151
|
position: "relative",
|
|
142
152
|
paddingVertical: 14,
|
|
@@ -150,7 +160,7 @@ var S = f.create({
|
|
|
150
160
|
backgroundColor: "transparent",
|
|
151
161
|
fontSize: 15,
|
|
152
162
|
fontWeight: "500",
|
|
153
|
-
color:
|
|
163
|
+
color: e.primary[900],
|
|
154
164
|
paddingBottom: 0
|
|
155
165
|
},
|
|
156
166
|
label: {
|
|
@@ -158,12 +168,12 @@ var S = f.create({
|
|
|
158
168
|
left: 0,
|
|
159
169
|
fontSize: 15,
|
|
160
170
|
fontWeight: "500",
|
|
161
|
-
color:
|
|
171
|
+
color: e.fg.tertiary
|
|
162
172
|
},
|
|
163
173
|
labelFloating: {
|
|
164
174
|
top: 2,
|
|
165
175
|
fontSize: 12,
|
|
166
|
-
color:
|
|
176
|
+
color: e.fg.secondary
|
|
167
177
|
},
|
|
168
178
|
labelNormal: {
|
|
169
179
|
top: "50%",
|
|
@@ -174,54 +184,54 @@ var S = f.create({
|
|
|
174
184
|
fontSize: 12,
|
|
175
185
|
paddingHorizontal: 4
|
|
176
186
|
},
|
|
177
|
-
helperError: { color:
|
|
178
|
-
helperNormal: { color:
|
|
187
|
+
helperError: { color: e.fg.accent.error },
|
|
188
|
+
helperNormal: { color: e.fg.secondary }
|
|
179
189
|
});
|
|
180
|
-
function
|
|
181
|
-
let [
|
|
182
|
-
|
|
183
|
-
i &&
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
],
|
|
187
|
-
height:
|
|
190
|
+
function S({ label: t, value: n = "", onChange: r, error: i, helperText: a, placeholder: o, secureTextEntry: c = !1, keyboardType: l = "default", autoCapitalize: p = "sentences", editable: _ = !0, multiline: v = !1, numberOfLines: y = 1, ...b }) {
|
|
191
|
+
let [S, C] = s(!1), w = n.length > 0, T = S || w, E = [
|
|
192
|
+
x.fieldContainer,
|
|
193
|
+
i && x.fieldContainerError,
|
|
194
|
+
S && !i && x.fieldContainerFocused,
|
|
195
|
+
S && i && x.fieldContainerFocusedError
|
|
196
|
+
], D = [x.label, T ? x.labelFloating : x.labelNormal], O = u.flatten([x.input, v && {
|
|
197
|
+
height: y * 20,
|
|
188
198
|
textAlignVertical: "top"
|
|
189
199
|
}]);
|
|
190
|
-
return /* @__PURE__ */ (
|
|
191
|
-
style:
|
|
192
|
-
children: [/* @__PURE__ */ (
|
|
193
|
-
style:
|
|
194
|
-
children: /* @__PURE__ */ (
|
|
195
|
-
style:
|
|
196
|
-
children: [/* @__PURE__ */ (
|
|
197
|
-
style:
|
|
198
|
-
value:
|
|
200
|
+
return /* @__PURE__ */ g(m, {
|
|
201
|
+
style: x.container,
|
|
202
|
+
children: [/* @__PURE__ */ h(m, {
|
|
203
|
+
style: E,
|
|
204
|
+
children: /* @__PURE__ */ g(m, {
|
|
205
|
+
style: x.formGroup,
|
|
206
|
+
children: [/* @__PURE__ */ h(f, {
|
|
207
|
+
style: O,
|
|
208
|
+
value: n,
|
|
199
209
|
onChangeText: r,
|
|
200
|
-
onFocus: () =>
|
|
201
|
-
onBlur: () =>
|
|
202
|
-
placeholder:
|
|
203
|
-
placeholderTextColor:
|
|
204
|
-
secureTextEntry:
|
|
205
|
-
keyboardType:
|
|
206
|
-
autoCapitalize:
|
|
207
|
-
editable:
|
|
208
|
-
multiline:
|
|
209
|
-
numberOfLines:
|
|
210
|
-
...
|
|
211
|
-
}), /* @__PURE__ */ (
|
|
212
|
-
style:
|
|
213
|
-
children:
|
|
210
|
+
onFocus: () => C(!0),
|
|
211
|
+
onBlur: () => C(!1),
|
|
212
|
+
placeholder: T ? o : "",
|
|
213
|
+
placeholderTextColor: e.fg.tertiary,
|
|
214
|
+
secureTextEntry: c,
|
|
215
|
+
keyboardType: l,
|
|
216
|
+
autoCapitalize: p,
|
|
217
|
+
editable: _,
|
|
218
|
+
multiline: v,
|
|
219
|
+
numberOfLines: y,
|
|
220
|
+
...b
|
|
221
|
+
}), /* @__PURE__ */ h(d, {
|
|
222
|
+
style: D,
|
|
223
|
+
children: t
|
|
214
224
|
})]
|
|
215
225
|
})
|
|
216
|
-
}), (i || a) && /* @__PURE__ */ (
|
|
217
|
-
style: [
|
|
226
|
+
}), (i || a) && /* @__PURE__ */ h(d, {
|
|
227
|
+
style: [x.helper, i ? x.helperError : x.helperNormal],
|
|
218
228
|
children: i || a
|
|
219
229
|
})]
|
|
220
230
|
});
|
|
221
231
|
}
|
|
222
232
|
//#endregion
|
|
223
233
|
//#region src/components/Loading/Loading.tsx
|
|
224
|
-
var
|
|
234
|
+
var C = _.div`
|
|
225
235
|
margin: 0 auto;
|
|
226
236
|
vertical-align: middle;
|
|
227
237
|
position: relative;
|
|
@@ -269,15 +279,15 @@ var w = _.div`
|
|
|
269
279
|
}
|
|
270
280
|
}
|
|
271
281
|
`;
|
|
272
|
-
function
|
|
273
|
-
return /* @__PURE__ */ (
|
|
274
|
-
$size:
|
|
275
|
-
$color:
|
|
282
|
+
function w({ size: t = "4rem", color: n = e.fg.primary }) {
|
|
283
|
+
return /* @__PURE__ */ h(C, {
|
|
284
|
+
$size: t,
|
|
285
|
+
$color: n
|
|
276
286
|
});
|
|
277
287
|
}
|
|
278
288
|
//#endregion
|
|
279
289
|
//#region src/components/Spinner/Spinner.tsx
|
|
280
|
-
var
|
|
290
|
+
var T = _.svg`
|
|
281
291
|
animation: spin 1s linear infinite;
|
|
282
292
|
|
|
283
293
|
@keyframes spin {
|
|
@@ -290,27 +300,27 @@ var E = _.svg`
|
|
|
290
300
|
}
|
|
291
301
|
}
|
|
292
302
|
`;
|
|
293
|
-
function
|
|
294
|
-
return /* @__PURE__ */ (
|
|
303
|
+
function E({ variant: t = "primary", dark: n }) {
|
|
304
|
+
return /* @__PURE__ */ g(T, {
|
|
295
305
|
width: "24",
|
|
296
306
|
height: "24",
|
|
297
307
|
viewBox: "0 0 24 24",
|
|
298
308
|
fill: "none",
|
|
299
309
|
xmlns: "http://www.w3.org/2000/svg",
|
|
300
|
-
children: [/* @__PURE__ */ (
|
|
310
|
+
children: [/* @__PURE__ */ h("circle", {
|
|
301
311
|
cx: "12",
|
|
302
312
|
cy: "12",
|
|
303
313
|
r: "8",
|
|
304
|
-
stroke:
|
|
314
|
+
stroke: n ? e.neutral["0-A8"] : e.neutral["800-A8"],
|
|
305
315
|
strokeOpacity: "0.08",
|
|
306
316
|
strokeWidth: "3"
|
|
307
|
-
}), /* @__PURE__ */ (
|
|
317
|
+
}), /* @__PURE__ */ h("path", {
|
|
308
318
|
d: "M12 4C16.4183 4 20 7.58172 20 12C20 14.1304 19.1672 16.0663 17.8095 17.5",
|
|
309
319
|
stroke: (() => {
|
|
310
|
-
switch (
|
|
311
|
-
case "secondary": return
|
|
312
|
-
case "error": return
|
|
313
|
-
default: return
|
|
320
|
+
switch (t) {
|
|
321
|
+
case "secondary": return e.fg.secondary;
|
|
322
|
+
case "error": return e.fg.accent.error;
|
|
323
|
+
default: return n ? e.white : e.fg.primary;
|
|
314
324
|
}
|
|
315
325
|
})(),
|
|
316
326
|
strokeWidth: "3",
|
|
@@ -320,44 +330,44 @@ function D({ variant: e = "primary", dark: t }) {
|
|
|
320
330
|
}
|
|
321
331
|
//#endregion
|
|
322
332
|
//#region src/components/Divider/Divider.tsx
|
|
323
|
-
var
|
|
333
|
+
var D = _.div`
|
|
324
334
|
height: 0.063rem;
|
|
325
335
|
width: 100%;
|
|
326
|
-
background-color: ${
|
|
336
|
+
background-color: ${e.border.default};
|
|
327
337
|
margin: 0.75rem 0;
|
|
328
338
|
`;
|
|
329
|
-
function
|
|
330
|
-
return /* @__PURE__ */ (
|
|
339
|
+
function O({ ...e }) {
|
|
340
|
+
return /* @__PURE__ */ h(D, { ...e });
|
|
331
341
|
}
|
|
332
342
|
//#endregion
|
|
333
343
|
//#region src/hooks/mobile.ts
|
|
334
|
-
var
|
|
335
|
-
let [e, t] =
|
|
336
|
-
return
|
|
344
|
+
var k = () => {
|
|
345
|
+
let [e, t] = s(window.innerWidth <= 768), n = o(window.innerWidth);
|
|
346
|
+
return a(() => {
|
|
337
347
|
let e = () => {
|
|
338
348
|
let e = window.innerWidth;
|
|
339
349
|
e <= 768 && n.current > 768 ? t(!0) : e > 768 && n.current <= 768 && t(!1), n.current = e;
|
|
340
350
|
};
|
|
341
351
|
return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
342
352
|
}, []), e;
|
|
343
|
-
},
|
|
344
|
-
function
|
|
345
|
-
return
|
|
353
|
+
}, A = 1, j = 1e6, M = 0;
|
|
354
|
+
function N() {
|
|
355
|
+
return M = (M + 1) % (2 ** 53 - 1), M.toString();
|
|
346
356
|
}
|
|
347
|
-
var
|
|
348
|
-
if (
|
|
357
|
+
var P = /* @__PURE__ */ new Map(), F = (e) => {
|
|
358
|
+
if (P.has(e)) return;
|
|
349
359
|
let t = setTimeout(() => {
|
|
350
|
-
|
|
360
|
+
P.delete(e), z({
|
|
351
361
|
type: "REMOVE_TOAST",
|
|
352
362
|
toastId: e
|
|
353
363
|
});
|
|
354
|
-
},
|
|
355
|
-
|
|
356
|
-
},
|
|
364
|
+
}, j);
|
|
365
|
+
P.set(e, t);
|
|
366
|
+
}, I = (e, t) => {
|
|
357
367
|
switch (t.type) {
|
|
358
368
|
case "ADD_TOAST": return {
|
|
359
369
|
...e,
|
|
360
|
-
toasts: [t.toast, ...e.toasts].slice(0,
|
|
370
|
+
toasts: [t.toast, ...e.toasts].slice(0, A)
|
|
361
371
|
};
|
|
362
372
|
case "UPDATE_TOAST": return {
|
|
363
373
|
...e,
|
|
@@ -368,8 +378,8 @@ var F = /* @__PURE__ */ new Map(), I = (e) => {
|
|
|
368
378
|
};
|
|
369
379
|
case "DISMISS_TOAST": {
|
|
370
380
|
let { toastId: n } = t;
|
|
371
|
-
return n ?
|
|
372
|
-
|
|
381
|
+
return n ? F(n) : e.toasts.forEach((e) => {
|
|
382
|
+
F(e.id);
|
|
373
383
|
}), {
|
|
374
384
|
...e,
|
|
375
385
|
toasts: e.toasts.map((e) => e.id === n || n === void 0 ? {
|
|
@@ -386,24 +396,24 @@ var F = /* @__PURE__ */ new Map(), I = (e) => {
|
|
|
386
396
|
toasts: e.toasts.filter((e) => e.id !== t.toastId)
|
|
387
397
|
};
|
|
388
398
|
}
|
|
389
|
-
},
|
|
390
|
-
function
|
|
391
|
-
|
|
392
|
-
e(
|
|
399
|
+
}, L = [], R = { toasts: [] };
|
|
400
|
+
function z(e) {
|
|
401
|
+
R = I(R, e), L.forEach((e) => {
|
|
402
|
+
e(R);
|
|
393
403
|
});
|
|
394
404
|
}
|
|
395
|
-
function
|
|
396
|
-
let t =
|
|
405
|
+
function B({ ...e }) {
|
|
406
|
+
let t = N(), n = (e) => z({
|
|
397
407
|
type: "UPDATE_TOAST",
|
|
398
408
|
toast: {
|
|
399
409
|
...e,
|
|
400
410
|
id: t
|
|
401
411
|
}
|
|
402
|
-
}), r = () =>
|
|
412
|
+
}), r = () => z({
|
|
403
413
|
type: "DISMISS_TOAST",
|
|
404
414
|
toastId: t
|
|
405
415
|
});
|
|
406
|
-
return
|
|
416
|
+
return z({
|
|
407
417
|
type: "ADD_TOAST",
|
|
408
418
|
toast: {
|
|
409
419
|
...e,
|
|
@@ -419,19 +429,19 @@ function V({ ...e }) {
|
|
|
419
429
|
update: n
|
|
420
430
|
};
|
|
421
431
|
}
|
|
422
|
-
function
|
|
423
|
-
let [e, t] =
|
|
424
|
-
return
|
|
425
|
-
let e =
|
|
426
|
-
e > -1 &&
|
|
432
|
+
function V() {
|
|
433
|
+
let [e, t] = r.useState(R);
|
|
434
|
+
return r.useEffect(() => (L.push(t), () => {
|
|
435
|
+
let e = L.indexOf(t);
|
|
436
|
+
e > -1 && L.splice(e, 1);
|
|
427
437
|
}), [e]), {
|
|
428
438
|
...e,
|
|
429
|
-
toast:
|
|
430
|
-
dismiss: (e) =>
|
|
439
|
+
toast: B,
|
|
440
|
+
dismiss: (e) => z({
|
|
431
441
|
type: "DISMISS_TOAST",
|
|
432
442
|
toastId: e
|
|
433
443
|
})
|
|
434
444
|
};
|
|
435
445
|
}
|
|
436
446
|
//#endregion
|
|
437
|
-
export {
|
|
447
|
+
export { b as Button, O as Divider, S as Input, w as Loading, E as Spinner, e as colors, n as icons, t as typography, k as useIsMobile, V as useToast };
|