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.
@@ -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.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.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,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 (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.fg.accent.error,
92
+ borderColor: e.fg.accent.error
94
93
  },
95
94
  text: {
96
95
  ...r,
97
- color: n.fg.accent.error
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 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([
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
- t && { width: "100%" },
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__ */ (0, v.jsx)(p, {
124
+ children: [typeof r == "string" ? /* @__PURE__ */ h(d, {
115
125
  style: c.text,
116
126
  children: r
117
- }) : r, i && /* @__PURE__ */ (0, v.jsx)(y, {
127
+ }) : r, i && /* @__PURE__ */ h(v, {
118
128
  size: 16,
119
- color: e === "secondary" ? n.primary[600] : n.white
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 S = f.create({
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: n.bg.secondary,
143
+ backgroundColor: e.bg.secondary,
134
144
  borderWidth: 2,
135
- borderColor: n.bg.tertiary
145
+ borderColor: e.bg.tertiary
136
146
  },
137
- fieldContainerError: { borderColor: n.fg.accent.error },
138
- fieldContainerFocused: { borderColor: n.fg.base },
139
- fieldContainerFocusedError: { borderColor: n.fg.accent.error },
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: n.primary[900],
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: n.fg.tertiary
171
+ color: e.fg.tertiary
162
172
  },
163
173
  labelFloating: {
164
174
  top: 2,
165
175
  fontSize: 12,
166
- color: n.fg.secondary
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: n.fg.accent.error },
178
- helperNormal: { color: n.fg.secondary }
187
+ helperError: { color: e.fg.accent.error },
188
+ helperNormal: { color: e.fg.secondary }
179
189
  });
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,
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__ */ (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,
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: () => 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
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__ */ (0, v.jsx)(p, {
217
- style: [S.helper, i ? S.helperError : S.helperNormal],
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 w = _.div`
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 T({ size: e = "4rem", color: t = n.fg.primary }) {
273
- return /* @__PURE__ */ (0, v.jsx)(w, {
274
- $size: e,
275
- $color: t
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 E = _.svg`
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 D({ variant: e = "primary", dark: t }) {
294
- return /* @__PURE__ */ (0, v.jsxs)(E, {
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__ */ (0, v.jsx)("circle", {
310
+ children: [/* @__PURE__ */ h("circle", {
301
311
  cx: "12",
302
312
  cy: "12",
303
313
  r: "8",
304
- stroke: t ? n.neutral["0-A8"] : n.neutral["800-A8"],
314
+ stroke: n ? e.neutral["0-A8"] : e.neutral["800-A8"],
305
315
  strokeOpacity: "0.08",
306
316
  strokeWidth: "3"
307
- }), /* @__PURE__ */ (0, v.jsx)("path", {
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 (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;
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 O = _.div`
333
+ var D = _.div`
324
334
  height: 0.063rem;
325
335
  width: 100%;
326
- background-color: ${n.border.default};
336
+ background-color: ${e.border.default};
327
337
  margin: 0.75rem 0;
328
338
  `;
329
- function k({ ...e }) {
330
- return /* @__PURE__ */ (0, v.jsx)(O, { ...e });
339
+ function O({ ...e }) {
340
+ return /* @__PURE__ */ h(D, { ...e });
331
341
  }
332
342
  //#endregion
333
343
  //#region src/hooks/mobile.ts
334
- var A = () => {
335
- let [e, t] = l(window.innerWidth <= 768), n = c(window.innerWidth);
336
- return s(() => {
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
- }, j = 1, M = 1e6, N = 0;
344
- function P() {
345
- return N = (N + 1) % (2 ** 53 - 1), N.toString();
353
+ }, A = 1, j = 1e6, M = 0;
354
+ function N() {
355
+ return M = (M + 1) % (2 ** 53 - 1), M.toString();
346
356
  }
347
- var F = /* @__PURE__ */ new Map(), I = (e) => {
348
- if (F.has(e)) return;
357
+ var P = /* @__PURE__ */ new Map(), F = (e) => {
358
+ if (P.has(e)) return;
349
359
  let t = setTimeout(() => {
350
- F.delete(e), B({
360
+ P.delete(e), z({
351
361
  type: "REMOVE_TOAST",
352
362
  toastId: e
353
363
  });
354
- }, M);
355
- F.set(e, t);
356
- }, L = (e, t) => {
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, j)
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 ? I(n) : e.toasts.forEach((e) => {
372
- I(e.id);
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
- }, R = [], z = { toasts: [] };
390
- function B(e) {
391
- z = L(z, e), R.forEach((e) => {
392
- e(z);
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 V({ ...e }) {
396
- let t = P(), n = (e) => B({
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 = () => B({
412
+ }), r = () => z({
403
413
  type: "DISMISS_TOAST",
404
414
  toastId: t
405
415
  });
406
- return B({
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 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);
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: V,
430
- dismiss: (e) => B({
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 { 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 };
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rechtspilot-ui",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "type": "module",
5
5
  "description": "Rechtspilot UI Library",
6
6
  "main": "dist/index.cjs",