@bgord/ui 0.6.0 → 0.6.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.
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>"u")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<"u"&&"PointerEvent"in window?"pointerenter":"mouseenter",m=typeof window<"u"&&"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 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 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>"u")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>"u")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
+ 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 g(e,t){q(()=>{if(typeof document>"u")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:p}=o.getBoundingClientRect(),a=n instanceof MouseEvent?n.clientX:n.touches[0].clientX,y=n instanceof MouseEvent?n.clientY:n.touches[0].clientY;if(a>=i&&a<=m&&y>=x&&y<=p)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 l;((r)=>{r.params="params";r.local="local"})(l||={});function L(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()),p=(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 a=s.isEmpty(m)?"":m,y=(c)=>p(c.currentTarget.value);return{strategy:t,defaultValue:i.get(),currentValue:m,value:a,set:p,handleChange:y,clear:()=>p(i.get()),label:{props:{htmlFor:e.name}},input:{props:{id:e.name,name:e.name,value:a,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 A(e){let t=L({...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 C({name:e,defaultValue:t=!1}){let[r,n]=O(t);return{on:r,off:!r,enable:()=>n(!0),disable:()=>n(!1),toggle:()=>n((a)=>!a),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 b(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}=C({name:"is-hovering"}),o=Q(null),i=typeof window<"u"&&"PointerEvent"in window?"pointerenter":"mouseenter",m=typeof window<"u"&&"PointerEvent"in window?"pointerleave":"mouseleave";return{attach:{ref:N((p)=>{let a=o.current;if(a)a.removeEventListener(i,r),a.removeEventListener(m,n);if(o.current=p,p&&e)p.addEventListener(i,r),p.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 f,useCallback as j}from"react";import{polishPlurals as G}from"polish-plurals";function F(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 E=Z({translations:{},language:"en",supportedLanguages:{en:"en"}});function je(){let e=f(E);if(e===void 0)throw 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 p=new RegExp(`{{${m}}}`,"g");return i.replace(p,String(x))},o)},[e.translations])}function R(){let e=f(E);if(e===void 0)throw Error("useLanguage must be used within the TranslationsContext");return e.language}function Ye(){let e=f(E);if(e===void 0)throw Error("useSupportedLanguages must be used within the TranslationsContext");return e.supportedLanguages}function ze(){let e=R();return(t)=>F({...t,language:e})}function mt(e){let t=R(),r=ee(),n=A({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 pt(){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>"u")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 Ct(e){let{toggle:t,rest:r}=b(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),g(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 pe}from"react-router";function kt(){let e=pe();return ue(()=>{let t=()=>e.revalidate();return window.addEventListener("focus",t),()=>window.removeEventListener("focus",t)},[e]),null}import{redirect as w}from"react-router";class d{static extractFrom(e){return e.headers.get("cookie")??""}}class ae{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 w("/")}async requireNoSession(e,t="/home"){if((await this.getServerSession(e))?.user)throw w(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)}),w(t,{headers:o})}}function S(){}var xe=()=>console.warn("Copying to clipboard not supported");async function Bt(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 Jt={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 Qt(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 Yt(){if(typeof window>"u")return;return window}function Vt(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,C as useToggle,Ye as useSupportedLanguages,H as useScrollLock,ze as usePluralize,pt as useMetaEnterSubmit,mt as useLanguageSelector,R as useLanguage,T as useKeyboardShortcuts,Je as useHover,De as useFocusKeyboardShortcut,l as useFieldStrategyEnum,L as useField,Ue as useExitAction,A as useClientFilter,g as useClickOutside,F as pluralize,S as noop,Yt as getSafeWindow,b as extractUseToggle,Qt as exec,Bt as copyToClipboard,de as WeakETag,E as TranslationsContext,Vt as Rhythm,kt as RevalidateOnFocus,I as LocalFields,Te as Form,ye as Fields,s as Field,ce as ETag,Ct as Dialog,Jt as Credentials,d as Cookies,he as Button,ae as AuthGuard};
@@ -8,9 +8,11 @@ type TranslationVariableType = Record<TranslationPlaceholderType, TranslationPla
8
8
  export type TranslationsContextValueType = {
9
9
  translations: TranslationsType;
10
10
  language: string;
11
+ supportedLanguages: Record<string, string>;
11
12
  };
12
13
  export declare const TranslationsContext: import("react").Context<TranslationsContextValueType>;
13
14
  export declare function useTranslations(): (key: TranslationsKeyType, variables?: TranslationVariableType) => string;
14
15
  export declare function useLanguage(): TranslationsContextValueType["language"];
16
+ export declare function useSupportedLanguages(): TranslationsContextValueType["supportedLanguages"];
15
17
  export declare function usePluralize(): (options: Omit<PluralizeOptionsType, "language">) => string;
16
18
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bgord/ui",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -24,10 +24,10 @@
24
24
  "access": "public"
25
25
  },
26
26
  "devDependencies": {
27
- "@biomejs/biome": "2.2.6",
27
+ "@biomejs/biome": "2.2.7",
28
28
  "@commitlint/cli": "20.1.0",
29
29
  "@commitlint/config-conventional": "20.0.0",
30
- "@happy-dom/global-registrator": "20.0.2",
30
+ "@happy-dom/global-registrator": "20.0.8",
31
31
  "@testing-library/dom": "10.4.1",
32
32
  "@testing-library/jest-dom": "6.9.1",
33
33
  "@testing-library/react": "16.3.0",
@@ -36,14 +36,14 @@
36
36
  "@types/js-cookie": "3.0.6",
37
37
  "@types/react": "19.2.2",
38
38
  "@types/react-dom": "19.2.2",
39
- "cspell": "9.2.1",
40
- "knip": "5.65.0",
41
- "lefthook": "1.13.6",
39
+ "cspell": "9.2.2",
40
+ "knip": "5.66.2",
41
+ "lefthook": "2.0.0",
42
42
  "only-allow": "1.2.1",
43
43
  "shellcheck": "4.1.0"
44
44
  },
45
45
  "dependencies": {
46
- "better-auth": "1.3.27",
46
+ "better-auth": "1.3.29",
47
47
  "js-cookie": "3.0.5",
48
48
  "polish-plurals": "1.1.0",
49
49
  "tinykeys": "3.0.0"