rechtspilot-ui 1.2.2 → 1.2.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.
@@ -1,51 +1,43 @@
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
- margin: 0 auto;
3
- vertical-align: middle;
4
- position: relative;
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.keyframes`
2
+ 0% {
3
+ transform: translateY(-150%);
4
+ opacity: 0;
5
+ }
6
+ 25%,
7
+ 50%,
8
+ 75% {
9
+ transform: translateY(0);
10
+ opacity: 1;
11
+ }
12
+ 100% {
13
+ transform: translateY(150%);
14
+ opacity: 0;
15
+ }
16
+ `,d=i.styled.div`
17
+ display: inline-flex;
18
+ align-items: center;
19
+ justify-content: space-between;
5
20
  width: ${({$size:e})=>e};
6
- height: ${({$size:e})=>e};
7
- animation: rotate-anim 2s infinite linear;
21
+ height: calc(${({$size:e})=>e} / 4);
8
22
 
9
- &:before,
10
- &:after {
11
- content: '';
12
- position: absolute;
13
- top: 50%;
14
- left: 50%;
15
- background: ${({$color:e})=>e};
23
+ span {
24
+ width: calc(${({$size:e})=>e} / 4);
25
+ height: calc(${({$size:e})=>e} / 4);
16
26
  border-radius: 50%;
17
- animation: transform-anim 1.25s infinite ease;
27
+ background-color: ${({$color:e})=>e};
28
+ animation: ${u} 1s infinite linear;
18
29
  }
19
30
 
20
- &:before {
21
- height: 75%;
22
- width: 75%;
23
- transform-origin: -40% -80%;
31
+ span:nth-child(1) {
32
+ animation-delay: 0s;
24
33
  }
25
-
26
- &:after {
27
- height: 50%;
28
- width: 50%;
29
- transform-origin: 40% 80%;
34
+ span:nth-child(2) {
35
+ animation-delay: 0.1s;
30
36
  }
31
-
32
- @keyframes rotate-anim {
33
- to {
34
- transform: rotate(360deg);
35
- }
36
- }
37
-
38
- @keyframes transform-anim {
39
- 0%,
40
- 100% {
41
- transform: translate(-50%, -50%) scale(1);
42
- }
43
-
44
- 50% {
45
- transform: translate(-50%, -50%) scale(0);
46
- }
37
+ span:nth-child(3) {
38
+ animation-delay: 0.2s;
47
39
  }
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`
40
+ `;function f({size:t=`4rem`,color:n=e.L.fg.primary}){return(0,r.jsxs)(d,{$size:t,$color:n,children:[(0,r.jsx)(`span`,{}),(0,r.jsx)(`span`,{}),(0,r.jsx)(`span`,{})]})}var p=i.styled.svg`
49
41
  animation: spin 1s linear infinite;
50
42
 
51
43
  @keyframes spin {
@@ -57,9 +49,9 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
57
49
  transform: rotate(360deg);
58
50
  }
59
51
  }
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`
52
+ `;function m({variant:t=`primary`,dark:n}){return(0,r.jsxs)(p,{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 h=i.styled.div`
61
53
  height: 0.063rem;
62
54
  width: 100%;
63
55
  background-color: ${e.L.border.default};
64
56
  margin: 0.75rem 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;
57
+ `;function g({...e}){return(0,r.jsx)(h,{...e})}var _=()=>{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},v=1,y=1e6,b=0;function x(){return b=(b+1)%(2**53-1),b.toString()}var S=new Map,C=e=>{if(S.has(e))return;let t=setTimeout(()=>{S.delete(e),D({type:`REMOVE_TOAST`,toastId:e})},y);S.set(e,t)},w=(e,t)=>{switch(t.type){case`ADD_TOAST`:return{...e,toasts:[t.toast,...e.toasts].slice(0,v)};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?C(n):e.toasts.forEach(e=>{C(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)}}},T=[],E={toasts:[]};function D(e){E=w(E,e),T.forEach(e=>{e(E)})}function O({...e}){let t=x(),n=e=>D({type:`UPDATE_TOAST`,toast:{...e,id:t}}),r=()=>D({type:`DISMISS_TOAST`,toastId:t});return D({type:`ADD_TOAST`,toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:n}}function k(){let[e,n]=t.useState(E);return t.useEffect(()=>(T.push(n),()=>{let e=T.indexOf(n);e>-1&&T.splice(e,1)}),[e]),{...e,toast:O,dismiss:e=>D({type:`DISMISS_TOAST`,toastId:e})}}exports.Button=s,exports.Divider=g,exports.Input=l,exports.Loading=f,exports.Spinner=m,exports.colors=e.L,Object.defineProperty(exports,`icons`,{enumerable:!0,get:function(){return e.t}}),exports.typography=e.R,exports.useIsMobile=_,exports.useToast=k;
@@ -3,9 +3,9 @@ import * as r from "react";
3
3
  import i, { useEffect as a, useRef as o, useState as s } from "react";
4
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
5
  import { jsx as h, jsxs as g } from "react/jsx-runtime";
6
- import { styled as _ } from "styled-components";
6
+ import { keyframes as _, styled as v } from "styled-components";
7
7
  //#region src/components/Spinner/Spinner.native.tsx
8
- var v = ({ size: t = 20, color: n = e.primary[600], style: r }) => {
8
+ var y = ({ size: t = 20, color: n = e.primary[600], style: r }) => {
9
9
  let a = i.useRef(new c.Value(0)).current;
10
10
  i.useEffect(() => {
11
11
  let e = () => {
@@ -37,7 +37,7 @@ var v = ({ size: t = 20, color: n = e.primary[600], style: r }) => {
37
37
  transform: [{ rotate: o }]
38
38
  } })
39
39
  });
40
- }, y = (t) => {
40
+ }, b = (t) => {
41
41
  let n = {
42
42
  alignItems: "center",
43
43
  borderRadius: 12,
@@ -109,8 +109,8 @@ var v = ({ size: t = 20, color: n = e.primary[600], style: r }) => {
109
109
  };
110
110
  }
111
111
  };
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);
112
+ function x({ variant: t = "primary", fullWidth: n = !1, children: r, loading: i = !1, disabled: a = !1, onPress: o, ...s }) {
113
+ let c = b(t);
114
114
  return /* @__PURE__ */ g(p, {
115
115
  style: u.flatten([
116
116
  c.container,
@@ -124,7 +124,7 @@ function b({ variant: t = "primary", fullWidth: n = !1, children: r, loading: i
124
124
  children: [typeof r == "string" ? /* @__PURE__ */ h(d, {
125
125
  style: c.text,
126
126
  children: r
127
- }) : r, i && /* @__PURE__ */ h(v, {
127
+ }) : r, i && /* @__PURE__ */ h(y, {
128
128
  size: 16,
129
129
  color: t === "secondary" ? e.primary[600] : t === "destructiveSubtle" ? e.fg.accent.error : e.white
130
130
  })]
@@ -132,7 +132,7 @@ function b({ variant: t = "primary", fullWidth: n = !1, children: r, loading: i
132
132
  }
133
133
  //#endregion
134
134
  //#region src/components/Input/Input.native.tsx
135
- var x = u.create({
135
+ var S = u.create({
136
136
  container: { marginBottom: 8 },
137
137
  fieldContainer: {
138
138
  height: 49,
@@ -187,22 +187,22 @@ var x = u.create({
187
187
  helperError: { color: e.fg.accent.error },
188
188
  helperNormal: { color: e.fg.secondary }
189
189
  });
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 && {
190
+ function C({ 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 [x, C] = s(!1), w = n.length > 0, T = x || w, E = [
192
+ S.fieldContainer,
193
+ i && S.fieldContainerError,
194
+ x && !i && S.fieldContainerFocused,
195
+ x && i && S.fieldContainerFocusedError
196
+ ], D = [S.label, T ? S.labelFloating : S.labelNormal], O = u.flatten([S.input, v && {
197
197
  height: y * 20,
198
198
  textAlignVertical: "top"
199
199
  }]);
200
200
  return /* @__PURE__ */ g(m, {
201
- style: x.container,
201
+ style: S.container,
202
202
  children: [/* @__PURE__ */ h(m, {
203
203
  style: E,
204
204
  children: /* @__PURE__ */ g(m, {
205
- style: x.formGroup,
205
+ style: S.formGroup,
206
206
  children: [/* @__PURE__ */ h(f, {
207
207
  style: O,
208
208
  value: n,
@@ -224,70 +224,67 @@ function S({ label: t, value: n = "", onChange: r, error: i, helperText: a, plac
224
224
  })]
225
225
  })
226
226
  }), (i || a) && /* @__PURE__ */ h(d, {
227
- style: [x.helper, i ? x.helperError : x.helperNormal],
227
+ style: [S.helper, i ? S.helperError : S.helperNormal],
228
228
  children: i || a
229
229
  })]
230
230
  });
231
231
  }
232
232
  //#endregion
233
233
  //#region src/components/Loading/Loading.tsx
234
- var C = _.div`
235
- margin: 0 auto;
236
- vertical-align: middle;
237
- position: relative;
234
+ var w = _`
235
+ 0% {
236
+ transform: translateY(-150%);
237
+ opacity: 0;
238
+ }
239
+ 25%,
240
+ 50%,
241
+ 75% {
242
+ transform: translateY(0);
243
+ opacity: 1;
244
+ }
245
+ 100% {
246
+ transform: translateY(150%);
247
+ opacity: 0;
248
+ }
249
+ `, T = v.div`
250
+ display: inline-flex;
251
+ align-items: center;
252
+ justify-content: space-between;
238
253
  width: ${({ $size: e }) => e};
239
- height: ${({ $size: e }) => e};
240
- animation: rotate-anim 2s infinite linear;
254
+ height: calc(${({ $size: e }) => e} / 4);
241
255
 
242
- &:before,
243
- &:after {
244
- content: '';
245
- position: absolute;
246
- top: 50%;
247
- left: 50%;
248
- background: ${({ $color: e }) => e};
256
+ span {
257
+ width: calc(${({ $size: e }) => e} / 4);
258
+ height: calc(${({ $size: e }) => e} / 4);
249
259
  border-radius: 50%;
250
- animation: transform-anim 1.25s infinite ease;
260
+ background-color: ${({ $color: e }) => e};
261
+ animation: ${w} 1s infinite linear;
251
262
  }
252
263
 
253
- &:before {
254
- height: 75%;
255
- width: 75%;
256
- transform-origin: -40% -80%;
264
+ span:nth-child(1) {
265
+ animation-delay: 0s;
257
266
  }
258
-
259
- &:after {
260
- height: 50%;
261
- width: 50%;
262
- transform-origin: 40% 80%;
267
+ span:nth-child(2) {
268
+ animation-delay: 0.1s;
263
269
  }
264
-
265
- @keyframes rotate-anim {
266
- to {
267
- transform: rotate(360deg);
268
- }
269
- }
270
-
271
- @keyframes transform-anim {
272
- 0%,
273
- 100% {
274
- transform: translate(-50%, -50%) scale(1);
275
- }
276
-
277
- 50% {
278
- transform: translate(-50%, -50%) scale(0);
279
- }
270
+ span:nth-child(3) {
271
+ animation-delay: 0.2s;
280
272
  }
281
273
  `;
282
- function w({ size: t = "4rem", color: n = e.fg.primary }) {
283
- return /* @__PURE__ */ h(C, {
274
+ function E({ size: t = "4rem", color: n = e.fg.primary }) {
275
+ return /* @__PURE__ */ g(T, {
284
276
  $size: t,
285
- $color: n
277
+ $color: n,
278
+ children: [
279
+ /* @__PURE__ */ h("span", {}),
280
+ /* @__PURE__ */ h("span", {}),
281
+ /* @__PURE__ */ h("span", {})
282
+ ]
286
283
  });
287
284
  }
288
285
  //#endregion
289
286
  //#region src/components/Spinner/Spinner.tsx
290
- var T = _.svg`
287
+ var D = v.svg`
291
288
  animation: spin 1s linear infinite;
292
289
 
293
290
  @keyframes spin {
@@ -300,8 +297,8 @@ var T = _.svg`
300
297
  }
301
298
  }
302
299
  `;
303
- function E({ variant: t = "primary", dark: n }) {
304
- return /* @__PURE__ */ g(T, {
300
+ function O({ variant: t = "primary", dark: n }) {
301
+ return /* @__PURE__ */ g(D, {
305
302
  width: "24",
306
303
  height: "24",
307
304
  viewBox: "0 0 24 24",
@@ -330,18 +327,18 @@ function E({ variant: t = "primary", dark: n }) {
330
327
  }
331
328
  //#endregion
332
329
  //#region src/components/Divider/Divider.tsx
333
- var D = _.div`
330
+ var k = v.div`
334
331
  height: 0.063rem;
335
332
  width: 100%;
336
333
  background-color: ${e.border.default};
337
334
  margin: 0.75rem 0;
338
335
  `;
339
- function O({ ...e }) {
340
- return /* @__PURE__ */ h(D, { ...e });
336
+ function A({ ...e }) {
337
+ return /* @__PURE__ */ h(k, { ...e });
341
338
  }
342
339
  //#endregion
343
340
  //#region src/hooks/mobile.ts
344
- var k = () => {
341
+ var j = () => {
345
342
  let [e, t] = s(window.innerWidth <= 768), n = o(window.innerWidth);
346
343
  return a(() => {
347
344
  let e = () => {
@@ -350,24 +347,24 @@ var k = () => {
350
347
  };
351
348
  return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
352
349
  }, []), e;
353
- }, A = 1, j = 1e6, M = 0;
354
- function N() {
355
- return M = (M + 1) % (2 ** 53 - 1), M.toString();
350
+ }, M = 1, N = 1e6, P = 0;
351
+ function F() {
352
+ return P = (P + 1) % (2 ** 53 - 1), P.toString();
356
353
  }
357
- var P = /* @__PURE__ */ new Map(), F = (e) => {
358
- if (P.has(e)) return;
354
+ var I = /* @__PURE__ */ new Map(), L = (e) => {
355
+ if (I.has(e)) return;
359
356
  let t = setTimeout(() => {
360
- P.delete(e), z({
357
+ I.delete(e), V({
361
358
  type: "REMOVE_TOAST",
362
359
  toastId: e
363
360
  });
364
- }, j);
365
- P.set(e, t);
366
- }, I = (e, t) => {
361
+ }, N);
362
+ I.set(e, t);
363
+ }, R = (e, t) => {
367
364
  switch (t.type) {
368
365
  case "ADD_TOAST": return {
369
366
  ...e,
370
- toasts: [t.toast, ...e.toasts].slice(0, A)
367
+ toasts: [t.toast, ...e.toasts].slice(0, M)
371
368
  };
372
369
  case "UPDATE_TOAST": return {
373
370
  ...e,
@@ -378,8 +375,8 @@ var P = /* @__PURE__ */ new Map(), F = (e) => {
378
375
  };
379
376
  case "DISMISS_TOAST": {
380
377
  let { toastId: n } = t;
381
- return n ? F(n) : e.toasts.forEach((e) => {
382
- F(e.id);
378
+ return n ? L(n) : e.toasts.forEach((e) => {
379
+ L(e.id);
383
380
  }), {
384
381
  ...e,
385
382
  toasts: e.toasts.map((e) => e.id === n || n === void 0 ? {
@@ -396,24 +393,24 @@ var P = /* @__PURE__ */ new Map(), F = (e) => {
396
393
  toasts: e.toasts.filter((e) => e.id !== t.toastId)
397
394
  };
398
395
  }
399
- }, L = [], R = { toasts: [] };
400
- function z(e) {
401
- R = I(R, e), L.forEach((e) => {
402
- e(R);
396
+ }, z = [], B = { toasts: [] };
397
+ function V(e) {
398
+ B = R(B, e), z.forEach((e) => {
399
+ e(B);
403
400
  });
404
401
  }
405
- function B({ ...e }) {
406
- let t = N(), n = (e) => z({
402
+ function H({ ...e }) {
403
+ let t = F(), n = (e) => V({
407
404
  type: "UPDATE_TOAST",
408
405
  toast: {
409
406
  ...e,
410
407
  id: t
411
408
  }
412
- }), r = () => z({
409
+ }), r = () => V({
413
410
  type: "DISMISS_TOAST",
414
411
  toastId: t
415
412
  });
416
- return z({
413
+ return V({
417
414
  type: "ADD_TOAST",
418
415
  toast: {
419
416
  ...e,
@@ -429,19 +426,19 @@ function B({ ...e }) {
429
426
  update: n
430
427
  };
431
428
  }
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);
429
+ function U() {
430
+ let [e, t] = r.useState(B);
431
+ return r.useEffect(() => (z.push(t), () => {
432
+ let e = z.indexOf(t);
433
+ e > -1 && z.splice(e, 1);
437
434
  }), [e]), {
438
435
  ...e,
439
- toast: B,
440
- dismiss: (e) => z({
436
+ toast: H,
437
+ dismiss: (e) => V({
441
438
  type: "DISMISS_TOAST",
442
439
  toastId: e
443
440
  })
444
441
  };
445
442
  }
446
443
  //#endregion
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 };
444
+ export { x as Button, A as Divider, C as Input, E as Loading, O as Spinner, e as colors, n as icons, t as typography, j as useIsMobile, U as useToast };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rechtspilot-ui",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "type": "module",
5
5
  "description": "Rechtspilot UI Library",
6
6
  "main": "dist/index.cjs",