@bgord/ui 0.5.7 → 0.5.9

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
- import React from "react";
1
+ import type React from "react";
2
2
  import * as hooks from "../hooks";
3
3
  export type DialogPropsType = hooks.UseToggleReturnType & React.JSX.IntrinsicElements["dialog"];
4
4
  export declare function Dialog(props: DialogPropsType): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- import { RefObject } from "react";
1
+ import { type RefObject } from "react";
2
2
  export declare function useClickOutside<T extends HTMLElement>(ref: RefObject<T | null>, handler: (e: MouseEvent | TouchEvent) => void): void;
@@ -1,5 +1,5 @@
1
- import { FieldValueAllowedTypes } from "../services/field";
2
- import { useFieldConfigType, useFieldReturnType, useFieldStrategyEnum } from "./use-field";
1
+ import { type FieldValueAllowedTypes } from "../services/field";
2
+ import { type useFieldConfigType, type useFieldReturnType, useFieldStrategyEnum } from "./use-field";
3
3
  export type useClientFilterQueryType = string | undefined;
4
4
  type useClientFilterConfigType<T extends FieldValueAllowedTypes> = Omit<useFieldConfigType<T>, "strategy"> & {
5
5
  enum: {
@@ -1,4 +1,4 @@
1
- import { FieldValueAllowedTypes } from "../services/field";
1
+ import { type FieldValueAllowedTypes } from "../services/field";
2
2
  /** Type for field names */
3
3
  type NewFieldNameType = string;
4
4
  /** Valid HTML elements that can be used as field inputs */
@@ -1,4 +1,4 @@
1
- import { Ref } from "react";
1
+ import { type Ref } from "react";
2
2
  type FocusableElement = HTMLElement & {
3
3
  focus(): void;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { useClientFilterReturnType } from "./use-client-filter";
1
+ import { type useClientFilterReturnType } from "./use-client-filter";
2
2
  type LanguageType = string;
3
3
  export declare function useLanguageSelector(supportedLanguages: Record<LanguageType, LanguageType>): useClientFilterReturnType<LanguageType>;
4
4
  export {};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{jsx as U}from"react/jsx-runtime";function he(){return U("button",{type:"button",children:"Click"})}import{useEffect as ie,useRef as me}from"react";import{useEffect as q}from"react";function R(e,t){q(()=>{if(typeof document==="undefined")return;function r(n){let o=e.current;if(!o)return;if(o.contains(n.target))if(n.target===o){let{left:i,right:m,top:x,bottom:a}=o.getBoundingClientRect(),p=n instanceof MouseEvent?n.clientX:n.touches[0].clientX,y=n instanceof MouseEvent?n.clientY:n.touches[0].clientY;if(p>=i&&p<=m&&y>=x&&y<=a)return}else return;t(n)}return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[e,t])}import{useCallback as $,useMemo as h}from"react";class s{static emptyValue=void 0;static isEmpty(e){return e===void 0||e===""||e===null}static compare(e,t){if(s.isEmpty(e)&&s.isEmpty(t))return!0;return e===t}value=s.emptyValue;constructor(e){this.value=s.isEmpty(e)?s.emptyValue:e}get(){return this.value}isEmpty(){return s.isEmpty(this.value)}}import{useEffect as P,useState as M}from"react";import{useSearchParams as W}from"react-router";var w;((r)=>{r.params="params";r.local="local"})(w||={});function g(e){let t=e.strategy??"local",[r,n]=W(),o=new s(r.get(e.name)),i=new s(e.defaultValue),[m,x]=M(o.isEmpty()?i.get():o.get()),a=(c)=>{let k=new s(c);x(k.get())};P(()=>{let c=new s(m);if(t==="params")if(c.isEmpty())r.delete(e.name),n(r);else r.set(e.name,c.get()),n(r)},[m,r,n,e.name,t]);let p=s.isEmpty(m)?"":m,y=(c)=>a(c.currentTarget.value);return{strategy:t,defaultValue:i.get(),currentValue:m,value:p,set:a,handleChange:y,clear:()=>a(i.get()),label:{props:{htmlFor:e.name}},input:{props:{id:e.name,name:e.name,value:p,onChange:y}},changed:!s.compare(m,i.get()),unchanged:s.compare(m,i.get()),empty:s.isEmpty(m)}}class I{static clearAll(e){return()=>e.forEach((t)=>t.clear())}}function l(e){let t=g({...e,strategy:"local"}),r=$((i)=>{if(t.empty)return!0;return s.compare(i,t.currentValue)},[t.empty,t.currentValue]),n=h(()=>e.filterFn??r,[e.filterFn,r]),o=h(()=>Object.entries(e.enum).map(([i,m])=>({name:i,value:m})),[e.enum]);return h(()=>({...t,filterFn:n,options:o,strategy:"local"}),[t,n,o])}import D from"react";function Ie(e){let[t,r]=D.useState("idle"),n=(m)=>{if(m.preventDefault(),t==="idle")r("exiting")},o=(m)=>{if(m.animationName!==e.animation)return;e.actionFn(),r("gone")},i=t==="exiting"?{"data-animation":e.animation,onAnimationEnd:o}:void 0;return{visible:t!=="gone",attach:i,trigger:n}}import{useCallback as B,useMemo as X,useRef as J}from"react";import{useEffect as v,useMemo as K}from"react";import{tinykeys as _}from"tinykeys";function T(e,t){let r=t?.enabled??!0,n=K(()=>e,[JSON.stringify(Object.keys(e))]);v(()=>{if(!r)return;let o=_(window,n);return()=>o()},[n,r])}function Je(e){let t=J(null),r=B(()=>{if(t.current)t.current.focus()},[]);return T({[e]:r}),X(()=>({ref:t}),[])}import{useCallback as N,useRef as Q}from"react";import{useState as O}from"react";function L({name:e,defaultValue:t=!1}){let[r,n]=O(t);return{on:r,off:!r,enable:()=>n(!0),disable:()=>n(!1),toggle:()=>n((p)=>!p),props:{controller:{"aria-expanded":r?"true":"false","aria-controls":e,role:"button",tabIndex:0},target:{id:e,role:"region","aria-hidden":r?"false":"true"}}}}function A(e){let{on:t,off:r,enable:n,disable:o,toggle:i,props:m,...x}=e;return{toggle:{on:t,off:r,enable:n,disable:o,toggle:i,props:m},rest:x}}function je({enabled:e=!0}={}){let{on:t,enable:r,disable:n}=L({name:"is-hovering"}),o=Q(null),i=typeof window!=="undefined"&&"PointerEvent"in window?"pointerenter":"mouseenter",m=typeof window!=="undefined"&&"PointerEvent"in window?"pointerleave":"mouseleave";return{attach:{ref:N((a)=>{let p=o.current;if(p)p.removeEventListener(i,r),p.removeEventListener(m,n);if(o.current=a,a&&e)a.addEventListener(i,r),a.addEventListener(m,n)},[i,m,e,r,n])},isHovering:t&&e}}import Y from"js-cookie";import{useCallback as z,useEffect as V}from"react";import{useRevalidator as ee}from"react-router";import{createContext as Z,use as b,useCallback as j}from"react";import{polishPlurals as G}from"polish-plurals";function C(e){if(e.language==="en"){let t=e.plural??`${e.singular}s`;if(e.value===1)return e.singular;return t}if(e.language==="pl"){let t=e.value??1;if(t===1)return e.singular;return G(e.singular,String(e.plural),String(e.genitive),t)}return console.warn(`[@bgord/frontend] missing pluralization function for language: ${e.language}.`),e.singular}var F=Z({translations:{},language:"en"});function nt(){let e=b(F);if(e===void 0)throw new Error("useTranslations must be used within the TranslationsContext");return j((r,n)=>{let o=e.translations[r];if(!o)return console.warn(`[@bgord/ui] missing translation for key: ${r}`),r;if(!n)return o;return Object.entries(n).reduce((i,[m,x])=>{let a=new RegExp(`{{${m}}}`,"g");return i.replace(a,String(x))},o)},[e.translations])}function f(){let e=b(F);if(e===void 0)throw new Error("useLanguage must be used within the TranslationsContext");return e.language}function ot(){let e=f();return(t)=>C({...t,language:e})}function yt(e){let t=f(),r=ee(),n=l({enum:e,defaultValue:t,name:"language"}),o=z(()=>{let i=new s(n.currentValue);if(!i.isEmpty()&&n.changed)Y.set("language",String(i.get())),r.revalidate()},[n.currentValue,n.changed]);return V(()=>{o()},[o]),n}import{useCallback as te,useMemo as re}from"react";function ht(){let e=te((t)=>{if(t.key!=="Enter"||!t.metaKey)return;t.preventDefault(),t.currentTarget.form?.requestSubmit()},[]);return re(()=>({onKeyDown:e}),[e])}import{useEffect as ne}from"react";function H(e=!0){ne(()=>{if(typeof document==="undefined")return;let t=document.body.style.overflow;if(e)document.body.style.overflow="hidden";return()=>{document.body.style.overflow=t}},[e])}import{jsx as se}from"react/jsx-runtime";function Pt(e){let{toggle:t,rest:r}=A(e),n=me(null);return ie(()=>{if(e.on)n.current?.showModal();else n.current?.close()},[e.on]),T({Escape:t.disable}),H(e.on),R(n,t.disable),se("dialog",{ref:n,tabIndex:0,"aria-modal":"true","data-disp":e.on?"flex":"none","data-dir":"column","data-mx":"auto","data-p":"5","data-position":"fixed","data-z":"2","data-bg":"neutral-900","data-br":"xs","data-backdrop":"stronger","data-animation":"grow-fade-in",...r})}import{useEffect as ue}from"react";import{useRevalidator as ae}from"react-router";function Dt(){let e=ae();return ue(()=>{let t=()=>e.revalidate();return window.addEventListener("focus",t),()=>window.removeEventListener("focus",t)},[e]),null}import{redirect as E}from"react-router";class d{static extractFrom(e){return e.headers.get("cookie")??""}}class pe{API_URL;constructor(e){this.API_URL=`${e}/api/auth`}async getServerSession(e){let t=d.extractFrom(e),r=await fetch(`${this.API_URL}/get-session`,{headers:{cookie:t,accept:"application/json"}});if(!r.ok)return null;return await r.json()}async requireSession(e){let t=await this.getServerSession(e);if(t?.user)return t;throw E("/")}async requireNoSession(e,t="/home"){if((await this.getServerSession(e))?.user)throw E(t)}async removeSession(e,t="/login"){let r=d.extractFrom(e),n=await fetch(`${import.meta.env.VITE_API_URL}/api/auth/sign-out`,{method:"POST",headers:{cookie:r}}),o=new Headers;throw n.headers.forEach((i,m)=>{if(m.toLowerCase()==="set-cookie")o.append("set-cookie",i)}),E(t,{headers:o})}}function S(){}var xe=()=>console.warn("Copying to clipboard not supported");async function jt(e){let t=e.onFailure??xe,r=e.onSuccess??S;if(!navigator.clipboard)t();try{await navigator.clipboard.writeText(e.text),r()}catch(n){t(n)}}var zt={email:{inputMode:"email",autoComplete:"email",autoCapitalize:"none",spellCheck:"false"},password:{new:{autoComplete:"new-password"},current:{autoComplete:"current-password"}}};class ce{static fromRevision(e){return{"if-match":String(e)}}}function tr(e){return function(){for(let t of e)t()}}class ye{static allUnchanged(e){return e.every((t)=>t.unchanged)}static allEmpty(e){return e.every((t)=>t.empty)}static anyEmpty(e){return e.some((t)=>t.empty)}static anyUnchanged(e){return e.some((t)=>t.unchanged)}static anyChanged(e){return e.some((t)=>t.changed)}}class Te{static inputPattern(e){let t=e.required??!0;if(e.min&&!e.max)return{pattern:`.{${e.min}}`,required:t};if(e.min&&e.max)return{pattern:`.{${e.min},${e.max}}`,required:t};if(!e.min&&e.max)return{pattern:`.{,${e.max}}`,required:t};return{pattern:void 0,required:t}}static textareaPattern(e){let t=e.required??!0;if(e.min&&!e.max)return{minLength:e.min,required:t};if(e.min&&e.max)return{minLength:e.min,maxLength:e.max,required:t};if(!e.min&&e.max)return{maxLength:e.max,required:t};return{required:t}}}function ir(){if(typeof window==="undefined")return;return window}function sr(e=12){return{times(t){let r=e*t,n={height:{height:u(r)},minHeight:{minHeight:u(r)},maxHeight:{maxHeight:u(r)},width:{width:u(r)},minWidth:{minWidth:u(r)},maxWidth:{maxWidth:u(r)},square:{height:u(r),width:u(r)}},o={height:{style:{height:u(r)}},minHeight:{style:{minHeight:u(r)}},maxHeight:{style:{maxHeight:u(r)}},width:{style:{width:u(r)}},minWidth:{style:{minWidth:u(r)}},maxWidth:{style:{maxWidth:u(r)}},square:{style:{height:u(r),width:u(r)}}};return{px:u(r),raw:r,style:o,...n}}}}function u(e){return`${e}px`}class de{static fromRevision(e){return{"if-match":`W/${e}`}}}export{nt as useTranslations,L as useToggle,H as useScrollLock,ot as usePluralize,ht as useMetaEnterSubmit,yt as useLanguageSelector,f as useLanguage,T as useKeyboardShortcuts,je as useHover,Je as useFocusKeyboardShortcut,w as useFieldStrategyEnum,g as useField,Ie as useExitAction,l as useClientFilter,R as useClickOutside,C as pluralize,S as noop,ir as getSafeWindow,A as extractUseToggle,tr as exec,jt as copyToClipboard,de as WeakETag,F as TranslationsContext,sr as Rhythm,Dt as RevalidateOnFocus,I as LocalFields,Te as Form,ye as Fields,s as Field,ce as ETag,Pt as Dialog,zt as Credentials,d as Cookies,he as Button,pe as AuthGuard};
1
+ import{jsx as U}from"react/jsx-runtime";function he(){return U("button",{type:"button",children:"Click"})}import{useEffect as ie,useRef as me}from"react";import{useEffect as q}from"react";function R(e,t){q(()=>{if(typeof document==="undefined")return;function r(n){let o=e.current;if(!o)return;if(o.contains(n.target))if(n.target===o){let{left:i,right:m,top:x,bottom:a}=o.getBoundingClientRect(),p=n instanceof MouseEvent?n.clientX:n.touches[0].clientX,y=n instanceof MouseEvent?n.clientY:n.touches[0].clientY;if(p>=i&&p<=m&&y>=x&&y<=a)return}else return;t(n)}return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[e,t])}import{useCallback as $,useMemo as h}from"react";class s{static emptyValue=void 0;static isEmpty(e){return e===void 0||e===""||e===null}static compare(e,t){if(s.isEmpty(e)&&s.isEmpty(t))return!0;return e===t}value=s.emptyValue;constructor(e){this.value=s.isEmpty(e)?s.emptyValue:e}get(){return this.value}isEmpty(){return s.isEmpty(this.value)}}import{useEffect as P,useState as M}from"react";import{useSearchParams as W}from"react-router";var w;((r)=>{r.params="params";r.local="local"})(w||={});function g(e){let t=e.strategy??"local",[r,n]=W(),o=new s(r.get(e.name)),i=new s(e.defaultValue),[m,x]=M(o.isEmpty()?i.get():o.get()),a=(c)=>{let k=new s(c);x(k.get())};P(()=>{let c=new s(m);if(t==="params")if(c.isEmpty())r.delete(e.name),n(r);else r.set(e.name,c.get()),n(r)},[m,r,n,e.name,t]);let p=s.isEmpty(m)?"":m,y=(c)=>a(c.currentTarget.value);return{strategy:t,defaultValue:i.get(),currentValue:m,value:p,set:a,handleChange:y,clear:()=>a(i.get()),label:{props:{htmlFor:e.name}},input:{props:{id:e.name,name:e.name,value:p,onChange:y}},changed:!s.compare(m,i.get()),unchanged:s.compare(m,i.get()),empty:s.isEmpty(m)}}class I{static clearAll(e){return()=>e.forEach((t)=>t.clear())}}function l(e){let t=g({...e,strategy:"local"}),r=$((i)=>{if(t.empty)return!0;return s.compare(i,t.currentValue)},[t.empty,t.currentValue]),n=h(()=>e.filterFn??r,[e.filterFn,r]),o=h(()=>Object.entries(e.enum).map(([i,m])=>({name:i,value:m})),[e.enum]);return h(()=>({...t,filterFn:n,options:o,strategy:"local"}),[t,n,o])}import D from"react";function Ue(e){let[t,r]=D.useState("idle"),n=(m)=>{if(m.preventDefault(),t==="idle")r("exiting")},o=(m)=>{if(m.animationName!==e.animation)return;e.actionFn(),r("gone")},i=t==="exiting"?{"data-animation":e.animation,onAnimationEnd:o}:void 0;return{visible:t!=="gone",attach:i,trigger:n}}import{useCallback as B,useMemo as X,useRef as J}from"react";import{useEffect as v,useMemo as K}from"react";import{tinykeys as _}from"tinykeys";function T(e,t){let r=t?.enabled??!0,n=K(()=>e,[JSON.stringify(Object.keys(e))]);v(()=>{if(!r)return;let o=_(window,n);return()=>o()},[n,r])}function De(e){let t=J(null),r=B(()=>{if(t.current)t.current.focus()},[]);return T({[e]:r}),X(()=>({ref:t}),[])}import{useCallback as N,useRef as Q}from"react";import{useState as O}from"react";function L({name:e,defaultValue:t=!1}){let[r,n]=O(t);return{on:r,off:!r,enable:()=>n(!0),disable:()=>n(!1),toggle:()=>n((p)=>!p),props:{controller:{"aria-expanded":r?"true":"false","aria-controls":e,role:"button",tabIndex:0},target:{id:e,role:"region","aria-hidden":r?"false":"true"}}}}function A(e){let{on:t,off:r,enable:n,disable:o,toggle:i,props:m,...x}=e;return{toggle:{on:t,off:r,enable:n,disable:o,toggle:i,props:m},rest:x}}function Je({enabled:e=!0}={}){let{on:t,enable:r,disable:n}=L({name:"is-hovering"}),o=Q(null),i=typeof window!=="undefined"&&"PointerEvent"in window?"pointerenter":"mouseenter",m=typeof window!=="undefined"&&"PointerEvent"in window?"pointerleave":"mouseleave";return{attach:{ref:N((a)=>{let p=o.current;if(p)p.removeEventListener(i,r),p.removeEventListener(m,n);if(o.current=a,a&&e)a.addEventListener(i,r),a.addEventListener(m,n)},[i,m,e,r,n])},isHovering:t&&e}}import Y from"js-cookie";import{useCallback as z,useEffect as V}from"react";import{useRevalidator as ee}from"react-router";import{createContext as Z,use as b,useCallback as j}from"react";import{polishPlurals as G}from"polish-plurals";function C(e){if(e.language==="en"){let t=e.plural??`${e.singular}s`;if(e.value===1)return e.singular;return t}if(e.language==="pl"){let t=e.value??1;if(t===1)return e.singular;return G(e.singular,String(e.plural),String(e.genitive),t)}return console.warn(`[@bgord/frontend] missing pluralization function for language: ${e.language}.`),e.singular}var F=Z({translations:{},language:"en"});function je(){let e=b(F);if(e===void 0)throw new Error("useTranslations must be used within the TranslationsContext");return j((r,n)=>{let o=e.translations[r];if(!o)return console.warn(`[@bgord/ui] missing translation for key: ${r}`),r;if(!n)return o;return Object.entries(n).reduce((i,[m,x])=>{let a=new RegExp(`{{${m}}}`,"g");return i.replace(a,String(x))},o)},[e.translations])}function f(){let e=b(F);if(e===void 0)throw new Error("useLanguage must be used within the TranslationsContext");return e.language}function Ye(){let e=f();return(t)=>C({...t,language:e})}function it(e){let t=f(),r=ee(),n=l({enum:e,defaultValue:t,name:"language"}),o=z(()=>{let i=new s(n.currentValue);if(!i.isEmpty()&&n.changed)Y.set("language",String(i.get())),r.revalidate()},[n.currentValue,n.changed]);return V(()=>{o()},[o]),n}import{useCallback as te,useMemo as re}from"react";function ut(){let e=te((t)=>{if(t.key!=="Enter"||!t.metaKey)return;t.preventDefault(),t.currentTarget.form?.requestSubmit()},[]);return re(()=>({onKeyDown:e}),[e])}import{useEffect as ne}from"react";function H(e=!0){ne(()=>{if(typeof document==="undefined")return;let t=document.body.style.overflow;if(e)document.body.style.overflow="hidden";return()=>{document.body.style.overflow=t}},[e])}import{jsx as se}from"react/jsx-runtime";function At(e){let{toggle:t,rest:r}=A(e),n=me(null);return ie(()=>{if(e.on)n.current?.showModal();else n.current?.close()},[e.on]),T({Escape:t.disable}),H(e.on),R(n,t.disable),se("dialog",{ref:n,tabIndex:0,"aria-modal":"true","data-disp":e.on?"flex":"none","data-dir":"column","data-mx":"auto","data-p":"5","data-position":"fixed","data-z":"2","data-bg":"neutral-900","data-br":"xs","data-backdrop":"stronger","data-animation":"grow-fade-in",...r})}import{useEffect as ue}from"react";import{useRevalidator as ae}from"react-router";function St(){let e=ae();return ue(()=>{let t=()=>e.revalidate();return window.addEventListener("focus",t),()=>window.removeEventListener("focus",t)},[e]),null}import{redirect as E}from"react-router";class d{static extractFrom(e){return e.headers.get("cookie")??""}}class pe{API_URL;constructor(e){this.API_URL=`${e}/api/auth`}async getServerSession(e){let t=d.extractFrom(e),r=await fetch(`${this.API_URL}/get-session`,{headers:{cookie:t,accept:"application/json"}});if(!r.ok)return null;return await r.json()}async requireSession(e){let t=await this.getServerSession(e);if(t?.user)return t;throw E("/")}async requireNoSession(e,t="/home"){if((await this.getServerSession(e))?.user)throw E(t)}async removeSession(e,t="/login"){let r=d.extractFrom(e),n=await fetch(`${import.meta.env.VITE_API_URL}/api/auth/sign-out`,{method:"POST",headers:{cookie:r}}),o=new Headers;throw n.headers.forEach((i,m)=>{if(m.toLowerCase()==="set-cookie")o.append("set-cookie",i)}),E(t,{headers:o})}}function S(){}var xe=()=>console.warn("Copying to clipboard not supported");async function _t(e){let t=e.onFailure??xe,r=e.onSuccess??S;if(!navigator.clipboard)t();try{await navigator.clipboard.writeText(e.text),r()}catch(n){t(n)}}var Xt={email:{inputMode:"email",autoComplete:"email",autoCapitalize:"none",spellCheck:"false"},password:{new:{autoComplete:"new-password"},current:{autoComplete:"current-password"}}};class ce{static fromRevision(e){return{"if-match":String(e)}}}function Nt(e){return function(){for(let t of e)t()}}class ye{static allUnchanged(e){return e.every((t)=>t.unchanged)}static allEmpty(e){return e.every((t)=>t.empty)}static anyEmpty(e){return e.some((t)=>t.empty)}static anyUnchanged(e){return e.some((t)=>t.unchanged)}static anyChanged(e){return e.some((t)=>t.changed)}}class Te{static inputPattern(e){let t=e.required??!0;if(e.min&&!e.max)return{pattern:`.{${e.min}}`,required:t};if(e.min&&e.max)return{pattern:`.{${e.min},${e.max}}`,required:t};if(!e.min&&e.max)return{pattern:`.{,${e.max}}`,required:t};return{pattern:void 0,required:t}}static textareaPattern(e){let t=e.required??!0;if(e.min&&!e.max)return{minLength:e.min,required:t};if(e.min&&e.max)return{minLength:e.min,maxLength:e.max,required:t};if(!e.min&&e.max)return{maxLength:e.max,required:t};return{required:t}}}function jt(){if(typeof window==="undefined")return;return window}function zt(e=12){return{times(t){let r=e*t,n={height:{height:u(r)},minHeight:{minHeight:u(r)},maxHeight:{maxHeight:u(r)},width:{width:u(r)},minWidth:{minWidth:u(r)},maxWidth:{maxWidth:u(r)},square:{height:u(r),width:u(r)}},o={height:{style:{height:u(r)}},minHeight:{style:{minHeight:u(r)}},maxHeight:{style:{maxHeight:u(r)}},width:{style:{width:u(r)}},minWidth:{style:{minWidth:u(r)}},maxWidth:{style:{maxWidth:u(r)}},square:{style:{height:u(r),width:u(r)}}};return{px:u(r),raw:r,style:o,...n}}}}function u(e){return`${e}px`}class de{static fromRevision(e){return{"if-match":`W/${e}`}}}export{je as useTranslations,L as useToggle,H as useScrollLock,Ye as usePluralize,ut as useMetaEnterSubmit,it as useLanguageSelector,f as useLanguage,T as useKeyboardShortcuts,Je as useHover,De as useFocusKeyboardShortcut,w as useFieldStrategyEnum,g as useField,Ue as useExitAction,l as useClientFilter,R as useClickOutside,C as pluralize,S as noop,jt as getSafeWindow,A as extractUseToggle,Nt as exec,_t as copyToClipboard,de as WeakETag,F as TranslationsContext,zt as Rhythm,St as RevalidateOnFocus,I as LocalFields,Te as Form,ye as Fields,s as Field,ce as ETag,At as Dialog,Xt as Credentials,d as Cookies,he as Button,pe as AuthGuard};
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import type React from "react";
2
2
  type PatternConfigType = {
3
3
  min?: number;
4
4
  max?: number;
@@ -1,4 +1,4 @@
1
- import { PluralizeOptionsType } from "./pluralize";
1
+ import { type PluralizeOptionsType } from "./pluralize";
2
2
  export type TranslationsKeyType = string;
3
3
  export type TranslationsValueType = string;
4
4
  export type TranslationsType = Record<TranslationsKeyType, TranslationsValueType>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bgord/ui",
3
- "version": "0.5.7",
3
+ "version": "0.5.9",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -14,7 +14,7 @@
14
14
  "peerDependencies": {
15
15
  "react": "19.1.1",
16
16
  "react-dom": "19.1.1",
17
- "react-router": "7.8.1"
17
+ "react-router": "7.8.2"
18
18
  },
19
19
  "scripts": {
20
20
  "build:js": "NODE_ENV=production bun build src/index.ts --minify --format esm --outdir dist --packages external --external react --external react-dom --external react/jsx-runtime --external react-router",
@@ -25,26 +25,26 @@
25
25
  "access": "public"
26
26
  },
27
27
  "devDependencies": {
28
- "@biomejs/biome": "2.2.0",
28
+ "@biomejs/biome": "2.2.3",
29
29
  "@commitlint/cli": "19.8.1",
30
30
  "@commitlint/config-conventional": "19.8.1",
31
31
  "@happy-dom/global-registrator": "18.0.1",
32
32
  "@testing-library/dom": "10.4.1",
33
- "@testing-library/jest-dom": "6.7.0",
33
+ "@testing-library/jest-dom": "6.8.0",
34
34
  "@testing-library/react": "16.3.0",
35
35
  "@testing-library/user-event": "14.6.1",
36
- "@types/bun": "1.2.20",
37
- "@types/js-cookie": "^3.0.6",
38
- "@types/react": "19.1.10",
39
- "@types/react-dom": "19.1.7",
40
- "cspell": "9.2.0",
41
- "knip": "5.62.0",
42
- "lefthook": "1.12.3",
36
+ "@types/bun": "1.2.21",
37
+ "@types/js-cookie": "3.0.6",
38
+ "@types/react": "19.1.12",
39
+ "@types/react-dom": "19.1.9",
40
+ "cspell": "9.2.1",
41
+ "knip": "5.63.1",
42
+ "lefthook": "1.12.4",
43
43
  "only-allow": "1.2.1",
44
44
  "shellcheck": "4.1.0"
45
45
  },
46
46
  "dependencies": {
47
- "better-auth": "1.3.7",
47
+ "better-auth": "1.3.8",
48
48
  "js-cookie": "3.0.5",
49
49
  "polish-plurals": "1.1.0",
50
50
  "tinykeys": "3.0.0"