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