@xjur-ui/react 2.2.1 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xjur-ui/react",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "type": "module",
5
5
  "description": "React components for XJur Design System",
6
6
  "types": "dist/index.d.ts",
@@ -1,2 +0,0 @@
1
- import {a as a$1}from'./chunk-JGPHBUVM.js';import {a,b}from'./chunk-2JQVYVAT.js';import {a as a$3,d,e,b as b$2,c}from'./chunk-YOLTIAFT.js';import {b as b$1}from'./chunk-DVDHTP4C.js';import {a as a$2}from'./chunk-EIG6CBTQ.js';import {tv,twMerge,twJoin}from'@xjur-ui/util';import {useMemo}from'react';import*as p from'@radix-ui/react-popover';import {jsx,jsxs}from'react/jsx-runtime';var S=tv({slots:{wrapper:"group flex w-full flex-col gap-small-2x",trigger:["h-large-4x w-full cursor-pointer relative","flex items-center gap-small rounded-small-1x justify-between","py-small_1x-alt px-small","bg-layer-2-idle border border-border-layer-2","group-has-[div[data-slot=input-action-slot]]:rounded-r-none","transition-all duration-200"],content:["group z-1000 max-h-[var(--radix-popover-content-available-height)] max-w-[var(--radix-popover-content-available-width)] min-w-[var(--radix-popover-trigger-width)]"],icon:"size-large text-icon-neutral-3 flex items-center justify-center",slotText:"size-large flex items-center justify-center !text-size-label-md text-neutral-placeholder",caption:"!text-size-body-sm font-normal"},variants:{state:{normal:{trigger:"hover:border-border-layer-3 data-[state=open]:border-primary-idle data-[state=open]:hover:border-primary-idle"},error:{trigger:"border-danger-idle hover:border-danger-idle data-[state=open]:border-danger-idle data-[state=open]:hover:border-danger-idle",caption:"text-danger-label-idle"},disabled:{trigger:"pointer-events-none border-transparent bg-layer-2-idle"}}}}),{wrapper:T,trigger:L,icon:N,caption:O,slotText:F,content:H}=S();function J({className:e,state:t="normal",defaultOpen:o,variant:n="normal",modal:i,open:a$1,onOpenChange:s,...R}){return jsx(p.Root,{defaultOpen:o,modal:i,open:a$1,onOpenChange:s,children:jsx(a.Provider,{value:{state:t,variant:n},children:jsx("div",{className:T({className:e,state:t}),...R})})})}function _({className:e,...t}){let{state:o,variant:n}=b(),i=tv({base:["group bg-layer-2-idle"],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"]}}}),a=twMerge(L({state:o,className:e}),n==="filter"&&i({state:o,className:e}));return jsx(p.Trigger,{className:a,disabled:o==="disabled",...t})}function q({className:e,name:t,...o}){let{state:n}=b();return jsx("div",{className:N({className:e,state:n}),...o,children:jsx(b$1,{name:t})})}function B(e){return jsx(a$1,{...e})}function D({className:e,displayValue:t="",value:o,placeholder:n,...i}){let{variant:a}=b(),s=useMemo(()=>a==="filter"?t:t||n,[t,n,a]);return jsxs("div",{className:"flex w-full",children:[jsx(a$2,{className:"text-neutral-dark group-has-[div[data-slot=date-picker-left-slot]]:pl-large-1x",children:s}),jsx("input",{...i,"aria-readonly":true,className:twJoin("pointer-events-none",e),hidden:true,placeholder:" ",readOnly:true,value:o??""})]})}function E({className:e,value:t,placeholder:o,children:n,...i}){let{variant:a}=b(),s=useMemo(()=>a==="filter"?false:Array.isArray(t)&&t.length===0&&o,[t,o,a]);return jsxs("div",{className:twMerge(e,"gap-small-1x scrollbar-hide flex w-full overflow-x-hidden","group-disabled:!pl-0"),children:[s&&jsx(a$2,{className:"text-neutral-dark group-has-[div[data-slot=date-picker-left-slot]]:pl-large-1x",children:o}),n,jsx("input",{...i,"aria-readonly":true,className:twMerge(e,"pointer-events-none"),hidden:true,placeholder:" ",readOnly:true,value:t})]})}function G({className:e,sideOffset:t=5,side:o="bottom",align:n="start",children:i,...a}){let{state:s}=b();return jsx(p.Portal,{children:jsx(p.Content,{align:n,className:H({className:e,state:s}),side:o,sideOffset:t,...a,children:jsx(a$3,{children:i})})})}function K({className:e,...t}){let{state:o}=b();return jsx("p",{className:O({className:e,state:o}),...t})}function Q({className:e,...t}){let{state:o}=b();return jsx("span",{className:F({className:e,state:o}),...t})}function U(e){return jsx(d,{...e})}function W({className:e$1,...t}){return jsx(e,{className:twMerge(e$1,"cursor-pointer"),...t})}function X(e){return jsx(a$2,{...e})}function Y(e){return jsx(b$2,{...e})}function Z(e){return jsx(c,{...e})}export{S as a,J as b,_ as c,q as d,B as e,D as f,E as g,G as h,K as i,Q as j,U as k,W as l,X as m,Y as n,Z as o};//# sourceMappingURL=chunk-2JU3PFV2.js.map
2
- //# sourceMappingURL=chunk-2JU3PFV2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/controls/select.tsx"],"names":["select","tv","wrapper","trigger","icon","caption","slotText","content","SelectRoot","className","state","defaultOpen","variant","modal","open","handleOpenChange","props","jsx","FieldContext","SelectTrigger","useFieldContext","filterTrigger","mergedClassName","twMerge","SelectIcon","name","Icon","SelectLabel","FloatingLabel","SelectValue","displayValue","value","placeholder","valueOrPlaceholder","useMemo","jsxs","Typography","twJoin","SelectMultiValue","children","shouldShowPlaceholder","SelectContent","sideOffset","side","align","ListRoot","SelectCaption","SelectSlot","SelectOptions","ListContent","SelectOption","ListItem","SelectOptionText","SelectHeader","ListHeader","SelectHeaderTitle","ListHeaderTitle"],"mappings":"8XAmBO,IAAMA,EAASC,EAAAA,CAAG,CACvB,KAAA,CAAO,CACL,QAAS,yCAAA,CACT,OAAA,CAAS,CACP,2CAAA,CACA,+DACA,0BAAA,CACA,8CAAA,CACA,6DAAA,CACA,6BACF,EACA,OAAA,CAAS,CACP,oKACF,CAAA,CACA,KAAM,iEAAA,CACN,QAAA,CACE,0FAAA,CACF,OAAA,CAAS,gCACX,CAAA,CACA,QAAA,CAAU,CACR,KAAA,CAAO,CACL,MAAA,CAAQ,CACN,OAAA,CACE,+GACJ,EACA,KAAA,CAAO,CACL,OAAA,CACE,6HAAA,CACF,QAAS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C1E,GAAM,CAAE,KAAA,CAAAN,CAAM,EAAIU,CAAAA,EAAgB,CAClC,OAAOH,GAAAA,CAAC,QAAK,SAAA,CAAWX,CAAAA,CAAS,CAAE,SAAA,CAAAG,EAAW,KAAA,CAAAC,CAAM,CAAC,CAAA,CAAI,GAAGM,CAAAA,CAAO,CACrE,CAEO,SAASgC,EAAchC,CAAAA,CAA2C,CACvE,OAAOC,GAAAA,CAACgC,EAAA,CAAa,GAAGjC,CAAAA,CAAO,CACjC,CAEO,SAASkC,CAAAA,CAAa,CAC3B,SAAA,CAAAzC,IACA,GAAGO,CACL,CAAA,CAAoC,CAClC,OACEC,GAAAA,CAACkC,CAAAA,CAAA,CAAS,SAAA,CAAW5B,QAAQd,GAAAA,CAAW,gBAAgB,CAAA,CAAI,GAAGO,EAAO,CAE1E,CAEO,SAASoC,CAAAA,CAAiBpC,EAA0C,CACzE,OAAOC,GAAAA,CAACmB,GAAAA,CAAA,CAAY,GAAGpB,CAAAA,CAAO,CAChC,CAEO,SAASqC,CAAAA,CAAarC,CAAAA,CAA0C,CACrE,OAAOC,IAACqC,GAAAA,CAAA,CAAY,GAAGtC,CAAAA,CAAO,CAChC,CAEO,SAASuC,CAAAA,CACdvC,CAAAA,CACA,CACA,OAAOC,GAAAA,CAACuC,EAAA,CAAiB,GAAGxC,EAAO,CACrC","file":"chunk-2JU3PFV2.js","sourcesContent":["import { tv, twJoin, twMerge } from '@xjur-ui/util'\nimport { useMemo, type ComponentProps } from 'react'\nimport * as RadixPopover from '@radix-ui/react-popover'\nimport { Icon, type IconType } from '../icon'\nimport { Typography } from '../typography'\nimport {\n ListHeaderTitle,\n ListHeader,\n ListContent,\n ListItem,\n ListRoot\n} from '../list'\nimport {\n FieldContext,\n useFieldContext,\n type FieldContextValue\n} from './context/field.context'\nimport { FloatingLabel } from './floating-label'\n\nexport const select = tv({\n slots: {\n wrapper: 'group flex w-full flex-col gap-small-2x',\n trigger: [\n 'h-large-4x w-full cursor-pointer relative',\n 'flex items-center gap-small rounded-small-1x justify-between',\n 'py-small_1x-alt px-small',\n 'bg-layer-2-idle border border-border-layer-2',\n 'group-has-[div[data-slot=input-action-slot]]:rounded-r-none',\n 'transition-all duration-200'\n ],\n content: [\n 'group z-1000 max-h-[var(--radix-popover-content-available-height)] max-w-[var(--radix-popover-content-available-width)] min-w-[var(--radix-popover-trigger-width)]'\n ],\n icon: 'size-large text-icon-neutral-3 flex items-center justify-center',\n slotText:\n 'size-large flex items-center justify-center !text-size-label-md text-neutral-placeholder',\n caption: '!text-size-body-sm font-normal'\n },\n variants: {\n state: {\n normal: {\n trigger:\n 'hover:border-border-layer-3 data-[state=open]:border-primary-idle data-[state=open]:hover:border-primary-idle'\n },\n error: {\n trigger:\n 'border-danger-idle hover:border-danger-idle data-[state=open]:border-danger-idle data-[state=open]:hover:border-danger-idle',\n caption: 'text-danger-label-idle'\n },\n disabled: {\n trigger: 'pointer-events-none border-transparent bg-layer-2-idle'\n }\n }\n }\n})\n\nconst { wrapper, trigger, icon, caption, slotText, content } = select()\n\nexport function SelectRoot({\n className,\n state = 'normal',\n defaultOpen,\n variant = 'normal',\n modal,\n open,\n onOpenChange: handleOpenChange,\n ...props\n}: ComponentProps<'div'> &\n FieldContextValue &\n ComponentProps<typeof RadixPopover.Root>) {\n return (\n <RadixPopover.Root\n defaultOpen={defaultOpen}\n modal={modal}\n open={open}\n onOpenChange={handleOpenChange}\n >\n <FieldContext.Provider value={{ state, variant }}>\n <div className={wrapper({ className, state })} {...props} />\n </FieldContext.Provider>\n </RadixPopover.Root>\n )\n}\n\nexport function SelectTrigger({\n className,\n ...props\n}: ComponentProps<typeof RadixPopover.Trigger>) {\n const { state, variant } = useFieldContext()\n\n const filterTrigger = tv({\n base: ['group bg-layer-2-idle'],\n variants: {\n state: {\n normal: [\n 'border-border-layer-2 hover:border-border-layer-3 has-[input:not(:placeholder-shown)]:border-primary-idle'\n ],\n error: ['border-danger-idle hover:border-danger-idle'],\n disabled: ['border border-border-layer-2 opacity-60']\n }\n }\n })\n\n const mergedClassName = twMerge(\n trigger({ state, className }),\n variant === 'filter' && filterTrigger({ state, className })\n )\n\n return (\n <RadixPopover.Trigger\n className={mergedClassName}\n disabled={state === 'disabled'}\n {...props}\n />\n )\n}\n\nexport function SelectIcon({\n className,\n name,\n ...props\n}: ComponentProps<'div'> & {\n name: IconType\n}) {\n const { state } = useFieldContext()\n\n return (\n <div className={icon({ className, state })} {...props}>\n <Icon name={name} />\n </div>\n )\n}\n\nexport function SelectLabel(props: ComponentProps<typeof FloatingLabel>) {\n return <FloatingLabel {...props} />\n}\n\nexport function SelectValue({\n className,\n displayValue = '',\n value,\n placeholder,\n ...props\n}: ComponentProps<'input'> & { displayValue?: string }) {\n const { variant } = useFieldContext()\n\n const valueOrPlaceholder = useMemo(() => {\n if (variant === 'filter') return displayValue\n return displayValue || placeholder\n }, [displayValue, placeholder, variant])\n\n return (\n <div className=\"flex w-full\">\n <Typography className=\"text-neutral-dark group-has-[div[data-slot=date-picker-left-slot]]:pl-large-1x\">\n {valueOrPlaceholder}\n </Typography>\n\n <input\n {...props}\n aria-readonly={true}\n className={twJoin('pointer-events-none', className)}\n hidden={true}\n placeholder={' '}\n readOnly={true}\n value={value ?? ''}\n />\n </div>\n )\n}\n\nexport function SelectMultiValue({\n className,\n value,\n placeholder,\n children,\n ...props\n}: ComponentProps<'input'>) {\n const { variant } = useFieldContext()\n\n const shouldShowPlaceholder = useMemo(() => {\n if (variant === 'filter') return false\n return Array.isArray(value) && value.length === 0 && placeholder\n }, [value, placeholder, variant])\n\n return (\n <div\n className={twMerge(\n className,\n 'gap-small-1x scrollbar-hide flex w-full overflow-x-hidden',\n 'group-disabled:!pl-0'\n )}\n >\n {shouldShowPlaceholder && (\n <Typography className=\"text-neutral-dark group-has-[div[data-slot=date-picker-left-slot]]:pl-large-1x\">\n {placeholder}\n </Typography>\n )}\n\n {children}\n\n <input\n {...props}\n aria-readonly={true}\n className={twMerge(className, 'pointer-events-none')}\n hidden={true}\n placeholder={' '}\n readOnly={true}\n value={value}\n />\n </div>\n )\n}\n\nexport function SelectContent({\n className,\n sideOffset = 5,\n side = 'bottom',\n align = 'start',\n children,\n ...props\n}: ComponentProps<typeof RadixPopover.Content>) {\n const { state } = useFieldContext()\n\n return (\n <RadixPopover.Portal>\n <RadixPopover.Content\n align={align}\n className={content({ className, state })}\n side={side}\n sideOffset={sideOffset}\n {...props}\n >\n <ListRoot>{children}</ListRoot>\n </RadixPopover.Content>\n </RadixPopover.Portal>\n )\n}\n\nexport function SelectCaption({ className, ...props }: ComponentProps<'p'>) {\n const { state } = useFieldContext()\n return <p className={caption({ className, state })} {...props} />\n}\n\nexport function SelectSlot({ className, ...props }: ComponentProps<'span'>) {\n const { state } = useFieldContext()\n return <span className={slotText({ className, state })} {...props} />\n}\n\nexport function SelectOptions(props: ComponentProps<typeof ListContent>) {\n return <ListContent {...props} />\n}\n\nexport function SelectOption({\n className,\n ...props\n}: ComponentProps<typeof ListItem>) {\n return (\n <ListItem className={twMerge(className, 'cursor-pointer')} {...props} />\n )\n}\n\nexport function SelectOptionText(props: ComponentProps<typeof Typography>) {\n return <Typography {...props} />\n}\n\nexport function SelectHeader(props: ComponentProps<typeof ListHeader>) {\n return <ListHeader {...props} />\n}\n\nexport function SelectHeaderTitle(\n props: ComponentProps<typeof ListHeaderTitle>\n) {\n return <ListHeaderTitle {...props} />\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/controls/input.tsx"],"names":["input","tv","wrapper","trigger","content","value","icon","caption","action","slotText","InputRoot","className","state","customMask","variant","mask","props","jsx","FieldContext","InputContent","useFieldContext","InputLabel","FloatingLabel","InputTrigger","filterTrigger","mergedClassName","twMerge","InputMask","placeholder","InputMaskComponent","inputMask","InputText","InputNumber","locales","groupDisplay","InputNumberFormat","InputIcon","name","Icon","InputSlot","InputCaption","InputAction","InputNumericStepper","handleIncrement","handleDecrement","jsxs","Divider"],"mappings":"uYAiBO,IAAMA,EAAQC,EAAAA,CAA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AE,SAAA,CAAAI,CAAAA,CAAW,KAAA,CAAAC,CAAM,CAAC,CAAA,CAAI,GAAGI,CAAAA,CAAO,CACjE,CAEO,SAASyB,CAAAA,CAAY,CAAE,SAAA,CAAA9B,EAAW,GAAGK,CAAM,CAAA,CAA0B,CAC1E,GAAM,CAAE,KAAA,CAAAJ,CAAM,CAAA,CAAIQ,GAAgB,CAClC,OACEH,GAAAA,CAAC,KAAA,CAAA,CACC,UAAWT,CAAAA,CAAO,CAAE,SAAA,CAAAG,CAAAA,CAAW,MAAAC,CAAM,CAAC,CAAA,CACtC,WAAA,CAAU,oBACT,GAAGI,CAAAA,CACN,CAEJ,CAEO,SAAS0B,CAAAA,CAAoB,CAClC,eAAA,CAAAC,CAAAA,CACA,gBAAAC,CACF,CAAA,CAGG,CACD,OACEC,KAACJ,CAAAA,CAAA,CAAY,SAAA,CAAU,uHAAA,CACrB,UAAAxB,GAAAA,CAAC,QAAA,CAAA,CACC,SAAA,CAAU,wCAAA,CACV,KAAK,QAAA,CACL,OAAA,CAAS0B,CAAAA,CAET,QAAA,CAAA1B,IAACqB,GAAAA,CAAA,CAAK,SAAA,CAAU,qBAAA,CAAsB,KAAK,mBAAA,CAAoB,CAAA,CACjE,CAAA,CAEArB,GAAAA,CAAC6B,IAAA,EAAQ,CAAA,CAET7B,GAAAA,CAAC,QAAA,CAAA,CACC,UAAU,wCAAA,CACV,IAAA,CAAK,QAAA,CACL,OAAA,CAAS2B,EAET,QAAA,CAAA3B,GAAAA,CAACqB,GAAAA,CAAA,CAAK,UAAU,qBAAA,CAAsB,IAAA,CAAK,qBAAA,CAAsB,CAAA,CACnE,GACF,CAEJ","file":"chunk-3H75F4Y2.js","sourcesContent":["import { tv, twMerge } from '@xjur-ui/util'\nimport type { ComponentProps } from 'react'\nimport { InputMask as InputMaskComponent } from '@react-input/mask'\nimport {\n InputNumberFormat,\n type InputNumberFormatProps\n} from '@react-input/number-format'\nimport { Icon, type IconType } from '../icon'\nimport { inputMask } from '../../resources/input-mask'\nimport { Divider } from '../divider'\nimport {\n type FieldContextValue,\n FieldContext,\n useFieldContext\n} from './context/field.context'\nimport { FloatingLabel } from './floating-label'\n\nexport const input = tv({\n slots: {\n wrapper: 'group flex w-full flex-col gap-small-2x',\n trigger: [\n 'h-large-4x w-full relative',\n 'flex items-center gap-small rounded-small-1x',\n 'py-small_1x-alt px-small',\n 'bg-layer-2-hover border border-transparent',\n 'group-has-[div[data-slot=input-action-slot]]:rounded-r-none',\n 'transition-all duration-200'\n ],\n content: 'flex w-full',\n value:\n 'text-size-body-md font-normal placeholder:text-neutral-placeholder flex-1 outline-none',\n icon: 'size-large text-icon-neutral-3 flex items-center justify-center',\n slotText:\n 'size-large flex items-center justify-center !text-size-label-md text-neutral-placeholder',\n caption: '!text-size-body-sm font-normal',\n action: 'h-large-4x overflow-hidden'\n },\n variants: {\n state: {\n normal: {\n trigger:\n 'hover:border-border-layer-1 focus-within:border-primary-idle focus-within:hover:border-primary-idle'\n },\n error: {\n trigger:\n 'border-danger-idle hover:border-danger-idle focus-within:border-danger-idle focus-within:hover:border-danger-idle',\n caption: 'text-danger-label-idle'\n },\n disabled: {\n trigger: 'pointer-events-none border-transparent bg-layer-2-idle'\n }\n }\n }\n})\n\nconst { wrapper, trigger, content, value, icon, caption, action, slotText } =\n input()\n\nexport function InputRoot({\n className,\n state = 'normal',\n customMask,\n variant = 'normal',\n mask,\n ...props\n}: ComponentProps<'div'> & FieldContextValue) {\n return (\n <FieldContext.Provider value={{ state, customMask, mask, variant }}>\n <div className={wrapper({ className, state })} {...props} />\n </FieldContext.Provider>\n )\n}\n\nexport function InputContent({ className, ...props }: ComponentProps<'div'>) {\n const { state } = useFieldContext()\n return <div className={content({ className, state })} {...props} />\n}\n\nexport function InputLabel(props: ComponentProps<typeof FloatingLabel>) {\n return <FloatingLabel {...props} />\n}\n\nexport function InputTrigger({ className, ...props }: ComponentProps<'div'>) {\n const { state, variant } = useFieldContext()\n\n const filterTrigger = tv({\n base: ['group bg-layer-2-idle relative'],\n variants: {\n state: {\n normal: [\n 'border-border-layer-2 hover:border-border-layer-3 has-[input:not(:placeholder-shown)]:border-primary-idle'\n ],\n error: ['border-danger-idle hover:border-danger-idle'],\n disabled: ['border border-border-layer-2 opacity-60']\n }\n }\n })\n\n const mergedClassName = twMerge(\n trigger({ state, className }),\n variant === 'filter' && filterTrigger({ state, className })\n )\n\n return (\n <div\n aria-disabled={state === 'disabled'}\n className={mergedClassName}\n {...props}\n />\n )\n}\n\nexport function InputMask({\n className,\n placeholder,\n ...props\n}: ComponentProps<'input'>) {\n const { customMask, state, mask, variant } = useFieldContext()\n\n return (\n <InputMaskComponent\n {...props}\n {...(mask ? { ...inputMask(mask) } : customMask && { ...customMask })}\n className={value({ className, state })}\n disabled={state === 'disabled'}\n placeholder={variant === 'filter' ? ' ' : placeholder}\n readOnly={state === 'disabled'}\n />\n )\n}\n\nexport function InputText({\n className,\n placeholder,\n ...props\n}: ComponentProps<'input'>) {\n const { state, variant } = useFieldContext()\n\n return (\n <input\n {...props}\n className={value({ className, state })}\n disabled={state === 'disabled'}\n placeholder={variant === 'filter' ? ' ' : placeholder}\n readOnly={state === 'disabled'}\n />\n )\n}\n\nexport function InputNumber({\n className,\n locales = 'pt-BR',\n placeholder,\n groupDisplay = false,\n ...props\n}: InputNumberFormatProps) {\n const { state, variant } = useFieldContext()\n\n return (\n <InputNumberFormat\n {...props}\n className={value({ className, state })}\n disabled={state === 'disabled'}\n groupDisplay={groupDisplay}\n locales={locales}\n placeholder={variant === 'filter' ? ' ' : placeholder}\n readOnly={state === 'disabled'}\n />\n )\n}\n\nexport function InputIcon({\n className,\n name,\n ...props\n}: ComponentProps<'div'> & {\n name: IconType\n}) {\n const { state } = useFieldContext()\n\n return (\n <div className={icon({ className, state })} {...props}>\n <Icon name={name} />\n </div>\n )\n}\n\nexport function InputSlot({ className, ...props }: ComponentProps<'span'>) {\n const { state } = useFieldContext()\n return <span className={slotText({ className, state })} {...props} />\n}\n\nexport function InputCaption({ className, ...props }: ComponentProps<'p'>) {\n const { state } = useFieldContext()\n return <p className={caption({ className, state })} {...props} />\n}\n\nexport function InputAction({ className, ...props }: ComponentProps<'div'>) {\n const { state } = useFieldContext()\n return (\n <div\n className={action({ className, state })}\n data-slot=\"input-action-slot\"\n {...props}\n />\n )\n}\n\nexport function InputNumericStepper({\n handleIncrement,\n handleDecrement\n}: {\n handleIncrement: () => void\n handleDecrement: () => void\n}) {\n return (\n <InputAction className=\"w-large-4x border-border-layer-2 rounded-r-small-1x bg-layer-2-hover flex flex-col items-center justify-center border\">\n <button\n className=\"flex h-1/2 items-center justify-center\"\n type=\"button\"\n onClick={handleIncrement}\n >\n <Icon className=\"text-icon-neutral-3\" name=\"keyboard_arrow_up\" />\n </button>\n\n <Divider />\n\n <button\n className=\"flex h-1/2 items-center justify-center\"\n type=\"button\"\n onClick={handleDecrement}\n >\n <Icon className=\"text-icon-neutral-3\" name=\"keyboard_arrow_down\" />\n </button>\n </InputAction>\n )\n}\n"]}