@xjur-ui/react 3.0.4 → 3.0.5
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/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext as M,useContext as N}from"react";var u=M({state:"normal",variant:"normal",customMask:void 0,mask:void 0});function n(){let e=N(u);if(!e)throw new Error("useFieldContext must be used within a InputRoot, SelectRoot, DatePickerRoot, etc.");return e}import{tv as F}from"@xjur-ui/util";var a=F({slots:{wrapper:"group flex flex-col gap-small-2x",trigger:["h-large-4x relative","inline-flex w-auto items-center gap-small rounded-small-1x","py-small_1x-alt px-small","bg-layer-2-hover border border-transparent","group-has-[div[data-slot=input-action-slot]]:rounded-r-none","transition-all duration-200"],content:"flex w-full",value:"text-size-body-md font-normal placeholder:text-neutral-placeholder flex-1 outline-none",icon:"size-large text-icon-neutral-3 flex items-center justify-center group-data-[state=open]:rotate-180 transition-transform duration-200",slotText:"size-large flex items-center justify-center !text-size-label-md text-neutral-placeholder",caption:"!text-size-body-sm font-normal",action:"h-large-4x overflow-hidden"},variants:{state:{normal:{trigger:"hover:border-border-layer-1 focus-within:border-primary-idle focus-within:hover:border-primary-idle"},error:{trigger:"border-danger-idle hover:border-danger-idle focus-within:border-danger-idle focus-within:hover:border-danger-idle",caption:"text-danger-label-idle"},disabled:{trigger:"pointer-events-none border-transparent bg-layer-2-idle"}}}});import{jsx as x}from"react/jsx-runtime";var{wrapper:S}=a();function R({className:e,state:t="normal",customMask:o,variant:r="normal",mask:i,...p}){return x(u.Provider,{value:{state:t,customMask:o,mask:i,variant:r},children:x("div",{className:S({className:e,state:t}),...p})})}import{jsx as z}from"react/jsx-runtime";var{content:O}=a();function T({className:e,...t}){let{state:o}=n();return z("div",{className:O({className:e,state:o}),...t})}import{tv as A}from"@xjur-ui/util";import{jsx as g}from"react/jsx-runtime";function b({className:e,htmlFor:t,children:o,...r}){let{state:i}=n(),p=A({base:["group inline-block max-w-full truncate text-left","ease animate-in left-small right-small pointer-events-none absolute top-1/2 -translate-y-1/2 transition-all duration-250","text-size-body-md","group-focus-within:-top-[3px]","group-data-[state=open]:-top-[3px]","group-focus-within:text-size-label-sm-1x group-focus-within:font-medium","group-data-[state=open]:text-size-label-sm-1x group-data-[state=open]:font-medium","group-has-[input:not(:placeholder-shown)]:-top-[3px]","group-has-[input:not(:placeholder-shown)]:text-size-label-sm-1x","group-has-[input:not(:placeholder-shown)]:font-medium","group-has-[div[data-slot=control-left-slot]]:left-large-4x","group-has-[div[data-slot=control-left-slot]]:group-focus-within:left-small","group-has-[div[data-slot=control-left-slot]]:group-has-[input:not(:placeholder-shown)]:left-small","group-has-[div[data-slot=control-left-slot]]:group-data-[state=open]:left-small","group-focus-within:animate-in","group-has-[input:not(:placeholder-shown)]:animate-out","data-[disabled=true]:hidden"],variants:{state:{normal:["group-focus-within:!text-primary-idle group-data-[state=open]:!text-primary-idle","group-has-[input:not(:placeholder-shown)]:!text-primary-idle"],error:["group-focus-within:!text-danger-label-active group-data-[state=open]:!text-danger-label-active","group-has-[input:not(:placeholder-shown)]:!text-danger-label-active"],disabled:[]}}});return g("label",{className:p({className:e,state:i}),htmlFor:t,...r,children:g("span",{className:"rounded-small-1x bg-layer-2-idle max-w-full",children:o})})}import{jsx as V}from"react/jsx-runtime";function E(e){return V(b,{...e})}import{tv as D,twMerge as K}from"@xjur-ui/util";import{jsx as q}from"react/jsx-runtime";var{trigger:L}=a();function $({className:e,...t}){let{state:o,variant:r}=n(),i=D({base:["group bg-layer-2-idle relative"],variants:{state:{normal:["border-border-layer-2 hover:border-border-layer-3 has-[input:not(:placeholder-shown)]:border-primary-idle"],error:["border-danger-idle hover:border-danger-idle"],disabled:["border border-border-layer-2 opacity-60"]}}}),p=K(L({state:o,className:e}),r==="filter"&&i({state:o,className:e}));return q("div",{"aria-disabled":o==="disabled",className:p,...t})}import{InputMask as Y}from"@react-input/mask";function _(e,t){switch(e){case"cpf":return{...t,...G};case"cnpj":return{...t,...H};case"telefone":return{...t,...J};case"cep":return{...t,...U};case"numero-processo":return{...t,...B};case"data":return{...t,...Q};case"hora":return{...t,...W};case"data-hora":return{...t,...X};case"custom":if(!t)throw new Error("Options are required for custom mask");return t}}var G={mask:"###.###.###-##",replacement:{"#":/\d/}},H={mask:"##.###.###/####-##",replacement:{"#":/\d/}},J={mask:"(##) #####-####",replacement:{"#":/\d/}},U={mask:"#####-###",replacement:{"#":/\d/}},B={mask:"#######-##.####.#.##.####",replacement:{"#":/\d/}},Q={mask:"##/##/####",replacement:{"#":/\d/}},W={mask:"##:##",replacement:{"#":/\d/}},X={mask:"##/##/#### ##:##",replacement:{"#":/\d/}};import{jsx as ee}from"react/jsx-runtime";var{value:Z}=a();function j({className:e,placeholder:t,...o}){let{customMask:r,state:i,mask:p,variant:P}=n();return ee(Y,{...o,...p?{..._(p)}:r&&{...r},className:Z({className:e,state:i}),disabled:i==="disabled",placeholder:P==="filter"?" ":t,readOnly:i==="disabled"})}import{jsx as re}from"react/jsx-runtime";var{value:te}=a();function oe({className:e,placeholder:t,...o}){let{state:r,variant:i}=n();return re("input",{...o,className:te({className:e,state:r}),disabled:r==="disabled",placeholder:i==="filter"?" ":t,readOnly:r==="disabled"})}import{NumericFormat as ne}from"react-number-format";import{jsx as v}from"react/jsx-runtime";var{value:ae}=a();function y({className:e,placeholder:t,...
|
|
1
|
+
import{createContext as M,useContext as N}from"react";var u=M({state:"normal",variant:"normal",customMask:void 0,mask:void 0});function n(){let e=N(u);if(!e)throw new Error("useFieldContext must be used within a InputRoot, SelectRoot, DatePickerRoot, etc.");return e}import{tv as F}from"@xjur-ui/util";var a=F({slots:{wrapper:"group flex flex-col gap-small-2x",trigger:["h-large-4x relative","inline-flex w-auto items-center gap-small rounded-small-1x","py-small_1x-alt px-small","bg-layer-2-hover border border-transparent","group-has-[div[data-slot=input-action-slot]]:rounded-r-none","transition-all duration-200"],content:"flex w-full",value:"text-size-body-md font-normal placeholder:text-neutral-placeholder flex-1 outline-none",icon:"size-large text-icon-neutral-3 flex items-center justify-center group-data-[state=open]:rotate-180 transition-transform duration-200",slotText:"size-large flex items-center justify-center !text-size-label-md text-neutral-placeholder",caption:"!text-size-body-sm font-normal",action:"h-large-4x overflow-hidden"},variants:{state:{normal:{trigger:"hover:border-border-layer-1 focus-within:border-primary-idle focus-within:hover:border-primary-idle"},error:{trigger:"border-danger-idle hover:border-danger-idle focus-within:border-danger-idle focus-within:hover:border-danger-idle",caption:"text-danger-label-idle"},disabled:{trigger:"pointer-events-none border-transparent bg-layer-2-idle"}}}});import{jsx as x}from"react/jsx-runtime";var{wrapper:S}=a();function R({className:e,state:t="normal",customMask:o,variant:r="normal",mask:i,...p}){return x(u.Provider,{value:{state:t,customMask:o,mask:i,variant:r},children:x("div",{className:S({className:e,state:t}),...p})})}import{jsx as z}from"react/jsx-runtime";var{content:O}=a();function T({className:e,...t}){let{state:o}=n();return z("div",{className:O({className:e,state:o}),...t})}import{tv as A}from"@xjur-ui/util";import{jsx as g}from"react/jsx-runtime";function b({className:e,htmlFor:t,children:o,...r}){let{state:i}=n(),p=A({base:["group inline-block max-w-full truncate text-left","ease animate-in left-small right-small pointer-events-none absolute top-1/2 -translate-y-1/2 transition-all duration-250","text-size-body-md","group-focus-within:-top-[3px]","group-data-[state=open]:-top-[3px]","group-focus-within:text-size-label-sm-1x group-focus-within:font-medium","group-data-[state=open]:text-size-label-sm-1x group-data-[state=open]:font-medium","group-has-[input:not(:placeholder-shown)]:-top-[3px]","group-has-[input:not(:placeholder-shown)]:text-size-label-sm-1x","group-has-[input:not(:placeholder-shown)]:font-medium","group-has-[div[data-slot=control-left-slot]]:left-large-4x","group-has-[div[data-slot=control-left-slot]]:group-focus-within:left-small","group-has-[div[data-slot=control-left-slot]]:group-has-[input:not(:placeholder-shown)]:left-small","group-has-[div[data-slot=control-left-slot]]:group-data-[state=open]:left-small","group-focus-within:animate-in","group-has-[input:not(:placeholder-shown)]:animate-out","data-[disabled=true]:hidden"],variants:{state:{normal:["group-focus-within:!text-primary-idle group-data-[state=open]:!text-primary-idle","group-has-[input:not(:placeholder-shown)]:!text-primary-idle"],error:["group-focus-within:!text-danger-label-active group-data-[state=open]:!text-danger-label-active","group-has-[input:not(:placeholder-shown)]:!text-danger-label-active"],disabled:[]}}});return g("label",{className:p({className:e,state:i}),htmlFor:t,...r,children:g("span",{className:"rounded-small-1x bg-layer-2-idle max-w-full",children:o})})}import{jsx as V}from"react/jsx-runtime";function E(e){return V(b,{...e})}import{tv as D,twMerge as K}from"@xjur-ui/util";import{jsx as q}from"react/jsx-runtime";var{trigger:L}=a();function $({className:e,...t}){let{state:o,variant:r}=n(),i=D({base:["group bg-layer-2-idle relative"],variants:{state:{normal:["border-border-layer-2 hover:border-border-layer-3 has-[input:not(:placeholder-shown)]:border-primary-idle"],error:["border-danger-idle hover:border-danger-idle"],disabled:["border border-border-layer-2 opacity-60"]}}}),p=K(L({state:o,className:e}),r==="filter"&&i({state:o,className:e}));return q("div",{"aria-disabled":o==="disabled",className:p,...t})}import{InputMask as Y}from"@react-input/mask";function _(e,t){switch(e){case"cpf":return{...t,...G};case"cnpj":return{...t,...H};case"telefone":return{...t,...J};case"cep":return{...t,...U};case"numero-processo":return{...t,...B};case"data":return{...t,...Q};case"hora":return{...t,...W};case"data-hora":return{...t,...X};case"custom":if(!t)throw new Error("Options are required for custom mask");return t}}var G={mask:"###.###.###-##",replacement:{"#":/\d/}},H={mask:"##.###.###/####-##",replacement:{"#":/\d/}},J={mask:"(##) #####-####",replacement:{"#":/\d/}},U={mask:"#####-###",replacement:{"#":/\d/}},B={mask:"#######-##.####.#.##.####",replacement:{"#":/\d/}},Q={mask:"##/##/####",replacement:{"#":/\d/}},W={mask:"##:##",replacement:{"#":/\d/}},X={mask:"##/##/#### ##:##",replacement:{"#":/\d/}};import{jsx as ee}from"react/jsx-runtime";var{value:Z}=a();function j({className:e,placeholder:t,...o}){let{customMask:r,state:i,mask:p,variant:P}=n();return ee(Y,{...o,...p?{..._(p)}:r&&{...r},className:Z({className:e,state:i}),disabled:i==="disabled",placeholder:P==="filter"?" ":t,readOnly:i==="disabled"})}import{jsx as re}from"react/jsx-runtime";var{value:te}=a();function oe({className:e,placeholder:t,...o}){let{state:r,variant:i}=n();return re("input",{...o,className:te({className:e,state:r}),disabled:r==="disabled",placeholder:i==="filter"?" ":t,readOnly:r==="disabled"})}import{NumericFormat as ne}from"react-number-format";import{jsx as v}from"react/jsx-runtime";var{value:ae}=a();function y({className:e,placeholder:t,value:o,...r}){let{state:i,variant:p}=n();return v(ne,{className:ae({className:e,state:i}),disabled:i==="disabled",placeholder:p==="filter"?" ":t,readOnly:i==="disabled",value:o||"",...r})}function c(e){return v(y,{allowNegative:!1,decimalScale:2,decimalSeparator:",",fixedDecimalScale:!0,inputMode:"decimal",thousandSeparator:".",...e})}import{cx as ie}from"@xjur-ui/util";import{jsx as pe}from"react/jsx-runtime";function l({className:e,filled:t=!1,name:o,...r}){return pe("span",{...r,className:ie("material-symbols-outlined","text-size-body-lg select-none",e),style:{fontVariationSettings:`'FILL' ${t?1:0}, 'wght' 600, 'GRAD' 0, 'opsz' 20`,...r.style},children:o})}import{jsx as w}from"react/jsx-runtime";var{icon:le}=a();function se({className:e,name:t,orientation:o="left",...r}){let{state:i}=n();return w("div",{className:le({className:e,state:i}),"data-slot":`control-${o}-slot`,...r,children:w(l,{name:t})})}import{jsx as ce}from"react/jsx-runtime";var{slotText:me}=a();function d({className:e,...t}){let{state:o}=n();return ce("span",{className:me({className:e,state:o}),...t})}import{jsx as fe}from"react/jsx-runtime";var{caption:de}=a();function ue({className:e,...t}){let{state:o}=n();return fe("p",{className:de({className:e,state:o}),...t})}import{jsx as xe}from"react/jsx-runtime";var{action:he}=a();function f({className:e,...t}){let{state:o}=n();return xe("div",{className:he({className:e,state:o}),"data-slot":"input-action-slot",...t})}import"react";import*as C from"@radix-ui/react-separator";import{cx as ge}from"@xjur-ui/util";import{jsx as be}from"react/jsx-runtime";function k({className:e,orientation:t="horizontal",decorative:o=!0,...r}){return be(C.Root,{className:ge("bg-border-layer-2 shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full","data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),"data-slot":"separator",decorative:o,orientation:t,...r})}import{jsx as s,jsxs as ye}from"react/jsx-runtime";function _e({handleIncrement:e,handleDecrement:t}){return ye(f,{className:"w-large-4x border-border-layer-2 rounded-r-small-1x bg-layer-2-hover flex flex-col items-center justify-center border",children:[s("button",{className:"flex h-1/2 items-center justify-center",type:"button",onClick:e,children:s(l,{className:"text-icon-neutral-3",name:"keyboard_arrow_up"})}),s(k,{}),s("button",{className:"flex h-1/2 items-center justify-center",type:"button",onClick:t,children:s(l,{className:"text-icon-neutral-3",name:"keyboard_arrow_down"})})]})}import{twMerge as I}from"@xjur-ui/util";import{jsx as m,jsxs as h}from"react/jsx-runtime";function ve({range:e,onRangeChange:t}){return h("div",{className:"group gap-small flex items-center",children:[h("div",{className:"gap-small-1x flex h-full max-w-[240px] min-w-[100px] grow items-center",children:[m(d,{children:"R$"}),m(c,{value:e?.from,onValueChange:o=>{t?.({...e,from:o.floatValue})}})]}),m("span",{className:I("text-size-label-md text-neutral-placeholder","hidden group-focus-within:block group-has-[input:not(:placeholder-shown)]:block"),children:"-"}),h("div",{className:I("gap-small-1x flex h-full max-w-[240px] min-w-[100px] grow items-center transition-all","hidden group-focus-within:flex group-has-[input:not(:placeholder-shown)]:flex"),children:[m(d,{children:"R$"}),m(c,{value:e?.to,onValueChange:o=>{t?.({...e,to:o.floatValue})}})]})]})}export{f as InputAction,ue as InputCaption,T as InputContent,c as InputCurrency,ve as InputCurrencyRange,se as InputIcon,E as InputLabel,j as InputMask,y as InputNumber,_e as InputNumericStepper,R as InputRoot,d as InputSlot,oe as InputText,$ as InputTrigger};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{twMerge as m}from"@xjur-ui/util";import{NumericFormat as
|
|
1
|
+
import{twMerge as m}from"@xjur-ui/util";import{NumericFormat as b}from"react-number-format";import{createContext as f,useContext as x}from"react";var g=f({state:"normal",variant:"normal",customMask:void 0,mask:void 0});function n(){let e=x(g);if(!e)throw new Error("useFieldContext must be used within a InputRoot, SelectRoot, DatePickerRoot, etc.");return e}import{tv as h}from"@xjur-ui/util";var a=h({slots:{wrapper:"group flex flex-col gap-small-2x",trigger:["h-large-4x relative","inline-flex w-auto items-center gap-small rounded-small-1x","py-small_1x-alt px-small","bg-layer-2-hover border border-transparent","group-has-[div[data-slot=input-action-slot]]:rounded-r-none","transition-all duration-200"],content:"flex w-full",value:"text-size-body-md font-normal placeholder:text-neutral-placeholder flex-1 outline-none",icon:"size-large text-icon-neutral-3 flex items-center justify-center group-data-[state=open]:rotate-180 transition-transform duration-200",slotText:"size-large flex items-center justify-center !text-size-label-md text-neutral-placeholder",caption:"!text-size-body-sm font-normal",action:"h-large-4x overflow-hidden"},variants:{state:{normal:{trigger:"hover:border-border-layer-1 focus-within:border-primary-idle focus-within:hover:border-primary-idle"},error:{trigger:"border-danger-idle hover:border-danger-idle focus-within:border-danger-idle focus-within:hover:border-danger-idle",caption:"text-danger-label-idle"},disabled:{trigger:"pointer-events-none border-transparent bg-layer-2-idle"}}}});import{jsx as u}from"react/jsx-runtime";var{value:v}=a();function y({className:e,placeholder:r,value:t,...d}){let{state:l,variant:c}=n();return u(b,{className:v({className:e,state:l}),disabled:l==="disabled",placeholder:c==="filter"?" ":r,readOnly:l==="disabled",value:t||"",...d})}function i(e){return u(y,{allowNegative:!1,decimalScale:2,decimalSeparator:",",fixedDecimalScale:!0,inputMode:"decimal",thousandSeparator:".",...e})}import{jsx as C}from"react/jsx-runtime";var{slotText:w}=a();function s({className:e,...r}){let{state:t}=n();return C("span",{className:w({className:e,state:t}),...r})}import{jsx as o,jsxs as p}from"react/jsx-runtime";function q({range:e,onRangeChange:r}){return p("div",{className:"group gap-small flex items-center",children:[p("div",{className:"gap-small-1x flex h-full max-w-[240px] min-w-[100px] grow items-center",children:[o(s,{children:"R$"}),o(i,{value:e?.from,onValueChange:t=>{r?.({...e,from:t.floatValue})}})]}),o("span",{className:m("text-size-label-md text-neutral-placeholder","hidden group-focus-within:block group-has-[input:not(:placeholder-shown)]:block"),children:"-"}),p("div",{className:m("gap-small-1x flex h-full max-w-[240px] min-w-[100px] grow items-center transition-all","hidden group-focus-within:flex group-has-[input:not(:placeholder-shown)]:flex"),children:[o(s,{children:"R$"}),o(i,{value:e?.to,onValueChange:t=>{r?.({...e,to:t.floatValue})}})]})]})}export{q as InputCurrencyRange};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type NumericFormatProps } from 'react-number-format';
|
|
2
2
|
import type { ComponentProps } from 'react';
|
|
3
|
-
export declare function InputNumber({ className, placeholder, ...props }: NumericFormatProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function InputNumber({ className, placeholder, value: valueProp, ...props }: NumericFormatProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare function InputCurrency(props: ComponentProps<typeof InputNumber>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{NumericFormat as
|
|
1
|
+
import{NumericFormat as c}from"react-number-format";import{createContext as d,useContext as p}from"react";var u=d({state:"normal",variant:"normal",customMask:void 0,mask:void 0});function r(){let e=p(u);if(!e)throw new Error("useFieldContext must be used within a InputRoot, SelectRoot, DatePickerRoot, etc.");return e}import{tv as m}from"@xjur-ui/util";var o=m({slots:{wrapper:"group flex flex-col gap-small-2x",trigger:["h-large-4x relative","inline-flex w-auto items-center gap-small rounded-small-1x","py-small_1x-alt px-small","bg-layer-2-hover border border-transparent","group-has-[div[data-slot=input-action-slot]]:rounded-r-none","transition-all duration-200"],content:"flex w-full",value:"text-size-body-md font-normal placeholder:text-neutral-placeholder flex-1 outline-none",icon:"size-large text-icon-neutral-3 flex items-center justify-center group-data-[state=open]:rotate-180 transition-transform duration-200",slotText:"size-large flex items-center justify-center !text-size-label-md text-neutral-placeholder",caption:"!text-size-body-sm font-normal",action:"h-large-4x overflow-hidden"},variants:{state:{normal:{trigger:"hover:border-border-layer-1 focus-within:border-primary-idle focus-within:hover:border-primary-idle"},error:{trigger:"border-danger-idle hover:border-danger-idle focus-within:border-danger-idle focus-within:hover:border-danger-idle",caption:"text-danger-label-idle"},disabled:{trigger:"pointer-events-none border-transparent bg-layer-2-idle"}}}});import{jsx as a}from"react/jsx-runtime";var{value:f}=o();function x({className:e,placeholder:n,value:i,...l}){let{state:t,variant:s}=r();return a(c,{className:f({className:e,state:t}),disabled:t==="disabled",placeholder:s==="filter"?" ":n,readOnly:t==="disabled",value:i||"",...l})}function C(e){return a(x,{allowNegative:!1,decimalScale:2,decimalSeparator:",",fixedDecimalScale:!0,inputMode:"decimal",thousandSeparator:".",...e})}export{C as InputCurrency,x as InputNumber};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xjur-ui/react",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React components for XJur Design System",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -121,8 +121,8 @@
|
|
|
121
121
|
"tailwindcss": "^4.1.11",
|
|
122
122
|
"tsup": "^8.5.0",
|
|
123
123
|
"typescript": "^5.9.3",
|
|
124
|
-
"@xjur-ui/
|
|
125
|
-
"@xjur-ui/
|
|
124
|
+
"@xjur-ui/eslint-config": "1.0.2",
|
|
125
|
+
"@xjur-ui/typescript-config": "1.0.2"
|
|
126
126
|
},
|
|
127
127
|
"scripts": {
|
|
128
128
|
"build": "tsup",
|